teodor-new-chat-ui 4.3.669 → 4.3.670
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/index.esm.js +771 -773
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +18 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ var Hs = (e, t, n) => gh(e, typeof t != "symbol" ? t + "" : t, n);
|
|
|
4
4
|
import { clsx as Nc } from "clsx";
|
|
5
5
|
import { twMerge as jc } from "tailwind-merge";
|
|
6
6
|
import * as w from "react";
|
|
7
|
-
import Q, { createContext as rr, useContext as or, useState as ce, useRef as ke, useCallback as ie, useEffect as ze, useMemo as
|
|
7
|
+
import Q, { createContext as rr, useContext as or, useState as ce, useRef as ke, useCallback as ie, useEffect as ze, useMemo as Oe, useReducer as xh, createElement as No, memo as no, useImperativeHandle as yh, useLayoutEffect as wh } from "react";
|
|
8
8
|
import { Slot as bh, createSlot as Kr } from "@radix-ui/react-slot";
|
|
9
9
|
import { cva as _c } from "class-variance-authority";
|
|
10
10
|
import * as Pc from "react-dom";
|
|
@@ -350,11 +350,11 @@ function gs(e, t, n) {
|
|
|
350
350
|
if (z.endsWith(g, "{}"))
|
|
351
351
|
g = r ? g : g.slice(0, -2), m = JSON.stringify(m);
|
|
352
352
|
else if (z.isArray(m) && Pm(m) || (z.isFileList(m) || z.endsWith(g, "[]")) && (x = z.toArray(m)))
|
|
353
|
-
return g = qc(g), x.forEach(function(
|
|
354
|
-
!(z.isUndefined(
|
|
353
|
+
return g = qc(g), x.forEach(function(k, T) {
|
|
354
|
+
!(z.isUndefined(k) || k === null) && t.append(
|
|
355
355
|
// eslint-disable-next-line no-nested-ternary
|
|
356
|
-
i === !0 ? Qa([g],
|
|
357
|
-
l(
|
|
356
|
+
i === !0 ? Qa([g], T, s) : i === null ? g : g + "[]",
|
|
357
|
+
l(k)
|
|
358
358
|
);
|
|
359
359
|
}), !1;
|
|
360
360
|
}
|
|
@@ -1048,13 +1048,13 @@ const tu = (e) => {
|
|
|
1048
1048
|
function x() {
|
|
1049
1049
|
if (!y)
|
|
1050
1050
|
return;
|
|
1051
|
-
const
|
|
1051
|
+
const k = At.from(
|
|
1052
1052
|
"getAllResponseHeaders" in y && y.getAllResponseHeaders()
|
|
1053
|
-
),
|
|
1053
|
+
), v = {
|
|
1054
1054
|
data: !a || a === "text" || a === "json" ? y.responseText : y.response,
|
|
1055
1055
|
status: y.status,
|
|
1056
1056
|
statusText: y.statusText,
|
|
1057
|
-
headers:
|
|
1057
|
+
headers: k,
|
|
1058
1058
|
config: e,
|
|
1059
1059
|
request: y
|
|
1060
1060
|
};
|
|
@@ -1062,28 +1062,28 @@ const tu = (e) => {
|
|
|
1062
1062
|
n(C), g();
|
|
1063
1063
|
}, function(C) {
|
|
1064
1064
|
r(C), g();
|
|
1065
|
-
},
|
|
1065
|
+
}, v), y = null;
|
|
1066
1066
|
}
|
|
1067
1067
|
"onloadend" in y ? y.onloadend = x : y.onreadystatechange = function() {
|
|
1068
1068
|
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1069
1069
|
}, y.onabort = function() {
|
|
1070
1070
|
y && (r(new Ie("Request aborted", Ie.ECONNABORTED, e, y)), y = null);
|
|
1071
|
-
}, y.onerror = function(
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1071
|
+
}, y.onerror = function(T) {
|
|
1072
|
+
const v = T && T.message ? T.message : "Network Error", S = new Ie(v, Ie.ERR_NETWORK, e, y);
|
|
1073
|
+
S.event = T || null, r(S), y = null;
|
|
1074
1074
|
}, y.ontimeout = function() {
|
|
1075
|
-
let
|
|
1076
|
-
const
|
|
1077
|
-
o.timeoutErrorMessage && (
|
|
1078
|
-
|
|
1079
|
-
|
|
1075
|
+
let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1076
|
+
const v = o.transitional || Xc;
|
|
1077
|
+
o.timeoutErrorMessage && (T = o.timeoutErrorMessage), r(new Ie(
|
|
1078
|
+
T,
|
|
1079
|
+
v.clarifyTimeoutError ? Ie.ETIMEDOUT : Ie.ECONNABORTED,
|
|
1080
1080
|
e,
|
|
1081
1081
|
y
|
|
1082
1082
|
)), y = null;
|
|
1083
|
-
}, s === void 0 && i.setContentType(null), "setRequestHeader" in y && z.forEach(i.toJSON(), function(
|
|
1084
|
-
y.setRequestHeader(
|
|
1085
|
-
}), z.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), a && a !== "json" && (y.responseType = o.responseType), l && ([p, m] = Yo(l, !0), y.addEventListener("progress", p)), u && y.upload && ([f, h] = Yo(u), y.upload.addEventListener("progress", f), y.upload.addEventListener("loadend", h)), (o.cancelToken || o.signal) && (c = (
|
|
1086
|
-
y && (r(!
|
|
1083
|
+
}, s === void 0 && i.setContentType(null), "setRequestHeader" in y && z.forEach(i.toJSON(), function(T, v) {
|
|
1084
|
+
y.setRequestHeader(v, T);
|
|
1085
|
+
}), z.isUndefined(o.withCredentials) || (y.withCredentials = !!o.withCredentials), a && a !== "json" && (y.responseType = o.responseType), l && ([p, m] = Yo(l, !0), y.addEventListener("progress", p)), u && y.upload && ([f, h] = Yo(u), y.upload.addEventListener("progress", f), y.upload.addEventListener("loadend", h)), (o.cancelToken || o.signal) && (c = (k) => {
|
|
1086
|
+
y && (r(!k || k.type ? new Rr(null, e, y) : k), y.abort(), y = null);
|
|
1087
1087
|
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
|
|
1088
1088
|
const b = eg(o.url);
|
|
1089
1089
|
if (b && mt.protocols.indexOf(b) === -1) {
|
|
@@ -1236,23 +1236,23 @@ const tu = (e) => {
|
|
|
1236
1236
|
method: y,
|
|
1237
1237
|
data: x,
|
|
1238
1238
|
signal: b,
|
|
1239
|
-
cancelToken:
|
|
1240
|
-
timeout:
|
|
1241
|
-
onDownloadProgress:
|
|
1242
|
-
onUploadProgress:
|
|
1239
|
+
cancelToken: k,
|
|
1240
|
+
timeout: T,
|
|
1241
|
+
onDownloadProgress: v,
|
|
1242
|
+
onUploadProgress: S,
|
|
1243
1243
|
responseType: C,
|
|
1244
1244
|
headers: R,
|
|
1245
1245
|
withCredentials: _ = "same-origin",
|
|
1246
1246
|
fetchOptions: D
|
|
1247
1247
|
} = tu(m), $ = t || fetch;
|
|
1248
1248
|
C = C ? (C + "").toLowerCase() : "text";
|
|
1249
|
-
let F = cg([b,
|
|
1249
|
+
let F = cg([b, k && k.toAbortSignal()], T), O = null;
|
|
1250
1250
|
const E = F && F.unsubscribe && (() => {
|
|
1251
1251
|
F.unsubscribe();
|
|
1252
1252
|
});
|
|
1253
1253
|
let q;
|
|
1254
1254
|
try {
|
|
1255
|
-
if (
|
|
1255
|
+
if (S && l && y !== "get" && y !== "head" && (q = await h(R, x)) !== 0) {
|
|
1256
1256
|
let U = new n(g, {
|
|
1257
1257
|
method: "POST",
|
|
1258
1258
|
body: x,
|
|
@@ -1261,7 +1261,7 @@ const tu = (e) => {
|
|
|
1261
1261
|
if (z.isFormData(x) && (P = U.headers.get("content-type")) && R.setContentType(P), U.body) {
|
|
1262
1262
|
const [N, L] = rl(
|
|
1263
1263
|
q,
|
|
1264
|
-
Yo(ol(
|
|
1264
|
+
Yo(ol(S))
|
|
1265
1265
|
);
|
|
1266
1266
|
x = il(U.body, al, N, L);
|
|
1267
1267
|
}
|
|
@@ -1279,14 +1279,14 @@ const tu = (e) => {
|
|
|
1279
1279
|
O = s && new n(g, re);
|
|
1280
1280
|
let V = await (s ? $(O, D) : $(g, re));
|
|
1281
1281
|
const W = c && (C === "stream" || C === "response");
|
|
1282
|
-
if (c && (
|
|
1282
|
+
if (c && (v || W && E)) {
|
|
1283
1283
|
const U = {};
|
|
1284
1284
|
["status", "statusText", "headers"].forEach((M) => {
|
|
1285
1285
|
U[M] = V[M];
|
|
1286
1286
|
});
|
|
1287
|
-
const P = z.toFiniteNumber(V.headers.get("content-length")), [N, L] =
|
|
1287
|
+
const P = z.toFiniteNumber(V.headers.get("content-length")), [N, L] = v && rl(
|
|
1288
1288
|
P,
|
|
1289
|
-
Yo(ol(
|
|
1289
|
+
Yo(ol(v), !0)
|
|
1290
1290
|
) || [];
|
|
1291
1291
|
V = new r(
|
|
1292
1292
|
il(V.body, al, N, () => {
|
|
@@ -2042,10 +2042,10 @@ function Rg() {
|
|
|
2042
2042
|
{
|
|
2043
2043
|
for (var A = arguments.length, H = new Array(A > 1 ? A - 1 : 0), Y = 1; Y < A; Y++)
|
|
2044
2044
|
H[Y - 1] = arguments[Y];
|
|
2045
|
-
|
|
2045
|
+
k("error", I, H);
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
|
-
function
|
|
2048
|
+
function k(I, A, H) {
|
|
2049
2049
|
{
|
|
2050
2050
|
var Y = x.ReactDebugCurrentFrame, te = Y.getStackAddendum();
|
|
2051
2051
|
te !== "" && (A += "%s", H = H.concat([te]));
|
|
@@ -2055,10 +2055,10 @@ function Rg() {
|
|
|
2055
2055
|
Se.unshift("Warning: " + A), Function.prototype.apply.call(console[I], console, Se);
|
|
2056
2056
|
}
|
|
2057
2057
|
}
|
|
2058
|
-
var
|
|
2058
|
+
var T = !1, v = !1, S = !1, C = !1, R = !1, _;
|
|
2059
2059
|
_ = Symbol.for("react.module.reference");
|
|
2060
2060
|
function D(I) {
|
|
2061
|
-
return !!(typeof I == "string" || typeof I == "function" || I === r || I === s || R || I === o || I === l || I === c || C || I === h ||
|
|
2061
|
+
return !!(typeof I == "string" || typeof I == "function" || I === r || I === s || R || I === o || I === l || I === c || C || I === h || T || v || S || typeof I == "object" && I !== null && (I.$$typeof === p || I.$$typeof === f || I.$$typeof === i || I.$$typeof === a || I.$$typeof === u || // This needs to include all possible module reference object
|
|
2062
2062
|
// types supported by any Flight configuration anywhere since
|
|
2063
2063
|
// we don't know which Flight build this will end up being used
|
|
2064
2064
|
// with.
|
|
@@ -2875,25 +2875,25 @@ function gr(e) {
|
|
|
2875
2875
|
};
|
|
2876
2876
|
}
|
|
2877
2877
|
function Bg(e, t) {
|
|
2878
|
-
var
|
|
2878
|
+
var S, C;
|
|
2879
2879
|
if (!e) return null;
|
|
2880
|
-
const n = ((
|
|
2880
|
+
const n = ((S = e.values) == null ? void 0 : S.activeAgent) ?? null, r = (C = e.values) == null ? void 0 : C.messages, s = (Array.isArray(r) ? r : []).map((R) => Hg(R, n)).filter((R) => !!R), i = Yn(e.metadata) ?? {}, a = yl(e.config), u = Yn(e.parentConfig), l = yl(u), c = Fr(a, ["checkpointId"]), f = Fr(a, ["checkpointNs"]), p = Fr(l, ["checkpointId"]), h = Yn(e.config), m = Array.isArray(e.tasks) ? e.tasks.map((R) => ({ ...R })) : e.tasks ?? null, g = Array.isArray(e.next) ? [...e.next] : e.next ?? null, y = typeof e.createdAt == "string" && e.createdAt.trim() ? e.createdAt : new Date(Date.now() - t).toISOString(), x = {
|
|
2881
2881
|
...i,
|
|
2882
2882
|
step: Mg(i, ["step"]) ?? 0,
|
|
2883
2883
|
source: Fr(i, ["source"]) ?? null
|
|
2884
2884
|
}, b = s.map((R) => ({
|
|
2885
2885
|
...R,
|
|
2886
2886
|
checkpointId: c ?? null
|
|
2887
|
-
})),
|
|
2887
|
+
})), k = e.values, T = Array.isArray(e.interrupts) ? e.interrupts : Array.isArray(k == null ? void 0 : k.interrupts) ? k.interrupts : [], v = Ug(b);
|
|
2888
2888
|
return {
|
|
2889
2889
|
checkpointId: c ?? null,
|
|
2890
2890
|
checkpointNs: f ?? null,
|
|
2891
2891
|
createdAt: y,
|
|
2892
2892
|
parentId: p ?? null,
|
|
2893
|
-
messages:
|
|
2893
|
+
messages: v,
|
|
2894
2894
|
interrupt: Wg(
|
|
2895
|
-
|
|
2896
|
-
|
|
2895
|
+
v,
|
|
2896
|
+
T,
|
|
2897
2897
|
t,
|
|
2898
2898
|
c ?? null
|
|
2899
2899
|
),
|
|
@@ -2980,14 +2980,14 @@ function Kg(e) {
|
|
|
2980
2980
|
return !!e && typeof e == "object" && "data" in e;
|
|
2981
2981
|
}
|
|
2982
2982
|
function qg(e = {}) {
|
|
2983
|
-
const t = e.baseUrl || "", n = e.streamPath ?? "/stream", [r, o] = ce(e.token ?? null), s = ke(e.headers ?? {}), i = e.credentials ?? "include", [a, u] = ce(!1), [l, c] = ce(null), [f, p] = ce(""), [h, m] = ce(null), [g, y] = ce(0), [x, b] = ce(!1), [
|
|
2983
|
+
const t = e.baseUrl || "", n = e.streamPath ?? "/stream", [r, o] = ce(e.token ?? null), s = ke(e.headers ?? {}), i = e.credentials ?? "include", [a, u] = ce(!1), [l, c] = ce(null), [f, p] = ce(""), [h, m] = ce(null), [g, y] = ce(0), [x, b] = ce(!1), [k, T] = ce({}), [v, S] = ce(null), [C, R] = ce({}), _ = ke(null), D = ke(!0), $ = ke(0), F = ke(null), O = ke(null), E = ke(null), q = ke(null), B = ke({
|
|
2984
2984
|
messageId: null,
|
|
2985
2985
|
lastSeq: null,
|
|
2986
2986
|
lastText: ""
|
|
2987
2987
|
}), re = ie((U) => {
|
|
2988
2988
|
o(U);
|
|
2989
2989
|
}, []), V = ie(() => {
|
|
2990
|
-
p(""), m(null), c(null), O.current = null, E.current = null, q.current = null,
|
|
2990
|
+
p(""), m(null), c(null), O.current = null, E.current = null, q.current = null, T({}), S(null), R({}), B.current = {
|
|
2991
2991
|
messageId: null,
|
|
2992
2992
|
lastSeq: null,
|
|
2993
2993
|
lastText: ""
|
|
@@ -3004,7 +3004,7 @@ function qg(e = {}) {
|
|
|
3004
3004
|
}) : Promise.resolve()).finally(P);
|
|
3005
3005
|
}, []), ee = ie(
|
|
3006
3006
|
(U, P, N) => {
|
|
3007
|
-
_.current && (_.current.abort(), _.current = null), u(!0), c(null), e.autoAppendAssistant !== !1 && p(""), m(null), O.current = null, E.current = null, q.current = null,
|
|
3007
|
+
_.current && (_.current.abort(), _.current = null), u(!0), c(null), e.autoAppendAssistant !== !1 && p(""), m(null), O.current = null, E.current = null, q.current = null, T({}), S(null), R({}), B.current = {
|
|
3008
3008
|
messageId: null,
|
|
3009
3009
|
lastSeq: null,
|
|
3010
3010
|
lastText: ""
|
|
@@ -3193,9 +3193,9 @@ function qg(e = {}) {
|
|
|
3193
3193
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3194
3194
|
content: [{ type: "text", text: xe }]
|
|
3195
3195
|
});
|
|
3196
|
-
|
|
3196
|
+
T((Ke) => ({ ...Ke, [ue]: Te })), S(ue);
|
|
3197
3197
|
} else
|
|
3198
|
-
|
|
3198
|
+
T((me) => {
|
|
3199
3199
|
const Te = me[ue];
|
|
3200
3200
|
return Te ? {
|
|
3201
3201
|
...me,
|
|
@@ -3327,8 +3327,8 @@ function qg(e = {}) {
|
|
|
3327
3327
|
isStreaming: a,
|
|
3328
3328
|
error: l,
|
|
3329
3329
|
assistantText: f,
|
|
3330
|
-
activeMessageId:
|
|
3331
|
-
streamedMessages:
|
|
3330
|
+
activeMessageId: v,
|
|
3331
|
+
streamedMessages: k,
|
|
3332
3332
|
lastCheckpointId: h,
|
|
3333
3333
|
lastSeq: g,
|
|
3334
3334
|
connected: x,
|
|
@@ -3392,11 +3392,11 @@ function Xg({
|
|
|
3392
3392
|
onThreadChange: r,
|
|
3393
3393
|
onCurrentThreadDeleted: o
|
|
3394
3394
|
}) {
|
|
3395
|
-
const [s, i] = ce([]), [a, u] = ce(t), [l, c] = ce(!1), [f, p] = ce(null), [h, m] = ce([]), [g, y] = ce(!1), [, x] = ce(null), [b,
|
|
3395
|
+
const [s, i] = ce([]), [a, u] = ce(t), [l, c] = ce(!1), [f, p] = ce(null), [h, m] = ce([]), [g, y] = ce(!1), [, x] = ce(null), [b, k] = ce(null), [T, v] = ce(!1), S = ke(a), C = ke(/* @__PURE__ */ new Map());
|
|
3396
3396
|
ze(() => {
|
|
3397
|
-
|
|
3397
|
+
S.current = a;
|
|
3398
3398
|
}, [a]), ze(() => {
|
|
3399
|
-
t !== void 0 && t !==
|
|
3399
|
+
t !== void 0 && t !== S.current && u(t);
|
|
3400
3400
|
}, [t]);
|
|
3401
3401
|
const R = ie(async () => {
|
|
3402
3402
|
c(!0), p(null);
|
|
@@ -3446,7 +3446,7 @@ function Xg({
|
|
|
3446
3446
|
const ee = new AbortController();
|
|
3447
3447
|
C.current.set(V, ee);
|
|
3448
3448
|
try {
|
|
3449
|
-
await e.deleteThread(V),
|
|
3449
|
+
await e.deleteThread(V), S.current === V && (u(null), o == null || o());
|
|
3450
3450
|
} catch (U) {
|
|
3451
3451
|
i(W);
|
|
3452
3452
|
const P = String(U);
|
|
@@ -3467,14 +3467,14 @@ function Xg({
|
|
|
3467
3467
|
[e, n, R]
|
|
3468
3468
|
), O = ie(
|
|
3469
3469
|
async (V, W) => {
|
|
3470
|
-
|
|
3470
|
+
v(!0), k("Sharing thread…");
|
|
3471
3471
|
try {
|
|
3472
|
-
await e.shareThread(V, W), await _(),
|
|
3472
|
+
await e.shareThread(V, W), await _(), k("Shared successfully");
|
|
3473
3473
|
} catch (ee) {
|
|
3474
3474
|
const U = Yg(ee);
|
|
3475
|
-
throw n == null || n(U),
|
|
3475
|
+
throw n == null || n(U), k(`Failed to share: ${U}`), new Error(U);
|
|
3476
3476
|
} finally {
|
|
3477
|
-
|
|
3477
|
+
v(!1);
|
|
3478
3478
|
}
|
|
3479
3479
|
},
|
|
3480
3480
|
[e, n, _]
|
|
@@ -3488,7 +3488,7 @@ function Xg({
|
|
|
3488
3488
|
}
|
|
3489
3489
|
},
|
|
3490
3490
|
[e, n, _]
|
|
3491
|
-
), q =
|
|
3491
|
+
), q = Oe(
|
|
3492
3492
|
() => ({
|
|
3493
3493
|
createThread: D,
|
|
3494
3494
|
deleteThread: $,
|
|
@@ -3520,11 +3520,11 @@ function Xg({
|
|
|
3520
3520
|
}) : N);
|
|
3521
3521
|
return U ? P : (console.debug("[useThreadsState] thread_info: adding thread to list", W.threadId), [W, ...ee]);
|
|
3522
3522
|
});
|
|
3523
|
-
}, []), re = ie(() =>
|
|
3523
|
+
}, []), re = ie(() => k(null), []);
|
|
3524
3524
|
return {
|
|
3525
3525
|
threads: s,
|
|
3526
3526
|
currentThreadId: a,
|
|
3527
|
-
currentThreadIdRef:
|
|
3527
|
+
currentThreadIdRef: S,
|
|
3528
3528
|
setCurrentThreadId: u,
|
|
3529
3529
|
isLoadingThreads: l,
|
|
3530
3530
|
threadsError: f,
|
|
@@ -3532,7 +3532,7 @@ function Xg({
|
|
|
3532
3532
|
isLoadingSharedThreads: g,
|
|
3533
3533
|
actions: q,
|
|
3534
3534
|
addThreadFromEvent: B,
|
|
3535
|
-
shareInFlight:
|
|
3535
|
+
shareInFlight: T,
|
|
3536
3536
|
shareStatus: b,
|
|
3537
3537
|
clearShareStatus: re
|
|
3538
3538
|
};
|
|
@@ -3563,7 +3563,7 @@ function Jg({
|
|
|
3563
3563
|
initialThreadId: t,
|
|
3564
3564
|
onError: n,
|
|
3565
3565
|
onThreadChange: r
|
|
3566
|
-
}), b =
|
|
3566
|
+
}), b = Oe(
|
|
3567
3567
|
() => ({
|
|
3568
3568
|
threads: s,
|
|
3569
3569
|
currentThreadId: i,
|
|
@@ -4014,7 +4014,7 @@ function Sx(e = []) {
|
|
|
4014
4014
|
ze(() => () => {
|
|
4015
4015
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
|
|
4016
4016
|
}, []);
|
|
4017
|
-
const l =
|
|
4017
|
+
const l = Oe(() => ({
|
|
4018
4018
|
reset: (c) => n({ type: "reset", payload: { messages: c } }),
|
|
4019
4019
|
seed: (c, f) => n({ type: "seed", payload: { messages: c, ...f ?? {} } }),
|
|
4020
4020
|
prepend: (c) => n({ type: "prepend", payload: { messages: c } }),
|
|
@@ -4284,22 +4284,22 @@ function jx(e) {
|
|
|
4284
4284
|
const c = e[l], f = c.checkpointId, p = f ?? `cp-${l}`, h = c.metadata ?? {}, m = typeof h.step == "number" ? h.step : null, g = typeof h.source == "string" ? h.source : null;
|
|
4285
4285
|
let y = null, x = null;
|
|
4286
4286
|
const b = Array.isArray(c.messages) ? c.messages : [];
|
|
4287
|
-
for (const
|
|
4288
|
-
|
|
4289
|
-
const
|
|
4287
|
+
for (const S of b)
|
|
4288
|
+
S.role === "user" && (x || (x = S), S.id && (y = S.id));
|
|
4289
|
+
const k = c.next && c.next.length > 0 ? String(c.next[0]) : null, T = c.parentConfig ?? null, v = {
|
|
4290
4290
|
id: p,
|
|
4291
4291
|
step: m,
|
|
4292
4292
|
source: g,
|
|
4293
4293
|
createdAt: c.createdAt ?? null,
|
|
4294
4294
|
namespace: c.checkpointNs ?? null,
|
|
4295
4295
|
parentId: c.parentId ?? null,
|
|
4296
|
-
next:
|
|
4297
|
-
parentConfig:
|
|
4296
|
+
next: k,
|
|
4297
|
+
parentConfig: T,
|
|
4298
4298
|
userMessageId: y
|
|
4299
4299
|
};
|
|
4300
|
-
if (o.push(
|
|
4301
|
-
const
|
|
4302
|
-
|
|
4300
|
+
if (o.push(v), f && t.set(f, v), f && x) {
|
|
4301
|
+
const S = Nx(x);
|
|
4302
|
+
S && r.set(f, S);
|
|
4303
4303
|
}
|
|
4304
4304
|
n.push({
|
|
4305
4305
|
id: p,
|
|
@@ -4307,8 +4307,8 @@ function jx(e) {
|
|
|
4307
4307
|
step: m,
|
|
4308
4308
|
source: g,
|
|
4309
4309
|
createdAt: c.createdAt ?? null,
|
|
4310
|
-
next:
|
|
4311
|
-
parentConfig:
|
|
4310
|
+
next: k,
|
|
4311
|
+
parentConfig: T
|
|
4312
4312
|
});
|
|
4313
4313
|
}
|
|
4314
4314
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -4369,7 +4369,7 @@ function _x(e, t, n) {
|
|
|
4369
4369
|
};
|
|
4370
4370
|
}
|
|
4371
4371
|
function Px(e) {
|
|
4372
|
-
return
|
|
4372
|
+
return Oe(() => jx(e), [e]);
|
|
4373
4373
|
}
|
|
4374
4374
|
function Mx({
|
|
4375
4375
|
api: e,
|
|
@@ -4383,12 +4383,12 @@ function Mx({
|
|
|
4383
4383
|
isStreaming: u,
|
|
4384
4384
|
getMessages: l
|
|
4385
4385
|
}) {
|
|
4386
|
-
const [c, f] = ce(null), h =
|
|
4386
|
+
const [c, f] = ce(null), h = Oe(
|
|
4387
4387
|
() => gr(c),
|
|
4388
4388
|
[c]
|
|
4389
|
-
).checkpoints, m = Px(h), g = m.timeline, [y, x] = ce(!1), [b,
|
|
4389
|
+
).checkpoints, m = Px(h), g = m.timeline, [y, x] = ce(!1), [b, k] = ce(!1), [T, v] = ce(null), S = ke(r), C = ke(null), R = ke(null), _ = ke(null), D = ke(null), $ = ke(null), F = ke(/* @__PURE__ */ new Map()), O = ke(null);
|
|
4390
4390
|
ze(() => {
|
|
4391
|
-
|
|
4391
|
+
S.current = r;
|
|
4392
4392
|
}, [r]);
|
|
4393
4393
|
const E = ie(
|
|
4394
4394
|
async (L) => {
|
|
@@ -4399,7 +4399,7 @@ function Mx({
|
|
|
4399
4399
|
try {
|
|
4400
4400
|
await L.action(M);
|
|
4401
4401
|
} catch (j) {
|
|
4402
|
-
if (!hl(j) &&
|
|
4402
|
+
if (!hl(j) && S.current === M) {
|
|
4403
4403
|
const X = String(j);
|
|
4404
4404
|
(Z = L.handleError) == null || Z.call(L, X), n == null || n(X);
|
|
4405
4405
|
}
|
|
@@ -4422,17 +4422,17 @@ function Mx({
|
|
|
4422
4422
|
const K = E({
|
|
4423
4423
|
threadId: L,
|
|
4424
4424
|
setLoading: x,
|
|
4425
|
-
onStart: () =>
|
|
4426
|
-
handleError: (oe) =>
|
|
4425
|
+
onStart: () => v(null),
|
|
4426
|
+
handleError: (oe) => v(oe),
|
|
4427
4427
|
action: async (oe) => {
|
|
4428
4428
|
const he = await e.getStateHistory({
|
|
4429
4429
|
threadId: oe,
|
|
4430
4430
|
checkpointId: M ?? void 0,
|
|
4431
4431
|
signal: j.signal
|
|
4432
4432
|
});
|
|
4433
|
-
if (
|
|
4433
|
+
if (S.current !== oe) {
|
|
4434
4434
|
console.log(
|
|
4435
|
-
`[useThreadHistoryState] Thread changed during load (was ${oe}, now ${
|
|
4435
|
+
`[useThreadHistoryState] Thread changed during load (was ${oe}, now ${S.current}), discarding stale data`
|
|
4436
4436
|
);
|
|
4437
4437
|
return;
|
|
4438
4438
|
}
|
|
@@ -4450,7 +4450,7 @@ function Mx({
|
|
|
4450
4450
|
} finally {
|
|
4451
4451
|
F.current.delete(G), O.current === j && (O.current = null);
|
|
4452
4452
|
}
|
|
4453
|
-
return
|
|
4453
|
+
return S.current === L && ($.current = G), K;
|
|
4454
4454
|
},
|
|
4455
4455
|
[e, t, E]
|
|
4456
4456
|
), B = ie(
|
|
@@ -4472,8 +4472,8 @@ function Mx({
|
|
|
4472
4472
|
_.current = L;
|
|
4473
4473
|
}, []), W = ie(
|
|
4474
4474
|
(L) => {
|
|
4475
|
-
const M = L.threadId ??
|
|
4476
|
-
if (!M ||
|
|
4475
|
+
const M = L.threadId ?? S.current;
|
|
4476
|
+
if (!M || S.current && S.current !== M)
|
|
4477
4477
|
return;
|
|
4478
4478
|
const { checkpoints: G, latest: Z } = gr(L);
|
|
4479
4479
|
if (!G.length)
|
|
@@ -4488,17 +4488,17 @@ function Mx({
|
|
|
4488
4488
|
[t, u]
|
|
4489
4489
|
), ee = ie(
|
|
4490
4490
|
async (L, M) => {
|
|
4491
|
-
const G =
|
|
4491
|
+
const G = S.current;
|
|
4492
4492
|
await E({
|
|
4493
4493
|
threadId: G,
|
|
4494
|
-
setLoading:
|
|
4494
|
+
setLoading: k,
|
|
4495
4495
|
action: async (Z) => {
|
|
4496
4496
|
const j = await e.getStateHistory({
|
|
4497
4497
|
threadId: Z,
|
|
4498
4498
|
checkpointId: L,
|
|
4499
4499
|
checkpointNs: M ?? void 0
|
|
4500
4500
|
});
|
|
4501
|
-
if (
|
|
4501
|
+
if (S.current !== Z)
|
|
4502
4502
|
return;
|
|
4503
4503
|
const { checkpoints: K } = gr(j), X = K.find(
|
|
4504
4504
|
(oe) => oe.checkpointId === L && (M ? oe.checkpointNs === M : !0)
|
|
@@ -4525,7 +4525,7 @@ function Mx({
|
|
|
4525
4525
|
},
|
|
4526
4526
|
[l, t]
|
|
4527
4527
|
), P = ie(async () => {
|
|
4528
|
-
|
|
4528
|
+
S.current && await B(S.current);
|
|
4529
4529
|
}, [B]);
|
|
4530
4530
|
ze(() => {
|
|
4531
4531
|
if (!a || !r || y || u)
|
|
@@ -4559,7 +4559,7 @@ function Mx({
|
|
|
4559
4559
|
B
|
|
4560
4560
|
]);
|
|
4561
4561
|
const N = ie(() => {
|
|
4562
|
-
f(null), x(!1),
|
|
4562
|
+
f(null), x(!1), k(!1), v(null), R.current = null, _.current = null, C.current = null, $.current = null, D.current = null;
|
|
4563
4563
|
}, []);
|
|
4564
4564
|
return {
|
|
4565
4565
|
threadCheckpoints: h,
|
|
@@ -4567,7 +4567,7 @@ function Mx({
|
|
|
4567
4567
|
checkpointIndex: m,
|
|
4568
4568
|
isLoadingThread: y,
|
|
4569
4569
|
isLoadingCheckpoint: b,
|
|
4570
|
-
threadStateError:
|
|
4570
|
+
threadStateError: T,
|
|
4571
4571
|
loadThread: B,
|
|
4572
4572
|
navigateToCheckpoint: ee,
|
|
4573
4573
|
setCurrentCheckpointId: U,
|
|
@@ -4607,10 +4607,10 @@ function Dx({
|
|
|
4607
4607
|
isLoadingThread: y,
|
|
4608
4608
|
isLoadingCheckpoint: x,
|
|
4609
4609
|
threadStateError: b,
|
|
4610
|
-
loadThread:
|
|
4611
|
-
navigateToCheckpoint:
|
|
4612
|
-
setCurrentCheckpointId:
|
|
4613
|
-
returnToLatest:
|
|
4610
|
+
loadThread: k,
|
|
4611
|
+
navigateToCheckpoint: T,
|
|
4612
|
+
setCurrentCheckpointId: v,
|
|
4613
|
+
returnToLatest: S,
|
|
4614
4614
|
handleStateHistoryEvent: C,
|
|
4615
4615
|
markSkipNextLoad: R,
|
|
4616
4616
|
markStreamPendingThread: _,
|
|
@@ -4640,7 +4640,7 @@ function Dx({
|
|
|
4640
4640
|
O.current = U;
|
|
4641
4641
|
},
|
|
4642
4642
|
[]
|
|
4643
|
-
), q =
|
|
4643
|
+
), q = Oe(() => ({ assemblingMessageId: l.assemblingId ?? null }), [l.assemblingId]), B = ie(
|
|
4644
4644
|
(U, P) => {
|
|
4645
4645
|
const N = du(U, "user");
|
|
4646
4646
|
return p({
|
|
@@ -4654,7 +4654,7 @@ function Dx({
|
|
|
4654
4654
|
[p]
|
|
4655
4655
|
), re = ie(async () => {
|
|
4656
4656
|
$.current ? await $.current() : (c([], {}), D());
|
|
4657
|
-
}, [c, D]), V =
|
|
4657
|
+
}, [c, D]), V = Oe(() => ax(l.messages), [l.messages]), W = Oe(
|
|
4658
4658
|
() => ({
|
|
4659
4659
|
threadId: u,
|
|
4660
4660
|
messages: l.messages,
|
|
@@ -4682,11 +4682,11 @@ function Dx({
|
|
|
4682
4682
|
});
|
|
4683
4683
|
},
|
|
4684
4684
|
clearState: re,
|
|
4685
|
-
navigateToCheckpoint:
|
|
4686
|
-
setCurrentCheckpointId:
|
|
4687
|
-
returnToLatest:
|
|
4685
|
+
navigateToCheckpoint: T,
|
|
4686
|
+
setCurrentCheckpointId: v,
|
|
4687
|
+
returnToLatest: S,
|
|
4688
4688
|
loadThread: async (U, P, N) => {
|
|
4689
|
-
await
|
|
4689
|
+
await k(U, P, { clearProgress: !1 });
|
|
4690
4690
|
},
|
|
4691
4691
|
clearThread: re,
|
|
4692
4692
|
respondToInterrupt: async (U, P, N) => {
|
|
@@ -4717,10 +4717,10 @@ function Dx({
|
|
|
4717
4717
|
b,
|
|
4718
4718
|
c,
|
|
4719
4719
|
re,
|
|
4720
|
-
k,
|
|
4721
|
-
S,
|
|
4722
|
-
v,
|
|
4723
4720
|
T,
|
|
4721
|
+
v,
|
|
4722
|
+
S,
|
|
4723
|
+
k,
|
|
4724
4724
|
C,
|
|
4725
4725
|
R,
|
|
4726
4726
|
_,
|
|
@@ -4728,7 +4728,7 @@ function Dx({
|
|
|
4728
4728
|
f,
|
|
4729
4729
|
V
|
|
4730
4730
|
]
|
|
4731
|
-
), ee =
|
|
4731
|
+
), ee = Oe(
|
|
4732
4732
|
() => ({
|
|
4733
4733
|
registerClearThread: F,
|
|
4734
4734
|
registerRespondToInterrupt: E
|
|
@@ -4794,10 +4794,10 @@ function Bx({
|
|
|
4794
4794
|
onMetadataEvent: p,
|
|
4795
4795
|
onFinish: h
|
|
4796
4796
|
}) {
|
|
4797
|
-
const { chatApi: m, baseUrl: g } = lo(), y = g, { stream: x, stop: b, clear:
|
|
4797
|
+
const { chatApi: m, baseUrl: g } = lo(), y = g, { stream: x, stop: b, clear: k, isStreaming: T, error: v, connected: S, streamedMessages: C, activeMessageId: R } = qg({ baseUrl: y }), [_, D] = ce(!1);
|
|
4798
4798
|
return ze(() => {
|
|
4799
|
-
D(
|
|
4800
|
-
}, [
|
|
4799
|
+
D(T);
|
|
4800
|
+
}, [T]), /* @__PURE__ */ d.jsx(
|
|
4801
4801
|
Jg,
|
|
4802
4802
|
{
|
|
4803
4803
|
initialThreadId: t,
|
|
@@ -4816,7 +4816,7 @@ function Bx({
|
|
|
4816
4816
|
Ux,
|
|
4817
4817
|
{
|
|
4818
4818
|
api: m,
|
|
4819
|
-
streamApi: { stream: x, stop: b, clear:
|
|
4819
|
+
streamApi: { stream: x, stop: b, clear: k, isStreaming: T, error: v, connected: S, streamedMessages: C, activeMessageId: R },
|
|
4820
4820
|
onError: s,
|
|
4821
4821
|
onAuthError: i,
|
|
4822
4822
|
onConnectionError: u,
|
|
@@ -4846,10 +4846,10 @@ function Ux({
|
|
|
4846
4846
|
onMetadataEvent: l,
|
|
4847
4847
|
onFinish: c
|
|
4848
4848
|
}) {
|
|
4849
|
-
const { stream: f, stop: p, clear: h, isStreaming: m, error: g, connected: y, streamedMessages: x, activeMessageId: b } = n, { setCurrentThreadId:
|
|
4849
|
+
const { stream: f, stop: p, clear: h, isStreaming: m, error: g, connected: y, streamedMessages: x, activeMessageId: b } = n, { setCurrentThreadId: k, currentThreadIdRef: T, addThreadFromEvent: v, currentThreadId: S } = ys();
|
|
4850
4850
|
ze(() => {
|
|
4851
|
-
|
|
4852
|
-
}, [
|
|
4851
|
+
S !== void 0 && h();
|
|
4852
|
+
}, [S, h]);
|
|
4853
4853
|
const {
|
|
4854
4854
|
interrupt: C,
|
|
4855
4855
|
checkpoint: R,
|
|
@@ -4863,9 +4863,9 @@ function Ux({
|
|
|
4863
4863
|
messages: B
|
|
4864
4864
|
} = bs(), { registerClearThread: re, registerRespondToInterrupt: V } = Ox(), W = ie(
|
|
4865
4865
|
(j) => {
|
|
4866
|
-
|
|
4866
|
+
v(j), T.current !== j.threadId && ((j.created ?? !T.current) && $(j.threadId), F(j.threadId), k(j.threadId));
|
|
4867
4867
|
},
|
|
4868
|
-
[
|
|
4868
|
+
[v, $, F, k, T]
|
|
4869
4869
|
), ee = ie(
|
|
4870
4870
|
(j) => {
|
|
4871
4871
|
j.type === "thread_info" ? W(j) : j.type === "state_history" ? D(j) : j.type === "tool.end" ? (q(j), i == null || i(j)) : q(j);
|
|
@@ -4898,7 +4898,7 @@ function Ux({
|
|
|
4898
4898
|
}, [R]);
|
|
4899
4899
|
const N = ie(
|
|
4900
4900
|
async (j, K, X) => {
|
|
4901
|
-
const oe =
|
|
4901
|
+
const oe = T.current;
|
|
4902
4902
|
if (!oe)
|
|
4903
4903
|
throw new Error("No active thread to handle interrupt");
|
|
4904
4904
|
const he = j ? K ?? !0 : !1, ve = P.current, _e = {
|
|
@@ -4910,28 +4910,28 @@ function Ux({
|
|
|
4910
4910
|
};
|
|
4911
4911
|
U(_e);
|
|
4912
4912
|
},
|
|
4913
|
-
[
|
|
4913
|
+
[T, U]
|
|
4914
4914
|
);
|
|
4915
4915
|
ze(() => {
|
|
4916
4916
|
V(N);
|
|
4917
4917
|
}, [N, V]);
|
|
4918
4918
|
const L = ie(async () => {
|
|
4919
|
-
p(), h(), O(),
|
|
4920
|
-
}, [h, O,
|
|
4919
|
+
p(), h(), O(), k(null);
|
|
4920
|
+
}, [h, O, k, p]);
|
|
4921
4921
|
ze(() => {
|
|
4922
4922
|
re(L);
|
|
4923
4923
|
}, [L, re]);
|
|
4924
4924
|
const M = ie(
|
|
4925
4925
|
async (j, K) => {
|
|
4926
4926
|
m && p();
|
|
4927
|
-
let X =
|
|
4927
|
+
let X = T.current;
|
|
4928
4928
|
const oe = (j == null ? void 0 : j.text) ?? "", he = (j == null ? void 0 : j.attachments) ?? [], ve = (oe == null ? void 0 : oe.trim()) ?? "", _e = { ...(j == null ? void 0 : j.payload) ?? {} }, Ae = Array.isArray(_e.messages) ? _e.messages : void 0;
|
|
4929
4929
|
Ae && delete _e.messages;
|
|
4930
4930
|
const We = !!(Ae && Ae.length), Qe = !!(j.contentParts && j.contentParts.length > 0);
|
|
4931
4931
|
if (!X && !ve && he.length === 0 && !We && !Qe) return;
|
|
4932
4932
|
if (!X) {
|
|
4933
4933
|
const Le = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), bt = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")).join("").slice(0, 16);
|
|
4934
|
-
X = `${Le}${bt}`, $(X),
|
|
4934
|
+
X = `${Le}${bt}`, $(X), k(X);
|
|
4935
4935
|
}
|
|
4936
4936
|
let Ye = null;
|
|
4937
4937
|
j.contentParts && j.contentParts.length > 0 && (Ye = j.contentParts);
|
|
@@ -4968,8 +4968,8 @@ function Ux({
|
|
|
4968
4968
|
};
|
|
4969
4969
|
U(wt, K == null ? void 0 : K.onEvent);
|
|
4970
4970
|
},
|
|
4971
|
-
[R,
|
|
4972
|
-
), G =
|
|
4971
|
+
[R, T, m, $, E, U, p, _]
|
|
4972
|
+
), G = Oe(() => {
|
|
4973
4973
|
if (!m || !b)
|
|
4974
4974
|
return B;
|
|
4975
4975
|
const j = x == null ? void 0 : x[b];
|
|
@@ -4980,7 +4980,7 @@ function Ux({
|
|
|
4980
4980
|
return [...B, j];
|
|
4981
4981
|
const X = [...B];
|
|
4982
4982
|
return X[K] = j, X;
|
|
4983
|
-
}, [b, m, x, B]), Z =
|
|
4983
|
+
}, [b, m, x, B]), Z = Oe(
|
|
4984
4984
|
() => ({
|
|
4985
4985
|
isStreaming: m,
|
|
4986
4986
|
error: g,
|
|
@@ -5053,7 +5053,7 @@ function Lo({
|
|
|
5053
5053
|
onMetadataEvent: h,
|
|
5054
5054
|
onFinish: m
|
|
5055
5055
|
}) {
|
|
5056
|
-
const g = Wx(t), y = wn(a), x = wn(u), b = wn(i),
|
|
5056
|
+
const g = Wx(t), y = wn(a), x = wn(u), b = wn(i), k = wn(l), T = wn(c), v = wn(f), S = wn(p), C = wn(h), R = wn(m), _ = Oe(
|
|
5057
5057
|
() => ({
|
|
5058
5058
|
initialThreadId: n,
|
|
5059
5059
|
initialCheckpointId: r,
|
|
@@ -5062,10 +5062,10 @@ function Lo({
|
|
|
5062
5062
|
onError: y,
|
|
5063
5063
|
onAuthError: x,
|
|
5064
5064
|
onConnectionError: b,
|
|
5065
|
-
onThreadChange:
|
|
5066
|
-
onToolEnd:
|
|
5067
|
-
onUpdateEvent:
|
|
5068
|
-
onCustomEvent:
|
|
5065
|
+
onThreadChange: k,
|
|
5066
|
+
onToolEnd: T,
|
|
5067
|
+
onUpdateEvent: v,
|
|
5068
|
+
onCustomEvent: S,
|
|
5069
5069
|
onMetadataEvent: C,
|
|
5070
5070
|
onFinish: R
|
|
5071
5071
|
}),
|
|
@@ -5414,7 +5414,7 @@ function Pe() {
|
|
|
5414
5414
|
function Dt(e) {
|
|
5415
5415
|
return Ss(Pe(), (t) => fe(e, t));
|
|
5416
5416
|
}
|
|
5417
|
-
function
|
|
5417
|
+
function Me(e, t = [], { singleton: n } = { singleton: !0 }) {
|
|
5418
5418
|
return {
|
|
5419
5419
|
constructor: e,
|
|
5420
5420
|
dependencies: t,
|
|
@@ -5471,7 +5471,7 @@ const sy = {
|
|
|
5471
5471
|
3: "error",
|
|
5472
5472
|
1: "log",
|
|
5473
5473
|
2: "warn"
|
|
5474
|
-
}, iy = () => typeof globalThis > "u" ? window : globalThis, On =
|
|
5474
|
+
}, iy = () => typeof globalThis > "u" ? window : globalThis, On = Me(
|
|
5475
5475
|
() => {
|
|
5476
5476
|
const e = ne(
|
|
5477
5477
|
3
|
|
@@ -5599,7 +5599,7 @@ function Pu(e, t, n) {
|
|
|
5599
5599
|
}
|
|
5600
5600
|
}, [a, t, i]), s;
|
|
5601
5601
|
}
|
|
5602
|
-
const St =
|
|
5602
|
+
const St = Me(
|
|
5603
5603
|
() => {
|
|
5604
5604
|
const e = Pe(), t = Pe(), n = ne(0), r = Pe(), o = ne(0), s = Pe(), i = Pe(), a = ne(0), u = ne(0), l = ne(0), c = ne(0), f = Pe(), p = Pe(), h = ne(!1), m = ne(!1), g = ne(!1);
|
|
5605
5605
|
return fe(
|
|
@@ -5780,7 +5780,7 @@ function Fu(e, t) {
|
|
|
5780
5780
|
function Yr(e, t) {
|
|
5781
5781
|
return !!(e && e[0] === t[0] && e[1] === t[1]);
|
|
5782
5782
|
}
|
|
5783
|
-
const ea =
|
|
5783
|
+
const ea = Me(
|
|
5784
5784
|
() => ({ recalcInProgress: ne(!1) }),
|
|
5785
5785
|
[],
|
|
5786
5786
|
{ singleton: !0 }
|
|
@@ -5947,33 +5947,33 @@ function wy(e) {
|
|
|
5947
5947
|
const by = {
|
|
5948
5948
|
offsetHeight: "height",
|
|
5949
5949
|
offsetWidth: "width"
|
|
5950
|
-
}, fn =
|
|
5950
|
+
}, fn = Me(
|
|
5951
5951
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
5952
|
-
const n = Pe(), r = Pe(), o = yt(r, 0), s = Pe(), i = Pe(), a = ne(0), u = ne([]), l = ne(void 0), c = ne(void 0), f = ne((
|
|
5952
|
+
const n = Pe(), r = Pe(), o = yt(r, 0), s = Pe(), i = Pe(), a = ne(0), u = ne([]), l = ne(void 0), c = ne(void 0), f = ne((v, S) => Rn(v, by[S])), p = ne(void 0), h = ne(0), m = dy(), g = yt(
|
|
5953
5953
|
J(n, Ee(u, e, h), an(gy, m), Ue()),
|
|
5954
5954
|
m
|
|
5955
5955
|
), y = yt(
|
|
5956
5956
|
J(
|
|
5957
5957
|
u,
|
|
5958
5958
|
Ue(),
|
|
5959
|
-
an((
|
|
5959
|
+
an((v, S) => ({ current: S, prev: v.current }), {
|
|
5960
5960
|
current: [],
|
|
5961
5961
|
prev: []
|
|
5962
5962
|
}),
|
|
5963
|
-
se(({ prev:
|
|
5963
|
+
se(({ prev: v }) => v)
|
|
5964
5964
|
),
|
|
5965
5965
|
[]
|
|
5966
5966
|
);
|
|
5967
5967
|
fe(
|
|
5968
5968
|
J(
|
|
5969
5969
|
u,
|
|
5970
|
-
we((
|
|
5970
|
+
we((v) => v.length > 0),
|
|
5971
5971
|
Ee(g, h),
|
|
5972
|
-
se(([
|
|
5973
|
-
const R =
|
|
5972
|
+
se(([v, S, C]) => {
|
|
5973
|
+
const R = v.reduce((_, D, $) => Ot(_, D, Xr(D, S.offsetTree, C) || $), yr());
|
|
5974
5974
|
return {
|
|
5975
|
-
...
|
|
5976
|
-
groupIndices:
|
|
5975
|
+
...S,
|
|
5976
|
+
groupIndices: v,
|
|
5977
5977
|
groupOffsetTree: R
|
|
5978
5978
|
};
|
|
5979
5979
|
})
|
|
@@ -5983,12 +5983,12 @@ const by = {
|
|
|
5983
5983
|
J(
|
|
5984
5984
|
r,
|
|
5985
5985
|
Ee(g),
|
|
5986
|
-
we(([
|
|
5987
|
-
se(([
|
|
5986
|
+
we(([v, { lastIndex: S }]) => v < S),
|
|
5987
|
+
se(([v, { lastIndex: S, lastSize: C }]) => [
|
|
5988
5988
|
{
|
|
5989
|
-
endIndex:
|
|
5989
|
+
endIndex: S,
|
|
5990
5990
|
size: C,
|
|
5991
|
-
startIndex:
|
|
5991
|
+
startIndex: v
|
|
5992
5992
|
}
|
|
5993
5993
|
])
|
|
5994
5994
|
),
|
|
@@ -5997,15 +5997,15 @@ const by = {
|
|
|
5997
5997
|
const x = yt(
|
|
5998
5998
|
J(
|
|
5999
5999
|
l,
|
|
6000
|
-
se((
|
|
6000
|
+
se((v) => v === void 0)
|
|
6001
6001
|
),
|
|
6002
6002
|
!0
|
|
6003
6003
|
);
|
|
6004
6004
|
fe(
|
|
6005
6005
|
J(
|
|
6006
6006
|
c,
|
|
6007
|
-
we((
|
|
6008
|
-
se((
|
|
6007
|
+
we((v) => v !== void 0 && $e(ot(g).sizeTree)),
|
|
6008
|
+
se((v) => [{ endIndex: 0, size: v, startIndex: 0 }])
|
|
6009
6009
|
),
|
|
6010
6010
|
n
|
|
6011
6011
|
);
|
|
@@ -6014,52 +6014,52 @@ const by = {
|
|
|
6014
6014
|
n,
|
|
6015
6015
|
Ee(g),
|
|
6016
6016
|
an(
|
|
6017
|
-
({ sizes:
|
|
6018
|
-
changed: C !==
|
|
6017
|
+
({ sizes: v }, [S, C]) => ({
|
|
6018
|
+
changed: C !== v,
|
|
6019
6019
|
sizes: C
|
|
6020
6020
|
}),
|
|
6021
6021
|
{ changed: !1, sizes: m }
|
|
6022
6022
|
),
|
|
6023
|
-
se((
|
|
6023
|
+
se((v) => v.changed)
|
|
6024
6024
|
)
|
|
6025
6025
|
);
|
|
6026
6026
|
De(
|
|
6027
6027
|
J(
|
|
6028
6028
|
a,
|
|
6029
6029
|
an(
|
|
6030
|
-
(
|
|
6030
|
+
(v, S) => ({ diff: v.prev - S, prev: S }),
|
|
6031
6031
|
{ diff: 0, prev: 0 }
|
|
6032
6032
|
),
|
|
6033
|
-
se((
|
|
6033
|
+
se((v) => v.diff)
|
|
6034
6034
|
),
|
|
6035
|
-
(
|
|
6036
|
-
const { groupIndices:
|
|
6037
|
-
if (
|
|
6038
|
-
Re(t, !0), Re(s,
|
|
6039
|
-
else if (
|
|
6035
|
+
(v) => {
|
|
6036
|
+
const { groupIndices: S } = ot(g);
|
|
6037
|
+
if (v > 0)
|
|
6038
|
+
Re(t, !0), Re(s, v + jl(v, S));
|
|
6039
|
+
else if (v < 0) {
|
|
6040
6040
|
const C = ot(y);
|
|
6041
|
-
C.length > 0 && (
|
|
6041
|
+
C.length > 0 && (v -= jl(-v, C)), Re(i, v);
|
|
6042
6042
|
}
|
|
6043
6043
|
}
|
|
6044
|
-
), De(J(a, Ee(e)), ([
|
|
6045
|
-
|
|
6044
|
+
), De(J(a, Ee(e)), ([v, S]) => {
|
|
6045
|
+
v < 0 && S(
|
|
6046
6046
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
6047
6047
|
{ firstItemIndex: a },
|
|
6048
6048
|
Nt.ERROR
|
|
6049
6049
|
);
|
|
6050
6050
|
});
|
|
6051
|
-
const
|
|
6051
|
+
const k = Dt(s);
|
|
6052
6052
|
fe(
|
|
6053
6053
|
J(
|
|
6054
6054
|
s,
|
|
6055
6055
|
Ee(g),
|
|
6056
|
-
se(([
|
|
6057
|
-
const C =
|
|
6056
|
+
se(([v, S]) => {
|
|
6057
|
+
const C = S.groupIndices.length > 0, R = [], _ = S.lastSize;
|
|
6058
6058
|
if (C) {
|
|
6059
|
-
const D = Gr(
|
|
6059
|
+
const D = Gr(S.sizeTree, 0);
|
|
6060
6060
|
let $ = 0, F = 0;
|
|
6061
|
-
for (; $ <
|
|
6062
|
-
const E =
|
|
6061
|
+
for (; $ < v; ) {
|
|
6062
|
+
const E = S.groupIndices[F], q = S.groupIndices.length === F + 1 ? 1 / 0 : S.groupIndices[F + 1] - E - 1;
|
|
6063
6063
|
R.push({
|
|
6064
6064
|
endIndex: E,
|
|
6065
6065
|
size: D,
|
|
@@ -6070,35 +6070,35 @@ const by = {
|
|
|
6070
6070
|
startIndex: E + 1
|
|
6071
6071
|
}), F++, $ += q + 1;
|
|
6072
6072
|
}
|
|
6073
|
-
const O = Wn(
|
|
6074
|
-
return $ !==
|
|
6073
|
+
const O = Wn(S.sizeTree);
|
|
6074
|
+
return $ !== v && O.shift(), O.reduce(
|
|
6075
6075
|
(E, { k: q, v: B }) => {
|
|
6076
6076
|
let re = E.ranges;
|
|
6077
6077
|
return E.prevSize !== 0 && (re = [
|
|
6078
6078
|
...E.ranges,
|
|
6079
6079
|
{
|
|
6080
|
-
endIndex: q +
|
|
6080
|
+
endIndex: q + v - 1,
|
|
6081
6081
|
size: E.prevSize,
|
|
6082
6082
|
startIndex: E.prevIndex
|
|
6083
6083
|
}
|
|
6084
6084
|
]), {
|
|
6085
|
-
prevIndex: q +
|
|
6085
|
+
prevIndex: q + v,
|
|
6086
6086
|
prevSize: B,
|
|
6087
6087
|
ranges: re
|
|
6088
6088
|
};
|
|
6089
6089
|
},
|
|
6090
6090
|
{
|
|
6091
|
-
prevIndex:
|
|
6091
|
+
prevIndex: v,
|
|
6092
6092
|
prevSize: 0,
|
|
6093
6093
|
ranges: R
|
|
6094
6094
|
}
|
|
6095
6095
|
).ranges;
|
|
6096
6096
|
}
|
|
6097
|
-
return Wn(
|
|
6097
|
+
return Wn(S.sizeTree).reduce(
|
|
6098
6098
|
(D, { k: $, v: F }) => ({
|
|
6099
|
-
prevIndex: $ +
|
|
6099
|
+
prevIndex: $ + v,
|
|
6100
6100
|
prevSize: F,
|
|
6101
|
-
ranges: [...D.ranges, { endIndex: $ +
|
|
6101
|
+
ranges: [...D.ranges, { endIndex: $ + v - 1, size: D.prevSize, startIndex: D.prevIndex }]
|
|
6102
6102
|
}),
|
|
6103
6103
|
{
|
|
6104
6104
|
prevIndex: 0,
|
|
@@ -6110,13 +6110,13 @@ const by = {
|
|
|
6110
6110
|
),
|
|
6111
6111
|
n
|
|
6112
6112
|
);
|
|
6113
|
-
const
|
|
6113
|
+
const T = Dt(
|
|
6114
6114
|
J(
|
|
6115
6115
|
i,
|
|
6116
6116
|
Ee(g, h),
|
|
6117
|
-
se(([
|
|
6118
|
-
const R = -
|
|
6119
|
-
return Xr(R,
|
|
6117
|
+
se(([v, { offsetTree: S }, C]) => {
|
|
6118
|
+
const R = -v;
|
|
6119
|
+
return Xr(R, S, C);
|
|
6120
6120
|
})
|
|
6121
6121
|
)
|
|
6122
6122
|
);
|
|
@@ -6124,42 +6124,42 @@ const by = {
|
|
|
6124
6124
|
J(
|
|
6125
6125
|
i,
|
|
6126
6126
|
Ee(g, h),
|
|
6127
|
-
se(([
|
|
6128
|
-
if (
|
|
6129
|
-
if ($e(
|
|
6130
|
-
return
|
|
6127
|
+
se(([v, S, C]) => {
|
|
6128
|
+
if (S.groupIndices.length > 0) {
|
|
6129
|
+
if ($e(S.sizeTree))
|
|
6130
|
+
return S;
|
|
6131
6131
|
let R = yr();
|
|
6132
6132
|
const _ = ot(y);
|
|
6133
6133
|
let D = 0, $ = 0, F = 0;
|
|
6134
|
-
for (; D < -
|
|
6134
|
+
for (; D < -v; ) {
|
|
6135
6135
|
F = _[$];
|
|
6136
6136
|
const O = _[$ + 1] - F - 1;
|
|
6137
6137
|
$++, D += O + 1;
|
|
6138
6138
|
}
|
|
6139
|
-
if (R = Wn(
|
|
6140
|
-
const O = Gr(
|
|
6139
|
+
if (R = Wn(S.sizeTree).reduce((O, { k: E, v: q }) => Ot(O, Math.max(0, E + v), q), R), D !== -v) {
|
|
6140
|
+
const O = Gr(S.sizeTree, F);
|
|
6141
6141
|
R = Ot(R, 0, O);
|
|
6142
|
-
const E = qt(
|
|
6142
|
+
const E = qt(S.sizeTree, -v + 1)[1];
|
|
6143
6143
|
R = Ot(R, 1, E);
|
|
6144
6144
|
}
|
|
6145
6145
|
return {
|
|
6146
|
-
...
|
|
6146
|
+
...S,
|
|
6147
6147
|
sizeTree: R,
|
|
6148
|
-
...Ii(
|
|
6148
|
+
...Ii(S.offsetTree, 0, R, C)
|
|
6149
6149
|
};
|
|
6150
6150
|
} else {
|
|
6151
|
-
const R = Wn(
|
|
6151
|
+
const R = Wn(S.sizeTree).reduce((_, { k: D, v: $ }) => Ot(_, Math.max(0, D + v), $), yr());
|
|
6152
6152
|
return {
|
|
6153
|
-
...
|
|
6153
|
+
...S,
|
|
6154
6154
|
sizeTree: R,
|
|
6155
|
-
...Ii(
|
|
6155
|
+
...Ii(S.offsetTree, 0, R, C)
|
|
6156
6156
|
};
|
|
6157
6157
|
}
|
|
6158
6158
|
})
|
|
6159
6159
|
),
|
|
6160
6160
|
g
|
|
6161
6161
|
), {
|
|
6162
|
-
beforeUnshiftWith:
|
|
6162
|
+
beforeUnshiftWith: k,
|
|
6163
6163
|
// input
|
|
6164
6164
|
data: p,
|
|
6165
6165
|
defaultItemSize: c,
|
|
@@ -6170,7 +6170,7 @@ const by = {
|
|
|
6170
6170
|
itemSize: f,
|
|
6171
6171
|
listRefresh: b,
|
|
6172
6172
|
shiftWith: i,
|
|
6173
|
-
shiftWithOffset:
|
|
6173
|
+
shiftWithOffset: T,
|
|
6174
6174
|
sizeRanges: n,
|
|
6175
6175
|
// output
|
|
6176
6176
|
sizes: g,
|
|
@@ -6192,7 +6192,7 @@ function vy(e) {
|
|
|
6192
6192
|
}
|
|
6193
6193
|
);
|
|
6194
6194
|
}
|
|
6195
|
-
const Hu =
|
|
6195
|
+
const Hu = Me(
|
|
6196
6196
|
([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
|
|
6197
6197
|
const s = Pe(), i = Pe(), a = Dt(J(s, se(vy)));
|
|
6198
6198
|
return fe(
|
|
@@ -6219,7 +6219,7 @@ const Hu = Oe(
|
|
|
6219
6219
|
), { groupCounts: s, topItemsIndexes: i };
|
|
6220
6220
|
},
|
|
6221
6221
|
He(fn, St)
|
|
6222
|
-
), Dn =
|
|
6222
|
+
), Dn = Me(
|
|
6223
6223
|
([{ log: e }]) => {
|
|
6224
6224
|
const t = ne(!1), n = Dt(
|
|
6225
6225
|
J(
|
|
@@ -6239,7 +6239,7 @@ function Wu(e) {
|
|
|
6239
6239
|
const t = typeof e == "number" ? { index: e } : e;
|
|
6240
6240
|
return t.align || (t.align = "start"), (!t.behavior || !Sy) && (t.behavior = "auto"), t.offset || (t.offset = 0), t;
|
|
6241
6241
|
}
|
|
6242
|
-
const uo =
|
|
6242
|
+
const uo = Me(
|
|
6243
6243
|
([
|
|
6244
6244
|
{ gap: e, listRefresh: t, sizes: n, totalCount: r },
|
|
6245
6245
|
{
|
|
@@ -6256,7 +6256,7 @@ const uo = Oe(
|
|
|
6256
6256
|
]) => {
|
|
6257
6257
|
const h = Pe(), m = Pe(), g = ne(0);
|
|
6258
6258
|
let y = null, x = null, b = null;
|
|
6259
|
-
function
|
|
6259
|
+
function k() {
|
|
6260
6260
|
y && (y(), y = null), b && (b(), b = null), x && (clearTimeout(x), x = null), Re(u, !1);
|
|
6261
6261
|
}
|
|
6262
6262
|
return fe(
|
|
@@ -6266,18 +6266,18 @@ const uo = Oe(
|
|
|
6266
6266
|
Ee(e, s, o),
|
|
6267
6267
|
se(
|
|
6268
6268
|
([
|
|
6269
|
-
[
|
|
6269
|
+
[T, v, S, C, R, _, D, $],
|
|
6270
6270
|
F,
|
|
6271
6271
|
O,
|
|
6272
6272
|
E
|
|
6273
6273
|
]) => {
|
|
6274
|
-
const q = Wu(
|
|
6275
|
-
let U = Xr(ee,
|
|
6276
|
-
B === "end" ? (U += O + qt(
|
|
6274
|
+
const q = Wu(T), { align: B, behavior: re, offset: V } = q, W = C - 1, ee = Uu(q, v, W);
|
|
6275
|
+
let U = Xr(ee, v.offsetTree, F) + _;
|
|
6276
|
+
B === "end" ? (U += O + qt(v.sizeTree, ee)[1] - S + E, ee === W && (U += D)) : B === "center" ? U += (O + qt(v.sizeTree, ee)[1] - S + E) / 2 : U -= R, V && (U += V);
|
|
6277
6277
|
const P = (N) => {
|
|
6278
|
-
|
|
6278
|
+
k(), N ? ($("retrying to scroll to", { location: T }, Nt.DEBUG), Re(h, T)) : (Re(m, !0), $("list did not change, scroll successful", {}, Nt.DEBUG));
|
|
6279
6279
|
};
|
|
6280
|
-
if (
|
|
6280
|
+
if (k(), re === "smooth") {
|
|
6281
6281
|
let N = !1;
|
|
6282
6282
|
b = De(t, (L) => {
|
|
6283
6283
|
N = N || L;
|
|
@@ -6287,7 +6287,7 @@ const uo = Oe(
|
|
|
6287
6287
|
} else
|
|
6288
6288
|
y = Kt(J(t, Cy(150)), P);
|
|
6289
6289
|
return x = setTimeout(() => {
|
|
6290
|
-
|
|
6290
|
+
k();
|
|
6291
6291
|
}, 1200), Re(u, !0), $("scrolling from index to", { behavior: re, index: ee, top: U }, Nt.DEBUG), { behavior: re, top: U };
|
|
6292
6292
|
}
|
|
6293
6293
|
)
|
|
@@ -6321,7 +6321,7 @@ function ra(e, t) {
|
|
|
6321
6321
|
const n = t - 1;
|
|
6322
6322
|
return typeof e == "number" ? e : e.index === "LAST" ? n : e.index;
|
|
6323
6323
|
}
|
|
6324
|
-
const fo =
|
|
6324
|
+
const fo = Me(
|
|
6325
6325
|
([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
|
|
6326
6326
|
const a = ne(!0), u = ne(0), l = ne(!0);
|
|
6327
6327
|
return fe(
|
|
@@ -6377,7 +6377,7 @@ const Jr = "up", Ur = "down", Ty = "none", ky = {
|
|
|
6377
6377
|
scrollTop: 0,
|
|
6378
6378
|
viewportHeight: 0
|
|
6379
6379
|
}
|
|
6380
|
-
}, Iy = 0, po =
|
|
6380
|
+
}, Iy = 0, po = Me(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
6381
6381
|
const i = ne(!1), a = ne(!0), u = Pe(), l = Pe(), c = ne(4), f = ne(Iy), p = yt(
|
|
6382
6382
|
J(
|
|
6383
6383
|
Si(J(ye(o), Qn(1), on(!0)), J(ye(o), Qn(1), on(!1), El(100))),
|
|
@@ -6391,7 +6391,7 @@ const Jr = "up", Ur = "down", Ty = "none", ky = {
|
|
|
6391
6391
|
fe(
|
|
6392
6392
|
J(
|
|
6393
6393
|
it(ye(o), ye(f)),
|
|
6394
|
-
se(([b,
|
|
6394
|
+
se(([b, k]) => b <= k),
|
|
6395
6395
|
Ue()
|
|
6396
6396
|
),
|
|
6397
6397
|
a
|
|
@@ -6399,15 +6399,15 @@ const Jr = "up", Ur = "down", Ty = "none", ky = {
|
|
|
6399
6399
|
const m = Dt(
|
|
6400
6400
|
J(
|
|
6401
6401
|
it(r, ye(s), ye(t), ye(e), ye(c)),
|
|
6402
|
-
an((b, [{ scrollHeight:
|
|
6403
|
-
const _ =
|
|
6404
|
-
scrollHeight:
|
|
6405
|
-
scrollTop:
|
|
6406
|
-
viewportHeight:
|
|
6402
|
+
an((b, [{ scrollHeight: k, scrollTop: T }, v, S, C, R]) => {
|
|
6403
|
+
const _ = T + v - k > -R, D = {
|
|
6404
|
+
scrollHeight: k,
|
|
6405
|
+
scrollTop: T,
|
|
6406
|
+
viewportHeight: v
|
|
6407
6407
|
};
|
|
6408
6408
|
if (_) {
|
|
6409
6409
|
let F, O;
|
|
6410
|
-
return
|
|
6410
|
+
return T > b.state.scrollTop ? (F = "SCROLLED_DOWN", O = b.state.scrollTop - T) : (F = "SIZE_DECREASED", O = b.state.scrollTop - T || b.scrollTopDelta), {
|
|
6411
6411
|
atBottom: !0,
|
|
6412
6412
|
atBottomBecause: F,
|
|
6413
6413
|
scrollTopDelta: O,
|
|
@@ -6415,38 +6415,38 @@ const Jr = "up", Ur = "down", Ty = "none", ky = {
|
|
|
6415
6415
|
};
|
|
6416
6416
|
}
|
|
6417
6417
|
let $;
|
|
6418
|
-
return D.scrollHeight > b.state.scrollHeight ? $ = "SIZE_INCREASED" :
|
|
6418
|
+
return D.scrollHeight > b.state.scrollHeight ? $ = "SIZE_INCREASED" : v < b.state.viewportHeight ? $ = "VIEWPORT_HEIGHT_DECREASING" : T < b.state.scrollTop ? $ = "SCROLLING_UPWARDS" : $ = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
6419
6419
|
atBottom: !1,
|
|
6420
6420
|
notAtBottomBecause: $,
|
|
6421
6421
|
state: D
|
|
6422
6422
|
};
|
|
6423
6423
|
}, ky),
|
|
6424
|
-
Ue((b,
|
|
6424
|
+
Ue((b, k) => b && b.atBottom === k.atBottom)
|
|
6425
6425
|
)
|
|
6426
6426
|
), g = yt(
|
|
6427
6427
|
J(
|
|
6428
6428
|
r,
|
|
6429
6429
|
an(
|
|
6430
|
-
(b, { scrollHeight:
|
|
6431
|
-
if (Vu(b.scrollHeight,
|
|
6430
|
+
(b, { scrollHeight: k, scrollTop: T, viewportHeight: v }) => {
|
|
6431
|
+
if (Vu(b.scrollHeight, k))
|
|
6432
6432
|
return {
|
|
6433
6433
|
changed: !1,
|
|
6434
6434
|
jump: 0,
|
|
6435
|
-
scrollHeight:
|
|
6436
|
-
scrollTop:
|
|
6435
|
+
scrollHeight: k,
|
|
6436
|
+
scrollTop: T
|
|
6437
6437
|
};
|
|
6438
6438
|
{
|
|
6439
|
-
const
|
|
6440
|
-
return b.scrollTop !==
|
|
6439
|
+
const S = k - (T + v) < 1;
|
|
6440
|
+
return b.scrollTop !== T && S ? {
|
|
6441
6441
|
changed: !0,
|
|
6442
|
-
jump: b.scrollTop -
|
|
6443
|
-
scrollHeight:
|
|
6444
|
-
scrollTop:
|
|
6442
|
+
jump: b.scrollTop - T,
|
|
6443
|
+
scrollHeight: k,
|
|
6444
|
+
scrollTop: T
|
|
6445
6445
|
} : {
|
|
6446
6446
|
changed: !0,
|
|
6447
6447
|
jump: 0,
|
|
6448
|
-
scrollHeight:
|
|
6449
|
-
scrollTop:
|
|
6448
|
+
scrollHeight: k,
|
|
6449
|
+
scrollTop: T
|
|
6450
6450
|
};
|
|
6451
6451
|
}
|
|
6452
6452
|
},
|
|
@@ -6471,7 +6471,7 @@ const Jr = "up", Ur = "down", Ty = "none", ky = {
|
|
|
6471
6471
|
se(({ scrollTop: b }) => b),
|
|
6472
6472
|
Ue(),
|
|
6473
6473
|
an(
|
|
6474
|
-
(b,
|
|
6474
|
+
(b, k) => ot(h) ? { direction: b.direction, prevScrollTop: k } : { direction: k < b.prevScrollTop ? Jr : Ur, prevScrollTop: k },
|
|
6475
6475
|
{ direction: Ur, prevScrollTop: 0 }
|
|
6476
6476
|
),
|
|
6477
6477
|
se((b) => b.direction)
|
|
@@ -6491,9 +6491,9 @@ const Jr = "up", Ur = "down", Ty = "none", ky = {
|
|
|
6491
6491
|
o,
|
|
6492
6492
|
bn(100),
|
|
6493
6493
|
Ee(p),
|
|
6494
|
-
we(([b,
|
|
6495
|
-
an(([b,
|
|
6496
|
-
se(([b,
|
|
6494
|
+
we(([b, k]) => !!k),
|
|
6495
|
+
an(([b, k], [T]) => [k, T], [0, 0]),
|
|
6496
|
+
se(([b, k]) => k - b)
|
|
6497
6497
|
),
|
|
6498
6498
|
x
|
|
6499
6499
|
), {
|
|
@@ -6517,7 +6517,7 @@ function Ml(e, t) {
|
|
|
6517
6517
|
var n;
|
|
6518
6518
|
return typeof e == "number" ? e : (n = e[t]) != null ? n : 0;
|
|
6519
6519
|
}
|
|
6520
|
-
const oa =
|
|
6520
|
+
const oa = Me(
|
|
6521
6521
|
([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
|
|
6522
6522
|
const s = Pe(), i = ne(0), a = ne(0), u = ne(0), l = yt(
|
|
6523
6523
|
J(
|
|
@@ -6542,14 +6542,14 @@ const oa = Oe(
|
|
|
6542
6542
|
y,
|
|
6543
6543
|
x,
|
|
6544
6544
|
b,
|
|
6545
|
-
|
|
6545
|
+
k
|
|
6546
6546
|
]) => {
|
|
6547
|
-
const
|
|
6547
|
+
const T = c - b, v = y + x, S = Math.max(p - T, 0);
|
|
6548
6548
|
let C = _l;
|
|
6549
|
-
const R = Ml(
|
|
6550
|
-
return h -= b, h += p + x, m += p + x, m -= b, h > c +
|
|
6551
|
-
Math.max(
|
|
6552
|
-
|
|
6549
|
+
const R = Ml(k, Qo), _ = Ml(k, es);
|
|
6550
|
+
return h -= b, h += p + x, m += p + x, m -= b, h > c + v - R && (C = Jr), m < c - S + f + _ && (C = Ur), C !== _l ? [
|
|
6551
|
+
Math.max(T - p - Pl(g, Qo, C) - R, 0),
|
|
6552
|
+
T - S - x + f + Pl(g, es, C) + _
|
|
6553
6553
|
] : null;
|
|
6554
6554
|
}
|
|
6555
6555
|
),
|
|
@@ -6655,7 +6655,7 @@ function Ol(e, t, n) {
|
|
|
6655
6655
|
}
|
|
6656
6656
|
return s;
|
|
6657
6657
|
}
|
|
6658
|
-
const ir =
|
|
6658
|
+
const ir = Me(
|
|
6659
6659
|
([
|
|
6660
6660
|
{ data: e, firstItemIndex: t, gap: n, sizes: r, totalCount: o },
|
|
6661
6661
|
s,
|
|
@@ -6683,15 +6683,15 @@ const ir = Oe(
|
|
|
6683
6683
|
ye(n),
|
|
6684
6684
|
e
|
|
6685
6685
|
),
|
|
6686
|
-
we(([
|
|
6686
|
+
we(([S, C, , R, , , , , , , _]) => {
|
|
6687
6687
|
const D = _ && _.length !== R;
|
|
6688
|
-
return
|
|
6688
|
+
return S && !C && !D;
|
|
6689
6689
|
}),
|
|
6690
6690
|
se(
|
|
6691
6691
|
([
|
|
6692
6692
|
,
|
|
6693
6693
|
,
|
|
6694
|
-
[
|
|
6694
|
+
[S, C],
|
|
6695
6695
|
R,
|
|
6696
6696
|
_,
|
|
6697
6697
|
D,
|
|
@@ -6704,7 +6704,7 @@ const ir = Oe(
|
|
|
6704
6704
|
const B = _, { offsetTree: re, sizeTree: V } = B, W = ot(y);
|
|
6705
6705
|
if (R === 0)
|
|
6706
6706
|
return { ...Xs, totalCount: R };
|
|
6707
|
-
if (
|
|
6707
|
+
if (S === 0 && C === 0)
|
|
6708
6708
|
return W === 0 ? { ...Xs, totalCount: R } : Ku(W, D, _, O, E, q || []);
|
|
6709
6709
|
if ($e(V))
|
|
6710
6710
|
return W > 0 ? null : Fo(
|
|
@@ -6727,7 +6727,7 @@ const ir = Oe(
|
|
|
6727
6727
|
}
|
|
6728
6728
|
if (!$)
|
|
6729
6729
|
return Fo([], ee, R, E, B, O);
|
|
6730
|
-
const U = F.length > 0 ? F[F.length - 1] + 1 : 0, P = my(re,
|
|
6730
|
+
const U = F.length > 0 ? F[F.length - 1] + 1 : 0, P = my(re, S, C, U);
|
|
6731
6731
|
if (P.length === 0)
|
|
6732
6732
|
return null;
|
|
6733
6733
|
const N = R - 1, L = Ss([], (M) => {
|
|
@@ -6735,8 +6735,8 @@ const ir = Oe(
|
|
|
6735
6735
|
const Z = G.value;
|
|
6736
6736
|
let j = Z.offset, K = G.start;
|
|
6737
6737
|
const X = Z.size;
|
|
6738
|
-
if (Z.offset <
|
|
6739
|
-
K += Math.floor((
|
|
6738
|
+
if (Z.offset < S) {
|
|
6739
|
+
K += Math.floor((S - Z.offset + E) / (X + E));
|
|
6740
6740
|
const he = K - G.start;
|
|
6741
6741
|
j += he * X + he * E;
|
|
6742
6742
|
}
|
|
@@ -6750,7 +6750,7 @@ const ir = Oe(
|
|
|
6750
6750
|
}
|
|
6751
6751
|
),
|
|
6752
6752
|
//@ts-expect-error filter needs to be fixed
|
|
6753
|
-
we((
|
|
6753
|
+
we((S) => S !== null),
|
|
6754
6754
|
Ue()
|
|
6755
6755
|
),
|
|
6756
6756
|
Xs
|
|
@@ -6759,65 +6759,65 @@ const ir = Oe(
|
|
|
6759
6759
|
J(
|
|
6760
6760
|
e,
|
|
6761
6761
|
we(Ji),
|
|
6762
|
-
se((
|
|
6762
|
+
se((S) => S == null ? void 0 : S.length)
|
|
6763
6763
|
),
|
|
6764
6764
|
o
|
|
6765
6765
|
), fe(
|
|
6766
6766
|
J(
|
|
6767
6767
|
b,
|
|
6768
|
-
se((
|
|
6768
|
+
se((S) => S.topListHeight)
|
|
6769
6769
|
),
|
|
6770
6770
|
f
|
|
6771
6771
|
), fe(f, a), fe(
|
|
6772
6772
|
J(
|
|
6773
6773
|
b,
|
|
6774
|
-
se((
|
|
6774
|
+
se((S) => [S.top, S.bottom])
|
|
6775
6775
|
),
|
|
6776
6776
|
i
|
|
6777
6777
|
), fe(
|
|
6778
6778
|
J(
|
|
6779
6779
|
b,
|
|
6780
|
-
se((
|
|
6780
|
+
se((S) => S.items)
|
|
6781
6781
|
),
|
|
6782
6782
|
x
|
|
6783
6783
|
);
|
|
6784
|
-
const
|
|
6784
|
+
const k = Dt(
|
|
6785
6785
|
J(
|
|
6786
6786
|
b,
|
|
6787
|
-
we(({ items:
|
|
6787
|
+
we(({ items: S }) => S.length > 0),
|
|
6788
6788
|
Ee(o, e),
|
|
6789
|
-
we(([{ items:
|
|
6790
|
-
se(([,
|
|
6789
|
+
we(([{ items: S }, C]) => S[S.length - 1].originalIndex === C - 1),
|
|
6790
|
+
se(([, S, C]) => [S - 1, C]),
|
|
6791
6791
|
Ue(Yr),
|
|
6792
|
-
se(([
|
|
6792
|
+
se(([S]) => S)
|
|
6793
6793
|
)
|
|
6794
|
-
),
|
|
6794
|
+
), T = Dt(
|
|
6795
6795
|
J(
|
|
6796
6796
|
b,
|
|
6797
6797
|
bn(200),
|
|
6798
|
-
we(({ items:
|
|
6799
|
-
se(({ items:
|
|
6798
|
+
we(({ items: S, topItems: C }) => S.length > 0 && S[0].originalIndex === C.length),
|
|
6799
|
+
se(({ items: S }) => S[0].index),
|
|
6800
6800
|
Ue()
|
|
6801
6801
|
)
|
|
6802
|
-
),
|
|
6802
|
+
), v = Dt(
|
|
6803
6803
|
J(
|
|
6804
6804
|
b,
|
|
6805
|
-
we(({ items:
|
|
6806
|
-
se(({ items:
|
|
6807
|
-
let C = 0, R =
|
|
6808
|
-
for (;
|
|
6805
|
+
we(({ items: S }) => S.length > 0),
|
|
6806
|
+
se(({ items: S }) => {
|
|
6807
|
+
let C = 0, R = S.length - 1;
|
|
6808
|
+
for (; S[C].type === "group" && C < R; )
|
|
6809
6809
|
C++;
|
|
6810
|
-
for (;
|
|
6810
|
+
for (; S[R].type === "group" && R > C; )
|
|
6811
6811
|
R--;
|
|
6812
6812
|
return {
|
|
6813
|
-
endIndex:
|
|
6814
|
-
startIndex:
|
|
6813
|
+
endIndex: S[R].index,
|
|
6814
|
+
startIndex: S[C].index
|
|
6815
6815
|
};
|
|
6816
6816
|
}),
|
|
6817
6817
|
Ue(Fu)
|
|
6818
6818
|
)
|
|
6819
6819
|
);
|
|
6820
|
-
return { endReached:
|
|
6820
|
+
return { endReached: k, initialItemCount: y, itemsRendered: x, listState: b, rangeChanged: v, startReached: T, topItemsIndexes: g, ...p };
|
|
6821
6821
|
},
|
|
6822
6822
|
He(
|
|
6823
6823
|
fn,
|
|
@@ -6830,7 +6830,7 @@ const ir = Oe(
|
|
|
6830
6830
|
ea
|
|
6831
6831
|
),
|
|
6832
6832
|
{ singleton: !0 }
|
|
6833
|
-
), qu =
|
|
6833
|
+
), qu = Me(
|
|
6834
6834
|
([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
|
|
6835
6835
|
const s = Pe(), i = yt(
|
|
6836
6836
|
J(
|
|
@@ -6843,7 +6843,7 @@ const ir = Oe(
|
|
|
6843
6843
|
},
|
|
6844
6844
|
He(St, ir),
|
|
6845
6845
|
{ singleton: !0 }
|
|
6846
|
-
), Ey =
|
|
6846
|
+
), Ey = Me(
|
|
6847
6847
|
([{ viewportHeight: e }, { totalListHeight: t }]) => {
|
|
6848
6848
|
const n = ne(!1), r = yt(
|
|
6849
6849
|
J(
|
|
@@ -6859,7 +6859,7 @@ const ir = Oe(
|
|
|
6859
6859
|
},
|
|
6860
6860
|
He(St, qu),
|
|
6861
6861
|
{ singleton: !0 }
|
|
6862
|
-
), Gu =
|
|
6862
|
+
), Gu = Me(() => ({
|
|
6863
6863
|
context: ne(null)
|
|
6864
6864
|
})), Ay = ({
|
|
6865
6865
|
itemBottom: e,
|
|
@@ -6867,7 +6867,7 @@ const ir = Oe(
|
|
|
6867
6867
|
locationParams: { align: n, behavior: r, ...o },
|
|
6868
6868
|
viewportBottom: s,
|
|
6869
6869
|
viewportTop: i
|
|
6870
|
-
}) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Yu =
|
|
6870
|
+
}) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Yu = Me(
|
|
6871
6871
|
([
|
|
6872
6872
|
{ gap: e, sizes: t, totalCount: n },
|
|
6873
6873
|
{ fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: u },
|
|
@@ -6879,11 +6879,11 @@ const ir = Oe(
|
|
|
6879
6879
|
c,
|
|
6880
6880
|
Ee(t, u, n, s, o, r, a),
|
|
6881
6881
|
Ee(e),
|
|
6882
|
-
se(([[f, p, h, m, g, y, x, b],
|
|
6883
|
-
const { align:
|
|
6882
|
+
se(([[f, p, h, m, g, y, x, b], k]) => {
|
|
6883
|
+
const { align: T, behavior: v, calculateViewLocation: S = Ay, done: C, ...R } = f, _ = Uu(f, p, m - 1), D = Xr(_, p.offsetTree, k) + g + y, $ = D + qt(p.sizeTree, _)[1], F = b + y, O = b + h - x, E = S({
|
|
6884
6884
|
itemBottom: $,
|
|
6885
6885
|
itemTop: D,
|
|
6886
|
-
locationParams: { align:
|
|
6886
|
+
locationParams: { align: T, behavior: v, ...R },
|
|
6887
6887
|
viewportBottom: O,
|
|
6888
6888
|
viewportTop: F
|
|
6889
6889
|
});
|
|
@@ -6911,7 +6911,7 @@ const ir = Oe(
|
|
|
6911
6911
|
function Dl(e) {
|
|
6912
6912
|
return e ? e === "smooth" ? "smooth" : "auto" : !1;
|
|
6913
6913
|
}
|
|
6914
|
-
const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy =
|
|
6914
|
+
const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Me(
|
|
6915
6915
|
([
|
|
6916
6916
|
{ listRefresh: e, totalCount: t, fixedItemSize: n, data: r },
|
|
6917
6917
|
{ atBottomState: o, isAtBottom: s },
|
|
@@ -6925,10 +6925,10 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
6925
6925
|
]) => {
|
|
6926
6926
|
const m = ne(!1), g = Pe();
|
|
6927
6927
|
let y = null;
|
|
6928
|
-
function x(
|
|
6928
|
+
function x(v) {
|
|
6929
6929
|
Re(i, {
|
|
6930
6930
|
align: "end",
|
|
6931
|
-
behavior:
|
|
6931
|
+
behavior: v,
|
|
6932
6932
|
index: "LAST"
|
|
6933
6933
|
});
|
|
6934
6934
|
}
|
|
@@ -6936,74 +6936,74 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
6936
6936
|
J(
|
|
6937
6937
|
it(J(ye(t), Qn(1)), u),
|
|
6938
6938
|
Ee(ye(m), s, a, f),
|
|
6939
|
-
se(([[
|
|
6940
|
-
let $ =
|
|
6941
|
-
return $ && (F = Ny(C, R || D), $ = $ && !!F), { followOutputBehavior: F, shouldFollow: $, totalCount:
|
|
6939
|
+
se(([[v, S], C, R, _, D]) => {
|
|
6940
|
+
let $ = S && _, F = "auto";
|
|
6941
|
+
return $ && (F = Ny(C, R || D), $ = $ && !!F), { followOutputBehavior: F, shouldFollow: $, totalCount: v };
|
|
6942
6942
|
}),
|
|
6943
|
-
we(({ shouldFollow:
|
|
6943
|
+
we(({ shouldFollow: v }) => v)
|
|
6944
6944
|
),
|
|
6945
|
-
({ followOutputBehavior:
|
|
6945
|
+
({ followOutputBehavior: v, totalCount: S }) => {
|
|
6946
6946
|
y && (y(), y = null), ot(n) ? requestAnimationFrame(() => {
|
|
6947
|
-
ot(c)("following output to ", { totalCount:
|
|
6947
|
+
ot(c)("following output to ", { totalCount: S }, Nt.DEBUG), x(v);
|
|
6948
6948
|
}) : y = Kt(e, () => {
|
|
6949
|
-
ot(c)("following output to ", { totalCount:
|
|
6949
|
+
ot(c)("following output to ", { totalCount: S }, Nt.DEBUG), x(v), y = null;
|
|
6950
6950
|
});
|
|
6951
6951
|
}
|
|
6952
6952
|
);
|
|
6953
|
-
function b(
|
|
6954
|
-
const
|
|
6955
|
-
|
|
6953
|
+
function b(v) {
|
|
6954
|
+
const S = Kt(o, (C) => {
|
|
6955
|
+
v && !C.atBottom && C.notAtBottomBecause === "SIZE_INCREASED" && !y && (ot(c)("scrolling to bottom due to increased size", {}, Nt.DEBUG), x("auto"));
|
|
6956
6956
|
});
|
|
6957
|
-
setTimeout(
|
|
6957
|
+
setTimeout(S, 100);
|
|
6958
6958
|
}
|
|
6959
6959
|
De(
|
|
6960
6960
|
J(
|
|
6961
6961
|
it(ye(m), t, l),
|
|
6962
|
-
we(([
|
|
6962
|
+
we(([v, , S]) => v && S),
|
|
6963
6963
|
an(
|
|
6964
|
-
({ value:
|
|
6964
|
+
({ value: v }, [, S]) => ({ refreshed: v === S, value: S }),
|
|
6965
6965
|
{ refreshed: !1, value: 0 }
|
|
6966
6966
|
),
|
|
6967
|
-
we(({ refreshed:
|
|
6967
|
+
we(({ refreshed: v }) => v),
|
|
6968
6968
|
Ee(m, t)
|
|
6969
6969
|
),
|
|
6970
|
-
([,
|
|
6971
|
-
ot(a) && b(
|
|
6970
|
+
([, v]) => {
|
|
6971
|
+
ot(a) && b(v !== !1);
|
|
6972
6972
|
}
|
|
6973
6973
|
), De(g, () => {
|
|
6974
6974
|
b(ot(m) !== !1);
|
|
6975
|
-
}), De(it(ye(m), o), ([
|
|
6976
|
-
|
|
6975
|
+
}), De(it(ye(m), o), ([v, S]) => {
|
|
6976
|
+
v && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && x("auto");
|
|
6977
6977
|
});
|
|
6978
|
-
const
|
|
6978
|
+
const k = ne(null), T = Pe();
|
|
6979
6979
|
return fe(
|
|
6980
6980
|
Si(
|
|
6981
6981
|
J(
|
|
6982
6982
|
ye(r),
|
|
6983
|
-
se((
|
|
6984
|
-
var
|
|
6985
|
-
return (
|
|
6983
|
+
se((v) => {
|
|
6984
|
+
var S;
|
|
6985
|
+
return (S = v == null ? void 0 : v.length) != null ? S : 0;
|
|
6986
6986
|
})
|
|
6987
6987
|
),
|
|
6988
6988
|
J(ye(t))
|
|
6989
6989
|
),
|
|
6990
|
-
|
|
6990
|
+
T
|
|
6991
6991
|
), De(
|
|
6992
6992
|
J(
|
|
6993
|
-
it(J(
|
|
6994
|
-
Ee(ye(
|
|
6995
|
-
se(([[
|
|
6996
|
-
we((
|
|
6993
|
+
it(J(T, Qn(1)), u),
|
|
6994
|
+
Ee(ye(k), a, f, p),
|
|
6995
|
+
se(([[v, S], C, R, _, D]) => S && R && (C == null ? void 0 : C({ context: D, totalCount: v, scrollingInProgress: _ }))),
|
|
6996
|
+
we((v) => !!v),
|
|
6997
6997
|
bn(0)
|
|
6998
6998
|
),
|
|
6999
|
-
(
|
|
6999
|
+
(v) => {
|
|
7000
7000
|
y && (y(), y = null), ot(n) ? requestAnimationFrame(() => {
|
|
7001
|
-
ot(c)("scrolling into view", {}), Re(h,
|
|
7001
|
+
ot(c)("scrolling into view", {}), Re(h, v);
|
|
7002
7002
|
}) : y = Kt(e, () => {
|
|
7003
|
-
ot(c)("scrolling into view", {}), Re(h,
|
|
7003
|
+
ot(c)("scrolling into view", {}), Re(h, v), y = null;
|
|
7004
7004
|
});
|
|
7005
7005
|
}
|
|
7006
|
-
), { autoscrollToBottom: g, followOutput: m, scrollIntoViewOnChange:
|
|
7006
|
+
), { autoscrollToBottom: g, followOutput: m, scrollIntoViewOnChange: k };
|
|
7007
7007
|
},
|
|
7008
7008
|
He(
|
|
7009
7009
|
fn,
|
|
@@ -7016,7 +7016,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7016
7016
|
Gu,
|
|
7017
7017
|
Yu
|
|
7018
7018
|
)
|
|
7019
|
-
), _y =
|
|
7019
|
+
), _y = Me(
|
|
7020
7020
|
([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (fe(
|
|
7021
7021
|
J(
|
|
7022
7022
|
a,
|
|
@@ -7029,7 +7029,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7029
7029
|
), {}),
|
|
7030
7030
|
He(fn, fo, ir, Dn),
|
|
7031
7031
|
{ singleton: !0 }
|
|
7032
|
-
), Py =
|
|
7032
|
+
), Py = Me(
|
|
7033
7033
|
([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
|
|
7034
7034
|
const r = ne(0);
|
|
7035
7035
|
return De(
|
|
@@ -7059,7 +7059,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7059
7059
|
},
|
|
7060
7060
|
He(Dn, St, ir),
|
|
7061
7061
|
{ singleton: !0 }
|
|
7062
|
-
), Xu =
|
|
7062
|
+
), Xu = Me(
|
|
7063
7063
|
([{ scrollVelocity: e }]) => {
|
|
7064
7064
|
const t = ne(!1), n = Pe(), r = ne(!1);
|
|
7065
7065
|
return fe(
|
|
@@ -7088,7 +7088,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7088
7088
|
},
|
|
7089
7089
|
He(po),
|
|
7090
7090
|
{ singleton: !0 }
|
|
7091
|
-
), sa =
|
|
7091
|
+
), sa = Me(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
7092
7092
|
const n = Pe(), r = Pe(), o = Pe(), s = ne(!1), i = ne(void 0);
|
|
7093
7093
|
return fe(
|
|
7094
7094
|
J(
|
|
@@ -7120,7 +7120,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7120
7120
|
windowScrollTo: o,
|
|
7121
7121
|
windowViewportRect: r
|
|
7122
7122
|
};
|
|
7123
|
-
}, He(St)), My =
|
|
7123
|
+
}, He(St)), My = Me(
|
|
7124
7124
|
([
|
|
7125
7125
|
{ sizeRanges: e, sizes: t },
|
|
7126
7126
|
{ headerHeight: n, scrollTop: r },
|
|
@@ -7134,9 +7134,9 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7134
7134
|
l,
|
|
7135
7135
|
Ee(t, r, i, f, p, n)
|
|
7136
7136
|
),
|
|
7137
|
-
([h, m, g, y, x, b,
|
|
7138
|
-
const
|
|
7139
|
-
y && x !== null && b !== null && (g = x.scrollTop - b.offsetTop), g -=
|
|
7137
|
+
([h, m, g, y, x, b, k]) => {
|
|
7138
|
+
const T = xy(m.sizeTree);
|
|
7139
|
+
y && x !== null && b !== null && (g = x.scrollTop - b.offsetTop), g -= k, h({ ranges: T, scrollTop: g });
|
|
7140
7140
|
}
|
|
7141
7141
|
), fe(J(c, we(Ji), se(Oy)), o), fe(
|
|
7142
7142
|
J(
|
|
@@ -7157,7 +7157,7 @@ const Ny = (e, t) => typeof e == "function" ? Dl(e(t)) : t && Dl(e), jy = Oe(
|
|
|
7157
7157
|
function Oy(e) {
|
|
7158
7158
|
return { align: "start", index: 0, offset: e.scrollTop };
|
|
7159
7159
|
}
|
|
7160
|
-
const Dy =
|
|
7160
|
+
const Dy = Me(([{ topItemsIndexes: e }]) => {
|
|
7161
7161
|
const t = ne(0);
|
|
7162
7162
|
return fe(
|
|
7163
7163
|
J(
|
|
@@ -7172,7 +7172,7 @@ function Ju(e) {
|
|
|
7172
7172
|
let t = !1, n;
|
|
7173
7173
|
return () => (t || (t = !0, n = e()), n);
|
|
7174
7174
|
}
|
|
7175
|
-
const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), $y =
|
|
7175
|
+
const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), $y = Me(
|
|
7176
7176
|
([
|
|
7177
7177
|
{ deviation: e, scrollBy: t, scrollingInProgress: n, scrollTop: r },
|
|
7178
7178
|
{ isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
|
|
@@ -7186,28 +7186,28 @@ const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7186
7186
|
u,
|
|
7187
7187
|
Ee(i),
|
|
7188
7188
|
an(
|
|
7189
|
-
([, x, b,
|
|
7190
|
-
const _ =
|
|
7189
|
+
([, x, b, k], [{ bottom: T, items: v, offsetBottom: S, totalCount: C }, R]) => {
|
|
7190
|
+
const _ = T + S;
|
|
7191
7191
|
let D = 0;
|
|
7192
|
-
return b === C && x.length > 0 &&
|
|
7192
|
+
return b === C && x.length > 0 && v.length > 0 && (v[0].originalIndex === 0 && x[0].originalIndex === 0 || (D = _ - k, D !== 0 && (D += R))), [D, v, C, _];
|
|
7193
7193
|
},
|
|
7194
7194
|
[0, [], 0, 0]
|
|
7195
7195
|
),
|
|
7196
7196
|
we(([x]) => x !== 0),
|
|
7197
7197
|
Ee(r, a, n, o, h, m),
|
|
7198
|
-
we(([, x, b,
|
|
7198
|
+
we(([, x, b, k, , , T]) => !T && !k && x !== 0 && b === Jr),
|
|
7199
7199
|
se(([[x], , , , , b]) => (b("Upward scrolling compensation", { amount: x }, Nt.DEBUG), x))
|
|
7200
7200
|
)
|
|
7201
7201
|
);
|
|
7202
7202
|
function y(x) {
|
|
7203
7203
|
x > 0 ? (Re(t, { behavior: "auto", top: -x }), Re(e, 0)) : (Re(e, 0), Re(t, { behavior: "auto", top: -x }));
|
|
7204
7204
|
}
|
|
7205
|
-
return De(J(g, Ee(e, s)), ([x, b,
|
|
7206
|
-
|
|
7205
|
+
return De(J(g, Ee(e, s)), ([x, b, k]) => {
|
|
7206
|
+
k && Ly() ? Re(e, b - x) : y(-x);
|
|
7207
7207
|
}), De(
|
|
7208
7208
|
J(
|
|
7209
7209
|
it(yt(s, !1), e, m),
|
|
7210
|
-
we(([x, b,
|
|
7210
|
+
we(([x, b, k]) => !x && !k && b !== 0),
|
|
7211
7211
|
se(([x, b]) => b),
|
|
7212
7212
|
bn(1)
|
|
7213
7213
|
),
|
|
@@ -7222,20 +7222,20 @@ const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7222
7222
|
J(
|
|
7223
7223
|
l,
|
|
7224
7224
|
Ee(p, c),
|
|
7225
|
-
se(([x, { groupIndices: b, lastSize:
|
|
7226
|
-
function
|
|
7227
|
-
return C * (
|
|
7225
|
+
se(([x, { groupIndices: b, lastSize: k, sizeTree: T }, v]) => {
|
|
7226
|
+
function S(C) {
|
|
7227
|
+
return C * (k + v);
|
|
7228
7228
|
}
|
|
7229
7229
|
if (b.length === 0)
|
|
7230
|
-
return
|
|
7230
|
+
return S(x);
|
|
7231
7231
|
{
|
|
7232
7232
|
let C = 0;
|
|
7233
|
-
const R = Gr(
|
|
7233
|
+
const R = Gr(T, 0);
|
|
7234
7234
|
let _ = 0, D = 0;
|
|
7235
7235
|
for (; _ < x; ) {
|
|
7236
7236
|
_++, C += R;
|
|
7237
7237
|
let $ = b.length === D + 1 ? 1 / 0 : b[D + 1] - b[D] - 1;
|
|
7238
|
-
_ + $ > x && (C -= R, $ = x - _ + 1), _ += $, C +=
|
|
7238
|
+
_ + $ > x && (C -= R, $ = x - _ + 1), _ += $, C += S($), D++;
|
|
7239
7239
|
}
|
|
7240
7240
|
return C;
|
|
7241
7241
|
}
|
|
@@ -7251,7 +7251,7 @@ const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7251
7251
|
), { deviation: e };
|
|
7252
7252
|
},
|
|
7253
7253
|
He(St, po, ir, fn, On, ea)
|
|
7254
|
-
), Fy =
|
|
7254
|
+
), Fy = Me(
|
|
7255
7255
|
([
|
|
7256
7256
|
e,
|
|
7257
7257
|
t,
|
|
@@ -7290,7 +7290,7 @@ const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7290
7290
|
On,
|
|
7291
7291
|
Gu
|
|
7292
7292
|
)
|
|
7293
|
-
), Zu =
|
|
7293
|
+
), Zu = Me(
|
|
7294
7294
|
([
|
|
7295
7295
|
{
|
|
7296
7296
|
data: e,
|
|
@@ -7310,13 +7310,13 @@ const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7310
7310
|
g,
|
|
7311
7311
|
y,
|
|
7312
7312
|
x,
|
|
7313
|
-
{ listState: b, topItemsIndexes:
|
|
7314
|
-
{ scrollToIndex:
|
|
7315
|
-
|
|
7313
|
+
{ listState: b, topItemsIndexes: k, ...T },
|
|
7314
|
+
{ scrollToIndex: v },
|
|
7315
|
+
S,
|
|
7316
7316
|
{ topItemCount: C },
|
|
7317
7317
|
{ groupCounts: R },
|
|
7318
7318
|
_
|
|
7319
|
-
]) => (fe(
|
|
7319
|
+
]) => (fe(T.rangeChanged, _.scrollSeekRangeChanged), fe(
|
|
7320
7320
|
J(
|
|
7321
7321
|
_.windowViewportRect,
|
|
7322
7322
|
se((D) => D.visibleHeight)
|
|
@@ -7334,19 +7334,19 @@ const Ly = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7334
7334
|
scrolledToInitialItem: m,
|
|
7335
7335
|
sizeRanges: a,
|
|
7336
7336
|
topItemCount: C,
|
|
7337
|
-
topItemsIndexes:
|
|
7337
|
+
topItemsIndexes: k,
|
|
7338
7338
|
// input
|
|
7339
7339
|
totalCount: c,
|
|
7340
7340
|
...x,
|
|
7341
7341
|
groupIndices: s,
|
|
7342
7342
|
itemSize: i,
|
|
7343
7343
|
listState: b,
|
|
7344
|
-
scrollToIndex:
|
|
7344
|
+
scrollToIndex: v,
|
|
7345
7345
|
// output
|
|
7346
7346
|
statefulTotalCount: l,
|
|
7347
7347
|
trackItemSizes: f,
|
|
7348
7348
|
// exported from stateFlagsSystem
|
|
7349
|
-
...
|
|
7349
|
+
...T,
|
|
7350
7350
|
// the bag of IO from featureGroup1System
|
|
7351
7351
|
..._,
|
|
7352
7352
|
...g,
|
|
@@ -7383,40 +7383,40 @@ function Qu(e, t, n) {
|
|
|
7383
7383
|
function u(y, x) {
|
|
7384
7384
|
y.propsReady && Re(y.propsReady, !1);
|
|
7385
7385
|
for (const b of r) {
|
|
7386
|
-
const
|
|
7387
|
-
Re(
|
|
7386
|
+
const k = y[t.required[b]];
|
|
7387
|
+
Re(k, x[b]);
|
|
7388
7388
|
}
|
|
7389
7389
|
for (const b of o)
|
|
7390
7390
|
if (b in x) {
|
|
7391
|
-
const
|
|
7392
|
-
Re(
|
|
7391
|
+
const k = y[t.optional[b]];
|
|
7392
|
+
Re(k, x[b]);
|
|
7393
7393
|
}
|
|
7394
7394
|
y.propsReady && Re(y.propsReady, !0);
|
|
7395
7395
|
}
|
|
7396
7396
|
function l(y) {
|
|
7397
|
-
return s.reduce((x, b) => (x[b] = (
|
|
7398
|
-
const
|
|
7399
|
-
Re(
|
|
7397
|
+
return s.reduce((x, b) => (x[b] = (k) => {
|
|
7398
|
+
const T = y[t.methods[b]];
|
|
7399
|
+
Re(T, k);
|
|
7400
7400
|
}, x), {});
|
|
7401
7401
|
}
|
|
7402
7402
|
function c(y) {
|
|
7403
7403
|
return i.reduce((x, b) => (x[b] = ny(y[t.events[b]]), x), {});
|
|
7404
7404
|
}
|
|
7405
7405
|
const f = Q.forwardRef((y, x) => {
|
|
7406
|
-
const { children: b, ...
|
|
7407
|
-
u(C,
|
|
7408
|
-
})), [
|
|
7406
|
+
const { children: b, ...k } = y, [T] = Q.useState(() => Ss(oy(e), (C) => {
|
|
7407
|
+
u(C, k);
|
|
7408
|
+
})), [v] = Q.useState(Rl(c, T));
|
|
7409
7409
|
vo(() => {
|
|
7410
7410
|
for (const C of i)
|
|
7411
|
-
C in
|
|
7411
|
+
C in k && De(v[C], k[C]);
|
|
7412
7412
|
return () => {
|
|
7413
|
-
Object.values(
|
|
7413
|
+
Object.values(v).map(Zi);
|
|
7414
7414
|
};
|
|
7415
|
-
}, [
|
|
7416
|
-
u(
|
|
7417
|
-
}), Q.useImperativeHandle(x, Il(l(
|
|
7418
|
-
const
|
|
7419
|
-
return /* @__PURE__ */ d.jsx(a.Provider, { value:
|
|
7415
|
+
}, [k, v, T]), vo(() => {
|
|
7416
|
+
u(T, k);
|
|
7417
|
+
}), Q.useImperativeHandle(x, Il(l(T)));
|
|
7418
|
+
const S = n;
|
|
7419
|
+
return /* @__PURE__ */ d.jsx(a.Provider, { value: T, children: n ? /* @__PURE__ */ d.jsx(S, { ...zy([...r, ...o, ...i], k), children: b }) : b });
|
|
7420
7420
|
}), p = (y) => {
|
|
7421
7421
|
const x = Q.useContext(a);
|
|
7422
7422
|
return Q.useCallback(
|
|
@@ -7427,7 +7427,7 @@ function Qu(e, t, n) {
|
|
|
7427
7427
|
);
|
|
7428
7428
|
}, h = (y) => {
|
|
7429
7429
|
const x = Q.useContext(a)[y], b = Q.useCallback(
|
|
7430
|
-
(
|
|
7430
|
+
(k) => De(x, k),
|
|
7431
7431
|
[x]
|
|
7432
7432
|
);
|
|
7433
7433
|
return Q.useSyncExternalStore(
|
|
@@ -7436,10 +7436,10 @@ function Qu(e, t, n) {
|
|
|
7436
7436
|
() => ot(x)
|
|
7437
7437
|
);
|
|
7438
7438
|
}, m = (y) => {
|
|
7439
|
-
const x = Q.useContext(a)[y], [b,
|
|
7439
|
+
const x = Q.useContext(a)[y], [b, k] = Q.useState(Rl(ot, x));
|
|
7440
7440
|
return vo(
|
|
7441
|
-
() => De(x, (
|
|
7442
|
-
|
|
7441
|
+
() => De(x, (T) => {
|
|
7442
|
+
T !== b && k(Il(T));
|
|
7443
7443
|
}),
|
|
7444
7444
|
[x, b]
|
|
7445
7445
|
), b;
|
|
@@ -7521,7 +7521,7 @@ const Zs = "-webkit-sticky", Ll = "sticky", ia = Ju(() => {
|
|
|
7521
7521
|
function aa(e) {
|
|
7522
7522
|
return e;
|
|
7523
7523
|
}
|
|
7524
|
-
const Uy = /* @__PURE__ */
|
|
7524
|
+
const Uy = /* @__PURE__ */ Me(() => {
|
|
7525
7525
|
const e = ne((a) => `Item ${a}`), t = ne((a) => `Group ${a}`), n = ne({}), r = ne(aa), o = ne("div"), s = ne(Nr), i = (a, u = null) => yt(
|
|
7526
7526
|
J(
|
|
7527
7527
|
n,
|
|
@@ -7547,7 +7547,7 @@ const Uy = /* @__PURE__ */ Oe(() => {
|
|
|
7547
7547
|
ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
|
|
7548
7548
|
TopItemListComponent: i("TopItemList")
|
|
7549
7549
|
};
|
|
7550
|
-
}), Hy = /* @__PURE__ */
|
|
7550
|
+
}), Hy = /* @__PURE__ */ Me(
|
|
7551
7551
|
([e, t]) => ({ ...e, ...t }),
|
|
7552
7552
|
He(Zu, Uy)
|
|
7553
7553
|
), Wy = ({ height: e }) => /* @__PURE__ */ d.jsx("div", { style: { height: e } }), Vy = { overflowAnchor: "none", position: ia(), zIndex: 1 }, od = { overflowAnchor: "none" }, Ky = { ...od, display: "inline-block", height: "100%" }, $l = /* @__PURE__ */ Q.memo(function({ showTopList: e = !1 }) {
|
|
@@ -7565,7 +7565,7 @@ const Uy = /* @__PURE__ */ Oe(() => {
|
|
|
7565
7565
|
la("deviation", (E) => {
|
|
7566
7566
|
x !== E && b(E);
|
|
7567
7567
|
});
|
|
7568
|
-
const
|
|
7568
|
+
const k = Ce("EmptyPlaceholder"), T = Ce("ScrollSeekPlaceholder") || Wy, v = Ce("ListComponent"), S = Ce("ItemComponent"), C = Ce("GroupComponent"), R = Ce("computeItemKey"), _ = Ce("isSeeking"), D = Ce("groupIndices").length > 0, $ = Ce("alignToBottom"), F = Ce("initialItemFinalLocationReached"), O = e ? {} : {
|
|
7569
7569
|
boxSizing: "border-box",
|
|
7570
7570
|
...g ? {
|
|
7571
7571
|
display: "inline-block",
|
|
@@ -7581,19 +7581,19 @@ const Uy = /* @__PURE__ */ Oe(() => {
|
|
|
7581
7581
|
},
|
|
7582
7582
|
...F ? {} : { visibility: "hidden" }
|
|
7583
7583
|
};
|
|
7584
|
-
return !e && t.totalCount === 0 &&
|
|
7585
|
-
|
|
7584
|
+
return !e && t.totalCount === 0 && k ? /* @__PURE__ */ d.jsx(k, { ...gt(k, l) }) : /* @__PURE__ */ d.jsx(
|
|
7585
|
+
v,
|
|
7586
7586
|
{
|
|
7587
|
-
...gt(
|
|
7587
|
+
...gt(v, l),
|
|
7588
7588
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
7589
7589
|
ref: y,
|
|
7590
7590
|
style: O,
|
|
7591
7591
|
children: (e ? t.topItems : t.items).map((E) => {
|
|
7592
7592
|
const q = E.originalIndex, B = R(q + t.firstItemIndex, E.data, l);
|
|
7593
7593
|
return _ ? /* @__PURE__ */ No(
|
|
7594
|
-
|
|
7594
|
+
T,
|
|
7595
7595
|
{
|
|
7596
|
-
...gt(
|
|
7596
|
+
...gt(T, l),
|
|
7597
7597
|
height: E.size,
|
|
7598
7598
|
index: E.index,
|
|
7599
7599
|
key: B,
|
|
@@ -7612,10 +7612,10 @@ const Uy = /* @__PURE__ */ Oe(() => {
|
|
|
7612
7612
|
},
|
|
7613
7613
|
c(E.index, l)
|
|
7614
7614
|
) : /* @__PURE__ */ No(
|
|
7615
|
-
|
|
7615
|
+
S,
|
|
7616
7616
|
{
|
|
7617
|
-
...gt(
|
|
7618
|
-
...Xy(
|
|
7617
|
+
...gt(S, l),
|
|
7618
|
+
...Xy(S, E.data),
|
|
7619
7619
|
"data-index": q,
|
|
7620
7620
|
"data-item-group-index": E.groupIndex,
|
|
7621
7621
|
"data-item-index": E.index,
|
|
@@ -7828,7 +7828,7 @@ const Qy = ({ children: e }) => {
|
|
|
7828
7828
|
}
|
|
7829
7829
|
},
|
|
7830
7830
|
nw
|
|
7831
|
-
), ow = /* @__PURE__ */ sd({ useEmitter: la, useEmitterValue: Ce, usePublisher: Ut }), sw = /* @__PURE__ */ id({ useEmitter: la, useEmitterValue: Ce, usePublisher: Ut }), iw = rw, aw = /* @__PURE__ */
|
|
7831
|
+
), ow = /* @__PURE__ */ sd({ useEmitter: la, useEmitterValue: Ce, usePublisher: Ut }), sw = /* @__PURE__ */ id({ useEmitter: la, useEmitterValue: Ce, usePublisher: Ut }), iw = rw, aw = /* @__PURE__ */ Me(() => {
|
|
7832
7832
|
const e = ne((l) => /* @__PURE__ */ d.jsxs("td", { children: [
|
|
7833
7833
|
"Item $",
|
|
7834
7834
|
l
|
|
@@ -7898,17 +7898,17 @@ function So(e, t) {
|
|
|
7898
7898
|
function uw(e, t) {
|
|
7899
7899
|
return e && e.column === t.column && e.row === t.row;
|
|
7900
7900
|
}
|
|
7901
|
-
const dw = /* @__PURE__ */
|
|
7901
|
+
const dw = /* @__PURE__ */ Me(
|
|
7902
7902
|
([
|
|
7903
7903
|
{ increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
|
|
7904
7904
|
{ footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: u, scrollTop: l, smoothScrollTargetReached: c, viewportHeight: f },
|
|
7905
7905
|
p,
|
|
7906
7906
|
h,
|
|
7907
7907
|
{ didMount: m, propsReady: g },
|
|
7908
|
-
{ customScrollParent: y, useWindowScroll: x, windowScrollContainerState: b, windowScrollTo:
|
|
7909
|
-
|
|
7908
|
+
{ customScrollParent: y, useWindowScroll: x, windowScrollContainerState: b, windowScrollTo: k, windowViewportRect: T },
|
|
7909
|
+
v
|
|
7910
7910
|
]) => {
|
|
7911
|
-
const
|
|
7911
|
+
const S = ne(0), C = ne(0), R = ne(Fl), _ = ne({ height: 0, width: 0 }), D = ne({ height: 0, width: 0 }), $ = Pe(), F = Pe(), O = ne(0), E = ne(null), q = ne({ column: 0, row: 0 }), B = Pe(), re = Pe(), V = ne(!1), W = ne(0), ee = ne(!0), U = ne(!1), P = ne(!1);
|
|
7912
7912
|
De(
|
|
7913
7913
|
J(
|
|
7914
7914
|
m,
|
|
@@ -7973,7 +7973,7 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
7973
7973
|
), fe(
|
|
7974
7974
|
J(
|
|
7975
7975
|
it(
|
|
7976
|
-
ye(
|
|
7976
|
+
ye(S),
|
|
7977
7977
|
r,
|
|
7978
7978
|
ye(q, uw),
|
|
7979
7979
|
ye(D, So),
|
|
@@ -8020,7 +8020,7 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
8020
8020
|
we((j) => j !== null),
|
|
8021
8021
|
se((j) => j.length)
|
|
8022
8022
|
),
|
|
8023
|
-
|
|
8023
|
+
S
|
|
8024
8024
|
), fe(
|
|
8025
8025
|
J(
|
|
8026
8026
|
it(_, D, R, q),
|
|
@@ -8044,7 +8044,7 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
8044
8044
|
);
|
|
8045
8045
|
const L = Dt(
|
|
8046
8046
|
J(
|
|
8047
|
-
it(R,
|
|
8047
|
+
it(R, S),
|
|
8048
8048
|
we(([{ items: j }]) => j.length > 0),
|
|
8049
8049
|
Ee(N),
|
|
8050
8050
|
we(([[j, K], X]) => {
|
|
@@ -8077,7 +8077,7 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
8077
8077
|
fe(G, h.scrollSeekRangeChanged), fe(
|
|
8078
8078
|
J(
|
|
8079
8079
|
$,
|
|
8080
|
-
Ee(_, D,
|
|
8080
|
+
Ee(_, D, S, q),
|
|
8081
8081
|
se(([j, K, X, oe, he]) => {
|
|
8082
8082
|
const ve = Wu(j), { align: _e, behavior: Ae, offset: We } = ve;
|
|
8083
8083
|
let Qe = ve.index;
|
|
@@ -8097,7 +8097,7 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
8097
8097
|
);
|
|
8098
8098
|
return fe(
|
|
8099
8099
|
J(
|
|
8100
|
-
|
|
8100
|
+
T,
|
|
8101
8101
|
se((j) => ({ height: j.visibleHeight, width: j.visibleWidth }))
|
|
8102
8102
|
),
|
|
8103
8103
|
_
|
|
@@ -8121,12 +8121,12 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
8121
8121
|
scrollToIndex: $,
|
|
8122
8122
|
scrollTop: l,
|
|
8123
8123
|
smoothScrollTargetReached: c,
|
|
8124
|
-
totalCount:
|
|
8124
|
+
totalCount: S,
|
|
8125
8125
|
useWindowScroll: x,
|
|
8126
8126
|
viewportDimensions: _,
|
|
8127
8127
|
windowScrollContainerState: b,
|
|
8128
|
-
windowScrollTo:
|
|
8129
|
-
windowViewportRect:
|
|
8128
|
+
windowScrollTo: k,
|
|
8129
|
+
windowViewportRect: T,
|
|
8130
8130
|
...h,
|
|
8131
8131
|
// output
|
|
8132
8132
|
gridState: R,
|
|
@@ -8140,7 +8140,7 @@ const dw = /* @__PURE__ */ Oe(
|
|
|
8140
8140
|
startReached: M,
|
|
8141
8141
|
stateChanged: B,
|
|
8142
8142
|
stateRestoreInProgress: V,
|
|
8143
|
-
...
|
|
8143
|
+
...v
|
|
8144
8144
|
};
|
|
8145
8145
|
},
|
|
8146
8146
|
He(oa, St, po, Xu, Dn, sa, On)
|
|
@@ -8159,7 +8159,7 @@ function Ri(e, t, n, r) {
|
|
|
8159
8159
|
const o = ad(e.width, n.width, t.column), s = ts(r / o), i = s * n.height + Hr(0, s - 1) * t.row;
|
|
8160
8160
|
return i > 0 ? i + t.row : i;
|
|
8161
8161
|
}
|
|
8162
|
-
const fw = /* @__PURE__ */
|
|
8162
|
+
const fw = /* @__PURE__ */ Me(() => {
|
|
8163
8163
|
const e = ne((f) => `Item ${f}`), t = ne({}), n = ne(null), r = ne("virtuoso-grid-item"), o = ne("virtuoso-grid-list"), s = ne(aa), i = ne("div"), a = ne(Nr), u = (f, p = null) => yt(
|
|
8164
8164
|
J(
|
|
8165
8165
|
t,
|
|
@@ -8186,7 +8186,7 @@ const fw = /* @__PURE__ */ Oe(() => {
|
|
|
8186
8186
|
scrollerRef: a,
|
|
8187
8187
|
ScrollSeekPlaceholder: u("ScrollSeekPlaceholder", "div")
|
|
8188
8188
|
};
|
|
8189
|
-
}), pw = /* @__PURE__ */
|
|
8189
|
+
}), pw = /* @__PURE__ */ Me(
|
|
8190
8190
|
([e, t]) => ({ ...e, ...t }),
|
|
8191
8191
|
He(dw, fw)
|
|
8192
8192
|
), hw = /* @__PURE__ */ Q.memo(function() {
|
|
@@ -8195,10 +8195,10 @@ const fw = /* @__PURE__ */ Oe(() => {
|
|
|
8195
8195
|
() => (x) => {
|
|
8196
8196
|
const b = x.parentElement.parentElement.scrollHeight;
|
|
8197
8197
|
i(b);
|
|
8198
|
-
const
|
|
8199
|
-
if (
|
|
8200
|
-
const { height:
|
|
8201
|
-
f({ height:
|
|
8198
|
+
const k = x.firstChild;
|
|
8199
|
+
if (k) {
|
|
8200
|
+
const { height: T, width: v } = k.getBoundingClientRect();
|
|
8201
|
+
f({ height: T, width: v });
|
|
8202
8202
|
}
|
|
8203
8203
|
p({
|
|
8204
8204
|
column: Wl("column-gap", getComputedStyle(x).columnGap, h),
|
|
@@ -8467,7 +8467,7 @@ function Iw(e) {
|
|
|
8467
8467
|
return null;
|
|
8468
8468
|
}
|
|
8469
8469
|
function cd(e) {
|
|
8470
|
-
return
|
|
8470
|
+
return Oe(() => {
|
|
8471
8471
|
const t = e.content.filter(
|
|
8472
8472
|
(l) => l.type === "text"
|
|
8473
8473
|
);
|
|
@@ -8528,7 +8528,7 @@ function Rw({
|
|
|
8528
8528
|
return E ? x(E) : null;
|
|
8529
8529
|
}
|
|
8530
8530
|
return x(g);
|
|
8531
|
-
},
|
|
8531
|
+
}, k = () => (m == null ? void 0 : m.kind) === "dict" ? x(m.data) : b(), v = (() => {
|
|
8532
8532
|
if (!a)
|
|
8533
8533
|
return;
|
|
8534
8534
|
if (l.name) {
|
|
@@ -8543,7 +8543,7 @@ function Rw({
|
|
|
8543
8543
|
return q;
|
|
8544
8544
|
}
|
|
8545
8545
|
return a.default;
|
|
8546
|
-
})(),
|
|
8546
|
+
})(), S = k(), C = !o || t === "expanded", R = (C ? v == null ? void 0 : v({
|
|
8547
8547
|
message: e,
|
|
8548
8548
|
toolMeta: l,
|
|
8549
8549
|
toolPayload: m,
|
|
@@ -8564,7 +8564,7 @@ function Rw({
|
|
|
8564
8564
|
message: e,
|
|
8565
8565
|
toolPayload: m,
|
|
8566
8566
|
isStreaming: n
|
|
8567
|
-
}) : null, F = R ??
|
|
8567
|
+
}) : null, F = R ?? S, O = D ? $ : null;
|
|
8568
8568
|
return /* @__PURE__ */ d.jsxs("div", { className: "space-y-2", children: [
|
|
8569
8569
|
n && /* @__PURE__ */ d.jsx(
|
|
8570
8570
|
Sw,
|
|
@@ -9040,17 +9040,17 @@ class ca {
|
|
|
9040
9040
|
const b = new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);
|
|
9041
9041
|
for (; t && (m = !1, !(!(n = b.exec(t)) || this.rules.block.hr.test(t))); ) {
|
|
9042
9042
|
if (r = n[0], t = t.substring(r.length), c = n[2].split(`
|
|
9043
|
-
`, 1)[0].replace(/^\t+/, (
|
|
9043
|
+
`, 1)[0].replace(/^\t+/, (T) => " ".repeat(3 * T.length)), f = t.split(`
|
|
9044
9044
|
`, 1)[0], this.options.pedantic ? (i = 2, h = c.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, h = c.slice(i), i += n[1].length), u = !1, !c && /^ *$/.test(f) && (r += f + `
|
|
9045
9045
|
`, t = t.substring(f.length + 1), m = !0), !m) {
|
|
9046
|
-
const
|
|
9046
|
+
const T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), v = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), S = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
|
|
9047
9047
|
for (; t && (p = t.split(`
|
|
9048
|
-
`, 1)[0], f = p, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(
|
|
9048
|
+
`, 1)[0], f = p, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(S.test(f) || C.test(f) || T.test(f) || v.test(t))); ) {
|
|
9049
9049
|
if (f.search(/[^ ]/) >= i || !f.trim())
|
|
9050
9050
|
h += `
|
|
9051
9051
|
` + f.slice(i);
|
|
9052
9052
|
else {
|
|
9053
|
-
if (u || c.search(/[^ ]/) >= 4 ||
|
|
9053
|
+
if (u || c.search(/[^ ]/) >= 4 || S.test(c) || C.test(c) || v.test(c))
|
|
9054
9054
|
break;
|
|
9055
9055
|
h += `
|
|
9056
9056
|
` + f;
|
|
@@ -9069,14 +9069,14 @@ class ca {
|
|
|
9069
9069
|
}), x.raw += r;
|
|
9070
9070
|
}
|
|
9071
9071
|
x.items[x.items.length - 1].raw = r.trimRight(), x.items[x.items.length - 1].text = h.trimRight(), x.raw = x.raw.trimRight();
|
|
9072
|
-
const
|
|
9073
|
-
for (a = 0; a <
|
|
9072
|
+
const k = x.items.length;
|
|
9073
|
+
for (a = 0; a < k; a++)
|
|
9074
9074
|
if (this.lexer.state.top = !1, x.items[a].tokens = this.lexer.blockTokens(x.items[a].text, []), !x.loose) {
|
|
9075
|
-
const
|
|
9076
|
-
x.loose =
|
|
9075
|
+
const T = x.items[a].tokens.filter((S) => S.type === "space"), v = T.length > 0 && T.some((S) => /\n.*\n/.test(S.raw));
|
|
9076
|
+
x.loose = v;
|
|
9077
9077
|
}
|
|
9078
9078
|
if (x.loose)
|
|
9079
|
-
for (a = 0; a <
|
|
9079
|
+
for (a = 0; a < k; a++)
|
|
9080
9080
|
x.items[a].loose = !0;
|
|
9081
9081
|
return x;
|
|
9082
9082
|
}
|
|
@@ -9952,11 +9952,11 @@ class An {
|
|
|
9952
9952
|
* Parse Loop
|
|
9953
9953
|
*/
|
|
9954
9954
|
parse(t, n = !0) {
|
|
9955
|
-
let r = "", o, s, i, a, u, l, c, f, p, h, m, g, y, x, b, T,
|
|
9955
|
+
let r = "", o, s, i, a, u, l, c, f, p, h, m, g, y, x, b, k, T, v, S;
|
|
9956
9956
|
const C = t.length;
|
|
9957
9957
|
for (o = 0; o < C; o++) {
|
|
9958
|
-
if (h = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[h.type] && (
|
|
9959
|
-
r +=
|
|
9958
|
+
if (h = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[h.type] && (S = this.options.extensions.renderers[h.type].call({ parser: this }, h), S !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(h.type))) {
|
|
9959
|
+
r += S || "";
|
|
9960
9960
|
continue;
|
|
9961
9961
|
}
|
|
9962
9962
|
switch (h.type) {
|
|
@@ -10006,10 +10006,10 @@ class An {
|
|
|
10006
10006
|
}
|
|
10007
10007
|
case "list": {
|
|
10008
10008
|
for (m = h.ordered, g = h.start, y = h.loose, a = h.items.length, p = "", s = 0; s < a; s++)
|
|
10009
|
-
b = h.items[s],
|
|
10009
|
+
b = h.items[s], k = b.checked, T = b.task, x = "", b.task && (v = this.renderer.checkbox(k), y ? b.tokens.length > 0 && b.tokens[0].type === "paragraph" ? (b.tokens[0].text = v + " " + b.tokens[0].text, b.tokens[0].tokens && b.tokens[0].tokens.length > 0 && b.tokens[0].tokens[0].type === "text" && (b.tokens[0].tokens[0].text = v + " " + b.tokens[0].tokens[0].text)) : b.tokens.unshift({
|
|
10010
10010
|
type: "text",
|
|
10011
|
-
text:
|
|
10012
|
-
}) : x +=
|
|
10011
|
+
text: v
|
|
10012
|
+
}) : x += v), x += this.parse(b.tokens, y), p += this.renderer.listitem(x, T, k);
|
|
10013
10013
|
r += this.renderer.list(p, m, g);
|
|
10014
10014
|
continue;
|
|
10015
10015
|
}
|
|
@@ -10326,7 +10326,7 @@ function Bo({
|
|
|
10326
10326
|
allowHtml: n = !1,
|
|
10327
10327
|
style: r
|
|
10328
10328
|
}) {
|
|
10329
|
-
const o =
|
|
10329
|
+
const o = Oe(() => {
|
|
10330
10330
|
if (!e || typeof e != "string" || e.trim().length === 0)
|
|
10331
10331
|
return "";
|
|
10332
10332
|
try {
|
|
@@ -10338,7 +10338,7 @@ function Bo({
|
|
|
10338
10338
|
} catch (i) {
|
|
10339
10339
|
return console.error("[MarkdownContent] parse error", i), `<pre class="font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words">Error rendering markdown: ${String(i)}</pre>`;
|
|
10340
10340
|
}
|
|
10341
|
-
}, [e, n]), s =
|
|
10341
|
+
}, [e, n]), s = Oe(() => {
|
|
10342
10342
|
const i = {
|
|
10343
10343
|
color: "currentColor",
|
|
10344
10344
|
...r
|
|
@@ -10468,10 +10468,10 @@ function Cd({
|
|
|
10468
10468
|
showCheckpointControls: y,
|
|
10469
10469
|
attemptCount: x,
|
|
10470
10470
|
attemptIndex: b,
|
|
10471
|
-
handleOlderAttemptSelect:
|
|
10472
|
-
handleNewerAttemptSelect:
|
|
10473
|
-
messageCreatedAt:
|
|
10474
|
-
copied:
|
|
10471
|
+
handleOlderAttemptSelect: k,
|
|
10472
|
+
handleNewerAttemptSelect: T,
|
|
10473
|
+
messageCreatedAt: v,
|
|
10474
|
+
copied: S
|
|
10475
10475
|
}) {
|
|
10476
10476
|
return !e && !t && !n && !r ? null : /* @__PURE__ */ d.jsxs(
|
|
10477
10477
|
"div",
|
|
@@ -10513,7 +10513,7 @@ function Cd({
|
|
|
10513
10513
|
b < x - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
10514
10514
|
),
|
|
10515
10515
|
onClick: () => {
|
|
10516
|
-
b >= x - 1 ||
|
|
10516
|
+
b >= x - 1 || k();
|
|
10517
10517
|
},
|
|
10518
10518
|
"aria-label": "Older attempt (back in time)",
|
|
10519
10519
|
disabled: b >= x - 1,
|
|
@@ -10534,7 +10534,7 @@ function Cd({
|
|
|
10534
10534
|
b > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
10535
10535
|
),
|
|
10536
10536
|
onClick: () => {
|
|
10537
|
-
b <= 0 ||
|
|
10537
|
+
b <= 0 || T();
|
|
10538
10538
|
},
|
|
10539
10539
|
"aria-label": "Newer attempt (forward in time)",
|
|
10540
10540
|
disabled: b <= 0,
|
|
@@ -10542,13 +10542,13 @@ function Cd({
|
|
|
10542
10542
|
}
|
|
10543
10543
|
)
|
|
10544
10544
|
] }),
|
|
10545
|
-
e &&
|
|
10545
|
+
e && v && /* @__PURE__ */ d.jsx(
|
|
10546
10546
|
"time",
|
|
10547
10547
|
{
|
|
10548
10548
|
className: de("text-xs opacity-60", o, l && "text-xs"),
|
|
10549
|
-
dateTime: new Date(
|
|
10550
|
-
title: new Date(
|
|
10551
|
-
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(
|
|
10549
|
+
dateTime: new Date(v.endsWith("Z") || v.includes("+") ? v : `${v}Z`).toISOString(),
|
|
10550
|
+
title: new Date(v.endsWith("Z") || v.includes("+") ? v : `${v}Z`).toLocaleString(),
|
|
10551
|
+
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(v.endsWith("Z") || v.includes("+") ? v : `${v}Z`))
|
|
10552
10552
|
}
|
|
10553
10553
|
),
|
|
10554
10554
|
c && !f && /* @__PURE__ */ d.jsxs(
|
|
@@ -10569,7 +10569,7 @@ function Cd({
|
|
|
10569
10569
|
className: de("h-6 w-6 p-0 hover:bg-foreground/10", o, l && "h-5 w-5"),
|
|
10570
10570
|
"aria-label": "Copy message",
|
|
10571
10571
|
title: "Copy message",
|
|
10572
|
-
children: /* @__PURE__ */ d.jsx(Ih, { className: de(
|
|
10572
|
+
children: /* @__PURE__ */ d.jsx(Ih, { className: de(S ? "text-success" : o, l ? "h-3 w-3" : "h-4 w-4") })
|
|
10573
10573
|
}
|
|
10574
10574
|
) }),
|
|
10575
10575
|
p === "user" && m && /* @__PURE__ */ d.jsx(
|
|
@@ -10603,7 +10603,7 @@ function Cd({
|
|
|
10603
10603
|
);
|
|
10604
10604
|
}
|
|
10605
10605
|
function da(e) {
|
|
10606
|
-
return
|
|
10606
|
+
return Oe(() => ({
|
|
10607
10607
|
textContent: rx(e),
|
|
10608
10608
|
imageParts: ox(e),
|
|
10609
10609
|
fileParts: sx(e),
|
|
@@ -10652,28 +10652,28 @@ const Is = no(function({
|
|
|
10652
10652
|
t,
|
|
10653
10653
|
g && h,
|
|
10654
10654
|
y
|
|
10655
|
-
), b =
|
|
10655
|
+
), b = Oe(
|
|
10656
10656
|
() => x.filter((F) => F.type === "text"),
|
|
10657
10657
|
[x]
|
|
10658
|
-
),
|
|
10658
|
+
), k = Oe(
|
|
10659
10659
|
() => b.map((F) => F.text ?? "").join(""),
|
|
10660
10660
|
[b]
|
|
10661
|
-
),
|
|
10662
|
-
if (!
|
|
10661
|
+
), T = m && h, v = Oe(() => {
|
|
10662
|
+
if (!T)
|
|
10663
10663
|
return null;
|
|
10664
|
-
const F = Qw(
|
|
10664
|
+
const F = Qw(k);
|
|
10665
10665
|
return {
|
|
10666
|
-
stablePart:
|
|
10667
|
-
tailPart:
|
|
10666
|
+
stablePart: k.slice(0, F),
|
|
10667
|
+
tailPart: k.slice(F)
|
|
10668
10668
|
};
|
|
10669
|
-
}, [
|
|
10670
|
-
if (!
|
|
10671
|
-
const { stablePart: F, tailPart: O } =
|
|
10669
|
+
}, [k, T]), S = Oe(() => {
|
|
10670
|
+
if (!v) return null;
|
|
10671
|
+
const { stablePart: F, tailPart: O } = v;
|
|
10672
10672
|
return !F && !O ? null : /* @__PURE__ */ d.jsxs("div", { className: "space-y-2", children: [
|
|
10673
10673
|
F ? /* @__PURE__ */ d.jsx(Bo, { content: F, allowHtml: !1 }) : null,
|
|
10674
10674
|
O ? /* @__PURE__ */ d.jsx(Bo, { content: O, allowHtml: !1 }) : null
|
|
10675
10675
|
] });
|
|
10676
|
-
}, [
|
|
10676
|
+
}, [v]), C = () => !r || r.length === 0 ? null : /* @__PURE__ */ d.jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: r.map((F, O) => {
|
|
10677
10677
|
const E = F;
|
|
10678
10678
|
return /* @__PURE__ */ d.jsx("div", { className: "relative group", children: /* @__PURE__ */ d.jsx(
|
|
10679
10679
|
"img",
|
|
@@ -10722,11 +10722,11 @@ const Is = no(function({
|
|
|
10722
10722
|
);
|
|
10723
10723
|
}
|
|
10724
10724
|
return null;
|
|
10725
|
-
}, _ =
|
|
10725
|
+
}, _ = T ? k : n;
|
|
10726
10726
|
if (!(_.trim().length > 0 || r.length > 0 || o.length > 0) && !h) return null;
|
|
10727
|
-
const $ =
|
|
10727
|
+
const $ = T ? x.filter((F) => F.type !== "text") : x;
|
|
10728
10728
|
return /* @__PURE__ */ d.jsxs("div", { className: "space-y-2", children: [
|
|
10729
|
-
|
|
10729
|
+
T ? S : null,
|
|
10730
10730
|
$.filter((F) => F.type === "text" || F.type === "file").map((F, O) => R(F, O)),
|
|
10731
10731
|
C(),
|
|
10732
10732
|
h && _.trim().length > 0 && /* @__PURE__ */ d.jsx(
|
|
@@ -10764,26 +10764,26 @@ const Td = no(function({
|
|
|
10764
10764
|
onSelectCheckpoint: u,
|
|
10765
10765
|
customStyles: l = {}
|
|
10766
10766
|
}) {
|
|
10767
|
-
const [c, f] = ce(!1), [p, h] = ce(!1), m = n === "phone" || n === "half-screen", { contentParts: g, textContent: y, imageParts: x, fileParts: b } = da(t),
|
|
10767
|
+
const [c, f] = ce(!1), [p, h] = ce(!1), m = n === "phone" || n === "half-screen", { contentParts: g, textContent: y, imageParts: x, fileParts: b } = da(t), k = ie(async () => {
|
|
10768
10768
|
try {
|
|
10769
10769
|
await navigator.clipboard.writeText(y), f(!0), setTimeout(() => f(!1), 2e3);
|
|
10770
10770
|
} catch (O) {
|
|
10771
10771
|
console.error("Failed to copy user message:", O);
|
|
10772
10772
|
}
|
|
10773
|
-
}, [y]),
|
|
10773
|
+
}, [y]), T = ie(() => {
|
|
10774
10774
|
if (!i || !t.id) return;
|
|
10775
10775
|
const O = {
|
|
10776
10776
|
checkpointId: t.checkpointId ?? null,
|
|
10777
10777
|
checkpointNs: t.checkpointNs ?? null
|
|
10778
10778
|
};
|
|
10779
10779
|
i(t.id, y, O);
|
|
10780
|
-
}, [i, t, y]), { attemptCount:
|
|
10781
|
-
const O = C[
|
|
10780
|
+
}, [i, t, y]), { attemptCount: v, attemptIndex: S, attempts: C } = Oe(() => a ? _x(t.id, t.checkpointId, a) : { attemptCount: 1, attemptIndex: 0, attempts: [] }, [t.id, t.checkpointId, a]), R = v > 1 && !!u, _ = ie(() => {
|
|
10781
|
+
const O = C[S + 1];
|
|
10782
10782
|
O && u && u(O.id, void 0, !!O.isLatestAttempt);
|
|
10783
|
-
}, [C,
|
|
10784
|
-
const O = C[
|
|
10783
|
+
}, [C, S, u]), D = ie(() => {
|
|
10784
|
+
const O = C[S - 1];
|
|
10785
10785
|
O && u && u(O.id, void 0, !!O.isLatestAttempt);
|
|
10786
|
-
}, [C,
|
|
10786
|
+
}, [C, S, u]), $ = /* @__PURE__ */ d.jsx(
|
|
10787
10787
|
Cd,
|
|
10788
10788
|
{
|
|
10789
10789
|
showTimestamp: !0,
|
|
@@ -10796,11 +10796,11 @@ const Td = no(function({
|
|
|
10796
10796
|
showActions: !0,
|
|
10797
10797
|
isEditing: !1,
|
|
10798
10798
|
messageRole: "user",
|
|
10799
|
-
onCopy:
|
|
10800
|
-
onEdit: s ?
|
|
10799
|
+
onCopy: k,
|
|
10800
|
+
onEdit: s ? T : void 0,
|
|
10801
10801
|
showCheckpointControls: R,
|
|
10802
|
-
attemptCount:
|
|
10803
|
-
attemptIndex:
|
|
10802
|
+
attemptCount: v,
|
|
10803
|
+
attemptIndex: S,
|
|
10804
10804
|
handleOlderAttemptSelect: _,
|
|
10805
10805
|
handleNewerAttemptSelect: D,
|
|
10806
10806
|
messageCreatedAt: t.createdAt,
|
|
@@ -10916,8 +10916,8 @@ const Ai = no(function({
|
|
|
10916
10916
|
isEmbedded: g = !1
|
|
10917
10917
|
}) {
|
|
10918
10918
|
var W;
|
|
10919
|
-
const [y, x] = ce(!1), { respondToInterrupt: b } = bs(), [
|
|
10920
|
-
contentParts:
|
|
10919
|
+
const [y, x] = ce(!1), { respondToInterrupt: b } = bs(), [k, T] = ce(!1), v = a === "phone" || a === "half-screen", {
|
|
10920
|
+
contentParts: S,
|
|
10921
10921
|
textContent: C,
|
|
10922
10922
|
imageParts: R,
|
|
10923
10923
|
fileParts: _,
|
|
@@ -10932,12 +10932,12 @@ const Ai = no(function({
|
|
|
10932
10932
|
}, [C, p]), O = ie(
|
|
10933
10933
|
async (ee, U) => {
|
|
10934
10934
|
if (!(!$ || !mu($.id))) {
|
|
10935
|
-
|
|
10935
|
+
T(!0);
|
|
10936
10936
|
try {
|
|
10937
10937
|
const N = h == null ? void 0 : h(t);
|
|
10938
10938
|
await b(ee, U, N);
|
|
10939
10939
|
} finally {
|
|
10940
|
-
|
|
10940
|
+
T(!1);
|
|
10941
10941
|
}
|
|
10942
10942
|
}
|
|
10943
10943
|
},
|
|
@@ -10954,7 +10954,7 @@ const Ai = no(function({
|
|
|
10954
10954
|
iconForeground: "text-[hsl(var(--chat-bubble-ai-text))]",
|
|
10955
10955
|
agentName: t.name || t.model || "Agent",
|
|
10956
10956
|
messageIcon: t.role === "tool" ? /* @__PURE__ */ d.jsx(_h, { className: "h-4 w-4 opacity-60" }) : /* @__PURE__ */ d.jsx(Ph, { className: "h-4 w-4 opacity-60" }),
|
|
10957
|
-
isCompactLayout:
|
|
10957
|
+
isCompactLayout: v,
|
|
10958
10958
|
showActions: !0,
|
|
10959
10959
|
isEditing: !1,
|
|
10960
10960
|
messageRole: t.role,
|
|
@@ -10994,12 +10994,12 @@ const Ai = no(function({
|
|
|
10994
10994
|
/* @__PURE__ */ d.jsx(
|
|
10995
10995
|
Is,
|
|
10996
10996
|
{
|
|
10997
|
-
contentParts:
|
|
10997
|
+
contentParts: S,
|
|
10998
10998
|
textContent: C,
|
|
10999
10999
|
imageParts: R,
|
|
11000
11000
|
fileParts: _,
|
|
11001
11001
|
messageRole: t.role,
|
|
11002
|
-
isCompactLayout:
|
|
11002
|
+
isCompactLayout: v,
|
|
11003
11003
|
isStreamingMessage: r,
|
|
11004
11004
|
renderStreamingMarkdown: s,
|
|
11005
11005
|
enableStreamingMarkdownBuffer: i,
|
|
@@ -11016,7 +11016,7 @@ const Ai = no(function({
|
|
|
11016
11016
|
handleInterruptApprove: () => O(!0),
|
|
11017
11017
|
handleInterruptReject: () => O(!1),
|
|
11018
11018
|
handleInterruptAlternative: (ee, U) => O(!0, { alternativeId: U == null ? void 0 : U.id }),
|
|
11019
|
-
disableInterruptActions:
|
|
11019
|
+
disableInterruptActions: k,
|
|
11020
11020
|
renderArtifactsInline: m,
|
|
11021
11021
|
iconForeground: "text-[hsl(var(--chat-bubble-ai-text))]",
|
|
11022
11022
|
textContent: C
|
|
@@ -11030,7 +11030,7 @@ const Ai = no(function({
|
|
|
11030
11030
|
role: t.role,
|
|
11031
11031
|
header: q,
|
|
11032
11032
|
content: V,
|
|
11033
|
-
isCompactLayout:
|
|
11033
|
+
isCompactLayout: v,
|
|
11034
11034
|
customStyles: c
|
|
11035
11035
|
}
|
|
11036
11036
|
);
|
|
@@ -11144,21 +11144,21 @@ function ck(e) {
|
|
|
11144
11144
|
return;
|
|
11145
11145
|
}
|
|
11146
11146
|
try {
|
|
11147
|
-
const
|
|
11148
|
-
if (
|
|
11147
|
+
const k = String(g.url ?? ""), T = k.match(/\/chat\/files\/([^/]+)(?:\/(view|download))?/);
|
|
11148
|
+
if (T) {
|
|
11149
11149
|
m.preventDefault();
|
|
11150
|
-
const
|
|
11151
|
-
p({ id:
|
|
11150
|
+
const v = T[1], S = g.name || `file_${v}`, C = g.mimeType || "application/octet-stream";
|
|
11151
|
+
p({ id: v, name: S, mimeType: C });
|
|
11152
11152
|
return;
|
|
11153
11153
|
}
|
|
11154
|
-
if (
|
|
11155
|
-
m.preventDefault(), i((
|
|
11156
|
-
const
|
|
11154
|
+
if (k.startsWith("data:")) {
|
|
11155
|
+
m.preventDefault(), i((S) => ({ ...S, [y]: !0 }));
|
|
11156
|
+
const v = o({ title: "Fetching file...", description: "", open: !0 });
|
|
11157
11157
|
try {
|
|
11158
|
-
const
|
|
11159
|
-
if (!
|
|
11158
|
+
const S = await r.listFiles(n ?? void 0);
|
|
11159
|
+
if (!S || !Array.isArray(S))
|
|
11160
11160
|
throw new Error("Invalid file list response");
|
|
11161
|
-
const C =
|
|
11161
|
+
const C = S.find((R) => !R || typeof R != "object" || !((R.filename ?? "") === (g.name ?? "")) ? !1 : typeof g.size == "number" && typeof R.size == "number" ? R.size === g.size : !0);
|
|
11162
11162
|
if (!(C != null && C.id))
|
|
11163
11163
|
throw new Error(`File "${g.name}" is not yet available on the server`);
|
|
11164
11164
|
if (!C.id || !C.filename)
|
|
@@ -11167,26 +11167,26 @@ function ck(e) {
|
|
|
11167
11167
|
id: C.id,
|
|
11168
11168
|
name: g.name || C.filename || `file_${C.id}`,
|
|
11169
11169
|
mimeType: g.mimeType || C.mime_type || "application/octet-stream"
|
|
11170
|
-
}), (x =
|
|
11171
|
-
id:
|
|
11170
|
+
}), (x = v.update) == null || x.call(v, {
|
|
11171
|
+
id: v.id,
|
|
11172
11172
|
title: "Success",
|
|
11173
11173
|
description: `Opened ${g.name}`,
|
|
11174
11174
|
open: !0
|
|
11175
11175
|
});
|
|
11176
|
-
} catch (
|
|
11177
|
-
console.error("Failed to fetch server file:",
|
|
11178
|
-
const C =
|
|
11179
|
-
(b =
|
|
11176
|
+
} catch (S) {
|
|
11177
|
+
console.error("Failed to fetch server file:", S);
|
|
11178
|
+
const C = S instanceof Error ? S.message : "Unknown error occurred";
|
|
11179
|
+
(b = v.update) == null || b.call(v, { id: v.id, title: "Failed", description: C }), o({
|
|
11180
11180
|
title: "Failed to fetch file",
|
|
11181
11181
|
description: C,
|
|
11182
11182
|
open: !0
|
|
11183
11183
|
});
|
|
11184
11184
|
} finally {
|
|
11185
|
-
i((
|
|
11185
|
+
i((S) => ({ ...S, [y]: !1 }));
|
|
11186
11186
|
}
|
|
11187
11187
|
}
|
|
11188
|
-
} catch (
|
|
11189
|
-
console.error("File click error:",
|
|
11188
|
+
} catch (k) {
|
|
11189
|
+
console.error("File click error:", k), i((T) => ({ ...T, [y]: !1 }));
|
|
11190
11190
|
}
|
|
11191
11191
|
},
|
|
11192
11192
|
[t, s, o, n, p]
|
|
@@ -11200,7 +11200,7 @@ function ck(e) {
|
|
|
11200
11200
|
};
|
|
11201
11201
|
}
|
|
11202
11202
|
function uk(e) {
|
|
11203
|
-
return
|
|
11203
|
+
return Oe(() => {
|
|
11204
11204
|
const t = e;
|
|
11205
11205
|
let n = Array.isArray(t.content) ? t.content : [];
|
|
11206
11206
|
typeof t.content == "string" && (n = [{ type: "text", text: t.content }]);
|
|
@@ -11232,7 +11232,7 @@ function ib({
|
|
|
11232
11232
|
onEvent: f,
|
|
11233
11233
|
activeThreadId: p
|
|
11234
11234
|
}) {
|
|
11235
|
-
const { messages: h } = ku(), [m, g] = ce(null), [y, x] = ce(""), [b,
|
|
11235
|
+
const { messages: h } = ku(), [m, g] = ce(null), [y, x] = ce(""), [b, k] = ce(null), [T, v] = ce(null), [S, C] = ce(!1), [R, _] = ce(""), D = ke(R), $ = ke(null);
|
|
11236
11236
|
ze(() => {
|
|
11237
11237
|
if (!m)
|
|
11238
11238
|
if (p) {
|
|
@@ -11298,10 +11298,10 @@ function ib({
|
|
|
11298
11298
|
config: t.config,
|
|
11299
11299
|
onEvent: f
|
|
11300
11300
|
}
|
|
11301
|
-
), o == null || o(G), l(!0), p && localStorage.removeItem(qs(p)), F(""),
|
|
11301
|
+
), o == null || o(G), l(!0), p && localStorage.removeItem(qs(p)), F(""), v(null), g(null), x(""), k(null);
|
|
11302
11302
|
} catch (Z) {
|
|
11303
11303
|
const j = (Z == null ? void 0 : Z.message) || "Failed to send message";
|
|
11304
|
-
|
|
11304
|
+
v(j), i == null || i(j), l(!1);
|
|
11305
11305
|
}
|
|
11306
11306
|
}, q = (U, P) => {
|
|
11307
11307
|
P || E(U, { files: [] });
|
|
@@ -11324,14 +11324,14 @@ function ib({
|
|
|
11324
11324
|
[n, r, t, s, e]
|
|
11325
11325
|
), re = ie(
|
|
11326
11326
|
(U, P, N) => {
|
|
11327
|
-
a && ($.current = R, g(U), x(P),
|
|
11327
|
+
a && ($.current = R, g(U), x(P), k({
|
|
11328
11328
|
checkpointId: (N == null ? void 0 : N.checkpointId) ?? null,
|
|
11329
11329
|
checkpointNs: (N == null ? void 0 : N.checkpointNs) ?? null
|
|
11330
|
-
}),
|
|
11330
|
+
}), v(null));
|
|
11331
11331
|
},
|
|
11332
11332
|
[R, a]
|
|
11333
11333
|
), V = ie(() => {
|
|
11334
|
-
g(null), x(""),
|
|
11334
|
+
g(null), x(""), k(null), v(null);
|
|
11335
11335
|
const U = $.current;
|
|
11336
11336
|
U !== null && _(U), $.current = null;
|
|
11337
11337
|
}, []), W = ie((U) => {
|
|
@@ -11364,9 +11364,9 @@ function ib({
|
|
|
11364
11364
|
return {
|
|
11365
11365
|
editingMessageId: m,
|
|
11366
11366
|
editingInitialValue: y,
|
|
11367
|
-
inputError:
|
|
11368
|
-
setInputError:
|
|
11369
|
-
dismissError:
|
|
11367
|
+
inputError: T,
|
|
11368
|
+
setInputError: v,
|
|
11369
|
+
dismissError: S,
|
|
11370
11370
|
setDismissError: C,
|
|
11371
11371
|
composerValue: R,
|
|
11372
11372
|
handleComposerChange: O,
|
|
@@ -11395,29 +11395,26 @@ const dk = (e) => `msg-${e}`, Rd = Q.memo(function({
|
|
|
11395
11395
|
getInterruptOptions: f,
|
|
11396
11396
|
toolConfig: p,
|
|
11397
11397
|
renderArtifactsInline: h
|
|
11398
|
-
} = Xi(), m = t.userMessage, g = t.aiMessages, y = o === "phone" || o === "half-screen", x =
|
|
11399
|
-
const
|
|
11400
|
-
return
|
|
11401
|
-
}, [g, p == null ? void 0 : p.getArtifactPlacement]), b =
|
|
11398
|
+
} = Xi(), m = t.userMessage, g = t.aiMessages, y = o === "phone" || o === "half-screen", x = Oe(() => {
|
|
11399
|
+
const T = p == null ? void 0 : p.getArtifactPlacement;
|
|
11400
|
+
return T ? g.filter((v) => v.role !== "tool" || !v.artifact ? !1 : T({ artifact: v.artifact, message: v }) === "separate") : [];
|
|
11401
|
+
}, [g, p == null ? void 0 : p.getArtifactPlacement]), b = Oe(() => {
|
|
11402
11402
|
if (x.length === 0) return g;
|
|
11403
|
-
const
|
|
11404
|
-
return g.filter((v) => !
|
|
11405
|
-
}, [g, x]),
|
|
11406
|
-
() => b[0] ? c == null ? void 0 : c(b[0]) : {},
|
|
11407
|
-
[b, c]
|
|
11408
|
-
), k = Me(() => {
|
|
11403
|
+
const T = new Set(x);
|
|
11404
|
+
return g.filter((v) => !T.has(v));
|
|
11405
|
+
}, [g, x]), k = Oe(() => {
|
|
11409
11406
|
if (!b.length) return null;
|
|
11410
11407
|
if (r && b.length === 1) {
|
|
11411
|
-
const
|
|
11408
|
+
const T = b[0], v = c == null ? void 0 : c(T);
|
|
11412
11409
|
return r({
|
|
11413
11410
|
turn: t,
|
|
11414
11411
|
aiMessages: b,
|
|
11415
|
-
baseAiMessage:
|
|
11412
|
+
baseAiMessage: T,
|
|
11416
11413
|
aiHeader: null,
|
|
11417
11414
|
aiContent: /* @__PURE__ */ d.jsx(
|
|
11418
11415
|
Ai,
|
|
11419
11416
|
{
|
|
11420
|
-
message:
|
|
11417
|
+
message: T,
|
|
11421
11418
|
messageIndex: 0,
|
|
11422
11419
|
isStreamingMessage: !!t.isStreaming,
|
|
11423
11420
|
streamingDebounceMs: s,
|
|
@@ -11426,29 +11423,30 @@ const dk = (e) => `msg-${e}`, Rd = Q.memo(function({
|
|
|
11426
11423
|
toolConfig: p,
|
|
11427
11424
|
renderArtifactsInline: h,
|
|
11428
11425
|
getInterruptOptions: f,
|
|
11429
|
-
isEmbedded: !0
|
|
11426
|
+
isEmbedded: !0,
|
|
11427
|
+
customStyles: v
|
|
11430
11428
|
}
|
|
11431
11429
|
),
|
|
11432
11430
|
isCompactLayout: y,
|
|
11433
11431
|
toolConfig: p
|
|
11434
11432
|
});
|
|
11435
11433
|
}
|
|
11436
|
-
return /* @__PURE__ */ d.jsx("div", { className: "flex flex-col gap-2", children: b.map((
|
|
11434
|
+
return /* @__PURE__ */ d.jsx("div", { className: "flex flex-col gap-2", children: b.map((T, v) => /* @__PURE__ */ d.jsx(
|
|
11437
11435
|
Ai,
|
|
11438
11436
|
{
|
|
11439
|
-
message:
|
|
11437
|
+
message: T,
|
|
11440
11438
|
messageIndex: v,
|
|
11441
11439
|
isStreamingMessage: !!(t.isStreaming && v === b.length - 1),
|
|
11442
11440
|
streamingDebounceMs: s,
|
|
11443
11441
|
layoutSize: o,
|
|
11444
|
-
showToolMessages:
|
|
11442
|
+
showToolMessages: T.role === "assistant",
|
|
11445
11443
|
toolConfig: p,
|
|
11446
11444
|
renderArtifactsInline: h,
|
|
11447
11445
|
getInterruptOptions: f,
|
|
11448
11446
|
isEmbedded: !1,
|
|
11449
|
-
customStyles: T
|
|
11447
|
+
customStyles: c == null ? void 0 : c(T)
|
|
11450
11448
|
},
|
|
11451
|
-
|
|
11449
|
+
T.id ? `${T.id}-${v}` : `ai-part-${v}`
|
|
11452
11450
|
)) });
|
|
11453
11451
|
}, [
|
|
11454
11452
|
b,
|
|
@@ -11460,7 +11458,7 @@ const dk = (e) => `msg-${e}`, Rd = Q.memo(function({
|
|
|
11460
11458
|
h,
|
|
11461
11459
|
f,
|
|
11462
11460
|
y,
|
|
11463
|
-
|
|
11461
|
+
c
|
|
11464
11462
|
]);
|
|
11465
11463
|
return /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col w-full", children: [
|
|
11466
11464
|
t.systemMessage && /* @__PURE__ */ d.jsx(
|
|
@@ -11485,14 +11483,14 @@ const dk = (e) => `msg-${e}`, Rd = Q.memo(function({
|
|
|
11485
11483
|
}
|
|
11486
11484
|
),
|
|
11487
11485
|
k,
|
|
11488
|
-
x.length > 0 && /* @__PURE__ */ d.jsx("div", { className: "flex flex-col gap-2", children: x.map((
|
|
11486
|
+
x.length > 0 && /* @__PURE__ */ d.jsx("div", { className: "flex flex-col gap-2", children: x.map((T) => /* @__PURE__ */ d.jsx(
|
|
11489
11487
|
lb,
|
|
11490
11488
|
{
|
|
11491
|
-
message:
|
|
11489
|
+
message: T,
|
|
11492
11490
|
toolConfig: p,
|
|
11493
11491
|
isStreaming: !!t.isStreaming
|
|
11494
11492
|
},
|
|
11495
|
-
`artifact-${
|
|
11493
|
+
`artifact-${T.id}`
|
|
11496
11494
|
)) })
|
|
11497
11495
|
] });
|
|
11498
11496
|
});
|
|
@@ -11536,7 +11534,7 @@ const Ed = Q.forwardRef(({
|
|
|
11536
11534
|
followNewMessages: c,
|
|
11537
11535
|
checkpointIndex: f,
|
|
11538
11536
|
pendingInterrupt: p
|
|
11539
|
-
} = Xi(), h = !!f, m = ke(null), g = ke(null), y = ke(!1), x = ke(!1),
|
|
11537
|
+
} = Xi(), h = !!f, m = ke(null), g = ke(null), y = ke(!1), x = ke(!1), T = Q.useMemo(() => {
|
|
11540
11538
|
const O = [];
|
|
11541
11539
|
let E = null;
|
|
11542
11540
|
const q = (B) => {
|
|
@@ -11581,9 +11579,9 @@ const Ed = Q.forwardRef(({
|
|
|
11581
11579
|
}
|
|
11582
11580
|
}
|
|
11583
11581
|
return O;
|
|
11584
|
-
}, [e, t, p]),
|
|
11582
|
+
}, [e, t, p]), v = ie((O) => {
|
|
11585
11583
|
i && i(!O), a && a(O);
|
|
11586
|
-
}, [i, a]),
|
|
11584
|
+
}, [i, a]), S = Oe(() => {
|
|
11587
11585
|
if (n)
|
|
11588
11586
|
return async () => {
|
|
11589
11587
|
if (!y.current) {
|
|
@@ -11595,7 +11593,7 @@ const Ed = Q.forwardRef(({
|
|
|
11595
11593
|
}
|
|
11596
11594
|
}
|
|
11597
11595
|
};
|
|
11598
|
-
}, [n]), C =
|
|
11596
|
+
}, [n]), C = Oe(() => !c || h ? !1 : "auto", [c, h]), R = T.length === 0 && s, _ = ["flex flex-1 flex-col min-h-0 min-w-0", r].filter(Boolean).join(" "), D = () => R ? /* @__PURE__ */ d.jsx("div", { className: "h-full w-full", children: s }) : /* @__PURE__ */ d.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: "No messages yet. Start a conversation!" }), $ = T.length, F = $ > 0;
|
|
11599
11597
|
return ze(() => {
|
|
11600
11598
|
var O, E;
|
|
11601
11599
|
if ($ === 0) {
|
|
@@ -11603,36 +11601,36 @@ const Ed = Q.forwardRef(({
|
|
|
11603
11601
|
return;
|
|
11604
11602
|
}
|
|
11605
11603
|
if (!x.current)
|
|
11606
|
-
if (x.current = !0, m.current &&
|
|
11607
|
-
const q =
|
|
11604
|
+
if (x.current = !0, m.current && T.length > 0) {
|
|
11605
|
+
const q = T.length - 1;
|
|
11608
11606
|
(E = (O = m.current).scrollToIndex) == null || E.call(O, { index: q, align: "end", behavior: "auto" });
|
|
11609
11607
|
} else g.current && (g.current.scrollTop = g.current.scrollHeight);
|
|
11610
|
-
}, [$,
|
|
11608
|
+
}, [$, T.length]), yh(l, () => ({
|
|
11611
11609
|
scrollToLatest: () => {
|
|
11612
11610
|
var O, E;
|
|
11613
|
-
if (m.current &&
|
|
11614
|
-
const q =
|
|
11611
|
+
if (m.current && T.length > 0) {
|
|
11612
|
+
const q = T.length - 1;
|
|
11615
11613
|
(E = (O = m.current).scrollToIndex) == null || E.call(O, { index: q, align: "end", behavior: "auto" });
|
|
11616
11614
|
} else g.current && (g.current.scrollTop = g.current.scrollHeight);
|
|
11617
11615
|
},
|
|
11618
11616
|
scrollToTop: () => {
|
|
11619
11617
|
var O, E;
|
|
11620
|
-
m.current &&
|
|
11618
|
+
m.current && T.length > 0 ? (E = (O = m.current).scrollToIndex) == null || E.call(O, { index: 0, align: "start", behavior: "auto" }) : g.current && (g.current.scrollTop = 0);
|
|
11621
11619
|
}
|
|
11622
|
-
}), [
|
|
11620
|
+
}), [T]), /* @__PURE__ */ d.jsx("div", { className: _, style: o, children: /* @__PURE__ */ d.jsx("div", { className: "relative flex-1 min-h-0 min-w-0", children: F ? /* @__PURE__ */ d.jsx(
|
|
11623
11621
|
iw,
|
|
11624
11622
|
{
|
|
11625
11623
|
ref: (O) => m.current = O,
|
|
11626
11624
|
scrollerRef: (O) => g.current = O instanceof HTMLDivElement ? O : null,
|
|
11627
|
-
data:
|
|
11625
|
+
data: T,
|
|
11628
11626
|
followOutput: C,
|
|
11629
|
-
initialTopMostItemIndex:
|
|
11627
|
+
initialTopMostItemIndex: T.length > 0 ? T.length - 1 : 0,
|
|
11630
11628
|
overscan: 200,
|
|
11631
11629
|
atBottomThreshold: 50,
|
|
11632
11630
|
startReached: () => {
|
|
11633
|
-
|
|
11631
|
+
S && S();
|
|
11634
11632
|
},
|
|
11635
|
-
atBottomStateChange:
|
|
11633
|
+
atBottomStateChange: v,
|
|
11636
11634
|
style: { height: "100%", width: "100%", overscrollBehavior: "contain" },
|
|
11637
11635
|
computeItemKey: (O, E) => E.id,
|
|
11638
11636
|
itemContent: (O, E) => /* @__PURE__ */ d.jsx(
|
|
@@ -11824,21 +11822,21 @@ function Nd(e) {
|
|
|
11824
11822
|
t,
|
|
11825
11823
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
11826
11824
|
), i = (g) => {
|
|
11827
|
-
const { scope: y, children: x } = g, b = Q.useRef(null),
|
|
11828
|
-
return /* @__PURE__ */ d.jsx(o, { scope: y, itemMap:
|
|
11825
|
+
const { scope: y, children: x } = g, b = Q.useRef(null), k = Q.useRef(/* @__PURE__ */ new Map()).current;
|
|
11826
|
+
return /* @__PURE__ */ d.jsx(o, { scope: y, itemMap: k, collectionRef: b, children: x });
|
|
11829
11827
|
};
|
|
11830
11828
|
i.displayName = t;
|
|
11831
11829
|
const a = e + "CollectionSlot", u = Kr(a), l = Q.forwardRef(
|
|
11832
11830
|
(g, y) => {
|
|
11833
|
-
const { scope: x, children: b } = g,
|
|
11834
|
-
return /* @__PURE__ */ d.jsx(u, { ref:
|
|
11831
|
+
const { scope: x, children: b } = g, k = s(a, x), T = Ge(y, k.collectionRef);
|
|
11832
|
+
return /* @__PURE__ */ d.jsx(u, { ref: T, children: b });
|
|
11835
11833
|
}
|
|
11836
11834
|
);
|
|
11837
11835
|
l.displayName = a;
|
|
11838
11836
|
const c = e + "CollectionItemSlot", f = "data-radix-collection-item", p = Kr(c), h = Q.forwardRef(
|
|
11839
11837
|
(g, y) => {
|
|
11840
|
-
const { scope: x, children: b, ...
|
|
11841
|
-
return Q.useEffect(() => (
|
|
11838
|
+
const { scope: x, children: b, ...k } = g, T = Q.useRef(null), v = Ge(y, T), S = s(c, x);
|
|
11839
|
+
return Q.useEffect(() => (S.itemMap.set(T, { ref: T, ...k }), () => void S.itemMap.delete(T))), /* @__PURE__ */ d.jsx(p, { [f]: "", ref: v, children: b });
|
|
11842
11840
|
}
|
|
11843
11841
|
);
|
|
11844
11842
|
h.displayName = c;
|
|
@@ -11847,9 +11845,9 @@ function Nd(e) {
|
|
|
11847
11845
|
return Q.useCallback(() => {
|
|
11848
11846
|
const b = y.collectionRef.current;
|
|
11849
11847
|
if (!b) return [];
|
|
11850
|
-
const
|
|
11848
|
+
const k = Array.from(b.querySelectorAll(`[${f}]`));
|
|
11851
11849
|
return Array.from(y.itemMap.values()).sort(
|
|
11852
|
-
(
|
|
11850
|
+
(S, C) => k.indexOf(S.ref.current) - k.indexOf(C.ref.current)
|
|
11853
11851
|
);
|
|
11854
11852
|
}, [y.collectionRef, y.itemMap]);
|
|
11855
11853
|
}
|
|
@@ -11896,10 +11894,10 @@ var xb = "DismissableLayer", Ni = "dismissableLayer.update", yb = "dismissableLa
|
|
|
11896
11894
|
onInteractOutside: i,
|
|
11897
11895
|
onDismiss: a,
|
|
11898
11896
|
...u
|
|
11899
|
-
} = e, l = w.useContext(jd), [c, f] = w.useState(null), p = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = w.useState({}), m = Ge(t, (C) => f(C)), g = Array.from(l.layers), [y] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), x = g.indexOf(y), b = c ? g.indexOf(c) : -1,
|
|
11897
|
+
} = e, l = w.useContext(jd), [c, f] = w.useState(null), p = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = w.useState({}), m = Ge(t, (C) => f(C)), g = Array.from(l.layers), [y] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), x = g.indexOf(y), b = c ? g.indexOf(c) : -1, k = l.layersWithOutsidePointerEventsDisabled.size > 0, T = b >= x, v = Sb((C) => {
|
|
11900
11898
|
const R = C.target, _ = [...l.branches].some((D) => D.contains(R));
|
|
11901
|
-
!
|
|
11902
|
-
}, p),
|
|
11899
|
+
!T || _ || (o == null || o(C), i == null || i(C), C.defaultPrevented || a == null || a());
|
|
11900
|
+
}, p), S = Cb((C) => {
|
|
11903
11901
|
const R = C.target;
|
|
11904
11902
|
[...l.branches].some((D) => D.contains(R)) || (s == null || s(C), i == null || i(C), C.defaultPrevented || a == null || a());
|
|
11905
11903
|
}, p);
|
|
@@ -11921,14 +11919,14 @@ var xb = "DismissableLayer", Ni = "dismissableLayer.update", yb = "dismissableLa
|
|
|
11921
11919
|
...u,
|
|
11922
11920
|
ref: m,
|
|
11923
11921
|
style: {
|
|
11924
|
-
pointerEvents:
|
|
11922
|
+
pointerEvents: k ? T ? "auto" : "none" : void 0,
|
|
11925
11923
|
...e.style
|
|
11926
11924
|
},
|
|
11927
|
-
onFocusCapture: be(e.onFocusCapture,
|
|
11928
|
-
onBlurCapture: be(e.onBlurCapture,
|
|
11925
|
+
onFocusCapture: be(e.onFocusCapture, S.onFocusCapture),
|
|
11926
|
+
onBlurCapture: be(e.onBlurCapture, S.onBlurCapture),
|
|
11929
11927
|
onPointerDownCapture: be(
|
|
11930
11928
|
e.onPointerDownCapture,
|
|
11931
|
-
|
|
11929
|
+
v.onPointerDownCapture
|
|
11932
11930
|
)
|
|
11933
11931
|
}
|
|
11934
11932
|
);
|
|
@@ -12029,18 +12027,18 @@ var ri = "focusScope.autoFocusOnMount", oi = "focusScope.autoFocusOnUnmount", rc
|
|
|
12029
12027
|
}).current;
|
|
12030
12028
|
w.useEffect(() => {
|
|
12031
12029
|
if (r) {
|
|
12032
|
-
let g = function(
|
|
12030
|
+
let g = function(k) {
|
|
12033
12031
|
if (h.paused || !a) return;
|
|
12034
|
-
const
|
|
12035
|
-
a.contains(
|
|
12036
|
-
}, y = function(
|
|
12032
|
+
const T = k.target;
|
|
12033
|
+
a.contains(T) ? f.current = T : kn(f.current, { select: !0 });
|
|
12034
|
+
}, y = function(k) {
|
|
12037
12035
|
if (h.paused || !a) return;
|
|
12038
|
-
const
|
|
12039
|
-
|
|
12040
|
-
}, x = function(
|
|
12036
|
+
const T = k.relatedTarget;
|
|
12037
|
+
T !== null && (a.contains(T) || kn(f.current, { select: !0 }));
|
|
12038
|
+
}, x = function(k) {
|
|
12041
12039
|
if (document.activeElement === document.body)
|
|
12042
|
-
for (const
|
|
12043
|
-
|
|
12040
|
+
for (const v of k)
|
|
12041
|
+
v.removedNodes.length > 0 && kn(a);
|
|
12044
12042
|
};
|
|
12045
12043
|
document.addEventListener("focusin", g), document.addEventListener("focusout", y);
|
|
12046
12044
|
const b = new MutationObserver(x);
|
|
@@ -12069,8 +12067,8 @@ var ri = "focusScope.autoFocusOnMount", oi = "focusScope.autoFocusOnUnmount", rc
|
|
|
12069
12067
|
if (!n && !r || h.paused) return;
|
|
12070
12068
|
const y = g.key === "Tab" && !g.altKey && !g.ctrlKey && !g.metaKey, x = document.activeElement;
|
|
12071
12069
|
if (y && x) {
|
|
12072
|
-
const b = g.currentTarget, [
|
|
12073
|
-
|
|
12070
|
+
const b = g.currentTarget, [k, T] = Ib(b);
|
|
12071
|
+
k && T ? !g.shiftKey && x === T ? (g.preventDefault(), n && kn(k, { select: !0 })) : g.shiftKey && x === k && (g.preventDefault(), n && kn(T, { select: !0 })) : x === b && g.preventDefault();
|
|
12074
12072
|
}
|
|
12075
12073
|
},
|
|
12076
12074
|
[n, r, h.paused]
|
|
@@ -12323,9 +12321,9 @@ const Wb = async (e, t, n) => {
|
|
|
12323
12321
|
fn: x
|
|
12324
12322
|
} = a[g], {
|
|
12325
12323
|
x: b,
|
|
12326
|
-
y:
|
|
12327
|
-
data:
|
|
12328
|
-
reset:
|
|
12324
|
+
y: k,
|
|
12325
|
+
data: T,
|
|
12326
|
+
reset: v
|
|
12329
12327
|
} = await x({
|
|
12330
12328
|
x: c,
|
|
12331
12329
|
y: f,
|
|
@@ -12340,17 +12338,17 @@ const Wb = async (e, t, n) => {
|
|
|
12340
12338
|
floating: t
|
|
12341
12339
|
}
|
|
12342
12340
|
});
|
|
12343
|
-
c = b ?? c, f =
|
|
12341
|
+
c = b ?? c, f = k ?? f, h = {
|
|
12344
12342
|
...h,
|
|
12345
12343
|
[y]: {
|
|
12346
12344
|
...h[y],
|
|
12347
|
-
...
|
|
12345
|
+
...T
|
|
12348
12346
|
}
|
|
12349
|
-
},
|
|
12347
|
+
}, v && m <= 50 && (m++, typeof v == "object" && (v.placement && (p = v.placement), v.rects && (l = v.rects === !0 ? await i.getElementRects({
|
|
12350
12348
|
reference: e,
|
|
12351
12349
|
floating: t,
|
|
12352
12350
|
strategy: o
|
|
12353
|
-
}) :
|
|
12351
|
+
}) : v.rects), {
|
|
12354
12352
|
x: c,
|
|
12355
12353
|
y: f
|
|
12356
12354
|
} = cc(l, p, u)), g = -1);
|
|
@@ -12389,23 +12387,23 @@ async function Zr(e, t) {
|
|
|
12389
12387
|
y: o,
|
|
12390
12388
|
width: i.floating.width,
|
|
12391
12389
|
height: i.floating.height
|
|
12392
|
-
} : i.reference,
|
|
12390
|
+
} : i.reference, k = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), T = await (s.isElement == null ? void 0 : s.isElement(k)) ? await (s.getScale == null ? void 0 : s.getScale(k)) || {
|
|
12393
12391
|
x: 1,
|
|
12394
12392
|
y: 1
|
|
12395
12393
|
} : {
|
|
12396
12394
|
x: 1,
|
|
12397
12395
|
y: 1
|
|
12398
|
-
},
|
|
12396
|
+
}, v = is(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
12399
12397
|
elements: a,
|
|
12400
12398
|
rect: b,
|
|
12401
|
-
offsetParent:
|
|
12399
|
+
offsetParent: k,
|
|
12402
12400
|
strategy: u
|
|
12403
12401
|
}) : b);
|
|
12404
12402
|
return {
|
|
12405
|
-
top: (x.top -
|
|
12406
|
-
bottom: (
|
|
12407
|
-
left: (x.left -
|
|
12408
|
-
right: (
|
|
12403
|
+
top: (x.top - v.top + m.top) / T.y,
|
|
12404
|
+
bottom: (v.bottom - x.bottom + m.bottom) / T.y,
|
|
12405
|
+
left: (x.left - v.left + m.left) / T.x,
|
|
12406
|
+
right: (v.right - x.right + m.right) / T.x
|
|
12409
12407
|
};
|
|
12410
12408
|
}
|
|
12411
12409
|
const Vb = (e) => ({
|
|
@@ -12429,10 +12427,10 @@ const Vb = (e) => ({
|
|
|
12429
12427
|
const f = Od(c), p = {
|
|
12430
12428
|
x: n,
|
|
12431
12429
|
y: r
|
|
12432
|
-
}, h = xa(o), m = ga(h), g = await i.getDimensions(l), y = h === "y", x = y ? "top" : "left", b = y ? "bottom" : "right",
|
|
12433
|
-
let C =
|
|
12434
|
-
(!C || !await (i.isElement == null ? void 0 : i.isElement(
|
|
12435
|
-
const R =
|
|
12430
|
+
}, h = xa(o), m = ga(h), g = await i.getDimensions(l), y = h === "y", x = y ? "top" : "left", b = y ? "bottom" : "right", k = y ? "clientHeight" : "clientWidth", T = s.reference[m] + s.reference[h] - p[h] - s.floating[m], v = p[h] - s.reference[h], S = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
|
|
12431
|
+
let C = S ? S[k] : 0;
|
|
12432
|
+
(!C || !await (i.isElement == null ? void 0 : i.isElement(S))) && (C = a.floating[k] || s.floating[m]);
|
|
12433
|
+
const R = T / 2 - v / 2, _ = C / 2 - g[m] / 2 - 1, D = jn(f[x], _), $ = jn(f[b], _), F = D, O = C - g[m] - $, E = C / 2 - g[m] / 2 + R, q = ji(F, E, O), B = !u.arrow && jr(o) != null && E !== q && s.reference[m] / 2 - (E < F ? D : $) - g[m] / 2 < 0, re = B ? E < F ? E - F : E - O : 0;
|
|
12436
12434
|
return {
|
|
12437
12435
|
[h]: p[h] + re,
|
|
12438
12436
|
data: {
|
|
@@ -12469,12 +12467,12 @@ const Vb = (e) => ({
|
|
|
12469
12467
|
} = vn(e, t);
|
|
12470
12468
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
12471
12469
|
return {};
|
|
12472
|
-
const x = Sn(o), b = ln(a),
|
|
12473
|
-
!p &&
|
|
12474
|
-
const C = [a, ...
|
|
12470
|
+
const x = Sn(o), b = ln(a), k = Sn(a) === a, T = await (u.isRTL == null ? void 0 : u.isRTL(l.floating)), v = p || (k || !g ? [ss(a)] : $b(a)), S = m !== "none";
|
|
12471
|
+
!p && S && v.push(...Ub(a, g, m, T));
|
|
12472
|
+
const C = [a, ...v], R = await Zr(t, y), _ = [];
|
|
12475
12473
|
let D = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
12476
12474
|
if (c && _.push(R[x]), f) {
|
|
12477
|
-
const E = Lb(o, i,
|
|
12475
|
+
const E = Lb(o, i, T);
|
|
12478
12476
|
_.push(R[E[0]], R[E[1]]);
|
|
12479
12477
|
}
|
|
12480
12478
|
if (D = [...D, {
|
|
@@ -12501,7 +12499,7 @@ const Vb = (e) => ({
|
|
|
12501
12499
|
case "bestFit": {
|
|
12502
12500
|
var O;
|
|
12503
12501
|
const re = (O = D.filter((V) => {
|
|
12504
|
-
if (
|
|
12502
|
+
if (S) {
|
|
12505
12503
|
const W = ln(V.placement);
|
|
12506
12504
|
return W === b || // Create a bias to the `y` side axis due to horizontal
|
|
12507
12505
|
// reading directions favoring greater width.
|
|
@@ -12660,12 +12658,12 @@ const Yb = function(e) {
|
|
|
12660
12658
|
}, c = await Zr(t, u), f = ln(Sn(o)), p = ma(f);
|
|
12661
12659
|
let h = l[p], m = l[f];
|
|
12662
12660
|
if (s) {
|
|
12663
|
-
const y = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", b = h + c[y],
|
|
12664
|
-
h = ji(b, h,
|
|
12661
|
+
const y = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", b = h + c[y], k = h - c[x];
|
|
12662
|
+
h = ji(b, h, k);
|
|
12665
12663
|
}
|
|
12666
12664
|
if (i) {
|
|
12667
|
-
const y = f === "y" ? "top" : "left", x = f === "y" ? "bottom" : "right", b = m + c[y],
|
|
12668
|
-
m = ji(b, m,
|
|
12665
|
+
const y = f === "y" ? "top" : "left", x = f === "y" ? "bottom" : "right", b = m + c[y], k = m - c[x];
|
|
12666
|
+
m = ji(b, m, k);
|
|
12669
12667
|
}
|
|
12670
12668
|
const g = a.fn({
|
|
12671
12669
|
...t,
|
|
@@ -12713,13 +12711,13 @@ const Yb = function(e) {
|
|
|
12713
12711
|
...g
|
|
12714
12712
|
};
|
|
12715
12713
|
if (u) {
|
|
12716
|
-
const
|
|
12717
|
-
h <
|
|
12714
|
+
const k = p === "y" ? "height" : "width", T = s.reference[p] - s.floating[k] + y.mainAxis, v = s.reference[p] + s.reference[k] - y.mainAxis;
|
|
12715
|
+
h < T ? h = T : h > v && (h = v);
|
|
12718
12716
|
}
|
|
12719
12717
|
if (l) {
|
|
12720
12718
|
var x, b;
|
|
12721
|
-
const
|
|
12722
|
-
m <
|
|
12719
|
+
const k = p === "y" ? "width" : "height", T = Dd.has(Sn(o)), v = s.reference[f] - s.floating[k] + (T && ((x = i.offset) == null ? void 0 : x[f]) || 0) + (T ? 0 : y.crossAxis), S = s.reference[f] + s.reference[k] + (T ? 0 : ((b = i.offset) == null ? void 0 : b[f]) || 0) - (T ? y.crossAxis : 0);
|
|
12720
|
+
m < v ? m = v : m > S && (m = S);
|
|
12723
12721
|
}
|
|
12724
12722
|
return {
|
|
12725
12723
|
[p]: h,
|
|
@@ -12748,9 +12746,9 @@ const Yb = function(e) {
|
|
|
12748
12746
|
} = s.floating;
|
|
12749
12747
|
let y, x;
|
|
12750
12748
|
f === "top" || f === "bottom" ? (y = f, x = p === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = f, y = p === "end" ? "top" : "bottom");
|
|
12751
|
-
const b = g - c.top - c.bottom,
|
|
12752
|
-
let C =
|
|
12753
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R =
|
|
12749
|
+
const b = g - c.top - c.bottom, k = m - c.left - c.right, T = jn(g - c[y], b), v = jn(m - c[x], k), S = !t.middlewareData.shift;
|
|
12750
|
+
let C = T, R = v;
|
|
12751
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = k), (r = t.middlewareData.shift) != null && r.enabled.y && (C = b), S && !p) {
|
|
12754
12752
|
const D = Mt(c.left, 0), $ = Mt(c.right, 0), F = Mt(c.top, 0), O = Mt(c.bottom, 0);
|
|
12755
12753
|
h ? R = m - 2 * (D !== 0 || $ !== 0 ? D + $ : Mt(c.left, c.right)) : C = g - 2 * (F !== 0 || O !== 0 ? F + O : Mt(c.top, c.bottom));
|
|
12756
12754
|
}
|
|
@@ -12932,8 +12930,8 @@ function er(e, t, n, r) {
|
|
|
12932
12930
|
const p = $t(s), h = r && Gt(r) ? $t(r) : r;
|
|
12933
12931
|
let m = p, g = Pi(m);
|
|
12934
12932
|
for (; g && r && h !== m; ) {
|
|
12935
|
-
const y = wr(g), x = g.getBoundingClientRect(), b = Yt(g),
|
|
12936
|
-
u *= y.x, l *= y.y, c *= y.x, f *= y.y, u +=
|
|
12933
|
+
const y = wr(g), x = g.getBoundingClientRect(), b = Yt(g), k = x.left + (g.clientLeft + parseFloat(b.paddingLeft)) * y.x, T = x.top + (g.clientTop + parseFloat(b.paddingTop)) * y.y;
|
|
12934
|
+
u *= y.x, l *= y.y, c *= y.x, f *= y.y, u += k, l += T, m = $t(g), g = Pi(m);
|
|
12937
12935
|
}
|
|
12938
12936
|
}
|
|
12939
12937
|
return is({
|
|
@@ -13190,30 +13188,30 @@ function Cv(e, t) {
|
|
|
13190
13188
|
} = l;
|
|
13191
13189
|
if (a || t(), !p || !h)
|
|
13192
13190
|
return;
|
|
13193
|
-
const m = To(f), g = To(o.clientWidth - (c + p)), y = To(o.clientHeight - (f + h)), x = To(c),
|
|
13191
|
+
const m = To(f), g = To(o.clientWidth - (c + p)), y = To(o.clientHeight - (f + h)), x = To(c), k = {
|
|
13194
13192
|
rootMargin: -m + "px " + -g + "px " + -y + "px " + -x + "px",
|
|
13195
13193
|
threshold: Mt(0, jn(1, u)) || 1
|
|
13196
13194
|
};
|
|
13197
|
-
let
|
|
13198
|
-
function S
|
|
13199
|
-
const C =
|
|
13195
|
+
let T = !0;
|
|
13196
|
+
function v(S) {
|
|
13197
|
+
const C = S[0].intersectionRatio;
|
|
13200
13198
|
if (C !== u) {
|
|
13201
|
-
if (!
|
|
13199
|
+
if (!T)
|
|
13202
13200
|
return i();
|
|
13203
13201
|
C ? i(!1, C) : r = setTimeout(() => {
|
|
13204
13202
|
i(!1, 1e-7);
|
|
13205
13203
|
}, 1e3);
|
|
13206
13204
|
}
|
|
13207
|
-
C === 1 && !Wd(l, e.getBoundingClientRect()) && i(),
|
|
13205
|
+
C === 1 && !Wd(l, e.getBoundingClientRect()) && i(), T = !1;
|
|
13208
13206
|
}
|
|
13209
13207
|
try {
|
|
13210
|
-
n = new IntersectionObserver(
|
|
13211
|
-
...
|
|
13208
|
+
n = new IntersectionObserver(v, {
|
|
13209
|
+
...k,
|
|
13212
13210
|
// Handle <iframe>s
|
|
13213
13211
|
root: o.ownerDocument
|
|
13214
13212
|
});
|
|
13215
13213
|
} catch {
|
|
13216
|
-
n = new IntersectionObserver(
|
|
13214
|
+
n = new IntersectionObserver(v, k);
|
|
13217
13215
|
}
|
|
13218
13216
|
n.observe(e);
|
|
13219
13217
|
}
|
|
@@ -13238,8 +13236,8 @@ function Tv(e, t, n, r) {
|
|
|
13238
13236
|
i && (h = new ResizeObserver((x) => {
|
|
13239
13237
|
let [b] = x;
|
|
13240
13238
|
b && b.target === l && h && (h.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
13241
|
-
var
|
|
13242
|
-
(
|
|
13239
|
+
var k;
|
|
13240
|
+
(k = h) == null || k.observe(t);
|
|
13243
13241
|
})), n();
|
|
13244
13242
|
}), l && !u && h.observe(l), h.observe(t));
|
|
13245
13243
|
let m, g = u ? er(e) : null;
|
|
@@ -13337,18 +13335,18 @@ function Mv(e) {
|
|
|
13337
13335
|
}), [p, h] = w.useState(r);
|
|
13338
13336
|
as(p, r) || h(r);
|
|
13339
13337
|
const [m, g] = w.useState(null), [y, x] = w.useState(null), b = w.useCallback((V) => {
|
|
13340
|
-
V !==
|
|
13341
|
-
}, []),
|
|
13338
|
+
V !== S.current && (S.current = V, g(V));
|
|
13339
|
+
}, []), k = w.useCallback((V) => {
|
|
13342
13340
|
V !== C.current && (C.current = V, x(V));
|
|
13343
|
-
}, []),
|
|
13344
|
-
if (!
|
|
13341
|
+
}, []), T = s || m, v = i || y, S = w.useRef(null), C = w.useRef(null), R = w.useRef(c), _ = u != null, D = ii(u), $ = ii(o), F = ii(l), O = w.useCallback(() => {
|
|
13342
|
+
if (!S.current || !C.current)
|
|
13345
13343
|
return;
|
|
13346
13344
|
const V = {
|
|
13347
13345
|
placement: t,
|
|
13348
13346
|
strategy: n,
|
|
13349
13347
|
middleware: p
|
|
13350
13348
|
};
|
|
13351
|
-
$.current && (V.platform = $.current), jv(
|
|
13349
|
+
$.current && (V.platform = $.current), jv(S.current, C.current, V).then((W) => {
|
|
13352
13350
|
const ee = {
|
|
13353
13351
|
...W,
|
|
13354
13352
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -13372,21 +13370,21 @@ function Mv(e) {
|
|
|
13372
13370
|
Wo(() => (E.current = !0, () => {
|
|
13373
13371
|
E.current = !1;
|
|
13374
13372
|
}), []), Wo(() => {
|
|
13375
|
-
if (
|
|
13373
|
+
if (T && (S.current = T), v && (C.current = v), T && v) {
|
|
13376
13374
|
if (D.current)
|
|
13377
|
-
return D.current(
|
|
13375
|
+
return D.current(T, v, O);
|
|
13378
13376
|
O();
|
|
13379
13377
|
}
|
|
13380
|
-
}, [
|
|
13378
|
+
}, [T, v, O, D, _]);
|
|
13381
13379
|
const q = w.useMemo(() => ({
|
|
13382
|
-
reference:
|
|
13380
|
+
reference: S,
|
|
13383
13381
|
floating: C,
|
|
13384
13382
|
setReference: b,
|
|
13385
|
-
setFloating:
|
|
13386
|
-
}), [b,
|
|
13387
|
-
reference:
|
|
13388
|
-
floating:
|
|
13389
|
-
}), [
|
|
13383
|
+
setFloating: k
|
|
13384
|
+
}), [b, k]), B = w.useMemo(() => ({
|
|
13385
|
+
reference: T,
|
|
13386
|
+
floating: v
|
|
13387
|
+
}), [T, v]), re = w.useMemo(() => {
|
|
13390
13388
|
const V = {
|
|
13391
13389
|
position: n,
|
|
13392
13390
|
left: 0,
|
|
@@ -13530,7 +13528,7 @@ var Sa = "PopperContent", [qv, Gv] = qd(Sa), Qd = w.forwardRef(
|
|
|
13530
13528
|
updatePositionStrategy: h = "optimized",
|
|
13531
13529
|
onPlaced: m,
|
|
13532
13530
|
...g
|
|
13533
|
-
} = e, y = Yd(Sa, n), [x, b] = w.useState(null),
|
|
13531
|
+
} = e, y = Yd(Sa, n), [x, b] = w.useState(null), k = Ge(t, (ve) => b(ve)), [T, v] = w.useState(null), S = Vv(T), C = (S == null ? void 0 : S.width) ?? 0, R = (S == null ? void 0 : S.height) ?? 0, _ = r + (s !== "center" ? "-" + s : ""), D = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, $ = Array.isArray(l) ? l : [l], F = $.length > 0, O = {
|
|
13534
13532
|
padding: D,
|
|
13535
13533
|
boundary: $.filter(Xv),
|
|
13536
13534
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
@@ -13561,7 +13559,7 @@ var Sa = "PopperContent", [qv, Gv] = qd(Sa), Qd = w.forwardRef(
|
|
|
13561
13559
|
Ve.setProperty("--radix-popper-available-width", `${Ae}px`), Ve.setProperty("--radix-popper-available-height", `${We}px`), Ve.setProperty("--radix-popper-anchor-width", `${Qe}px`), Ve.setProperty("--radix-popper-anchor-height", `${Ye}px`);
|
|
13562
13560
|
}
|
|
13563
13561
|
}),
|
|
13564
|
-
|
|
13562
|
+
T && Uv({ element: T, padding: a }),
|
|
13565
13563
|
Jv({ arrowWidth: C, arrowHeight: R }),
|
|
13566
13564
|
p && Bv({ strategy: "referenceHidden", ...O })
|
|
13567
13565
|
]
|
|
@@ -13601,7 +13599,7 @@ var Sa = "PopperContent", [qv, Gv] = qd(Sa), Qd = w.forwardRef(
|
|
|
13601
13599
|
{
|
|
13602
13600
|
scope: n,
|
|
13603
13601
|
placedSide: W,
|
|
13604
|
-
onArrowChange:
|
|
13602
|
+
onArrowChange: v,
|
|
13605
13603
|
arrowX: P,
|
|
13606
13604
|
arrowY: N,
|
|
13607
13605
|
shouldHideArrow: L,
|
|
@@ -13611,7 +13609,7 @@ var Sa = "PopperContent", [qv, Gv] = qd(Sa), Qd = w.forwardRef(
|
|
|
13611
13609
|
"data-side": W,
|
|
13612
13610
|
"data-align": ee,
|
|
13613
13611
|
...g,
|
|
13614
|
-
ref:
|
|
13612
|
+
ref: k,
|
|
13615
13613
|
style: {
|
|
13616
13614
|
...g.style,
|
|
13617
13615
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
@@ -13792,12 +13790,12 @@ var d0 = w.forwardRef((e, t) => {
|
|
|
13792
13790
|
defaultProp: a ?? null,
|
|
13793
13791
|
onChange: u,
|
|
13794
13792
|
caller: go
|
|
13795
|
-
}), [x, b] = w.useState(!1),
|
|
13793
|
+
}), [x, b] = w.useState(!1), k = xt(l), T = rf(n), v = w.useRef(!1), [S, C] = w.useState(0);
|
|
13796
13794
|
return w.useEffect(() => {
|
|
13797
13795
|
const R = p.current;
|
|
13798
13796
|
if (R)
|
|
13799
|
-
return R.addEventListener(ai,
|
|
13800
|
-
}, [
|
|
13797
|
+
return R.addEventListener(ai, k), () => R.removeEventListener(ai, k);
|
|
13798
|
+
}, [k]), /* @__PURE__ */ d.jsx(
|
|
13801
13799
|
c0,
|
|
13802
13800
|
{
|
|
13803
13801
|
scope: n,
|
|
@@ -13821,26 +13819,26 @@ var d0 = w.forwardRef((e, t) => {
|
|
|
13821
13819
|
children: /* @__PURE__ */ d.jsx(
|
|
13822
13820
|
je.div,
|
|
13823
13821
|
{
|
|
13824
|
-
tabIndex: x ||
|
|
13822
|
+
tabIndex: x || S === 0 ? -1 : 0,
|
|
13825
13823
|
"data-orientation": r,
|
|
13826
13824
|
...f,
|
|
13827
13825
|
ref: h,
|
|
13828
13826
|
style: { outline: "none", ...e.style },
|
|
13829
13827
|
onMouseDown: be(e.onMouseDown, () => {
|
|
13830
|
-
|
|
13828
|
+
v.current = !0;
|
|
13831
13829
|
}),
|
|
13832
13830
|
onFocus: be(e.onFocus, (R) => {
|
|
13833
|
-
const _ = !
|
|
13831
|
+
const _ = !v.current;
|
|
13834
13832
|
if (R.target === R.currentTarget && _ && !x) {
|
|
13835
13833
|
const D = new CustomEvent(ai, i0);
|
|
13836
13834
|
if (R.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
13837
|
-
const $ =
|
|
13835
|
+
const $ = T().filter((B) => B.focusable), F = $.find((B) => B.active), O = $.find((B) => B.id === g), q = [F, O, ...$].filter(
|
|
13838
13836
|
Boolean
|
|
13839
13837
|
).map((B) => B.ref.current);
|
|
13840
13838
|
cf(q, c);
|
|
13841
13839
|
}
|
|
13842
13840
|
}
|
|
13843
|
-
|
|
13841
|
+
v.current = !1;
|
|
13844
13842
|
}),
|
|
13845
13843
|
onBlur: be(e.onBlur, () => b(!1))
|
|
13846
13844
|
}
|
|
@@ -13888,14 +13886,14 @@ var d0 = w.forwardRef((e, t) => {
|
|
|
13888
13886
|
if (x !== void 0) {
|
|
13889
13887
|
if (y.metaKey || y.ctrlKey || y.altKey || y.shiftKey) return;
|
|
13890
13888
|
y.preventDefault();
|
|
13891
|
-
let
|
|
13892
|
-
if (x === "last")
|
|
13889
|
+
let k = p().filter((T) => T.focusable).map((T) => T.ref.current);
|
|
13890
|
+
if (x === "last") k.reverse();
|
|
13893
13891
|
else if (x === "prev" || x === "next") {
|
|
13894
|
-
x === "prev" &&
|
|
13895
|
-
const
|
|
13896
|
-
|
|
13892
|
+
x === "prev" && k.reverse();
|
|
13893
|
+
const T = k.indexOf(y.currentTarget);
|
|
13894
|
+
k = c.loop ? m0(k, T + 1) : k.slice(T + 1);
|
|
13897
13895
|
}
|
|
13898
|
-
setTimeout(() => cf(
|
|
13896
|
+
setTimeout(() => cf(k));
|
|
13899
13897
|
}
|
|
13900
13898
|
}),
|
|
13901
13899
|
children: typeof i == "function" ? i({ isCurrentTabStop: f, hasTabStop: g != null }) : i
|
|
@@ -14129,12 +14127,12 @@ var hf = A0(), ui = function() {
|
|
|
14129
14127
|
onScrollCapture: ui,
|
|
14130
14128
|
onWheelCapture: ui,
|
|
14131
14129
|
onTouchMoveCapture: ui
|
|
14132
|
-
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, u = e.className, l = e.removeScrollBar, c = e.enabled, f = e.shards, p = e.sideCar, h = e.noRelative, m = e.noIsolation, g = e.inert, y = e.allowPinchZoom, x = e.as, b = x === void 0 ? "div" : x,
|
|
14130
|
+
}), o = r[0], s = r[1], i = e.forwardProps, a = e.children, u = e.className, l = e.removeScrollBar, c = e.enabled, f = e.shards, p = e.sideCar, h = e.noRelative, m = e.noIsolation, g = e.inert, y = e.allowPinchZoom, x = e.as, b = x === void 0 ? "div" : x, k = e.gapMode, T = ff(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), v = p, S = I0([n, t]), C = sn(sn({}, T), o);
|
|
14133
14131
|
return w.createElement(
|
|
14134
14132
|
w.Fragment,
|
|
14135
14133
|
null,
|
|
14136
|
-
c && w.createElement(
|
|
14137
|
-
i ? w.cloneElement(w.Children.only(a), sn(sn({}, C), { ref:
|
|
14134
|
+
c && w.createElement(v, { sideCar: hf, removeScrollBar: l, shards: f, noRelative: h, noIsolation: m, inert: g, setCallbacks: s, allowPinchZoom: !!y, lockRef: n, gapMode: k }),
|
|
14135
|
+
i ? w.cloneElement(w.Children.only(a), sn(sn({}, C), { ref: S })) : w.createElement(b, sn({}, C, { className: u, ref: S }), a)
|
|
14138
14136
|
);
|
|
14139
14137
|
});
|
|
14140
14138
|
_s.defaultProps = {
|
|
@@ -14380,40 +14378,40 @@ function eS(e) {
|
|
|
14380
14378
|
var a = w.useCallback(function(g, y) {
|
|
14381
14379
|
if ("touches" in g && g.touches.length === 2 || g.type === "wheel" && g.ctrlKey)
|
|
14382
14380
|
return !i.current.allowPinchZoom;
|
|
14383
|
-
var x = Ao(g), b = n.current,
|
|
14384
|
-
if ("touches" in g && C === "h" &&
|
|
14381
|
+
var x = Ao(g), b = n.current, k = "deltaX" in g ? g.deltaX : b[0] - x[0], T = "deltaY" in g ? g.deltaY : b[1] - x[1], v, S = g.target, C = Math.abs(k) > Math.abs(T) ? "h" : "v";
|
|
14382
|
+
if ("touches" in g && C === "h" && S.type === "range")
|
|
14385
14383
|
return !1;
|
|
14386
|
-
var R = bc(C,
|
|
14384
|
+
var R = bc(C, S);
|
|
14387
14385
|
if (!R)
|
|
14388
14386
|
return !0;
|
|
14389
|
-
if (R ?
|
|
14387
|
+
if (R ? v = C : (v = C === "v" ? "h" : "v", R = bc(C, S)), !R)
|
|
14390
14388
|
return !1;
|
|
14391
|
-
if (!r.current && "changedTouches" in g && (
|
|
14389
|
+
if (!r.current && "changedTouches" in g && (k || T) && (r.current = v), !v)
|
|
14392
14390
|
return !0;
|
|
14393
|
-
var _ = r.current ||
|
|
14394
|
-
return X0(_, y, g, _ === "h" ?
|
|
14391
|
+
var _ = r.current || v;
|
|
14392
|
+
return X0(_, y, g, _ === "h" ? k : T);
|
|
14395
14393
|
}, []), u = w.useCallback(function(g) {
|
|
14396
14394
|
var y = g;
|
|
14397
14395
|
if (!(!pr.length || pr[pr.length - 1] !== s)) {
|
|
14398
|
-
var x = "deltaY" in y ? vc(y) : Ao(y), b = t.current.filter(function(
|
|
14399
|
-
return
|
|
14396
|
+
var x = "deltaY" in y ? vc(y) : Ao(y), b = t.current.filter(function(v) {
|
|
14397
|
+
return v.name === y.type && (v.target === y.target || y.target === v.shadowParent) && J0(v.delta, x);
|
|
14400
14398
|
})[0];
|
|
14401
14399
|
if (b && b.should) {
|
|
14402
14400
|
y.cancelable && y.preventDefault();
|
|
14403
14401
|
return;
|
|
14404
14402
|
}
|
|
14405
14403
|
if (!b) {
|
|
14406
|
-
var
|
|
14407
|
-
return
|
|
14408
|
-
}),
|
|
14409
|
-
|
|
14404
|
+
var k = (i.current.shards || []).map(Sc).filter(Boolean).filter(function(v) {
|
|
14405
|
+
return v.contains(y.target);
|
|
14406
|
+
}), T = k.length > 0 ? a(y, k[0]) : !i.current.noIsolation;
|
|
14407
|
+
T && y.cancelable && y.preventDefault();
|
|
14410
14408
|
}
|
|
14411
14409
|
}
|
|
14412
14410
|
}, []), l = w.useCallback(function(g, y, x, b) {
|
|
14413
|
-
var
|
|
14414
|
-
t.current.push(
|
|
14415
|
-
t.current = t.current.filter(function(
|
|
14416
|
-
return
|
|
14411
|
+
var k = { name: g, delta: y, target: x, should: b, shadowParent: tS(x) };
|
|
14412
|
+
t.current.push(k), setTimeout(function() {
|
|
14413
|
+
t.current = t.current.filter(function(T) {
|
|
14414
|
+
return T !== k;
|
|
14417
14415
|
});
|
|
14418
14416
|
}, 1);
|
|
14419
14417
|
}, []), c = w.useCallback(function(g) {
|
|
@@ -14566,9 +14564,9 @@ var Wt = "MenuContent", [pS, Ra] = lr(Wt), kf = w.forwardRef(
|
|
|
14566
14564
|
onDismiss: h,
|
|
14567
14565
|
disableOutsideScroll: m,
|
|
14568
14566
|
...g
|
|
14569
|
-
} = e, y = cr(Wt, n), x = yo(Wt, n), b = Ps(n),
|
|
14567
|
+
} = e, y = cr(Wt, n), x = yo(Wt, n), b = Ps(n), k = vf(n), T = aS(n), [v, S] = w.useState(null), C = w.useRef(null), R = Ge(t, C, y.onContentChange), _ = w.useRef(0), D = w.useRef(""), $ = w.useRef(0), F = w.useRef(null), O = w.useRef("right"), E = w.useRef(0), q = m ? Ta : w.Fragment, B = m ? { as: gS, allowPinchZoom: !0 } : void 0, re = (W) => {
|
|
14570
14568
|
var Z, j;
|
|
14571
|
-
const ee = D.current + W, U =
|
|
14569
|
+
const ee = D.current + W, U = T().filter((K) => !K.disabled), P = document.activeElement, N = (Z = U.find((K) => K.ref.current === P)) == null ? void 0 : Z.textValue, L = U.map((K) => K.textValue), M = ES(L, ee, N), G = (j = U.find((K) => K.textValue === M)) == null ? void 0 : j.ref.current;
|
|
14572
14570
|
(function K(X) {
|
|
14573
14571
|
D.current = X, window.clearTimeout(_.current), X !== "" && (_.current = window.setTimeout(() => K(""), 1e3));
|
|
14574
14572
|
})(ee), G && setTimeout(() => G.focus());
|
|
@@ -14592,7 +14590,7 @@ var Wt = "MenuContent", [pS, Ra] = lr(Wt), kf = w.forwardRef(
|
|
|
14592
14590
|
onItemLeave: w.useCallback(
|
|
14593
14591
|
(W) => {
|
|
14594
14592
|
var ee;
|
|
14595
|
-
V(W) || ((ee = C.current) == null || ee.focus(),
|
|
14593
|
+
V(W) || ((ee = C.current) == null || ee.focus(), S(null));
|
|
14596
14594
|
},
|
|
14597
14595
|
[V]
|
|
14598
14596
|
),
|
|
@@ -14630,12 +14628,12 @@ var Wt = "MenuContent", [pS, Ra] = lr(Wt), kf = w.forwardRef(
|
|
|
14630
14628
|
g0,
|
|
14631
14629
|
{
|
|
14632
14630
|
asChild: !0,
|
|
14633
|
-
...
|
|
14631
|
+
...k,
|
|
14634
14632
|
dir: x.dir,
|
|
14635
14633
|
orientation: "vertical",
|
|
14636
14634
|
loop: r,
|
|
14637
|
-
currentTabStopId:
|
|
14638
|
-
onCurrentTabStopIdChange:
|
|
14635
|
+
currentTabStopId: v,
|
|
14636
|
+
onCurrentTabStopIdChange: S,
|
|
14639
14637
|
onEntryFocus: be(u, (W) => {
|
|
14640
14638
|
x.isUsingKeyboardRef.current || W.preventDefault();
|
|
14641
14639
|
}),
|
|
@@ -14658,7 +14656,7 @@ var Wt = "MenuContent", [pS, Ra] = lr(Wt), kf = w.forwardRef(
|
|
|
14658
14656
|
const L = C.current;
|
|
14659
14657
|
if (W.target !== L || !oS.includes(W.key)) return;
|
|
14660
14658
|
W.preventDefault();
|
|
14661
|
-
const G =
|
|
14659
|
+
const G = T().filter((Z) => !Z.disabled).map((Z) => Z.ref.current);
|
|
14662
14660
|
wf.includes(W.key) && G.reverse(), IS(G);
|
|
14663
14661
|
}),
|
|
14664
14662
|
onBlur: be(e.onBlur, (W) => {
|
|
@@ -14912,15 +14910,15 @@ var kS = "MenuSub", [fk, Lf] = lr(kS), zr = "MenuSubTrigger", $f = w.forwardRef(
|
|
|
14912
14910
|
c();
|
|
14913
14911
|
const p = (h = n.content) == null ? void 0 : h.getBoundingClientRect();
|
|
14914
14912
|
if (p) {
|
|
14915
|
-
const g = (m = n.content) == null ? void 0 : m.dataset.side, y = g === "right", x = y ? -5 : 5, b = p[y ? "left" : "right"],
|
|
14913
|
+
const g = (m = n.content) == null ? void 0 : m.dataset.side, y = g === "right", x = y ? -5 : 5, b = p[y ? "left" : "right"], k = p[y ? "right" : "left"];
|
|
14916
14914
|
s.onPointerGraceIntentChange({
|
|
14917
14915
|
area: [
|
|
14918
14916
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
14919
14917
|
// consistently within polygon bounds
|
|
14920
14918
|
{ x: f.clientX + x, y: f.clientY },
|
|
14921
14919
|
{ x: b, y: p.top },
|
|
14922
|
-
{ x:
|
|
14923
|
-
{ x:
|
|
14920
|
+
{ x: k, y: p.top },
|
|
14921
|
+
{ x: k, y: p.bottom },
|
|
14924
14922
|
{ x: b, y: p.bottom }
|
|
14925
14923
|
],
|
|
14926
14924
|
side: g
|
|
@@ -15344,9 +15342,9 @@ function wC({
|
|
|
15344
15342
|
validate: g,
|
|
15345
15343
|
onValidationError: y
|
|
15346
15344
|
}) {
|
|
15347
|
-
const x = i !== void 0, [b,
|
|
15345
|
+
const x = i !== void 0, [b, k] = Q.useState(e), T = (x ? i : b) ?? "", [v, S] = Q.useTransition(), C = Q.useRef(null), R = Q.useRef(0), _ = Q.useRef(null), D = Q.useRef("");
|
|
15348
15346
|
Q.useEffect(() => {
|
|
15349
|
-
if (!x && (
|
|
15347
|
+
if (!x && (k(e ?? ""), _.current = null, C.current)) {
|
|
15350
15348
|
const L = !e || e.trim() === "", M = 44;
|
|
15351
15349
|
L ? C.current.style.height = `${M}px` : (C.current.style.height = "auto", C.current.style.height = `${Math.max(C.current.scrollHeight, M)}px`);
|
|
15352
15350
|
}
|
|
@@ -15374,44 +15372,44 @@ function wC({
|
|
|
15374
15372
|
}, []);
|
|
15375
15373
|
Q.useEffect(() => {
|
|
15376
15374
|
B();
|
|
15377
|
-
}, [B,
|
|
15375
|
+
}, [B, T]), Q.useEffect(() => {
|
|
15378
15376
|
if (!$)
|
|
15379
15377
|
return;
|
|
15380
|
-
const L = (
|
|
15378
|
+
const L = (T ?? "").trim();
|
|
15381
15379
|
D.current !== L && q(L);
|
|
15382
|
-
}, [
|
|
15380
|
+
}, [T, $, q]);
|
|
15383
15381
|
const re = Q.useCallback(
|
|
15384
15382
|
(L, { fromUser: M }) => {
|
|
15385
|
-
x ||
|
|
15383
|
+
x || k(L), M && (a == null || a(L));
|
|
15386
15384
|
},
|
|
15387
15385
|
[x, a]
|
|
15388
15386
|
), V = Q.useCallback(
|
|
15389
15387
|
async (L) => {
|
|
15390
15388
|
L && L.preventDefault();
|
|
15391
|
-
const M = (
|
|
15389
|
+
const M = (T ?? "").trim();
|
|
15392
15390
|
if (!M && !h || q(M))
|
|
15393
15391
|
return;
|
|
15394
15392
|
const G = ++R.current;
|
|
15395
15393
|
_.current = {
|
|
15396
15394
|
id: G,
|
|
15397
15395
|
shouldClear: !0
|
|
15398
|
-
},
|
|
15396
|
+
}, S(() => {
|
|
15399
15397
|
var Z, j, K;
|
|
15400
15398
|
try {
|
|
15401
15399
|
const X = u(M);
|
|
15402
15400
|
X && typeof X.then == "function" ? X.then(() => {
|
|
15403
15401
|
var oe, he;
|
|
15404
|
-
((oe = _.current) == null ? void 0 : oe.id) === G && _.current.shouldClear && (x || (
|
|
15402
|
+
((oe = _.current) == null ? void 0 : oe.id) === G && _.current.shouldClear && (x || (k(""), C.current && (C.current.style.height = "auto"), a == null || a(""))), ((he = _.current) == null ? void 0 : he.id) === G && (_.current = null);
|
|
15405
15403
|
}).catch(() => {
|
|
15406
15404
|
var oe;
|
|
15407
15405
|
((oe = _.current) == null ? void 0 : oe.id) === G && (_.current = null);
|
|
15408
|
-
}) : (((Z = _.current) == null ? void 0 : Z.id) === G && _.current.shouldClear && (x || (
|
|
15406
|
+
}) : (((Z = _.current) == null ? void 0 : Z.id) === G && _.current.shouldClear && (x || (k(""), C.current && (C.current.style.height = "auto"), a == null || a(""))), ((j = _.current) == null ? void 0 : j.id) === G && (_.current = null));
|
|
15409
15407
|
} catch {
|
|
15410
15408
|
((K = _.current) == null ? void 0 : K.id) === G && (_.current = null);
|
|
15411
15409
|
}
|
|
15412
15410
|
});
|
|
15413
15411
|
},
|
|
15414
|
-
[
|
|
15412
|
+
[T, u, h, x, a, q]
|
|
15415
15413
|
), W = Q.useCallback((L) => {
|
|
15416
15414
|
const M = L.target.value;
|
|
15417
15415
|
re(M, { fromUser: !0 }), _.current && (_.current.shouldClear = !1), C.current && (C.current.style.height = "auto", C.current.style.height = `${C.current.scrollHeight}px`), $ && q(M.trim());
|
|
@@ -15427,7 +15425,7 @@ function wC({
|
|
|
15427
15425
|
fp,
|
|
15428
15426
|
{
|
|
15429
15427
|
ref: C,
|
|
15430
|
-
value:
|
|
15428
|
+
value: T,
|
|
15431
15429
|
onChange: W,
|
|
15432
15430
|
onKeyDown: ee,
|
|
15433
15431
|
placeholder: t ? "Edit your message..." : n,
|
|
@@ -15463,7 +15461,7 @@ function wC({
|
|
|
15463
15461
|
size: "icon",
|
|
15464
15462
|
className: `shrink-0 ${m ?? ""}`,
|
|
15465
15463
|
title: t ? "Save changes" : "Send message",
|
|
15466
|
-
disabled: o || !
|
|
15464
|
+
disabled: o || !T.trim() && !h || v || r,
|
|
15467
15465
|
children: /* @__PURE__ */ d.jsx(Dh, { size: 16 })
|
|
15468
15466
|
}
|
|
15469
15467
|
) })
|
|
@@ -15491,10 +15489,10 @@ function pp({
|
|
|
15491
15489
|
allowEmptySend: x = !1,
|
|
15492
15490
|
inputError: b = null
|
|
15493
15491
|
}) {
|
|
15494
|
-
const [
|
|
15495
|
-
|
|
15492
|
+
const [k, T] = ce([]), v = ke(null), S = ke(null), [C, R] = ce(0), [_, D] = ce(0), [$, F] = ce(!1), [O, E] = ce(null), [q, B] = ce(null), re = ie(() => {
|
|
15493
|
+
v.current && (v.current.value = ""), S.current && (S.current.value = ""), R((M) => M + 1), D((M) => M + 1);
|
|
15496
15494
|
}, []), V = ie((M) => {
|
|
15497
|
-
|
|
15495
|
+
T((G) => {
|
|
15498
15496
|
const Z = [...G, ...M];
|
|
15499
15497
|
return g == null || g(Z), Z;
|
|
15500
15498
|
});
|
|
@@ -15505,7 +15503,7 @@ function pp({
|
|
|
15505
15503
|
},
|
|
15506
15504
|
[V]
|
|
15507
15505
|
), ee = ie((M) => {
|
|
15508
|
-
|
|
15506
|
+
T((G) => {
|
|
15509
15507
|
const Z = G.filter((j, K) => K !== M);
|
|
15510
15508
|
return Z.length === 0 && re(), g == null || g(Z), Z;
|
|
15511
15509
|
});
|
|
@@ -15525,12 +15523,12 @@ function pp({
|
|
|
15525
15523
|
}
|
|
15526
15524
|
},
|
|
15527
15525
|
[m, y, re]
|
|
15528
|
-
), P =
|
|
15526
|
+
), P = Oe(() => x || k.length > 0, [x, k]), N = ie(
|
|
15529
15527
|
async (M) => {
|
|
15530
|
-
const Z = await n(M,
|
|
15531
|
-
return
|
|
15528
|
+
const Z = await n(M, k);
|
|
15529
|
+
return k.length > 0 && (T([]), g == null || g([]), re()), Z;
|
|
15532
15530
|
},
|
|
15533
|
-
[n, re,
|
|
15531
|
+
[n, re, k]
|
|
15534
15532
|
), L = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${s ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${b ? "border-red-400" : ""} ${f.textarea || ""} ${c}`;
|
|
15535
15533
|
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
15536
15534
|
(p || h) && /* @__PURE__ */ d.jsxs("div", { className: "mb-3 space-y-3", children: [
|
|
@@ -15538,7 +15536,7 @@ function pp({
|
|
|
15538
15536
|
/* @__PURE__ */ d.jsx(
|
|
15539
15537
|
"input",
|
|
15540
15538
|
{
|
|
15541
|
-
ref:
|
|
15539
|
+
ref: v,
|
|
15542
15540
|
type: "file",
|
|
15543
15541
|
multiple: !0,
|
|
15544
15542
|
onChange: W,
|
|
@@ -15546,7 +15544,7 @@ function pp({
|
|
|
15546
15544
|
},
|
|
15547
15545
|
C
|
|
15548
15546
|
),
|
|
15549
|
-
|
|
15547
|
+
k.length > 0 && /* @__PURE__ */ d.jsx("div", { className: "flex flex-wrap gap-2", children: k.map((M, G) => /* @__PURE__ */ d.jsxs(
|
|
15550
15548
|
"div",
|
|
15551
15549
|
{
|
|
15552
15550
|
className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100",
|
|
@@ -15573,7 +15571,7 @@ function pp({
|
|
|
15573
15571
|
/* @__PURE__ */ d.jsx(
|
|
15574
15572
|
"input",
|
|
15575
15573
|
{
|
|
15576
|
-
ref:
|
|
15574
|
+
ref: S,
|
|
15577
15575
|
type: "file",
|
|
15578
15576
|
accept: ".xls,.xlsx,.xlsm",
|
|
15579
15577
|
onChange: U,
|
|
@@ -15609,7 +15607,7 @@ function pp({
|
|
|
15609
15607
|
{
|
|
15610
15608
|
onClick: () => {
|
|
15611
15609
|
var M;
|
|
15612
|
-
return (M =
|
|
15610
|
+
return (M = v.current) == null ? void 0 : M.click();
|
|
15613
15611
|
},
|
|
15614
15612
|
className: "cursor-pointer",
|
|
15615
15613
|
children: [
|
|
@@ -15623,7 +15621,7 @@ function pp({
|
|
|
15623
15621
|
{
|
|
15624
15622
|
onClick: () => {
|
|
15625
15623
|
var M;
|
|
15626
|
-
$ || (M =
|
|
15624
|
+
$ || (M = S.current) == null || M.click();
|
|
15627
15625
|
},
|
|
15628
15626
|
className: `cursor-pointer ${$ ? "opacity-60 pointer-events-none" : ""}`,
|
|
15629
15627
|
children: [
|
|
@@ -15983,7 +15981,7 @@ var Ua = "ScrollArea", [Op, gk] = Ln(Ua), [OC, Vt] = Op(Ua), Dp = w.forwardRef(
|
|
|
15983
15981
|
dir: o,
|
|
15984
15982
|
scrollHideDelay: s = 600,
|
|
15985
15983
|
...i
|
|
15986
|
-
} = e, [a, u] = w.useState(null), [l, c] = w.useState(null), [f, p] = w.useState(null), [h, m] = w.useState(null), [g, y] = w.useState(null), [x, b] = w.useState(0), [
|
|
15984
|
+
} = e, [a, u] = w.useState(null), [l, c] = w.useState(null), [f, p] = w.useState(null), [h, m] = w.useState(null), [g, y] = w.useState(null), [x, b] = w.useState(0), [k, T] = w.useState(0), [v, S] = w.useState(!1), [C, R] = w.useState(!1), _ = Ge(t, ($) => u($)), D = fa(o);
|
|
15987
15985
|
return /* @__PURE__ */ d.jsx(
|
|
15988
15986
|
OC,
|
|
15989
15987
|
{
|
|
@@ -15998,14 +15996,14 @@ var Ua = "ScrollArea", [Op, gk] = Ln(Ua), [OC, Vt] = Op(Ua), Dp = w.forwardRef(
|
|
|
15998
15996
|
onContentChange: p,
|
|
15999
15997
|
scrollbarX: h,
|
|
16000
15998
|
onScrollbarXChange: m,
|
|
16001
|
-
scrollbarXEnabled:
|
|
16002
|
-
onScrollbarXEnabledChange:
|
|
15999
|
+
scrollbarXEnabled: v,
|
|
16000
|
+
onScrollbarXEnabledChange: S,
|
|
16003
16001
|
scrollbarY: g,
|
|
16004
16002
|
onScrollbarYChange: y,
|
|
16005
16003
|
scrollbarYEnabled: C,
|
|
16006
16004
|
onScrollbarYEnabledChange: R,
|
|
16007
16005
|
onCornerWidthChange: b,
|
|
16008
|
-
onCornerHeightChange:
|
|
16006
|
+
onCornerHeightChange: T,
|
|
16009
16007
|
children: /* @__PURE__ */ d.jsx(
|
|
16010
16008
|
je.div,
|
|
16011
16009
|
{
|
|
@@ -16016,7 +16014,7 @@ var Ua = "ScrollArea", [Op, gk] = Ln(Ua), [OC, Vt] = Op(Ua), Dp = w.forwardRef(
|
|
|
16016
16014
|
position: "relative",
|
|
16017
16015
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
16018
16016
|
"--radix-scroll-area-corner-width": x + "px",
|
|
16019
|
-
"--radix-scroll-area-corner-height":
|
|
16017
|
+
"--radix-scroll-area-corner-height": k + "px",
|
|
16020
16018
|
...e.style
|
|
16021
16019
|
}
|
|
16022
16020
|
}
|
|
@@ -16305,7 +16303,7 @@ var DC = w.forwardRef((e, t) => {
|
|
|
16305
16303
|
onWheelScroll: c,
|
|
16306
16304
|
onResize: f,
|
|
16307
16305
|
...p
|
|
16308
|
-
} = e, h = Vt(hn, n), [m, g] = w.useState(null), y = Ge(t, (_) => g(_)), x = w.useRef(null), b = w.useRef(""),
|
|
16306
|
+
} = e, h = Vt(hn, n), [m, g] = w.useState(null), y = Ge(t, (_) => g(_)), x = w.useRef(null), b = w.useRef(""), k = h.viewport, T = r.content - r.viewport, v = xt(c), S = xt(u), C = Fs(f, 10);
|
|
16309
16307
|
function R(_) {
|
|
16310
16308
|
if (x.current) {
|
|
16311
16309
|
const D = _.clientX - x.current.left, $ = _.clientY - x.current.top;
|
|
@@ -16315,10 +16313,10 @@ var DC = w.forwardRef((e, t) => {
|
|
|
16315
16313
|
return w.useEffect(() => {
|
|
16316
16314
|
const _ = (D) => {
|
|
16317
16315
|
const $ = D.target;
|
|
16318
|
-
(m == null ? void 0 : m.contains($)) &&
|
|
16316
|
+
(m == null ? void 0 : m.contains($)) && v(D, T);
|
|
16319
16317
|
};
|
|
16320
16318
|
return document.addEventListener("wheel", _, { passive: !1 }), () => document.removeEventListener("wheel", _, { passive: !1 });
|
|
16321
|
-
}, [
|
|
16319
|
+
}, [k, m, T, v]), w.useEffect(S, [r, S]), kr(m, C), kr(h.content, C), /* @__PURE__ */ d.jsx(
|
|
16322
16320
|
zC,
|
|
16323
16321
|
{
|
|
16324
16322
|
scope: n,
|
|
@@ -16326,7 +16324,7 @@ var DC = w.forwardRef((e, t) => {
|
|
|
16326
16324
|
hasThumb: o,
|
|
16327
16325
|
onThumbChange: xt(s),
|
|
16328
16326
|
onThumbPointerUp: xt(i),
|
|
16329
|
-
onThumbPositionChange:
|
|
16327
|
+
onThumbPositionChange: S,
|
|
16330
16328
|
onThumbPointerDown: xt(a),
|
|
16331
16329
|
children: /* @__PURE__ */ d.jsx(
|
|
16332
16330
|
je.div,
|
|
@@ -16572,24 +16570,24 @@ function qo({
|
|
|
16572
16570
|
onExcelUploadSuccess: y,
|
|
16573
16571
|
onError: x,
|
|
16574
16572
|
renderArtifactsInline: b = !0,
|
|
16575
|
-
emptyMessage:
|
|
16573
|
+
emptyMessage: k
|
|
16576
16574
|
}) {
|
|
16577
16575
|
var Z, j, K;
|
|
16578
|
-
const { currentThreadId:
|
|
16579
|
-
submit:
|
|
16576
|
+
const { currentThreadId: T } = ys(), v = bs(), S = ku(), C = ib({
|
|
16577
|
+
submit: S.submit,
|
|
16580
16578
|
chatRequest: { payload: p },
|
|
16581
|
-
lastCheckpointId: ((Z =
|
|
16582
|
-
lastCheckpointNs: ((j =
|
|
16579
|
+
lastCheckpointId: ((Z = v.checkpoint) == null ? void 0 : Z.id) ?? null,
|
|
16580
|
+
lastCheckpointNs: ((j = v.checkpoint) == null ? void 0 : j.namespace) ?? null,
|
|
16583
16581
|
onMessageSent: g,
|
|
16584
16582
|
onExcelUploadSuccess: y,
|
|
16585
16583
|
onError: x,
|
|
16586
16584
|
enableMessageEditing: a,
|
|
16587
|
-
messages:
|
|
16585
|
+
messages: v.messages,
|
|
16588
16586
|
setPendingAssistantResponse: () => {
|
|
16589
16587
|
},
|
|
16590
16588
|
// Handled by stream state
|
|
16591
|
-
activeThreadId:
|
|
16592
|
-
}), R =
|
|
16589
|
+
activeThreadId: T ?? null
|
|
16590
|
+
}), R = v.interrupt, _ = R ? mu(R.id) : null, D = _ !== null ? { type: "interrupt", id: _ } : null, [$, F] = ce(!1), [O, E] = ce("desktop"), [q, B] = ce(!1), [re, V] = ce(null), W = ke(null);
|
|
16593
16591
|
ze(() => {
|
|
16594
16592
|
const X = () => {
|
|
16595
16593
|
const oe = window.innerWidth;
|
|
@@ -16600,38 +16598,38 @@ function qo({
|
|
|
16600
16598
|
const ee = ie(
|
|
16601
16599
|
async (X, oe, he) => {
|
|
16602
16600
|
try {
|
|
16603
|
-
F(!0), await
|
|
16601
|
+
F(!0), await v.respondToInterrupt(X, oe, he);
|
|
16604
16602
|
} catch (ve) {
|
|
16605
16603
|
console.error("Failed to respond to interrupt:", ve);
|
|
16606
16604
|
} finally {
|
|
16607
16605
|
F(!1);
|
|
16608
16606
|
}
|
|
16609
16607
|
},
|
|
16610
|
-
[
|
|
16608
|
+
[v]
|
|
16611
16609
|
), U = ie(
|
|
16612
16610
|
async (X) => {
|
|
16613
16611
|
var oe, he;
|
|
16614
16612
|
B(!0);
|
|
16615
16613
|
try {
|
|
16616
16614
|
if (!X)
|
|
16617
|
-
await
|
|
16615
|
+
await v.returnToLatest(), (oe = W.current) == null || oe.scrollToLatest();
|
|
16618
16616
|
else {
|
|
16619
|
-
const ve =
|
|
16620
|
-
await
|
|
16617
|
+
const ve = v.checkpoints.find((_e) => _e.checkpointId === X);
|
|
16618
|
+
await v.navigateToCheckpoint(X, (ve == null ? void 0 : ve.checkpointNs) ?? null), (he = W.current) == null || he.scrollToTop();
|
|
16621
16619
|
}
|
|
16622
16620
|
} finally {
|
|
16623
16621
|
B(!1);
|
|
16624
16622
|
}
|
|
16625
16623
|
},
|
|
16626
|
-
[
|
|
16624
|
+
[v]
|
|
16627
16625
|
), P = l ?? {
|
|
16628
16626
|
toolRenderers: c,
|
|
16629
16627
|
toolArtifactRenderers: f,
|
|
16630
16628
|
getToolExpandable: (X) => X.name !== "ask_user_choice"
|
|
16631
16629
|
}, N = !!R || $, L = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${h.container || ""}`, M = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 ${R ? "pb-32" : ""} bg-transparent ${h.messagesArea || ""}`, G = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${h.inputArea || ""}`;
|
|
16632
16630
|
return /* @__PURE__ */ d.jsxs("div", { className: L, children: [
|
|
16633
|
-
!!
|
|
16634
|
-
/* @__PURE__ */ d.jsx("span", { children:
|
|
16631
|
+
!!S.error && !C.dismissError && /* @__PURE__ */ d.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
|
|
16632
|
+
/* @__PURE__ */ d.jsx("span", { children: S.error }),
|
|
16635
16633
|
/* @__PURE__ */ d.jsx(Ze, { variant: "ghost", size: "sm", onClick: () => C.setDismissError(!0), className: "text-red-800 hover:bg-red-100", children: /* @__PURE__ */ d.jsx(Go, { size: 16 }) })
|
|
16636
16634
|
] }),
|
|
16637
16635
|
/* @__PURE__ */ d.jsxs("div", { className: `relative ${M}`, style: n ? { maxHeight: n } : void 0, children: [
|
|
@@ -16646,11 +16644,11 @@ function qo({
|
|
|
16646
16644
|
editingMessageId: C.editingMessageId,
|
|
16647
16645
|
showToolMessages: u,
|
|
16648
16646
|
followNewMessages: o,
|
|
16649
|
-
showThinkingIndicator:
|
|
16647
|
+
showThinkingIndicator: S.isStreaming,
|
|
16650
16648
|
streamingDebounceMs: r,
|
|
16651
16649
|
toolConfig: P,
|
|
16652
|
-
checkpointIndex:
|
|
16653
|
-
activeCheckpointId: (K =
|
|
16650
|
+
checkpointIndex: v.checkpointIndex,
|
|
16651
|
+
activeCheckpointId: (K = v.checkpoint) == null ? void 0 : K.id,
|
|
16654
16652
|
onSelectCheckpoint: U,
|
|
16655
16653
|
pendingInterrupt: R,
|
|
16656
16654
|
onEdit: C.startEditing,
|
|
@@ -16666,9 +16664,9 @@ function qo({
|
|
|
16666
16664
|
ref: W,
|
|
16667
16665
|
className: "h-full",
|
|
16668
16666
|
style: { height: "100%" },
|
|
16669
|
-
messages: C.displayMessages ??
|
|
16670
|
-
isStreaming:
|
|
16671
|
-
emptyMessage:
|
|
16667
|
+
messages: C.displayMessages ?? v.messages,
|
|
16668
|
+
isStreaming: S.isStreaming,
|
|
16669
|
+
emptyMessage: k
|
|
16672
16670
|
}
|
|
16673
16671
|
)
|
|
16674
16672
|
}
|
|
@@ -16681,13 +16679,13 @@ function qo({
|
|
|
16681
16679
|
toolCall: re
|
|
16682
16680
|
}
|
|
16683
16681
|
),
|
|
16684
|
-
(
|
|
16682
|
+
(S.connectionState === "reconnecting" || S.connectionState === "connecting") && /* @__PURE__ */ d.jsx("div", { className: "pointer-events-none absolute top-3 right-3 z-20 rounded-full bg-muted/80 px-3 py-1 text-xs font-medium text-foreground shadow-sm backdrop-blur-sm dark:bg-muted/60", children: /* @__PURE__ */ d.jsxs("span", { className: "flex items-center gap-2", children: [
|
|
16685
16683
|
/* @__PURE__ */ d.jsx(Vn, { className: "h-3 w-3 animate-spin" }),
|
|
16686
|
-
|
|
16684
|
+
S.connectionState === "reconnecting" ? "Reconnecting…" : "Connecting…"
|
|
16687
16685
|
] }) }),
|
|
16688
|
-
|
|
16686
|
+
v.isLoading || q ? /* @__PURE__ */ d.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
|
|
16689
16687
|
/* @__PURE__ */ d.jsx(Vn, { className: "h-6 w-6 animate-spin" }),
|
|
16690
|
-
/* @__PURE__ */ d.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children:
|
|
16688
|
+
/* @__PURE__ */ d.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children: v.isLoading ? "Loading messages…" : "Loading checkpoint…" })
|
|
16691
16689
|
] }) : null,
|
|
16692
16690
|
R && D && /* @__PURE__ */ d.jsx("div", { className: "pointer-events-auto absolute inset-x-0 bottom-6 z-30 flex justify-center px-4", children: /* @__PURE__ */ d.jsx("div", { className: "w-full max-w-3xl", children: /* @__PURE__ */ d.jsx(
|
|
16693
16691
|
md,
|
|
@@ -16718,11 +16716,11 @@ function qo({
|
|
|
16718
16716
|
onComposerChange: C.handleComposerChange,
|
|
16719
16717
|
onSend: C.handleSendMessage,
|
|
16720
16718
|
onCancelEdit: C.cancelEditing,
|
|
16721
|
-
onStop:
|
|
16719
|
+
onStop: S.stop,
|
|
16722
16720
|
editingMessageId: C.editingMessageId,
|
|
16723
16721
|
editingInitialValue: C.editingInitialValue,
|
|
16724
16722
|
placeholder: C.editingMessageId ? "Edit your message..." : t,
|
|
16725
|
-
isStreaming:
|
|
16723
|
+
isStreaming: S.isStreaming,
|
|
16726
16724
|
disabled: N,
|
|
16727
16725
|
enableFileUpload: s,
|
|
16728
16726
|
enableExcelUpload: i,
|
|
@@ -16755,28 +16753,28 @@ var $r = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', rT = '[cmdk-group-head
|
|
|
16755
16753
|
let n = mr(() => {
|
|
16756
16754
|
var P, N;
|
|
16757
16755
|
return { search: "", value: (N = (P = e.value) != null ? P : e.defaultValue) != null ? N : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
16758
|
-
}), r = mr(() => /* @__PURE__ */ new Set()), o = mr(() => /* @__PURE__ */ new Map()), s = mr(() => /* @__PURE__ */ new Map()), i = mr(() => /* @__PURE__ */ new Set()), a = th(e), { label: u, children: l, value: c, onValueChange: f, filter: p, shouldFilter: h, loop: m, disablePointerSelection: g = !1, vimBindings: y = !0, ...x } = e, b = Lt(),
|
|
16756
|
+
}), r = mr(() => /* @__PURE__ */ new Set()), o = mr(() => /* @__PURE__ */ new Map()), s = mr(() => /* @__PURE__ */ new Map()), i = mr(() => /* @__PURE__ */ new Set()), a = th(e), { label: u, children: l, value: c, onValueChange: f, filter: p, shouldFilter: h, loop: m, disablePointerSelection: g = !1, vimBindings: y = !0, ...x } = e, b = Lt(), k = Lt(), T = Lt(), v = w.useRef(null), S = mT();
|
|
16759
16757
|
nr(() => {
|
|
16760
16758
|
if (c !== void 0) {
|
|
16761
16759
|
let P = c.trim();
|
|
16762
16760
|
n.current.value = P, C.emit();
|
|
16763
16761
|
}
|
|
16764
16762
|
}, [c]), nr(() => {
|
|
16765
|
-
|
|
16763
|
+
S(6, O);
|
|
16766
16764
|
}, []);
|
|
16767
16765
|
let C = w.useMemo(() => ({ subscribe: (P) => (i.current.add(P), () => i.current.delete(P)), snapshot: () => n.current, setState: (P, N, L) => {
|
|
16768
16766
|
var M, G, Z, j;
|
|
16769
16767
|
if (!Object.is(n.current[P], N)) {
|
|
16770
|
-
if (n.current[P] = N, P === "search") F(), D(),
|
|
16768
|
+
if (n.current[P] = N, P === "search") F(), D(), S(1, $);
|
|
16771
16769
|
else if (P === "value") {
|
|
16772
16770
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
16773
|
-
let K = document.getElementById(
|
|
16771
|
+
let K = document.getElementById(T);
|
|
16774
16772
|
K ? K.focus() : (M = document.getElementById(b)) == null || M.focus();
|
|
16775
16773
|
}
|
|
16776
|
-
if (
|
|
16774
|
+
if (S(7, () => {
|
|
16777
16775
|
var K;
|
|
16778
16776
|
n.current.selectedItemId = (K = E()) == null ? void 0 : K.id, C.emit();
|
|
16779
|
-
}), L ||
|
|
16777
|
+
}), L || S(5, O), ((G = a.current) == null ? void 0 : G.value) !== void 0) {
|
|
16780
16778
|
let K = N ?? "";
|
|
16781
16779
|
(j = (Z = a.current).onValueChange) == null || j.call(Z, K);
|
|
16782
16780
|
return;
|
|
@@ -16788,20 +16786,20 @@ var $r = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', rT = '[cmdk-group-head
|
|
|
16788
16786
|
i.current.forEach((P) => P());
|
|
16789
16787
|
} }), []), R = w.useMemo(() => ({ value: (P, N, L) => {
|
|
16790
16788
|
var M;
|
|
16791
|
-
N !== ((M = s.current.get(P)) == null ? void 0 : M.value) && (s.current.set(P, { value: N, keywords: L }), n.current.filtered.items.set(P, _(N, L)),
|
|
16789
|
+
N !== ((M = s.current.get(P)) == null ? void 0 : M.value) && (s.current.set(P, { value: N, keywords: L }), n.current.filtered.items.set(P, _(N, L)), S(2, () => {
|
|
16792
16790
|
D(), C.emit();
|
|
16793
16791
|
}));
|
|
16794
|
-
}, item: (P, N) => (r.current.add(P), N && (o.current.has(N) ? o.current.get(N).add(P) : o.current.set(N, /* @__PURE__ */ new Set([P]))),
|
|
16792
|
+
}, item: (P, N) => (r.current.add(P), N && (o.current.has(N) ? o.current.get(N).add(P) : o.current.set(N, /* @__PURE__ */ new Set([P]))), S(3, () => {
|
|
16795
16793
|
F(), D(), n.current.value || $(), C.emit();
|
|
16796
16794
|
}), () => {
|
|
16797
16795
|
s.current.delete(P), r.current.delete(P), n.current.filtered.items.delete(P);
|
|
16798
16796
|
let L = E();
|
|
16799
|
-
|
|
16797
|
+
S(4, () => {
|
|
16800
16798
|
F(), (L == null ? void 0 : L.getAttribute("id")) === P && $(), C.emit();
|
|
16801
16799
|
});
|
|
16802
16800
|
}), group: (P) => (o.current.has(P) || o.current.set(P, /* @__PURE__ */ new Set()), () => {
|
|
16803
16801
|
s.current.delete(P), o.current.delete(P);
|
|
16804
|
-
}), filter: () => a.current.shouldFilter, label: u || e["aria-label"], getDisablePointerSelection: () => a.current.disablePointerSelection, listId: b, inputId:
|
|
16802
|
+
}), filter: () => a.current.shouldFilter, label: u || e["aria-label"], getDisablePointerSelection: () => a.current.disablePointerSelection, listId: b, inputId: T, labelId: k, listInnerRef: v }), []);
|
|
16805
16803
|
function _(P, N) {
|
|
16806
16804
|
var L, M;
|
|
16807
16805
|
let G = (M = (L = a.current) == null ? void 0 : L.filter) != null ? M : oT;
|
|
@@ -16817,7 +16815,7 @@ var $r = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', rT = '[cmdk-group-head
|
|
|
16817
16815
|
Z = Math.max(K, Z);
|
|
16818
16816
|
}), N.push([M, Z]);
|
|
16819
16817
|
});
|
|
16820
|
-
let L =
|
|
16818
|
+
let L = v.current;
|
|
16821
16819
|
q().sort((M, G) => {
|
|
16822
16820
|
var Z, j;
|
|
16823
16821
|
let K = M.getAttribute("id"), X = G.getAttribute("id");
|
|
@@ -16827,7 +16825,7 @@ var $r = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', rT = '[cmdk-group-head
|
|
|
16827
16825
|
G ? G.appendChild(M.parentElement === G ? M : M.closest(`${hi} > *`)) : L.appendChild(M.parentElement === L ? M : M.closest(`${hi} > *`));
|
|
16828
16826
|
}), N.sort((M, G) => G[1] - M[1]).forEach((M) => {
|
|
16829
16827
|
var G;
|
|
16830
|
-
let Z = (G =
|
|
16828
|
+
let Z = (G = v.current) == null ? void 0 : G.querySelector(`${$r}[${hr}="${encodeURIComponent(M[0])}"]`);
|
|
16831
16829
|
Z == null || Z.parentElement.appendChild(Z);
|
|
16832
16830
|
});
|
|
16833
16831
|
}
|
|
@@ -16860,11 +16858,11 @@ var $r = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', rT = '[cmdk-group-head
|
|
|
16860
16858
|
}
|
|
16861
16859
|
function E() {
|
|
16862
16860
|
var P;
|
|
16863
|
-
return (P =
|
|
16861
|
+
return (P = v.current) == null ? void 0 : P.querySelector(`${Xp}[aria-selected="true"]`);
|
|
16864
16862
|
}
|
|
16865
16863
|
function q() {
|
|
16866
16864
|
var P;
|
|
16867
|
-
return Array.from(((P =
|
|
16865
|
+
return Array.from(((P = v.current) == null ? void 0 : P.querySelectorAll(Rc)) || []);
|
|
16868
16866
|
}
|
|
16869
16867
|
function B(P) {
|
|
16870
16868
|
let N = q()[P];
|
|
@@ -16932,21 +16930,21 @@ var $r = '[cmdk-group=""]', hi = '[cmdk-group-items=""]', rT = '[cmdk-group-head
|
|
|
16932
16930
|
nr(() => {
|
|
16933
16931
|
if (!l) return a.item(o, i == null ? void 0 : i.id);
|
|
16934
16932
|
}, [l]);
|
|
16935
|
-
let c = nh(o, s, [e.value, e.children, s], e.keywords), f = qa(), p = Pn((
|
|
16933
|
+
let c = nh(o, s, [e.value, e.children, s], e.keywords), f = qa(), p = Pn((S) => S.value && S.value === c.current), h = Pn((S) => l || a.filter() === !1 ? !0 : S.search ? S.filtered.items.get(o) > 0 : !0);
|
|
16936
16934
|
w.useEffect(() => {
|
|
16937
|
-
let
|
|
16938
|
-
if (!(!
|
|
16935
|
+
let S = s.current;
|
|
16936
|
+
if (!(!S || e.disabled)) return S.addEventListener($i, m), () => S.removeEventListener($i, m);
|
|
16939
16937
|
}, [h, e.onSelect, e.disabled]);
|
|
16940
16938
|
function m() {
|
|
16941
|
-
var
|
|
16942
|
-
g(), (C = (
|
|
16939
|
+
var S, C;
|
|
16940
|
+
g(), (C = (S = u.current).onSelect) == null || C.call(S, c.current);
|
|
16943
16941
|
}
|
|
16944
16942
|
function g() {
|
|
16945
16943
|
f.setState("value", c.current, !0);
|
|
16946
16944
|
}
|
|
16947
16945
|
if (!h) return null;
|
|
16948
|
-
let { disabled: y, value: x, onSelect: b, forceMount:
|
|
16949
|
-
return w.createElement(je.div, { ref: Nn(s, t), ...
|
|
16946
|
+
let { disabled: y, value: x, onSelect: b, forceMount: k, keywords: T, ...v } = e;
|
|
16947
|
+
return w.createElement(je.div, { ref: Nn(s, t), ...v, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!y, "aria-selected": !!p, "data-disabled": !!y, "data-selected": !!p, onPointerMove: y || a.getDisablePointerSelection() ? void 0 : g, onClick: y ? void 0 : m }, e.children);
|
|
16950
16948
|
}), iT = w.forwardRef((e, t) => {
|
|
16951
16949
|
let { heading: n, children: r, forceMount: o, ...s } = e, i = Lt(), a = w.useRef(null), u = w.useRef(null), l = Lt(), c = wo(), f = Pn((h) => o || c.filter() === !1 ? !0 : h.search ? h.filtered.groups.has(i) : !0);
|
|
16952
16950
|
nr(() => c.group(i), []), nh(i, a, [e.value, e.heading, u]);
|
|
@@ -17141,10 +17139,10 @@ function Ec({
|
|
|
17141
17139
|
activeItemClassName: y,
|
|
17142
17140
|
secondaryLine: x
|
|
17143
17141
|
}) {
|
|
17144
|
-
const b = n === e.threadId,
|
|
17142
|
+
const b = n === e.threadId, k = Oe(
|
|
17145
17143
|
() => (m == null ? void 0 : m(e)) ?? e.title ?? e.threadId,
|
|
17146
17144
|
[m, e]
|
|
17147
|
-
),
|
|
17145
|
+
), T = () => o == null ? void 0 : o(e.threadId), v = (S) => s == null ? void 0 : s(e, S);
|
|
17148
17146
|
return /* @__PURE__ */ d.jsxs(
|
|
17149
17147
|
"div",
|
|
17150
17148
|
{
|
|
@@ -17153,7 +17151,7 @@ function Ec({
|
|
|
17153
17151
|
g,
|
|
17154
17152
|
t && (y ?? "bg-muted/70")
|
|
17155
17153
|
),
|
|
17156
|
-
onClick:
|
|
17154
|
+
onClick: T,
|
|
17157
17155
|
children: [
|
|
17158
17156
|
/* @__PURE__ */ d.jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
17159
17157
|
b ? /* @__PURE__ */ d.jsx(
|
|
@@ -17161,18 +17159,18 @@ function Ec({
|
|
|
17161
17159
|
{
|
|
17162
17160
|
className: "text-sm px-2 py-1 border rounded",
|
|
17163
17161
|
value: r,
|
|
17164
|
-
onChange: (
|
|
17162
|
+
onChange: (S) => i == null ? void 0 : i(S.target.value)
|
|
17165
17163
|
}
|
|
17166
|
-
) : /* @__PURE__ */ d.jsx("span", { className: "font-medium truncate", children:
|
|
17164
|
+
) : /* @__PURE__ */ d.jsx("span", { className: "font-medium truncate", children: k }),
|
|
17167
17165
|
x && /* @__PURE__ */ d.jsx("span", { className: "text-xs text-muted-foreground truncate", children: x }),
|
|
17168
17166
|
h && e.updatedAt && /* @__PURE__ */ d.jsx("span", { className: "text-[10px] text-muted-foreground", children: h(e.updatedAt) })
|
|
17169
17167
|
] }),
|
|
17170
17168
|
/* @__PURE__ */ d.jsx("div", { className: "flex items-center gap-1", children: b ? /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
17171
|
-
/* @__PURE__ */ d.jsx(Ze, { size: "sm", variant: "ghost", className: "h-7 px-2 text-xs", onClick: (
|
|
17172
|
-
|
|
17169
|
+
/* @__PURE__ */ d.jsx(Ze, { size: "sm", variant: "ghost", className: "h-7 px-2 text-xs", onClick: (S) => {
|
|
17170
|
+
S.stopPropagation(), a == null || a(e);
|
|
17173
17171
|
}, children: "Save" }),
|
|
17174
|
-
/* @__PURE__ */ d.jsx(Ze, { size: "sm", variant: "ghost", className: "h-7 px-2 text-xs", onClick: (
|
|
17175
|
-
|
|
17172
|
+
/* @__PURE__ */ d.jsx(Ze, { size: "sm", variant: "ghost", className: "h-7 px-2 text-xs", onClick: (S) => {
|
|
17173
|
+
S.stopPropagation(), u == null || u(e);
|
|
17176
17174
|
}, children: "Cancel" })
|
|
17177
17175
|
] }) : /* @__PURE__ */ d.jsxs(_a, { children: [
|
|
17178
17176
|
/* @__PURE__ */ d.jsx(Pa, { asChild: !0, children: /* @__PURE__ */ d.jsxs(
|
|
@@ -17181,7 +17179,7 @@ function Ec({
|
|
|
17181
17179
|
size: "sm",
|
|
17182
17180
|
variant: "ghost",
|
|
17183
17181
|
className: "h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",
|
|
17184
|
-
onClick: (
|
|
17182
|
+
onClick: (S) => S.stopPropagation(),
|
|
17185
17183
|
children: [
|
|
17186
17184
|
/* @__PURE__ */ d.jsx(zh, { className: "h-4 w-4" }),
|
|
17187
17185
|
/* @__PURE__ */ d.jsx("span", { className: "sr-only", children: "Open menu" })
|
|
@@ -17189,14 +17187,14 @@ function Ec({
|
|
|
17189
17187
|
}
|
|
17190
17188
|
) }),
|
|
17191
17189
|
/* @__PURE__ */ d.jsxs(Ds, { align: "end", children: [
|
|
17192
|
-
f && /* @__PURE__ */ d.jsxs(Xn, { onClick: (
|
|
17193
|
-
|
|
17190
|
+
f && /* @__PURE__ */ d.jsxs(Xn, { onClick: (S) => {
|
|
17191
|
+
S.stopPropagation(), v(S);
|
|
17194
17192
|
}, children: [
|
|
17195
17193
|
/* @__PURE__ */ d.jsx(ro, { className: "mr-2 h-4 w-4" }),
|
|
17196
17194
|
/* @__PURE__ */ d.jsx("span", { children: "Rename" })
|
|
17197
17195
|
] }),
|
|
17198
|
-
l && /* @__PURE__ */ d.jsxs(Xn, { onClick: (
|
|
17199
|
-
|
|
17196
|
+
l && /* @__PURE__ */ d.jsxs(Xn, { onClick: (S) => {
|
|
17197
|
+
S.stopPropagation(), l(e);
|
|
17200
17198
|
}, children: [
|
|
17201
17199
|
/* @__PURE__ */ d.jsx(Bh, { className: "mr-2 h-4 w-4" }),
|
|
17202
17200
|
/* @__PURE__ */ d.jsx("span", { children: "Share" })
|
|
@@ -17204,8 +17202,8 @@ function Ec({
|
|
|
17204
17202
|
p && /* @__PURE__ */ d.jsxs(
|
|
17205
17203
|
Xn,
|
|
17206
17204
|
{
|
|
17207
|
-
onClick: (
|
|
17208
|
-
|
|
17205
|
+
onClick: (S) => {
|
|
17206
|
+
S.stopPropagation(), c == null || c(e);
|
|
17209
17207
|
},
|
|
17210
17208
|
className: "text-destructive focus:text-destructive",
|
|
17211
17209
|
children: [
|
|
@@ -17296,8 +17294,8 @@ var vT = w.forwardRef((e, t) => {
|
|
|
17296
17294
|
transitionDuration: b.style.transitionDuration,
|
|
17297
17295
|
animationName: b.style.animationName
|
|
17298
17296
|
}, b.style.transitionDuration = "0s", b.style.animationName = "none";
|
|
17299
|
-
const
|
|
17300
|
-
f.current =
|
|
17297
|
+
const k = b.getBoundingClientRect();
|
|
17298
|
+
f.current = k.height, h.current = k.width, y.current || (b.style.transitionDuration = x.current.transitionDuration, b.style.animationName = x.current.animationName), u(r);
|
|
17301
17299
|
}
|
|
17302
17300
|
}, [i.open, r]), /* @__PURE__ */ d.jsx(
|
|
17303
17301
|
je.div,
|
|
@@ -17372,11 +17370,11 @@ function Fi({
|
|
|
17372
17370
|
showHeader: y = !0,
|
|
17373
17371
|
shareTargets: x,
|
|
17374
17372
|
isLoadingShareTargets: b,
|
|
17375
|
-
shareTargetFilter:
|
|
17376
|
-
groupBy:
|
|
17377
|
-
filter:
|
|
17373
|
+
shareTargetFilter: k,
|
|
17374
|
+
groupBy: T,
|
|
17375
|
+
filter: v
|
|
17378
17376
|
}) {
|
|
17379
|
-
const { chatApi:
|
|
17377
|
+
const { chatApi: S, authApi: C } = lo(), {
|
|
17380
17378
|
threads: R,
|
|
17381
17379
|
sharedThreads: _,
|
|
17382
17380
|
currentThreadId: D,
|
|
@@ -17406,7 +17404,7 @@ function Fi({
|
|
|
17406
17404
|
ft(!1);
|
|
17407
17405
|
}
|
|
17408
17406
|
})();
|
|
17409
|
-
}, [Ae, x, dt.length, ct,
|
|
17407
|
+
}, [Ae, x, dt.length, ct, S]);
|
|
17410
17408
|
const _t = x ?? dt, Xe = b ?? ct, tt = m && m.length > 0 ? m : AT, pt = ET({ defaultView: p }), wt = g ?? pt, Le = f ?? wt.view, bt = ie(
|
|
17411
17409
|
(A) => {
|
|
17412
17410
|
f || wt.setView(A), h == null || h(A);
|
|
@@ -17426,11 +17424,11 @@ function Fi({
|
|
|
17426
17424
|
}
|
|
17427
17425
|
},
|
|
17428
17426
|
[Zt, q, Qe, U]
|
|
17429
|
-
), Bt =
|
|
17427
|
+
), Bt = Oe(() => {
|
|
17430
17428
|
const A = _t, H = Ve.trim().toLowerCase();
|
|
17431
|
-
return H ?
|
|
17432
|
-
}, [x, Ve,
|
|
17433
|
-
const A = Array.isArray(
|
|
17429
|
+
return H ? k ? A.filter((Y) => k(Y, H)) : A.filter((Y) => `${Y.label} ${Y.secondaryLabel ?? ""}`.toLowerCase().includes(H)) : A;
|
|
17430
|
+
}, [x, Ve, k]), vt = Le === "shared", $n = vt ? _ : L, Tt = v ? $n.filter(v) : $n, en = Oe(() => {
|
|
17431
|
+
const A = Array.isArray(T) ? T : [];
|
|
17434
17432
|
if (A.length === 0 || vt) return null;
|
|
17435
17433
|
const H = "Default", Y = (le) => {
|
|
17436
17434
|
if (!le) return "Older";
|
|
@@ -17478,7 +17476,7 @@ function Fi({
|
|
|
17478
17476
|
Object.values(le).forEach(xe);
|
|
17479
17477
|
}, Ne = ue(Tt, A);
|
|
17480
17478
|
return xe(Ne), { kind: "nested", groups: Ne };
|
|
17481
|
-
}, [Tt,
|
|
17479
|
+
}, [Tt, T, vt]), Fn = vt ? O : F, Be = vt ? "No shared conversations yet" : "No conversations yet", nt = (A) => {
|
|
17482
17480
|
const H = A.sharedAt ? ` • ${xn(A.sharedAt)}` : "";
|
|
17483
17481
|
return `Shared by ${A.sharedByUserId}${H}`;
|
|
17484
17482
|
}, tn = (A) => "sharedByUserId" in A;
|