@versini/sassysaint 8.61.0 → 8.61.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AboutChangelog.khIO6IQv.js → AboutChangelog.DWmZpJSX.js} +2 -2
- package/dist/chunks/{AboutEntry.C8vztscz.js → AboutEntry.DmZe57qx.js} +7 -7
- package/dist/chunks/{App.BrPp8T2f.js → App.B1QyQK7k.js} +706 -695
- package/dist/chunks/{Chart.-OJvZ1z-.js → Chart.C-juS_F8.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.R0psov42.js → ChatBubbleAssistant.9M5ZLVQq.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.Cyfsx64P.js → ChatBubbleUser.jeCCU-N6.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.CyvWYwYT.js → ChatHistoryTable.BjwC_0r4.js} +3 -3
- package/dist/chunks/{HistoryEntry.COlV18V9.js → HistoryEntry.oh23W-Mc.js} +3 -3
- package/dist/chunks/{ProfileEntry.Cz0cXlvu.js → ProfileEntry.C_2DJQt9.js} +2 -2
- package/dist/chunks/{SettingsEntry.DlOg852u.js → SettingsEntry.HgvcJ9LW.js} +3 -3
- package/dist/chunks/{Table.lgFnJD0P.js → Table.CzXZSGZ3.js} +2 -2
- package/dist/chunks/{UsageEntry.DqdOT7Fq.js → UsageEntry.Cheb49JV.js} +3 -3
- package/dist/chunks/{UserMemoriesPanel.oDlcY89z.js → UserMemoriesPanel.iRR7Hyuo.js} +3 -3
- package/dist/chunks/{index.DPie0Opm.js → index.B2bikqFg.js} +1 -1
- package/dist/chunks/{index.BPgNgE6z.js → index.BxHljC9m.js} +3 -3
- package/dist/chunks/{index.B-qS2v_F.js → index.CDCPARyL.js} +1 -1
- package/dist/chunks/{index.D0NeHQ_Z.js → index.DkQzq-rg.js} +119 -111
- package/dist/chunks/{index.UrB_uFIS.js → index.DtZwl5C5.js} +1 -1
- package/dist/chunks/{index.KT85y0Xl.js → index.FYHmj2Xw.js} +1 -1
- package/dist/chunks/{index.B73h5HsZ.js → index.N4EJ1e2I.js} +2 -2
- package/dist/chunks/{useMarkdown.DCsDrRoY.js → useMarkdown.Bo_Se5Gb.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as l, jsxs as x, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
-
import { I as G, ACTION_SORT as Xa, ACTION_SEARCH as Qa, ACTION_RESET_PROMPT as eo, ACTION_TOGGLE_PROMPT as to, oe as Ka, te as ve, DEFAULT_ICON_ACTION_SIZE as
|
|
2
|
+
import { I as G, ACTION_SORT as Xa, ACTION_SEARCH as Qa, ACTION_RESET_PROMPT as eo, ACTION_TOGGLE_PROMPT as to, oe as Ka, te as ve, DEFAULT_ICON_ACTION_SIZE as Ie, isTauri as Bt, n as ye, useUserPreferences as Ze, isProbablyiPhone as Ae, serverUrl as ro, useEntitlements as es, L as wr, j as Qe, C as Kr, LOCAL_STORAGE_PREFIX as Ke, LOCAL_STORAGE_PRIVATE_DISCLOSURE as ts, Pe as jt, LOCAL_STORAGE_REASONING_DISCLOSURE as rs, useChatsHistory as no, mutateCall as ns, SERVICE_TYPES as os, TOAST_CHAT_SAVED as as, PROMPT_CLASSNAME as ss, PROMPT_EDITABLE_AREA_CLASSNAME as is, i as cs, ERROR_MESSAGE as ls, c as ht, CLIPBOARD_PROMPT as en, INPUT_PLACEHOLDER_TEXT_MOBILE as tn, INPUT_PLACEHOLDER_TEXT_ENTER as rn, INPUT_PLACEHOLDER_TEXT_CMD_ENTER as nn, isProbablyMobile as Ir, ue as us, FOOTER_DISCLAIMERS as on, h as oo, isProbablyiPad as ds, INPUT_BOTTOM_OFFSET_EXTRA as an, INPUT_BOTTOM_OFFSET_IPHONE as ps, INPUT_BOTTOM_OFFSET_IPAD as ms, INPUT_BOTTOM_OFFSET as ao, getLayoutPaddingClass as Er, i$1 as hs, E as fs, y as gs, setNewProvider as vs, TOAST_PROVIDER_CHANGED as ys, LOG_OUT as sn, a as so, ne as cn, useServerCapabilities as _s, getMessageContaintWrapperClass as bs, UI_FOOTER_BUFFER as io, UI_BUTTON_SCROLL_BUFFER as ws, Logo as Is, UI_DEFAULT_MAIN_HEIGHT as ln, isPWAMode as Es, UI_DEFAULT_MAIN_HEIGHT_IPHONE as Ts, APP_CLASSNAME as Ss, le as un, pe as xs, LOCAL_STORAGE_SORT as ks, LOCAL_STORAGE_SEARCH as Cs, LOCAL_STORAGE_SORT_TIMESTAMP as Ns, LOCAL_STORAGE_SORT_TOKEN_USAGE as zs, TOAST_CACHE_ENABLED as As, TOAST_CACHE_DISABLED as Os } from "./index.DkQzq-rg.js";
|
|
3
3
|
import * as ae from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import st, { useRef as J, useEffect as $, useState as P, useCallback as B, useSyncExternalStore as Pt, createContext as Ms, useContext as te, useId as co, forwardRef as lo, useMemo as nt, Suspense as Vt, lazy as Te, useReducer as xt, useLayoutEffect as $s } from "react";
|
|
5
|
+
import M from "clsx";
|
|
6
6
|
import { computePosition as Ps, offset as uo, flip as po, shift as mo, arrow as Rs, useMergeRefs as $r, FloatingPortal as ho, FloatingOverlay as Zs, FloatingFocusManager as fo, useFloating as go, useClick as vo, useDismiss as yo, useRole as _o, useInteractions as bo, FloatingTree as Ds, useFloatingTree as wo, useFloatingNodeId as Ls, useListItem as Io, autoUpdate as Us, useListNavigation as Bs, useTypeahead as js, FloatingNode as Vs, FloatingList as Fs } from "@floating-ui/react";
|
|
7
7
|
const dn = ["mousedown", "touchstart"];
|
|
8
8
|
function Hs(e, t, r) {
|
|
9
9
|
const n = J(null);
|
|
10
|
-
return
|
|
10
|
+
return $(() => {
|
|
11
11
|
const o = (a) => {
|
|
12
12
|
const i = a ? a.target : void 0;
|
|
13
13
|
if (Array.isArray(r)) {
|
|
@@ -65,7 +65,7 @@ function qs(e, t, r = !1) {
|
|
|
65
65
|
return e.target instanceof HTMLElement ? (r || !e.target.isContentEditable) && !t.includes(e.target.tagName) : !0;
|
|
66
66
|
}
|
|
67
67
|
function Pr(e, t = ["INPUT", "TEXTAREA", "SELECT"], r = !1) {
|
|
68
|
-
|
|
68
|
+
$(() => {
|
|
69
69
|
const n = (o) => {
|
|
70
70
|
e.forEach(
|
|
71
71
|
([a, i, s = { preventDefault: !0 }]) => {
|
|
@@ -77,15 +77,15 @@ function Pr(e, t = ["INPUT", "TEXTAREA", "SELECT"], r = !1) {
|
|
|
77
77
|
}, [e, t, r]);
|
|
78
78
|
}
|
|
79
79
|
function Ys(e, t) {
|
|
80
|
-
const [r, n] =
|
|
80
|
+
const [r, n] = P(!1), o = J(null), a = J(null), i = B(() => {
|
|
81
81
|
n((u) => (!u && (!o.current || o.current === -1) && (o.current = window.setInterval(a.current, t)), !0));
|
|
82
82
|
}, [t]), s = B(() => {
|
|
83
83
|
n(!1), window.clearInterval(o.current || -1), o.current = -1;
|
|
84
84
|
}, []);
|
|
85
|
-
return
|
|
85
|
+
return $(() => (a.current = e, r && i(), s), [e, r, i, s]), { start: i, stop: s, active: r };
|
|
86
86
|
}
|
|
87
87
|
function Xs() {
|
|
88
|
-
const e = J(null), [t, r] =
|
|
88
|
+
const e = J(null), [t, r] = P(!1);
|
|
89
89
|
return { ref: B((n) => {
|
|
90
90
|
typeof IntersectionObserver < "u" && (n && !e.current ? e.current = new IntersectionObserver(
|
|
91
91
|
(o) => r(o.some((a) => a.isIntersecting))
|
|
@@ -103,7 +103,7 @@ const pn = (e, t) => {
|
|
|
103
103
|
}, Qs = (e) => {
|
|
104
104
|
window.localStorage.removeItem(e), To(e, null);
|
|
105
105
|
}, mn = (e) => window.localStorage.getItem(e), Ks = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
106
|
-
function
|
|
106
|
+
function et({
|
|
107
107
|
key: e,
|
|
108
108
|
initialValue: t
|
|
109
109
|
}) {
|
|
@@ -122,7 +122,7 @@ function Ke({
|
|
|
122
122
|
}, [t, n]), a = B(() => {
|
|
123
123
|
n(null);
|
|
124
124
|
}, [n]);
|
|
125
|
-
return
|
|
125
|
+
return $(() => {
|
|
126
126
|
try {
|
|
127
127
|
mn(e) === null && typeof t < "u" && pn(e, t);
|
|
128
128
|
} catch (i) {
|
|
@@ -131,12 +131,12 @@ function Ke({
|
|
|
131
131
|
}, [e, t]), [r ? JSON.parse(r) : null, n, o, a];
|
|
132
132
|
}
|
|
133
133
|
function hn(e, t) {
|
|
134
|
-
|
|
134
|
+
$(() => (window.addEventListener(e, t, {
|
|
135
135
|
passive: !0
|
|
136
136
|
}), () => window.removeEventListener(e, t)), [e, t]);
|
|
137
137
|
}
|
|
138
138
|
function ei() {
|
|
139
|
-
const [e, t] =
|
|
139
|
+
const [e, t] = P({
|
|
140
140
|
width: 0,
|
|
141
141
|
height: 0
|
|
142
142
|
}), r = B(() => {
|
|
@@ -145,10 +145,10 @@ function ei() {
|
|
|
145
145
|
height: window.innerHeight || 0
|
|
146
146
|
});
|
|
147
147
|
}, []);
|
|
148
|
-
return hn("resize", r), hn("orientationchange", r),
|
|
148
|
+
return hn("resize", r), hn("orientationchange", r), $(r, []), e;
|
|
149
149
|
}
|
|
150
150
|
function ti() {
|
|
151
|
-
const [e, t] =
|
|
151
|
+
const [e, t] = P({
|
|
152
152
|
width: 0,
|
|
153
153
|
height: 0
|
|
154
154
|
}), r = B(() => {
|
|
@@ -157,7 +157,7 @@ function ti() {
|
|
|
157
157
|
height: window?.visualViewport?.height || window.innerHeight || 0
|
|
158
158
|
});
|
|
159
159
|
}, []);
|
|
160
|
-
return
|
|
160
|
+
return $(() => (r(), window.visualViewport && (window.visualViewport.addEventListener("resize", r, {
|
|
161
161
|
passive: !0
|
|
162
162
|
}), window.visualViewport.addEventListener("orientationchange", r, {
|
|
163
163
|
passive: !0
|
|
@@ -732,7 +732,7 @@ const ri = ({
|
|
|
732
732
|
/* @__PURE__ */ l("path", { d: "M224 32c-53 0-96 43-96 96v64h240c44.2 0 80 35.8 80 80v160c0 44.2-35.8 80-80 80H80c-44.2 0-80-35.8-80-80V272c0-44.2 35.8-80 80-80h16v-64C96 57.3 153.3 0 224 0c58 0 107 38.6 122.7 91.4 2.5 8.5-2.3 17.4-10.8 19.9s-17.4-2.3-19.9-10.8C304.2 60.9 267.5 32 224 32M80 224c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm184 144h-80c-8.8 0-16-7.2-16-16s7.2-16 16-16h80c8.8 0 16 7.2 16 16s-7.2 16-16 16" })
|
|
733
733
|
]
|
|
734
734
|
}
|
|
735
|
-
),
|
|
735
|
+
), ot = {
|
|
736
736
|
ASC: "asc",
|
|
737
737
|
DESC: "desc"
|
|
738
738
|
};
|
|
@@ -856,10 +856,10 @@ function Mi(e) {
|
|
|
856
856
|
const { onEvent: t = ur, onError: r = ur, onRetry: n = ur, onComment: o } = e;
|
|
857
857
|
let a = "", i = !0, s, u = "", c = "";
|
|
858
858
|
function p(h) {
|
|
859
|
-
const v = i ? h.replace(/^\xEF\xBB\xBF/, "") : h, [I,
|
|
859
|
+
const v = i ? h.replace(/^\xEF\xBB\xBF/, "") : h, [I, y] = $i(`${a}${v}`);
|
|
860
860
|
for (const E of I)
|
|
861
861
|
d(E);
|
|
862
|
-
a =
|
|
862
|
+
a = y, i = !1;
|
|
863
863
|
}
|
|
864
864
|
function d(h) {
|
|
865
865
|
if (h === "") {
|
|
@@ -872,7 +872,7 @@ function Mi(e) {
|
|
|
872
872
|
}
|
|
873
873
|
const v = h.indexOf(":");
|
|
874
874
|
if (v !== -1) {
|
|
875
|
-
const I = h.slice(0, v),
|
|
875
|
+
const I = h.slice(0, v), y = h[v + 1] === " " ? 2 : 1, E = h.slice(v + y);
|
|
876
876
|
f(I, E, h);
|
|
877
877
|
return;
|
|
878
878
|
}
|
|
@@ -964,7 +964,7 @@ class Pi extends TransformStream {
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function _(e, t, r) {
|
|
968
968
|
function n(s, u) {
|
|
969
969
|
var c;
|
|
970
970
|
Object.defineProperty(s, "_zod", {
|
|
@@ -991,7 +991,7 @@ function y(e, t, r) {
|
|
|
991
991
|
value: (s) => r?.Parent && s instanceof r.Parent ? !0 : s?._zod?.traits?.has(e)
|
|
992
992
|
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
993
993
|
}
|
|
994
|
-
class
|
|
994
|
+
class ft extends Error {
|
|
995
995
|
constructor() {
|
|
996
996
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
997
997
|
}
|
|
@@ -1053,7 +1053,7 @@ function bt(e, t, r) {
|
|
|
1053
1053
|
configurable: !0
|
|
1054
1054
|
});
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function it(e) {
|
|
1057
1057
|
return JSON.stringify(e);
|
|
1058
1058
|
}
|
|
1059
1059
|
const Uo = Error.captureStackTrace ? Error.captureStackTrace : (...e) => {
|
|
@@ -1084,7 +1084,7 @@ const Li = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
|
1084
1084
|
function wt(e) {
|
|
1085
1085
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function Ve(e, t, r) {
|
|
1088
1088
|
const n = new e._zod.constr(t ?? e._zod.def);
|
|
1089
1089
|
return (!t || r?.parent) && (n._zod.parent = e), n;
|
|
1090
1090
|
}
|
|
@@ -1118,7 +1118,7 @@ function ji(e, t) {
|
|
|
1118
1118
|
throw new Error(`Unrecognized key: "${o}"`);
|
|
1119
1119
|
t[o] && (r[o] = n.shape[o]);
|
|
1120
1120
|
}
|
|
1121
|
-
return
|
|
1121
|
+
return Ve(e, {
|
|
1122
1122
|
...e._zod.def,
|
|
1123
1123
|
shape: r,
|
|
1124
1124
|
checks: []
|
|
@@ -1131,7 +1131,7 @@ function Vi(e, t) {
|
|
|
1131
1131
|
throw new Error(`Unrecognized key: "${o}"`);
|
|
1132
1132
|
t[o] && delete r[o];
|
|
1133
1133
|
}
|
|
1134
|
-
return
|
|
1134
|
+
return Ve(e, {
|
|
1135
1135
|
...e._zod.def,
|
|
1136
1136
|
shape: r,
|
|
1137
1137
|
checks: []
|
|
@@ -1149,10 +1149,10 @@ function Fi(e, t) {
|
|
|
1149
1149
|
checks: []
|
|
1150
1150
|
// delete existing checks
|
|
1151
1151
|
};
|
|
1152
|
-
return
|
|
1152
|
+
return Ve(e, r);
|
|
1153
1153
|
}
|
|
1154
1154
|
function Hi(e, t) {
|
|
1155
|
-
return
|
|
1155
|
+
return Ve(e, {
|
|
1156
1156
|
...e._zod.def,
|
|
1157
1157
|
get shape() {
|
|
1158
1158
|
const r = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
@@ -1180,7 +1180,7 @@ function Ji(e, t, r) {
|
|
|
1180
1180
|
type: "optional",
|
|
1181
1181
|
innerType: n[a]
|
|
1182
1182
|
}) : n[a];
|
|
1183
|
-
return
|
|
1183
|
+
return Ve(t, {
|
|
1184
1184
|
...t._zod.def,
|
|
1185
1185
|
shape: o,
|
|
1186
1186
|
checks: []
|
|
@@ -1203,20 +1203,20 @@ function Gi(e, t, r) {
|
|
|
1203
1203
|
type: "nonoptional",
|
|
1204
1204
|
innerType: n[a]
|
|
1205
1205
|
});
|
|
1206
|
-
return
|
|
1206
|
+
return Ve(t, {
|
|
1207
1207
|
...t._zod.def,
|
|
1208
1208
|
shape: o,
|
|
1209
1209
|
// optional: [],
|
|
1210
1210
|
checks: []
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function pt(e, t = 0) {
|
|
1214
1214
|
for (let r = t; r < e.issues.length; r++)
|
|
1215
1215
|
if (e.issues[r]?.continue !== !0)
|
|
1216
1216
|
return !0;
|
|
1217
1217
|
return !1;
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function Be(e, t) {
|
|
1220
1220
|
return t.map((r) => {
|
|
1221
1221
|
var n;
|
|
1222
1222
|
return (n = r).path ?? (n.path = []), r.path.unshift(e), r;
|
|
@@ -1236,7 +1236,7 @@ function Pe(e, t, r) {
|
|
|
1236
1236
|
function Lr(e) {
|
|
1237
1237
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function gt(...e) {
|
|
1240
1240
|
const [t, r, n] = e;
|
|
1241
1241
|
return typeof t == "string" ? {
|
|
1242
1242
|
message: t,
|
|
@@ -1262,7 +1262,7 @@ const Bo = (e, t) => {
|
|
|
1262
1262
|
value: () => e.message,
|
|
1263
1263
|
enumerable: !1
|
|
1264
1264
|
});
|
|
1265
|
-
}, jo =
|
|
1265
|
+
}, jo = _("$ZodError", Bo), Vo = _("$ZodError", Bo, { Parent: Error });
|
|
1266
1266
|
function Wi(e, t = (r) => r.message) {
|
|
1267
1267
|
const r = {}, n = [];
|
|
1268
1268
|
for (const o of e.issues)
|
|
@@ -1295,7 +1295,7 @@ function qi(e, t) {
|
|
|
1295
1295
|
const Yi = (e) => (t, r, n, o) => {
|
|
1296
1296
|
const a = n ? Object.assign(n, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: r, issues: [] }, a);
|
|
1297
1297
|
if (i instanceof Promise)
|
|
1298
|
-
throw new
|
|
1298
|
+
throw new ft();
|
|
1299
1299
|
if (i.issues.length) {
|
|
1300
1300
|
const s = new (o?.Err ?? e)(i.issues.map((u) => Pe(u, a, $e())));
|
|
1301
1301
|
throw Uo(s, o?.callee), s;
|
|
@@ -1312,7 +1312,7 @@ const Yi = (e) => (t, r, n, o) => {
|
|
|
1312
1312
|
}, Fo = (e) => (t, r, n) => {
|
|
1313
1313
|
const o = n ? { ...n, async: !1 } : { async: !1 }, a = t._zod.run({ value: r, issues: [] }, o);
|
|
1314
1314
|
if (a instanceof Promise)
|
|
1315
|
-
throw new
|
|
1315
|
+
throw new ft();
|
|
1316
1316
|
return a.issues.length ? {
|
|
1317
1317
|
success: !1,
|
|
1318
1318
|
error: new (e ?? jo)(a.issues.map((i) => Pe(i, o, $e())))
|
|
@@ -1345,14 +1345,14 @@ function bc(e) {
|
|
|
1345
1345
|
const wc = (e) => {
|
|
1346
1346
|
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
1347
1347
|
return new RegExp(`^${t}$`);
|
|
1348
|
-
}, Ic = /^\d+$/, Ec = /^-?\d+(?:\.\d+)?/i, Tc = /true|false/i, Sc = /null/i, xc = /^[^A-Z]*$/, kc = /^[^a-z]*$/, ue = /* @__PURE__ */
|
|
1348
|
+
}, Ic = /^\d+$/, Ec = /^-?\d+(?:\.\d+)?/i, Tc = /true|false/i, Sc = /null/i, xc = /^[^A-Z]*$/, kc = /^[^a-z]*$/, ue = /* @__PURE__ */ _("$ZodCheck", (e, t) => {
|
|
1349
1349
|
var r;
|
|
1350
1350
|
e._zod ?? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ?? (r.onattach = []);
|
|
1351
1351
|
}), qo = {
|
|
1352
1352
|
number: "number",
|
|
1353
1353
|
bigint: "bigint",
|
|
1354
1354
|
object: "date"
|
|
1355
|
-
}, Yo = /* @__PURE__ */
|
|
1355
|
+
}, Yo = /* @__PURE__ */ _("$ZodCheckLessThan", (e, t) => {
|
|
1356
1356
|
ue.init(e, t);
|
|
1357
1357
|
const r = qo[typeof t.value];
|
|
1358
1358
|
e._zod.onattach.push((n) => {
|
|
@@ -1369,7 +1369,7 @@ const wc = (e) => {
|
|
|
1369
1369
|
continue: !t.abort
|
|
1370
1370
|
});
|
|
1371
1371
|
};
|
|
1372
|
-
}), Xo = /* @__PURE__ */
|
|
1372
|
+
}), Xo = /* @__PURE__ */ _("$ZodCheckGreaterThan", (e, t) => {
|
|
1373
1373
|
ue.init(e, t);
|
|
1374
1374
|
const r = qo[typeof t.value];
|
|
1375
1375
|
e._zod.onattach.push((n) => {
|
|
@@ -1386,7 +1386,7 @@ const wc = (e) => {
|
|
|
1386
1386
|
continue: !t.abort
|
|
1387
1387
|
});
|
|
1388
1388
|
};
|
|
1389
|
-
}), Cc = /* @__PURE__ */
|
|
1389
|
+
}), Cc = /* @__PURE__ */ _("$ZodCheckMultipleOf", (e, t) => {
|
|
1390
1390
|
ue.init(e, t), e._zod.onattach.push((r) => {
|
|
1391
1391
|
var n;
|
|
1392
1392
|
(n = r._zod.bag).multipleOf ?? (n.multipleOf = t.value);
|
|
@@ -1402,7 +1402,7 @@ const wc = (e) => {
|
|
|
1402
1402
|
continue: !t.abort
|
|
1403
1403
|
});
|
|
1404
1404
|
};
|
|
1405
|
-
}), Nc = /* @__PURE__ */
|
|
1405
|
+
}), Nc = /* @__PURE__ */ _("$ZodCheckNumberFormat", (e, t) => {
|
|
1406
1406
|
ue.init(e, t), t.format = t.format || "float64";
|
|
1407
1407
|
const r = t.format?.includes("int"), n = r ? "int" : "number", [o, a] = Bi[t.format];
|
|
1408
1408
|
e._zod.onattach.push((i) => {
|
|
@@ -1458,7 +1458,7 @@ const wc = (e) => {
|
|
|
1458
1458
|
inst: e
|
|
1459
1459
|
});
|
|
1460
1460
|
};
|
|
1461
|
-
}), zc = /* @__PURE__ */
|
|
1461
|
+
}), zc = /* @__PURE__ */ _("$ZodCheckMaxLength", (e, t) => {
|
|
1462
1462
|
var r;
|
|
1463
1463
|
ue.init(e, t), (r = e._zod.def).when ?? (r.when = (n) => {
|
|
1464
1464
|
const o = n.value;
|
|
@@ -1481,7 +1481,7 @@ const wc = (e) => {
|
|
|
1481
1481
|
continue: !t.abort
|
|
1482
1482
|
});
|
|
1483
1483
|
};
|
|
1484
|
-
}), Ac = /* @__PURE__ */
|
|
1484
|
+
}), Ac = /* @__PURE__ */ _("$ZodCheckMinLength", (e, t) => {
|
|
1485
1485
|
var r;
|
|
1486
1486
|
ue.init(e, t), (r = e._zod.def).when ?? (r.when = (n) => {
|
|
1487
1487
|
const o = n.value;
|
|
@@ -1504,7 +1504,7 @@ const wc = (e) => {
|
|
|
1504
1504
|
continue: !t.abort
|
|
1505
1505
|
});
|
|
1506
1506
|
};
|
|
1507
|
-
}), Oc = /* @__PURE__ */
|
|
1507
|
+
}), Oc = /* @__PURE__ */ _("$ZodCheckLengthEquals", (e, t) => {
|
|
1508
1508
|
var r;
|
|
1509
1509
|
ue.init(e, t), (r = e._zod.def).when ?? (r.when = (n) => {
|
|
1510
1510
|
const o = n.value;
|
|
@@ -1527,7 +1527,7 @@ const wc = (e) => {
|
|
|
1527
1527
|
continue: !t.abort
|
|
1528
1528
|
});
|
|
1529
1529
|
};
|
|
1530
|
-
}), er = /* @__PURE__ */
|
|
1530
|
+
}), er = /* @__PURE__ */ _("$ZodCheckStringFormat", (e, t) => {
|
|
1531
1531
|
var r, n;
|
|
1532
1532
|
ue.init(e, t), e._zod.onattach.push((o) => {
|
|
1533
1533
|
const a = o._zod.bag;
|
|
@@ -1544,7 +1544,7 @@ const wc = (e) => {
|
|
|
1544
1544
|
});
|
|
1545
1545
|
}) : (n = e._zod).check ?? (n.check = () => {
|
|
1546
1546
|
});
|
|
1547
|
-
}), Mc = /* @__PURE__ */
|
|
1547
|
+
}), Mc = /* @__PURE__ */ _("$ZodCheckRegex", (e, t) => {
|
|
1548
1548
|
er.init(e, t), e._zod.check = (r) => {
|
|
1549
1549
|
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
1550
1550
|
origin: "string",
|
|
@@ -1556,11 +1556,11 @@ const wc = (e) => {
|
|
|
1556
1556
|
continue: !t.abort
|
|
1557
1557
|
});
|
|
1558
1558
|
};
|
|
1559
|
-
}), $c = /* @__PURE__ */
|
|
1559
|
+
}), $c = /* @__PURE__ */ _("$ZodCheckLowerCase", (e, t) => {
|
|
1560
1560
|
t.pattern ?? (t.pattern = xc), er.init(e, t);
|
|
1561
|
-
}), Pc = /* @__PURE__ */
|
|
1561
|
+
}), Pc = /* @__PURE__ */ _("$ZodCheckUpperCase", (e, t) => {
|
|
1562
1562
|
t.pattern ?? (t.pattern = kc), er.init(e, t);
|
|
1563
|
-
}), Rc = /* @__PURE__ */
|
|
1563
|
+
}), Rc = /* @__PURE__ */ _("$ZodCheckIncludes", (e, t) => {
|
|
1564
1564
|
ue.init(e, t);
|
|
1565
1565
|
const r = wt(t.includes), n = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${r}` : r);
|
|
1566
1566
|
t.pattern = n, e._zod.onattach.push((o) => {
|
|
@@ -1577,7 +1577,7 @@ const wc = (e) => {
|
|
|
1577
1577
|
continue: !t.abort
|
|
1578
1578
|
});
|
|
1579
1579
|
};
|
|
1580
|
-
}), Zc = /* @__PURE__ */
|
|
1580
|
+
}), Zc = /* @__PURE__ */ _("$ZodCheckStartsWith", (e, t) => {
|
|
1581
1581
|
ue.init(e, t);
|
|
1582
1582
|
const r = new RegExp(`^${wt(t.prefix)}.*`);
|
|
1583
1583
|
t.pattern ?? (t.pattern = r), e._zod.onattach.push((n) => {
|
|
@@ -1594,7 +1594,7 @@ const wc = (e) => {
|
|
|
1594
1594
|
continue: !t.abort
|
|
1595
1595
|
});
|
|
1596
1596
|
};
|
|
1597
|
-
}), Dc = /* @__PURE__ */
|
|
1597
|
+
}), Dc = /* @__PURE__ */ _("$ZodCheckEndsWith", (e, t) => {
|
|
1598
1598
|
ue.init(e, t);
|
|
1599
1599
|
const r = new RegExp(`.*${wt(t.suffix)}$`);
|
|
1600
1600
|
t.pattern ?? (t.pattern = r), e._zod.onattach.push((n) => {
|
|
@@ -1611,7 +1611,7 @@ const wc = (e) => {
|
|
|
1611
1611
|
continue: !t.abort
|
|
1612
1612
|
});
|
|
1613
1613
|
};
|
|
1614
|
-
}), Lc = /* @__PURE__ */
|
|
1614
|
+
}), Lc = /* @__PURE__ */ _("$ZodCheckOverwrite", (e, t) => {
|
|
1615
1615
|
ue.init(e, t), e._zod.check = (r) => {
|
|
1616
1616
|
r.value = t.tx(r.value);
|
|
1617
1617
|
};
|
|
@@ -1643,7 +1643,7 @@ const Bc = {
|
|
|
1643
1643
|
major: 4,
|
|
1644
1644
|
minor: 0,
|
|
1645
1645
|
patch: 0
|
|
1646
|
-
}, j = /* @__PURE__ */
|
|
1646
|
+
}, j = /* @__PURE__ */ _("$ZodType", (e, t) => {
|
|
1647
1647
|
var r;
|
|
1648
1648
|
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Bc;
|
|
1649
1649
|
const n = [...e._zod.def.checks ?? []];
|
|
@@ -1657,7 +1657,7 @@ const Bc = {
|
|
|
1657
1657
|
});
|
|
1658
1658
|
else {
|
|
1659
1659
|
const o = (a, i, s) => {
|
|
1660
|
-
let u =
|
|
1660
|
+
let u = pt(a), c;
|
|
1661
1661
|
for (const p of i) {
|
|
1662
1662
|
if (p._zod.def.when) {
|
|
1663
1663
|
if (!p._zod.def.when(a))
|
|
@@ -1666,15 +1666,15 @@ const Bc = {
|
|
|
1666
1666
|
continue;
|
|
1667
1667
|
const d = a.issues.length, f = p._zod.check(a);
|
|
1668
1668
|
if (f instanceof Promise && s?.async === !1)
|
|
1669
|
-
throw new
|
|
1669
|
+
throw new ft();
|
|
1670
1670
|
if (c || f instanceof Promise)
|
|
1671
1671
|
c = (c ?? Promise.resolve()).then(async () => {
|
|
1672
|
-
await f, a.issues.length !== d && (u || (u =
|
|
1672
|
+
await f, a.issues.length !== d && (u || (u = pt(a, d)));
|
|
1673
1673
|
});
|
|
1674
1674
|
else {
|
|
1675
1675
|
if (a.issues.length === d)
|
|
1676
1676
|
continue;
|
|
1677
|
-
u || (u =
|
|
1677
|
+
u || (u = pt(a, d));
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
1680
|
return c ? c.then(() => a) : a;
|
|
@@ -1683,7 +1683,7 @@ const Bc = {
|
|
|
1683
1683
|
const s = e._zod.parse(a, i);
|
|
1684
1684
|
if (s instanceof Promise) {
|
|
1685
1685
|
if (i.async === !1)
|
|
1686
|
-
throw new
|
|
1686
|
+
throw new ft();
|
|
1687
1687
|
return s.then((u) => o(u, n, i));
|
|
1688
1688
|
}
|
|
1689
1689
|
return o(s, n, i);
|
|
@@ -1701,7 +1701,7 @@ const Bc = {
|
|
|
1701
1701
|
vendor: "zod",
|
|
1702
1702
|
version: 1
|
|
1703
1703
|
};
|
|
1704
|
-
}), Ur = /* @__PURE__ */
|
|
1704
|
+
}), Ur = /* @__PURE__ */ _("$ZodString", (e, t) => {
|
|
1705
1705
|
j.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? wc(e._zod.bag), e._zod.parse = (r, n) => {
|
|
1706
1706
|
if (t.coerce)
|
|
1707
1707
|
try {
|
|
@@ -1715,11 +1715,11 @@ const Bc = {
|
|
|
1715
1715
|
inst: e
|
|
1716
1716
|
}), r;
|
|
1717
1717
|
};
|
|
1718
|
-
}), W = /* @__PURE__ */
|
|
1718
|
+
}), W = /* @__PURE__ */ _("$ZodStringFormat", (e, t) => {
|
|
1719
1719
|
er.init(e, t), Ur.init(e, t);
|
|
1720
|
-
}), jc = /* @__PURE__ */
|
|
1720
|
+
}), jc = /* @__PURE__ */ _("$ZodGUID", (e, t) => {
|
|
1721
1721
|
t.pattern ?? (t.pattern = ic), W.init(e, t);
|
|
1722
|
-
}), Vc = /* @__PURE__ */
|
|
1722
|
+
}), Vc = /* @__PURE__ */ _("$ZodUUID", (e, t) => {
|
|
1723
1723
|
if (t.version) {
|
|
1724
1724
|
const n = {
|
|
1725
1725
|
v1: 1,
|
|
@@ -1737,9 +1737,9 @@ const Bc = {
|
|
|
1737
1737
|
} else
|
|
1738
1738
|
t.pattern ?? (t.pattern = vn());
|
|
1739
1739
|
W.init(e, t);
|
|
1740
|
-
}), Fc = /* @__PURE__ */
|
|
1740
|
+
}), Fc = /* @__PURE__ */ _("$ZodEmail", (e, t) => {
|
|
1741
1741
|
t.pattern ?? (t.pattern = cc), W.init(e, t);
|
|
1742
|
-
}), Hc = /* @__PURE__ */
|
|
1742
|
+
}), Hc = /* @__PURE__ */ _("$ZodURL", (e, t) => {
|
|
1743
1743
|
W.init(e, t), e._zod.check = (r) => {
|
|
1744
1744
|
try {
|
|
1745
1745
|
const n = r.value, o = new URL(n), a = o.href;
|
|
@@ -1771,34 +1771,34 @@ const Bc = {
|
|
|
1771
1771
|
});
|
|
1772
1772
|
}
|
|
1773
1773
|
};
|
|
1774
|
-
}), Jc = /* @__PURE__ */
|
|
1774
|
+
}), Jc = /* @__PURE__ */ _("$ZodEmoji", (e, t) => {
|
|
1775
1775
|
t.pattern ?? (t.pattern = uc()), W.init(e, t);
|
|
1776
|
-
}), Gc = /* @__PURE__ */
|
|
1776
|
+
}), Gc = /* @__PURE__ */ _("$ZodNanoID", (e, t) => {
|
|
1777
1777
|
t.pattern ?? (t.pattern = ac), W.init(e, t);
|
|
1778
|
-
}), Wc = /* @__PURE__ */
|
|
1778
|
+
}), Wc = /* @__PURE__ */ _("$ZodCUID", (e, t) => {
|
|
1779
1779
|
t.pattern ?? (t.pattern = ec), W.init(e, t);
|
|
1780
|
-
}), qc = /* @__PURE__ */
|
|
1780
|
+
}), qc = /* @__PURE__ */ _("$ZodCUID2", (e, t) => {
|
|
1781
1781
|
t.pattern ?? (t.pattern = tc), W.init(e, t);
|
|
1782
|
-
}), Yc = /* @__PURE__ */
|
|
1782
|
+
}), Yc = /* @__PURE__ */ _("$ZodULID", (e, t) => {
|
|
1783
1783
|
t.pattern ?? (t.pattern = rc), W.init(e, t);
|
|
1784
|
-
}), Xc = /* @__PURE__ */
|
|
1784
|
+
}), Xc = /* @__PURE__ */ _("$ZodXID", (e, t) => {
|
|
1785
1785
|
t.pattern ?? (t.pattern = nc), W.init(e, t);
|
|
1786
|
-
}), Qc = /* @__PURE__ */
|
|
1786
|
+
}), Qc = /* @__PURE__ */ _("$ZodKSUID", (e, t) => {
|
|
1787
1787
|
t.pattern ?? (t.pattern = oc), W.init(e, t);
|
|
1788
|
-
}), Kc = /* @__PURE__ */
|
|
1788
|
+
}), Kc = /* @__PURE__ */ _("$ZodISODateTime", (e, t) => {
|
|
1789
1789
|
t.pattern ?? (t.pattern = bc(t)), W.init(e, t);
|
|
1790
|
-
}), el = /* @__PURE__ */
|
|
1790
|
+
}), el = /* @__PURE__ */ _("$ZodISODate", (e, t) => {
|
|
1791
1791
|
t.pattern ?? (t.pattern = yc), W.init(e, t);
|
|
1792
|
-
}), tl = /* @__PURE__ */
|
|
1792
|
+
}), tl = /* @__PURE__ */ _("$ZodISOTime", (e, t) => {
|
|
1793
1793
|
t.pattern ?? (t.pattern = _c(t)), W.init(e, t);
|
|
1794
|
-
}), rl = /* @__PURE__ */
|
|
1794
|
+
}), rl = /* @__PURE__ */ _("$ZodISODuration", (e, t) => {
|
|
1795
1795
|
t.pattern ?? (t.pattern = sc), W.init(e, t);
|
|
1796
|
-
}), nl = /* @__PURE__ */
|
|
1796
|
+
}), nl = /* @__PURE__ */ _("$ZodIPv4", (e, t) => {
|
|
1797
1797
|
t.pattern ?? (t.pattern = dc), W.init(e, t), e._zod.onattach.push((r) => {
|
|
1798
1798
|
const n = r._zod.bag;
|
|
1799
1799
|
n.format = "ipv4";
|
|
1800
1800
|
});
|
|
1801
|
-
}), ol = /* @__PURE__ */
|
|
1801
|
+
}), ol = /* @__PURE__ */ _("$ZodIPv6", (e, t) => {
|
|
1802
1802
|
t.pattern ?? (t.pattern = pc), W.init(e, t), e._zod.onattach.push((r) => {
|
|
1803
1803
|
const n = r._zod.bag;
|
|
1804
1804
|
n.format = "ipv6";
|
|
@@ -1815,9 +1815,9 @@ const Bc = {
|
|
|
1815
1815
|
});
|
|
1816
1816
|
}
|
|
1817
1817
|
};
|
|
1818
|
-
}), al = /* @__PURE__ */
|
|
1818
|
+
}), al = /* @__PURE__ */ _("$ZodCIDRv4", (e, t) => {
|
|
1819
1819
|
t.pattern ?? (t.pattern = mc), W.init(e, t);
|
|
1820
|
-
}), sl = /* @__PURE__ */
|
|
1820
|
+
}), sl = /* @__PURE__ */ _("$ZodCIDRv6", (e, t) => {
|
|
1821
1821
|
t.pattern ?? (t.pattern = hc), W.init(e, t), e._zod.check = (r) => {
|
|
1822
1822
|
const [n, o] = r.value.split("/");
|
|
1823
1823
|
try {
|
|
@@ -1851,7 +1851,7 @@ function Qo(e) {
|
|
|
1851
1851
|
return !1;
|
|
1852
1852
|
}
|
|
1853
1853
|
}
|
|
1854
|
-
const il = /* @__PURE__ */
|
|
1854
|
+
const il = /* @__PURE__ */ _("$ZodBase64", (e, t) => {
|
|
1855
1855
|
t.pattern ?? (t.pattern = fc), W.init(e, t), e._zod.onattach.push((r) => {
|
|
1856
1856
|
r._zod.bag.contentEncoding = "base64";
|
|
1857
1857
|
}), e._zod.check = (r) => {
|
|
@@ -1870,7 +1870,7 @@ function cl(e) {
|
|
|
1870
1870
|
const t = e.replace(/[-_]/g, (n) => n === "-" ? "+" : "/"), r = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1871
1871
|
return Qo(r);
|
|
1872
1872
|
}
|
|
1873
|
-
const ll = /* @__PURE__ */
|
|
1873
|
+
const ll = /* @__PURE__ */ _("$ZodBase64URL", (e, t) => {
|
|
1874
1874
|
t.pattern ?? (t.pattern = Jo), W.init(e, t), e._zod.onattach.push((r) => {
|
|
1875
1875
|
r._zod.bag.contentEncoding = "base64url";
|
|
1876
1876
|
}), e._zod.check = (r) => {
|
|
@@ -1882,7 +1882,7 @@ const ll = /* @__PURE__ */ y("$ZodBase64URL", (e, t) => {
|
|
|
1882
1882
|
continue: !t.abort
|
|
1883
1883
|
});
|
|
1884
1884
|
};
|
|
1885
|
-
}), ul = /* @__PURE__ */
|
|
1885
|
+
}), ul = /* @__PURE__ */ _("$ZodE164", (e, t) => {
|
|
1886
1886
|
t.pattern ?? (t.pattern = vc), W.init(e, t);
|
|
1887
1887
|
});
|
|
1888
1888
|
function dl(e, t = null) {
|
|
@@ -1899,7 +1899,7 @@ function dl(e, t = null) {
|
|
|
1899
1899
|
return !1;
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
1902
|
-
const pl = /* @__PURE__ */
|
|
1902
|
+
const pl = /* @__PURE__ */ _("$ZodJWT", (e, t) => {
|
|
1903
1903
|
W.init(e, t), e._zod.check = (r) => {
|
|
1904
1904
|
dl(r.value, t.alg) || r.issues.push({
|
|
1905
1905
|
code: "invalid_format",
|
|
@@ -1909,7 +1909,7 @@ const pl = /* @__PURE__ */ y("$ZodJWT", (e, t) => {
|
|
|
1909
1909
|
continue: !t.abort
|
|
1910
1910
|
});
|
|
1911
1911
|
};
|
|
1912
|
-
}), Ko = /* @__PURE__ */
|
|
1912
|
+
}), Ko = /* @__PURE__ */ _("$ZodNumber", (e, t) => {
|
|
1913
1913
|
j.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Ec, e._zod.parse = (r, n) => {
|
|
1914
1914
|
if (t.coerce)
|
|
1915
1915
|
try {
|
|
@@ -1928,9 +1928,9 @@ const pl = /* @__PURE__ */ y("$ZodJWT", (e, t) => {
|
|
|
1928
1928
|
...a ? { received: a } : {}
|
|
1929
1929
|
}), r;
|
|
1930
1930
|
};
|
|
1931
|
-
}), ml = /* @__PURE__ */
|
|
1931
|
+
}), ml = /* @__PURE__ */ _("$ZodNumber", (e, t) => {
|
|
1932
1932
|
Nc.init(e, t), Ko.init(e, t);
|
|
1933
|
-
}), hl = /* @__PURE__ */
|
|
1933
|
+
}), hl = /* @__PURE__ */ _("$ZodBoolean", (e, t) => {
|
|
1934
1934
|
j.init(e, t), e._zod.pattern = Tc, e._zod.parse = (r, n) => {
|
|
1935
1935
|
if (t.coerce)
|
|
1936
1936
|
try {
|
|
@@ -1945,7 +1945,7 @@ const pl = /* @__PURE__ */ y("$ZodJWT", (e, t) => {
|
|
|
1945
1945
|
inst: e
|
|
1946
1946
|
}), r;
|
|
1947
1947
|
};
|
|
1948
|
-
}), fl = /* @__PURE__ */
|
|
1948
|
+
}), fl = /* @__PURE__ */ _("$ZodNull", (e, t) => {
|
|
1949
1949
|
j.init(e, t), e._zod.pattern = Sc, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (r, n) => {
|
|
1950
1950
|
const o = r.value;
|
|
1951
1951
|
return o === null || r.issues.push({
|
|
@@ -1955,9 +1955,9 @@ const pl = /* @__PURE__ */ y("$ZodJWT", (e, t) => {
|
|
|
1955
1955
|
inst: e
|
|
1956
1956
|
}), r;
|
|
1957
1957
|
};
|
|
1958
|
-
}), gl = /* @__PURE__ */
|
|
1958
|
+
}), gl = /* @__PURE__ */ _("$ZodUnknown", (e, t) => {
|
|
1959
1959
|
j.init(e, t), e._zod.parse = (r) => r;
|
|
1960
|
-
}), vl = /* @__PURE__ */
|
|
1960
|
+
}), vl = /* @__PURE__ */ _("$ZodNever", (e, t) => {
|
|
1961
1961
|
j.init(e, t), e._zod.parse = (r, n) => (r.issues.push({
|
|
1962
1962
|
expected: "never",
|
|
1963
1963
|
code: "invalid_type",
|
|
@@ -1966,9 +1966,9 @@ const pl = /* @__PURE__ */ y("$ZodJWT", (e, t) => {
|
|
|
1966
1966
|
}), r);
|
|
1967
1967
|
});
|
|
1968
1968
|
function yn(e, t, r) {
|
|
1969
|
-
e.issues.length && t.issues.push(...
|
|
1969
|
+
e.issues.length && t.issues.push(...Be(r, e.issues)), t.value[r] = e.value;
|
|
1970
1970
|
}
|
|
1971
|
-
const yl = /* @__PURE__ */
|
|
1971
|
+
const yl = /* @__PURE__ */ _("$ZodArray", (e, t) => {
|
|
1972
1972
|
j.init(e, t), e._zod.parse = (r, n) => {
|
|
1973
1973
|
const o = r.value;
|
|
1974
1974
|
if (!Array.isArray(o))
|
|
@@ -1991,12 +1991,12 @@ const yl = /* @__PURE__ */ y("$ZodArray", (e, t) => {
|
|
|
1991
1991
|
};
|
|
1992
1992
|
});
|
|
1993
1993
|
function Ct(e, t, r) {
|
|
1994
|
-
e.issues.length && t.issues.push(...
|
|
1994
|
+
e.issues.length && t.issues.push(...Be(r, e.issues)), t.value[r] = e.value;
|
|
1995
1995
|
}
|
|
1996
1996
|
function _n(e, t, r, n) {
|
|
1997
|
-
e.issues.length ? n[r] === void 0 ? r in n ? t.value[r] = void 0 : t.value[r] = e.value : t.issues.push(...
|
|
1997
|
+
e.issues.length ? n[r] === void 0 ? r in n ? t.value[r] = void 0 : t.value[r] = e.value : t.issues.push(...Be(r, e.issues)) : e.value === void 0 ? r in n && (t.value[r] = void 0) : t.value[r] = e.value;
|
|
1998
1998
|
}
|
|
1999
|
-
const _l = /* @__PURE__ */
|
|
1999
|
+
const _l = /* @__PURE__ */ _("$ZodObject", (e, t) => {
|
|
2000
2000
|
j.init(e, t);
|
|
2001
2001
|
const r = Rr(() => {
|
|
2002
2002
|
const d = Object.keys(t.shape);
|
|
@@ -2025,21 +2025,21 @@ const _l = /* @__PURE__ */ y("$ZodObject", (e, t) => {
|
|
|
2025
2025
|
return f;
|
|
2026
2026
|
});
|
|
2027
2027
|
const n = (d) => {
|
|
2028
|
-
const f = new Uc(["shape", "payload", "ctx"]), g = r.value, m = (
|
|
2029
|
-
const E =
|
|
2028
|
+
const f = new Uc(["shape", "payload", "ctx"]), g = r.value, m = (y) => {
|
|
2029
|
+
const E = it(y);
|
|
2030
2030
|
return `shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`;
|
|
2031
2031
|
};
|
|
2032
2032
|
f.write("const input = payload.value;");
|
|
2033
2033
|
const h = /* @__PURE__ */ Object.create(null);
|
|
2034
2034
|
let v = 0;
|
|
2035
|
-
for (const
|
|
2036
|
-
h[
|
|
2035
|
+
for (const y of g.keys)
|
|
2036
|
+
h[y] = `key_${v++}`;
|
|
2037
2037
|
f.write("const newResult = {}");
|
|
2038
|
-
for (const
|
|
2039
|
-
if (g.optionalKeys.has(
|
|
2040
|
-
const E = h[
|
|
2041
|
-
f.write(`const ${E} = ${m(
|
|
2042
|
-
const b =
|
|
2038
|
+
for (const y of g.keys)
|
|
2039
|
+
if (g.optionalKeys.has(y)) {
|
|
2040
|
+
const E = h[y];
|
|
2041
|
+
f.write(`const ${E} = ${m(y)};`);
|
|
2042
|
+
const b = it(y);
|
|
2043
2043
|
f.write(`
|
|
2044
2044
|
if (${E}.issues.length) {
|
|
2045
2045
|
if (input[${b}] === undefined) {
|
|
@@ -2061,16 +2061,16 @@ const _l = /* @__PURE__ */ y("$ZodObject", (e, t) => {
|
|
|
2061
2061
|
}
|
|
2062
2062
|
`);
|
|
2063
2063
|
} else {
|
|
2064
|
-
const E = h[
|
|
2065
|
-
f.write(`const ${E} = ${m(
|
|
2064
|
+
const E = h[y];
|
|
2065
|
+
f.write(`const ${E} = ${m(y)};`), f.write(`
|
|
2066
2066
|
if (${E}.issues.length) payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
2067
2067
|
...iss,
|
|
2068
|
-
path: iss.path ? [${
|
|
2069
|
-
})));`), f.write(`newResult[${
|
|
2068
|
+
path: iss.path ? [${it(y)}, ...iss.path] : [${it(y)}]
|
|
2069
|
+
})));`), f.write(`newResult[${it(y)}] = ${E}.value`);
|
|
2070
2070
|
}
|
|
2071
2071
|
f.write("payload.value = newResult;"), f.write("return payload;");
|
|
2072
2072
|
const I = f.compile();
|
|
2073
|
-
return (
|
|
2073
|
+
return (y, E) => I(d, y, E);
|
|
2074
2074
|
};
|
|
2075
2075
|
let o;
|
|
2076
2076
|
const a = Ht, i = !Do.jitless, u = i && Di.value, c = t.catchall;
|
|
@@ -2092,22 +2092,22 @@ const _l = /* @__PURE__ */ y("$ZodObject", (e, t) => {
|
|
|
2092
2092
|
d.value = {};
|
|
2093
2093
|
const E = p.shape;
|
|
2094
2094
|
for (const b of p.keys) {
|
|
2095
|
-
const
|
|
2096
|
-
|
|
2095
|
+
const z = E[b], A = z._zod.run({ value: g[b], issues: [] }, f), k = z._zod.optin === "optional" && z._zod.optout === "optional";
|
|
2096
|
+
A instanceof Promise ? m.push(A.then((O) => k ? _n(O, d, b, g) : Ct(O, d, b))) : k ? _n(A, d, b, g) : Ct(A, d, b);
|
|
2097
2097
|
}
|
|
2098
2098
|
}
|
|
2099
2099
|
if (!c)
|
|
2100
2100
|
return m.length ? Promise.all(m).then(() => d) : d;
|
|
2101
|
-
const h = [], v = p.keySet, I = c._zod,
|
|
2101
|
+
const h = [], v = p.keySet, I = c._zod, y = I.def.type;
|
|
2102
2102
|
for (const E of Object.keys(g)) {
|
|
2103
2103
|
if (v.has(E))
|
|
2104
2104
|
continue;
|
|
2105
|
-
if (
|
|
2105
|
+
if (y === "never") {
|
|
2106
2106
|
h.push(E);
|
|
2107
2107
|
continue;
|
|
2108
2108
|
}
|
|
2109
2109
|
const b = I.run({ value: g[E], issues: [] }, f);
|
|
2110
|
-
b instanceof Promise ? m.push(b.then((
|
|
2110
|
+
b instanceof Promise ? m.push(b.then((z) => Ct(z, d, E))) : Ct(b, d, E);
|
|
2111
2111
|
}
|
|
2112
2112
|
return h.length && d.issues.push({
|
|
2113
2113
|
code: "unrecognized_keys",
|
|
@@ -2128,7 +2128,7 @@ function bn(e, t, r, n) {
|
|
|
2128
2128
|
errors: e.map((o) => o.issues.map((a) => Pe(a, n, $e())))
|
|
2129
2129
|
}), t;
|
|
2130
2130
|
}
|
|
2131
|
-
const ea = /* @__PURE__ */
|
|
2131
|
+
const ea = /* @__PURE__ */ _("$ZodUnion", (e, t) => {
|
|
2132
2132
|
j.init(e, t), Z(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), Z(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), Z(e._zod, "values", () => {
|
|
2133
2133
|
if (t.options.every((r) => r._zod.values))
|
|
2134
2134
|
return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
|
|
@@ -2155,7 +2155,7 @@ const ea = /* @__PURE__ */ y("$ZodUnion", (e, t) => {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
return o ? Promise.all(a).then((i) => bn(i, r, e, n)) : bn(a, r, e, n);
|
|
2157
2157
|
};
|
|
2158
|
-
}), bl = /* @__PURE__ */
|
|
2158
|
+
}), bl = /* @__PURE__ */ _("$ZodDiscriminatedUnion", (e, t) => {
|
|
2159
2159
|
ea.init(e, t);
|
|
2160
2160
|
const r = e._zod.parse;
|
|
2161
2161
|
Z(e._zod, "propValues", () => {
|
|
@@ -2205,7 +2205,7 @@ const ea = /* @__PURE__ */ y("$ZodUnion", (e, t) => {
|
|
|
2205
2205
|
inst: e
|
|
2206
2206
|
}), o);
|
|
2207
2207
|
};
|
|
2208
|
-
}), wl = /* @__PURE__ */
|
|
2208
|
+
}), wl = /* @__PURE__ */ _("$ZodIntersection", (e, t) => {
|
|
2209
2209
|
j.init(e, t), e._zod.parse = (r, n) => {
|
|
2210
2210
|
const o = r.value, a = t.left._zod.run({ value: o, issues: [] }, n), i = t.right._zod.run({ value: o, issues: [] }, n);
|
|
2211
2211
|
return a instanceof Promise || i instanceof Promise ? Promise.all([a, i]).then(([u, c]) => wn(r, u, c)) : wn(r, a, i);
|
|
@@ -2247,14 +2247,14 @@ function Sr(e, t) {
|
|
|
2247
2247
|
return { valid: !1, mergeErrorPath: [] };
|
|
2248
2248
|
}
|
|
2249
2249
|
function wn(e, t, r) {
|
|
2250
|
-
if (t.issues.length && e.issues.push(...t.issues), r.issues.length && e.issues.push(...r.issues),
|
|
2250
|
+
if (t.issues.length && e.issues.push(...t.issues), r.issues.length && e.issues.push(...r.issues), pt(e))
|
|
2251
2251
|
return e;
|
|
2252
2252
|
const n = Sr(t.value, r.value);
|
|
2253
2253
|
if (!n.valid)
|
|
2254
2254
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);
|
|
2255
2255
|
return e.value = n.data, e;
|
|
2256
2256
|
}
|
|
2257
|
-
const Il = /* @__PURE__ */
|
|
2257
|
+
const Il = /* @__PURE__ */ _("$ZodRecord", (e, t) => {
|
|
2258
2258
|
j.init(e, t), e._zod.parse = (r, n) => {
|
|
2259
2259
|
const o = r.value;
|
|
2260
2260
|
if (!Jt(o))
|
|
@@ -2272,8 +2272,8 @@ const Il = /* @__PURE__ */ y("$ZodRecord", (e, t) => {
|
|
|
2272
2272
|
if (typeof u == "string" || typeof u == "number" || typeof u == "symbol") {
|
|
2273
2273
|
const c = t.valueType._zod.run({ value: o[u], issues: [] }, n);
|
|
2274
2274
|
c instanceof Promise ? a.push(c.then((p) => {
|
|
2275
|
-
p.issues.length && r.issues.push(...
|
|
2276
|
-
})) : (c.issues.length && r.issues.push(...
|
|
2275
|
+
p.issues.length && r.issues.push(...Be(u, p.issues)), r.value[u] = p.value;
|
|
2276
|
+
})) : (c.issues.length && r.issues.push(...Be(u, c.issues)), r.value[u] = c.value);
|
|
2277
2277
|
}
|
|
2278
2278
|
let s;
|
|
2279
2279
|
for (const u in o)
|
|
@@ -2305,13 +2305,13 @@ const Il = /* @__PURE__ */ y("$ZodRecord", (e, t) => {
|
|
|
2305
2305
|
}
|
|
2306
2306
|
const u = t.valueType._zod.run({ value: o[i], issues: [] }, n);
|
|
2307
2307
|
u instanceof Promise ? a.push(u.then((c) => {
|
|
2308
|
-
c.issues.length && r.issues.push(...
|
|
2309
|
-
})) : (u.issues.length && r.issues.push(...
|
|
2308
|
+
c.issues.length && r.issues.push(...Be(i, c.issues)), r.value[s.value] = c.value;
|
|
2309
|
+
})) : (u.issues.length && r.issues.push(...Be(i, u.issues)), r.value[s.value] = u.value);
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
2312
|
return a.length ? Promise.all(a).then(() => r) : r;
|
|
2313
2313
|
};
|
|
2314
|
-
}), El = /* @__PURE__ */
|
|
2314
|
+
}), El = /* @__PURE__ */ _("$ZodEnum", (e, t) => {
|
|
2315
2315
|
j.init(e, t);
|
|
2316
2316
|
const r = Lo(t.entries);
|
|
2317
2317
|
e._zod.values = new Set(r), e._zod.pattern = new RegExp(`^(${r.filter((n) => Li.has(typeof n)).map((n) => typeof n == "string" ? wt(n) : n.toString()).join("|")})$`), e._zod.parse = (n, o) => {
|
|
@@ -2323,7 +2323,7 @@ const Il = /* @__PURE__ */ y("$ZodRecord", (e, t) => {
|
|
|
2323
2323
|
inst: e
|
|
2324
2324
|
}), n;
|
|
2325
2325
|
};
|
|
2326
|
-
}), Tl = /* @__PURE__ */
|
|
2326
|
+
}), Tl = /* @__PURE__ */ _("$ZodLiteral", (e, t) => {
|
|
2327
2327
|
j.init(e, t), e._zod.values = new Set(t.values), e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? wt(r) : r ? r.toString() : String(r)).join("|")})$`), e._zod.parse = (r, n) => {
|
|
2328
2328
|
const o = r.value;
|
|
2329
2329
|
return e._zod.values.has(o) || r.issues.push({
|
|
@@ -2333,26 +2333,26 @@ const Il = /* @__PURE__ */ y("$ZodRecord", (e, t) => {
|
|
|
2333
2333
|
inst: e
|
|
2334
2334
|
}), r;
|
|
2335
2335
|
};
|
|
2336
|
-
}), Sl = /* @__PURE__ */
|
|
2336
|
+
}), Sl = /* @__PURE__ */ _("$ZodTransform", (e, t) => {
|
|
2337
2337
|
j.init(e, t), e._zod.parse = (r, n) => {
|
|
2338
2338
|
const o = t.transform(r.value, r);
|
|
2339
2339
|
if (n.async)
|
|
2340
2340
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (r.value = i, r));
|
|
2341
2341
|
if (o instanceof Promise)
|
|
2342
|
-
throw new
|
|
2342
|
+
throw new ft();
|
|
2343
2343
|
return r.value = o, r;
|
|
2344
2344
|
};
|
|
2345
|
-
}), xl = /* @__PURE__ */
|
|
2345
|
+
}), xl = /* @__PURE__ */ _("$ZodOptional", (e, t) => {
|
|
2346
2346
|
j.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", Z(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), Z(e._zod, "pattern", () => {
|
|
2347
2347
|
const r = t.innerType._zod.pattern;
|
|
2348
2348
|
return r ? new RegExp(`^(${Dr(r.source)})?$`) : void 0;
|
|
2349
2349
|
}), e._zod.parse = (r, n) => t.innerType._zod.optin === "optional" ? t.innerType._zod.run(r, n) : r.value === void 0 ? r : t.innerType._zod.run(r, n);
|
|
2350
|
-
}), kl = /* @__PURE__ */
|
|
2350
|
+
}), kl = /* @__PURE__ */ _("$ZodNullable", (e, t) => {
|
|
2351
2351
|
j.init(e, t), Z(e._zod, "optin", () => t.innerType._zod.optin), Z(e._zod, "optout", () => t.innerType._zod.optout), Z(e._zod, "pattern", () => {
|
|
2352
2352
|
const r = t.innerType._zod.pattern;
|
|
2353
2353
|
return r ? new RegExp(`^(${Dr(r.source)}|null)$`) : void 0;
|
|
2354
2354
|
}), Z(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (r, n) => r.value === null ? r : t.innerType._zod.run(r, n);
|
|
2355
|
-
}), Cl = /* @__PURE__ */
|
|
2355
|
+
}), Cl = /* @__PURE__ */ _("$ZodDefault", (e, t) => {
|
|
2356
2356
|
j.init(e, t), e._zod.optin = "optional", Z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
2357
2357
|
if (r.value === void 0)
|
|
2358
2358
|
return r.value = t.defaultValue, r;
|
|
@@ -2363,9 +2363,9 @@ const Il = /* @__PURE__ */ y("$ZodRecord", (e, t) => {
|
|
|
2363
2363
|
function In(e, t) {
|
|
2364
2364
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
2365
2365
|
}
|
|
2366
|
-
const Nl = /* @__PURE__ */
|
|
2366
|
+
const Nl = /* @__PURE__ */ _("$ZodPrefault", (e, t) => {
|
|
2367
2367
|
j.init(e, t), e._zod.optin = "optional", Z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => (r.value === void 0 && (r.value = t.defaultValue), t.innerType._zod.run(r, n));
|
|
2368
|
-
}), zl = /* @__PURE__ */
|
|
2368
|
+
}), zl = /* @__PURE__ */ _("$ZodNonOptional", (e, t) => {
|
|
2369
2369
|
j.init(e, t), Z(e._zod, "values", () => {
|
|
2370
2370
|
const r = t.innerType._zod.values;
|
|
2371
2371
|
return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
|
|
@@ -2382,7 +2382,7 @@ function En(e, t) {
|
|
|
2382
2382
|
inst: t
|
|
2383
2383
|
}), e;
|
|
2384
2384
|
}
|
|
2385
|
-
const Al = /* @__PURE__ */
|
|
2385
|
+
const Al = /* @__PURE__ */ _("$ZodCatch", (e, t) => {
|
|
2386
2386
|
j.init(e, t), e._zod.optin = "optional", Z(e._zod, "optout", () => t.innerType._zod.optout), Z(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
2387
2387
|
const o = t.innerType._zod.run(r, n);
|
|
2388
2388
|
return o instanceof Promise ? o.then((a) => (r.value = a.value, a.issues.length && (r.value = t.catchValue({
|
|
@@ -2399,16 +2399,16 @@ const Al = /* @__PURE__ */ y("$ZodCatch", (e, t) => {
|
|
|
2399
2399
|
input: r.value
|
|
2400
2400
|
}), r.issues = []), r);
|
|
2401
2401
|
};
|
|
2402
|
-
}), Ol = /* @__PURE__ */
|
|
2402
|
+
}), Ol = /* @__PURE__ */ _("$ZodPipe", (e, t) => {
|
|
2403
2403
|
j.init(e, t), Z(e._zod, "values", () => t.in._zod.values), Z(e._zod, "optin", () => t.in._zod.optin), Z(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (r, n) => {
|
|
2404
2404
|
const o = t.in._zod.run(r, n);
|
|
2405
2405
|
return o instanceof Promise ? o.then((a) => Tn(a, t, n)) : Tn(o, t, n);
|
|
2406
2406
|
};
|
|
2407
2407
|
});
|
|
2408
2408
|
function Tn(e, t, r) {
|
|
2409
|
-
return
|
|
2409
|
+
return pt(e) ? e : t.out._zod.run({ value: e.value, issues: e.issues }, r);
|
|
2410
2410
|
}
|
|
2411
|
-
const Ml = /* @__PURE__ */
|
|
2411
|
+
const Ml = /* @__PURE__ */ _("$ZodReadonly", (e, t) => {
|
|
2412
2412
|
j.init(e, t), Z(e._zod, "propValues", () => t.innerType._zod.propValues), Z(e._zod, "values", () => t.innerType._zod.values), Z(e._zod, "optin", () => t.innerType._zod.optin), Z(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (r, n) => {
|
|
2413
2413
|
const o = t.innerType._zod.run(r, n);
|
|
2414
2414
|
return o instanceof Promise ? o.then(Sn) : Sn(o);
|
|
@@ -2417,9 +2417,9 @@ const Ml = /* @__PURE__ */ y("$ZodReadonly", (e, t) => {
|
|
|
2417
2417
|
function Sn(e) {
|
|
2418
2418
|
return e.value = Object.freeze(e.value), e;
|
|
2419
2419
|
}
|
|
2420
|
-
const $l = /* @__PURE__ */
|
|
2420
|
+
const $l = /* @__PURE__ */ _("$ZodLazy", (e, t) => {
|
|
2421
2421
|
j.init(e, t), Z(e._zod, "innerType", () => t.getter()), Z(e._zod, "pattern", () => e._zod.innerType._zod.pattern), Z(e._zod, "propValues", () => e._zod.innerType._zod.propValues), Z(e._zod, "optin", () => e._zod.innerType._zod.optin), Z(e._zod, "optout", () => e._zod.innerType._zod.optout), e._zod.parse = (r, n) => e._zod.innerType._zod.run(r, n);
|
|
2422
|
-
}), Pl = /* @__PURE__ */
|
|
2422
|
+
}), Pl = /* @__PURE__ */ _("$ZodCustom", (e, t) => {
|
|
2423
2423
|
ue.init(e, t), j.init(e, t), e._zod.parse = (r, n) => r, e._zod.check = (r) => {
|
|
2424
2424
|
const n = r.value, o = t.fn(n);
|
|
2425
2425
|
if (o instanceof Promise)
|
|
@@ -2439,7 +2439,7 @@ function xn(e, t, r, n) {
|
|
|
2439
2439
|
continue: !n._zod.def.abort
|
|
2440
2440
|
// params: inst._zod.def.params,
|
|
2441
2441
|
};
|
|
2442
|
-
n._zod.def.params && (o.params = n._zod.def.params), t.issues.push(
|
|
2442
|
+
n._zod.def.params && (o.params = n._zod.def.params), t.issues.push(gt(o));
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
2445
|
class ta {
|
|
@@ -2477,7 +2477,7 @@ class ta {
|
|
|
2477
2477
|
function Rl() {
|
|
2478
2478
|
return new ta();
|
|
2479
2479
|
}
|
|
2480
|
-
const
|
|
2480
|
+
const ct = /* @__PURE__ */ Rl();
|
|
2481
2481
|
function Zl(e, t) {
|
|
2482
2482
|
return new e({
|
|
2483
2483
|
type: "string",
|
|
@@ -2913,7 +2913,7 @@ function xu(e, t, r) {
|
|
|
2913
2913
|
}
|
|
2914
2914
|
class An {
|
|
2915
2915
|
constructor(t) {
|
|
2916
|
-
this.counter = 0, this.metadataRegistry = t?.metadata ??
|
|
2916
|
+
this.counter = 0, this.metadataRegistry = t?.metadata ?? ct, this.target = t?.target ?? "draft-2020-12", this.unrepresentable = t?.unrepresentable ?? "throw", this.override = t?.override ?? (() => {
|
|
2917
2917
|
}), this.io = t?.io ?? "output", this.seen = /* @__PURE__ */ new Map();
|
|
2918
2918
|
}
|
|
2919
2919
|
process(t, r = { path: [], schemaPath: [] }) {
|
|
@@ -2947,21 +2947,21 @@ class An {
|
|
|
2947
2947
|
case "string": {
|
|
2948
2948
|
const m = g;
|
|
2949
2949
|
m.type = "string";
|
|
2950
|
-
const { minimum: h, maximum: v, format: I, patterns:
|
|
2951
|
-
if (typeof h == "number" && (m.minLength = h), typeof v == "number" && (m.maxLength = v), I && (m.format = a[I] ?? I, m.format === "" && delete m.format), E && (m.contentEncoding = E),
|
|
2952
|
-
const b = [...
|
|
2950
|
+
const { minimum: h, maximum: v, format: I, patterns: y, contentEncoding: E } = t._zod.bag;
|
|
2951
|
+
if (typeof h == "number" && (m.minLength = h), typeof v == "number" && (m.maxLength = v), I && (m.format = a[I] ?? I, m.format === "" && delete m.format), E && (m.contentEncoding = E), y && y.size > 0) {
|
|
2952
|
+
const b = [...y];
|
|
2953
2953
|
b.length === 1 ? m.pattern = b[0].source : b.length > 1 && (s.schema.allOf = [
|
|
2954
|
-
...b.map((
|
|
2954
|
+
...b.map((z) => ({
|
|
2955
2955
|
...this.target === "draft-7" ? { type: "string" } : {},
|
|
2956
|
-
pattern:
|
|
2956
|
+
pattern: z.source
|
|
2957
2957
|
}))
|
|
2958
2958
|
]);
|
|
2959
2959
|
}
|
|
2960
2960
|
break;
|
|
2961
2961
|
}
|
|
2962
2962
|
case "number": {
|
|
2963
|
-
const m = g, { minimum: h, maximum: v, format: I, multipleOf:
|
|
2964
|
-
typeof I == "string" && I.includes("int") ? m.type = "integer" : m.type = "number", typeof b == "number" && (m.exclusiveMinimum = b), typeof h == "number" && (m.minimum = h, typeof b == "number" && (b >= h ? delete m.minimum : delete m.exclusiveMinimum)), typeof E == "number" && (m.exclusiveMaximum = E), typeof v == "number" && (m.maximum = v, typeof E == "number" && (E <= v ? delete m.maximum : delete m.exclusiveMaximum)), typeof
|
|
2963
|
+
const m = g, { minimum: h, maximum: v, format: I, multipleOf: y, exclusiveMaximum: E, exclusiveMinimum: b } = t._zod.bag;
|
|
2964
|
+
typeof I == "string" && I.includes("int") ? m.type = "integer" : m.type = "number", typeof b == "number" && (m.exclusiveMinimum = b), typeof h == "number" && (m.minimum = h, typeof b == "number" && (b >= h ? delete m.minimum : delete m.exclusiveMinimum)), typeof E == "number" && (m.exclusiveMaximum = E), typeof v == "number" && (m.maximum = v, typeof E == "number" && (E <= v ? delete m.maximum : delete m.exclusiveMaximum)), typeof y == "number" && (m.multipleOf = y);
|
|
2965
2965
|
break;
|
|
2966
2966
|
}
|
|
2967
2967
|
case "boolean": {
|
|
@@ -3015,13 +3015,13 @@ class An {
|
|
|
3015
3015
|
const m = g;
|
|
3016
3016
|
m.type = "object", m.properties = {};
|
|
3017
3017
|
const h = o.shape;
|
|
3018
|
-
for (const
|
|
3019
|
-
m.properties[
|
|
3018
|
+
for (const y in h)
|
|
3019
|
+
m.properties[y] = this.process(h[y], {
|
|
3020
3020
|
...d,
|
|
3021
|
-
path: [...d.path, "properties",
|
|
3021
|
+
path: [...d.path, "properties", y]
|
|
3022
3022
|
});
|
|
3023
|
-
const v = new Set(Object.keys(h)), I = new Set([...v].filter((
|
|
3024
|
-
const E = o.shape[
|
|
3023
|
+
const v = new Set(Object.keys(h)), I = new Set([...v].filter((y) => {
|
|
3024
|
+
const E = o.shape[y]._zod;
|
|
3025
3025
|
return this.io === "input" ? E.optin === void 0 : E.optout === void 0;
|
|
3026
3026
|
}));
|
|
3027
3027
|
I.size > 0 && (m.required = Array.from(I)), o.catchall?._zod.def.type === "never" ? m.additionalProperties = !1 : o.catchall ? o.catchall && (m.additionalProperties = this.process(o.catchall, {
|
|
@@ -3045,23 +3045,23 @@ class An {
|
|
|
3045
3045
|
}), v = this.process(o.right, {
|
|
3046
3046
|
...d,
|
|
3047
3047
|
path: [...d.path, "allOf", 1]
|
|
3048
|
-
}), I = (E) => "allOf" in E && Object.keys(E).length === 1,
|
|
3048
|
+
}), I = (E) => "allOf" in E && Object.keys(E).length === 1, y = [
|
|
3049
3049
|
...I(h) ? h.allOf : [h],
|
|
3050
3050
|
...I(v) ? v.allOf : [v]
|
|
3051
3051
|
];
|
|
3052
|
-
m.allOf =
|
|
3052
|
+
m.allOf = y;
|
|
3053
3053
|
break;
|
|
3054
3054
|
}
|
|
3055
3055
|
case "tuple": {
|
|
3056
3056
|
const m = g;
|
|
3057
3057
|
m.type = "array";
|
|
3058
|
-
const h = o.items.map((
|
|
3058
|
+
const h = o.items.map((y, E) => this.process(y, { ...d, path: [...d.path, "prefixItems", E] }));
|
|
3059
3059
|
if (this.target === "draft-2020-12" ? m.prefixItems = h : m.items = h, o.rest) {
|
|
3060
|
-
const
|
|
3060
|
+
const y = this.process(o.rest, {
|
|
3061
3061
|
...d,
|
|
3062
3062
|
path: [...d.path, "items"]
|
|
3063
3063
|
});
|
|
3064
|
-
this.target === "draft-2020-12" ? m.items =
|
|
3064
|
+
this.target === "draft-2020-12" ? m.items = y : m.additionalItems = y;
|
|
3065
3065
|
}
|
|
3066
3066
|
o.rest && (m.items = this.process(o.rest, {
|
|
3067
3067
|
...d,
|
|
@@ -3118,8 +3118,8 @@ class An {
|
|
|
3118
3118
|
type: "string",
|
|
3119
3119
|
format: "binary",
|
|
3120
3120
|
contentEncoding: "binary"
|
|
3121
|
-
}, { minimum: v, maximum: I, mime:
|
|
3122
|
-
v !== void 0 && (h.minLength = v), I !== void 0 && (h.maxLength = I),
|
|
3121
|
+
}, { minimum: v, maximum: I, mime: y } = t._zod.bag;
|
|
3122
|
+
v !== void 0 && (h.minLength = v), I !== void 0 && (h.maxLength = I), y ? y.length === 1 ? (h.contentMediaType = y[0], Object.assign(m, h)) : m.anyOf = y.map((E) => ({ ...h, contentMediaType: E })) : Object.assign(m, h);
|
|
3123
3123
|
break;
|
|
3124
3124
|
}
|
|
3125
3125
|
case "transform": {
|
|
@@ -3219,7 +3219,7 @@ class An {
|
|
|
3219
3219
|
const a = (p) => {
|
|
3220
3220
|
const d = this.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3221
3221
|
if (n.external) {
|
|
3222
|
-
const h = n.external.registry.get(p[0])?.id, v = n.external.uri ?? ((
|
|
3222
|
+
const h = n.external.registry.get(p[0])?.id, v = n.external.uri ?? ((y) => y);
|
|
3223
3223
|
if (h)
|
|
3224
3224
|
return { ref: v(h) };
|
|
3225
3225
|
const I = p[1].defId ?? p[1].schema.id ?? `schema${this.counter++}`;
|
|
@@ -3421,25 +3421,25 @@ function K(e, t) {
|
|
|
3421
3421
|
}
|
|
3422
3422
|
throw new Error(`Unknown schema type: ${o.type}`);
|
|
3423
3423
|
}
|
|
3424
|
-
const Cu = /* @__PURE__ */
|
|
3424
|
+
const Cu = /* @__PURE__ */ _("ZodISODateTime", (e, t) => {
|
|
3425
3425
|
Kc.init(e, t), Y.init(e, t);
|
|
3426
3426
|
});
|
|
3427
3427
|
function Nu(e) {
|
|
3428
3428
|
return ou(Cu, e);
|
|
3429
3429
|
}
|
|
3430
|
-
const zu = /* @__PURE__ */
|
|
3430
|
+
const zu = /* @__PURE__ */ _("ZodISODate", (e, t) => {
|
|
3431
3431
|
el.init(e, t), Y.init(e, t);
|
|
3432
3432
|
});
|
|
3433
3433
|
function Au(e) {
|
|
3434
3434
|
return au(zu, e);
|
|
3435
3435
|
}
|
|
3436
|
-
const Ou = /* @__PURE__ */
|
|
3436
|
+
const Ou = /* @__PURE__ */ _("ZodISOTime", (e, t) => {
|
|
3437
3437
|
tl.init(e, t), Y.init(e, t);
|
|
3438
3438
|
});
|
|
3439
3439
|
function Mu(e) {
|
|
3440
3440
|
return su(Ou, e);
|
|
3441
3441
|
}
|
|
3442
|
-
const $u = /* @__PURE__ */
|
|
3442
|
+
const $u = /* @__PURE__ */ _("ZodISODuration", (e, t) => {
|
|
3443
3443
|
rl.init(e, t), Y.init(e, t);
|
|
3444
3444
|
});
|
|
3445
3445
|
function Pu(e) {
|
|
@@ -3470,9 +3470,9 @@ const Ru = (e, t) => {
|
|
|
3470
3470
|
// enumerable: false,
|
|
3471
3471
|
}
|
|
3472
3472
|
});
|
|
3473
|
-
}, tr =
|
|
3473
|
+
}, tr = _("ZodError", Ru, {
|
|
3474
3474
|
Parent: Error
|
|
3475
|
-
}), Zu = /* @__PURE__ */ Yi(tr), Du = /* @__PURE__ */ Xi(tr), Lu = /* @__PURE__ */ Fo(tr), aa = /* @__PURE__ */ Ho(tr), q = /* @__PURE__ */
|
|
3475
|
+
}), Zu = /* @__PURE__ */ Yi(tr), Du = /* @__PURE__ */ Xi(tr), Lu = /* @__PURE__ */ Fo(tr), aa = /* @__PURE__ */ Ho(tr), q = /* @__PURE__ */ _("ZodType", (e, t) => (j.init(e, t), e.def = t, Object.defineProperty(e, "_def", { value: t }), e.check = (...r) => e.clone(
|
|
3476
3476
|
{
|
|
3477
3477
|
...t,
|
|
3478
3478
|
checks: [
|
|
@@ -3481,118 +3481,118 @@ const Ru = (e, t) => {
|
|
|
3481
3481
|
]
|
|
3482
3482
|
}
|
|
3483
3483
|
// { parent: true }
|
|
3484
|
-
), e.clone = (r, n) =>
|
|
3484
|
+
), e.clone = (r, n) => Ve(e, r, n), e.brand = () => e, e.register = ((r, n) => (r.add(e, n), e)), e.parse = (r, n) => Zu(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => Lu(e, r, n), e.parseAsync = async (r, n) => Du(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => aa(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(Md(r, n)), e.superRefine = (r) => e.check($d(r)), e.overwrite = (r) => e.check(It(r)), e.optional = () => Q(e), e.nullable = () => $n(e), e.nullish = () => Q($n(e)), e.nonoptional = (r) => Ed(e, r), e.array = () => Se(e), e.or = (r) => ee([e, r]), e.and = (r) => md(e, r), e.transform = (r) => Pn(e, vd(r)), e.default = (r) => bd(e, r), e.prefault = (r) => Id(e, r), e.catch = (r) => Sd(e, r), e.pipe = (r) => Pn(e, r), e.readonly = () => Cd(e), e.describe = (r) => {
|
|
3485
3485
|
const n = e.clone();
|
|
3486
|
-
return
|
|
3486
|
+
return ct.add(n, { description: r }), n;
|
|
3487
3487
|
}, Object.defineProperty(e, "description", {
|
|
3488
3488
|
get() {
|
|
3489
|
-
return
|
|
3489
|
+
return ct.get(e)?.description;
|
|
3490
3490
|
},
|
|
3491
3491
|
configurable: !0
|
|
3492
3492
|
}), e.meta = (...r) => {
|
|
3493
3493
|
if (r.length === 0)
|
|
3494
|
-
return
|
|
3494
|
+
return ct.get(e);
|
|
3495
3495
|
const n = e.clone();
|
|
3496
|
-
return
|
|
3497
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), sa = /* @__PURE__ */
|
|
3496
|
+
return ct.add(n, r[0]), n;
|
|
3497
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), sa = /* @__PURE__ */ _("_ZodString", (e, t) => {
|
|
3498
3498
|
Ur.init(e, t), q.init(e, t);
|
|
3499
3499
|
const r = e._zod.bag;
|
|
3500
3500
|
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(hu(...n)), e.includes = (...n) => e.check(vu(...n)), e.startsWith = (...n) => e.check(yu(...n)), e.endsWith = (...n) => e.check(_u(...n)), e.min = (...n) => e.check(Gt(...n)), e.max = (...n) => e.check(na(...n)), e.length = (...n) => e.check(oa(...n)), e.nonempty = (...n) => e.check(Gt(1, ...n)), e.lowercase = (n) => e.check(fu(n)), e.uppercase = (n) => e.check(gu(n)), e.trim = () => e.check(wu()), e.normalize = (...n) => e.check(bu(...n)), e.toLowerCase = () => e.check(Iu()), e.toUpperCase = () => e.check(Eu());
|
|
3501
|
-
}), Uu = /* @__PURE__ */
|
|
3501
|
+
}), Uu = /* @__PURE__ */ _("ZodString", (e, t) => {
|
|
3502
3502
|
Ur.init(e, t), sa.init(e, t), e.email = (r) => e.check(Dl(Bu, r)), e.url = (r) => e.check(Vl(ju, r)), e.jwt = (r) => e.check(nu(rd, r)), e.emoji = (r) => e.check(Fl(Vu, r)), e.guid = (r) => e.check(kn(On, r)), e.uuid = (r) => e.check(Ll(Nt, r)), e.uuidv4 = (r) => e.check(Ul(Nt, r)), e.uuidv6 = (r) => e.check(Bl(Nt, r)), e.uuidv7 = (r) => e.check(jl(Nt, r)), e.nanoid = (r) => e.check(Hl(Fu, r)), e.guid = (r) => e.check(kn(On, r)), e.cuid = (r) => e.check(Jl(Hu, r)), e.cuid2 = (r) => e.check(Gl(Ju, r)), e.ulid = (r) => e.check(Wl(Gu, r)), e.base64 = (r) => e.check(ra(ia, r)), e.base64url = (r) => e.check(tu(ed, r)), e.xid = (r) => e.check(ql(Wu, r)), e.ksuid = (r) => e.check(Yl(qu, r)), e.ipv4 = (r) => e.check(Xl(Yu, r)), e.ipv6 = (r) => e.check(Ql(Xu, r)), e.cidrv4 = (r) => e.check(Kl(Qu, r)), e.cidrv6 = (r) => e.check(eu(Ku, r)), e.e164 = (r) => e.check(ru(td, r)), e.datetime = (r) => e.check(Nu(r)), e.date = (r) => e.check(Au(r)), e.time = (r) => e.check(Mu(r)), e.duration = (r) => e.check(Pu(r));
|
|
3503
3503
|
});
|
|
3504
3504
|
function w(e) {
|
|
3505
3505
|
return Zl(Uu, e);
|
|
3506
3506
|
}
|
|
3507
|
-
const Y = /* @__PURE__ */
|
|
3507
|
+
const Y = /* @__PURE__ */ _("ZodStringFormat", (e, t) => {
|
|
3508
3508
|
W.init(e, t), sa.init(e, t);
|
|
3509
|
-
}), Bu = /* @__PURE__ */
|
|
3509
|
+
}), Bu = /* @__PURE__ */ _("ZodEmail", (e, t) => {
|
|
3510
3510
|
Fc.init(e, t), Y.init(e, t);
|
|
3511
|
-
}), On = /* @__PURE__ */
|
|
3511
|
+
}), On = /* @__PURE__ */ _("ZodGUID", (e, t) => {
|
|
3512
3512
|
jc.init(e, t), Y.init(e, t);
|
|
3513
|
-
}), Nt = /* @__PURE__ */
|
|
3513
|
+
}), Nt = /* @__PURE__ */ _("ZodUUID", (e, t) => {
|
|
3514
3514
|
Vc.init(e, t), Y.init(e, t);
|
|
3515
|
-
}), ju = /* @__PURE__ */
|
|
3515
|
+
}), ju = /* @__PURE__ */ _("ZodURL", (e, t) => {
|
|
3516
3516
|
Hc.init(e, t), Y.init(e, t);
|
|
3517
|
-
}), Vu = /* @__PURE__ */
|
|
3517
|
+
}), Vu = /* @__PURE__ */ _("ZodEmoji", (e, t) => {
|
|
3518
3518
|
Jc.init(e, t), Y.init(e, t);
|
|
3519
|
-
}), Fu = /* @__PURE__ */
|
|
3519
|
+
}), Fu = /* @__PURE__ */ _("ZodNanoID", (e, t) => {
|
|
3520
3520
|
Gc.init(e, t), Y.init(e, t);
|
|
3521
|
-
}), Hu = /* @__PURE__ */
|
|
3521
|
+
}), Hu = /* @__PURE__ */ _("ZodCUID", (e, t) => {
|
|
3522
3522
|
Wc.init(e, t), Y.init(e, t);
|
|
3523
|
-
}), Ju = /* @__PURE__ */
|
|
3523
|
+
}), Ju = /* @__PURE__ */ _("ZodCUID2", (e, t) => {
|
|
3524
3524
|
qc.init(e, t), Y.init(e, t);
|
|
3525
|
-
}), Gu = /* @__PURE__ */
|
|
3525
|
+
}), Gu = /* @__PURE__ */ _("ZodULID", (e, t) => {
|
|
3526
3526
|
Yc.init(e, t), Y.init(e, t);
|
|
3527
|
-
}), Wu = /* @__PURE__ */
|
|
3527
|
+
}), Wu = /* @__PURE__ */ _("ZodXID", (e, t) => {
|
|
3528
3528
|
Xc.init(e, t), Y.init(e, t);
|
|
3529
|
-
}), qu = /* @__PURE__ */
|
|
3529
|
+
}), qu = /* @__PURE__ */ _("ZodKSUID", (e, t) => {
|
|
3530
3530
|
Qc.init(e, t), Y.init(e, t);
|
|
3531
|
-
}), Yu = /* @__PURE__ */
|
|
3531
|
+
}), Yu = /* @__PURE__ */ _("ZodIPv4", (e, t) => {
|
|
3532
3532
|
nl.init(e, t), Y.init(e, t);
|
|
3533
|
-
}), Xu = /* @__PURE__ */
|
|
3533
|
+
}), Xu = /* @__PURE__ */ _("ZodIPv6", (e, t) => {
|
|
3534
3534
|
ol.init(e, t), Y.init(e, t);
|
|
3535
|
-
}), Qu = /* @__PURE__ */
|
|
3535
|
+
}), Qu = /* @__PURE__ */ _("ZodCIDRv4", (e, t) => {
|
|
3536
3536
|
al.init(e, t), Y.init(e, t);
|
|
3537
|
-
}), Ku = /* @__PURE__ */
|
|
3537
|
+
}), Ku = /* @__PURE__ */ _("ZodCIDRv6", (e, t) => {
|
|
3538
3538
|
sl.init(e, t), Y.init(e, t);
|
|
3539
|
-
}), ia = /* @__PURE__ */
|
|
3539
|
+
}), ia = /* @__PURE__ */ _("ZodBase64", (e, t) => {
|
|
3540
3540
|
il.init(e, t), Y.init(e, t);
|
|
3541
3541
|
});
|
|
3542
3542
|
function ca(e) {
|
|
3543
3543
|
return ra(ia, e);
|
|
3544
3544
|
}
|
|
3545
|
-
const ed = /* @__PURE__ */
|
|
3545
|
+
const ed = /* @__PURE__ */ _("ZodBase64URL", (e, t) => {
|
|
3546
3546
|
ll.init(e, t), Y.init(e, t);
|
|
3547
|
-
}), td = /* @__PURE__ */
|
|
3547
|
+
}), td = /* @__PURE__ */ _("ZodE164", (e, t) => {
|
|
3548
3548
|
ul.init(e, t), Y.init(e, t);
|
|
3549
|
-
}), rd = /* @__PURE__ */
|
|
3549
|
+
}), rd = /* @__PURE__ */ _("ZodJWT", (e, t) => {
|
|
3550
3550
|
pl.init(e, t), Y.init(e, t);
|
|
3551
|
-
}), la = /* @__PURE__ */
|
|
3551
|
+
}), la = /* @__PURE__ */ _("ZodNumber", (e, t) => {
|
|
3552
3552
|
Ko.init(e, t), q.init(e, t), e.gt = (n, o) => e.check(Nn(n, o)), e.gte = (n, o) => e.check(pr(n, o)), e.min = (n, o) => e.check(pr(n, o)), e.lt = (n, o) => e.check(Cn(n, o)), e.lte = (n, o) => e.check(dr(n, o)), e.max = (n, o) => e.check(dr(n, o)), e.int = (n) => e.check(Mn(n)), e.safe = (n) => e.check(Mn(n)), e.positive = (n) => e.check(Nn(0, n)), e.nonnegative = (n) => e.check(pr(0, n)), e.negative = (n) => e.check(Cn(0, n)), e.nonpositive = (n) => e.check(dr(0, n)), e.multipleOf = (n, o) => e.check(zn(n, o)), e.step = (n, o) => e.check(zn(n, o)), e.finite = () => e;
|
|
3553
3553
|
const r = e._zod.bag;
|
|
3554
3554
|
e.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), e.isFinite = !0, e.format = r.format ?? null;
|
|
3555
3555
|
});
|
|
3556
|
-
function
|
|
3556
|
+
function vt(e) {
|
|
3557
3557
|
return cu(la, e);
|
|
3558
3558
|
}
|
|
3559
|
-
const nd = /* @__PURE__ */
|
|
3559
|
+
const nd = /* @__PURE__ */ _("ZodNumberFormat", (e, t) => {
|
|
3560
3560
|
ml.init(e, t), la.init(e, t);
|
|
3561
3561
|
});
|
|
3562
3562
|
function Mn(e) {
|
|
3563
3563
|
return lu(nd, e);
|
|
3564
3564
|
}
|
|
3565
|
-
const od = /* @__PURE__ */
|
|
3565
|
+
const od = /* @__PURE__ */ _("ZodBoolean", (e, t) => {
|
|
3566
3566
|
hl.init(e, t), q.init(e, t);
|
|
3567
3567
|
});
|
|
3568
3568
|
function X(e) {
|
|
3569
3569
|
return uu(od, e);
|
|
3570
3570
|
}
|
|
3571
|
-
const ad = /* @__PURE__ */
|
|
3571
|
+
const ad = /* @__PURE__ */ _("ZodNull", (e, t) => {
|
|
3572
3572
|
fl.init(e, t), q.init(e, t);
|
|
3573
3573
|
});
|
|
3574
3574
|
function sd(e) {
|
|
3575
3575
|
return du(ad, e);
|
|
3576
3576
|
}
|
|
3577
|
-
const id = /* @__PURE__ */
|
|
3577
|
+
const id = /* @__PURE__ */ _("ZodUnknown", (e, t) => {
|
|
3578
3578
|
gl.init(e, t), q.init(e, t);
|
|
3579
3579
|
});
|
|
3580
3580
|
function H() {
|
|
3581
3581
|
return pu(id);
|
|
3582
3582
|
}
|
|
3583
|
-
const cd = /* @__PURE__ */
|
|
3583
|
+
const cd = /* @__PURE__ */ _("ZodNever", (e, t) => {
|
|
3584
3584
|
vl.init(e, t), q.init(e, t);
|
|
3585
3585
|
});
|
|
3586
3586
|
function le(e) {
|
|
3587
3587
|
return mu(cd, e);
|
|
3588
3588
|
}
|
|
3589
|
-
const ld = /* @__PURE__ */
|
|
3589
|
+
const ld = /* @__PURE__ */ _("ZodArray", (e, t) => {
|
|
3590
3590
|
yl.init(e, t), q.init(e, t), e.element = t.element, e.min = (r, n) => e.check(Gt(r, n)), e.nonempty = (r) => e.check(Gt(1, r)), e.max = (r, n) => e.check(na(r, n)), e.length = (r, n) => e.check(oa(r, n)), e.unwrap = () => e.element;
|
|
3591
3591
|
});
|
|
3592
3592
|
function Se(e, t) {
|
|
3593
3593
|
return Tu(ld, e, t);
|
|
3594
3594
|
}
|
|
3595
|
-
const Br = /* @__PURE__ */
|
|
3595
|
+
const Br = /* @__PURE__ */ _("ZodObject", (e, t) => {
|
|
3596
3596
|
_l.init(e, t), q.init(e, t), Z(e, "shape", () => t.shape), e.keyof = () => rr(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: H() }), e.loose = () => e.clone({ ...e._zod.def, catchall: H() }), e.strict = () => e.clone({ ...e._zod.def, catchall: le() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => Fi(e, r), e.merge = (r) => Hi(e, r), e.pick = (r) => ji(e, r), e.omit = (r) => Vi(e, r), e.partial = (...r) => Ji(da, e, r[0]), e.required = (...r) => Gi(pa, e, r[0]);
|
|
3597
3597
|
});
|
|
3598
3598
|
function C(e, t) {
|
|
@@ -3615,7 +3615,7 @@ function V(e, t) {
|
|
|
3615
3615
|
...S(t)
|
|
3616
3616
|
});
|
|
3617
3617
|
}
|
|
3618
|
-
function
|
|
3618
|
+
function tt(e, t) {
|
|
3619
3619
|
return new Br({
|
|
3620
3620
|
type: "object",
|
|
3621
3621
|
get shape() {
|
|
@@ -3625,7 +3625,7 @@ function et(e, t) {
|
|
|
3625
3625
|
...S(t)
|
|
3626
3626
|
});
|
|
3627
3627
|
}
|
|
3628
|
-
const ua = /* @__PURE__ */
|
|
3628
|
+
const ua = /* @__PURE__ */ _("ZodUnion", (e, t) => {
|
|
3629
3629
|
ea.init(e, t), q.init(e, t), e.options = t.options;
|
|
3630
3630
|
});
|
|
3631
3631
|
function ee(e, t) {
|
|
@@ -3635,7 +3635,7 @@ function ee(e, t) {
|
|
|
3635
3635
|
...S(t)
|
|
3636
3636
|
});
|
|
3637
3637
|
}
|
|
3638
|
-
const ud = /* @__PURE__ */
|
|
3638
|
+
const ud = /* @__PURE__ */ _("ZodDiscriminatedUnion", (e, t) => {
|
|
3639
3639
|
ua.init(e, t), bl.init(e, t);
|
|
3640
3640
|
});
|
|
3641
3641
|
function dd(e, t, r) {
|
|
@@ -3646,7 +3646,7 @@ function dd(e, t, r) {
|
|
|
3646
3646
|
...S(r)
|
|
3647
3647
|
});
|
|
3648
3648
|
}
|
|
3649
|
-
const pd = /* @__PURE__ */
|
|
3649
|
+
const pd = /* @__PURE__ */ _("ZodIntersection", (e, t) => {
|
|
3650
3650
|
wl.init(e, t), q.init(e, t);
|
|
3651
3651
|
});
|
|
3652
3652
|
function md(e, t) {
|
|
@@ -3656,7 +3656,7 @@ function md(e, t) {
|
|
|
3656
3656
|
right: t
|
|
3657
3657
|
});
|
|
3658
3658
|
}
|
|
3659
|
-
const hd = /* @__PURE__ */
|
|
3659
|
+
const hd = /* @__PURE__ */ _("ZodRecord", (e, t) => {
|
|
3660
3660
|
Il.init(e, t), q.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3661
3661
|
});
|
|
3662
3662
|
function xr(e, t, r) {
|
|
@@ -3667,7 +3667,7 @@ function xr(e, t, r) {
|
|
|
3667
3667
|
...S(r)
|
|
3668
3668
|
});
|
|
3669
3669
|
}
|
|
3670
|
-
const kr = /* @__PURE__ */
|
|
3670
|
+
const kr = /* @__PURE__ */ _("ZodEnum", (e, t) => {
|
|
3671
3671
|
El.init(e, t), q.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3672
3672
|
const r = new Set(Object.keys(t.entries));
|
|
3673
3673
|
e.extract = (n, o) => {
|
|
@@ -3706,7 +3706,7 @@ function rr(e, t) {
|
|
|
3706
3706
|
...S(t)
|
|
3707
3707
|
});
|
|
3708
3708
|
}
|
|
3709
|
-
const fd = /* @__PURE__ */
|
|
3709
|
+
const fd = /* @__PURE__ */ _("ZodLiteral", (e, t) => {
|
|
3710
3710
|
Tl.init(e, t), q.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
3711
3711
|
get() {
|
|
3712
3712
|
if (t.values.length > 1)
|
|
@@ -3722,14 +3722,14 @@ function T(e, t) {
|
|
|
3722
3722
|
...S(t)
|
|
3723
3723
|
});
|
|
3724
3724
|
}
|
|
3725
|
-
const gd = /* @__PURE__ */
|
|
3725
|
+
const gd = /* @__PURE__ */ _("ZodTransform", (e, t) => {
|
|
3726
3726
|
Sl.init(e, t), q.init(e, t), e._zod.parse = (r, n) => {
|
|
3727
3727
|
r.addIssue = (a) => {
|
|
3728
3728
|
if (typeof a == "string")
|
|
3729
|
-
r.issues.push(
|
|
3729
|
+
r.issues.push(gt(a, r.value, t));
|
|
3730
3730
|
else {
|
|
3731
3731
|
const i = a;
|
|
3732
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = r.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !0), r.issues.push(
|
|
3732
|
+
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = r.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !0), r.issues.push(gt(i));
|
|
3733
3733
|
}
|
|
3734
3734
|
};
|
|
3735
3735
|
const o = t.transform(r.value, r);
|
|
@@ -3742,7 +3742,7 @@ function vd(e) {
|
|
|
3742
3742
|
transform: e
|
|
3743
3743
|
});
|
|
3744
3744
|
}
|
|
3745
|
-
const da = /* @__PURE__ */
|
|
3745
|
+
const da = /* @__PURE__ */ _("ZodOptional", (e, t) => {
|
|
3746
3746
|
xl.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3747
3747
|
});
|
|
3748
3748
|
function Q(e) {
|
|
@@ -3751,7 +3751,7 @@ function Q(e) {
|
|
|
3751
3751
|
innerType: e
|
|
3752
3752
|
});
|
|
3753
3753
|
}
|
|
3754
|
-
const yd = /* @__PURE__ */
|
|
3754
|
+
const yd = /* @__PURE__ */ _("ZodNullable", (e, t) => {
|
|
3755
3755
|
kl.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3756
3756
|
});
|
|
3757
3757
|
function $n(e) {
|
|
@@ -3760,7 +3760,7 @@ function $n(e) {
|
|
|
3760
3760
|
innerType: e
|
|
3761
3761
|
});
|
|
3762
3762
|
}
|
|
3763
|
-
const _d = /* @__PURE__ */
|
|
3763
|
+
const _d = /* @__PURE__ */ _("ZodDefault", (e, t) => {
|
|
3764
3764
|
Cl.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
3765
3765
|
});
|
|
3766
3766
|
function bd(e, t) {
|
|
@@ -3772,7 +3772,7 @@ function bd(e, t) {
|
|
|
3772
3772
|
}
|
|
3773
3773
|
});
|
|
3774
3774
|
}
|
|
3775
|
-
const wd = /* @__PURE__ */
|
|
3775
|
+
const wd = /* @__PURE__ */ _("ZodPrefault", (e, t) => {
|
|
3776
3776
|
Nl.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3777
3777
|
});
|
|
3778
3778
|
function Id(e, t) {
|
|
@@ -3784,7 +3784,7 @@ function Id(e, t) {
|
|
|
3784
3784
|
}
|
|
3785
3785
|
});
|
|
3786
3786
|
}
|
|
3787
|
-
const pa = /* @__PURE__ */
|
|
3787
|
+
const pa = /* @__PURE__ */ _("ZodNonOptional", (e, t) => {
|
|
3788
3788
|
zl.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3789
3789
|
});
|
|
3790
3790
|
function Ed(e, t) {
|
|
@@ -3794,7 +3794,7 @@ function Ed(e, t) {
|
|
|
3794
3794
|
...S(t)
|
|
3795
3795
|
});
|
|
3796
3796
|
}
|
|
3797
|
-
const Td = /* @__PURE__ */
|
|
3797
|
+
const Td = /* @__PURE__ */ _("ZodCatch", (e, t) => {
|
|
3798
3798
|
Al.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3799
3799
|
});
|
|
3800
3800
|
function Sd(e, t) {
|
|
@@ -3804,7 +3804,7 @@ function Sd(e, t) {
|
|
|
3804
3804
|
catchValue: typeof t == "function" ? t : () => t
|
|
3805
3805
|
});
|
|
3806
3806
|
}
|
|
3807
|
-
const xd = /* @__PURE__ */
|
|
3807
|
+
const xd = /* @__PURE__ */ _("ZodPipe", (e, t) => {
|
|
3808
3808
|
Ol.init(e, t), q.init(e, t), e.in = t.in, e.out = t.out;
|
|
3809
3809
|
});
|
|
3810
3810
|
function Pn(e, t) {
|
|
@@ -3815,7 +3815,7 @@ function Pn(e, t) {
|
|
|
3815
3815
|
// ...util.normalizeParams(params),
|
|
3816
3816
|
});
|
|
3817
3817
|
}
|
|
3818
|
-
const kd = /* @__PURE__ */
|
|
3818
|
+
const kd = /* @__PURE__ */ _("ZodReadonly", (e, t) => {
|
|
3819
3819
|
Ml.init(e, t), q.init(e, t);
|
|
3820
3820
|
});
|
|
3821
3821
|
function Cd(e) {
|
|
@@ -3824,7 +3824,7 @@ function Cd(e) {
|
|
|
3824
3824
|
innerType: e
|
|
3825
3825
|
});
|
|
3826
3826
|
}
|
|
3827
|
-
const Nd = /* @__PURE__ */
|
|
3827
|
+
const Nd = /* @__PURE__ */ _("ZodLazy", (e, t) => {
|
|
3828
3828
|
$l.init(e, t), q.init(e, t), e.unwrap = () => e._zod.def.getter();
|
|
3829
3829
|
});
|
|
3830
3830
|
function zd(e) {
|
|
@@ -3833,7 +3833,7 @@ function zd(e) {
|
|
|
3833
3833
|
getter: e
|
|
3834
3834
|
});
|
|
3835
3835
|
}
|
|
3836
|
-
const jr = /* @__PURE__ */
|
|
3836
|
+
const jr = /* @__PURE__ */ _("ZodCustom", (e, t) => {
|
|
3837
3837
|
Pl.init(e, t), q.init(e, t);
|
|
3838
3838
|
});
|
|
3839
3839
|
function Ad(e) {
|
|
@@ -3852,10 +3852,10 @@ function Md(e, t = {}) {
|
|
|
3852
3852
|
function $d(e) {
|
|
3853
3853
|
const t = Ad((r) => (r.addIssue = (n) => {
|
|
3854
3854
|
if (typeof n == "string")
|
|
3855
|
-
r.issues.push(
|
|
3855
|
+
r.issues.push(gt(n, r.value, t._zod.def));
|
|
3856
3856
|
else {
|
|
3857
3857
|
const o = n;
|
|
3858
|
-
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = r.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), r.issues.push(
|
|
3858
|
+
o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = r.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), r.issues.push(gt(o));
|
|
3859
3859
|
}
|
|
3860
3860
|
}, e(r.value, r)));
|
|
3861
3861
|
return t;
|
|
@@ -4008,7 +4008,7 @@ function Hd({
|
|
|
4008
4008
|
})
|
|
4009
4009
|
);
|
|
4010
4010
|
}
|
|
4011
|
-
async function
|
|
4011
|
+
async function qe(e) {
|
|
4012
4012
|
return typeof e == "function" && (e = e()), Promise.resolve(e);
|
|
4013
4013
|
}
|
|
4014
4014
|
var Jd = (e, t) => {
|
|
@@ -5000,43 +5000,43 @@ var ba = ee([
|
|
|
5000
5000
|
},
|
|
5001
5001
|
{ message: "Must be a Buffer" }
|
|
5002
5002
|
)
|
|
5003
|
-
]),
|
|
5003
|
+
]), yt = zd(
|
|
5004
5004
|
() => ee([
|
|
5005
5005
|
sd(),
|
|
5006
5006
|
w(),
|
|
5007
|
-
|
|
5007
|
+
vt(),
|
|
5008
5008
|
X(),
|
|
5009
|
-
xr(w(),
|
|
5010
|
-
Se(
|
|
5009
|
+
xr(w(), yt),
|
|
5010
|
+
Se(yt)
|
|
5011
5011
|
])
|
|
5012
|
-
),
|
|
5012
|
+
), R = xr(
|
|
5013
5013
|
w(),
|
|
5014
|
-
xr(w(),
|
|
5014
|
+
xr(w(), yt)
|
|
5015
5015
|
), wa = C({
|
|
5016
5016
|
type: T("text"),
|
|
5017
5017
|
text: w(),
|
|
5018
|
-
providerOptions:
|
|
5018
|
+
providerOptions: R.optional()
|
|
5019
5019
|
}), jp = C({
|
|
5020
5020
|
type: T("image"),
|
|
5021
5021
|
image: ee([ba, Wt(URL)]),
|
|
5022
5022
|
mediaType: w().optional(),
|
|
5023
|
-
providerOptions:
|
|
5023
|
+
providerOptions: R.optional()
|
|
5024
5024
|
}), Ia = C({
|
|
5025
5025
|
type: T("file"),
|
|
5026
5026
|
data: ee([ba, Wt(URL)]),
|
|
5027
5027
|
filename: w().optional(),
|
|
5028
5028
|
mediaType: w(),
|
|
5029
|
-
providerOptions:
|
|
5029
|
+
providerOptions: R.optional()
|
|
5030
5030
|
}), Vp = C({
|
|
5031
5031
|
type: T("reasoning"),
|
|
5032
5032
|
text: w(),
|
|
5033
|
-
providerOptions:
|
|
5033
|
+
providerOptions: R.optional()
|
|
5034
5034
|
}), Fp = C({
|
|
5035
5035
|
type: T("tool-call"),
|
|
5036
5036
|
toolCallId: w(),
|
|
5037
5037
|
toolName: w(),
|
|
5038
5038
|
input: H(),
|
|
5039
|
-
providerOptions:
|
|
5039
|
+
providerOptions: R.optional(),
|
|
5040
5040
|
providerExecuted: X().optional()
|
|
5041
5041
|
}), Hp = dd("type", [
|
|
5042
5042
|
C({
|
|
@@ -5045,7 +5045,7 @@ var ba = ee([
|
|
|
5045
5045
|
}),
|
|
5046
5046
|
C({
|
|
5047
5047
|
type: T("json"),
|
|
5048
|
-
value:
|
|
5048
|
+
value: yt
|
|
5049
5049
|
}),
|
|
5050
5050
|
C({
|
|
5051
5051
|
type: T("error-text"),
|
|
@@ -5053,7 +5053,7 @@ var ba = ee([
|
|
|
5053
5053
|
}),
|
|
5054
5054
|
C({
|
|
5055
5055
|
type: T("error-json"),
|
|
5056
|
-
value:
|
|
5056
|
+
value: yt
|
|
5057
5057
|
}),
|
|
5058
5058
|
C({
|
|
5059
5059
|
type: T("content"),
|
|
@@ -5076,12 +5076,12 @@ var ba = ee([
|
|
|
5076
5076
|
toolCallId: w(),
|
|
5077
5077
|
toolName: w(),
|
|
5078
5078
|
output: Hp,
|
|
5079
|
-
providerOptions:
|
|
5079
|
+
providerOptions: R.optional()
|
|
5080
5080
|
}), Jp = C(
|
|
5081
5081
|
{
|
|
5082
5082
|
role: T("system"),
|
|
5083
5083
|
content: w(),
|
|
5084
|
-
providerOptions:
|
|
5084
|
+
providerOptions: R.optional()
|
|
5085
5085
|
}
|
|
5086
5086
|
), Gp = C({
|
|
5087
5087
|
role: T("user"),
|
|
@@ -5089,7 +5089,7 @@ var ba = ee([
|
|
|
5089
5089
|
w(),
|
|
5090
5090
|
Se(ee([wa, jp, Ia]))
|
|
5091
5091
|
]),
|
|
5092
|
-
providerOptions:
|
|
5092
|
+
providerOptions: R.optional()
|
|
5093
5093
|
}), Wp = C({
|
|
5094
5094
|
role: T("assistant"),
|
|
5095
5095
|
content: ee([
|
|
@@ -5104,11 +5104,11 @@ var ba = ee([
|
|
|
5104
5104
|
])
|
|
5105
5105
|
)
|
|
5106
5106
|
]),
|
|
5107
|
-
providerOptions:
|
|
5107
|
+
providerOptions: R.optional()
|
|
5108
5108
|
}), qp = C({
|
|
5109
5109
|
role: T("tool"),
|
|
5110
5110
|
content: Se(Ea),
|
|
5111
|
-
providerOptions:
|
|
5111
|
+
providerOptions: R.optional()
|
|
5112
5112
|
});
|
|
5113
5113
|
ee([
|
|
5114
5114
|
Jp,
|
|
@@ -5124,18 +5124,18 @@ var Yp = ee([
|
|
|
5124
5124
|
V({
|
|
5125
5125
|
type: T("text-start"),
|
|
5126
5126
|
id: w(),
|
|
5127
|
-
providerMetadata:
|
|
5127
|
+
providerMetadata: R.optional()
|
|
5128
5128
|
}),
|
|
5129
5129
|
V({
|
|
5130
5130
|
type: T("text-delta"),
|
|
5131
5131
|
id: w(),
|
|
5132
5132
|
delta: w(),
|
|
5133
|
-
providerMetadata:
|
|
5133
|
+
providerMetadata: R.optional()
|
|
5134
5134
|
}),
|
|
5135
5135
|
V({
|
|
5136
5136
|
type: T("text-end"),
|
|
5137
5137
|
id: w(),
|
|
5138
|
-
providerMetadata:
|
|
5138
|
+
providerMetadata: R.optional()
|
|
5139
5139
|
}),
|
|
5140
5140
|
V({
|
|
5141
5141
|
type: T("error"),
|
|
@@ -5159,7 +5159,7 @@ var Yp = ee([
|
|
|
5159
5159
|
toolName: w(),
|
|
5160
5160
|
input: H(),
|
|
5161
5161
|
providerExecuted: X().optional(),
|
|
5162
|
-
providerMetadata:
|
|
5162
|
+
providerMetadata: R.optional(),
|
|
5163
5163
|
dynamic: X().optional()
|
|
5164
5164
|
}),
|
|
5165
5165
|
V({
|
|
@@ -5168,7 +5168,7 @@ var Yp = ee([
|
|
|
5168
5168
|
toolName: w(),
|
|
5169
5169
|
input: H(),
|
|
5170
5170
|
providerExecuted: X().optional(),
|
|
5171
|
-
providerMetadata:
|
|
5171
|
+
providerMetadata: R.optional(),
|
|
5172
5172
|
dynamic: X().optional(),
|
|
5173
5173
|
errorText: w()
|
|
5174
5174
|
}),
|
|
@@ -5190,23 +5190,23 @@ var Yp = ee([
|
|
|
5190
5190
|
V({
|
|
5191
5191
|
type: T("reasoning"),
|
|
5192
5192
|
text: w(),
|
|
5193
|
-
providerMetadata:
|
|
5193
|
+
providerMetadata: R.optional()
|
|
5194
5194
|
}),
|
|
5195
5195
|
V({
|
|
5196
5196
|
type: T("reasoning-start"),
|
|
5197
5197
|
id: w(),
|
|
5198
|
-
providerMetadata:
|
|
5198
|
+
providerMetadata: R.optional()
|
|
5199
5199
|
}),
|
|
5200
5200
|
V({
|
|
5201
5201
|
type: T("reasoning-delta"),
|
|
5202
5202
|
id: w(),
|
|
5203
5203
|
delta: w(),
|
|
5204
|
-
providerMetadata:
|
|
5204
|
+
providerMetadata: R.optional()
|
|
5205
5205
|
}),
|
|
5206
5206
|
V({
|
|
5207
5207
|
type: T("reasoning-end"),
|
|
5208
5208
|
id: w(),
|
|
5209
|
-
providerMetadata:
|
|
5209
|
+
providerMetadata: R.optional()
|
|
5210
5210
|
}),
|
|
5211
5211
|
V({
|
|
5212
5212
|
type: T("reasoning-part-finish")
|
|
@@ -5216,7 +5216,7 @@ var Yp = ee([
|
|
|
5216
5216
|
sourceId: w(),
|
|
5217
5217
|
url: w(),
|
|
5218
5218
|
title: w().optional(),
|
|
5219
|
-
providerMetadata:
|
|
5219
|
+
providerMetadata: R.optional()
|
|
5220
5220
|
}),
|
|
5221
5221
|
V({
|
|
5222
5222
|
type: T("source-document"),
|
|
@@ -5224,13 +5224,13 @@ var Yp = ee([
|
|
|
5224
5224
|
mediaType: w(),
|
|
5225
5225
|
title: w(),
|
|
5226
5226
|
filename: w().optional(),
|
|
5227
|
-
providerMetadata:
|
|
5227
|
+
providerMetadata: R.optional()
|
|
5228
5228
|
}),
|
|
5229
5229
|
V({
|
|
5230
5230
|
type: T("file"),
|
|
5231
5231
|
url: w(),
|
|
5232
5232
|
mediaType: w(),
|
|
5233
|
-
providerMetadata:
|
|
5233
|
+
providerMetadata: R.optional()
|
|
5234
5234
|
}),
|
|
5235
5235
|
V({
|
|
5236
5236
|
type: w().startsWith("data-"),
|
|
@@ -5582,33 +5582,33 @@ function tm({
|
|
|
5582
5582
|
await n(async ({ state: c, write: p }) => {
|
|
5583
5583
|
var d, f, g, m;
|
|
5584
5584
|
function h(b) {
|
|
5585
|
-
const
|
|
5585
|
+
const A = c.message.parts.filter(Rt).find(
|
|
5586
5586
|
(k) => k.toolCallId === b
|
|
5587
5587
|
);
|
|
5588
|
-
if (
|
|
5588
|
+
if (A == null)
|
|
5589
5589
|
throw new Error(
|
|
5590
5590
|
"tool-output-error must be preceded by a tool-input-available"
|
|
5591
5591
|
);
|
|
5592
|
-
return
|
|
5592
|
+
return A;
|
|
5593
5593
|
}
|
|
5594
5594
|
function v(b) {
|
|
5595
|
-
const
|
|
5595
|
+
const A = c.message.parts.filter(
|
|
5596
5596
|
(k) => k.type === "dynamic-tool"
|
|
5597
5597
|
).find(
|
|
5598
5598
|
(k) => k.toolCallId === b
|
|
5599
5599
|
);
|
|
5600
|
-
if (
|
|
5600
|
+
if (A == null)
|
|
5601
5601
|
throw new Error(
|
|
5602
5602
|
"tool-output-error must be preceded by a tool-input-available"
|
|
5603
5603
|
);
|
|
5604
|
-
return
|
|
5604
|
+
return A;
|
|
5605
5605
|
}
|
|
5606
5606
|
function I(b) {
|
|
5607
|
-
var
|
|
5608
|
-
const
|
|
5607
|
+
var z;
|
|
5608
|
+
const A = c.message.parts.find(
|
|
5609
5609
|
(ie) => Rt(ie) && ie.toolCallId === b.toolCallId
|
|
5610
|
-
), k = b,
|
|
5611
|
-
|
|
5610
|
+
), k = b, O = A;
|
|
5611
|
+
A != null ? (A.state = b.state, O.input = k.input, O.output = k.output, O.errorText = k.errorText, O.rawInput = k.rawInput, O.preliminary = k.preliminary, O.providerExecuted = (z = k.providerExecuted) != null ? z : A.providerExecuted, k.providerMetadata != null && A.state === "input-available" && (A.callProviderMetadata = k.providerMetadata)) : c.message.parts.push({
|
|
5612
5612
|
type: `tool-${b.toolName}`,
|
|
5613
5613
|
toolCallId: b.toolCallId,
|
|
5614
5614
|
state: b.state,
|
|
@@ -5621,12 +5621,12 @@ function tm({
|
|
|
5621
5621
|
...k.providerMetadata != null ? { callProviderMetadata: k.providerMetadata } : {}
|
|
5622
5622
|
});
|
|
5623
5623
|
}
|
|
5624
|
-
function
|
|
5625
|
-
var
|
|
5626
|
-
const
|
|
5624
|
+
function y(b) {
|
|
5625
|
+
var z;
|
|
5626
|
+
const A = c.message.parts.find(
|
|
5627
5627
|
(ie) => ie.type === "dynamic-tool" && ie.toolCallId === b.toolCallId
|
|
5628
|
-
), k = b,
|
|
5629
|
-
|
|
5628
|
+
), k = b, O = A;
|
|
5629
|
+
A != null ? (A.state = b.state, O.toolName = b.toolName, O.input = k.input, O.output = k.output, O.errorText = k.errorText, O.rawInput = (z = k.rawInput) != null ? z : O.rawInput, O.preliminary = k.preliminary, k.providerMetadata != null && A.state === "input-available" && (A.callProviderMetadata = k.providerMetadata)) : c.message.parts.push({
|
|
5630
5630
|
type: "dynamic-tool",
|
|
5631
5631
|
toolName: b.toolName,
|
|
5632
5632
|
toolCallId: b.toolCallId,
|
|
@@ -5640,11 +5640,11 @@ function tm({
|
|
|
5640
5640
|
}
|
|
5641
5641
|
async function E(b) {
|
|
5642
5642
|
if (b != null) {
|
|
5643
|
-
const
|
|
5643
|
+
const z = c.message.metadata != null ? Ta(c.message.metadata, b) : b;
|
|
5644
5644
|
t != null && await Rn({
|
|
5645
|
-
value:
|
|
5645
|
+
value: z,
|
|
5646
5646
|
schema: t
|
|
5647
|
-
}), c.message.metadata =
|
|
5647
|
+
}), c.message.metadata = z;
|
|
5648
5648
|
}
|
|
5649
5649
|
}
|
|
5650
5650
|
switch (s.type) {
|
|
@@ -5724,7 +5724,7 @@ function tm({
|
|
|
5724
5724
|
toolName: s.toolName,
|
|
5725
5725
|
index: b.length,
|
|
5726
5726
|
dynamic: s.dynamic
|
|
5727
|
-
}, s.dynamic ?
|
|
5727
|
+
}, s.dynamic ? y({
|
|
5728
5728
|
toolCallId: s.toolCallId,
|
|
5729
5729
|
toolName: s.toolName,
|
|
5730
5730
|
state: "input-streaming",
|
|
@@ -5741,24 +5741,24 @@ function tm({
|
|
|
5741
5741
|
case "tool-input-delta": {
|
|
5742
5742
|
const b = c.partialToolCalls[s.toolCallId];
|
|
5743
5743
|
b.text += s.inputTextDelta;
|
|
5744
|
-
const { value:
|
|
5744
|
+
const { value: z } = await Sa(
|
|
5745
5745
|
b.text
|
|
5746
5746
|
);
|
|
5747
|
-
b.dynamic ?
|
|
5747
|
+
b.dynamic ? y({
|
|
5748
5748
|
toolCallId: s.toolCallId,
|
|
5749
5749
|
toolName: b.toolName,
|
|
5750
5750
|
state: "input-streaming",
|
|
5751
|
-
input:
|
|
5751
|
+
input: z
|
|
5752
5752
|
}) : I({
|
|
5753
5753
|
toolCallId: s.toolCallId,
|
|
5754
5754
|
toolName: b.toolName,
|
|
5755
5755
|
state: "input-streaming",
|
|
5756
|
-
input:
|
|
5756
|
+
input: z
|
|
5757
5757
|
}), p();
|
|
5758
5758
|
break;
|
|
5759
5759
|
}
|
|
5760
5760
|
case "tool-input-available": {
|
|
5761
|
-
s.dynamic ?
|
|
5761
|
+
s.dynamic ? y({
|
|
5762
5762
|
toolCallId: s.toolCallId,
|
|
5763
5763
|
toolName: s.toolName,
|
|
5764
5764
|
state: "input-available",
|
|
@@ -5777,7 +5777,7 @@ function tm({
|
|
|
5777
5777
|
break;
|
|
5778
5778
|
}
|
|
5779
5779
|
case "tool-input-error": {
|
|
5780
|
-
s.dynamic ?
|
|
5780
|
+
s.dynamic ? y({
|
|
5781
5781
|
toolCallId: s.toolCallId,
|
|
5782
5782
|
toolName: s.toolName,
|
|
5783
5783
|
state: "output-error",
|
|
@@ -5801,7 +5801,7 @@ function tm({
|
|
|
5801
5801
|
const b = v(
|
|
5802
5802
|
s.toolCallId
|
|
5803
5803
|
);
|
|
5804
|
-
|
|
5804
|
+
y({
|
|
5805
5805
|
toolCallId: s.toolCallId,
|
|
5806
5806
|
toolName: b.toolName,
|
|
5807
5807
|
state: "output-available",
|
|
@@ -5829,7 +5829,7 @@ function tm({
|
|
|
5829
5829
|
const b = v(
|
|
5830
5830
|
s.toolCallId
|
|
5831
5831
|
);
|
|
5832
|
-
|
|
5832
|
+
y({
|
|
5833
5833
|
toolCallId: s.toolCallId,
|
|
5834
5834
|
toolName: b.toolName,
|
|
5835
5835
|
state: "output-error",
|
|
@@ -5885,10 +5885,10 @@ function tm({
|
|
|
5885
5885
|
i?.(b);
|
|
5886
5886
|
break;
|
|
5887
5887
|
}
|
|
5888
|
-
const
|
|
5889
|
-
(
|
|
5888
|
+
const z = b.id != null ? c.message.parts.find(
|
|
5889
|
+
(A) => b.type === A.type && b.id === A.id
|
|
5890
5890
|
) : void 0;
|
|
5891
|
-
|
|
5891
|
+
z != null ? z.data = b.data : c.message.parts.push(b), i?.(b), p();
|
|
5892
5892
|
}
|
|
5893
5893
|
}
|
|
5894
5894
|
u.enqueue(s);
|
|
@@ -6012,41 +6012,41 @@ var am = () => ({
|
|
|
6012
6012
|
return a.value;
|
|
6013
6013
|
}
|
|
6014
6014
|
};
|
|
6015
|
-
}, im =
|
|
6015
|
+
}, im = tt({
|
|
6016
6016
|
name: w(),
|
|
6017
6017
|
version: w()
|
|
6018
|
-
}), Hr =
|
|
6018
|
+
}), Hr = tt({
|
|
6019
6019
|
_meta: Q(C({}).loose())
|
|
6020
|
-
}),
|
|
6020
|
+
}), _t = Hr, cm = C({
|
|
6021
6021
|
method: w(),
|
|
6022
6022
|
params: Q(Hr)
|
|
6023
|
-
}), lm =
|
|
6023
|
+
}), lm = tt({
|
|
6024
6024
|
experimental: Q(C({}).loose()),
|
|
6025
6025
|
logging: Q(C({}).loose()),
|
|
6026
6026
|
prompts: Q(
|
|
6027
|
-
|
|
6027
|
+
tt({
|
|
6028
6028
|
listChanged: Q(X())
|
|
6029
6029
|
})
|
|
6030
6030
|
),
|
|
6031
6031
|
resources: Q(
|
|
6032
|
-
|
|
6032
|
+
tt({
|
|
6033
6033
|
subscribe: Q(X()),
|
|
6034
6034
|
listChanged: Q(X())
|
|
6035
6035
|
})
|
|
6036
6036
|
),
|
|
6037
6037
|
tools: Q(
|
|
6038
|
-
|
|
6038
|
+
tt({
|
|
6039
6039
|
listChanged: Q(X())
|
|
6040
6040
|
})
|
|
6041
6041
|
)
|
|
6042
6042
|
});
|
|
6043
|
-
|
|
6043
|
+
_t.extend({
|
|
6044
6044
|
protocolVersion: w(),
|
|
6045
6045
|
capabilities: lm,
|
|
6046
6046
|
serverInfo: im,
|
|
6047
6047
|
instructions: Q(w())
|
|
6048
6048
|
});
|
|
6049
|
-
var um =
|
|
6049
|
+
var um = _t.extend({
|
|
6050
6050
|
nextCursor: Q(w())
|
|
6051
6051
|
}), dm = C({
|
|
6052
6052
|
name: w(),
|
|
@@ -6083,28 +6083,28 @@ var pm = C({
|
|
|
6083
6083
|
type: T("resource"),
|
|
6084
6084
|
resource: ee([hm, fm])
|
|
6085
6085
|
}).loose();
|
|
6086
|
-
|
|
6086
|
+
_t.extend({
|
|
6087
6087
|
content: Se(
|
|
6088
6088
|
ee([pm, mm, gm])
|
|
6089
6089
|
),
|
|
6090
6090
|
isError: X().default(!1).optional()
|
|
6091
6091
|
}).or(
|
|
6092
|
-
|
|
6092
|
+
_t.extend({
|
|
6093
6093
|
toolResult: H()
|
|
6094
6094
|
})
|
|
6095
6095
|
);
|
|
6096
6096
|
var nr = "2.0", vm = C({
|
|
6097
6097
|
jsonrpc: T(nr),
|
|
6098
|
-
id: ee([w(),
|
|
6098
|
+
id: ee([w(), vt().int()])
|
|
6099
6099
|
}).merge(cm).strict(), ym = C({
|
|
6100
6100
|
jsonrpc: T(nr),
|
|
6101
|
-
id: ee([w(),
|
|
6102
|
-
result:
|
|
6101
|
+
id: ee([w(), vt().int()]),
|
|
6102
|
+
result: _t
|
|
6103
6103
|
}).strict(), _m = C({
|
|
6104
6104
|
jsonrpc: T(nr),
|
|
6105
|
-
id: ee([w(),
|
|
6105
|
+
id: ee([w(), vt().int()]),
|
|
6106
6106
|
error: C({
|
|
6107
|
-
code:
|
|
6107
|
+
code: vt().int(),
|
|
6108
6108
|
message: w(),
|
|
6109
6109
|
data: Q(H())
|
|
6110
6110
|
})
|
|
@@ -6162,7 +6162,7 @@ var Im = class {
|
|
|
6162
6162
|
...t
|
|
6163
6163
|
}) {
|
|
6164
6164
|
var r, n, o, a, i;
|
|
6165
|
-
const s = await
|
|
6165
|
+
const s = await qe(this.body), u = await qe(this.headers), c = await qe(this.credentials), p = await ((r = this.prepareSendMessagesRequest) == null ? void 0 : r.call(this, {
|
|
6166
6166
|
api: this.api,
|
|
6167
6167
|
id: t.chatId,
|
|
6168
6168
|
messages: t.messages,
|
|
@@ -6199,7 +6199,7 @@ var Im = class {
|
|
|
6199
6199
|
}
|
|
6200
6200
|
async reconnectToStream(e) {
|
|
6201
6201
|
var t, r, n, o, a;
|
|
6202
|
-
const i = await
|
|
6202
|
+
const i = await qe(this.body), s = await qe(this.headers), u = await qe(this.credentials), c = await ((t = this.prepareReconnectToStreamRequest) == null ? void 0 : t.call(this, {
|
|
6203
6203
|
api: this.api,
|
|
6204
6204
|
id: e.chatId,
|
|
6205
6205
|
body: { ...i, ...e.body },
|
|
@@ -6270,16 +6270,16 @@ var Im = class {
|
|
|
6270
6270
|
..."text" in d && d.text != null ? [{ type: "text", text: d.text }] : []
|
|
6271
6271
|
]
|
|
6272
6272
|
} : I = d, d.messageId != null) {
|
|
6273
|
-
const
|
|
6273
|
+
const y = this.state.messages.findIndex(
|
|
6274
6274
|
(E) => E.id === d.messageId
|
|
6275
6275
|
);
|
|
6276
|
-
if (
|
|
6276
|
+
if (y === -1)
|
|
6277
6277
|
throw new Error(`message with id ${d.messageId} not found`);
|
|
6278
|
-
if (this.state.messages[
|
|
6278
|
+
if (this.state.messages[y].role !== "user")
|
|
6279
6279
|
throw new Error(
|
|
6280
6280
|
`message with id ${d.messageId} is not a user message`
|
|
6281
6281
|
);
|
|
6282
|
-
this.state.messages = this.state.messages.slice(0,
|
|
6282
|
+
this.state.messages = this.state.messages.slice(0, y + 1), this.state.replaceMessage(y, {
|
|
6283
6283
|
...I,
|
|
6284
6284
|
id: d.messageId,
|
|
6285
6285
|
role: (m = I.role) != null ? m : "user",
|
|
@@ -6327,15 +6327,15 @@ var Im = class {
|
|
|
6327
6327
|
this.state.replaceMessage(v.length - 1, {
|
|
6328
6328
|
...I,
|
|
6329
6329
|
parts: I.parts.map(
|
|
6330
|
-
(
|
|
6330
|
+
(y) => Un(y) && y.toolCallId === f ? { ...y, state: "output-available", output: g } : y
|
|
6331
6331
|
)
|
|
6332
6332
|
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(
|
|
6333
|
-
(
|
|
6334
|
-
...
|
|
6333
|
+
(y) => Un(y) && y.toolCallId === f ? {
|
|
6334
|
+
...y,
|
|
6335
6335
|
state: "output-available",
|
|
6336
6336
|
output: g,
|
|
6337
6337
|
errorText: void 0
|
|
6338
|
-
} :
|
|
6338
|
+
} : y
|
|
6339
6339
|
)), this.status !== "streaming" && this.status !== "submitted" && ((m = this.sendAutomaticallyWhen) != null && m.call(this, { messages: this.state.messages })) && this.makeRequest({
|
|
6340
6340
|
trigger: "submit-message",
|
|
6341
6341
|
messageId: (h = this.lastMessage) == null ? void 0 : h.id
|
|
@@ -6481,31 +6481,31 @@ var Im = class {
|
|
|
6481
6481
|
type: T("text"),
|
|
6482
6482
|
text: w(),
|
|
6483
6483
|
state: rr(["streaming", "done"]).optional(),
|
|
6484
|
-
providerMetadata:
|
|
6484
|
+
providerMetadata: R.optional()
|
|
6485
6485
|
}), Sm = C({
|
|
6486
6486
|
type: T("reasoning"),
|
|
6487
6487
|
text: w(),
|
|
6488
6488
|
state: rr(["streaming", "done"]).optional(),
|
|
6489
|
-
providerMetadata:
|
|
6489
|
+
providerMetadata: R.optional()
|
|
6490
6490
|
}), xm = C({
|
|
6491
6491
|
type: T("source-url"),
|
|
6492
6492
|
sourceId: w(),
|
|
6493
6493
|
url: w(),
|
|
6494
6494
|
title: w().optional(),
|
|
6495
|
-
providerMetadata:
|
|
6495
|
+
providerMetadata: R.optional()
|
|
6496
6496
|
}), km = C({
|
|
6497
6497
|
type: T("source-document"),
|
|
6498
6498
|
sourceId: w(),
|
|
6499
6499
|
mediaType: w(),
|
|
6500
6500
|
title: w(),
|
|
6501
6501
|
filename: w().optional(),
|
|
6502
|
-
providerMetadata:
|
|
6502
|
+
providerMetadata: R.optional()
|
|
6503
6503
|
}), Cm = C({
|
|
6504
6504
|
type: T("file"),
|
|
6505
6505
|
mediaType: w(),
|
|
6506
6506
|
filename: w().optional(),
|
|
6507
6507
|
url: w(),
|
|
6508
|
-
providerMetadata:
|
|
6508
|
+
providerMetadata: R.optional()
|
|
6509
6509
|
}), Nm = C({
|
|
6510
6510
|
type: T("step-start")
|
|
6511
6511
|
}), zm = C({
|
|
@@ -6530,7 +6530,7 @@ var Im = class {
|
|
|
6530
6530
|
input: H(),
|
|
6531
6531
|
output: le().optional(),
|
|
6532
6532
|
errorText: le().optional(),
|
|
6533
|
-
callProviderMetadata:
|
|
6533
|
+
callProviderMetadata: R.optional()
|
|
6534
6534
|
}),
|
|
6535
6535
|
C({
|
|
6536
6536
|
type: T("dynamic-tool"),
|
|
@@ -6540,7 +6540,7 @@ var Im = class {
|
|
|
6540
6540
|
input: H(),
|
|
6541
6541
|
output: H(),
|
|
6542
6542
|
errorText: le().optional(),
|
|
6543
|
-
callProviderMetadata:
|
|
6543
|
+
callProviderMetadata: R.optional(),
|
|
6544
6544
|
preliminary: X().optional()
|
|
6545
6545
|
}),
|
|
6546
6546
|
C({
|
|
@@ -6551,7 +6551,7 @@ var Im = class {
|
|
|
6551
6551
|
input: H(),
|
|
6552
6552
|
output: le().optional(),
|
|
6553
6553
|
errorText: w(),
|
|
6554
|
-
callProviderMetadata:
|
|
6554
|
+
callProviderMetadata: R.optional()
|
|
6555
6555
|
})
|
|
6556
6556
|
], Om = [
|
|
6557
6557
|
C({
|
|
@@ -6569,7 +6569,7 @@ var Im = class {
|
|
|
6569
6569
|
input: H(),
|
|
6570
6570
|
output: le().optional(),
|
|
6571
6571
|
errorText: le().optional(),
|
|
6572
|
-
callProviderMetadata:
|
|
6572
|
+
callProviderMetadata: R.optional()
|
|
6573
6573
|
}),
|
|
6574
6574
|
C({
|
|
6575
6575
|
type: w().startsWith("tool-"),
|
|
@@ -6578,7 +6578,7 @@ var Im = class {
|
|
|
6578
6578
|
input: H(),
|
|
6579
6579
|
output: H(),
|
|
6580
6580
|
errorText: le().optional(),
|
|
6581
|
-
callProviderMetadata:
|
|
6581
|
+
callProviderMetadata: R.optional(),
|
|
6582
6582
|
preliminary: X().optional()
|
|
6583
6583
|
}),
|
|
6584
6584
|
C({
|
|
@@ -6588,7 +6588,7 @@ var Im = class {
|
|
|
6588
6588
|
input: H(),
|
|
6589
6589
|
output: le().optional(),
|
|
6590
6590
|
errorText: w(),
|
|
6591
|
-
callProviderMetadata:
|
|
6591
|
+
callProviderMetadata: R.optional()
|
|
6592
6592
|
})
|
|
6593
6593
|
];
|
|
6594
6594
|
C({
|
|
@@ -6641,7 +6641,7 @@ const ka = async () => (gr || (gr = import(
|
|
|
6641
6641
|
"./index.BwP0kG4H.js"
|
|
6642
6642
|
)), gr), Ca = async () => (vr || (vr = import(
|
|
6643
6643
|
/* webpackChunkName: "toast-utilities" */
|
|
6644
|
-
"./index.
|
|
6644
|
+
"./index.DkQzq-rg.js"
|
|
6645
6645
|
).then((e) => e.utilities)), vr), Zm = async () => {
|
|
6646
6646
|
try {
|
|
6647
6647
|
await Promise.all([ka(), Ca()]);
|
|
@@ -6663,7 +6663,7 @@ const ka = async () => (gr || (gr = import(
|
|
|
6663
6663
|
}, 100);
|
|
6664
6664
|
} catch {
|
|
6665
6665
|
}
|
|
6666
|
-
}, Xt = (e, t) => Na(e, "success", t), Of = (e, t) => Na(e, "error", t),
|
|
6666
|
+
}, Xt = (e, t) => Na(e, "success", t), Of = (e, t) => Na(e, "error", t), mt = "FOOTER_BOTTOM", Qt = "FOOTER_TOP", Zt = "APP_SET_FOOTER_POSITION", za = "APP_SET_FOOTER_HEIGHT", Dm = (e, t) => {
|
|
6667
6667
|
switch (t.type) {
|
|
6668
6668
|
case Zt:
|
|
6669
6669
|
return {
|
|
@@ -6679,19 +6679,19 @@ const ka = async () => (gr || (gr = import(
|
|
|
6679
6679
|
default:
|
|
6680
6680
|
return e;
|
|
6681
6681
|
}
|
|
6682
|
-
},
|
|
6682
|
+
}, rt = "CHAT_SET_STATUS", Aa = "CHAT_SET_USAGE", at = "CHAT_SET_ATTACHMENTS", Oa = "CHAT_SET_PROVIDER", Fe = "CHAT_RESET", Lm = (e, t) => {
|
|
6683
6683
|
switch (t.type) {
|
|
6684
6684
|
case Aa:
|
|
6685
6685
|
return {
|
|
6686
6686
|
...e,
|
|
6687
6687
|
tokenUsage: e.tokenUsage + t.payload.tokenUsage
|
|
6688
6688
|
};
|
|
6689
|
-
case
|
|
6689
|
+
case at:
|
|
6690
6690
|
return {
|
|
6691
6691
|
...e,
|
|
6692
6692
|
attachments: t.payload.attachments
|
|
6693
6693
|
};
|
|
6694
|
-
case
|
|
6694
|
+
case rt: {
|
|
6695
6695
|
let r = !1, n = !1, o = !1, a = !1, i = "", s = 0, u = e.tokenUsage;
|
|
6696
6696
|
return typeof t?.payload?.loading == "boolean" ? o = t.payload.loading : typeof e.loading == "boolean" && (o = e.loading), typeof t?.payload?.streaming == "boolean" ? n = t.payload.streaming : typeof e.streaming == "boolean" && (n = e.streaming), typeof t?.payload?.restoring == "boolean" ? (r = t.payload.restoring, i = t.payload.restoredModel || "", s = t.payload.restoredUsage || 0, r && (u = s)) : typeof e.restoring == "boolean" && (r = e.restoring, i = e.restoredModel || "", s = e.restoredUsage || 0), typeof t?.payload?.aborted == "boolean" ? a = t.payload.aborted : typeof e.aborted == "boolean" && (a = e.aborted), (n || o) && (r = !1, i = "", s = 0, a = !1), {
|
|
6697
6697
|
...e,
|
|
@@ -6712,7 +6712,7 @@ const ka = async () => (gr || (gr = import(
|
|
|
6712
6712
|
...e,
|
|
6713
6713
|
provider: t.payload.provider
|
|
6714
6714
|
};
|
|
6715
|
-
case
|
|
6715
|
+
case Fe: {
|
|
6716
6716
|
let r = !1, n = !1;
|
|
6717
6717
|
return typeof t?.payload?.privateChat == "boolean" ? r = t.payload.privateChat : typeof e.privateChat == "boolean" && (r = e.privateChat), typeof t?.payload?.reasoning == "boolean" ? n = t.payload.reasoning : typeof e.reasoning == "boolean" && (n = e.reasoning), {
|
|
6718
6718
|
privateChat: r,
|
|
@@ -6740,7 +6740,7 @@ const ka = async () => (gr || (gr = import(
|
|
|
6740
6740
|
sortDirection: e.sortDirection
|
|
6741
6741
|
};
|
|
6742
6742
|
case Xa: {
|
|
6743
|
-
const r = t.payload.sortDirection, n = r ===
|
|
6743
|
+
const r = t.payload.sortDirection, n = r === ot.ASC || r === ot.DESC ? r : ot.DESC;
|
|
6744
6744
|
return {
|
|
6745
6745
|
searchString: e.searchString,
|
|
6746
6746
|
sortedCell: t.payload.sortedCell,
|
|
@@ -6792,7 +6792,7 @@ const Hm = /* @__PURE__ */ jm(Fm);
|
|
|
6792
6792
|
var Ma = (e, t, r) => {
|
|
6793
6793
|
if (!t.has(e))
|
|
6794
6794
|
throw TypeError("Cannot " + r);
|
|
6795
|
-
}, F = (e, t, r) => (Ma(e, t, "read from private field"), r ? r.call(e) : t.get(e)),
|
|
6795
|
+
}, F = (e, t, r) => (Ma(e, t, "read from private field"), r ? r.call(e) : t.get(e)), be = (e, t, r) => {
|
|
6796
6796
|
if (t.has(e))
|
|
6797
6797
|
throw TypeError("Cannot add the same private member more than once");
|
|
6798
6798
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
@@ -6800,34 +6800,34 @@ var Ma = (e, t, r) => {
|
|
|
6800
6800
|
function Jm(e, t) {
|
|
6801
6801
|
return t != null ? Hm(e, t) : e;
|
|
6802
6802
|
}
|
|
6803
|
-
var me, Dt, Lt,
|
|
6803
|
+
var me, Dt, Lt, lt, ut, dt, Ye, zr, Ar, Gm = class {
|
|
6804
6804
|
constructor(e = []) {
|
|
6805
|
-
|
|
6806
|
-
ze(this, me, F(this, me).concat(t)), F(this,
|
|
6805
|
+
be(this, me, void 0), be(this, Dt, "ready"), be(this, Lt, void 0), be(this, lt, /* @__PURE__ */ new Set()), be(this, ut, /* @__PURE__ */ new Set()), be(this, dt, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
|
|
6806
|
+
ze(this, me, F(this, me).concat(t)), F(this, Ye).call(this);
|
|
6807
6807
|
}, this.popMessage = () => {
|
|
6808
|
-
ze(this, me, F(this, me).slice(0, -1)), F(this,
|
|
6808
|
+
ze(this, me, F(this, me).slice(0, -1)), F(this, Ye).call(this);
|
|
6809
6809
|
}, this.replaceMessage = (t, r) => {
|
|
6810
6810
|
ze(this, me, [
|
|
6811
6811
|
...F(this, me).slice(0, t),
|
|
6812
6812
|
// We deep clone the message here to ensure the new React Compiler (currently in RC) detects deeply nested parts/metadata changes:
|
|
6813
6813
|
this.snapshot(r),
|
|
6814
6814
|
...F(this, me).slice(t + 1)
|
|
6815
|
-
]), F(this,
|
|
6815
|
+
]), F(this, Ye).call(this);
|
|
6816
6816
|
}, this.snapshot = (t) => structuredClone(t), this["~registerMessagesCallback"] = (t, r) => {
|
|
6817
6817
|
const n = r ? Jm(t, r) : t;
|
|
6818
|
-
return F(this,
|
|
6819
|
-
F(this,
|
|
6818
|
+
return F(this, lt).add(n), () => {
|
|
6819
|
+
F(this, lt).delete(n);
|
|
6820
6820
|
};
|
|
6821
|
-
}, this["~registerStatusCallback"] = (t) => (F(this,
|
|
6822
|
-
F(this, lt).delete(t);
|
|
6823
|
-
}), this["~registerErrorCallback"] = (t) => (F(this, ut).add(t), () => {
|
|
6821
|
+
}, this["~registerStatusCallback"] = (t) => (F(this, ut).add(t), () => {
|
|
6824
6822
|
F(this, ut).delete(t);
|
|
6825
|
-
}),
|
|
6826
|
-
F(this,
|
|
6827
|
-
}),
|
|
6823
|
+
}), this["~registerErrorCallback"] = (t) => (F(this, dt).add(t), () => {
|
|
6824
|
+
F(this, dt).delete(t);
|
|
6825
|
+
}), be(this, Ye, () => {
|
|
6828
6826
|
F(this, lt).forEach((t) => t());
|
|
6829
|
-
}),
|
|
6827
|
+
}), be(this, zr, () => {
|
|
6830
6828
|
F(this, ut).forEach((t) => t());
|
|
6829
|
+
}), be(this, Ar, () => {
|
|
6830
|
+
F(this, dt).forEach((t) => t());
|
|
6831
6831
|
}), ze(this, me, e);
|
|
6832
6832
|
}
|
|
6833
6833
|
get status() {
|
|
@@ -6846,25 +6846,25 @@ var me, Dt, Lt, ct, lt, ut, qe, zr, Ar, Gm = class {
|
|
|
6846
6846
|
return F(this, me);
|
|
6847
6847
|
}
|
|
6848
6848
|
set messages(e) {
|
|
6849
|
-
ze(this, me, [...e]), F(this,
|
|
6849
|
+
ze(this, me, [...e]), F(this, Ye).call(this);
|
|
6850
6850
|
}
|
|
6851
6851
|
};
|
|
6852
6852
|
me = /* @__PURE__ */ new WeakMap();
|
|
6853
6853
|
Dt = /* @__PURE__ */ new WeakMap();
|
|
6854
6854
|
Lt = /* @__PURE__ */ new WeakMap();
|
|
6855
|
-
ct = /* @__PURE__ */ new WeakMap();
|
|
6856
6855
|
lt = /* @__PURE__ */ new WeakMap();
|
|
6857
6856
|
ut = /* @__PURE__ */ new WeakMap();
|
|
6858
|
-
|
|
6857
|
+
dt = /* @__PURE__ */ new WeakMap();
|
|
6858
|
+
Ye = /* @__PURE__ */ new WeakMap();
|
|
6859
6859
|
zr = /* @__PURE__ */ new WeakMap();
|
|
6860
6860
|
Ar = /* @__PURE__ */ new WeakMap();
|
|
6861
|
-
var
|
|
6861
|
+
var Xe, Fn = class extends Em {
|
|
6862
6862
|
constructor({ messages: e, ...t }) {
|
|
6863
6863
|
const r = new Gm(e);
|
|
6864
|
-
super({ ...t, state: r }),
|
|
6864
|
+
super({ ...t, state: r }), be(this, Xe, void 0), this["~registerMessagesCallback"] = (n, o) => F(this, Xe)["~registerMessagesCallback"](n, o), this["~registerStatusCallback"] = (n) => F(this, Xe)["~registerStatusCallback"](n), this["~registerErrorCallback"] = (n) => F(this, Xe)["~registerErrorCallback"](n), ze(this, Xe, r);
|
|
6865
6865
|
}
|
|
6866
6866
|
};
|
|
6867
|
-
|
|
6867
|
+
Xe = /* @__PURE__ */ new WeakMap();
|
|
6868
6868
|
function Wm({
|
|
6869
6869
|
experimental_throttle: e,
|
|
6870
6870
|
resume: t = !1,
|
|
@@ -6897,7 +6897,7 @@ function Wm({
|
|
|
6897
6897
|
},
|
|
6898
6898
|
[n]
|
|
6899
6899
|
);
|
|
6900
|
-
return
|
|
6900
|
+
return $(() => {
|
|
6901
6901
|
t && n.current.resumeStream();
|
|
6902
6902
|
}, [t, n]), {
|
|
6903
6903
|
id: n.current.id,
|
|
@@ -6919,14 +6919,14 @@ const Hn = () => ({
|
|
|
6919
6919
|
onData: /* @__PURE__ */ new Set(),
|
|
6920
6920
|
onToolCall: /* @__PURE__ */ new Set()
|
|
6921
6921
|
}), $a = Ms(null);
|
|
6922
|
-
function
|
|
6922
|
+
function He(e = {}) {
|
|
6923
6923
|
const t = te($a);
|
|
6924
6924
|
if (!t)
|
|
6925
6925
|
throw new Error("useAiChat must be used within a AiChatProvider");
|
|
6926
6926
|
const r = J(e);
|
|
6927
|
-
return
|
|
6927
|
+
return $(() => {
|
|
6928
6928
|
r.current = e;
|
|
6929
|
-
}, [e]),
|
|
6929
|
+
}, [e]), $(() => {
|
|
6930
6930
|
const { onFinish: n, onError: o, onData: a, onToolCall: i } = r.current;
|
|
6931
6931
|
return n && t.handlers.onFinish.add(n), o && t.handlers.onError.add(o), a && t.handlers.onData.add(a), i && t.handlers.onToolCall.add(i), () => {
|
|
6932
6932
|
n && t.handlers.onFinish.delete(n), o && t.handlers.onError.delete(o), a && t.handlers.onData.delete(a), i && t.handlers.onToolCall.delete(i);
|
|
@@ -6941,8 +6941,8 @@ function qm({
|
|
|
6941
6941
|
children: e,
|
|
6942
6942
|
value: t
|
|
6943
6943
|
}) {
|
|
6944
|
-
const r = J(Hn()), [n, o] =
|
|
6945
|
-
|
|
6944
|
+
const r = J(Hn()), [n, o] = P("");
|
|
6945
|
+
$(() => {
|
|
6946
6946
|
r.current = Hn();
|
|
6947
6947
|
}, [t]);
|
|
6948
6948
|
const a = B((p) => {
|
|
@@ -6988,8 +6988,8 @@ const Jn = ({
|
|
|
6988
6988
|
containerId: e,
|
|
6989
6989
|
...t
|
|
6990
6990
|
}) => {
|
|
6991
|
-
const [r, n] =
|
|
6992
|
-
return
|
|
6991
|
+
const [r, n] = P(zt);
|
|
6992
|
+
return $(() => {
|
|
6993
6993
|
if (!zt) {
|
|
6994
6994
|
const o = async () => {
|
|
6995
6995
|
try {
|
|
@@ -7009,19 +7009,19 @@ const Jn = ({
|
|
|
7009
7009
|
};
|
|
7010
7010
|
}
|
|
7011
7011
|
}, []), r && _r ? /* @__PURE__ */ l(_r, { containerId: e, ...t }) : null;
|
|
7012
|
-
}, Ym = "z-20", Xm = "z-10", Gr =
|
|
7012
|
+
}, Ym = "z-20", Xm = "z-10", Gr = st.createContext({
|
|
7013
7013
|
state: {
|
|
7014
7014
|
searchString: "",
|
|
7015
7015
|
sortedCell: "",
|
|
7016
|
-
sortDirection:
|
|
7016
|
+
sortDirection: ot.DESC
|
|
7017
7017
|
},
|
|
7018
7018
|
dispatch: () => {
|
|
7019
7019
|
}
|
|
7020
|
-
}), Wr =
|
|
7020
|
+
}), Wr = st.createContext({
|
|
7021
7021
|
state: { prompt: "", lastTriggeredTimestamp: 0 },
|
|
7022
7022
|
dispatch: () => {
|
|
7023
7023
|
}
|
|
7024
|
-
}),
|
|
7024
|
+
}), _e = st.createContext({
|
|
7025
7025
|
state: {
|
|
7026
7026
|
provider: Ka,
|
|
7027
7027
|
privateChat: !1,
|
|
@@ -7041,7 +7041,7 @@ const Jn = ({
|
|
|
7041
7041
|
},
|
|
7042
7042
|
setInitialMessages: () => {
|
|
7043
7043
|
}
|
|
7044
|
-
}), qr =
|
|
7044
|
+
}), qr = st.createContext({
|
|
7045
7045
|
state: {
|
|
7046
7046
|
footerPosition: Qt,
|
|
7047
7047
|
footerHeight: 0,
|
|
@@ -7049,33 +7049,33 @@ const Jn = ({
|
|
|
7049
7049
|
},
|
|
7050
7050
|
dispatch: () => {
|
|
7051
7051
|
}
|
|
7052
|
-
}), Qm = "av-tooltip", Km = "av-tooltip-arrow", At = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, eh = () =>
|
|
7052
|
+
}), Qm = "av-tooltip", Km = "av-tooltip-arrow", At = (e, t = "px") => typeof e > "u" ? "" : `${Math.round(e)}${t}`, eh = () => M("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"), Gn = ({
|
|
7053
7053
|
mode: e
|
|
7054
|
-
}) =>
|
|
7054
|
+
}) => M({
|
|
7055
7055
|
"bg-surface-darker": e === "dark" || e === "system",
|
|
7056
7056
|
"bg-surface-light": e === "light" || e === "alt-system",
|
|
7057
7057
|
"dark:bg-surface-light": e === "system",
|
|
7058
7058
|
"dark:bg-surface-darker": e === "alt-system"
|
|
7059
7059
|
}), th = ({
|
|
7060
7060
|
mode: e
|
|
7061
|
-
}) =>
|
|
7061
|
+
}) => M({
|
|
7062
7062
|
"text-copy-light": e === "dark" || e === "system",
|
|
7063
7063
|
"text-copy-dark": e === "light" || e === "alt-system",
|
|
7064
7064
|
"dark:text-copy-dark": e === "system",
|
|
7065
7065
|
"dark:text-copy-light": e === "alt-system"
|
|
7066
|
-
}), rh = () =>
|
|
7066
|
+
}), rh = () => M("absolute", "size-2", "transform rotate-45"), nh = ({
|
|
7067
7067
|
mode: e,
|
|
7068
7068
|
className: t,
|
|
7069
7069
|
tooltipClassName: r,
|
|
7070
7070
|
arrowClassName: n
|
|
7071
7071
|
}) => {
|
|
7072
|
-
const o =
|
|
7072
|
+
const o = M("relative inline-block", t), a = M(
|
|
7073
7073
|
Qm,
|
|
7074
7074
|
eh(),
|
|
7075
7075
|
Gn({ mode: e }),
|
|
7076
7076
|
th({ mode: e }),
|
|
7077
7077
|
r
|
|
7078
|
-
), i =
|
|
7078
|
+
), i = M(
|
|
7079
7079
|
Km,
|
|
7080
7080
|
rh(),
|
|
7081
7081
|
Gn({ mode: e }),
|
|
@@ -7096,19 +7096,19 @@ const Jn = ({
|
|
|
7096
7096
|
}) => {
|
|
7097
7097
|
const u = Hs(() => {
|
|
7098
7098
|
h.stop(), m(!1);
|
|
7099
|
-
}), c = J(null), p = J(null), [d, f] =
|
|
7099
|
+
}), c = J(null), p = J(null), [d, f] = P(!1), [g, m] = P(!1), h = Ys(() => {
|
|
7100
7100
|
m(!1);
|
|
7101
7101
|
}, ah), v = nh({
|
|
7102
7102
|
mode: n,
|
|
7103
7103
|
className: a,
|
|
7104
7104
|
tooltipClassName: i,
|
|
7105
7105
|
arrowClassName: s
|
|
7106
|
-
}), I = oh({ delay: o }),
|
|
7106
|
+
}), I = oh({ delay: o }), y = B(async () => {
|
|
7107
7107
|
if (u.current && c.current && p.current) {
|
|
7108
7108
|
const {
|
|
7109
|
-
x:
|
|
7109
|
+
x: A,
|
|
7110
7110
|
y: k,
|
|
7111
|
-
middlewareData:
|
|
7111
|
+
middlewareData: O,
|
|
7112
7112
|
placement: ie
|
|
7113
7113
|
} = await Ps(u.current, c.current, {
|
|
7114
7114
|
placement: r,
|
|
@@ -7123,7 +7123,7 @@ const Jn = ({
|
|
|
7123
7123
|
]
|
|
7124
7124
|
});
|
|
7125
7125
|
c?.current?.style && Object.assign(c.current.style, {
|
|
7126
|
-
left: At(
|
|
7126
|
+
left: At(A),
|
|
7127
7127
|
top: At(k),
|
|
7128
7128
|
...I
|
|
7129
7129
|
});
|
|
@@ -7134,22 +7134,22 @@ const Jn = ({
|
|
|
7134
7134
|
left: "right"
|
|
7135
7135
|
}[ie.split("-")[0]];
|
|
7136
7136
|
p?.current?.style && Object.assign(p.current.style, {
|
|
7137
|
-
left: At(
|
|
7138
|
-
top: At(
|
|
7137
|
+
left: At(O.arrow?.x),
|
|
7138
|
+
top: At(O.arrow?.y),
|
|
7139
7139
|
right: "",
|
|
7140
7140
|
bottom: "",
|
|
7141
7141
|
[ke]: "-4px"
|
|
7142
7142
|
});
|
|
7143
7143
|
}
|
|
7144
7144
|
}, [r, I, u]);
|
|
7145
|
-
|
|
7146
|
-
(async () => d && await
|
|
7147
|
-
}, [
|
|
7145
|
+
$(() => {
|
|
7146
|
+
(async () => d && await y())();
|
|
7147
|
+
}, [y, d]);
|
|
7148
7148
|
const E = () => {
|
|
7149
7149
|
f(!1), m(!0), h.start();
|
|
7150
7150
|
}, b = () => {
|
|
7151
7151
|
g || f(!0);
|
|
7152
|
-
},
|
|
7152
|
+
}, z = () => {
|
|
7153
7153
|
g || f(!1);
|
|
7154
7154
|
};
|
|
7155
7155
|
return /* @__PURE__ */ x(
|
|
@@ -7158,7 +7158,7 @@ const Jn = ({
|
|
|
7158
7158
|
className: v.wrapper,
|
|
7159
7159
|
ref: u,
|
|
7160
7160
|
onMouseEnter: b,
|
|
7161
|
-
onMouseLeave:
|
|
7161
|
+
onMouseLeave: z,
|
|
7162
7162
|
onClick: E,
|
|
7163
7163
|
children: [
|
|
7164
7164
|
e,
|
|
@@ -7210,13 +7210,13 @@ const sh = ({
|
|
|
7210
7210
|
onClick: t,
|
|
7211
7211
|
noBorder: !0,
|
|
7212
7212
|
noBackground: !0,
|
|
7213
|
-
children: /* @__PURE__ */ l(ri, { size:
|
|
7213
|
+
children: /* @__PURE__ */ l(ri, { size: Ie, monotone: !0 })
|
|
7214
7214
|
}
|
|
7215
7215
|
)
|
|
7216
7216
|
}
|
|
7217
7217
|
);
|
|
7218
7218
|
function Pa(e, t) {
|
|
7219
|
-
|
|
7219
|
+
$(() => {
|
|
7220
7220
|
if (Bt() && typeof window < "u")
|
|
7221
7221
|
return window.__VERSINI_DIGGIDY_TAURI_EVENTS__ && (window.__VERSINI_DIGGIDY_TAURI_EVENTS__[e] = t), () => {
|
|
7222
7222
|
window.__VERSINI_DIGGIDY_TAURI_EVENTS__ && (window.__VERSINI_DIGGIDY_TAURI_EVENTS__[e] = null);
|
|
@@ -7226,37 +7226,40 @@ function Pa(e, t) {
|
|
|
7226
7226
|
const ih = ({
|
|
7227
7227
|
className: e
|
|
7228
7228
|
}) => {
|
|
7229
|
-
const { getAccessToken: t } =
|
|
7230
|
-
state: { streaming:
|
|
7231
|
-
dispatch:
|
|
7232
|
-
setChatId:
|
|
7233
|
-
setInitialMessages:
|
|
7234
|
-
} = te(
|
|
7235
|
-
|
|
7236
|
-
|
|
7229
|
+
const { getAccessToken: t, user: r } = ye(), {
|
|
7230
|
+
state: { streaming: n, loading: o },
|
|
7231
|
+
dispatch: a,
|
|
7232
|
+
setChatId: i,
|
|
7233
|
+
setInitialMessages: s
|
|
7234
|
+
} = te(_e), { id: u, setInput: c, stop: p } = He(), d = J(null), f = J(!1), { data: g, isSuccess: m } = Ze({
|
|
7235
|
+
user: r?.username,
|
|
7236
|
+
getAccessToken: t
|
|
7237
|
+
}), h = B(() => {
|
|
7238
|
+
i(Re()), s([]), c(""), a({
|
|
7239
|
+
type: Fe,
|
|
7237
7240
|
payload: {
|
|
7238
7241
|
privateChat: !1,
|
|
7239
7242
|
reasoning: !1
|
|
7240
7243
|
}
|
|
7241
|
-
}),
|
|
7242
|
-
type:
|
|
7244
|
+
}), a({
|
|
7245
|
+
type: at,
|
|
7243
7246
|
payload: {
|
|
7244
7247
|
attachments: 0
|
|
7245
7248
|
}
|
|
7246
7249
|
});
|
|
7247
|
-
}, [
|
|
7248
|
-
Pa("newChat",
|
|
7250
|
+
}, [i, s, c, a]);
|
|
7251
|
+
Pa("newChat", h), Pr(
|
|
7249
7252
|
[
|
|
7250
7253
|
[
|
|
7251
7254
|
"mod+N",
|
|
7252
7255
|
() => {
|
|
7253
|
-
Bt() &&
|
|
7256
|
+
Bt() && h();
|
|
7254
7257
|
}
|
|
7255
7258
|
],
|
|
7256
7259
|
[
|
|
7257
7260
|
"mod+T",
|
|
7258
7261
|
() => {
|
|
7259
|
-
Bt() &&
|
|
7262
|
+
Bt() && h();
|
|
7260
7263
|
}
|
|
7261
7264
|
]
|
|
7262
7265
|
],
|
|
@@ -7267,9 +7270,9 @@ const ih = ({
|
|
|
7267
7270
|
*/
|
|
7268
7271
|
[]
|
|
7269
7272
|
);
|
|
7270
|
-
const
|
|
7271
|
-
|
|
7272
|
-
type:
|
|
7273
|
+
const v = async (y) => {
|
|
7274
|
+
y.preventDefault(), p(), a({
|
|
7275
|
+
type: rt,
|
|
7273
7276
|
payload: {
|
|
7274
7277
|
aborted: !0,
|
|
7275
7278
|
streaming: !1,
|
|
@@ -7277,24 +7280,24 @@ const ih = ({
|
|
|
7277
7280
|
}
|
|
7278
7281
|
});
|
|
7279
7282
|
try {
|
|
7280
|
-
const
|
|
7283
|
+
const E = await t();
|
|
7281
7284
|
await fetch(`${ro}/api/abort`, {
|
|
7282
7285
|
method: "POST",
|
|
7283
7286
|
headers: {
|
|
7284
7287
|
"Content-Type": "application/json",
|
|
7285
|
-
Authorization: `Bearer ${
|
|
7288
|
+
Authorization: `Bearer ${E}`
|
|
7286
7289
|
},
|
|
7287
|
-
body: JSON.stringify({ chatId:
|
|
7290
|
+
body: JSON.stringify({ chatId: u })
|
|
7288
7291
|
});
|
|
7289
|
-
} catch (
|
|
7290
|
-
console.error("Failed to send abort signal:",
|
|
7292
|
+
} catch (E) {
|
|
7293
|
+
console.error("Failed to send abort signal:", E);
|
|
7291
7294
|
}
|
|
7292
|
-
},
|
|
7293
|
-
|
|
7295
|
+
}, I = (y) => {
|
|
7296
|
+
y.preventDefault(), h();
|
|
7294
7297
|
};
|
|
7295
|
-
return
|
|
7296
|
-
Ae() || ((
|
|
7297
|
-
}, [
|
|
7298
|
+
return $(() => {
|
|
7299
|
+
Ae() || ((n === !0 || o === !0) && !f.current && d.current && (f.current = !0, d.current.focus()), n === !1 && f.current && (f.current = !1));
|
|
7300
|
+
}, [n, o]), /* @__PURE__ */ l(
|
|
7298
7301
|
xe,
|
|
7299
7302
|
{
|
|
7300
7303
|
label: "New Chat",
|
|
@@ -7309,9 +7312,10 @@ const ih = ({
|
|
|
7309
7312
|
mode: "dark",
|
|
7310
7313
|
focusMode: "light",
|
|
7311
7314
|
label: "New Chat",
|
|
7312
|
-
ref:
|
|
7313
|
-
onClick:
|
|
7314
|
-
|
|
7315
|
+
ref: d,
|
|
7316
|
+
onClick: n || o ? v : I,
|
|
7317
|
+
disabled: !(m && g),
|
|
7318
|
+
children: n || o ? /* @__PURE__ */ l(ci, { size: Ie, monotone: !0 }) : /* @__PURE__ */ l(ui, { size: Ie })
|
|
7315
7319
|
}
|
|
7316
7320
|
)
|
|
7317
7321
|
}
|
|
@@ -7330,7 +7334,7 @@ const ih = ({
|
|
|
7330
7334
|
semantic: s = !1,
|
|
7331
7335
|
...u
|
|
7332
7336
|
}) => {
|
|
7333
|
-
const c =
|
|
7337
|
+
const c = M(a, n);
|
|
7334
7338
|
return /* @__PURE__ */ x(
|
|
7335
7339
|
"svg",
|
|
7336
7340
|
{
|
|
@@ -7445,7 +7449,7 @@ const hh = ae.forwardRef(function(e, t) {
|
|
|
7445
7449
|
const { context: r, ...n } = or(), o = $r([n.refs.setFloating, t]);
|
|
7446
7450
|
if (!r.open)
|
|
7447
7451
|
return null;
|
|
7448
|
-
const { overlayBackground: a, ...i } = e, s =
|
|
7452
|
+
const { overlayBackground: a, ...i } = e, s = M("grid place-items-center", {
|
|
7449
7453
|
[`${a}`]: a,
|
|
7450
7454
|
"bg-black sm:bg-black/[.8]": !a
|
|
7451
7455
|
});
|
|
@@ -7486,7 +7490,7 @@ try {
|
|
|
7486
7490
|
});
|
|
7487
7491
|
} catch {
|
|
7488
7492
|
}
|
|
7489
|
-
const ge = "panel",
|
|
7493
|
+
const ge = "panel", Ue = "messagebox", yh = ({
|
|
7490
7494
|
className: e,
|
|
7491
7495
|
kind: t,
|
|
7492
7496
|
borderMode: r,
|
|
@@ -7496,7 +7500,7 @@ const ge = "panel", Le = "messagebox", yh = ({
|
|
|
7496
7500
|
}) => {
|
|
7497
7501
|
const i = a ?? (t === ge ? "large" : void 0);
|
|
7498
7502
|
return {
|
|
7499
|
-
main:
|
|
7503
|
+
main: M("prose prose-lighter flex flex-col bg-surface-dark", {
|
|
7500
7504
|
"duration-200 ease-out": n,
|
|
7501
7505
|
/**
|
|
7502
7506
|
* Panel styles
|
|
@@ -7513,13 +7517,13 @@ const ge = "panel", Le = "messagebox", yh = ({
|
|
|
7513
7517
|
/**
|
|
7514
7518
|
* Messagebox styles
|
|
7515
7519
|
*/
|
|
7516
|
-
[`${ch} rounded-lg border-2`]: t ===
|
|
7517
|
-
"w-[95%] sm:w-[50%] md:max-w-2xl": t ===
|
|
7518
|
-
"max-h-[20%]": t ===
|
|
7519
|
-
"max-h-[50%]": t ===
|
|
7520
|
-
"max-h-[95%]": t ===
|
|
7521
|
-
"border-border-dark": r === "dark" && t ===
|
|
7522
|
-
"border-border-accent": r === "light" && t ===
|
|
7520
|
+
[`${ch} rounded-lg border-2`]: t === Ue,
|
|
7521
|
+
"w-[95%] sm:w-[50%] md:max-w-2xl": t === Ue && !e,
|
|
7522
|
+
"max-h-[20%]": t === Ue && i === "small",
|
|
7523
|
+
"max-h-[50%]": t === Ue && i === "medium",
|
|
7524
|
+
"max-h-[95%]": t === Ue && i === "large",
|
|
7525
|
+
"border-border-dark": r === "dark" && t === Ue,
|
|
7526
|
+
"border-border-accent": r === "light" && t === Ue,
|
|
7523
7527
|
[`${e}`]: !!e
|
|
7524
7528
|
}),
|
|
7525
7529
|
content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
|
|
@@ -7541,7 +7545,7 @@ const ge = "panel", Le = "messagebox", yh = ({
|
|
|
7541
7545
|
maxWidth: p = "medium",
|
|
7542
7546
|
maxHeight: d
|
|
7543
7547
|
}) => {
|
|
7544
|
-
const f = J(""), [g, m] =
|
|
7548
|
+
const f = J(""), [g, m] = P(
|
|
7545
7549
|
u ? c === Wn ? { opacity: 0 } : {
|
|
7546
7550
|
transform: "translateY(-100vh)"
|
|
7547
7551
|
} : {}
|
|
@@ -7553,9 +7557,9 @@ const ge = "panel", Le = "messagebox", yh = ({
|
|
|
7553
7557
|
maxWidth: p,
|
|
7554
7558
|
maxHeight: d
|
|
7555
7559
|
});
|
|
7556
|
-
return
|
|
7560
|
+
return $(() => (e && (f.current = document.title, document.title = `${r} | ${f.current}`), () => {
|
|
7557
7561
|
e && (document.title = f.current);
|
|
7558
|
-
}), [r, e]),
|
|
7562
|
+
}), [r, e]), $(() => {
|
|
7559
7563
|
if (u && e) {
|
|
7560
7564
|
m(
|
|
7561
7565
|
u ? c === Wn ? { opacity: 0 } : {
|
|
@@ -7608,7 +7612,7 @@ try {
|
|
|
7608
7612
|
});
|
|
7609
7613
|
} catch {
|
|
7610
7614
|
}
|
|
7611
|
-
const wh = "av-toggle", Ih = ({ narrow: e }) =>
|
|
7615
|
+
const wh = "av-toggle", Ih = ({ narrow: e }) => M(
|
|
7612
7616
|
"peer",
|
|
7613
7617
|
"rounded-full",
|
|
7614
7618
|
{
|
|
@@ -7619,7 +7623,7 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
|
7619
7623
|
"transition-colors duration-300 ease-in-out motion-reduce:transition-none"
|
|
7620
7624
|
), Eh = ({
|
|
7621
7625
|
focusMode: e
|
|
7622
|
-
}) =>
|
|
7626
|
+
}) => M(
|
|
7623
7627
|
"peer-focus:outline",
|
|
7624
7628
|
"peer-focus:outline-2",
|
|
7625
7629
|
"peer-focus:outline-offset-2",
|
|
@@ -7629,7 +7633,7 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
|
7629
7633
|
"peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": e === "alt-system",
|
|
7630
7634
|
"peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": e === "system"
|
|
7631
7635
|
}
|
|
7632
|
-
), Th = ({ narrow: e }) =>
|
|
7636
|
+
), Th = ({ narrow: e }) => M(
|
|
7633
7637
|
{
|
|
7634
7638
|
"peer-checked:after:translate-x-full": !e,
|
|
7635
7639
|
"peer-checked:after:translate-x-4": e
|
|
@@ -7639,7 +7643,7 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
|
7639
7643
|
// knob circle and border color when checked
|
|
7640
7644
|
"peer-checked:after:bg-white",
|
|
7641
7645
|
"peer-checked:after:border-white"
|
|
7642
|
-
), Sh = ({ narrow: e }) =>
|
|
7646
|
+
), Sh = ({ narrow: e }) => M(
|
|
7643
7647
|
"after:left-[2px]",
|
|
7644
7648
|
"after:top-[2px]",
|
|
7645
7649
|
"after:border",
|
|
@@ -7658,7 +7662,7 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
|
7658
7662
|
), xh = ({
|
|
7659
7663
|
mode: e,
|
|
7660
7664
|
noBorder: t
|
|
7661
|
-
}) =>
|
|
7665
|
+
}) => M({
|
|
7662
7666
|
border: !t,
|
|
7663
7667
|
"border-border-medium bg-surface-medium": e === "light",
|
|
7664
7668
|
"border-border-light bg-surface-darker": e === "dark",
|
|
@@ -7668,12 +7672,12 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
|
7668
7672
|
labelHidden: e,
|
|
7669
7673
|
labelMode: t,
|
|
7670
7674
|
mode: r
|
|
7671
|
-
}) => (t = t || r, e ? "sr-only" :
|
|
7675
|
+
}) => (t = t || r, e ? "sr-only" : M("ml-2 text-sm", {
|
|
7672
7676
|
"text-copy-dark": t === "light",
|
|
7673
7677
|
"text-copy-lighter": t === "dark",
|
|
7674
7678
|
"text-copy-lighter dark:text-copy-dark": t === "alt-system",
|
|
7675
7679
|
"text-copy-dark dark:text-copy-lighter": t === "system"
|
|
7676
|
-
})), Ch = ({ className: e }) =>
|
|
7680
|
+
})), Ch = ({ className: e }) => M(
|
|
7677
7681
|
wh,
|
|
7678
7682
|
"relative flex cursor-pointer items-center",
|
|
7679
7683
|
e
|
|
@@ -7686,7 +7690,7 @@ const wh = "av-toggle", Ih = ({ narrow: e }) => O(
|
|
|
7686
7690
|
narrow: a,
|
|
7687
7691
|
labelMode: i
|
|
7688
7692
|
}) => ({
|
|
7689
|
-
toggle:
|
|
7693
|
+
toggle: M(
|
|
7690
7694
|
Ih({ narrow: a }),
|
|
7691
7695
|
xh({ mode: e, noBorder: o }),
|
|
7692
7696
|
Eh({ focusMode: t }),
|
|
@@ -7748,7 +7752,7 @@ try {
|
|
|
7748
7752
|
});
|
|
7749
7753
|
} catch {
|
|
7750
7754
|
}
|
|
7751
|
-
const
|
|
7755
|
+
const je = ({
|
|
7752
7756
|
showConfirmation: e,
|
|
7753
7757
|
setShowConfirmation: t,
|
|
7754
7758
|
action: r,
|
|
@@ -7766,7 +7770,7 @@ const Be = ({
|
|
|
7766
7770
|
onToggleChange: p
|
|
7767
7771
|
}) => {
|
|
7768
7772
|
const d = /* @__PURE__ */ x(wr, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
7769
|
-
/* @__PURE__ */ l(
|
|
7773
|
+
/* @__PURE__ */ l(Qe, { children: !a && /* @__PURE__ */ l(
|
|
7770
7774
|
Kr,
|
|
7771
7775
|
{
|
|
7772
7776
|
noBorder: !0,
|
|
@@ -7779,7 +7783,7 @@ const Be = ({
|
|
|
7779
7783
|
children: o.cancelAction
|
|
7780
7784
|
}
|
|
7781
7785
|
) }),
|
|
7782
|
-
/* @__PURE__ */ l(
|
|
7786
|
+
/* @__PURE__ */ l(Qe, { children: /* @__PURE__ */ l(
|
|
7783
7787
|
Kr,
|
|
7784
7788
|
{
|
|
7785
7789
|
noBorder: !0,
|
|
@@ -7799,7 +7803,7 @@ const Be = ({
|
|
|
7799
7803
|
alignVertical: "center",
|
|
7800
7804
|
columnGap: 2,
|
|
7801
7805
|
children: [
|
|
7802
|
-
/* @__PURE__ */ l(
|
|
7806
|
+
/* @__PURE__ */ l(Qe, { span: "auto", children: /* @__PURE__ */ l(
|
|
7803
7807
|
zh,
|
|
7804
7808
|
{
|
|
7805
7809
|
narrow: !0,
|
|
@@ -7814,7 +7818,7 @@ const Be = ({
|
|
|
7814
7818
|
}
|
|
7815
7819
|
}
|
|
7816
7820
|
) }),
|
|
7817
|
-
/* @__PURE__ */ l(
|
|
7821
|
+
/* @__PURE__ */ l(Qe, { span: "auto", children: d })
|
|
7818
7822
|
]
|
|
7819
7823
|
}
|
|
7820
7824
|
) : d;
|
|
@@ -7832,34 +7836,37 @@ const Be = ({
|
|
|
7832
7836
|
}, Ah = ({
|
|
7833
7837
|
className: e
|
|
7834
7838
|
}) => {
|
|
7835
|
-
const {
|
|
7836
|
-
state: { privateChat:
|
|
7837
|
-
dispatch:
|
|
7838
|
-
setChatId:
|
|
7839
|
-
setInitialMessages:
|
|
7840
|
-
} = te(
|
|
7841
|
-
key:
|
|
7839
|
+
const { getAccessToken: t, user: r } = ye(), {
|
|
7840
|
+
state: { privateChat: n, tokenUsage: o },
|
|
7841
|
+
dispatch: a,
|
|
7842
|
+
setChatId: i,
|
|
7843
|
+
setInitialMessages: s
|
|
7844
|
+
} = te(_e), [u, c] = P(!1), [p, d] = P(!1), [f, g] = P(!1), [m, h] = et({
|
|
7845
|
+
key: Ke + ts,
|
|
7842
7846
|
initialValue: ""
|
|
7843
|
-
}),
|
|
7844
|
-
|
|
7845
|
-
|
|
7847
|
+
}), v = Kt(jt.TOOL.MEMORIES), { data: I, isSuccess: y } = Ze({
|
|
7848
|
+
user: r?.username,
|
|
7849
|
+
getAccessToken: t
|
|
7850
|
+
}), E = (z) => {
|
|
7851
|
+
i(Re()), s([]), a({
|
|
7852
|
+
type: Fe,
|
|
7846
7853
|
payload: {
|
|
7847
|
-
privateChat: !
|
|
7854
|
+
privateChat: !n
|
|
7848
7855
|
}
|
|
7849
|
-
}),
|
|
7850
|
-
type:
|
|
7856
|
+
}), z && a({
|
|
7857
|
+
type: at,
|
|
7851
7858
|
payload: {
|
|
7852
7859
|
attachments: 0
|
|
7853
7860
|
}
|
|
7854
7861
|
});
|
|
7855
7862
|
};
|
|
7856
7863
|
return /* @__PURE__ */ x(Oe, { children: [
|
|
7857
|
-
|
|
7858
|
-
|
|
7864
|
+
f && /* @__PURE__ */ x(
|
|
7865
|
+
je,
|
|
7859
7866
|
{
|
|
7860
|
-
showConfirmation:
|
|
7861
|
-
setShowConfirmation:
|
|
7862
|
-
action: () =>
|
|
7867
|
+
showConfirmation: f,
|
|
7868
|
+
setShowConfirmation: g,
|
|
7869
|
+
action: () => E(!0),
|
|
7863
7870
|
customStrings: {
|
|
7864
7871
|
confirmAction: "Continue",
|
|
7865
7872
|
cancelAction: "Cancel",
|
|
@@ -7871,17 +7878,17 @@ const Be = ({
|
|
|
7871
7878
|
]
|
|
7872
7879
|
}
|
|
7873
7880
|
),
|
|
7874
|
-
|
|
7875
|
-
|
|
7881
|
+
p && /* @__PURE__ */ l(
|
|
7882
|
+
je,
|
|
7876
7883
|
{
|
|
7877
7884
|
toggleLabel: "Don't show this again",
|
|
7878
7885
|
toggleName: "private-disclosure",
|
|
7879
|
-
toggleChecked:
|
|
7880
|
-
onToggleChange: (
|
|
7881
|
-
showConfirmation:
|
|
7882
|
-
setShowConfirmation:
|
|
7886
|
+
toggleChecked: u,
|
|
7887
|
+
onToggleChange: (z) => c(z),
|
|
7888
|
+
showConfirmation: p,
|
|
7889
|
+
setShowConfirmation: d,
|
|
7883
7890
|
action: () => {
|
|
7884
|
-
|
|
7891
|
+
u && h("true"), E();
|
|
7885
7892
|
},
|
|
7886
7893
|
customStrings: {
|
|
7887
7894
|
confirmAction: "Continue",
|
|
@@ -7891,7 +7898,7 @@ const Be = ({
|
|
|
7891
7898
|
children: /* @__PURE__ */ x("ul", { children: [
|
|
7892
7899
|
/* @__PURE__ */ x("li", { children: [
|
|
7893
7900
|
"In Private Mode, your chat sessions will not be saved to your chat history. ",
|
|
7894
|
-
|
|
7901
|
+
v && "Memories will also be disabled."
|
|
7895
7902
|
] }),
|
|
7896
7903
|
/* @__PURE__ */ l("li", { children: "If you refresh your browser, the setting will revert to the default (non-private) chat." })
|
|
7897
7904
|
] })
|
|
@@ -7908,19 +7915,19 @@ const Be = ({
|
|
|
7908
7915
|
ve,
|
|
7909
7916
|
{
|
|
7910
7917
|
noBorder: !0,
|
|
7911
|
-
noBackground: !
|
|
7918
|
+
noBackground: !n,
|
|
7912
7919
|
animated: !0,
|
|
7913
7920
|
mode: "dark",
|
|
7914
7921
|
focusMode: "light",
|
|
7915
7922
|
label: "Private Chat",
|
|
7916
|
-
labelRight:
|
|
7917
|
-
variant:
|
|
7918
|
-
onClick: (
|
|
7919
|
-
|
|
7923
|
+
labelRight: n ? "private" : "",
|
|
7924
|
+
variant: n ? "danger" : "secondary",
|
|
7925
|
+
onClick: (z) => {
|
|
7926
|
+
z && z.preventDefault(), m ? o > 0 ? g(!f) : E() : d(!p);
|
|
7920
7927
|
},
|
|
7921
7928
|
className: "text-sm",
|
|
7922
|
-
disabled:
|
|
7923
|
-
children:
|
|
7929
|
+
disabled: !(y && I) || n && o > 0,
|
|
7930
|
+
children: n ? /* @__PURE__ */ l(gi, { size: Ie }) : /* @__PURE__ */ l(Si, { size: Ie })
|
|
7924
7931
|
}
|
|
7925
7932
|
)
|
|
7926
7933
|
}
|
|
@@ -7957,7 +7964,7 @@ const Be = ({
|
|
|
7957
7964
|
focusMode: i = "system",
|
|
7958
7965
|
...s
|
|
7959
7966
|
}, u) => {
|
|
7960
|
-
const [c, p] =
|
|
7967
|
+
const [c, p] = P(!1), [d, f] = P(!1), [g, m] = P(null), h = J([]), v = J([]), I = te(Or), y = wo(), E = Ls(), b = Io(), { floatingStyles: z, refs: A, context: k } = go({
|
|
7961
7968
|
nodeId: E,
|
|
7962
7969
|
open: c,
|
|
7963
7970
|
onOpenChange: (ce) => {
|
|
@@ -7967,11 +7974,11 @@ const Be = ({
|
|
|
7967
7974
|
strategy: "fixed",
|
|
7968
7975
|
middleware: [uo({ mainAxis: 10 }), po(), mo()],
|
|
7969
7976
|
whileElementsMounted: Us
|
|
7970
|
-
}),
|
|
7977
|
+
}), O = vo(k, {
|
|
7971
7978
|
event: "mousedown",
|
|
7972
7979
|
toggle: !0,
|
|
7973
7980
|
ignoreMouse: !1
|
|
7974
|
-
}), ie = _o(k, { role: "menu" }), ke = yo(k, { bubbles: !0 }),
|
|
7981
|
+
}), ie = _o(k, { role: "menu" }), ke = yo(k, { bubbles: !0 }), Je = Bs(k, {
|
|
7975
7982
|
listRef: h,
|
|
7976
7983
|
activeIndex: g,
|
|
7977
7984
|
nested: !1,
|
|
@@ -7981,37 +7988,37 @@ const Be = ({
|
|
|
7981
7988
|
listRef: v,
|
|
7982
7989
|
onMatch: c ? m : void 0,
|
|
7983
7990
|
activeIndex: g
|
|
7984
|
-
}), { getReferenceProps:
|
|
7985
|
-
noInternalClick:
|
|
7991
|
+
}), { getReferenceProps: Ge, getFloatingProps: de, getItemProps: Ce } = bo([O, ie, ke, Je, U]), We = qn(e) === "Button" || qn(e) === "ButtonIcon", sr = We ? {
|
|
7992
|
+
noInternalClick: We,
|
|
7986
7993
|
focusMode: i,
|
|
7987
7994
|
mode: a
|
|
7988
|
-
} : {}, Tt =
|
|
7995
|
+
} : {}, Tt = st.cloneElement(
|
|
7989
7996
|
e,
|
|
7990
7997
|
{
|
|
7991
7998
|
...sr,
|
|
7992
7999
|
"aria-label": r,
|
|
7993
8000
|
"data-open": c ? "" : void 0,
|
|
7994
8001
|
"data-focus-inside": d ? "" : void 0,
|
|
7995
|
-
ref: $r([
|
|
7996
|
-
...
|
|
8002
|
+
ref: $r([A.setReference, b.ref, u]),
|
|
8003
|
+
...Ge(
|
|
7997
8004
|
I.getItemProps({
|
|
7998
8005
|
...s
|
|
7999
8006
|
})
|
|
8000
8007
|
)
|
|
8001
8008
|
}
|
|
8002
8009
|
);
|
|
8003
|
-
return
|
|
8004
|
-
if (!
|
|
8010
|
+
return $(() => {
|
|
8011
|
+
if (!y)
|
|
8005
8012
|
return;
|
|
8006
8013
|
function ce() {
|
|
8007
8014
|
p(!1), o?.(!1);
|
|
8008
8015
|
}
|
|
8009
|
-
return
|
|
8010
|
-
|
|
8016
|
+
return y.events.on("click", ce), () => {
|
|
8017
|
+
y.events.off("click", ce);
|
|
8011
8018
|
};
|
|
8012
|
-
}, [
|
|
8013
|
-
c &&
|
|
8014
|
-
}, [
|
|
8019
|
+
}, [y, o]), $(() => {
|
|
8020
|
+
c && y && y.events.emit("menuopen", { nodeId: E });
|
|
8021
|
+
}, [y, c, E]), /* @__PURE__ */ x(Vs, { id: E, children: [
|
|
8015
8022
|
Tt,
|
|
8016
8023
|
/* @__PURE__ */ l(
|
|
8017
8024
|
Or.Provider,
|
|
@@ -8033,9 +8040,9 @@ const Be = ({
|
|
|
8033
8040
|
children: /* @__PURE__ */ l(
|
|
8034
8041
|
"div",
|
|
8035
8042
|
{
|
|
8036
|
-
ref:
|
|
8043
|
+
ref: A.setFloating,
|
|
8037
8044
|
className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-hidden p-4 sm:p-2",
|
|
8038
|
-
style:
|
|
8045
|
+
style: z,
|
|
8039
8046
|
...de(),
|
|
8040
8047
|
children: t
|
|
8041
8048
|
}
|
|
@@ -8060,7 +8067,7 @@ const Oh = ({
|
|
|
8060
8067
|
semantic: s = !1,
|
|
8061
8068
|
...u
|
|
8062
8069
|
}) => {
|
|
8063
|
-
const c =
|
|
8070
|
+
const c = M(a, n);
|
|
8064
8071
|
return /* @__PURE__ */ x(
|
|
8065
8072
|
"svg",
|
|
8066
8073
|
{
|
|
@@ -8132,7 +8139,7 @@ try {
|
|
|
8132
8139
|
});
|
|
8133
8140
|
} catch {
|
|
8134
8141
|
}
|
|
8135
|
-
const
|
|
8142
|
+
const we = ae.forwardRef(
|
|
8136
8143
|
({
|
|
8137
8144
|
label: e,
|
|
8138
8145
|
disabled: t,
|
|
@@ -8159,7 +8166,7 @@ const be = ae.forwardRef(
|
|
|
8159
8166
|
}
|
|
8160
8167
|
);
|
|
8161
8168
|
r && (c = "pl-2");
|
|
8162
|
-
const m =
|
|
8169
|
+
const m = M(
|
|
8163
8170
|
"items-center flex-row",
|
|
8164
8171
|
"m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1 flex w-full rounded-md border border-transparent text-left text-base outline-hidden focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium",
|
|
8165
8172
|
{
|
|
@@ -8192,15 +8199,15 @@ const be = ae.forwardRef(
|
|
|
8192
8199
|
);
|
|
8193
8200
|
}
|
|
8194
8201
|
);
|
|
8195
|
-
|
|
8202
|
+
we.displayName = "MenuItem";
|
|
8196
8203
|
const $h = ({ className: e, ...t }) => {
|
|
8197
|
-
const r =
|
|
8204
|
+
const r = M(e, "my-1 border-t border-border-medium");
|
|
8198
8205
|
return /* @__PURE__ */ l("div", { className: r, ...t });
|
|
8199
8206
|
}, Da = ({
|
|
8200
8207
|
className: e,
|
|
8201
8208
|
...t
|
|
8202
8209
|
}) => {
|
|
8203
|
-
const r =
|
|
8210
|
+
const r = M(
|
|
8204
8211
|
e,
|
|
8205
8212
|
"pt-1 mb-2 text-sm text-copy-dark border-b border-border-medium"
|
|
8206
8213
|
);
|
|
@@ -8228,12 +8235,12 @@ const Ph = (e) => {
|
|
|
8228
8235
|
className: e,
|
|
8229
8236
|
defaultPlacement: t = "top-start"
|
|
8230
8237
|
}) => {
|
|
8231
|
-
const { dispatch: r, setChatId: n, setInitialMessages: o } = te(
|
|
8238
|
+
const { dispatch: r, setChatId: n, setInitialMessages: o } = te(_e), { dispatch: a } = te(Wr), { getAccessToken: i, user: s } = ye(), { data: u, isSuccess: c } = Ze({
|
|
8232
8239
|
user: s?.username,
|
|
8233
8240
|
getAccessToken: i
|
|
8234
8241
|
}), p = (g, m, h) => {
|
|
8235
8242
|
g.preventDefault(), n(Re()), o([]), r({
|
|
8236
|
-
type:
|
|
8243
|
+
type: Fe,
|
|
8237
8244
|
payload: {
|
|
8238
8245
|
privateChat: h
|
|
8239
8246
|
}
|
|
@@ -8255,7 +8262,7 @@ const Ph = (e) => {
|
|
|
8255
8262
|
noBackground: !0,
|
|
8256
8263
|
label: "Prompts",
|
|
8257
8264
|
disabled: !d,
|
|
8258
|
-
children: /* @__PURE__ */ l(ai, { size:
|
|
8265
|
+
children: /* @__PURE__ */ l(ai, { size: Ie })
|
|
8259
8266
|
}
|
|
8260
8267
|
),
|
|
8261
8268
|
defaultPlacement: t,
|
|
@@ -8278,7 +8285,7 @@ const Ph = (e) => {
|
|
|
8278
8285
|
break;
|
|
8279
8286
|
}
|
|
8280
8287
|
return g.enabled && g.label && g.content && /* @__PURE__ */ l(
|
|
8281
|
-
|
|
8288
|
+
we,
|
|
8282
8289
|
{
|
|
8283
8290
|
label: g.label,
|
|
8284
8291
|
icon: m,
|
|
@@ -8307,17 +8314,17 @@ const Ph = (e) => {
|
|
|
8307
8314
|
dispatch: n,
|
|
8308
8315
|
setChatId: o,
|
|
8309
8316
|
setInitialMessages: a
|
|
8310
|
-
} = te(
|
|
8311
|
-
key:
|
|
8317
|
+
} = te(_e), [i, s] = P(!1), [u, c] = P(!1), [p, d] = et({
|
|
8318
|
+
key: Ke + rs,
|
|
8312
8319
|
initialValue: ""
|
|
8313
|
-
}), [f, g] =
|
|
8320
|
+
}), [f, g] = P(!1), m = (v) => {
|
|
8314
8321
|
o(Re()), a([]), n({
|
|
8315
|
-
type:
|
|
8322
|
+
type: Fe,
|
|
8316
8323
|
payload: {
|
|
8317
8324
|
reasoning: !t
|
|
8318
8325
|
}
|
|
8319
8326
|
}), v && n({
|
|
8320
|
-
type:
|
|
8327
|
+
type: at,
|
|
8321
8328
|
payload: {
|
|
8322
8329
|
attachments: 0
|
|
8323
8330
|
}
|
|
@@ -8325,7 +8332,7 @@ const Ph = (e) => {
|
|
|
8325
8332
|
};
|
|
8326
8333
|
return /* @__PURE__ */ x(Oe, { children: [
|
|
8327
8334
|
u && /* @__PURE__ */ l(
|
|
8328
|
-
|
|
8335
|
+
je,
|
|
8329
8336
|
{
|
|
8330
8337
|
showConfirmation: u,
|
|
8331
8338
|
setShowConfirmation: c,
|
|
@@ -8339,7 +8346,7 @@ const Ph = (e) => {
|
|
|
8339
8346
|
}
|
|
8340
8347
|
),
|
|
8341
8348
|
i && /* @__PURE__ */ l(
|
|
8342
|
-
|
|
8349
|
+
je,
|
|
8343
8350
|
{
|
|
8344
8351
|
toggleLabel: "Don't show this again",
|
|
8345
8352
|
toggleName: "reasoning-disclosure",
|
|
@@ -8383,7 +8390,7 @@ const Ph = (e) => {
|
|
|
8383
8390
|
v && v.preventDefault(), p ? r > 0 ? c(!u) : m() : s(!i);
|
|
8384
8391
|
},
|
|
8385
8392
|
className: "text-sm",
|
|
8386
|
-
children: /* @__PURE__ */ l(fi, { size:
|
|
8393
|
+
children: /* @__PURE__ */ l(fi, { size: Ie })
|
|
8387
8394
|
}
|
|
8388
8395
|
)
|
|
8389
8396
|
}
|
|
@@ -8392,26 +8399,26 @@ const Ph = (e) => {
|
|
|
8392
8399
|
}, Dh = ({
|
|
8393
8400
|
className: e
|
|
8394
8401
|
}) => {
|
|
8395
|
-
const { user: t, getAccessToken: r } =
|
|
8402
|
+
const { user: t, getAccessToken: r } = ye(), {
|
|
8396
8403
|
dispatch: n,
|
|
8397
8404
|
state: { tokenUsage: o, provider: a, privateChat: i }
|
|
8398
|
-
} = te(
|
|
8405
|
+
} = te(_e), { messages: s, id: u } = He(), { state: c } = te(Gr), { refetch: p } = no({
|
|
8399
8406
|
enabled: !1,
|
|
8400
8407
|
user: t?.username || "",
|
|
8401
8408
|
searchString: c.searchString,
|
|
8402
8409
|
sortDirection: c.sortDirection,
|
|
8403
8410
|
sortedCell: c.sortedCell,
|
|
8404
8411
|
getAccessToken: r
|
|
8405
|
-
}), [d, f] =
|
|
8412
|
+
}), [d, f] = P(!1), [g, m] = P(!1), h = async () => {
|
|
8406
8413
|
try {
|
|
8407
8414
|
if (u && s && a) {
|
|
8408
|
-
const I = s.filter((
|
|
8415
|
+
const I = s.filter((y) => y.parts && y.parts.length > 0 ? y.parts.some(
|
|
8409
8416
|
(E) => E.type === "text" && E.text?.trim()
|
|
8410
|
-
) : !1).map((
|
|
8411
|
-
role:
|
|
8417
|
+
) : !1).map((y) => ({
|
|
8418
|
+
role: y.role,
|
|
8412
8419
|
// Convert v5 parts array to v4-style content string for storage.
|
|
8413
|
-
content:
|
|
8414
|
-
id:
|
|
8420
|
+
content: y.parts?.filter((E) => E.type === "text").map((E) => E.text).join("") || "",
|
|
8421
|
+
id: y.id
|
|
8415
8422
|
}));
|
|
8416
8423
|
await ns({
|
|
8417
8424
|
accessToken: await r(),
|
|
@@ -8424,7 +8431,7 @@ const Ph = (e) => {
|
|
|
8424
8431
|
tokenUsage: o
|
|
8425
8432
|
}
|
|
8426
8433
|
}), n({
|
|
8427
|
-
type:
|
|
8434
|
+
type: Fe,
|
|
8428
8435
|
payload: {
|
|
8429
8436
|
privateChat: !1,
|
|
8430
8437
|
preserveTokenUsage: !0
|
|
@@ -8438,11 +8445,11 @@ const Ph = (e) => {
|
|
|
8438
8445
|
}, v = (I) => {
|
|
8439
8446
|
I && I.preventDefault(), o > 0 ? m(!g) : h();
|
|
8440
8447
|
};
|
|
8441
|
-
return
|
|
8448
|
+
return $(() => {
|
|
8442
8449
|
i && s?.length > 0 ? f(!0) : f(!1);
|
|
8443
8450
|
}, [i, s]), /* @__PURE__ */ x(Oe, { children: [
|
|
8444
8451
|
g && /* @__PURE__ */ l(
|
|
8445
|
-
|
|
8452
|
+
je,
|
|
8446
8453
|
{
|
|
8447
8454
|
showConfirmation: g,
|
|
8448
8455
|
setShowConfirmation: m,
|
|
@@ -8471,7 +8478,7 @@ const Ph = (e) => {
|
|
|
8471
8478
|
focusMode: "light",
|
|
8472
8479
|
label: "Save Private Chat",
|
|
8473
8480
|
onClick: v,
|
|
8474
|
-
children: /* @__PURE__ */ l(li, { size:
|
|
8481
|
+
children: /* @__PURE__ */ l(li, { size: Ie, monotone: !0 })
|
|
8475
8482
|
}
|
|
8476
8483
|
)
|
|
8477
8484
|
}
|
|
@@ -8480,9 +8487,12 @@ const Ph = (e) => {
|
|
|
8480
8487
|
}, Lh = ({
|
|
8481
8488
|
className: e
|
|
8482
8489
|
}) => {
|
|
8483
|
-
const {
|
|
8484
|
-
state: { loading:
|
|
8485
|
-
} = te(
|
|
8490
|
+
const { getAccessToken: t, user: r } = ye(), {
|
|
8491
|
+
state: { loading: n, streaming: o }
|
|
8492
|
+
} = te(_e), { data: a, isSuccess: i } = Ze({
|
|
8493
|
+
user: r?.username,
|
|
8494
|
+
getAccessToken: t
|
|
8495
|
+
});
|
|
8486
8496
|
return /* @__PURE__ */ l(
|
|
8487
8497
|
xe,
|
|
8488
8498
|
{
|
|
@@ -8494,13 +8504,13 @@ const Ph = (e) => {
|
|
|
8494
8504
|
ve,
|
|
8495
8505
|
{
|
|
8496
8506
|
iconClassName: "text-copy-lighter pr-0.5",
|
|
8497
|
-
disabled:
|
|
8507
|
+
disabled: !(i && a) || n || o,
|
|
8498
8508
|
label: "Send",
|
|
8499
8509
|
noBorder: !0,
|
|
8500
8510
|
type: "submit",
|
|
8501
8511
|
mode: "dark",
|
|
8502
8512
|
focusMode: "light",
|
|
8503
|
-
children: /* @__PURE__ */ l(Ii, { size:
|
|
8513
|
+
children: /* @__PURE__ */ l(Ii, { size: Ie })
|
|
8504
8514
|
}
|
|
8505
8515
|
)
|
|
8506
8516
|
}
|
|
@@ -8522,26 +8532,27 @@ const Ph = (e) => {
|
|
|
8522
8532
|
], br = [
|
|
8523
8533
|
...Uh,
|
|
8524
8534
|
...Bh
|
|
8525
|
-
], Mr = 400 * 1024, jh = "text/plain", Vh = () =>
|
|
8535
|
+
], Mr = 400 * 1024, jh = "text/plain", Vh = () => M(
|
|
8526
8536
|
"relative rounded-md text-base h-auto min-w-28 overflow-hidden pt-2"
|
|
8527
|
-
), Yn = () =>
|
|
8537
|
+
), Yn = () => M("bg-surface-darker"), Fh = () => M("text-copy-lighter caret-copy-light"), Hh = () => M(
|
|
8528
8538
|
"has-[.av-prompt-editable:focus]:outline",
|
|
8529
8539
|
"has-[.av-prompt-editable:focus]:outline-2",
|
|
8530
8540
|
"has-[.av-prompt-editable:focus]:outline-offset-2",
|
|
8531
8541
|
"has-[.av-prompt-editable:focus]:outline-focus-light"
|
|
8532
|
-
), Jh = () =>
|
|
8542
|
+
), Jh = () => M(
|
|
8533
8543
|
"peer",
|
|
8534
8544
|
"text-base resize-none overflow-hidden w-full text-inherit outline-none",
|
|
8535
|
-
"h-6 pr-2 pl-4"
|
|
8545
|
+
"h-6 pr-2 pl-4",
|
|
8546
|
+
"placeholder:text-surface-medium"
|
|
8536
8547
|
), Gh = ({ className: e }) => {
|
|
8537
|
-
const t =
|
|
8548
|
+
const t = M(
|
|
8538
8549
|
ss,
|
|
8539
8550
|
Vh(),
|
|
8540
8551
|
Yn(),
|
|
8541
8552
|
Fh(),
|
|
8542
8553
|
Hh(),
|
|
8543
8554
|
e
|
|
8544
|
-
), r =
|
|
8555
|
+
), r = M(
|
|
8545
8556
|
is,
|
|
8546
8557
|
Jh(),
|
|
8547
8558
|
Yn()
|
|
@@ -8605,7 +8616,7 @@ const Ph = (e) => {
|
|
|
8605
8616
|
] }), Ua = 24, Yh = 500, Ba = 2, Xh = 5, Qh = Ua * Ba, Xn = Xh * Ua, Kh = "ready", ef = "streaming", tf = "error", rf = "submitted", Ot = (e) => {
|
|
8606
8617
|
e.current && (e.current.style.height = `${Qh}px`);
|
|
8607
8618
|
}, nf = () => {
|
|
8608
|
-
const { user: e, getAccessToken: t } =
|
|
8619
|
+
const { user: e, getAccessToken: t } = ye(), r = Kt(jt.ADDON.ATTACHMENTS), n = Kt(jt.ADDON.REASONING), [o, a] = P(null), [i, s] = P(!1), [u, c] = P(!1), {
|
|
8609
8620
|
dispatch: p,
|
|
8610
8621
|
state: {
|
|
8611
8622
|
reasoning: d,
|
|
@@ -8616,21 +8627,21 @@ const Ph = (e) => {
|
|
|
8616
8627
|
provider: v,
|
|
8617
8628
|
privateChat: I
|
|
8618
8629
|
}
|
|
8619
|
-
} = te(
|
|
8630
|
+
} = te(_e), { state: y, dispatch: E } = te(Wr), { state: b } = te(Gr), { refetch: z } = no({
|
|
8620
8631
|
enabled: !1,
|
|
8621
8632
|
user: e?.username || "",
|
|
8622
8633
|
searchString: b.searchString,
|
|
8623
8634
|
sortDirection: b.sortDirection,
|
|
8624
8635
|
sortedCell: b.sortedCell,
|
|
8625
8636
|
getAccessToken: t
|
|
8626
|
-
}), { data:
|
|
8637
|
+
}), { data: A } = Ze({
|
|
8627
8638
|
user: e?.username,
|
|
8628
8639
|
getAccessToken: t
|
|
8629
|
-
}), k = J(null),
|
|
8640
|
+
}), k = J(null), O = J(null), ie = J(!1), ke = J(0), Je = J(null), U = J(null), Ge = cs(), de = Gh({
|
|
8630
8641
|
className: ""
|
|
8631
|
-
}), { setMessages: Ce, status:
|
|
8642
|
+
}), { setMessages: Ce, status: We, id: sr, sendMessage: Tt, input: ce, setInput: De } = He({
|
|
8632
8643
|
onFinish: (D) => {
|
|
8633
|
-
|
|
8644
|
+
z();
|
|
8634
8645
|
const ne = D.message?.metadata;
|
|
8635
8646
|
ne?.tokenUsage && p({
|
|
8636
8647
|
type: Aa,
|
|
@@ -8641,9 +8652,9 @@ const Ph = (e) => {
|
|
|
8641
8652
|
}
|
|
8642
8653
|
}), Fa = B(
|
|
8643
8654
|
(D) => {
|
|
8644
|
-
|
|
8655
|
+
De(D.target.value);
|
|
8645
8656
|
},
|
|
8646
|
-
[
|
|
8657
|
+
[De]
|
|
8647
8658
|
), Ha = B(
|
|
8648
8659
|
(D, re) => {
|
|
8649
8660
|
if (D.preventDefault(), ce.trim()) {
|
|
@@ -8667,33 +8678,33 @@ const Ph = (e) => {
|
|
|
8667
8678
|
headers: re?.headers,
|
|
8668
8679
|
body: ne
|
|
8669
8680
|
}
|
|
8670
|
-
),
|
|
8681
|
+
), De("");
|
|
8671
8682
|
}
|
|
8672
8683
|
},
|
|
8673
|
-
[ce, Tt,
|
|
8684
|
+
[ce, Tt, De, v, I]
|
|
8674
8685
|
), Xr = B(
|
|
8675
8686
|
async (D) => {
|
|
8676
8687
|
D === Kh && p({
|
|
8677
|
-
type:
|
|
8688
|
+
type: rt,
|
|
8678
8689
|
payload: {
|
|
8679
8690
|
loading: !1,
|
|
8680
8691
|
streaming: !1
|
|
8681
8692
|
}
|
|
8682
8693
|
}), D === rf && p({
|
|
8683
|
-
type:
|
|
8694
|
+
type: rt,
|
|
8684
8695
|
payload: {
|
|
8685
8696
|
loading: !0,
|
|
8686
8697
|
streaming: !1
|
|
8687
8698
|
}
|
|
8688
8699
|
}), D === ef && p({
|
|
8689
|
-
type:
|
|
8700
|
+
type: rt,
|
|
8690
8701
|
payload: {
|
|
8691
8702
|
loading: !1,
|
|
8692
8703
|
streaming: !0
|
|
8693
8704
|
}
|
|
8694
8705
|
}), D === tf && setTimeout(() => {
|
|
8695
8706
|
g || (p({
|
|
8696
|
-
type:
|
|
8707
|
+
type: rt,
|
|
8697
8708
|
payload: {
|
|
8698
8709
|
loading: !1,
|
|
8699
8710
|
streaming: !1
|
|
@@ -8702,7 +8713,7 @@ const Ph = (e) => {
|
|
|
8702
8713
|
...re,
|
|
8703
8714
|
{
|
|
8704
8715
|
id: Re(),
|
|
8705
|
-
role:
|
|
8716
|
+
role: ht,
|
|
8706
8717
|
parts: [{ type: "text", text: ls }]
|
|
8707
8718
|
}
|
|
8708
8719
|
]));
|
|
@@ -8710,11 +8721,11 @@ const Ph = (e) => {
|
|
|
8710
8721
|
},
|
|
8711
8722
|
[p, Ce, g]
|
|
8712
8723
|
);
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
}, [
|
|
8716
|
-
|
|
8717
|
-
}, [
|
|
8724
|
+
$(() => {
|
|
8725
|
+
We && Xr(We);
|
|
8726
|
+
}, [We, Xr]), $(() => {
|
|
8727
|
+
A?.sendOnEnter !== void 0 && c(A.sendOnEnter);
|
|
8728
|
+
}, [A]);
|
|
8718
8729
|
const ir = B(() => {
|
|
8719
8730
|
if (!U.current)
|
|
8720
8731
|
return;
|
|
@@ -8728,37 +8739,37 @@ const Ph = (e) => {
|
|
|
8728
8739
|
}, []), Ja = (D) => {
|
|
8729
8740
|
if (D.preventDefault(), D.target.files && D.target.files.length > 0) {
|
|
8730
8741
|
const re = o ? Array.from(o) : [], ne = Array.from(D.target.files), Ne = [...re];
|
|
8731
|
-
let
|
|
8732
|
-
for (const
|
|
8733
|
-
const cr = "." +
|
|
8742
|
+
let Le = !1;
|
|
8743
|
+
for (const Ee of ne) {
|
|
8744
|
+
const cr = "." + Ee.name.split(".").pop()?.toLowerCase();
|
|
8734
8745
|
br.includes(cr) ? Ne.some(
|
|
8735
|
-
(lr) => lr.name ===
|
|
8736
|
-
) || Ne.push(
|
|
8746
|
+
(lr) => lr.name === Ee.name && lr.size === Ee.size && lr.lastModified === Ee.lastModified
|
|
8747
|
+
) || Ne.push(Ee) : Le = !0;
|
|
8737
8748
|
}
|
|
8738
|
-
if (
|
|
8749
|
+
if (O.current && (O.current.value = ""), La(Ne) > Mr) {
|
|
8739
8750
|
k.current = `Total file size exceeds the limit of ${Ut(
|
|
8740
8751
|
Mr
|
|
8741
8752
|
)}.`, s(!0);
|
|
8742
8753
|
return;
|
|
8743
8754
|
}
|
|
8744
|
-
if (
|
|
8755
|
+
if (Le) {
|
|
8745
8756
|
k.current = `Only ${br.join(
|
|
8746
8757
|
", "
|
|
8747
8758
|
)} files are allowed.`, s(!0);
|
|
8748
8759
|
return;
|
|
8749
8760
|
}
|
|
8750
8761
|
if (Ne.length > 0) {
|
|
8751
|
-
const
|
|
8752
|
-
Ne.forEach((cr) =>
|
|
8753
|
-
type:
|
|
8762
|
+
const Ee = new DataTransfer();
|
|
8763
|
+
Ne.forEach((cr) => Ee.items.add(cr)), a(Ee.files), p({
|
|
8764
|
+
type: at,
|
|
8754
8765
|
payload: {
|
|
8755
|
-
attachments:
|
|
8766
|
+
attachments: Ee.files.length
|
|
8756
8767
|
}
|
|
8757
8768
|
});
|
|
8758
8769
|
}
|
|
8759
8770
|
}
|
|
8760
8771
|
}, Ga = () => {
|
|
8761
|
-
|
|
8772
|
+
O.current && O.current.click();
|
|
8762
8773
|
}, Wa = (D) => {
|
|
8763
8774
|
if (!o)
|
|
8764
8775
|
return;
|
|
@@ -8766,13 +8777,13 @@ const Ph = (e) => {
|
|
|
8766
8777
|
Array.from(o).forEach((ne) => {
|
|
8767
8778
|
ne !== D && re.items.add(ne);
|
|
8768
8779
|
}), re.files.length === 0 ? a(null) : a(re.files), p({
|
|
8769
|
-
type:
|
|
8780
|
+
type: at,
|
|
8770
8781
|
payload: {
|
|
8771
8782
|
attachments: re.files.length
|
|
8772
8783
|
}
|
|
8773
|
-
}),
|
|
8784
|
+
}), O.current && (O.current.value = "");
|
|
8774
8785
|
}, qa = B(() => {
|
|
8775
|
-
|
|
8786
|
+
O.current && (O.current.value = ""), a(null);
|
|
8776
8787
|
}, []), Qr = async (D) => {
|
|
8777
8788
|
D.preventDefault(), Ot(U);
|
|
8778
8789
|
const re = await t();
|
|
@@ -8780,8 +8791,8 @@ const Ph = (e) => {
|
|
|
8780
8791
|
if (o && o.length > 0) {
|
|
8781
8792
|
const Ne = Array.from(o).map(
|
|
8782
8793
|
(St) => Wh(St)
|
|
8783
|
-
),
|
|
8784
|
-
Ne.forEach((St) =>
|
|
8794
|
+
), Le = new DataTransfer();
|
|
8795
|
+
Ne.forEach((St) => Le.items.add(St)), ne = Le.files;
|
|
8785
8796
|
}
|
|
8786
8797
|
Ha(D, {
|
|
8787
8798
|
headers: {
|
|
@@ -8804,17 +8815,17 @@ const Ph = (e) => {
|
|
|
8804
8815
|
U && U.current && !Ae() && U.current.focus();
|
|
8805
8816
|
}
|
|
8806
8817
|
]
|
|
8807
|
-
]),
|
|
8808
|
-
if (
|
|
8809
|
-
const D =
|
|
8818
|
+
]), $(() => {
|
|
8819
|
+
if (y.prompt !== "") {
|
|
8820
|
+
const D = y.prompt.endsWith(":") && !y.prompt.endsWith(": ") ? y.prompt + " " : y.prompt;
|
|
8810
8821
|
D.indexOf(en) !== -1 ? navigator.clipboard.readText().then((ne) => {
|
|
8811
|
-
const
|
|
8812
|
-
|
|
8813
|
-
}) :
|
|
8822
|
+
const Le = ne.startsWith("http://") || ne.startsWith("https://") ? ne : `"""${ne}"""`;
|
|
8823
|
+
De(D.replace(en, Le));
|
|
8824
|
+
}) : De(D), !Ae() && U.current && U.current.focus(), E({
|
|
8814
8825
|
type: eo
|
|
8815
8826
|
});
|
|
8816
8827
|
}
|
|
8817
|
-
}, [
|
|
8828
|
+
}, [y, E, De]), $(() => {
|
|
8818
8829
|
if (ie.current === !1) {
|
|
8819
8830
|
ie.current = !0, !ce && Ot(U);
|
|
8820
8831
|
return;
|
|
@@ -8822,15 +8833,15 @@ const Ph = (e) => {
|
|
|
8822
8833
|
m > 0 && m !== ke.current ? (ke.current = m, setTimeout(() => {
|
|
8823
8834
|
U.current && (!ce && Ot(U), U.current.focus());
|
|
8824
8835
|
}, Yh)) : f === !1 && !ce && (Ot(U), !Ae() && U.current && U.current.focus());
|
|
8825
|
-
}, [m, f, ce]),
|
|
8826
|
-
|
|
8836
|
+
}, [m, f, ce]), $(() => {
|
|
8837
|
+
y.lastTriggeredTimestamp && setTimeout(() => {
|
|
8827
8838
|
ir();
|
|
8828
8839
|
}, 100);
|
|
8829
|
-
}, [
|
|
8830
|
-
h === 0 && (
|
|
8840
|
+
}, [y.lastTriggeredTimestamp, ir]), $(() => {
|
|
8841
|
+
h === 0 && (O.current && (O.current.value = ""), a(null));
|
|
8831
8842
|
}, [h]), /* @__PURE__ */ x(Oe, { children: [
|
|
8832
8843
|
/* @__PURE__ */ l(
|
|
8833
|
-
|
|
8844
|
+
je,
|
|
8834
8845
|
{
|
|
8835
8846
|
showConfirmation: i,
|
|
8836
8847
|
setShowConfirmation: s,
|
|
@@ -8845,8 +8856,8 @@ const Ph = (e) => {
|
|
|
8845
8856
|
children: /* @__PURE__ */ l("p", { className: "m-0", children: k.current })
|
|
8846
8857
|
}
|
|
8847
8858
|
),
|
|
8848
|
-
/* @__PURE__ */ l("div", { className: de.wrapper, ref:
|
|
8849
|
-
/* @__PURE__ */ l("div", { id:
|
|
8859
|
+
/* @__PURE__ */ l("div", { className: de.wrapper, ref: Je, children: /* @__PURE__ */ x("form", { onSubmit: Qr, children: [
|
|
8860
|
+
/* @__PURE__ */ l("div", { id: Ge, className: "sr-only", children: Ir() ? tn : u ? rn : nn }),
|
|
8850
8861
|
/* @__PURE__ */ x("div", { className: "relative", children: [
|
|
8851
8862
|
/* @__PURE__ */ l(
|
|
8852
8863
|
"textarea",
|
|
@@ -8862,14 +8873,14 @@ const Ph = (e) => {
|
|
|
8862
8873
|
[u ? "enter" : "mod+Enter", Qr]
|
|
8863
8874
|
]),
|
|
8864
8875
|
className: de.textArea,
|
|
8865
|
-
"aria-labelledby":
|
|
8876
|
+
"aria-labelledby": Ge
|
|
8866
8877
|
}
|
|
8867
8878
|
),
|
|
8868
8879
|
/* @__PURE__ */ l(
|
|
8869
8880
|
"input",
|
|
8870
8881
|
{
|
|
8871
8882
|
type: "file",
|
|
8872
|
-
ref:
|
|
8883
|
+
ref: O,
|
|
8873
8884
|
onChange: Ja,
|
|
8874
8885
|
className: "hidden",
|
|
8875
8886
|
multiple: !0,
|
|
@@ -8890,7 +8901,7 @@ const Ph = (e) => {
|
|
|
8890
8901
|
onClick: Ga
|
|
8891
8902
|
}
|
|
8892
8903
|
),
|
|
8893
|
-
n &&
|
|
8904
|
+
n && A?.showReasoningButton && /* @__PURE__ */ l(Zh, { className: "order-4 mr-3 sm:mr-2" }),
|
|
8894
8905
|
/* @__PURE__ */ l(Ah, { className: "order-5 mr-3 sm:mr-2" }),
|
|
8895
8906
|
/* @__PURE__ */ l(Dh, { className: "order-6" })
|
|
8896
8907
|
] })
|
|
@@ -8899,55 +8910,55 @@ const Ph = (e) => {
|
|
|
8899
8910
|
}, Mt = "--sassy-bottom", of = ({ isComponent: e }) => {
|
|
8900
8911
|
const {
|
|
8901
8912
|
state: { loading: t, streaming: r, restoring: n }
|
|
8902
|
-
} = te(
|
|
8913
|
+
} = te(_e), {
|
|
8903
8914
|
state: { footerHeight: o, footerPosition: a },
|
|
8904
8915
|
dispatch: i
|
|
8905
|
-
} = te(qr), [s] =
|
|
8916
|
+
} = te(qr), [s] = P(
|
|
8906
8917
|
() => on[Math.floor(Math.random() * on.length)]
|
|
8907
|
-
), { messages: u } =
|
|
8918
|
+
), { messages: u } = He(), { height: c } = ei(), { height: p } = ti(), [d, f] = oo(), g = nt(() => Ae(), []), m = nt(() => ds(), []), h = c - p, v = nt(() => {
|
|
8908
8919
|
const I = g ? ps : m ? ms : ao;
|
|
8909
8920
|
return h > 70 && h < 500 ? g ? an / 2 : an : I;
|
|
8910
8921
|
}, [h, g, m]);
|
|
8911
|
-
return
|
|
8922
|
+
return $(() => {
|
|
8912
8923
|
o !== f.height && i({
|
|
8913
8924
|
type: za,
|
|
8914
8925
|
payload: {
|
|
8915
8926
|
footerHeight: f.height
|
|
8916
8927
|
}
|
|
8917
8928
|
});
|
|
8918
|
-
}, [f.height, o, i]),
|
|
8929
|
+
}, [f.height, o, i]), $(() => {
|
|
8919
8930
|
if (!d || !d.current)
|
|
8920
8931
|
return;
|
|
8921
8932
|
const I = d?.current?.style.getPropertyValue(Mt);
|
|
8922
8933
|
if (a === Qt && (t && !r || n) && I !== `${v}px` && (i({
|
|
8923
8934
|
type: Zt,
|
|
8924
8935
|
payload: {
|
|
8925
|
-
footerPosition:
|
|
8936
|
+
footerPosition: mt,
|
|
8926
8937
|
footerOffset: v
|
|
8927
8938
|
}
|
|
8928
8939
|
}), d.current.style.setProperty(
|
|
8929
8940
|
Mt,
|
|
8930
8941
|
`${v}px`
|
|
8931
|
-
)), a ===
|
|
8942
|
+
)), a === mt && I !== `${v}px` && (i({
|
|
8932
8943
|
type: Zt,
|
|
8933
8944
|
payload: {
|
|
8934
|
-
footerPosition:
|
|
8945
|
+
footerPosition: mt,
|
|
8935
8946
|
footerOffset: v
|
|
8936
8947
|
}
|
|
8937
8948
|
}), d.current.style.setProperty(
|
|
8938
8949
|
Mt,
|
|
8939
8950
|
`${v}px`
|
|
8940
8951
|
)), !t && !r && !n && u.length === 0 && c > 0 && f.height > 0) {
|
|
8941
|
-
const
|
|
8942
|
-
I !== `${
|
|
8952
|
+
const y = `${c - f.height - (e ? 300 : 245)}`;
|
|
8953
|
+
I !== `${y}px` && Number(y) > 0 && (i({
|
|
8943
8954
|
type: Zt,
|
|
8944
8955
|
payload: {
|
|
8945
8956
|
footerPosition: Qt,
|
|
8946
|
-
footerOffset: Number(
|
|
8957
|
+
footerOffset: Number(y)
|
|
8947
8958
|
}
|
|
8948
8959
|
}), d?.current?.style.setProperty(
|
|
8949
8960
|
Mt,
|
|
8950
|
-
`${
|
|
8961
|
+
`${y}px`
|
|
8951
8962
|
));
|
|
8952
8963
|
}
|
|
8953
8964
|
}, [
|
|
@@ -8966,7 +8977,7 @@ const Ph = (e) => {
|
|
|
8966
8977
|
"footer",
|
|
8967
8978
|
{
|
|
8968
8979
|
ref: d,
|
|
8969
|
-
className:
|
|
8980
|
+
className: M(
|
|
8970
8981
|
"border-transparent mt-5",
|
|
8971
8982
|
"bottom-(--sassy-bottom)",
|
|
8972
8983
|
Ym
|
|
@@ -8999,28 +9010,28 @@ const Ph = (e) => {
|
|
|
8999
9010
|
state: { privateChat: r },
|
|
9000
9011
|
setChatId: n,
|
|
9001
9012
|
setInitialMessages: o
|
|
9002
|
-
} = te(
|
|
9013
|
+
} = te(_e), { getAccessToken: a, user: i } = ye(), { status: s } = He(), [u, c] = P(!1), p = B(() => {
|
|
9003
9014
|
u || (Zm(), c(!0));
|
|
9004
|
-
}, [u]), { isSuccess: d, refetch: f, data: g } =
|
|
9015
|
+
}, [u]), { isSuccess: d, refetch: f, data: g } = Ze({
|
|
9005
9016
|
user: i?.username,
|
|
9006
9017
|
getAccessToken: a
|
|
9007
|
-
}), m = async (
|
|
9018
|
+
}), m = async (y) => {
|
|
9008
9019
|
try {
|
|
9009
|
-
n(Re()), o([]),
|
|
9010
|
-
provider:
|
|
9020
|
+
n(Re()), o([]), y !== g?.provider && (await vs({
|
|
9021
|
+
provider: y,
|
|
9011
9022
|
accessToken: await a(),
|
|
9012
9023
|
username: i?.username || ""
|
|
9013
|
-
}), f(), await Xt(`${ys} ${
|
|
9024
|
+
}), f(), await Xt(`${ys} ${y}`, {
|
|
9014
9025
|
containerId: "toggle-provider"
|
|
9015
9026
|
})), t({
|
|
9016
|
-
type:
|
|
9027
|
+
type: Fe,
|
|
9017
9028
|
payload: {
|
|
9018
9029
|
privateChat: r
|
|
9019
9030
|
}
|
|
9020
9031
|
});
|
|
9021
9032
|
} catch {
|
|
9022
9033
|
}
|
|
9023
|
-
}, h = g && d, v = h && $t.find((
|
|
9034
|
+
}, h = g && d, v = h && $t.find((y) => g.provider === y.id)?.icon || $t[0].icon, I = /* @__PURE__ */ x(
|
|
9024
9035
|
ar,
|
|
9025
9036
|
{
|
|
9026
9037
|
mode: "dark",
|
|
@@ -9038,7 +9049,7 @@ const Ph = (e) => {
|
|
|
9038
9049
|
v,
|
|
9039
9050
|
{
|
|
9040
9051
|
className: h && s === "streaming" ? "av-pulsate-icon" : "",
|
|
9041
|
-
size:
|
|
9052
|
+
size: Ie
|
|
9042
9053
|
}
|
|
9043
9054
|
)
|
|
9044
9055
|
}
|
|
@@ -9046,15 +9057,15 @@ const Ph = (e) => {
|
|
|
9046
9057
|
defaultPlacement: "top-start",
|
|
9047
9058
|
children: [
|
|
9048
9059
|
/* @__PURE__ */ l(Da, { children: "Providers" }),
|
|
9049
|
-
h && $t.map((
|
|
9050
|
-
|
|
9060
|
+
h && $t.map((y) => /* @__PURE__ */ l(
|
|
9061
|
+
we,
|
|
9051
9062
|
{
|
|
9052
|
-
selected: g.provider ===
|
|
9053
|
-
label:
|
|
9054
|
-
icon: /* @__PURE__ */ l(
|
|
9055
|
-
onClick: () => m(
|
|
9063
|
+
selected: g.provider === y.id,
|
|
9064
|
+
label: y.label,
|
|
9065
|
+
icon: /* @__PURE__ */ l(y.icon, {}),
|
|
9066
|
+
onClick: () => m(y.id)
|
|
9056
9067
|
},
|
|
9057
|
-
|
|
9068
|
+
y.id
|
|
9058
9069
|
))
|
|
9059
9070
|
]
|
|
9060
9071
|
}
|
|
@@ -9072,38 +9083,38 @@ const Ph = (e) => {
|
|
|
9072
9083
|
}, sf = Te(
|
|
9073
9084
|
() => import(
|
|
9074
9085
|
/* webpackChunkName: "modal-chunk" */
|
|
9075
|
-
"./ProfileEntry.
|
|
9086
|
+
"./ProfileEntry.C_2DJQt9.js"
|
|
9076
9087
|
).then((e) => ({
|
|
9077
9088
|
default: e.Profile
|
|
9078
9089
|
}))
|
|
9079
9090
|
), cf = Te(
|
|
9080
9091
|
() => import(
|
|
9081
9092
|
/* webpackChunkName: "modal-chunk" */
|
|
9082
|
-
"./SettingsEntry.
|
|
9093
|
+
"./SettingsEntry.HgvcJ9LW.js"
|
|
9083
9094
|
).then((e) => ({
|
|
9084
9095
|
default: e.SettingsPanel
|
|
9085
9096
|
}))
|
|
9086
9097
|
), lf = Te(
|
|
9087
9098
|
() => import(
|
|
9088
9099
|
/* webpackChunkName: "modal-chunk" */
|
|
9089
|
-
"./HistoryEntry.
|
|
9100
|
+
"./HistoryEntry.oh23W-Mc.js"
|
|
9090
9101
|
).then((e) => ({
|
|
9091
9102
|
default: e.HistoryPanel
|
|
9092
9103
|
}))
|
|
9093
9104
|
), uf = Te(
|
|
9094
9105
|
() => import(
|
|
9095
9106
|
/* webpackChunkName: "modal-chunk" */
|
|
9096
|
-
"./AboutEntry.
|
|
9107
|
+
"./AboutEntry.DmZe57qx.js"
|
|
9097
9108
|
).then((e) => ({ default: e.About }))
|
|
9098
9109
|
), df = Te(
|
|
9099
9110
|
() => import(
|
|
9100
9111
|
/* webpackChunkName: "modal-chunk" */
|
|
9101
|
-
"./UsageEntry.
|
|
9112
|
+
"./UsageEntry.Cheb49JV.js"
|
|
9102
9113
|
).then((e) => ({ default: e.Usage }))
|
|
9103
9114
|
), pf = Te(
|
|
9104
9115
|
() => import(
|
|
9105
9116
|
/* webpackChunkName: "modal-chunk" */
|
|
9106
|
-
"./UserMemoriesPanel.
|
|
9117
|
+
"./UserMemoriesPanel.iRR7Hyuo.js"
|
|
9107
9118
|
).then(
|
|
9108
9119
|
(e) => ({ default: e.default })
|
|
9109
9120
|
)
|
|
@@ -9111,7 +9122,7 @@ const Ph = (e) => {
|
|
|
9111
9122
|
open: e,
|
|
9112
9123
|
onOpenChange: t
|
|
9113
9124
|
}) => {
|
|
9114
|
-
const { user: r } =
|
|
9125
|
+
const { user: r } = ye();
|
|
9115
9126
|
return /* @__PURE__ */ l(
|
|
9116
9127
|
pf,
|
|
9117
9128
|
{
|
|
@@ -9140,44 +9151,44 @@ const Ph = (e) => {
|
|
|
9140
9151
|
})() }) : null, ff = ({
|
|
9141
9152
|
isComponent: e = !1
|
|
9142
9153
|
}) => {
|
|
9143
|
-
const { logout: t, getAccessToken: r, user: n } =
|
|
9154
|
+
const { logout: t, getAccessToken: r, user: n } = ye(), { data: o, isSuccess: a } = Ze({
|
|
9144
9155
|
user: n?.username,
|
|
9145
9156
|
getAccessToken: r
|
|
9146
|
-
}), [i, s] =
|
|
9147
|
-
|
|
9157
|
+
}), [i, s] = P(null), [u, c] = P(!1), [p, d] = P(!1), [f, g] = P(!1), m = Kt(jt.TOOL.MEMORIES);
|
|
9158
|
+
$(() => {
|
|
9148
9159
|
a && o && m && g(o?.useMemory ?? !1);
|
|
9149
9160
|
}, [a, o, m]);
|
|
9150
9161
|
const h = B(() => {
|
|
9151
9162
|
p || Promise.all([
|
|
9152
9163
|
import(
|
|
9153
9164
|
/* webpackChunkName: "modal-chunk" */
|
|
9154
|
-
"./ProfileEntry.
|
|
9165
|
+
"./ProfileEntry.C_2DJQt9.js"
|
|
9155
9166
|
),
|
|
9156
9167
|
import(
|
|
9157
9168
|
/* webpackChunkName: "modal-chunk" */
|
|
9158
|
-
"./SettingsEntry.
|
|
9169
|
+
"./SettingsEntry.HgvcJ9LW.js"
|
|
9159
9170
|
),
|
|
9160
9171
|
import(
|
|
9161
9172
|
/* webpackChunkName: "modal-chunk" */
|
|
9162
|
-
"./HistoryEntry.
|
|
9173
|
+
"./HistoryEntry.oh23W-Mc.js"
|
|
9163
9174
|
),
|
|
9164
9175
|
import(
|
|
9165
9176
|
/* webpackChunkName: "modal-chunk" */
|
|
9166
|
-
"./AboutEntry.
|
|
9177
|
+
"./AboutEntry.DmZe57qx.js"
|
|
9167
9178
|
),
|
|
9168
9179
|
import(
|
|
9169
9180
|
/* webpackChunkName: "modal-chunk" */
|
|
9170
|
-
"./UsageEntry.
|
|
9181
|
+
"./UsageEntry.Cheb49JV.js"
|
|
9171
9182
|
)
|
|
9172
9183
|
]).finally(() => d(!0));
|
|
9173
9184
|
}, [p]), v = B((b) => {
|
|
9174
9185
|
s(b);
|
|
9175
9186
|
}, []), I = B(() => {
|
|
9176
9187
|
s(null);
|
|
9177
|
-
}, []),
|
|
9188
|
+
}, []), y = B(() => {
|
|
9178
9189
|
v("settings");
|
|
9179
9190
|
}, [v]);
|
|
9180
|
-
Pa("openSettings",
|
|
9191
|
+
Pa("openSettings", y);
|
|
9181
9192
|
const E = () => {
|
|
9182
9193
|
c(!u);
|
|
9183
9194
|
};
|
|
@@ -9198,7 +9209,7 @@ const Ph = (e) => {
|
|
|
9198
9209
|
[]
|
|
9199
9210
|
), /* @__PURE__ */ x(Oe, { children: [
|
|
9200
9211
|
/* @__PURE__ */ l(
|
|
9201
|
-
|
|
9212
|
+
je,
|
|
9202
9213
|
{
|
|
9203
9214
|
showConfirmation: u,
|
|
9204
9215
|
setShowConfirmation: c,
|
|
@@ -9227,8 +9238,8 @@ const Ph = (e) => {
|
|
|
9227
9238
|
rowGap: 0,
|
|
9228
9239
|
columnGap: 0,
|
|
9229
9240
|
children: [
|
|
9230
|
-
/* @__PURE__ */ l(
|
|
9231
|
-
/* @__PURE__ */ l(
|
|
9241
|
+
/* @__PURE__ */ l(Qe, { children: /* @__PURE__ */ l(af, { className: " mr-4 sm:mr-2" }) }),
|
|
9242
|
+
/* @__PURE__ */ l(Qe, { children: /* @__PURE__ */ l(
|
|
9232
9243
|
xe,
|
|
9233
9244
|
{
|
|
9234
9245
|
label: "Profile, Settings, etc.",
|
|
@@ -9253,7 +9264,7 @@ const Ph = (e) => {
|
|
|
9253
9264
|
defaultPlacement: "bottom-end",
|
|
9254
9265
|
children: [
|
|
9255
9266
|
/* @__PURE__ */ l(
|
|
9256
|
-
|
|
9267
|
+
we,
|
|
9257
9268
|
{
|
|
9258
9269
|
label: "Profile",
|
|
9259
9270
|
onClick: () => v("profile"),
|
|
@@ -9261,7 +9272,7 @@ const Ph = (e) => {
|
|
|
9261
9272
|
}
|
|
9262
9273
|
),
|
|
9263
9274
|
/* @__PURE__ */ l(
|
|
9264
|
-
|
|
9275
|
+
we,
|
|
9265
9276
|
{
|
|
9266
9277
|
label: "Settings",
|
|
9267
9278
|
onClick: () => v("settings"),
|
|
@@ -9269,7 +9280,7 @@ const Ph = (e) => {
|
|
|
9269
9280
|
}
|
|
9270
9281
|
),
|
|
9271
9282
|
/* @__PURE__ */ l(
|
|
9272
|
-
|
|
9283
|
+
we,
|
|
9273
9284
|
{
|
|
9274
9285
|
label: "History",
|
|
9275
9286
|
onClick: () => v("history"),
|
|
@@ -9277,7 +9288,7 @@ const Ph = (e) => {
|
|
|
9277
9288
|
}
|
|
9278
9289
|
),
|
|
9279
9290
|
f && /* @__PURE__ */ l(
|
|
9280
|
-
|
|
9291
|
+
we,
|
|
9281
9292
|
{
|
|
9282
9293
|
label: "Memories",
|
|
9283
9294
|
onClick: () => v("memories"),
|
|
@@ -9285,7 +9296,7 @@ const Ph = (e) => {
|
|
|
9285
9296
|
}
|
|
9286
9297
|
),
|
|
9287
9298
|
!e && /* @__PURE__ */ l(
|
|
9288
|
-
|
|
9299
|
+
we,
|
|
9289
9300
|
{
|
|
9290
9301
|
label: "Usage",
|
|
9291
9302
|
onClick: () => v("usage"),
|
|
@@ -9293,7 +9304,7 @@ const Ph = (e) => {
|
|
|
9293
9304
|
}
|
|
9294
9305
|
),
|
|
9295
9306
|
/* @__PURE__ */ l(
|
|
9296
|
-
|
|
9307
|
+
we,
|
|
9297
9308
|
{
|
|
9298
9309
|
label: "About",
|
|
9299
9310
|
onClick: () => v("about"),
|
|
@@ -9303,7 +9314,7 @@ const Ph = (e) => {
|
|
|
9303
9314
|
!e && /* @__PURE__ */ x(Oe, { children: [
|
|
9304
9315
|
/* @__PURE__ */ l($h, {}),
|
|
9305
9316
|
/* @__PURE__ */ l(
|
|
9306
|
-
|
|
9317
|
+
we,
|
|
9307
9318
|
{
|
|
9308
9319
|
label: "Log out",
|
|
9309
9320
|
onClick: E,
|
|
@@ -9330,14 +9341,14 @@ const Ph = (e) => {
|
|
|
9330
9341
|
"div",
|
|
9331
9342
|
{
|
|
9332
9343
|
style: { bottom: `${t}px` },
|
|
9333
|
-
className: n ||
|
|
9344
|
+
className: n || M(
|
|
9334
9345
|
Xm,
|
|
9335
9346
|
"fixed left-1/2 transform -translate-x-1/2 isolate"
|
|
9336
9347
|
),
|
|
9337
9348
|
children: /* @__PURE__ */ l(
|
|
9338
9349
|
"button",
|
|
9339
9350
|
{
|
|
9340
|
-
className:
|
|
9351
|
+
className: M(
|
|
9341
9352
|
"focus:outline-2",
|
|
9342
9353
|
"focus:outline-focus-dark dark:focus:outline-focus-light",
|
|
9343
9354
|
"av-button not-prose truncate text-copy-light rounded-full inline-flex items-center justify-center h-8 w-8 p-1 border border-white/20 dark:border-black/20 focus:outline-offset-2 disabled:opacity-50 dark:bg-slate-50/60 bg-slate-500/60 backdrop-blur-lg backdrop-saturate-150 disabled:cursor-auto opacity-90 hover:opacity-100 transition-opacity",
|
|
@@ -9371,7 +9382,7 @@ const Ph = (e) => {
|
|
|
9371
9382
|
type: r = "circle",
|
|
9372
9383
|
className: n
|
|
9373
9384
|
}) => {
|
|
9374
|
-
const o = r === "circle" ?
|
|
9385
|
+
const o = r === "circle" ? M(
|
|
9375
9386
|
Qn,
|
|
9376
9387
|
"h-8 w-8",
|
|
9377
9388
|
"align-[-0.125em]",
|
|
@@ -9384,7 +9395,7 @@ const Ph = (e) => {
|
|
|
9384
9395
|
"text-copy-accent dark:text-copy-dark": t === "alt-system"
|
|
9385
9396
|
},
|
|
9386
9397
|
n
|
|
9387
|
-
) :
|
|
9398
|
+
) : M(Qn, n), a = M("av-spinner__dot", {
|
|
9388
9399
|
"fill-copy-dark": t === "dark",
|
|
9389
9400
|
"fill-copy-accent": t === "light",
|
|
9390
9401
|
"fill-copy-dark dark:fill-copy-accent": t === "system",
|
|
@@ -9413,20 +9424,20 @@ try {
|
|
|
9413
9424
|
} catch {
|
|
9414
9425
|
}
|
|
9415
9426
|
const vf = Te(
|
|
9416
|
-
() => import("./index.
|
|
9427
|
+
() => import("./index.CDCPARyL.js").then((e) => ({ default: e.Bubble }))
|
|
9417
9428
|
), Yr = (e) => /* @__PURE__ */ l(Vt, { fallback: /* @__PURE__ */ l("span", { className: "inline-block" }), children: /* @__PURE__ */ l(vf, { ...e }) });
|
|
9418
9429
|
Yr.displayName = "AsyncBubble";
|
|
9419
9430
|
const Kn = 1, yf = 150, _f = Te(
|
|
9420
9431
|
() => import(
|
|
9421
9432
|
/* webpackChunkName: "LazyMessageAssistant" */
|
|
9422
|
-
"./ChatBubbleAssistant.
|
|
9433
|
+
"./ChatBubbleAssistant.9M5ZLVQq.js"
|
|
9423
9434
|
)
|
|
9424
9435
|
), bf = Te(
|
|
9425
9436
|
() => import(
|
|
9426
9437
|
/* webpackChunkName: "LazyMessageUser" */
|
|
9427
|
-
"./ChatBubbleUser.
|
|
9438
|
+
"./ChatBubbleUser.jeCCU-N6.js"
|
|
9428
9439
|
)
|
|
9429
|
-
), wf =
|
|
9440
|
+
), wf = st.memo(
|
|
9430
9441
|
({
|
|
9431
9442
|
role: e,
|
|
9432
9443
|
content: t,
|
|
@@ -9435,10 +9446,10 @@ const Kn = 1, yf = 150, _f = Te(
|
|
|
9435
9446
|
isLastAssistantMessage: o = !1,
|
|
9436
9447
|
status: a
|
|
9437
9448
|
}) => {
|
|
9438
|
-
const [i, s] =
|
|
9449
|
+
const [i, s] = P(!0), u = J(Date.now()), [c] = P(
|
|
9439
9450
|
() => o && (a === "streaming" || a === "submitted")
|
|
9440
9451
|
);
|
|
9441
|
-
return
|
|
9452
|
+
return $(() => {
|
|
9442
9453
|
if (o && i && t && t.trim().length >= Kn) {
|
|
9443
9454
|
const d = Date.now() - u.current, f = yf - d;
|
|
9444
9455
|
if (f > 0) {
|
|
@@ -9453,7 +9464,7 @@ const Kn = 1, yf = 150, _f = Te(
|
|
|
9453
9464
|
}, [t, i, o]), e === so && t ? /* @__PURE__ */ x(Vt, { fallback: /* @__PURE__ */ l("span", {}), children: [
|
|
9454
9465
|
/* @__PURE__ */ l(bf, { content: t }),
|
|
9455
9466
|
";"
|
|
9456
|
-
] }) : (e ===
|
|
9467
|
+
] }) : (e === ht || e === cn) && o && (a === "submitted" || a === "streaming") && i ? /* @__PURE__ */ l(Yr, { tail: !0, children: /* @__PURE__ */ l(ja, { type: "dots" }) }) : (e === ht || e === cn) && t && t.trim().length >= Kn ? /* @__PURE__ */ l(Vt, { fallback: /* @__PURE__ */ l("span", {}), children: /* @__PURE__ */ l(
|
|
9457
9468
|
_f,
|
|
9458
9469
|
{
|
|
9459
9470
|
role: e,
|
|
@@ -9489,11 +9500,11 @@ function Ef(e) {
|
|
|
9489
9500
|
}
|
|
9490
9501
|
}
|
|
9491
9502
|
const Tf = () => {
|
|
9492
|
-
const { messages: e, status: t } =
|
|
9503
|
+
const { messages: e, status: t } = He(), r = e ? e.map((a, i) => a.role === ht ? i : -1).filter((a) => a !== -1).pop() : -1, n = e && e.length > 0 ? e[e.length - 1] : null, o = (t === "submitted" || t === "streaming") && n?.role === so;
|
|
9493
9504
|
return e && e.length > 0 ? /* @__PURE__ */ x("div", { className: "space-y-6 mt-2 @container", children: [
|
|
9494
9505
|
e?.map((a, i) => {
|
|
9495
9506
|
let s;
|
|
9496
|
-
const u = `${i}-${a.role}`, c = If(a), p = Ef(a), d = a.role ===
|
|
9507
|
+
const u = `${i}-${a.role}`, c = If(a), p = Ef(a), d = a.role === ht && i === r;
|
|
9497
9508
|
return /* @__PURE__ */ l(
|
|
9498
9509
|
wf,
|
|
9499
9510
|
{
|
|
@@ -9510,11 +9521,11 @@ const Tf = () => {
|
|
|
9510
9521
|
o && /* @__PURE__ */ l(Yr, { tail: !0, children: /* @__PURE__ */ l(ja, { type: "dots" }) })
|
|
9511
9522
|
] }) : null;
|
|
9512
9523
|
}, Sf = () => {
|
|
9513
|
-
const { isAuthenticated: e } =
|
|
9524
|
+
const { isAuthenticated: e } = ye(), { ref: t, inViewport: r } = Xs(), n = J(null), o = J(null), {
|
|
9514
9525
|
state: { footerPosition: a, footerHeight: i, footerOffset: s }
|
|
9515
9526
|
} = te(qr), {
|
|
9516
9527
|
state: { loading: u }
|
|
9517
|
-
} = te(
|
|
9528
|
+
} = te(_e), { messages: c } = He(), p = J(0), { data: d, isSuccess: f } = _s(), g = bs({
|
|
9518
9529
|
isAuthenticated: e,
|
|
9519
9530
|
extraClass: "rounded-b-md relative border-b-16 border-slate-900"
|
|
9520
9531
|
}), m = Ir() ? "mt-4" : "", h = B(() => {
|
|
@@ -9523,10 +9534,10 @@ const Tf = () => {
|
|
|
9523
9534
|
block: "end"
|
|
9524
9535
|
});
|
|
9525
9536
|
}, []);
|
|
9526
|
-
return
|
|
9537
|
+
return $(() => {
|
|
9527
9538
|
u && h();
|
|
9528
|
-
}, [u, h]),
|
|
9529
|
-
p.current = a ===
|
|
9539
|
+
}, [u, h]), $(() => {
|
|
9540
|
+
p.current = a === mt ? i + s + io + ws + 15 : 0;
|
|
9530
9541
|
}, [a, i, s]), /* @__PURE__ */ x(Oe, { children: [
|
|
9531
9542
|
/* @__PURE__ */ x("div", { className: g, ref: n, children: [
|
|
9532
9543
|
/* @__PURE__ */ l(
|
|
@@ -9543,7 +9554,7 @@ const Tf = () => {
|
|
|
9543
9554
|
"div",
|
|
9544
9555
|
{
|
|
9545
9556
|
ref: o,
|
|
9546
|
-
className:
|
|
9557
|
+
className: M({
|
|
9547
9558
|
"pt-20": c && c.length > 1
|
|
9548
9559
|
})
|
|
9549
9560
|
}
|
|
@@ -9552,7 +9563,7 @@ const Tf = () => {
|
|
|
9552
9563
|
/* @__PURE__ */ l(
|
|
9553
9564
|
gf,
|
|
9554
9565
|
{
|
|
9555
|
-
show: !r && a ===
|
|
9566
|
+
show: !r && a === mt,
|
|
9556
9567
|
bottom: p.current,
|
|
9557
9568
|
onClick: h
|
|
9558
9569
|
}
|
|
@@ -9563,26 +9574,26 @@ function Va({
|
|
|
9563
9574
|
isComponent: e = !1,
|
|
9564
9575
|
headerHeight: t = 0
|
|
9565
9576
|
}) {
|
|
9566
|
-
const { user: r, getAccessToken: n } =
|
|
9567
|
-
key:
|
|
9577
|
+
const { user: r, getAccessToken: n } = ye(), [o, a] = P(`${ln}px`), [i, s] = oo(), [u, c] = P(Re()), [p, d] = P([]), [f] = et({
|
|
9578
|
+
key: Ke + Cs,
|
|
9568
9579
|
initialValue: ""
|
|
9569
|
-
}), [g] =
|
|
9570
|
-
key:
|
|
9580
|
+
}), [g] = et({
|
|
9581
|
+
key: Ke + ks,
|
|
9571
9582
|
initialValue: un
|
|
9572
|
-
}), [m] =
|
|
9573
|
-
key:
|
|
9574
|
-
initialValue:
|
|
9575
|
-
}), [h] =
|
|
9576
|
-
key:
|
|
9577
|
-
initialValue:
|
|
9578
|
-
}), v =
|
|
9583
|
+
}), [m] = et({
|
|
9584
|
+
key: Ke + Ns,
|
|
9585
|
+
initialValue: ot.DESC
|
|
9586
|
+
}), [h] = et({
|
|
9587
|
+
key: Ke + zs,
|
|
9588
|
+
initialValue: ot.ASC
|
|
9589
|
+
}), v = nt(() => ({
|
|
9579
9590
|
footerPosition: Qt,
|
|
9580
9591
|
footerHeight: 0,
|
|
9581
9592
|
footerOffset: Ae() ? ao : 0
|
|
9582
|
-
}), []), [I,
|
|
9593
|
+
}), []), [I, y] = xt(Dm, v), E = nt(() => {
|
|
9583
9594
|
const de = Ae(), Ce = Es();
|
|
9584
9595
|
return de && Ce ? "mt-1" : "mt-5";
|
|
9585
|
-
}, []),
|
|
9596
|
+
}, []), z = {
|
|
9586
9597
|
searchString: f,
|
|
9587
9598
|
sortedCell: g,
|
|
9588
9599
|
sortDirection: (() => {
|
|
@@ -9594,13 +9605,13 @@ function Va({
|
|
|
9594
9605
|
return m;
|
|
9595
9606
|
}
|
|
9596
9607
|
})()
|
|
9597
|
-
}, [
|
|
9608
|
+
}, [A, k] = xt(
|
|
9598
9609
|
Um,
|
|
9599
|
-
|
|
9600
|
-
), [
|
|
9610
|
+
z
|
|
9611
|
+
), [O, ie] = xt(Bm, {
|
|
9601
9612
|
prompt: "",
|
|
9602
9613
|
lastTriggeredTimestamp: 0
|
|
9603
|
-
}), [ke,
|
|
9614
|
+
}), [ke, Je] = xt(Lm, {
|
|
9604
9615
|
provider: "",
|
|
9605
9616
|
// OpenAI, Anthropic, etc.
|
|
9606
9617
|
privateChat: !1,
|
|
@@ -9613,26 +9624,26 @@ function Va({
|
|
|
9613
9624
|
attachments: 0,
|
|
9614
9625
|
lastStreamingTimestamp: 0,
|
|
9615
9626
|
lastResetTimestamp: 0
|
|
9616
|
-
}), { data: U } =
|
|
9627
|
+
}), { data: U } = Ze({
|
|
9617
9628
|
user: r?.username,
|
|
9618
9629
|
getAccessToken: n
|
|
9619
|
-
}),
|
|
9630
|
+
}), Ge = nt(() => new Jr({
|
|
9620
9631
|
api: `${ro}/api/generate`,
|
|
9621
9632
|
// Only include static values in transport body.
|
|
9622
9633
|
body: {
|
|
9623
9634
|
username: r?.username
|
|
9624
9635
|
}
|
|
9625
9636
|
}), [r?.username]);
|
|
9626
|
-
return
|
|
9637
|
+
return $(() => {
|
|
9627
9638
|
document.getElementById("root")?.classList.replace("app-hidden", "fadeIn");
|
|
9628
|
-
}, []),
|
|
9629
|
-
U && U.provider &&
|
|
9639
|
+
}, []), $(() => {
|
|
9640
|
+
U && U.provider && Je({
|
|
9630
9641
|
type: Oa,
|
|
9631
9642
|
payload: {
|
|
9632
9643
|
provider: U.provider
|
|
9633
9644
|
}
|
|
9634
9645
|
});
|
|
9635
|
-
}, [U]),
|
|
9646
|
+
}, [U]), $(() => {
|
|
9636
9647
|
try {
|
|
9637
9648
|
const de = sessionStorage.getItem("sw-toggle-pending");
|
|
9638
9649
|
de && (de === "enabled" ? Xt(As, { containerId: "toggle-save" }) : de === "disabled" && Xt(Os, {
|
|
@@ -9654,19 +9665,19 @@ function Va({
|
|
|
9654
9665
|
Gr.Provider,
|
|
9655
9666
|
{
|
|
9656
9667
|
value: {
|
|
9657
|
-
state:
|
|
9668
|
+
state: A,
|
|
9658
9669
|
dispatch: k
|
|
9659
9670
|
},
|
|
9660
|
-
children: /* @__PURE__ */ l(qr.Provider, { value: { state: I, dispatch:
|
|
9671
|
+
children: /* @__PURE__ */ l(qr.Provider, { value: { state: I, dispatch: y }, children: /* @__PURE__ */ l(
|
|
9661
9672
|
Wr.Provider,
|
|
9662
9673
|
{
|
|
9663
|
-
value: { state:
|
|
9674
|
+
value: { state: O, dispatch: ie },
|
|
9664
9675
|
children: /* @__PURE__ */ l(
|
|
9665
|
-
|
|
9676
|
+
_e.Provider,
|
|
9666
9677
|
{
|
|
9667
9678
|
value: {
|
|
9668
9679
|
state: ke,
|
|
9669
|
-
dispatch:
|
|
9680
|
+
dispatch: Je,
|
|
9670
9681
|
setChatId: c,
|
|
9671
9682
|
setInitialMessages: d
|
|
9672
9683
|
},
|
|
@@ -9676,7 +9687,7 @@ function Va({
|
|
|
9676
9687
|
value: {
|
|
9677
9688
|
id: u,
|
|
9678
9689
|
messages: p,
|
|
9679
|
-
transport:
|
|
9690
|
+
transport: Ge,
|
|
9680
9691
|
experimental_throttle: 300,
|
|
9681
9692
|
generateId() {
|
|
9682
9693
|
return Re();
|
|
@@ -9725,14 +9736,14 @@ export {
|
|
|
9725
9736
|
Yr as AsyncBubble,
|
|
9726
9737
|
gf as ButtonScroll,
|
|
9727
9738
|
Oa as CHAT_SET_PROVIDER,
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9739
|
+
rt as CHAT_SET_STATUS,
|
|
9740
|
+
_e as ChatContext,
|
|
9741
|
+
je as ConfirmationPanel,
|
|
9742
|
+
et as E,
|
|
9732
9743
|
Gr as HistoryContext,
|
|
9733
9744
|
Jn as LazyToastContainerWrapper,
|
|
9734
9745
|
zh as O,
|
|
9735
|
-
|
|
9746
|
+
ot as e,
|
|
9736
9747
|
jm as getDefaultExportFromCjs,
|
|
9737
9748
|
bh as oe,
|
|
9738
9749
|
Xs as p,
|
|
@@ -9741,7 +9752,7 @@ export {
|
|
|
9741
9752
|
Of as showErrorToast,
|
|
9742
9753
|
Xt as showSuccessToast,
|
|
9743
9754
|
xe as st,
|
|
9744
|
-
|
|
9755
|
+
He as useAiChat,
|
|
9745
9756
|
Kt as useCapability,
|
|
9746
9757
|
yi as z
|
|
9747
9758
|
};
|