teodor-new-chat-ui 4.1.1 → 4.1.3
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 +419 -424
- package/dist/index.umd.js +13 -13
- package/dist/types/api.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Ip = Object.defineProperty;
|
|
|
2
2
|
var Np = (e, t, n) => t in e ? Ip(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Ba = (e, t, n) => Np(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as m from "react";
|
|
5
|
-
import $, { createContext as Xr, useContext as ts, useReducer as Ap, useRef as it, useCallback as ze, useEffect as gt, useMemo as pt, useState as
|
|
5
|
+
import $, { createContext as Xr, useContext as ts, useReducer as Ap, useRef as it, useCallback as ze, useEffect as gt, useMemo as pt, useState as pe, createElement as yo, useLayoutEffect as jp } from "react";
|
|
6
6
|
import { Square as _p, Send as Pp, X as ur, ExternalLink as Op, Download as Mp, Image as Dp, FileText as Ha, Loader as Cc, Bot as Ua, Wrench as Lp, User as Fp, ChevronUp as jr, ChevronDown as cr, Paperclip as ui, Copy as Wa, Edit as Va, RotateCcw as di, ChevronRight as $p, Check as Wi, Circle as zp, Loader2 as fi, Edit3 as Tc, Plus as Bp, FileSpreadsheet as Hp, MessageSquarePlus as Up, MessageSquare as Wp, Calendar as Vp, Trash2 as Kp, Settings as qp, Server as Gp, EyeOff as Yp, Eye as Xp, Layout as Jp, MessageCircle as Zp, Save as Qp } from "lucide-react";
|
|
7
7
|
import { Slot as em, createSlot as mr } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as ns } from "class-variance-authority";
|
|
@@ -217,7 +217,7 @@ function om() {
|
|
|
217
217
|
var se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
218
|
X = new se();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function te(T, B) {
|
|
221
221
|
if (!T || V)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
@@ -289,7 +289,7 @@ function om() {
|
|
|
289
289
|
return typeof T == "function" && X.set(T, Fn), Fn;
|
|
290
290
|
}
|
|
291
291
|
function Le(T, B, Q) {
|
|
292
|
-
return
|
|
292
|
+
return te(T, !1);
|
|
293
293
|
}
|
|
294
294
|
function Ge(T) {
|
|
295
295
|
var B = T.prototype;
|
|
@@ -299,7 +299,7 @@ function om() {
|
|
|
299
299
|
if (T == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof T == "function")
|
|
302
|
-
return
|
|
302
|
+
return te(T, Ge(T));
|
|
303
303
|
if (typeof T == "string")
|
|
304
304
|
return P(T);
|
|
305
305
|
switch (T) {
|
|
@@ -324,7 +324,7 @@ function om() {
|
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var
|
|
327
|
+
var be = Object.prototype.hasOwnProperty, je = {}, Ye = x.ReactDebugCurrentFrame;
|
|
328
328
|
function Fe(T) {
|
|
329
329
|
if (T) {
|
|
330
330
|
var B = T._owner, Q = et(T.type, T._source, B ? B.type : null);
|
|
@@ -334,7 +334,7 @@ function om() {
|
|
|
334
334
|
}
|
|
335
335
|
function st(T, B, Q, Ce, Ve) {
|
|
336
336
|
{
|
|
337
|
-
var Je = Function.call.bind(
|
|
337
|
+
var Je = Function.call.bind(be);
|
|
338
338
|
for (var $e in T)
|
|
339
339
|
if (Je(T, $e)) {
|
|
340
340
|
var Pe = void 0;
|
|
@@ -361,7 +361,7 @@ function om() {
|
|
|
361
361
|
return Q;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function he(T) {
|
|
365
365
|
try {
|
|
366
366
|
return Se(T), !1;
|
|
367
367
|
} catch {
|
|
@@ -371,8 +371,8 @@ function om() {
|
|
|
371
371
|
function Se(T) {
|
|
372
372
|
return "" + T;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
if (
|
|
374
|
+
function ve(T) {
|
|
375
|
+
if (he(T))
|
|
376
376
|
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ae(T)), Se(T);
|
|
377
377
|
}
|
|
378
378
|
var Ie = x.ReactCurrentOwner, Xe = {
|
|
@@ -382,7 +382,7 @@ function om() {
|
|
|
382
382
|
__source: !0
|
|
383
383
|
}, Ue, lt;
|
|
384
384
|
function Et(T) {
|
|
385
|
-
if (
|
|
385
|
+
if (be.call(T, "ref")) {
|
|
386
386
|
var B = Object.getOwnPropertyDescriptor(T, "ref").get;
|
|
387
387
|
if (B && B.isReactWarning)
|
|
388
388
|
return !1;
|
|
@@ -390,7 +390,7 @@ function om() {
|
|
|
390
390
|
return T.ref !== void 0;
|
|
391
391
|
}
|
|
392
392
|
function yn(T) {
|
|
393
|
-
if (
|
|
393
|
+
if (be.call(T, "key")) {
|
|
394
394
|
var B = Object.getOwnPropertyDescriptor(T, "key").get;
|
|
395
395
|
if (B && B.isReactWarning)
|
|
396
396
|
return !1;
|
|
@@ -454,9 +454,9 @@ function om() {
|
|
|
454
454
|
function qe(T, B, Q, Ce, Ve) {
|
|
455
455
|
{
|
|
456
456
|
var Je, $e = {}, Pe = null, Ct = null;
|
|
457
|
-
Q !== void 0 && (
|
|
457
|
+
Q !== void 0 && (ve(Q), Pe = "" + Q), yn(B) && (ve(B.key), Pe = "" + B.key), Et(B) && (Ct = B.ref, G(B, Ve));
|
|
458
458
|
for (Je in B)
|
|
459
|
-
|
|
459
|
+
be.call(B, Je) && !Xe.hasOwnProperty(Je) && ($e[Je] = B[Je]);
|
|
460
460
|
if (T && T.defaultProps) {
|
|
461
461
|
var ct = T.defaultProps;
|
|
462
462
|
for (Je in ct)
|
|
@@ -510,7 +510,7 @@ Check the top-level render call using <` + Q + ">.");
|
|
|
510
510
|
return B;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ne(T, B) {
|
|
514
514
|
{
|
|
515
515
|
if (!T._store || T._store.validated || T.key != null)
|
|
516
516
|
return;
|
|
@@ -523,14 +523,14 @@ Check the top-level render call using <` + Q + ">.");
|
|
|
523
523
|
T && T._owner && T._owner !== kt.current && (Ce = " It was passed a child from " + D(T._owner.type) + "."), qt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', Q, Ce), qt(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function xe(T, B) {
|
|
527
527
|
{
|
|
528
528
|
if (typeof T != "object")
|
|
529
529
|
return;
|
|
530
530
|
if (Z(T))
|
|
531
531
|
for (var Q = 0; Q < T.length; Q++) {
|
|
532
532
|
var Ce = T[Q];
|
|
533
|
-
Dn(Ce) &&
|
|
533
|
+
Dn(Ce) && ne(Ce, B);
|
|
534
534
|
}
|
|
535
535
|
else if (Dn(T))
|
|
536
536
|
T._store && (T._store.validated = !0);
|
|
@@ -538,7 +538,7 @@ Check the top-level render call using <` + Q + ">.");
|
|
|
538
538
|
var Ve = g(T);
|
|
539
539
|
if (typeof Ve == "function" && Ve !== T.entries)
|
|
540
540
|
for (var Je = Ve.call(T), $e; !($e = Je.next()).done; )
|
|
541
|
-
Dn($e.value) &&
|
|
541
|
+
Dn($e.value) && ne($e.value, B);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
@@ -600,14 +600,14 @@ Check the top-level render call using <` + Q + ">.");
|
|
|
600
600
|
if (Ce)
|
|
601
601
|
if (Z($t)) {
|
|
602
602
|
for (var sr = 0; sr < $t.length; sr++)
|
|
603
|
-
|
|
603
|
+
xe($t[sr], T);
|
|
604
604
|
Object.freeze && Object.freeze($t);
|
|
605
605
|
} else
|
|
606
606
|
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
607
607
|
else
|
|
608
|
-
|
|
608
|
+
xe($t, T);
|
|
609
609
|
}
|
|
610
|
-
if (
|
|
610
|
+
if (be.call(B, "key")) {
|
|
611
611
|
var Fn = D(T), It = Object.keys(B).filter(function(kp) {
|
|
612
612
|
return kp !== "key";
|
|
613
613
|
}), Fs = It.length > 0 ? "{key: someKey, " + It.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
@@ -2896,7 +2896,7 @@ function Jg(e) {
|
|
|
2896
2896
|
return t[t.length - 1] || null;
|
|
2897
2897
|
}
|
|
2898
2898
|
function Zg(e = {}) {
|
|
2899
|
-
const t = pt(() => vn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] =
|
|
2899
|
+
const t = pt(() => vn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = pe(e.token ?? null), s = it(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = pe(!1), [u, d] = pe(null), [f, h] = pe(""), [p, w] = pe(null), [v, g] = pe(0), [x, b] = pe(!1), y = it(null), R = it(!0), S = it(0), C = ze((N) => {
|
|
2900
2900
|
o(N);
|
|
2901
2901
|
}, []), E = ze(() => {
|
|
2902
2902
|
var N;
|
|
@@ -2957,13 +2957,13 @@ function Zg(e = {}) {
|
|
|
2957
2957
|
credentials: i
|
|
2958
2958
|
});
|
|
2959
2959
|
if (!fe.ok || !fe.body) {
|
|
2960
|
-
const
|
|
2960
|
+
const be = await fe.text().catch(() => "");
|
|
2961
2961
|
throw console.debug(
|
|
2962
2962
|
"[use-chat] non-OK response",
|
|
2963
2963
|
fe.status,
|
|
2964
|
-
|
|
2964
|
+
be == null ? void 0 : be.slice(0, 500)
|
|
2965
2965
|
), new Error(
|
|
2966
|
-
`stream ${fe.status}${
|
|
2966
|
+
`stream ${fe.status}${be ? ": " + be : ""}`
|
|
2967
2967
|
);
|
|
2968
2968
|
}
|
|
2969
2969
|
b(!0);
|
|
@@ -2973,23 +2973,23 @@ function Zg(e = {}) {
|
|
|
2973
2973
|
let V = 0, X = null;
|
|
2974
2974
|
const se = () => {
|
|
2975
2975
|
if (P.length) {
|
|
2976
|
-
const
|
|
2977
|
-
P = [], R.current && h((je) => je +
|
|
2976
|
+
const be = P.join("");
|
|
2977
|
+
P = [], R.current && h((je) => je + be);
|
|
2978
2978
|
}
|
|
2979
2979
|
X = null;
|
|
2980
|
-
},
|
|
2980
|
+
}, te = () => {
|
|
2981
2981
|
typeof window < "u" && X == null && (X = requestAnimationFrame(se));
|
|
2982
2982
|
};
|
|
2983
2983
|
let Le = Date.now();
|
|
2984
2984
|
const Ge = setInterval(() => {
|
|
2985
|
-
var
|
|
2986
|
-
if (Date.now() - Le >
|
|
2985
|
+
var be;
|
|
2986
|
+
if (Date.now() - Le > 6e4) {
|
|
2987
2987
|
const je = "Stream idle timeout";
|
|
2988
|
-
d(je), D.abort(), (
|
|
2988
|
+
d(je), D.abort(), (be = M == null ? void 0 : M.onError) == null || be.call(M, je);
|
|
2989
2989
|
}
|
|
2990
2990
|
}, 5e3), et = 1024 * 1024;
|
|
2991
2991
|
try {
|
|
2992
|
-
const
|
|
2992
|
+
const be = fe.headers.get("X-Thread-Id") || fe.headers.get("x-thread-id"), je = fe.headers.get("X-Thread-Created") || fe.headers.get("x-thread-created"), Ye = be ?? null, Fe = String(je ?? "").toLowerCase() === "true";
|
|
2993
2993
|
for ((L = M == null ? void 0 : M.onOpen) == null || L.call(M, { threadId: Ye, created: Fe }); ; ) {
|
|
2994
2994
|
const { value: st, done: at } = await Re.read();
|
|
2995
2995
|
if (at) break;
|
|
@@ -3000,38 +3000,37 @@ function Zg(e = {}) {
|
|
|
3000
3000
|
`)) >= 0; ) {
|
|
3001
3001
|
const ae = z.slice(0, Z);
|
|
3002
3002
|
z = z.slice(Z + 2);
|
|
3003
|
-
const
|
|
3004
|
-
if (!
|
|
3003
|
+
const he = ex(ae);
|
|
3004
|
+
if (!he) continue;
|
|
3005
3005
|
let Se;
|
|
3006
3006
|
try {
|
|
3007
|
-
Se = JSON.parse(
|
|
3007
|
+
Se = JSON.parse(he);
|
|
3008
3008
|
} catch {
|
|
3009
|
-
console.debug("[use-chat] malformed SSE:",
|
|
3009
|
+
console.debug("[use-chat] malformed SSE:", he.slice(0, 200));
|
|
3010
3010
|
continue;
|
|
3011
3011
|
}
|
|
3012
|
-
const
|
|
3012
|
+
const ve = Qg(Se) ? Se.data : Se;
|
|
3013
3013
|
Le = Date.now();
|
|
3014
|
-
const Ie =
|
|
3014
|
+
const Ie = ve.seq;
|
|
3015
3015
|
if (Ie !== void 0) {
|
|
3016
3016
|
if (Ie <= V) {
|
|
3017
|
-
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Ie, lastProcessedSeq: V, type:
|
|
3017
|
+
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Ie, lastProcessedSeq: V, type: ve.type });
|
|
3018
3018
|
continue;
|
|
3019
3019
|
}
|
|
3020
3020
|
V > 0 && Ie > V + 1 && ((k = M == null ? void 0 : M.onGap) == null || k.call(M, { from: V, to: Ie })), V = Ie, S.current = Ie, g(Ie);
|
|
3021
3021
|
}
|
|
3022
|
-
if (O == null || O(
|
|
3023
|
-
P.push(
|
|
3024
|
-
else if (
|
|
3025
|
-
const Xe =
|
|
3026
|
-
Xe && e.autoAppendAssistant !== !1 && (P.push(Xe),
|
|
3027
|
-
} else
|
|
3028
|
-
X !== null && cancelAnimationFrame(X), se(), be.type === "checkpoint" ? w(be.checkpointId) : be.type === "error" && d(be.message);
|
|
3022
|
+
if (O == null || O(ve), ve.type === "token" && e.autoAppendAssistant !== !1)
|
|
3023
|
+
P.push(ve.content), te();
|
|
3024
|
+
else if (ve.type === "message_delta") {
|
|
3025
|
+
const Xe = ve.delta.filter((Ue) => Ue.type === "text").map((Ue) => Ue.text).join("");
|
|
3026
|
+
Xe && e.autoAppendAssistant !== !1 && (P.push(Xe), te());
|
|
3027
|
+
} else ve.type === "heartbeat" ? console.debug("[use-chat] heartbeat received") : (X !== null && cancelAnimationFrame(X), se(), ve.type === "checkpoint" ? w(ve.checkpointId) : ve.type === "error" && d(ve.message));
|
|
3029
3028
|
}
|
|
3030
3029
|
}
|
|
3031
3030
|
se();
|
|
3032
|
-
} catch (
|
|
3033
|
-
if (
|
|
3034
|
-
const je =
|
|
3031
|
+
} catch (be) {
|
|
3032
|
+
if (be.name !== "AbortError") {
|
|
3033
|
+
const je = be.message || String(be);
|
|
3035
3034
|
d(je), (U = M == null ? void 0 : M.onError) == null || U.call(M, je);
|
|
3036
3035
|
}
|
|
3037
3036
|
} finally {
|
|
@@ -3156,7 +3155,7 @@ function ox({
|
|
|
3156
3155
|
onError: i,
|
|
3157
3156
|
onThreadChange: a
|
|
3158
3157
|
}) {
|
|
3159
|
-
const { api: l, baseUrl: u } = Jc(), d = pt(() => vn(u), [u]), [f, h] =
|
|
3158
|
+
const { api: l, baseUrl: u } = Jc(), d = pt(() => vn(u), [u]), [f, h] = pe([]), [p, w] = pe(t), [v, g] = pe(!1), [x, b] = pe(!1), [y, R] = pe(!1), [S, C] = pe(!1), [E, I] = pe(null), [j, N] = pe(void 0), [O, M] = pe(void 0), {
|
|
3160
3159
|
state: D,
|
|
3161
3160
|
seed: _,
|
|
3162
3161
|
prepend: W,
|
|
@@ -3195,14 +3194,13 @@ function ox({
|
|
|
3195
3194
|
g(!1);
|
|
3196
3195
|
}
|
|
3197
3196
|
}, [l, i]), z = ze(async () => {
|
|
3198
|
-
|
|
3199
|
-
fe.current = !1;
|
|
3197
|
+
fe.current && (fe.current = !1, setTimeout(async () => {
|
|
3200
3198
|
try {
|
|
3201
3199
|
await ue();
|
|
3202
3200
|
} catch (G) {
|
|
3203
3201
|
console.error("[ChatSessionProvider] Failed to refresh threads after stream:", G);
|
|
3204
3202
|
}
|
|
3205
|
-
}
|
|
3203
|
+
}, 100));
|
|
3206
3204
|
}, [ue]), P = it(!1), V = ze(() => {
|
|
3207
3205
|
fe.current = !0, P.current || z();
|
|
3208
3206
|
}, [z]), X = ze(
|
|
@@ -3216,7 +3214,7 @@ function ox({
|
|
|
3216
3214
|
[W, _]
|
|
3217
3215
|
), se = ze(() => {
|
|
3218
3216
|
L([]), R(!1), C(!1), I(null), N(void 0), M(void 0);
|
|
3219
|
-
}, [L]),
|
|
3217
|
+
}, [L]), te = ze(({ from: G, to: le }) => {
|
|
3220
3218
|
const Ee = k.current;
|
|
3221
3219
|
Ee && console.warn(
|
|
3222
3220
|
`[ChatSessionProvider] Stream sequence gap detected (${G} -> ${le}) for thread ${Ee}`
|
|
@@ -3231,18 +3229,18 @@ function ox({
|
|
|
3231
3229
|
(We || Ee) && V();
|
|
3232
3230
|
},
|
|
3233
3231
|
[V, D.messages.length]
|
|
3234
|
-
), { startStream: Ge, stop: et, isStreaming:
|
|
3232
|
+
), { startStream: Ge, stop: et, isStreaming: be, error: je, setAuthToken: Ye } = tx({
|
|
3235
3233
|
baseUrl: d,
|
|
3236
3234
|
onThreadInfo: Le,
|
|
3237
3235
|
onMessageEvent: q,
|
|
3238
3236
|
onUnhandledEvent: (G) => {
|
|
3239
3237
|
console.warn(`[ChatSessionProvider] Unhandled stream event: ${G.type}`, G);
|
|
3240
3238
|
},
|
|
3241
|
-
onSequenceGap:
|
|
3239
|
+
onSequenceGap: te
|
|
3242
3240
|
});
|
|
3243
3241
|
gt(() => {
|
|
3244
|
-
P.current =
|
|
3245
|
-
}, [z,
|
|
3242
|
+
P.current = be, be || z();
|
|
3243
|
+
}, [z, be]), gt(() => {
|
|
3246
3244
|
var Ee;
|
|
3247
3245
|
const G = l.getAuthToken();
|
|
3248
3246
|
Ye(G);
|
|
@@ -3307,7 +3305,7 @@ function ox({
|
|
|
3307
3305
|
console.warn("[ChatSessionProvider] Failed to clear lastThreadId:", G);
|
|
3308
3306
|
}
|
|
3309
3307
|
}, "clearCurrentThread");
|
|
3310
|
-
}, [se, Re]),
|
|
3308
|
+
}, [se, Re]), he = ze(
|
|
3311
3309
|
async (G) => {
|
|
3312
3310
|
const le = await l.listCheckpoints(G);
|
|
3313
3311
|
return $g(le, G);
|
|
@@ -3319,7 +3317,7 @@ function ox({
|
|
|
3319
3317
|
await Z(k.current, G, le ?? void 0, !0);
|
|
3320
3318
|
},
|
|
3321
3319
|
[Z]
|
|
3322
|
-
),
|
|
3320
|
+
), ve = ze(async () => {
|
|
3323
3321
|
if (!k.current) throw new Error("No active thread");
|
|
3324
3322
|
await Z(k.current, void 0, void 0, !0);
|
|
3325
3323
|
}, [Z]), Ie = ze(
|
|
@@ -3384,24 +3382,21 @@ function ox({
|
|
|
3384
3382
|
nodeFilter: le == null ? void 0 : le.nodeFilter,
|
|
3385
3383
|
config: le == null ? void 0 : le.config
|
|
3386
3384
|
};
|
|
3387
|
-
|
|
3385
|
+
Ge(Er, {
|
|
3388
3386
|
onError: (mn) => {
|
|
3389
3387
|
console.warn("[ChatSessionProvider] Stream error:", mn);
|
|
3390
3388
|
},
|
|
3391
|
-
onOpen: ({ threadId: mn, created:
|
|
3392
|
-
|
|
3393
|
-
const he = D.messages.length <= 1;
|
|
3394
|
-
he && (oe.current = mn), w(mn), (ee || he) && V();
|
|
3395
|
-
}
|
|
3389
|
+
onOpen: ({ threadId: mn, created: ne }) => {
|
|
3390
|
+
!k.current && mn && (D.messages.length <= 1 && (oe.current = mn), w(mn));
|
|
3396
3391
|
},
|
|
3397
|
-
onGap:
|
|
3392
|
+
onGap: te
|
|
3398
3393
|
});
|
|
3399
3394
|
},
|
|
3400
3395
|
[
|
|
3401
3396
|
l,
|
|
3402
3397
|
o,
|
|
3403
3398
|
s,
|
|
3404
|
-
|
|
3399
|
+
te,
|
|
3405
3400
|
V,
|
|
3406
3401
|
D.lastCheckpointId,
|
|
3407
3402
|
D.lastCheckpointNs,
|
|
@@ -3463,9 +3458,9 @@ function ox({
|
|
|
3463
3458
|
refreshThreads: ue,
|
|
3464
3459
|
loadThread: Z,
|
|
3465
3460
|
clearCurrentThread: ae,
|
|
3466
|
-
listCheckpoints:
|
|
3461
|
+
listCheckpoints: he,
|
|
3467
3462
|
navigateToCheckpoint: Se,
|
|
3468
|
-
returnToLatest:
|
|
3463
|
+
returnToLatest: ve
|
|
3469
3464
|
}),
|
|
3470
3465
|
[
|
|
3471
3466
|
ae,
|
|
@@ -3474,12 +3469,12 @@ function ox({
|
|
|
3474
3469
|
st,
|
|
3475
3470
|
x,
|
|
3476
3471
|
v,
|
|
3477
|
-
|
|
3472
|
+
he,
|
|
3478
3473
|
Z,
|
|
3479
3474
|
Se,
|
|
3480
3475
|
ue,
|
|
3481
3476
|
at,
|
|
3482
|
-
|
|
3477
|
+
ve,
|
|
3483
3478
|
f
|
|
3484
3479
|
]
|
|
3485
3480
|
), Et = pt(
|
|
@@ -3508,14 +3503,14 @@ function ox({
|
|
|
3508
3503
|
]
|
|
3509
3504
|
), yn = pt(
|
|
3510
3505
|
() => ({
|
|
3511
|
-
isStreaming:
|
|
3506
|
+
isStreaming: be,
|
|
3512
3507
|
error: je,
|
|
3513
3508
|
streamingAssistantId: D.assemblingId,
|
|
3514
3509
|
lastCheckpointId: D.lastCheckpointId ?? null,
|
|
3515
3510
|
lastCheckpointNs: D.lastCheckpointNs ?? null
|
|
3516
3511
|
}),
|
|
3517
3512
|
[
|
|
3518
|
-
|
|
3513
|
+
be,
|
|
3519
3514
|
D.assemblingId,
|
|
3520
3515
|
D.lastCheckpointId,
|
|
3521
3516
|
D.lastCheckpointNs,
|
|
@@ -3793,7 +3788,7 @@ function ye(e) {
|
|
|
3793
3788
|
e(n) && t(n);
|
|
3794
3789
|
};
|
|
3795
3790
|
}
|
|
3796
|
-
function
|
|
3791
|
+
function ee(e) {
|
|
3797
3792
|
return (t) => ou(t, e);
|
|
3798
3793
|
}
|
|
3799
3794
|
function rn(e) {
|
|
@@ -3946,7 +3941,7 @@ function ht(...e) {
|
|
|
3946
3941
|
}
|
|
3947
3942
|
};
|
|
3948
3943
|
}
|
|
3949
|
-
function
|
|
3944
|
+
function we(e, t = su) {
|
|
3950
3945
|
return F(e, tt(t));
|
|
3951
3946
|
}
|
|
3952
3947
|
function bi(...e) {
|
|
@@ -4099,13 +4094,13 @@ const Tt = He(
|
|
|
4099
4094
|
return ce(
|
|
4100
4095
|
F(
|
|
4101
4096
|
e,
|
|
4102
|
-
|
|
4097
|
+
ee(({ scrollTop: g }) => g)
|
|
4103
4098
|
),
|
|
4104
4099
|
t
|
|
4105
4100
|
), ce(
|
|
4106
4101
|
F(
|
|
4107
4102
|
e,
|
|
4108
|
-
|
|
4103
|
+
ee(({ scrollHeight: g }) => g)
|
|
4109
4104
|
),
|
|
4110
4105
|
i
|
|
4111
4106
|
), ce(t, o), {
|
|
@@ -4454,7 +4449,7 @@ const _x = {
|
|
|
4454
4449
|
current: [],
|
|
4455
4450
|
prev: []
|
|
4456
4451
|
}),
|
|
4457
|
-
|
|
4452
|
+
ee(({ prev: S }) => S)
|
|
4458
4453
|
),
|
|
4459
4454
|
[]
|
|
4460
4455
|
);
|
|
@@ -4463,7 +4458,7 @@ const _x = {
|
|
|
4463
4458
|
l,
|
|
4464
4459
|
ye((S) => S.length > 0),
|
|
4465
4460
|
_e(v, p),
|
|
4466
|
-
|
|
4461
|
+
ee(([S, C, E]) => {
|
|
4467
4462
|
const I = S.reduce((j, N, O) => Mt(j, N, Ur(N, C.offsetTree, E) || O), dr());
|
|
4468
4463
|
return {
|
|
4469
4464
|
...C,
|
|
@@ -4478,7 +4473,7 @@ const _x = {
|
|
|
4478
4473
|
r,
|
|
4479
4474
|
_e(v),
|
|
4480
4475
|
ye(([S, { lastIndex: C }]) => S < C),
|
|
4481
|
-
|
|
4476
|
+
ee(([S, { lastIndex: C, lastSize: E }]) => [
|
|
4482
4477
|
{
|
|
4483
4478
|
endIndex: C,
|
|
4484
4479
|
size: E,
|
|
@@ -4491,7 +4486,7 @@ const _x = {
|
|
|
4491
4486
|
const x = St(
|
|
4492
4487
|
F(
|
|
4493
4488
|
u,
|
|
4494
|
-
|
|
4489
|
+
ee((S) => S === void 0)
|
|
4495
4490
|
),
|
|
4496
4491
|
!0
|
|
4497
4492
|
);
|
|
@@ -4499,7 +4494,7 @@ const _x = {
|
|
|
4499
4494
|
F(
|
|
4500
4495
|
d,
|
|
4501
4496
|
ye((S) => S !== void 0 && Ze(ut(v).sizeTree)),
|
|
4502
|
-
|
|
4497
|
+
ee((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
|
|
4503
4498
|
),
|
|
4504
4499
|
n
|
|
4505
4500
|
);
|
|
@@ -4514,7 +4509,7 @@ const _x = {
|
|
|
4514
4509
|
}),
|
|
4515
4510
|
{ changed: !1, sizes: w }
|
|
4516
4511
|
),
|
|
4517
|
-
|
|
4512
|
+
ee((S) => S.changed)
|
|
4518
4513
|
)
|
|
4519
4514
|
);
|
|
4520
4515
|
Ke(
|
|
@@ -4524,7 +4519,7 @@ const _x = {
|
|
|
4524
4519
|
(S, C) => ({ diff: S.prev - C, prev: C }),
|
|
4525
4520
|
{ diff: 0, prev: 0 }
|
|
4526
4521
|
),
|
|
4527
|
-
|
|
4522
|
+
ee((S) => S.diff)
|
|
4528
4523
|
),
|
|
4529
4524
|
(S) => {
|
|
4530
4525
|
const { groupIndices: C } = ut(v);
|
|
@@ -4547,7 +4542,7 @@ const _x = {
|
|
|
4547
4542
|
F(
|
|
4548
4543
|
s,
|
|
4549
4544
|
_e(v),
|
|
4550
|
-
|
|
4545
|
+
ee(([S, C]) => {
|
|
4551
4546
|
const E = C.groupIndices.length > 0, I = [], j = C.lastSize;
|
|
4552
4547
|
if (E) {
|
|
4553
4548
|
const N = Br(C.sizeTree, 0);
|
|
@@ -4608,7 +4603,7 @@ const _x = {
|
|
|
4608
4603
|
F(
|
|
4609
4604
|
i,
|
|
4610
4605
|
_e(v, p),
|
|
4611
|
-
|
|
4606
|
+
ee(([S, { offsetTree: C }, E]) => {
|
|
4612
4607
|
const I = -S;
|
|
4613
4608
|
return Ur(I, C, E);
|
|
4614
4609
|
})
|
|
@@ -4618,7 +4613,7 @@ const _x = {
|
|
|
4618
4613
|
F(
|
|
4619
4614
|
i,
|
|
4620
4615
|
_e(v, p),
|
|
4621
|
-
|
|
4616
|
+
ee(([S, C, E]) => {
|
|
4622
4617
|
if (C.groupIndices.length > 0) {
|
|
4623
4618
|
if (Ze(C.sizeTree))
|
|
4624
4619
|
return C;
|
|
@@ -4688,26 +4683,26 @@ function Px(e) {
|
|
|
4688
4683
|
}
|
|
4689
4684
|
const gu = He(
|
|
4690
4685
|
([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
|
|
4691
|
-
const s = De(), i = De(), a = Dt(F(s,
|
|
4686
|
+
const s = De(), i = De(), a = Dt(F(s, ee(Px)));
|
|
4692
4687
|
return ce(
|
|
4693
4688
|
F(
|
|
4694
4689
|
a,
|
|
4695
|
-
|
|
4690
|
+
ee((l) => l.totalCount)
|
|
4696
4691
|
),
|
|
4697
4692
|
n
|
|
4698
4693
|
), ce(
|
|
4699
4694
|
F(
|
|
4700
4695
|
a,
|
|
4701
|
-
|
|
4696
|
+
ee((l) => l.groupIndices)
|
|
4702
4697
|
),
|
|
4703
4698
|
e
|
|
4704
4699
|
), ce(
|
|
4705
4700
|
F(
|
|
4706
4701
|
ht(o, t, r),
|
|
4707
4702
|
ye(([l, u]) => fs(u)),
|
|
4708
|
-
|
|
4703
|
+
ee(([l, u, d]) => Xt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
|
|
4709
4704
|
tt(),
|
|
4710
|
-
|
|
4705
|
+
ee((l) => [l])
|
|
4711
4706
|
),
|
|
4712
4707
|
i
|
|
4713
4708
|
), { groupCounts: s, topItemsIndexes: i };
|
|
@@ -4758,7 +4753,7 @@ const to = He(
|
|
|
4758
4753
|
p,
|
|
4759
4754
|
_e(n, f, r, v, a, i, h),
|
|
4760
4755
|
_e(e, s, o),
|
|
4761
|
-
|
|
4756
|
+
ee(
|
|
4762
4757
|
([
|
|
4763
4758
|
[R, S, C, E, I, j, N, O],
|
|
4764
4759
|
M,
|
|
@@ -4874,7 +4869,7 @@ const Wr = "up", Or = "down", Dx = "none", Lx = {
|
|
|
4874
4869
|
}, Fx = 0, ro = He(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
4875
4870
|
const i = K(!1), a = K(!0), l = De(), u = De(), d = K(4), f = K(Fx), h = St(
|
|
4876
4871
|
F(
|
|
4877
|
-
bi(F(
|
|
4872
|
+
bi(F(we(o), qn(1), rn(!0)), F(we(o), qn(1), rn(!1), xl(100))),
|
|
4878
4873
|
tt()
|
|
4879
4874
|
),
|
|
4880
4875
|
!1
|
|
@@ -4884,15 +4879,15 @@ const Wr = "up", Or = "down", Dx = "none", Lx = {
|
|
|
4884
4879
|
);
|
|
4885
4880
|
ce(
|
|
4886
4881
|
F(
|
|
4887
|
-
ht(
|
|
4888
|
-
|
|
4882
|
+
ht(we(o), we(f)),
|
|
4883
|
+
ee(([b, y]) => b <= y),
|
|
4889
4884
|
tt()
|
|
4890
4885
|
),
|
|
4891
4886
|
a
|
|
4892
4887
|
), ce(F(a, xn(50)), u);
|
|
4893
4888
|
const w = Dt(
|
|
4894
4889
|
F(
|
|
4895
|
-
ht(r,
|
|
4890
|
+
ht(r, we(s), we(t), we(e), we(d)),
|
|
4896
4891
|
sn((b, [{ scrollHeight: y, scrollTop: R }, S, C, E, I]) => {
|
|
4897
4892
|
const j = R + S - y > -I, N = {
|
|
4898
4893
|
scrollHeight: y,
|
|
@@ -4947,14 +4942,14 @@ const Wr = "up", Or = "down", Dx = "none", Lx = {
|
|
|
4947
4942
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
4948
4943
|
),
|
|
4949
4944
|
ye((b) => b.changed),
|
|
4950
|
-
|
|
4945
|
+
ee((b) => b.jump)
|
|
4951
4946
|
),
|
|
4952
4947
|
0
|
|
4953
4948
|
);
|
|
4954
4949
|
ce(
|
|
4955
4950
|
F(
|
|
4956
4951
|
w,
|
|
4957
|
-
|
|
4952
|
+
ee((b) => b.atBottom)
|
|
4958
4953
|
),
|
|
4959
4954
|
i
|
|
4960
4955
|
), ce(F(i, xn(50)), l);
|
|
@@ -4962,13 +4957,13 @@ const Wr = "up", Or = "down", Dx = "none", Lx = {
|
|
|
4962
4957
|
ce(
|
|
4963
4958
|
F(
|
|
4964
4959
|
r,
|
|
4965
|
-
|
|
4960
|
+
ee(({ scrollTop: b }) => b),
|
|
4966
4961
|
tt(),
|
|
4967
4962
|
sn(
|
|
4968
4963
|
(b, y) => ut(p) ? { direction: b.direction, prevScrollTop: y } : { direction: y < b.prevScrollTop ? Wr : Or, prevScrollTop: y },
|
|
4969
4964
|
{ direction: Or, prevScrollTop: 0 }
|
|
4970
4965
|
),
|
|
4971
|
-
|
|
4966
|
+
ee((b) => b.direction)
|
|
4972
4967
|
),
|
|
4973
4968
|
g
|
|
4974
4969
|
), ce(F(r, xn(50), rn(Dx)), g);
|
|
@@ -4987,7 +4982,7 @@ const Wr = "up", Or = "down", Dx = "none", Lx = {
|
|
|
4987
4982
|
_e(h),
|
|
4988
4983
|
ye(([b, y]) => !!y),
|
|
4989
4984
|
sn(([b, y], [R]) => [y, R], [0, 0]),
|
|
4990
|
-
|
|
4985
|
+
ee(([b, y]) => y - b)
|
|
4991
4986
|
),
|
|
4992
4987
|
x
|
|
4993
4988
|
), {
|
|
@@ -5016,17 +5011,17 @@ const na = He(
|
|
|
5016
5011
|
const s = De(), i = K(0), a = K(0), l = K(0), u = St(
|
|
5017
5012
|
F(
|
|
5018
5013
|
ht(
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5014
|
+
we(r),
|
|
5015
|
+
we(o),
|
|
5016
|
+
we(n),
|
|
5017
|
+
we(s, Hr),
|
|
5018
|
+
we(l),
|
|
5019
|
+
we(i),
|
|
5020
|
+
we(t),
|
|
5021
|
+
we(e),
|
|
5022
|
+
we(a)
|
|
5028
5023
|
),
|
|
5029
|
-
|
|
5024
|
+
ee(
|
|
5030
5025
|
([
|
|
5031
5026
|
d,
|
|
5032
5027
|
f,
|
|
@@ -5167,21 +5162,21 @@ const er = He(
|
|
|
5167
5162
|
ht(
|
|
5168
5163
|
p,
|
|
5169
5164
|
w,
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5165
|
+
we(l, Hr),
|
|
5166
|
+
we(o),
|
|
5167
|
+
we(r),
|
|
5168
|
+
we(u),
|
|
5174
5169
|
d,
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5170
|
+
we(v),
|
|
5171
|
+
we(t),
|
|
5172
|
+
we(n),
|
|
5178
5173
|
e
|
|
5179
5174
|
),
|
|
5180
5175
|
ye(([C, E, , I, , , , , , , j]) => {
|
|
5181
5176
|
const N = j && j.length !== I;
|
|
5182
5177
|
return C && !E && !N;
|
|
5183
5178
|
}),
|
|
5184
|
-
|
|
5179
|
+
ee(
|
|
5185
5180
|
([
|
|
5186
5181
|
,
|
|
5187
5182
|
,
|
|
@@ -5215,8 +5210,8 @@ const er = He(
|
|
|
5215
5210
|
let z = 0;
|
|
5216
5211
|
for (const P of ds(L, Re, ue)) {
|
|
5217
5212
|
const V = P.value, X = Math.max(P.start, Re), se = Math.min(P.end, ue);
|
|
5218
|
-
for (let
|
|
5219
|
-
U.push({ data: W == null ? void 0 : W[
|
|
5213
|
+
for (let te = X; te <= se; te++)
|
|
5214
|
+
U.push({ data: W == null ? void 0 : W[te], index: te, offset: z, size: V }), z += V;
|
|
5220
5215
|
}
|
|
5221
5216
|
}
|
|
5222
5217
|
if (!O)
|
|
@@ -5231,13 +5226,13 @@ const er = He(
|
|
|
5231
5226
|
const X = z.size;
|
|
5232
5227
|
if (z.offset < C) {
|
|
5233
5228
|
V += Math.floor((C - z.offset + _) / (X + _));
|
|
5234
|
-
const
|
|
5235
|
-
P +=
|
|
5229
|
+
const te = V - ue.start;
|
|
5230
|
+
P += te * X + te * _;
|
|
5236
5231
|
}
|
|
5237
5232
|
V < Y && (P += (Y - V) * X, V = Y);
|
|
5238
5233
|
const se = Math.min(ue.end, oe);
|
|
5239
|
-
for (let
|
|
5240
|
-
Re.push({ data: W == null ? void 0 : W[
|
|
5234
|
+
for (let te = V; te <= se && !(P >= E); te++)
|
|
5235
|
+
Re.push({ data: W == null ? void 0 : W[te], index: te, offset: P, size: X }), P += X + _;
|
|
5241
5236
|
}
|
|
5242
5237
|
});
|
|
5243
5238
|
return Eo(fe, U, I, _, H, D);
|
|
@@ -5253,25 +5248,25 @@ const er = He(
|
|
|
5253
5248
|
F(
|
|
5254
5249
|
e,
|
|
5255
5250
|
ye(Yi),
|
|
5256
|
-
|
|
5251
|
+
ee((C) => C == null ? void 0 : C.length)
|
|
5257
5252
|
),
|
|
5258
5253
|
o
|
|
5259
5254
|
), ce(
|
|
5260
5255
|
F(
|
|
5261
5256
|
b,
|
|
5262
|
-
|
|
5257
|
+
ee((C) => C.topListHeight)
|
|
5263
5258
|
),
|
|
5264
5259
|
f
|
|
5265
5260
|
), ce(f, a), ce(
|
|
5266
5261
|
F(
|
|
5267
5262
|
b,
|
|
5268
|
-
|
|
5263
|
+
ee((C) => [C.top, C.bottom])
|
|
5269
5264
|
),
|
|
5270
5265
|
i
|
|
5271
5266
|
), ce(
|
|
5272
5267
|
F(
|
|
5273
5268
|
b,
|
|
5274
|
-
|
|
5269
|
+
ee((C) => C.items)
|
|
5275
5270
|
),
|
|
5276
5271
|
x
|
|
5277
5272
|
);
|
|
@@ -5281,23 +5276,23 @@ const er = He(
|
|
|
5281
5276
|
ye(({ items: C }) => C.length > 0),
|
|
5282
5277
|
_e(o, e),
|
|
5283
5278
|
ye(([{ items: C }, E]) => C[C.length - 1].originalIndex === E - 1),
|
|
5284
|
-
|
|
5279
|
+
ee(([, C, E]) => [C - 1, E]),
|
|
5285
5280
|
tt(Hr),
|
|
5286
|
-
|
|
5281
|
+
ee(([C]) => C)
|
|
5287
5282
|
)
|
|
5288
5283
|
), R = Dt(
|
|
5289
5284
|
F(
|
|
5290
5285
|
b,
|
|
5291
5286
|
xn(200),
|
|
5292
5287
|
ye(({ items: C, topItems: E }) => C.length > 0 && C[0].originalIndex === E.length),
|
|
5293
|
-
|
|
5288
|
+
ee(({ items: C }) => C[0].index),
|
|
5294
5289
|
tt()
|
|
5295
5290
|
)
|
|
5296
5291
|
), S = Dt(
|
|
5297
5292
|
F(
|
|
5298
5293
|
b,
|
|
5299
5294
|
ye(({ items: C }) => C.length > 0),
|
|
5300
|
-
|
|
5295
|
+
ee(({ items: C }) => {
|
|
5301
5296
|
let E = 0, I = C.length - 1;
|
|
5302
5297
|
for (; C[E].type === "group" && E < I; )
|
|
5303
5298
|
E++;
|
|
@@ -5329,11 +5324,11 @@ const er = He(
|
|
|
5329
5324
|
const s = De(), i = St(
|
|
5330
5325
|
F(
|
|
5331
5326
|
ht(n, e, r, t, o),
|
|
5332
|
-
|
|
5327
|
+
ee(([a, l, u, d, f]) => a + l + u + d + f.offsetBottom + f.bottom)
|
|
5333
5328
|
),
|
|
5334
5329
|
0
|
|
5335
5330
|
);
|
|
5336
|
-
return ce(
|
|
5331
|
+
return ce(we(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
5337
5332
|
},
|
|
5338
5333
|
nt(Tt, er),
|
|
5339
5334
|
{ singleton: !0 }
|
|
@@ -5343,7 +5338,7 @@ const er = He(
|
|
|
5343
5338
|
F(
|
|
5344
5339
|
ht(n, e, t),
|
|
5345
5340
|
ye(([o]) => o),
|
|
5346
|
-
|
|
5341
|
+
ee(([, o, s]) => Math.max(0, o - s)),
|
|
5347
5342
|
xn(0),
|
|
5348
5343
|
tt()
|
|
5349
5344
|
),
|
|
@@ -5373,7 +5368,7 @@ const er = He(
|
|
|
5373
5368
|
d,
|
|
5374
5369
|
_e(t, l, n, s, o, r, a),
|
|
5375
5370
|
_e(e),
|
|
5376
|
-
|
|
5371
|
+
ee(([[f, h, p, w, v, g, x, b], y]) => {
|
|
5377
5372
|
const { align: R, behavior: S, calculateViewLocation: C = Bx, done: E, ...I } = f, j = mu(f, h, w - 1), N = Ur(j, h.offsetTree, y) + v + g, O = N + Xt(h.sizeTree, j)[1], M = b + g, D = b + p - x, _ = C({
|
|
5378
5373
|
itemBottom: O,
|
|
5379
5374
|
itemTop: N,
|
|
@@ -5428,9 +5423,9 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5428
5423
|
}
|
|
5429
5424
|
Ke(
|
|
5430
5425
|
F(
|
|
5431
|
-
ht(F(
|
|
5432
|
-
_e(
|
|
5433
|
-
|
|
5426
|
+
ht(F(we(t), qn(1)), l),
|
|
5427
|
+
_e(we(w), s, a, f),
|
|
5428
|
+
ee(([[S, C], E, I, j, N]) => {
|
|
5434
5429
|
let O = C && j, M = "auto";
|
|
5435
5430
|
return O && (M = Hx(E, I || N), O = O && !!M), { followOutputBehavior: M, shouldFollow: O, totalCount: S };
|
|
5436
5431
|
}),
|
|
@@ -5452,7 +5447,7 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5452
5447
|
}
|
|
5453
5448
|
Ke(
|
|
5454
5449
|
F(
|
|
5455
|
-
ht(
|
|
5450
|
+
ht(we(w), t, u),
|
|
5456
5451
|
ye(([S, , C]) => S && C),
|
|
5457
5452
|
sn(
|
|
5458
5453
|
({ value: S }, [, C]) => ({ refreshed: S === C, value: C }),
|
|
@@ -5466,27 +5461,27 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5466
5461
|
}
|
|
5467
5462
|
), Ke(v, () => {
|
|
5468
5463
|
b(ut(w) !== !1);
|
|
5469
|
-
}), Ke(ht(
|
|
5464
|
+
}), Ke(ht(we(w), o), ([S, C]) => {
|
|
5470
5465
|
S && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && x("auto");
|
|
5471
5466
|
});
|
|
5472
5467
|
const y = K(null), R = De();
|
|
5473
5468
|
return ce(
|
|
5474
5469
|
bi(
|
|
5475
5470
|
F(
|
|
5476
|
-
|
|
5477
|
-
|
|
5471
|
+
we(r),
|
|
5472
|
+
ee((S) => {
|
|
5478
5473
|
var C;
|
|
5479
5474
|
return (C = S == null ? void 0 : S.length) != null ? C : 0;
|
|
5480
5475
|
})
|
|
5481
5476
|
),
|
|
5482
|
-
F(
|
|
5477
|
+
F(we(t))
|
|
5483
5478
|
),
|
|
5484
5479
|
R
|
|
5485
5480
|
), Ke(
|
|
5486
5481
|
F(
|
|
5487
5482
|
ht(F(R, qn(1)), l),
|
|
5488
|
-
_e(
|
|
5489
|
-
|
|
5483
|
+
_e(we(y), a, f, h),
|
|
5484
|
+
ee(([[S, C], E, I, j, N]) => C && I && (E == null ? void 0 : E({ context: N, totalCount: S, scrollingInProgress: j }))),
|
|
5490
5485
|
ye((S) => !!S),
|
|
5491
5486
|
xn(0)
|
|
5492
5487
|
),
|
|
@@ -5517,7 +5512,7 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5517
5512
|
_e(s),
|
|
5518
5513
|
ye(([, l]) => l !== 0),
|
|
5519
5514
|
_e(o, r, t, n, e),
|
|
5520
|
-
|
|
5515
|
+
ee(([[, l], u, d, f, h, p = []]) => wu(l, u, d, f, h, p))
|
|
5521
5516
|
),
|
|
5522
5517
|
i
|
|
5523
5518
|
), {}),
|
|
@@ -5531,7 +5526,7 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5531
5526
|
e,
|
|
5532
5527
|
_e(r),
|
|
5533
5528
|
ye(([, o]) => o !== 0),
|
|
5534
|
-
|
|
5529
|
+
ee(([, o]) => ({ top: o }))
|
|
5535
5530
|
),
|
|
5536
5531
|
(o) => {
|
|
5537
5532
|
Yt(
|
|
@@ -5561,7 +5556,7 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5561
5556
|
e,
|
|
5562
5557
|
_e(r, t, n),
|
|
5563
5558
|
ye(([o, s]) => !!s),
|
|
5564
|
-
|
|
5559
|
+
ee(([o, s, i, a]) => {
|
|
5565
5560
|
const { enter: l, exit: u } = s;
|
|
5566
5561
|
if (i) {
|
|
5567
5562
|
if (u(o, a))
|
|
@@ -5587,7 +5582,7 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5587
5582
|
return ce(
|
|
5588
5583
|
F(
|
|
5589
5584
|
ht(n, r),
|
|
5590
|
-
|
|
5585
|
+
ee(([{ scrollHeight: a, scrollTop: l, viewportHeight: u }, { offsetTop: d }]) => ({
|
|
5591
5586
|
scrollHeight: a,
|
|
5592
5587
|
scrollTop: Math.max(0, l - d),
|
|
5593
5588
|
viewportHeight: u
|
|
@@ -5598,7 +5593,7 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5598
5593
|
F(
|
|
5599
5594
|
t,
|
|
5600
5595
|
_e(r),
|
|
5601
|
-
|
|
5596
|
+
ee(([a, { offsetTop: l }]) => ({
|
|
5602
5597
|
...a,
|
|
5603
5598
|
top: a.top + l
|
|
5604
5599
|
}))
|
|
@@ -5632,13 +5627,13 @@ const Hx = (e, t) => typeof e == "function" ? Rl(e(t)) : t && Rl(e), Ux = He(
|
|
|
5632
5627
|
const R = Nx(w.sizeTree);
|
|
5633
5628
|
g && x !== null && b !== null && (v = x.scrollTop - b.offsetTop), v -= y, p({ ranges: R, scrollTop: v });
|
|
5634
5629
|
}
|
|
5635
|
-
), ce(F(d, ye(Yi),
|
|
5630
|
+
), ce(F(d, ye(Yi), ee(qx)), o), ce(
|
|
5636
5631
|
F(
|
|
5637
5632
|
s,
|
|
5638
5633
|
_e(d),
|
|
5639
5634
|
ye(([, p]) => p !== void 0),
|
|
5640
5635
|
tt(),
|
|
5641
|
-
|
|
5636
|
+
ee(([, p]) => p.ranges)
|
|
5642
5637
|
),
|
|
5643
5638
|
e
|
|
5644
5639
|
), {
|
|
@@ -5657,7 +5652,7 @@ const Gx = He(([{ topItemsIndexes: e }]) => {
|
|
|
5657
5652
|
F(
|
|
5658
5653
|
t,
|
|
5659
5654
|
ye((n) => n >= 0),
|
|
5660
|
-
|
|
5655
|
+
ee((n) => Array.from({ length: n }).map((r, o) => o))
|
|
5661
5656
|
),
|
|
5662
5657
|
e
|
|
5663
5658
|
), { topItemCount: t };
|
|
@@ -5690,7 +5685,7 @@ const Yx = Tu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5690
5685
|
ye(([x]) => x !== 0),
|
|
5691
5686
|
_e(r, a, n, o, p, w),
|
|
5692
5687
|
ye(([, x, b, y, , , R]) => !R && !y && x !== 0 && b === Wr),
|
|
5693
|
-
|
|
5688
|
+
ee(([[x], , , , , b]) => (b("Upward scrolling compensation", { amount: x }, jt.DEBUG), x))
|
|
5694
5689
|
)
|
|
5695
5690
|
);
|
|
5696
5691
|
function g(x) {
|
|
@@ -5702,21 +5697,21 @@ const Yx = Tu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5702
5697
|
F(
|
|
5703
5698
|
ht(St(s, !1), e, w),
|
|
5704
5699
|
ye(([x, b, y]) => !x && !y && b !== 0),
|
|
5705
|
-
|
|
5700
|
+
ee(([x, b]) => b),
|
|
5706
5701
|
xn(1)
|
|
5707
5702
|
),
|
|
5708
5703
|
g
|
|
5709
5704
|
), ce(
|
|
5710
5705
|
F(
|
|
5711
5706
|
f,
|
|
5712
|
-
|
|
5707
|
+
ee((x) => ({ top: -x }))
|
|
5713
5708
|
),
|
|
5714
5709
|
t
|
|
5715
5710
|
), Ke(
|
|
5716
5711
|
F(
|
|
5717
5712
|
u,
|
|
5718
5713
|
_e(h, d),
|
|
5719
|
-
|
|
5714
|
+
ee(([x, { groupIndices: b, lastSize: y, sizeTree: R }, S]) => {
|
|
5720
5715
|
function C(E) {
|
|
5721
5716
|
return E * (y + S);
|
|
5722
5717
|
}
|
|
@@ -5813,7 +5808,7 @@ const Yx = Tu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5813
5808
|
]) => (ce(R.rangeChanged, j.scrollSeekRangeChanged), ce(
|
|
5814
5809
|
F(
|
|
5815
5810
|
j.windowViewportRect,
|
|
5816
|
-
|
|
5811
|
+
ee((N) => N.visibleHeight)
|
|
5817
5812
|
),
|
|
5818
5813
|
v.viewportHeight
|
|
5819
5814
|
), {
|
|
@@ -6019,7 +6014,7 @@ const ev = /* @__PURE__ */ He(() => {
|
|
|
6019
6014
|
const e = K((a) => `Item ${a}`), t = K((a) => `Group ${a}`), n = K({}), r = K(sa), o = K("div"), s = K(Sr), i = (a, l = null) => St(
|
|
6020
6015
|
F(
|
|
6021
6016
|
n,
|
|
6022
|
-
|
|
6017
|
+
ee((u) => u[a]),
|
|
6023
6018
|
tt()
|
|
6024
6019
|
),
|
|
6025
6020
|
l
|
|
@@ -6332,7 +6327,7 @@ const dv = ({ children: e }) => {
|
|
|
6332
6327
|
] })), r = K(null), o = K(null), s = K({}), i = K(sa), a = K(Sr), l = (u, d = null) => St(
|
|
6333
6328
|
F(
|
|
6334
6329
|
s,
|
|
6335
|
-
|
|
6330
|
+
ee((f) => f[u]),
|
|
6336
6331
|
tt()
|
|
6337
6332
|
),
|
|
6338
6333
|
d
|
|
@@ -6415,7 +6410,7 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6415
6410
|
), Ke(
|
|
6416
6411
|
F(
|
|
6417
6412
|
ht(w, U, N, j, k, Y),
|
|
6418
|
-
ye(([P, V, X, se, ,
|
|
6413
|
+
ye(([P, V, X, se, , te]) => P && !V && X.height !== 0 && se.height !== 0 && !te)
|
|
6419
6414
|
),
|
|
6420
6415
|
([, , , , P]) => {
|
|
6421
6416
|
Ae(Y, !0), ea(1, () => {
|
|
@@ -6445,18 +6440,18 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6445
6440
|
), ce(
|
|
6446
6441
|
F(
|
|
6447
6442
|
j,
|
|
6448
|
-
|
|
6443
|
+
ee(({ height: P }) => P)
|
|
6449
6444
|
),
|
|
6450
6445
|
f
|
|
6451
6446
|
), ce(
|
|
6452
6447
|
F(
|
|
6453
6448
|
ht(
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6449
|
+
we(j, ho),
|
|
6450
|
+
we(N, ho),
|
|
6451
|
+
we(W, (P, V) => P && P.column === V.column && P.row === V.row),
|
|
6452
|
+
we(u)
|
|
6458
6453
|
),
|
|
6459
|
-
|
|
6454
|
+
ee(([P, V, X, se]) => ({
|
|
6460
6455
|
gap: X,
|
|
6461
6456
|
item: V,
|
|
6462
6457
|
scrollTop: se,
|
|
@@ -6467,32 +6462,32 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6467
6462
|
), ce(
|
|
6468
6463
|
F(
|
|
6469
6464
|
ht(
|
|
6470
|
-
|
|
6465
|
+
we(C),
|
|
6471
6466
|
r,
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6467
|
+
we(W, Sv),
|
|
6468
|
+
we(N, ho),
|
|
6469
|
+
we(j, ho),
|
|
6470
|
+
we(_),
|
|
6471
|
+
we(E),
|
|
6472
|
+
we(L),
|
|
6473
|
+
we(U),
|
|
6474
|
+
we(k)
|
|
6480
6475
|
),
|
|
6481
6476
|
ye(([, , , , , , , P]) => !P),
|
|
6482
|
-
|
|
6477
|
+
ee(
|
|
6483
6478
|
([
|
|
6484
6479
|
P,
|
|
6485
6480
|
[V, X],
|
|
6486
6481
|
se,
|
|
6487
|
-
|
|
6482
|
+
te,
|
|
6488
6483
|
Le,
|
|
6489
6484
|
Ge,
|
|
6490
6485
|
et,
|
|
6491
6486
|
,
|
|
6492
|
-
|
|
6487
|
+
be,
|
|
6493
6488
|
je
|
|
6494
6489
|
]) => {
|
|
6495
|
-
const { column: Ye, row: Fe } = se, { height: st, width: at } =
|
|
6490
|
+
const { column: Ye, row: Fe } = se, { height: st, width: at } = te, { width: Z } = Le;
|
|
6496
6491
|
if (et === 0 && (P === 0 || Z === 0))
|
|
6497
6492
|
return Il;
|
|
6498
6493
|
if (at === 0) {
|
|
@@ -6500,10 +6495,10 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6500
6495
|
return yv(jl(Et, yn, Ge));
|
|
6501
6496
|
}
|
|
6502
6497
|
const ae = Ou(Z, at, Ye);
|
|
6503
|
-
let
|
|
6504
|
-
|
|
6505
|
-
const
|
|
6506
|
-
return { bottom: Ie, itemHeight: st, items:
|
|
6498
|
+
let he, Se;
|
|
6499
|
+
be ? V === 0 && X === 0 && et > 0 ? (he = 0, Se = et - 1) : (he = ae * Bo((V + Fe) / (st + Fe)), Se = ae * Nl((X + Fe) / (st + Fe)) - 1, Se = Xs(P - 1, Mr(Se, ae - 1)), he = Xs(Se, Mr(0, he))) : (he = 0, Se = -1);
|
|
6500
|
+
const ve = jl(he, Se, Ge), { bottom: Ie, top: Xe } = _l(Le, se, te, ve), Ue = Nl(P / ae), lt = Ue * st + (Ue - 1) * Fe - Ie;
|
|
6501
|
+
return { bottom: Ie, itemHeight: st, items: ve, itemWidth: at, offsetBottom: lt, offsetTop: Xe, top: Xe };
|
|
6507
6502
|
}
|
|
6508
6503
|
)
|
|
6509
6504
|
),
|
|
@@ -6512,16 +6507,16 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6512
6507
|
F(
|
|
6513
6508
|
_,
|
|
6514
6509
|
ye((P) => P !== null),
|
|
6515
|
-
|
|
6510
|
+
ee((P) => P.length)
|
|
6516
6511
|
),
|
|
6517
6512
|
C
|
|
6518
6513
|
), ce(
|
|
6519
6514
|
F(
|
|
6520
6515
|
ht(j, N, I, W),
|
|
6521
6516
|
ye(([P, V, { items: X }]) => X.length > 0 && V.height !== 0 && P.height !== 0),
|
|
6522
|
-
|
|
6523
|
-
const { bottom:
|
|
6524
|
-
return [Le,
|
|
6517
|
+
ee(([P, V, { items: X }, se]) => {
|
|
6518
|
+
const { bottom: te, top: Le } = _l(P, se, V, X);
|
|
6519
|
+
return [Le, te];
|
|
6525
6520
|
}),
|
|
6526
6521
|
tt(Hr)
|
|
6527
6522
|
),
|
|
@@ -6532,7 +6527,7 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6532
6527
|
F(
|
|
6533
6528
|
u,
|
|
6534
6529
|
_e(oe),
|
|
6535
|
-
|
|
6530
|
+
ee(([P, V]) => V || P !== 0)
|
|
6536
6531
|
),
|
|
6537
6532
|
oe
|
|
6538
6533
|
);
|
|
@@ -6545,22 +6540,22 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6545
6540
|
const se = P.items[P.items.length - 1].index === V - 1;
|
|
6546
6541
|
return (X || P.bottom > 0 && P.itemHeight > 0 && P.offsetBottom === 0 && P.items.length === V) && se;
|
|
6547
6542
|
}),
|
|
6548
|
-
|
|
6543
|
+
ee(([[, P]]) => P - 1),
|
|
6549
6544
|
tt()
|
|
6550
6545
|
)
|
|
6551
6546
|
), Re = Dt(
|
|
6552
6547
|
F(
|
|
6553
|
-
|
|
6548
|
+
we(I),
|
|
6554
6549
|
ye(({ items: P }) => P.length > 0 && P[0].index === 0),
|
|
6555
6550
|
rn(0),
|
|
6556
6551
|
tt()
|
|
6557
6552
|
)
|
|
6558
6553
|
), ue = Dt(
|
|
6559
6554
|
F(
|
|
6560
|
-
|
|
6555
|
+
we(I),
|
|
6561
6556
|
_e(L),
|
|
6562
6557
|
ye(([{ items: P }, V]) => P.length > 0 && !V),
|
|
6563
|
-
|
|
6558
|
+
ee(([{ items: P }]) => ({
|
|
6564
6559
|
endIndex: P[P.length - 1].index,
|
|
6565
6560
|
startIndex: P[0].index
|
|
6566
6561
|
})),
|
|
@@ -6572,12 +6567,12 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6572
6567
|
F(
|
|
6573
6568
|
O,
|
|
6574
6569
|
_e(j, N, C, W),
|
|
6575
|
-
|
|
6576
|
-
const Le = xu(P), { align: Ge, behavior: et, offset:
|
|
6570
|
+
ee(([P, V, X, se, te]) => {
|
|
6571
|
+
const Le = xu(P), { align: Ge, behavior: et, offset: be } = Le;
|
|
6577
6572
|
let je = Le.index;
|
|
6578
6573
|
je === "LAST" && (je = se - 1), je = Mr(0, je, Xs(se - 1, je));
|
|
6579
|
-
let Ye = Ri(V,
|
|
6580
|
-
return Ge === "end" ? Ye = Al(Ye - V.height + X.height) : Ge === "center" && (Ye = Al(Ye - V.height / 2 + X.height / 2)),
|
|
6574
|
+
let Ye = Ri(V, te, X, je);
|
|
6575
|
+
return Ge === "end" ? Ye = Al(Ye - V.height + X.height) : Ge === "center" && (Ye = Al(Ye - V.height / 2 + X.height / 2)), be && (Ye += be), { behavior: et, top: Ye };
|
|
6581
6576
|
})
|
|
6582
6577
|
),
|
|
6583
6578
|
l
|
|
@@ -6585,14 +6580,14 @@ const Cv = /* @__PURE__ */ He(
|
|
|
6585
6580
|
const z = St(
|
|
6586
6581
|
F(
|
|
6587
6582
|
I,
|
|
6588
|
-
|
|
6583
|
+
ee((P) => P.offsetBottom + P.bottom)
|
|
6589
6584
|
),
|
|
6590
6585
|
0
|
|
6591
6586
|
);
|
|
6592
6587
|
return ce(
|
|
6593
6588
|
F(
|
|
6594
6589
|
R,
|
|
6595
|
-
|
|
6590
|
+
ee((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
|
|
6596
6591
|
),
|
|
6597
6592
|
j
|
|
6598
6593
|
), {
|
|
@@ -6657,12 +6652,12 @@ const Tv = /* @__PURE__ */ He(() => {
|
|
|
6657
6652
|
const e = K((f) => `Item ${f}`), t = K({}), n = K(null), r = K("virtuoso-grid-item"), o = K("virtuoso-grid-list"), s = K(sa), i = K("div"), a = K(Sr), l = (f, h = null) => St(
|
|
6658
6653
|
F(
|
|
6659
6654
|
t,
|
|
6660
|
-
|
|
6655
|
+
ee((p) => p[f]),
|
|
6661
6656
|
tt()
|
|
6662
6657
|
),
|
|
6663
6658
|
h
|
|
6664
6659
|
), u = K(!1), d = K(!1);
|
|
6665
|
-
return ce(
|
|
6660
|
+
return ce(we(d), u), {
|
|
6666
6661
|
components: t,
|
|
6667
6662
|
computeItemKey: s,
|
|
6668
6663
|
context: n,
|
|
@@ -7846,7 +7841,7 @@ class da {
|
|
|
7846
7841
|
}
|
|
7847
7842
|
}
|
|
7848
7843
|
}
|
|
7849
|
-
const
|
|
7844
|
+
const ge = {
|
|
7850
7845
|
newline: /^(?: *(?:\n|$))+/,
|
|
7851
7846
|
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
7852
7847
|
fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
@@ -7863,37 +7858,37 @@ const xe = {
|
|
|
7863
7858
|
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
|
|
7864
7859
|
text: /^[^\n]+/
|
|
7865
7860
|
};
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
...
|
|
7861
|
+
ge._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
|
|
7862
|
+
ge._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
|
|
7863
|
+
ge.def = Qe(ge.def).replace("label", ge._label).replace("title", ge._title).getRegex();
|
|
7864
|
+
ge.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
7865
|
+
ge.listItemStart = Qe(/^( *)(bull) */).replace("bull", ge.bullet).getRegex();
|
|
7866
|
+
ge.list = Qe(ge.list).replace(/bull/g, ge.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + ge.def.source + ")").getRegex();
|
|
7867
|
+
ge._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
7868
|
+
ge._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
|
|
7869
|
+
ge.html = Qe(ge.html, "i").replace("comment", ge._comment).replace("tag", ge._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
7870
|
+
ge.paragraph = Qe(ge._paragraph).replace("hr", ge.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ge._tag).getRegex();
|
|
7871
|
+
ge.blockquote = Qe(ge.blockquote).replace("paragraph", ge.paragraph).getRegex();
|
|
7872
|
+
ge.normal = { ...ge };
|
|
7873
|
+
ge.gfm = {
|
|
7874
|
+
...ge.normal,
|
|
7880
7875
|
table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
7881
7876
|
// Cells
|
|
7882
7877
|
};
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
...
|
|
7878
|
+
ge.gfm.table = Qe(ge.gfm.table).replace("hr", ge.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ge._tag).getRegex();
|
|
7879
|
+
ge.gfm.paragraph = Qe(ge._paragraph).replace("hr", ge.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", ge.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ge._tag).getRegex();
|
|
7880
|
+
ge.pedantic = {
|
|
7881
|
+
...ge.normal,
|
|
7887
7882
|
html: Qe(
|
|
7888
7883
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
7889
|
-
).replace("comment",
|
|
7884
|
+
).replace("comment", ge._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
7890
7885
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
7891
7886
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
7892
7887
|
fences: Ho,
|
|
7893
7888
|
// fences not supported
|
|
7894
7889
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
7895
|
-
paragraph: Qe(
|
|
7896
|
-
]`).replace("lheading",
|
|
7890
|
+
paragraph: Qe(ge.normal._paragraph).replace("hr", ge.hr).replace("heading", ` *#{1,6} *[^
|
|
7891
|
+
]`).replace("lheading", ge.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
|
|
7897
7892
|
};
|
|
7898
7893
|
const re = {
|
|
7899
7894
|
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
@@ -7923,7 +7918,7 @@ re._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
|
|
|
7923
7918
|
re.punctuation = Qe(re.punctuation).replace(/punctuation/g, re._punctuation).getRegex();
|
|
7924
7919
|
re.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
|
|
7925
7920
|
re.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
|
|
7926
|
-
re._comment = Qe(
|
|
7921
|
+
re._comment = Qe(ge._comment).replace("(?:-->|$)", "-->").getRegex();
|
|
7927
7922
|
re.emStrong.lDelim = Qe(re.emStrong.lDelim).replace(/punct/g, re._punctuation).getRegex();
|
|
7928
7923
|
re.emStrong.rDelimAst = Qe(re.emStrong.rDelimAst, "g").replace(/punct/g, re._punctuation).getRegex();
|
|
7929
7924
|
re.emStrong.rDelimUnd = Qe(re.emStrong.rDelimUnd, "g").replace(/punct/g, re._punctuation).getRegex();
|
|
@@ -7937,8 +7932,8 @@ re._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
|
7937
7932
|
re._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
|
|
7938
7933
|
re._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
|
|
7939
7934
|
re.link = Qe(re.link).replace("label", re._label).replace("href", re._href).replace("title", re._title).getRegex();
|
|
7940
|
-
re.reflink = Qe(re.reflink).replace("label", re._label).replace("ref",
|
|
7941
|
-
re.nolink = Qe(re.nolink).replace("ref",
|
|
7935
|
+
re.reflink = Qe(re.reflink).replace("label", re._label).replace("ref", ge._label).getRegex();
|
|
7936
|
+
re.nolink = Qe(re.nolink).replace("ref", ge._label).getRegex();
|
|
7942
7937
|
re.reflinkSearch = Qe(re.reflinkSearch, "g").replace("reflink", re.reflink).replace("nolink", re.nolink).getRegex();
|
|
7943
7938
|
re.normal = { ...re };
|
|
7944
7939
|
re.pedantic = {
|
|
@@ -7991,17 +7986,17 @@ class En {
|
|
|
7991
7986
|
top: !0
|
|
7992
7987
|
};
|
|
7993
7988
|
const n = {
|
|
7994
|
-
block:
|
|
7989
|
+
block: ge.normal,
|
|
7995
7990
|
inline: re.normal
|
|
7996
7991
|
};
|
|
7997
|
-
this.options.pedantic ? (n.block =
|
|
7992
|
+
this.options.pedantic ? (n.block = ge.pedantic, n.inline = re.pedantic) : this.options.gfm && (n.block = ge.gfm, this.options.breaks ? n.inline = re.breaks : n.inline = re.gfm), this.tokenizer.rules = n;
|
|
7998
7993
|
}
|
|
7999
7994
|
/**
|
|
8000
7995
|
* Expose Rules
|
|
8001
7996
|
*/
|
|
8002
7997
|
static get rules() {
|
|
8003
7998
|
return {
|
|
8004
|
-
block:
|
|
7999
|
+
block: ge,
|
|
8005
8000
|
inline: re
|
|
8006
8001
|
};
|
|
8007
8002
|
}
|
|
@@ -8637,7 +8632,7 @@ function Gu(e, t) {
|
|
|
8637
8632
|
return (n, r, o) => {
|
|
8638
8633
|
typeof r == "function" && (o = r, r = null);
|
|
8639
8634
|
const s = { ...r };
|
|
8640
|
-
r = { ...
|
|
8635
|
+
r = { ...me.defaults, ...s };
|
|
8641
8636
|
const i = hw(r.silent, r.async, o);
|
|
8642
8637
|
if (typeof n > "u" || n === null)
|
|
8643
8638
|
return i(new Error("marked(): input parameter is undefined or null"));
|
|
@@ -8655,7 +8650,7 @@ function Gu(e, t) {
|
|
|
8655
8650
|
let h;
|
|
8656
8651
|
if (!f)
|
|
8657
8652
|
try {
|
|
8658
|
-
r.walkTokens &&
|
|
8653
|
+
r.walkTokens && me.walkTokens(l, r.walkTokens), h = t(l, r), r.hooks && (h = r.hooks.postprocess(h));
|
|
8659
8654
|
} catch (p) {
|
|
8660
8655
|
f = p;
|
|
8661
8656
|
}
|
|
@@ -8663,7 +8658,7 @@ function Gu(e, t) {
|
|
|
8663
8658
|
};
|
|
8664
8659
|
if (!a || a.length < 3 || (delete r.highlight, !l.length)) return u();
|
|
8665
8660
|
let d = 0;
|
|
8666
|
-
|
|
8661
|
+
me.walkTokens(l, function(f) {
|
|
8667
8662
|
f.type === "code" && (d++, setTimeout(() => {
|
|
8668
8663
|
a(f.text, f.lang, function(h, p) {
|
|
8669
8664
|
if (h)
|
|
@@ -8675,11 +8670,11 @@ function Gu(e, t) {
|
|
|
8675
8670
|
return;
|
|
8676
8671
|
}
|
|
8677
8672
|
if (r.async)
|
|
8678
|
-
return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => e(a, r)).then((a) => r.walkTokens ? Promise.all(
|
|
8673
|
+
return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => e(a, r)).then((a) => r.walkTokens ? Promise.all(me.walkTokens(a, r.walkTokens)).then(() => a) : a).then((a) => t(a, r)).then((a) => r.hooks ? r.hooks.postprocess(a) : a).catch(i);
|
|
8679
8674
|
try {
|
|
8680
8675
|
r.hooks && (n = r.hooks.preprocess(n));
|
|
8681
8676
|
const a = e(n, r);
|
|
8682
|
-
r.walkTokens &&
|
|
8677
|
+
r.walkTokens && me.walkTokens(a, r.walkTokens);
|
|
8683
8678
|
let l = t(a, r);
|
|
8684
8679
|
return r.hooks && (l = r.hooks.postprocess(l)), l;
|
|
8685
8680
|
} catch (a) {
|
|
@@ -8687,19 +8682,19 @@ function Gu(e, t) {
|
|
|
8687
8682
|
}
|
|
8688
8683
|
};
|
|
8689
8684
|
}
|
|
8690
|
-
function
|
|
8685
|
+
function me(e, t, n) {
|
|
8691
8686
|
return Gu(En.lex, kn.parse)(e, t, n);
|
|
8692
8687
|
}
|
|
8693
|
-
|
|
8694
|
-
return
|
|
8688
|
+
me.options = me.setOptions = function(e) {
|
|
8689
|
+
return me.defaults = { ...me.defaults, ...e }, Jv(me.defaults), me;
|
|
8695
8690
|
};
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
const t =
|
|
8691
|
+
me.getDefaults = Hu;
|
|
8692
|
+
me.defaults = tr;
|
|
8693
|
+
me.use = function(...e) {
|
|
8694
|
+
const t = me.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
8700
8695
|
e.forEach((n) => {
|
|
8701
8696
|
const r = { ...n };
|
|
8702
|
-
if (r.async =
|
|
8697
|
+
if (r.async = me.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((o) => {
|
|
8703
8698
|
if (!o.name)
|
|
8704
8699
|
throw new Error("extension name required");
|
|
8705
8700
|
if (o.renderer) {
|
|
@@ -8716,7 +8711,7 @@ ge.use = function(...e) {
|
|
|
8716
8711
|
}
|
|
8717
8712
|
o.childTokens && (t.childTokens[o.name] = o.childTokens);
|
|
8718
8713
|
}), r.extensions = t), n.renderer) {
|
|
8719
|
-
const o =
|
|
8714
|
+
const o = me.defaults.renderer || new fa();
|
|
8720
8715
|
for (const s in n.renderer) {
|
|
8721
8716
|
const i = o[s];
|
|
8722
8717
|
o[s] = (...a) => {
|
|
@@ -8727,7 +8722,7 @@ ge.use = function(...e) {
|
|
|
8727
8722
|
r.renderer = o;
|
|
8728
8723
|
}
|
|
8729
8724
|
if (n.tokenizer) {
|
|
8730
|
-
const o =
|
|
8725
|
+
const o = me.defaults.tokenizer || new da();
|
|
8731
8726
|
for (const s in n.tokenizer) {
|
|
8732
8727
|
const i = o[s];
|
|
8733
8728
|
o[s] = (...a) => {
|
|
@@ -8738,11 +8733,11 @@ ge.use = function(...e) {
|
|
|
8738
8733
|
r.tokenizer = o;
|
|
8739
8734
|
}
|
|
8740
8735
|
if (n.hooks) {
|
|
8741
|
-
const o =
|
|
8736
|
+
const o = me.defaults.hooks || new Uo();
|
|
8742
8737
|
for (const s in n.hooks) {
|
|
8743
8738
|
const i = o[s];
|
|
8744
8739
|
Uo.passThroughHooks.has(s) ? o[s] = (a) => {
|
|
8745
|
-
if (
|
|
8740
|
+
if (me.defaults.async)
|
|
8746
8741
|
return Promise.resolve(n.hooks[s].call(o, a)).then((u) => i.call(o, u));
|
|
8747
8742
|
const l = n.hooks[s].call(o, a);
|
|
8748
8743
|
return i.call(o, l);
|
|
@@ -8754,54 +8749,54 @@ ge.use = function(...e) {
|
|
|
8754
8749
|
r.hooks = o;
|
|
8755
8750
|
}
|
|
8756
8751
|
if (n.walkTokens) {
|
|
8757
|
-
const o =
|
|
8752
|
+
const o = me.defaults.walkTokens;
|
|
8758
8753
|
r.walkTokens = function(s) {
|
|
8759
8754
|
let i = [];
|
|
8760
8755
|
return i.push(n.walkTokens.call(this, s)), o && (i = i.concat(o.call(this, s))), i;
|
|
8761
8756
|
};
|
|
8762
8757
|
}
|
|
8763
|
-
|
|
8758
|
+
me.setOptions(r);
|
|
8764
8759
|
});
|
|
8765
8760
|
};
|
|
8766
|
-
|
|
8761
|
+
me.walkTokens = function(e, t) {
|
|
8767
8762
|
let n = [];
|
|
8768
8763
|
for (const r of e)
|
|
8769
|
-
switch (n = n.concat(t.call(
|
|
8764
|
+
switch (n = n.concat(t.call(me, r)), r.type) {
|
|
8770
8765
|
case "table": {
|
|
8771
8766
|
for (const o of r.header)
|
|
8772
|
-
n = n.concat(
|
|
8767
|
+
n = n.concat(me.walkTokens(o.tokens, t));
|
|
8773
8768
|
for (const o of r.rows)
|
|
8774
8769
|
for (const s of o)
|
|
8775
|
-
n = n.concat(
|
|
8770
|
+
n = n.concat(me.walkTokens(s.tokens, t));
|
|
8776
8771
|
break;
|
|
8777
8772
|
}
|
|
8778
8773
|
case "list": {
|
|
8779
|
-
n = n.concat(
|
|
8774
|
+
n = n.concat(me.walkTokens(r.items, t));
|
|
8780
8775
|
break;
|
|
8781
8776
|
}
|
|
8782
8777
|
default:
|
|
8783
|
-
|
|
8784
|
-
n = n.concat(
|
|
8785
|
-
}) : r.tokens && (n = n.concat(
|
|
8778
|
+
me.defaults.extensions && me.defaults.extensions.childTokens && me.defaults.extensions.childTokens[r.type] ? me.defaults.extensions.childTokens[r.type].forEach(function(o) {
|
|
8779
|
+
n = n.concat(me.walkTokens(r[o], t));
|
|
8780
|
+
}) : r.tokens && (n = n.concat(me.walkTokens(r.tokens, t)));
|
|
8786
8781
|
}
|
|
8787
8782
|
return n;
|
|
8788
8783
|
};
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8784
|
+
me.parseInline = Gu(En.lexInline, kn.parseInline);
|
|
8785
|
+
me.Parser = kn;
|
|
8786
|
+
me.parser = kn.parse;
|
|
8787
|
+
me.Renderer = fa;
|
|
8788
|
+
me.TextRenderer = Ku;
|
|
8789
|
+
me.Lexer = En;
|
|
8790
|
+
me.lexer = En.lex;
|
|
8791
|
+
me.Tokenizer = da;
|
|
8792
|
+
me.Slugger = qu;
|
|
8793
|
+
me.Hooks = Uo;
|
|
8794
|
+
me.parse = me;
|
|
8795
|
+
me.options;
|
|
8796
|
+
me.setOptions;
|
|
8797
|
+
me.use;
|
|
8798
|
+
me.walkTokens;
|
|
8799
|
+
me.parseInline;
|
|
8805
8800
|
kn.parse;
|
|
8806
8801
|
En.lex;
|
|
8807
8802
|
function Ul({
|
|
@@ -8813,9 +8808,9 @@ function Ul({
|
|
|
8813
8808
|
try {
|
|
8814
8809
|
if (!n) {
|
|
8815
8810
|
const o = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
|
|
8816
|
-
return
|
|
8811
|
+
return me.parse(o);
|
|
8817
8812
|
}
|
|
8818
|
-
return
|
|
8813
|
+
return me.parse(e);
|
|
8819
8814
|
} catch (o) {
|
|
8820
8815
|
return console.error("[MarkdownContent] parse error", o), `<pre>Error rendering markdown: ${String(o)}</pre>`;
|
|
8821
8816
|
}
|
|
@@ -9261,7 +9256,7 @@ function ni(e, t) {
|
|
|
9261
9256
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
9262
9257
|
}
|
|
9263
9258
|
function zw(e, t) {
|
|
9264
|
-
var n =
|
|
9259
|
+
var n = pe(function() {
|
|
9265
9260
|
return {
|
|
9266
9261
|
// value
|
|
9267
9262
|
value: e,
|
|
@@ -10068,7 +10063,7 @@ const Ob = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
|
|
|
10068
10063
|
));
|
|
10069
10064
|
Ob.displayName = Cs.displayName;
|
|
10070
10065
|
function Mb({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
10071
|
-
const [s, i] =
|
|
10066
|
+
const [s, i] = pe(!1), [a, l] = pe(null), [u, d] = pe(null), { toast: f } = ha(), h = $.useCallback(async () => {
|
|
10072
10067
|
if (n) {
|
|
10073
10068
|
i(!0), d(null), l(null);
|
|
10074
10069
|
try {
|
|
@@ -10329,7 +10324,7 @@ function sc(e) {
|
|
|
10329
10324
|
return `${e.id}:${t}:${n}`;
|
|
10330
10325
|
}
|
|
10331
10326
|
function Hb({ className: e }) {
|
|
10332
|
-
const [t, n] =
|
|
10327
|
+
const [t, n] = pe(0);
|
|
10333
10328
|
return gt(() => {
|
|
10334
10329
|
const r = setInterval(() => n((o) => (o + 1) % 4), 500);
|
|
10335
10330
|
return () => clearInterval(r);
|
|
@@ -10364,7 +10359,7 @@ const Ub = $.memo(function({
|
|
|
10364
10359
|
onCancelEdit: g,
|
|
10365
10360
|
onCopy: x
|
|
10366
10361
|
}) {
|
|
10367
|
-
const [b, y] =
|
|
10362
|
+
const [b, y] = pe(!1), [R, S] = pe("collapsed"), [C, E] = pe(!1), { currentThreadId: I } = Gi(), { handleInterrupt: j } = tu(), { toast: N } = ha(), [O, M] = pe({}), [D, _] = pe(!1), [W, H] = pe(null), q = l === "phone" || l === "half-screen", L = t.role, k = L === "tool", U = !(r && L !== "user"), Y = $.useMemo(() => {
|
|
10368
10363
|
switch (L) {
|
|
10369
10364
|
case "user":
|
|
10370
10365
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -10390,23 +10385,23 @@ const Ub = $.memo(function({
|
|
|
10390
10385
|
pt(() => zb(t.content), [t.content]);
|
|
10391
10386
|
const P = pt(() => z.length <= $n ? z : `${z.slice(0, $n)}
|
|
10392
10387
|
… [truncated ${z.length - $n} chars]`, [z]), V = $.useCallback(async (Z = "all") => {
|
|
10393
|
-
const
|
|
10394
|
-
async function Se(
|
|
10388
|
+
const he = Z === "visible" && k ? P : k ? z : de;
|
|
10389
|
+
async function Se(ve) {
|
|
10395
10390
|
try {
|
|
10396
|
-
await navigator.clipboard.writeText(
|
|
10391
|
+
await navigator.clipboard.writeText(ve);
|
|
10397
10392
|
} catch {
|
|
10398
10393
|
try {
|
|
10399
10394
|
const Ie = document.createElement("textarea");
|
|
10400
|
-
Ie.value =
|
|
10395
|
+
Ie.value = ve, Ie.setAttribute("readonly", ""), Ie.style.position = "absolute", Ie.style.left = "-9999px", document.body.appendChild(Ie), Ie.select(), document.execCommand("copy"), document.body.removeChild(Ie);
|
|
10401
10396
|
} catch (Ie) {
|
|
10402
10397
|
throw console.error("Failed to copy:", Ie), Ie;
|
|
10403
10398
|
}
|
|
10404
10399
|
}
|
|
10405
10400
|
}
|
|
10406
10401
|
try {
|
|
10407
|
-
await Se(
|
|
10408
|
-
} catch (
|
|
10409
|
-
console.error("Failed to copy:",
|
|
10402
|
+
await Se(he), y(!0), setTimeout(() => y(!1), 2e3), x == null || x(he);
|
|
10403
|
+
} catch (ve) {
|
|
10404
|
+
console.error("Failed to copy:", ve);
|
|
10410
10405
|
}
|
|
10411
10406
|
}, [k, z, de, P, x]), X = $.useCallback(() => {
|
|
10412
10407
|
if (!w) return;
|
|
@@ -10414,25 +10409,25 @@ const Ub = $.memo(function({
|
|
|
10414
10409
|
w(t.id, Z);
|
|
10415
10410
|
}, [w, t.id, k, z, de]), se = $.useCallback(() => {
|
|
10416
10411
|
v == null || v(n);
|
|
10417
|
-
}, [v, n]),
|
|
10412
|
+
}, [v, n]), te = $.useCallback(async (Z, ae, he) => {
|
|
10418
10413
|
if (!U) {
|
|
10419
10414
|
Z.preventDefault();
|
|
10420
10415
|
return;
|
|
10421
10416
|
}
|
|
10422
|
-
if (O[
|
|
10417
|
+
if (O[he]) {
|
|
10423
10418
|
Z.preventDefault();
|
|
10424
10419
|
return;
|
|
10425
10420
|
}
|
|
10426
10421
|
try {
|
|
10427
|
-
const Se = String(ae.url ?? ""),
|
|
10428
|
-
if (
|
|
10422
|
+
const Se = String(ae.url ?? ""), ve = Se.match(/\/chat\/files\/([^/]+)(?:\/(view|download))?/);
|
|
10423
|
+
if (ve) {
|
|
10429
10424
|
Z.preventDefault();
|
|
10430
|
-
const Ie =
|
|
10425
|
+
const Ie = ve[1], Xe = ae.name || `file_${Ie}`, Ue = ae.mimeType || "application/octet-stream";
|
|
10431
10426
|
H({ id: Ie, name: Xe, mimeType: Ue }), _(!0);
|
|
10432
10427
|
return;
|
|
10433
10428
|
}
|
|
10434
10429
|
if (Se.startsWith("data:")) {
|
|
10435
|
-
Z.preventDefault(), M((Ue) => ({ ...Ue, [
|
|
10430
|
+
Z.preventDefault(), M((Ue) => ({ ...Ue, [he]: !0 }));
|
|
10436
10431
|
const Ie = `${ae.name}_${ae.size}_${Date.now()}`, Xe = N({ title: "Fetching file...", description: "", open: !0 });
|
|
10437
10432
|
try {
|
|
10438
10433
|
const Ue = await mw(I ?? void 0);
|
|
@@ -10457,11 +10452,11 @@ const Ub = $.memo(function({
|
|
|
10457
10452
|
open: !0
|
|
10458
10453
|
});
|
|
10459
10454
|
} finally {
|
|
10460
|
-
M((Ue) => ({ ...Ue, [
|
|
10455
|
+
M((Ue) => ({ ...Ue, [he]: !1 }));
|
|
10461
10456
|
}
|
|
10462
10457
|
}
|
|
10463
10458
|
} catch (Se) {
|
|
10464
|
-
console.error("File click error:", Se), M((
|
|
10459
|
+
console.error("File click error:", Se), M((ve) => ({ ...ve, [he]: !1 }));
|
|
10465
10460
|
}
|
|
10466
10461
|
}, [U, O, N, I]), Le = $.useCallback(() => {
|
|
10467
10462
|
const ae = J(q ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Y);
|
|
@@ -10519,7 +10514,7 @@ const Ub = $.memo(function({
|
|
|
10519
10514
|
"border border-border/60 dark:border-border/40"
|
|
10520
10515
|
);
|
|
10521
10516
|
}
|
|
10522
|
-
}, [q, L]),
|
|
10517
|
+
}, [q, L]), be = $.useCallback(async (Z) => {
|
|
10523
10518
|
try {
|
|
10524
10519
|
const ae = Z.id || `interrupt-${Date.now()}`;
|
|
10525
10520
|
await j(ae, !0);
|
|
@@ -10535,8 +10530,8 @@ const Ub = $.memo(function({
|
|
|
10535
10530
|
}
|
|
10536
10531
|
}, [j]), Ye = $.useCallback(({ part: Z, i: ae }) => {
|
|
10537
10532
|
if (Z.type === "text") {
|
|
10538
|
-
const
|
|
10539
|
-
return
|
|
10533
|
+
const he = Z.text ?? "", Se = he.trim(), ve = oc(Se);
|
|
10534
|
+
return ve && L !== "tool" ? /* @__PURE__ */ c.jsx(Wb, { data: ve }, ae) : L === "user" && f && Se.length > h ? /* @__PURE__ */ c.jsxs(Ml, { open: C, onOpenChange: E, children: [
|
|
10540
10535
|
/* @__PURE__ */ c.jsx("div", { className: J("text-sm text-[hsl(var(--chat-bubble-user-text))]", q && "text-xs"), children: C ? /* @__PURE__ */ c.jsx(Ul, { content: Se, allowHtml: !1 }) : /* @__PURE__ */ c.jsxs("pre", { className: J("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", q && "text-xs"), children: [
|
|
10541
10536
|
Se.substring(0, h),
|
|
10542
10537
|
"..."
|
|
@@ -10558,27 +10553,27 @@ const Ub = $.memo(function({
|
|
|
10558
10553
|
] })
|
|
10559
10554
|
}
|
|
10560
10555
|
) })
|
|
10561
|
-
] }, ae) : /* @__PURE__ */ c.jsx(Ul, { content:
|
|
10556
|
+
] }, ae) : /* @__PURE__ */ c.jsx(Ul, { content: he, allowHtml: !1 }, ae);
|
|
10562
10557
|
}
|
|
10563
10558
|
if (Z.type === "image_url") {
|
|
10564
|
-
const
|
|
10559
|
+
const he = Z;
|
|
10565
10560
|
return /* @__PURE__ */ c.jsx("div", { className: "my-2", children: /* @__PURE__ */ c.jsx(
|
|
10566
10561
|
"img",
|
|
10567
10562
|
{
|
|
10568
|
-
src:
|
|
10569
|
-
alt:
|
|
10563
|
+
src: he.url,
|
|
10564
|
+
alt: he.alt ?? "",
|
|
10570
10565
|
loading: "lazy",
|
|
10571
10566
|
className: "border rounded max-h-[420px] w-auto object-contain"
|
|
10572
10567
|
}
|
|
10573
10568
|
) }, ae);
|
|
10574
10569
|
}
|
|
10575
10570
|
if (Z.type === "file") {
|
|
10576
|
-
const
|
|
10571
|
+
const he = Z, Se = he.name || "file";
|
|
10577
10572
|
return /* @__PURE__ */ c.jsxs(
|
|
10578
10573
|
"a",
|
|
10579
10574
|
{
|
|
10580
|
-
href:
|
|
10581
|
-
onClick: (
|
|
10575
|
+
href: he.url,
|
|
10576
|
+
onClick: (ve) => te(ve, he, ae),
|
|
10582
10577
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
10583
10578
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
10584
10579
|
children: [
|
|
@@ -10596,15 +10591,15 @@ const Ub = $.memo(function({
|
|
|
10596
10591
|
Kb,
|
|
10597
10592
|
{
|
|
10598
10593
|
interruptPart: Z,
|
|
10599
|
-
onApprove:
|
|
10594
|
+
onApprove: be,
|
|
10600
10595
|
onReject: je
|
|
10601
10596
|
},
|
|
10602
10597
|
ae
|
|
10603
10598
|
) : null;
|
|
10604
10599
|
}, [
|
|
10605
|
-
|
|
10600
|
+
te,
|
|
10606
10601
|
O,
|
|
10607
|
-
|
|
10602
|
+
be,
|
|
10608
10603
|
je,
|
|
10609
10604
|
L,
|
|
10610
10605
|
f,
|
|
@@ -10619,22 +10614,22 @@ const Ub = $.memo(function({
|
|
|
10619
10614
|
if (!k && !Z && !r)
|
|
10620
10615
|
return Fe();
|
|
10621
10616
|
if (t.model === "reflection") {
|
|
10622
|
-
const ae = de.trim(),
|
|
10623
|
-
if (
|
|
10624
|
-
return /* @__PURE__ */ c.jsx(qb, { data:
|
|
10617
|
+
const ae = de.trim(), he = oc(ae);
|
|
10618
|
+
if (he && typeof he == "object")
|
|
10619
|
+
return /* @__PURE__ */ c.jsx(qb, { data: he });
|
|
10625
10620
|
}
|
|
10626
10621
|
if (k && oe.name === "get_issues") {
|
|
10627
|
-
const ae = t.content.find((
|
|
10622
|
+
const ae = t.content.find((ve) => ve.type === "tool_end"), he = (ae == null ? void 0 : ae.output) ?? z, Se = jd(he);
|
|
10628
10623
|
if (Se) return /* @__PURE__ */ c.jsx(Gb, { issues: Se });
|
|
10629
10624
|
}
|
|
10630
10625
|
if (k) {
|
|
10631
10626
|
const ae = Fb(t.content);
|
|
10632
10627
|
if (ae.length > 0)
|
|
10633
|
-
return /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: ae.map((
|
|
10634
|
-
const
|
|
10635
|
-
… [truncated ${
|
|
10628
|
+
return /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: ae.map((he, Se) => {
|
|
10629
|
+
const ve = typeof he.output == "string" ? he.output : Ni(he.output), Ie = ve.length > $n ? `${ve.slice(0, $n)}
|
|
10630
|
+
… [truncated ${ve.length - $n} chars]` : ve, Xe = R === "expanded";
|
|
10636
10631
|
return /* @__PURE__ */ c.jsxs(Ml, { open: Xe, onOpenChange: (Ue) => S(Ue ? "expanded" : "preview"), children: [
|
|
10637
|
-
/* @__PURE__ */ c.jsx("div", { className: "flex items-center gap-2 text-xs", children: /* @__PURE__ */ c.jsx(Ei, { variant: "outline", children: (
|
|
10632
|
+
/* @__PURE__ */ c.jsx("div", { className: "flex items-center gap-2 text-xs", children: /* @__PURE__ */ c.jsx(Ei, { variant: "outline", children: (he.name ?? "tool") + (he.toolCallId ? ` • ${he.toolCallId.slice(0, 8)}` : "") }) }),
|
|
10638
10633
|
/* @__PURE__ */ c.jsx("div", { className: "font-mono text-sm mt-1", children: /* @__PURE__ */ c.jsx("pre", { className: "whitespace-pre-wrap break-words", children: Xe ? Ie : Ie.slice(0, d) + (Ie.length > d ? "..." : "") }) }),
|
|
10639
10634
|
/* @__PURE__ */ c.jsx(Dl, { asChild: !0, children: /* @__PURE__ */ c.jsx(Be, { variant: "ghost", size: "sm", className: "h-6 text-xs", children: Xe ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
10640
10635
|
" ",
|
|
@@ -10644,11 +10639,11 @@ const Ub = $.memo(function({
|
|
|
10644
10639
|
/* @__PURE__ */ c.jsx(cr, { className: "h-3 w-3 mr-1" }),
|
|
10645
10640
|
" Show more"
|
|
10646
10641
|
] }) }) })
|
|
10647
|
-
] },
|
|
10642
|
+
] }, he.toolCallId ?? Se);
|
|
10648
10643
|
}) });
|
|
10649
10644
|
}
|
|
10650
10645
|
if (!k) {
|
|
10651
|
-
const ae = /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: t.content.map((
|
|
10646
|
+
const ae = /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: t.content.map((he, Se) => /* @__PURE__ */ c.jsx(Ye, { part: he, i: Se }, Se)) });
|
|
10652
10647
|
return r ? /* @__PURE__ */ c.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
10653
10648
|
ae,
|
|
10654
10649
|
/* @__PURE__ */ c.jsx(Hb, { className: Y })
|
|
@@ -11011,7 +11006,7 @@ const ic = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, _d = $.forwa
|
|
|
11011
11006
|
onScrollAway: g,
|
|
11012
11007
|
onAtBottom: x
|
|
11013
11008
|
}, b) => {
|
|
11014
|
-
const y = it(null), R = it(null), S = it(!1), [C, E] =
|
|
11009
|
+
const y = it(null), R = it(null), S = it(!1), [C, E] = pe(!0), I = ze((O) => {
|
|
11015
11010
|
E(O), g && g(!O), x && x(O);
|
|
11016
11011
|
}, [g, x]), j = pt(() => {
|
|
11017
11012
|
if (a)
|
|
@@ -12533,7 +12528,7 @@ var Yd = "PopperAnchor", Xd = m.forwardRef(
|
|
|
12533
12528
|
Xd.displayName = Yd;
|
|
12534
12529
|
var Ia = "PopperContent", [f0, h0] = Kd(Ia), Jd = m.forwardRef(
|
|
12535
12530
|
(e, t) => {
|
|
12536
|
-
var z, P, V, X, se,
|
|
12531
|
+
var z, P, V, X, se, te;
|
|
12537
12532
|
const {
|
|
12538
12533
|
__scopePopper: n,
|
|
12539
12534
|
side: r = "bottom",
|
|
@@ -12575,9 +12570,9 @@ var Ia = "PopperContent", [f0, h0] = Kd(Ia), Jd = m.forwardRef(
|
|
|
12575
12570
|
l && s0({ ...D }),
|
|
12576
12571
|
i0({
|
|
12577
12572
|
...D,
|
|
12578
|
-
apply: ({ elements: Le, rects: Ge, availableWidth: et, availableHeight:
|
|
12573
|
+
apply: ({ elements: Le, rects: Ge, availableWidth: et, availableHeight: be }) => {
|
|
12579
12574
|
const { width: je, height: Ye } = Ge.reference, Fe = Le.floating.style;
|
|
12580
|
-
Fe.setProperty("--radix-popper-available-width", `${et}px`), Fe.setProperty("--radix-popper-available-height", `${
|
|
12575
|
+
Fe.setProperty("--radix-popper-available-width", `${et}px`), Fe.setProperty("--radix-popper-available-height", `${be}px`), Fe.setProperty("--radix-popper-anchor-width", `${je}px`), Fe.setProperty("--radix-popper-anchor-height", `${Ye}px`);
|
|
12581
12576
|
}
|
|
12582
12577
|
}),
|
|
12583
12578
|
R && l0({ element: R, padding: a }),
|
|
@@ -12609,7 +12604,7 @@ var Ia = "PopperContent", [f0, h0] = Kd(Ia), Jd = m.forwardRef(
|
|
|
12609
12604
|
// hide the content if using the hide middleware and should be hidden
|
|
12610
12605
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
12611
12606
|
// as if the PopperContent isn't there at all
|
|
12612
|
-
...((
|
|
12607
|
+
...((te = L.hide) == null ? void 0 : te.referenceHidden) && {
|
|
12613
12608
|
visibility: "hidden",
|
|
12614
12609
|
pointerEvents: "none"
|
|
12615
12610
|
}
|
|
@@ -13771,34 +13766,34 @@ function ci({
|
|
|
13771
13766
|
streamingAssistantId: M,
|
|
13772
13767
|
lastCheckpointId: D,
|
|
13773
13768
|
lastCheckpointNs: _
|
|
13774
|
-
} = sx(), [W, H] =
|
|
13775
|
-
Se.current && (Se.current.value = ""),
|
|
13769
|
+
} = sx(), [W, H] = pe(null), [q, L] = pe(""), [k, U] = pe(null), [Y, de] = pe([]), [oe, fe] = pe(0), [Re, ue] = pe(0), [z, P] = pe(!1), [V, X] = pe(null), [se, te] = pe(null), [Le, Ge] = pe(!1), [et, be] = pe(null), [je, Ye] = pe([]), [Fe, st] = pe(null), [at, Z] = pe(null), [ae, he] = pe(!1), Se = it(null), ve = it(null), Ie = it(null), Xe = ze(() => {
|
|
13770
|
+
Se.current && (Se.current.value = ""), ve.current && (ve.current.value = ""), fe((ne) => ne + 1), ue((ne) => ne + 1);
|
|
13776
13771
|
}, []), Ue = it(!1);
|
|
13777
13772
|
gt(() => {
|
|
13778
13773
|
Ue.current && !N && (de([]), Xe()), Ue.current = N;
|
|
13779
13774
|
}, [N, Xe]);
|
|
13780
|
-
const [lt, Et] =
|
|
13775
|
+
const [lt, Et] = pe("desktop");
|
|
13781
13776
|
gt(() => {
|
|
13782
|
-
const
|
|
13783
|
-
const
|
|
13784
|
-
Et(
|
|
13777
|
+
const ne = () => {
|
|
13778
|
+
const xe = window.innerWidth;
|
|
13779
|
+
Et(xe < 640 ? "phone" : xe < 1024 ? "tablet" : "desktop");
|
|
13785
13780
|
};
|
|
13786
|
-
return
|
|
13781
|
+
return ne(), window.addEventListener("resize", ne), () => window.removeEventListener("resize", ne);
|
|
13787
13782
|
}, []), gt(() => {
|
|
13788
|
-
let
|
|
13783
|
+
let ne = !1;
|
|
13789
13784
|
if (!v) {
|
|
13790
13785
|
Ye([]), st(null), Z(null), Ie.current = null;
|
|
13791
13786
|
return;
|
|
13792
13787
|
}
|
|
13793
|
-
const
|
|
13788
|
+
const xe = {
|
|
13794
13789
|
threadId: v,
|
|
13795
13790
|
checkpointId: D ?? null,
|
|
13796
13791
|
checkpointNs: _ ?? null
|
|
13797
13792
|
}, Me = Ie.current;
|
|
13798
|
-
if (!(Me && Me.threadId ===
|
|
13793
|
+
if (!(Me && Me.threadId === xe.threadId && Me.checkpointId === xe.checkpointId && Me.checkpointNs === xe.checkpointNs))
|
|
13799
13794
|
return x(v).then((rt) => {
|
|
13800
13795
|
var co;
|
|
13801
|
-
if (
|
|
13796
|
+
if (ne) return;
|
|
13802
13797
|
const _t = ((rt == null ? void 0 : rt.checkpoints) ?? []).slice().sort((gn, T) => new Date(T.createdAt).getTime() - new Date(gn.createdAt).getTime());
|
|
13803
13798
|
Ye(_t);
|
|
13804
13799
|
const tn = Fe, kr = tn && _t.some((gn) => gn.checkpointId === tn) ? tn : ((co = _t[0]) == null ? void 0 : co.checkpointId) ?? null;
|
|
@@ -13807,11 +13802,11 @@ function ci({
|
|
|
13807
13802
|
const gn = _t.find((T) => T.checkpointId === kr);
|
|
13808
13803
|
lo = (gn == null ? void 0 : gn.checkpointNs) ?? null;
|
|
13809
13804
|
}
|
|
13810
|
-
st(kr), Z(lo), Ie.current =
|
|
13805
|
+
st(kr), Z(lo), Ie.current = xe;
|
|
13811
13806
|
}).catch((rt) => {
|
|
13812
|
-
console.error("ChatInterface - listCheckpoints error:", rt),
|
|
13807
|
+
console.error("ChatInterface - listCheckpoints error:", rt), ne || (Ye([]), Ie.current = null);
|
|
13813
13808
|
}), () => {
|
|
13814
|
-
|
|
13809
|
+
ne = !0;
|
|
13815
13810
|
};
|
|
13816
13811
|
}, [v, D, _, Fe, x]), gt(() => {
|
|
13817
13812
|
D && (st(D), Z(_ ?? null));
|
|
@@ -13820,64 +13815,64 @@ function ci({
|
|
|
13820
13815
|
if (!(!S || C))
|
|
13821
13816
|
try {
|
|
13822
13817
|
await j();
|
|
13823
|
-
} catch (
|
|
13824
|
-
console.warn("loadOlderMessages failed",
|
|
13818
|
+
} catch (ne) {
|
|
13819
|
+
console.warn("loadOlderMessages failed", ne);
|
|
13825
13820
|
}
|
|
13826
13821
|
}, [S, C, j]);
|
|
13827
13822
|
gt(() => {
|
|
13828
13823
|
(async () => {
|
|
13829
13824
|
if (!w.baseUrl) {
|
|
13830
|
-
|
|
13825
|
+
be(null);
|
|
13831
13826
|
return;
|
|
13832
13827
|
}
|
|
13833
13828
|
try {
|
|
13834
|
-
const
|
|
13835
|
-
|
|
13836
|
-
} catch (
|
|
13837
|
-
console.warn("Failed to fetch default message:",
|
|
13829
|
+
const xe = await w.getAgent("default");
|
|
13830
|
+
be(xe.uiDefaultMessage || null);
|
|
13831
|
+
} catch (xe) {
|
|
13832
|
+
console.warn("Failed to fetch default message:", xe), be(null);
|
|
13838
13833
|
}
|
|
13839
13834
|
})();
|
|
13840
13835
|
}, [w]), gt(() => {
|
|
13841
13836
|
O && !Le && (p == null || p(O));
|
|
13842
13837
|
}, [O, Le, p]);
|
|
13843
|
-
const G = (
|
|
13844
|
-
if (
|
|
13845
|
-
return `Message too long (${
|
|
13838
|
+
const G = (ne) => {
|
|
13839
|
+
if (ne.length > Oo)
|
|
13840
|
+
return `Message too long (${ne.length}/${Oo} characters)`;
|
|
13846
13841
|
try {
|
|
13847
|
-
return Jb(
|
|
13848
|
-
} catch (
|
|
13849
|
-
return (
|
|
13850
|
-
}
|
|
13851
|
-
}, le = async (
|
|
13852
|
-
const
|
|
13853
|
-
if (!(!
|
|
13854
|
-
if (
|
|
13855
|
-
const Me = G(
|
|
13842
|
+
return Jb(ne), null;
|
|
13843
|
+
} catch (xe) {
|
|
13844
|
+
return (xe == null ? void 0 : xe.message) || "Invalid message";
|
|
13845
|
+
}
|
|
13846
|
+
}, le = async (ne) => {
|
|
13847
|
+
const xe = ne.trim();
|
|
13848
|
+
if (!(!xe && Y.length === 0)) {
|
|
13849
|
+
if (xe) {
|
|
13850
|
+
const Me = G(xe);
|
|
13856
13851
|
if (Me) {
|
|
13857
13852
|
U(Me);
|
|
13858
13853
|
return;
|
|
13859
13854
|
}
|
|
13860
13855
|
}
|
|
13861
13856
|
try {
|
|
13862
|
-
await E(
|
|
13857
|
+
await E(xe || "", {
|
|
13863
13858
|
checkpointId: Fe ?? D ?? void 0,
|
|
13864
13859
|
checkpointNs: at ?? _ ?? void 0,
|
|
13865
13860
|
payloadExtras: W ? { edit: !0, originalMessageId: W } : void 0,
|
|
13866
13861
|
attachments: Y
|
|
13867
|
-
}), f == null || f(
|
|
13862
|
+
}), f == null || f(xe), U(null), de([]), Xe(), H(null), L("");
|
|
13868
13863
|
} catch (Me) {
|
|
13869
13864
|
const rt = (Me == null ? void 0 : Me.message) || "Failed to send message";
|
|
13870
13865
|
U(rt), p == null || p(rt);
|
|
13871
13866
|
}
|
|
13872
13867
|
}
|
|
13873
|
-
}, Ee = $.useCallback((
|
|
13874
|
-
u && (H(
|
|
13868
|
+
}, Ee = $.useCallback((ne, xe) => {
|
|
13869
|
+
u && (H(ne), L(xe), U(null));
|
|
13875
13870
|
}, [u]), We = $.useCallback(() => {
|
|
13876
13871
|
H(null), L(""), U(null);
|
|
13877
|
-
}, []), qe = ze((
|
|
13878
|
-
Ee(
|
|
13879
|
-
}, [Ee]), kt = ze((
|
|
13880
|
-
const
|
|
13872
|
+
}, []), qe = ze((ne, xe) => {
|
|
13873
|
+
Ee(ne, xe);
|
|
13874
|
+
}, [Ee]), kt = ze((ne) => {
|
|
13875
|
+
const xe = (Me) => {
|
|
13881
13876
|
const rt = Me.content || [], _t = rt.filter((tn) => tn.type === "text").map((tn) => tn.text).join("");
|
|
13882
13877
|
if (_t) return _t;
|
|
13883
13878
|
try {
|
|
@@ -13886,58 +13881,58 @@ function ci({
|
|
|
13886
13881
|
return String(rt);
|
|
13887
13882
|
}
|
|
13888
13883
|
};
|
|
13889
|
-
for (let Me =
|
|
13884
|
+
for (let Me = ne - 1; Me >= 0; Me--)
|
|
13890
13885
|
if (R[Me].role === "user") {
|
|
13891
|
-
const rt =
|
|
13886
|
+
const rt = xe(R[Me]);
|
|
13892
13887
|
rt && E(rt, {
|
|
13893
13888
|
checkpointId: Fe ?? D ?? void 0,
|
|
13894
13889
|
checkpointNs: at ?? _ ?? void 0
|
|
13895
13890
|
});
|
|
13896
13891
|
break;
|
|
13897
13892
|
}
|
|
13898
|
-
}, [R, E, Fe, at, D, _]), Sn = (
|
|
13899
|
-
const
|
|
13900
|
-
de((Me) => [...Me, ...
|
|
13901
|
-
}, qt = (
|
|
13902
|
-
de((
|
|
13903
|
-
const Me =
|
|
13893
|
+
}, [R, E, Fe, at, D, _]), Sn = (ne) => {
|
|
13894
|
+
const xe = Array.from(ne.target.files || []);
|
|
13895
|
+
de((Me) => [...Me, ...xe]), ne.target.value = "";
|
|
13896
|
+
}, qt = (ne) => {
|
|
13897
|
+
de((xe) => {
|
|
13898
|
+
const Me = xe.filter((rt, _t) => ne !== _t);
|
|
13904
13899
|
return Me.length === 0 && Xe(), Me;
|
|
13905
13900
|
});
|
|
13906
|
-
}, Mn = async (
|
|
13907
|
-
const
|
|
13908
|
-
if (
|
|
13909
|
-
X(null),
|
|
13901
|
+
}, Mn = async (ne) => {
|
|
13902
|
+
const xe = (ne.target.files || [])[0];
|
|
13903
|
+
if (xe) {
|
|
13904
|
+
X(null), te(null), P(!0);
|
|
13910
13905
|
try {
|
|
13911
13906
|
await E("", {
|
|
13912
13907
|
checkpointId: Fe ?? D ?? void 0,
|
|
13913
13908
|
checkpointNs: at ?? _ ?? void 0,
|
|
13914
|
-
attachments: [
|
|
13909
|
+
attachments: [xe]
|
|
13915
13910
|
});
|
|
13916
|
-
const Me = `Uploaded ${
|
|
13917
|
-
|
|
13911
|
+
const Me = `Uploaded ${xe.name} - processing through chat stream`;
|
|
13912
|
+
te(Me);
|
|
13918
13913
|
} catch (Me) {
|
|
13919
13914
|
const rt = Me instanceof Error ? Me.message : "Failed to upload Excel file";
|
|
13920
13915
|
console.error("Excel upload failed", Me), X(rt), p == null || p(rt);
|
|
13921
13916
|
} finally {
|
|
13922
|
-
P(!1),
|
|
13917
|
+
P(!1), ne.target.value = "", Xe();
|
|
13923
13918
|
}
|
|
13924
13919
|
}
|
|
13925
|
-
}, Dn = (
|
|
13926
|
-
if (!
|
|
13927
|
-
const
|
|
13928
|
-
return Number.isNaN(
|
|
13929
|
-
}, or = async (
|
|
13920
|
+
}, Dn = (ne) => {
|
|
13921
|
+
if (!ne) return "Unknown";
|
|
13922
|
+
const xe = Date.parse(ne);
|
|
13923
|
+
return Number.isNaN(xe) ? ne : new Date(xe).toLocaleString();
|
|
13924
|
+
}, or = async (ne) => {
|
|
13930
13925
|
if (v) {
|
|
13931
|
-
|
|
13926
|
+
he(!0);
|
|
13932
13927
|
try {
|
|
13933
|
-
if (!
|
|
13928
|
+
if (!ne) {
|
|
13934
13929
|
await y(), st(null), Z(null);
|
|
13935
13930
|
return;
|
|
13936
13931
|
}
|
|
13937
|
-
const
|
|
13938
|
-
await b(
|
|
13932
|
+
const xe = je.find((rt) => rt.checkpointId === ne), Me = (xe == null ? void 0 : xe.checkpointNs) ?? null;
|
|
13933
|
+
await b(ne, Me), st(ne), Z(Me);
|
|
13939
13934
|
} finally {
|
|
13940
|
-
|
|
13935
|
+
he(!1);
|
|
13941
13936
|
}
|
|
13942
13937
|
}
|
|
13943
13938
|
}, Er = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, Ln = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${d.messagesArea || ""}`, mn = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
|
|
@@ -13963,16 +13958,16 @@ function ci({
|
|
|
13963
13958
|
{
|
|
13964
13959
|
className: "border border-border rounded px-2 py-1 text-xs bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring dark:bg-secondary",
|
|
13965
13960
|
value: Fe ?? "",
|
|
13966
|
-
onChange: (
|
|
13967
|
-
const
|
|
13968
|
-
or(
|
|
13961
|
+
onChange: (ne) => {
|
|
13962
|
+
const xe = ne.target.value || null;
|
|
13963
|
+
or(xe);
|
|
13969
13964
|
},
|
|
13970
13965
|
children: [
|
|
13971
13966
|
/* @__PURE__ */ c.jsx("option", { value: "", children: "Latest" }),
|
|
13972
|
-
je.map((
|
|
13973
|
-
Dn(
|
|
13974
|
-
|
|
13975
|
-
] },
|
|
13967
|
+
je.map((ne) => /* @__PURE__ */ c.jsxs("option", { value: ne.checkpointId, children: [
|
|
13968
|
+
Dn(ne.createdAt),
|
|
13969
|
+
ne.preview ? ` — ${ne.preview.slice(0, 40)}` : ""
|
|
13970
|
+
] }, ne.checkpointId))
|
|
13976
13971
|
]
|
|
13977
13972
|
}
|
|
13978
13973
|
)
|
|
@@ -14038,32 +14033,32 @@ function ci({
|
|
|
14038
14033
|
ref: Se,
|
|
14039
14034
|
type: "file",
|
|
14040
14035
|
multiple: !0,
|
|
14041
|
-
onChange: (
|
|
14036
|
+
onChange: (ne) => Sn(ne),
|
|
14042
14037
|
className: "hidden"
|
|
14043
14038
|
},
|
|
14044
14039
|
oe
|
|
14045
14040
|
),
|
|
14046
|
-
Y.length > 0 && /* @__PURE__ */ c.jsx("div", { className: "flex flex-wrap gap-2", children: Y.map((
|
|
14041
|
+
Y.length > 0 && /* @__PURE__ */ c.jsx("div", { className: "flex flex-wrap gap-2", children: Y.map((ne, xe) => /* @__PURE__ */ c.jsxs("div", { 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", children: [
|
|
14047
14042
|
/* @__PURE__ */ c.jsx(ui, { size: 14 }),
|
|
14048
|
-
/* @__PURE__ */ c.jsx("span", { className: "truncate max-w-[150px]", children:
|
|
14043
|
+
/* @__PURE__ */ c.jsx("span", { className: "truncate max-w-[150px]", children: ne.name }),
|
|
14049
14044
|
/* @__PURE__ */ c.jsx(
|
|
14050
14045
|
Be,
|
|
14051
14046
|
{
|
|
14052
14047
|
variant: "ghost",
|
|
14053
14048
|
size: "sm",
|
|
14054
|
-
onClick: () => qt(
|
|
14049
|
+
onClick: () => qt(xe),
|
|
14055
14050
|
className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
|
|
14056
|
-
"aria-label": `Remove ${
|
|
14051
|
+
"aria-label": `Remove ${ne.name}`,
|
|
14057
14052
|
children: /* @__PURE__ */ c.jsx(ur, { size: 12 })
|
|
14058
14053
|
}
|
|
14059
14054
|
)
|
|
14060
|
-
] },
|
|
14055
|
+
] }, xe)) })
|
|
14061
14056
|
] }),
|
|
14062
14057
|
l && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
14063
14058
|
/* @__PURE__ */ c.jsx(
|
|
14064
14059
|
"input",
|
|
14065
14060
|
{
|
|
14066
|
-
ref:
|
|
14061
|
+
ref: ve,
|
|
14067
14062
|
type: "file",
|
|
14068
14063
|
accept: ".xls,.xlsx,.xlsm",
|
|
14069
14064
|
onChange: Mn,
|
|
@@ -14096,8 +14091,8 @@ function ci({
|
|
|
14096
14091
|
) }),
|
|
14097
14092
|
/* @__PURE__ */ c.jsxs(sh, { align: "start", sideOffset: 6, className: "w-52", children: [
|
|
14098
14093
|
a && /* @__PURE__ */ c.jsxs(Mi, { onClick: () => {
|
|
14099
|
-
var
|
|
14100
|
-
return (
|
|
14094
|
+
var ne;
|
|
14095
|
+
return (ne = Se.current) == null ? void 0 : ne.click();
|
|
14101
14096
|
}, className: "cursor-pointer", children: [
|
|
14102
14097
|
/* @__PURE__ */ c.jsx(ui, { className: "h-4 w-4 mr-2" }),
|
|
14103
14098
|
" Attach files or images"
|
|
@@ -14106,8 +14101,8 @@ function ci({
|
|
|
14106
14101
|
Mi,
|
|
14107
14102
|
{
|
|
14108
14103
|
onClick: () => {
|
|
14109
|
-
var
|
|
14110
|
-
z || (
|
|
14104
|
+
var ne;
|
|
14105
|
+
z || (ne = ve.current) == null || ne.click();
|
|
14111
14106
|
},
|
|
14112
14107
|
className: `cursor-pointer ${z ? "opacity-60 pointer-events-none" : ""}`,
|
|
14113
14108
|
children: [
|
|
@@ -14718,7 +14713,7 @@ function wc({
|
|
|
14718
14713
|
deleteThread: v,
|
|
14719
14714
|
renameThread: g,
|
|
14720
14715
|
isLoadingThreads: x
|
|
14721
|
-
} = Gi(), [b, y] =
|
|
14716
|
+
} = Gi(), [b, y] = pe(h ?? []), [R, S] = pe(null), [C, E] = pe(""), [I, j] = pe(!1);
|
|
14722
14717
|
gt(() => {
|
|
14723
14718
|
y(h ?? []);
|
|
14724
14719
|
}, [h]);
|
|
@@ -15331,9 +15326,9 @@ var Gt = 10, [Uh, On] = Rr(Zn), kC = "SelectContentImpl", IC = mr("SelectContent
|
|
|
15331
15326
|
}, [y]), pa();
|
|
15332
15327
|
const H = m.useCallback(
|
|
15333
15328
|
(z) => {
|
|
15334
|
-
const [P, ...V] = M().map((
|
|
15335
|
-
for (const
|
|
15336
|
-
if (
|
|
15329
|
+
const [P, ...V] = M().map((te) => te.ref.current), [X] = V.slice(-1), se = document.activeElement;
|
|
15330
|
+
for (const te of z)
|
|
15331
|
+
if (te === se || (te == null || te.scrollIntoView({ block: "nearest" }), te === P && S && (S.scrollTop = 0), te === X && S && (S.scrollTop = S.scrollHeight), te == null || te.focus(), document.activeElement !== se)) return;
|
|
15337
15332
|
},
|
|
15338
15333
|
[M, S]
|
|
15339
15334
|
), q = m.useCallback(
|
|
@@ -15348,10 +15343,10 @@ var Gt = 10, [Uh, On] = Rr(Zn), kC = "SelectContentImpl", IC = mr("SelectContent
|
|
|
15348
15343
|
if (y) {
|
|
15349
15344
|
let z = { x: 0, y: 0 };
|
|
15350
15345
|
const P = (X) => {
|
|
15351
|
-
var se,
|
|
15346
|
+
var se, te;
|
|
15352
15347
|
z = {
|
|
15353
15348
|
x: Math.abs(Math.round(X.pageX) - (((se = k.current) == null ? void 0 : se.x) ?? 0)),
|
|
15354
|
-
y: Math.abs(Math.round(X.pageY) - (((
|
|
15349
|
+
y: Math.abs(Math.round(X.pageY) - (((te = k.current) == null ? void 0 : te.y) ?? 0))
|
|
15355
15350
|
};
|
|
15356
15351
|
}, V = (X) => {
|
|
15357
15352
|
z.x <= 10 && z.y <= 10 ? X.preventDefault() : y.contains(X.target) || L(!1), document.removeEventListener("pointermove", P), k.current = null;
|
|
@@ -15455,8 +15450,8 @@ var Gt = 10, [Uh, On] = Rr(Zn), kC = "SelectContentImpl", IC = mr("SelectContent
|
|
|
15455
15450
|
if (z.key === "Tab" && z.preventDefault(), !P && z.key.length === 1 && Y(z.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(z.key)) {
|
|
15456
15451
|
let X = M().filter((se) => !se.disabled).map((se) => se.ref.current);
|
|
15457
15452
|
if (["ArrowUp", "End"].includes(z.key) && (X = X.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(z.key)) {
|
|
15458
|
-
const se = z.target,
|
|
15459
|
-
X = X.slice(
|
|
15453
|
+
const se = z.target, te = X.indexOf(se);
|
|
15454
|
+
X = X.slice(te + 1);
|
|
15460
15455
|
}
|
|
15461
15456
|
setTimeout(() => H(X)), z.preventDefault();
|
|
15462
15457
|
}
|
|
@@ -15477,20 +15472,20 @@ var NC = "SelectItemAlignedPosition", Vh = m.forwardRef((e, t) => {
|
|
|
15477
15472
|
if (s.trigger && s.valueNode && a && u && v && g && x) {
|
|
15478
15473
|
const E = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), j = s.valueNode.getBoundingClientRect(), N = x.getBoundingClientRect();
|
|
15479
15474
|
if (s.dir !== "rtl") {
|
|
15480
|
-
const se = N.left - I.left,
|
|
15475
|
+
const se = N.left - I.left, te = j.left - se, Le = E.left - te, Ge = E.width + Le, et = Math.max(Ge, I.width), be = window.innerWidth - Gt, je = Di(te, [
|
|
15481
15476
|
Gt,
|
|
15482
15477
|
// Prevents the content from going off the starting edge of the
|
|
15483
15478
|
// viewport. It may still go off the ending edge, but this can be
|
|
15484
15479
|
// controlled by the user since they may want to manage overflow in a
|
|
15485
15480
|
// specific way.
|
|
15486
15481
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
15487
|
-
Math.max(Gt,
|
|
15482
|
+
Math.max(Gt, be - et)
|
|
15488
15483
|
]);
|
|
15489
15484
|
a.style.minWidth = Ge + "px", a.style.left = je + "px";
|
|
15490
15485
|
} else {
|
|
15491
|
-
const se = I.right - N.right,
|
|
15486
|
+
const se = I.right - N.right, te = window.innerWidth - j.right - se, Le = window.innerWidth - E.right - te, Ge = E.width + Le, et = Math.max(Ge, I.width), be = window.innerWidth - Gt, je = Di(te, [
|
|
15492
15487
|
Gt,
|
|
15493
|
-
Math.max(Gt,
|
|
15488
|
+
Math.max(Gt, be - et)
|
|
15494
15489
|
]);
|
|
15495
15490
|
a.style.minWidth = Ge + "px", a.style.right = je + "px";
|
|
15496
15491
|
}
|
|
@@ -15498,10 +15493,10 @@ var NC = "SelectItemAlignedPosition", Vh = m.forwardRef((e, t) => {
|
|
|
15498
15493
|
if (P <= fe) {
|
|
15499
15494
|
const se = O.length > 0 && g === O[O.length - 1].ref.current;
|
|
15500
15495
|
a.style.bottom = "0px";
|
|
15501
|
-
const
|
|
15496
|
+
const te = u.clientHeight - v.offsetTop - v.offsetHeight, Le = Math.max(
|
|
15502
15497
|
Re,
|
|
15503
15498
|
ue + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
15504
|
-
(se ? oe : 0) +
|
|
15499
|
+
(se ? oe : 0) + te + q
|
|
15505
15500
|
), Ge = P + Le;
|
|
15506
15501
|
a.style.height = Ge + "px";
|
|
15507
15502
|
} else {
|
|
@@ -16166,7 +16161,7 @@ const nT = {
|
|
|
16166
16161
|
}
|
|
16167
16162
|
};
|
|
16168
16163
|
function $T({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
16169
|
-
const [r, o] =
|
|
16164
|
+
const [r, o] = pe(!1), [s, i] = pe(!1), [a, l] = pe(e), [u, d] = pe(!1), { toast: f } = ha();
|
|
16170
16165
|
gt(() => {
|
|
16171
16166
|
const g = JSON.stringify(a) !== JSON.stringify(e);
|
|
16172
16167
|
d(g);
|