teodor-new-chat-ui 4.3.200 → 4.3.201
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 +623 -617
- package/dist/index.umd.js +18 -18
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var om = Object.defineProperty;
|
|
|
2
2
|
var sm = (e, t, n) => t in e ? om(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var cl = (e, t, n) => sm(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as v from "react";
|
|
5
|
-
import z, { createContext as co, useContext as xs, useRef as Ze, useCallback as Ie, useReducer as im, useEffect as
|
|
5
|
+
import z, { createContext as co, useContext as xs, useRef as Ze, useCallback as Ie, useReducer as im, useEffect as Ct, useMemo as at, useState as ge, useLayoutEffect as am, createElement as Do, useImperativeHandle as lm } from "react";
|
|
6
6
|
import { Square as cm, Send as um, ChevronRight as Xc, Check as ca, Circle as dm, X as vr, ExternalLink as fm, Download as pm, Image as hm, FileText as ul, Loader as ua, Bot as si, Wrench as mm, User as gm, Paperclip as ji, ChevronUp as da, ChevronDown as ys, ChevronLeft as xm, Copy as dl, Edit as fl, RotateCcw as _i, Info as ym, Loader2 as zr, Edit3 as Jc, Plus as vm, FileSpreadsheet as wm, MessageSquarePlus as bm, MessageSquare as Sm, Calendar as Cm, Trash2 as Tm, Settings as km, Server as Rm, EyeOff as Em, Eye as Im, Layout as Nm, MessageCircle as Am, Save as jm } from "lucide-react";
|
|
7
7
|
import { Slot as _m, createSlot as Tr } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as vs } from "class-variance-authority";
|
|
@@ -66,10 +66,10 @@ function Dm() {
|
|
|
66
66
|
{
|
|
67
67
|
var Se = g.ReactDebugCurrentFrame, Ye = Se.getStackAddendum();
|
|
68
68
|
Ye !== "" && (K += "%s", ae = ae.concat([Ye]));
|
|
69
|
-
var
|
|
70
|
-
return String(
|
|
69
|
+
var it = ae.map(function(Ue) {
|
|
70
|
+
return String(Ue);
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
it.unshift("Warning: " + K), Function.prototype.apply.call(console[R], console, it);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
var T = !1, C = !1, S = !1, k = !1, N = !1, I;
|
|
@@ -126,9 +126,9 @@ function Dm() {
|
|
|
126
126
|
var Se = R.displayName || null;
|
|
127
127
|
return Se !== null ? Se : F(R.type) || "Memo";
|
|
128
128
|
case p: {
|
|
129
|
-
var Ye = R,
|
|
129
|
+
var Ye = R, it = Ye._payload, Ue = Ye._init;
|
|
130
130
|
try {
|
|
131
|
-
return F(
|
|
131
|
+
return F(Ue(it));
|
|
132
132
|
} catch {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -136,14 +136,14 @@ function Dm() {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
var j = Object.assign, $ = 0, A, B, D, O, J, X,
|
|
139
|
+
var j = Object.assign, $ = 0, A, B, D, O, J, X, fe;
|
|
140
140
|
function Ee() {
|
|
141
141
|
}
|
|
142
142
|
Ee.__reactDisabledLog = !0;
|
|
143
143
|
function Ne() {
|
|
144
144
|
{
|
|
145
145
|
if ($ === 0) {
|
|
146
|
-
A = console.log, B = console.info, D = console.warn, O = console.error, J = console.group, X = console.groupCollapsed,
|
|
146
|
+
A = console.log, B = console.info, D = console.warn, O = console.error, J = console.group, X = console.groupCollapsed, fe = console.groupEnd;
|
|
147
147
|
var R = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
@@ -191,7 +191,7 @@ function Dm() {
|
|
|
191
191
|
value: X
|
|
192
192
|
}),
|
|
193
193
|
groupEnd: j({}, R, {
|
|
194
|
-
value:
|
|
194
|
+
value: fe
|
|
195
195
|
})
|
|
196
196
|
});
|
|
197
197
|
}
|
|
@@ -229,31 +229,31 @@ function Dm() {
|
|
|
229
229
|
H = !0;
|
|
230
230
|
var Ye = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
|
-
var
|
|
233
|
-
|
|
232
|
+
var it;
|
|
233
|
+
it = ee.current, ee.current = null, Ne();
|
|
234
234
|
try {
|
|
235
235
|
if (K) {
|
|
236
|
-
var
|
|
236
|
+
var Ue = function() {
|
|
237
237
|
throw Error();
|
|
238
238
|
};
|
|
239
|
-
if (Object.defineProperty(
|
|
239
|
+
if (Object.defineProperty(Ue.prototype, "props", {
|
|
240
240
|
set: function() {
|
|
241
241
|
throw Error();
|
|
242
242
|
}
|
|
243
243
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
244
|
try {
|
|
245
|
-
Reflect.construct(
|
|
245
|
+
Reflect.construct(Ue, []);
|
|
246
246
|
} catch (Ft) {
|
|
247
247
|
Se = Ft;
|
|
248
248
|
}
|
|
249
|
-
Reflect.construct(R, [],
|
|
249
|
+
Reflect.construct(R, [], Ue);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
|
-
|
|
252
|
+
Ue.call();
|
|
253
253
|
} catch (Ft) {
|
|
254
254
|
Se = Ft;
|
|
255
255
|
}
|
|
256
|
-
R.call(
|
|
256
|
+
R.call(Ue.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
@@ -267,23 +267,23 @@ function Dm() {
|
|
|
267
267
|
if (Ft && Se && typeof Ft.stack == "string") {
|
|
268
268
|
for (var Fe = Ft.stack.split(`
|
|
269
269
|
`), Ot = Se.stack.split(`
|
|
270
|
-
`),
|
|
271
|
-
|
|
272
|
-
for (;
|
|
273
|
-
if (Fe[
|
|
274
|
-
if (
|
|
270
|
+
`), St = Fe.length - 1, vt = Ot.length - 1; St >= 1 && vt >= 0 && Fe[St] !== Ot[vt]; )
|
|
271
|
+
vt--;
|
|
272
|
+
for (; St >= 1 && vt >= 0; St--, vt--)
|
|
273
|
+
if (Fe[St] !== Ot[vt]) {
|
|
274
|
+
if (St !== 1 || vt !== 1)
|
|
275
275
|
do
|
|
276
|
-
if (
|
|
276
|
+
if (St--, vt--, vt < 0 || Fe[St] !== Ot[vt]) {
|
|
277
277
|
var Kt = `
|
|
278
|
-
` + Fe[
|
|
278
|
+
` + Fe[St].replace(" at new ", " at ");
|
|
279
279
|
return R.displayName && Kt.includes("<anonymous>") && (Kt = Kt.replace("<anonymous>", R.displayName)), typeof R == "function" && te.set(R, Kt), Kt;
|
|
280
280
|
}
|
|
281
|
-
while (
|
|
281
|
+
while (St >= 1 && vt >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
H = !1, ee.current =
|
|
286
|
+
H = !1, ee.current = it, G(), Error.prepareStackTrace = Ye;
|
|
287
287
|
}
|
|
288
288
|
var Fn = R ? R.displayName || R.name : "", Nn = Fn ? M(Fn) : "";
|
|
289
289
|
return typeof R == "function" && te.set(R, Nn), Nn;
|
|
@@ -315,9 +315,9 @@ function Dm() {
|
|
|
315
315
|
case f:
|
|
316
316
|
return se(R.type, K, ae);
|
|
317
317
|
case p: {
|
|
318
|
-
var Se = R, Ye = Se._payload,
|
|
318
|
+
var Se = R, Ye = Se._payload, it = Se._init;
|
|
319
319
|
try {
|
|
320
|
-
return se(
|
|
320
|
+
return se(it(Ye), K, ae);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
@@ -334,20 +334,20 @@ function Dm() {
|
|
|
334
334
|
}
|
|
335
335
|
function $e(R, K, ae, Se, Ye) {
|
|
336
336
|
{
|
|
337
|
-
var
|
|
338
|
-
for (var
|
|
339
|
-
if (
|
|
337
|
+
var it = Function.call.bind(Te);
|
|
338
|
+
for (var Ue in R)
|
|
339
|
+
if (it(R, Ue)) {
|
|
340
340
|
var Fe = void 0;
|
|
341
341
|
try {
|
|
342
|
-
if (typeof R[
|
|
343
|
-
var Ot = Error((Se || "React class") + ": " + ae + " type `" +
|
|
342
|
+
if (typeof R[Ue] != "function") {
|
|
343
|
+
var Ot = Error((Se || "React class") + ": " + ae + " type `" + Ue + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ue] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
344
|
throw Ot.name = "Invariant Violation", Ot;
|
|
345
345
|
}
|
|
346
|
-
Fe = R[
|
|
347
|
-
} catch (
|
|
348
|
-
Fe =
|
|
346
|
+
Fe = R[Ue](K, Ue, Se, ae, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
|
+
} catch (St) {
|
|
348
|
+
Fe = St;
|
|
349
349
|
}
|
|
350
|
-
Fe && !(Fe instanceof Error) && (ze(Ye), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Se || "React class", ae,
|
|
350
|
+
Fe && !(Fe instanceof Error) && (ze(Ye), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Se || "React class", ae, Ue, typeof Fe), ze(null)), Fe instanceof Error && !(Fe.message in je) && (je[Fe.message] = !0, ze(Ye), w("Failed %s type: %s", ae, Fe.message), ze(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -375,12 +375,12 @@ function Dm() {
|
|
|
375
375
|
if (Je(R))
|
|
376
376
|
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(R)), nt(R);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var ut = g.ReactCurrentOwner, lt = {
|
|
379
379
|
key: !0,
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
382
382
|
__source: !0
|
|
383
|
-
},
|
|
383
|
+
}, Tt, bt;
|
|
384
384
|
function re(R) {
|
|
385
385
|
if (Te.call(R, "ref")) {
|
|
386
386
|
var K = Object.getOwnPropertyDescriptor(R, "ref").get;
|
|
@@ -397,13 +397,13 @@ function Dm() {
|
|
|
397
397
|
}
|
|
398
398
|
return R.key !== void 0;
|
|
399
399
|
}
|
|
400
|
-
function Ue(R, K) {
|
|
401
|
-
typeof R.ref == "string" && ct.current;
|
|
402
|
-
}
|
|
403
400
|
function Be(R, K) {
|
|
401
|
+
typeof R.ref == "string" && ut.current;
|
|
402
|
+
}
|
|
403
|
+
function He(R, K) {
|
|
404
404
|
{
|
|
405
405
|
var ae = function() {
|
|
406
|
-
|
|
406
|
+
Tt || (Tt = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
|
|
407
407
|
};
|
|
408
408
|
ae.isReactWarning = !0, Object.defineProperty(R, "key", {
|
|
409
409
|
get: ae,
|
|
@@ -411,10 +411,10 @@ function Dm() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function mt(R, K) {
|
|
415
415
|
{
|
|
416
416
|
var ae = function() {
|
|
417
|
-
|
|
417
|
+
bt || (bt = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
|
|
418
418
|
};
|
|
419
419
|
ae.isReactWarning = !0, Object.defineProperty(R, "ref", {
|
|
420
420
|
get: ae,
|
|
@@ -422,7 +422,7 @@ function Dm() {
|
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var
|
|
425
|
+
var xe = function(R, K, ae, Se, Ye, it, Ue) {
|
|
426
426
|
var Fe = {
|
|
427
427
|
// This tag allows us to uniquely identify this as a React Element
|
|
428
428
|
$$typeof: t,
|
|
@@ -430,9 +430,9 @@ function Dm() {
|
|
|
430
430
|
type: R,
|
|
431
431
|
key: K,
|
|
432
432
|
ref: ae,
|
|
433
|
-
props:
|
|
433
|
+
props: Ue,
|
|
434
434
|
// Record the component responsible for creating this element.
|
|
435
|
-
_owner:
|
|
435
|
+
_owner: it
|
|
436
436
|
};
|
|
437
437
|
return Fe._store = {}, Object.defineProperty(Fe._store, "validated", {
|
|
438
438
|
configurable: !1,
|
|
@@ -451,25 +451,25 @@ function Dm() {
|
|
|
451
451
|
value: Ye
|
|
452
452
|
}), Object.freeze && (Object.freeze(Fe.props), Object.freeze(Fe)), Fe;
|
|
453
453
|
};
|
|
454
|
-
function
|
|
454
|
+
function pe(R, K, ae, Se, Ye) {
|
|
455
455
|
{
|
|
456
|
-
var
|
|
457
|
-
ae !== void 0 && (jt(ae), Fe = "" + ae), we(K) && (jt(K.key), Fe = "" + K.key), re(K) && (Ot = K.ref,
|
|
458
|
-
for (
|
|
459
|
-
Te.call(K,
|
|
456
|
+
var it, Ue = {}, Fe = null, Ot = null;
|
|
457
|
+
ae !== void 0 && (jt(ae), Fe = "" + ae), we(K) && (jt(K.key), Fe = "" + K.key), re(K) && (Ot = K.ref, Be(K, Ye));
|
|
458
|
+
for (it in K)
|
|
459
|
+
Te.call(K, it) && !lt.hasOwnProperty(it) && (Ue[it] = K[it]);
|
|
460
460
|
if (R && R.defaultProps) {
|
|
461
|
-
var
|
|
462
|
-
for (
|
|
463
|
-
|
|
461
|
+
var St = R.defaultProps;
|
|
462
|
+
for (it in St)
|
|
463
|
+
Ue[it] === void 0 && (Ue[it] = St[it]);
|
|
464
464
|
}
|
|
465
465
|
if (Fe || Ot) {
|
|
466
|
-
var
|
|
467
|
-
Fe &&
|
|
466
|
+
var vt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
|
|
467
|
+
Fe && He(Ue, vt), Ot && mt(Ue, vt);
|
|
468
468
|
}
|
|
469
|
-
return
|
|
469
|
+
return xe(R, Fe, Ot, Ye, Se, ut.current, Ue);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
var
|
|
472
|
+
var st = g.ReactCurrentOwner, _t = g.ReactDebugCurrentFrame;
|
|
473
473
|
function V(R) {
|
|
474
474
|
if (R) {
|
|
475
475
|
var K = R._owner, ae = se(R.type, R._source, K ? K.type : null);
|
|
@@ -479,13 +479,13 @@ function Dm() {
|
|
|
479
479
|
}
|
|
480
480
|
var be;
|
|
481
481
|
be = !1;
|
|
482
|
-
function
|
|
482
|
+
function ye(R) {
|
|
483
483
|
return typeof R == "object" && R !== null && R.$$typeof === t;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function ht() {
|
|
486
486
|
{
|
|
487
|
-
if (
|
|
488
|
-
var R = F(
|
|
487
|
+
if (st.current) {
|
|
488
|
+
var R = F(st.current.type);
|
|
489
489
|
if (R)
|
|
490
490
|
return `
|
|
491
491
|
|
|
@@ -494,13 +494,13 @@ Check the render method of \`` + R + "`.";
|
|
|
494
494
|
return "";
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function gt(R) {
|
|
498
498
|
return "";
|
|
499
499
|
}
|
|
500
|
-
var
|
|
500
|
+
var kt = {};
|
|
501
501
|
function Pe(R) {
|
|
502
502
|
{
|
|
503
|
-
var K =
|
|
503
|
+
var K = ht();
|
|
504
504
|
if (!K) {
|
|
505
505
|
var ae = typeof R == "string" ? R : R.displayName || R.name;
|
|
506
506
|
ae && (K = `
|
|
@@ -516,33 +516,33 @@ Check the top-level render call using <` + ae + ">.");
|
|
|
516
516
|
return;
|
|
517
517
|
R._store.validated = !0;
|
|
518
518
|
var ae = Pe(K);
|
|
519
|
-
if (
|
|
519
|
+
if (kt[ae])
|
|
520
520
|
return;
|
|
521
|
-
|
|
521
|
+
kt[ae] = !0;
|
|
522
522
|
var Se = "";
|
|
523
|
-
R && R._owner && R._owner !==
|
|
523
|
+
R && R._owner && R._owner !== st.current && (Se = " It was passed a child from " + F(R._owner.type) + "."), V(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ae, Se), V(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function ct(R, K) {
|
|
527
527
|
{
|
|
528
528
|
if (typeof R != "object")
|
|
529
529
|
return;
|
|
530
530
|
if (Ge(R))
|
|
531
531
|
for (var ae = 0; ae < R.length; ae++) {
|
|
532
532
|
var Se = R[ae];
|
|
533
|
-
|
|
533
|
+
ye(Se) && Vt(Se, K);
|
|
534
534
|
}
|
|
535
|
-
else if (
|
|
535
|
+
else if (ye(R))
|
|
536
536
|
R._store && (R._store.validated = !0);
|
|
537
537
|
else if (R) {
|
|
538
538
|
var Ye = m(R);
|
|
539
539
|
if (typeof Ye == "function" && Ye !== R.entries)
|
|
540
|
-
for (var
|
|
541
|
-
|
|
540
|
+
for (var it = Ye.call(R), Ue; !(Ue = it.next()).done; )
|
|
541
|
+
ye(Ue.value) && Vt(Ue.value, K);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function Rt(R) {
|
|
546
546
|
{
|
|
547
547
|
var K = R.type;
|
|
548
548
|
if (K == null || typeof K == "string")
|
|
@@ -580,32 +580,32 @@ Check the top-level render call using <` + ae + ">.");
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
var Jn = {};
|
|
583
|
-
function Ln(R, K, ae, Se, Ye,
|
|
583
|
+
function Ln(R, K, ae, Se, Ye, it) {
|
|
584
584
|
{
|
|
585
|
-
var
|
|
586
|
-
if (!
|
|
585
|
+
var Ue = E(R);
|
|
586
|
+
if (!Ue) {
|
|
587
587
|
var Fe = "";
|
|
588
588
|
(R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (Fe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
589
|
-
var Ot =
|
|
590
|
-
Ot ? Fe += Ot : Fe +=
|
|
591
|
-
var
|
|
592
|
-
R === null ?
|
|
589
|
+
var Ot = gt();
|
|
590
|
+
Ot ? Fe += Ot : Fe += ht();
|
|
591
|
+
var St;
|
|
592
|
+
R === null ? St = "null" : Ge(R) ? St = "array" : R !== void 0 && R.$$typeof === t ? (St = "<" + (F(R.type) || "Unknown") + " />", Fe = " Did you accidentally export a JSX literal instead of a component?") : St = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", St, Fe);
|
|
593
593
|
}
|
|
594
|
-
var
|
|
595
|
-
if (
|
|
596
|
-
return
|
|
597
|
-
if (
|
|
594
|
+
var vt = pe(R, K, ae, Ye, it);
|
|
595
|
+
if (vt == null)
|
|
596
|
+
return vt;
|
|
597
|
+
if (Ue) {
|
|
598
598
|
var Kt = K.children;
|
|
599
599
|
if (Kt !== void 0)
|
|
600
600
|
if (Se)
|
|
601
601
|
if (Ge(Kt)) {
|
|
602
602
|
for (var Fn = 0; Fn < Kt.length; Fn++)
|
|
603
|
-
|
|
603
|
+
ct(Kt[Fn], R);
|
|
604
604
|
Object.freeze && Object.freeze(Kt);
|
|
605
605
|
} else
|
|
606
606
|
w("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
|
+
ct(Kt, R);
|
|
609
609
|
}
|
|
610
610
|
if (Te.call(K, "key")) {
|
|
611
611
|
var Nn = F(R), Ft = Object.keys(K).filter(function(oe) {
|
|
@@ -621,7 +621,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
621
621
|
<%s key={someKey} {...props} />`, Dr, Nn, q, Nn), Jn[Nn + Dr] = !0;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
return R === r ? Dn(
|
|
624
|
+
return R === r ? Dn(vt) : Rt(vt), vt;
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
function ti(R, K, ae) {
|
|
@@ -1880,8 +1880,8 @@ const xu = (e) => {
|
|
|
1880
1880
|
method: "POST",
|
|
1881
1881
|
body: g,
|
|
1882
1882
|
duplex: "half"
|
|
1883
|
-
}),
|
|
1884
|
-
if (P.isFormData(g) && (
|
|
1883
|
+
}), fe;
|
|
1884
|
+
if (P.isFormData(g) && (fe = X.headers.get("content-type")) && N.setContentType(fe), X.body) {
|
|
1885
1885
|
const [Ee, Ne] = wl(
|
|
1886
1886
|
$,
|
|
1887
1887
|
Xo(bl(S))
|
|
@@ -1907,8 +1907,8 @@ const xu = (e) => {
|
|
|
1907
1907
|
["status", "statusText", "headers"].forEach((G) => {
|
|
1908
1908
|
X[G] = D[G];
|
|
1909
1909
|
});
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1910
|
+
const fe = P.toFiniteNumber(D.headers.get("content-length")), [Ee, Ne] = C && wl(
|
|
1911
|
+
fe,
|
|
1912
1912
|
Xo(bl(C), !0)
|
|
1913
1913
|
) || [];
|
|
1914
1914
|
D = new r(
|
|
@@ -1920,8 +1920,8 @@ const xu = (e) => {
|
|
|
1920
1920
|
}
|
|
1921
1921
|
k = k || "text";
|
|
1922
1922
|
let J = await f[P.findKey(f, k) || "text"](D, x);
|
|
1923
|
-
return !O && j && j(), await new Promise((X,
|
|
1924
|
-
mu(X,
|
|
1923
|
+
return !O && j && j(), await new Promise((X, fe) => {
|
|
1924
|
+
mu(X, fe, {
|
|
1925
1925
|
data: J,
|
|
1926
1926
|
headers: Yt.from(D.headers),
|
|
1927
1927
|
status: D.status,
|
|
@@ -2349,26 +2349,26 @@ function Su(e) {
|
|
|
2349
2349
|
return Su(or(e, o));
|
|
2350
2350
|
}, n;
|
|
2351
2351
|
}
|
|
2352
|
-
const
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2352
|
+
const It = Su(ho);
|
|
2353
|
+
It.Axios = nr;
|
|
2354
|
+
It.CanceledError = Ar;
|
|
2355
|
+
It.CancelToken = lx;
|
|
2356
|
+
It.isCancel = hu;
|
|
2357
|
+
It.VERSION = wu;
|
|
2358
|
+
It.toFormData = Ts;
|
|
2359
|
+
It.AxiosError = Oe;
|
|
2360
|
+
It.Cancel = It.CanceledError;
|
|
2361
|
+
It.all = function(t) {
|
|
2362
2362
|
return Promise.all(t);
|
|
2363
2363
|
};
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2364
|
+
It.spread = cx;
|
|
2365
|
+
It.isAxiosError = ux;
|
|
2366
|
+
It.mergeConfig = or;
|
|
2367
|
+
It.AxiosHeaders = Yt;
|
|
2368
|
+
It.formToJSON = (e) => pu(P.isHTMLForm(e) ? new FormData(e) : e);
|
|
2369
|
+
It.getAdapter = vu.getAdapter;
|
|
2370
|
+
It.HttpStatusCode = Fi;
|
|
2371
|
+
It.default = It;
|
|
2372
2372
|
const {
|
|
2373
2373
|
Axios: QT,
|
|
2374
2374
|
AxiosError: ek,
|
|
@@ -2386,7 +2386,7 @@ const {
|
|
|
2386
2386
|
formToJSON: fk,
|
|
2387
2387
|
getAdapter: pk,
|
|
2388
2388
|
mergeConfig: hk
|
|
2389
|
-
} =
|
|
2389
|
+
} = It, jl = typeof window < "u" ? window.__API_BASE_URL__ : void 0, _l = jl ? _n(jl) : void 0;
|
|
2390
2390
|
function _n(e) {
|
|
2391
2391
|
const n = (e != null && e.trim() ? e.trim() : "/api/chat").replace(/\/+$/, "");
|
|
2392
2392
|
return n ? n.endsWith("/chat") ? n : `${n}/chat` : "/api/chat";
|
|
@@ -2402,7 +2402,7 @@ function zi(e) {
|
|
|
2402
2402
|
function fx(e) {
|
|
2403
2403
|
return $i.add(e), () => $i.delete(e);
|
|
2404
2404
|
}
|
|
2405
|
-
const px = 3e4, hx = 9e4, ln =
|
|
2405
|
+
const px = 3e4, hx = 9e4, ln = It.create({
|
|
2406
2406
|
// Only set baseURL when configured — do NOT fall back to localhost. Falling back causes
|
|
2407
2407
|
// noisy network requests to the frontend Dev server when the backend isn't configured.
|
|
2408
2408
|
..._l ? { baseURL: _l } : {},
|
|
@@ -3056,10 +3056,10 @@ function Bx(e = []) {
|
|
|
3056
3056
|
}, [i]), l = Ie((d) => {
|
|
3057
3057
|
r.current.push(d), a();
|
|
3058
3058
|
}, [a]);
|
|
3059
|
-
|
|
3059
|
+
Ct(() => () => {
|
|
3060
3060
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
|
|
3061
3061
|
}, []);
|
|
3062
|
-
const c =
|
|
3062
|
+
const c = at(() => ({
|
|
3063
3063
|
reset: (d) => n({ type: "reset", payload: { messages: d } }),
|
|
3064
3064
|
seed: (d, f) => n({ type: "seed", payload: { messages: d, ...f ?? {} } }),
|
|
3065
3065
|
prepend: (d) => n({ type: "prepend", payload: { messages: d } }),
|
|
@@ -3393,7 +3393,7 @@ function Vx(e) {
|
|
|
3393
3393
|
return t[t.length - 1] || null;
|
|
3394
3394
|
}
|
|
3395
3395
|
function Kx(e = {}) {
|
|
3396
|
-
const t =
|
|
3396
|
+
const t = at(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ge(e.token ?? null), s = Ze(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ge(!1), [c, d] = ge(null), [f, p] = ge(""), [h, x] = ge(null), [y, m] = ge(0), [g, w] = ge(!1), b = Ze(null), T = Ze(!0), C = Ze(0), S = Ze(null), k = Ze(null), N = Ze(null), I = Ze(null), E = Ie((j) => {
|
|
3397
3397
|
o(j);
|
|
3398
3398
|
}, []), _ = Ie(() => {
|
|
3399
3399
|
p(""), x(null), d(null), k.current = null, N.current = null, I.current = null;
|
|
@@ -3410,7 +3410,7 @@ function Kx(e = {}) {
|
|
|
3410
3410
|
threadId: j.threadId ?? null,
|
|
3411
3411
|
headers: {}
|
|
3412
3412
|
}, (async () => {
|
|
3413
|
-
var
|
|
3413
|
+
var fe, Ee, Ne, G, ee, W, M, H, te, ie, ne, De, Q, se, Te, je, Ke, ze;
|
|
3414
3414
|
const X = ($e) => {
|
|
3415
3415
|
var qe;
|
|
3416
3416
|
try {
|
|
@@ -3429,14 +3429,14 @@ function Kx(e = {}) {
|
|
|
3429
3429
|
if (r)
|
|
3430
3430
|
$e = { Authorization: `Bearer ${r}` };
|
|
3431
3431
|
else if (typeof window < "u") {
|
|
3432
|
-
const
|
|
3432
|
+
const pe = window.__AUTH_TOKEN__, st = ((fe = window.localStorage) == null ? void 0 : fe.getItem("authToken")) || null;
|
|
3433
3433
|
let _t = null;
|
|
3434
3434
|
try {
|
|
3435
3435
|
const be = (Ee = window.localStorage) == null ? void 0 : Ee.getItem("chat-settings");
|
|
3436
3436
|
be && (_t = ((Ne = JSON.parse(be)) == null ? void 0 : Ne.apiKey) || null);
|
|
3437
3437
|
} catch {
|
|
3438
3438
|
}
|
|
3439
|
-
const V =
|
|
3439
|
+
const V = pe || st || _t || null;
|
|
3440
3440
|
V && ($e = { Authorization: `Bearer ${V}` });
|
|
3441
3441
|
}
|
|
3442
3442
|
} catch {
|
|
@@ -3449,8 +3449,8 @@ function Kx(e = {}) {
|
|
|
3449
3449
|
let qe = {};
|
|
3450
3450
|
if (typeof window < "u")
|
|
3451
3451
|
try {
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3452
|
+
const xe = (G = window.localStorage) == null ? void 0 : G.getItem("authSessionId");
|
|
3453
|
+
xe && (qe = { "X-Session-Id": xe });
|
|
3454
3454
|
} catch {
|
|
3455
3455
|
}
|
|
3456
3456
|
const Ge = {
|
|
@@ -3469,80 +3469,80 @@ function Kx(e = {}) {
|
|
|
3469
3469
|
credentials: i
|
|
3470
3470
|
});
|
|
3471
3471
|
if (S.current && (S.current.headers = Ge), !Je.ok || !Je.body) {
|
|
3472
|
-
const
|
|
3472
|
+
const xe = await Je.text().catch(() => "");
|
|
3473
3473
|
console.debug(
|
|
3474
3474
|
"[use-chat] non-OK response",
|
|
3475
3475
|
Je.status,
|
|
3476
|
-
|
|
3476
|
+
xe == null ? void 0 : xe.slice(0, 500)
|
|
3477
3477
|
);
|
|
3478
|
-
const
|
|
3479
|
-
throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A,
|
|
3478
|
+
const pe = `stream ${Je.status}${xe ? ": " + xe : ""}`;
|
|
3479
|
+
throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A, pe), J = !0, D = "error", O = pe, new Error(pe);
|
|
3480
3480
|
}
|
|
3481
3481
|
w(!0);
|
|
3482
3482
|
const nt = Je.body.getReader(), jt = new TextDecoder();
|
|
3483
|
-
let
|
|
3483
|
+
let ut = "", lt = [];
|
|
3484
3484
|
C.current = 0, m(0);
|
|
3485
|
-
let
|
|
3485
|
+
let Tt = 0, bt = null;
|
|
3486
3486
|
const re = () => {
|
|
3487
|
-
if (
|
|
3488
|
-
const
|
|
3489
|
-
|
|
3487
|
+
if (lt.length) {
|
|
3488
|
+
const xe = lt.join("");
|
|
3489
|
+
lt = [], T.current && p((pe) => pe + xe);
|
|
3490
3490
|
}
|
|
3491
|
-
|
|
3491
|
+
bt = null;
|
|
3492
3492
|
}, we = () => {
|
|
3493
|
-
typeof window < "u" &&
|
|
3493
|
+
typeof window < "u" && bt == null && (bt = requestAnimationFrame(re));
|
|
3494
3494
|
};
|
|
3495
|
-
let
|
|
3496
|
-
const
|
|
3497
|
-
var
|
|
3498
|
-
if (Date.now() -
|
|
3499
|
-
const
|
|
3500
|
-
d(
|
|
3495
|
+
let Be = Date.now();
|
|
3496
|
+
const He = setInterval(() => {
|
|
3497
|
+
var xe;
|
|
3498
|
+
if (Date.now() - Be > 18e5) {
|
|
3499
|
+
const pe = "Stream idle timeout";
|
|
3500
|
+
d(pe), D = "error", O = pe, B.abort(), (xe = A == null ? void 0 : A.onError) == null || xe.call(A, pe);
|
|
3501
3501
|
}
|
|
3502
|
-
}, 5e3),
|
|
3502
|
+
}, 5e3), mt = 1024 * 1024;
|
|
3503
3503
|
try {
|
|
3504
|
-
const
|
|
3504
|
+
const xe = Je.headers.get("X-Thread-Id") || Je.headers.get("x-thread-id"), pe = Je.headers.get("X-Thread-Created") || Je.headers.get("x-thread-created"), st = xe ?? null, _t = String(pe ?? "").toLowerCase() === "true";
|
|
3505
3505
|
for (S.current && !S.current.threadId && (S.current = {
|
|
3506
3506
|
...S.current,
|
|
3507
|
-
threadId:
|
|
3508
|
-
}), (W = A == null ? void 0 : A.onOpen) == null || W.call(A, { threadId:
|
|
3507
|
+
threadId: st
|
|
3508
|
+
}), (W = A == null ? void 0 : A.onOpen) == null || W.call(A, { threadId: st, created: _t }); ; ) {
|
|
3509
3509
|
const { value: V, done: be } = await nt.read();
|
|
3510
3510
|
if (be) break;
|
|
3511
|
-
|
|
3512
|
-
let
|
|
3513
|
-
for (; (
|
|
3511
|
+
ut += jt.decode(V, { stream: !0 }), ut.length > mt && (ut = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
3512
|
+
let ye;
|
|
3513
|
+
for (; (ye = ut.indexOf(`
|
|
3514
3514
|
|
|
3515
3515
|
`)) >= 0; ) {
|
|
3516
|
-
const
|
|
3517
|
-
|
|
3518
|
-
const
|
|
3519
|
-
if (!
|
|
3520
|
-
let
|
|
3516
|
+
const ht = ut.slice(0, ye);
|
|
3517
|
+
ut = ut.slice(ye + 2);
|
|
3518
|
+
const gt = Gx(ht);
|
|
3519
|
+
if (!gt) continue;
|
|
3520
|
+
let kt;
|
|
3521
3521
|
try {
|
|
3522
|
-
|
|
3522
|
+
kt = JSON.parse(gt);
|
|
3523
3523
|
} catch {
|
|
3524
|
-
console.debug("[use-chat] malformed SSE:",
|
|
3524
|
+
console.debug("[use-chat] malformed SSE:", gt.slice(0, 200));
|
|
3525
3525
|
continue;
|
|
3526
3526
|
}
|
|
3527
|
-
const Pe = qx(
|
|
3528
|
-
|
|
3527
|
+
const Pe = qx(kt) ? kt.data : kt;
|
|
3528
|
+
Be = Date.now();
|
|
3529
3529
|
const Vt = Pe.seq;
|
|
3530
3530
|
if (Vt !== void 0) {
|
|
3531
|
-
if (Vt <=
|
|
3532
|
-
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Vt, lastProcessedSeq:
|
|
3531
|
+
if (Vt <= Tt) {
|
|
3532
|
+
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: Vt, lastProcessedSeq: Tt, type: Pe.type });
|
|
3533
3533
|
continue;
|
|
3534
3534
|
}
|
|
3535
|
-
|
|
3535
|
+
Tt > 0 && Vt > Tt + 1 && ((M = A == null ? void 0 : A.onGap) == null || M.call(A, { from: Tt, to: Vt })), Tt = Vt, C.current = Vt, m(Vt);
|
|
3536
3536
|
}
|
|
3537
3537
|
if (console.debug("[use-chat] received event", {
|
|
3538
3538
|
seq: Pe.seq,
|
|
3539
3539
|
type: Pe.type,
|
|
3540
3540
|
preview: (() => {
|
|
3541
|
-
var
|
|
3541
|
+
var ct;
|
|
3542
3542
|
try {
|
|
3543
|
-
return Pe.type === "message_delta" ? { deltaTypes: (
|
|
3544
|
-
} catch (
|
|
3545
|
-
return { err: String(
|
|
3543
|
+
return Pe.type === "message_delta" ? { deltaTypes: (ct = Pe.delta) == null ? void 0 : ct.map((Rt) => Rt.type), textLen: (Pe.delta || []).filter((Rt) => Rt.type === "text").map((Rt) => String(Rt.text || "").length) } : Pe.content || Pe.delta ? { hasContent: !0 } : {};
|
|
3544
|
+
} catch (Rt) {
|
|
3545
|
+
return { err: String(Rt) };
|
|
3546
3546
|
}
|
|
3547
3547
|
})()
|
|
3548
3548
|
}), Pe.type === "checkpoint")
|
|
@@ -3550,37 +3550,37 @@ function Kx(e = {}) {
|
|
|
3550
3550
|
else if (Pe.type === "state_history") {
|
|
3551
3551
|
I.current = Pe;
|
|
3552
3552
|
try {
|
|
3553
|
-
const
|
|
3554
|
-
|
|
3555
|
-
} catch (
|
|
3556
|
-
console.warn("[use-chat] Failed to hydrate state_history payload",
|
|
3553
|
+
const Rt = Ur(Pe).latest;
|
|
3554
|
+
Rt && (k.current = Rt.checkpointId ?? null, N.current = Rt.checkpointNs ?? null, x(Rt.checkpointId ?? null));
|
|
3555
|
+
} catch (ct) {
|
|
3556
|
+
console.warn("[use-chat] Failed to hydrate state_history payload", ct);
|
|
3557
3557
|
}
|
|
3558
3558
|
}
|
|
3559
3559
|
try {
|
|
3560
3560
|
$ == null || $(Pe);
|
|
3561
|
-
} catch (
|
|
3562
|
-
console.error("[use-chat] Error in onEvent callback:",
|
|
3561
|
+
} catch (ct) {
|
|
3562
|
+
console.error("[use-chat] Error in onEvent callback:", ct, "for event:", Pe.type);
|
|
3563
3563
|
}
|
|
3564
3564
|
if (Pe.type === "token" && e.autoAppendAssistant !== !1)
|
|
3565
|
-
|
|
3565
|
+
lt.push(Pe.content), we();
|
|
3566
3566
|
else if (Pe.type === "message_delta") {
|
|
3567
|
-
const
|
|
3568
|
-
|
|
3567
|
+
const ct = Pe.delta.filter((Rt) => Rt.type === "text").map((Rt) => Rt.text).join("");
|
|
3568
|
+
ct && e.autoAppendAssistant !== !1 && (lt.push(ct), we());
|
|
3569
3569
|
} else if (Pe.type === "heartbeat") {
|
|
3570
3570
|
console.debug("[use-chat] heartbeat received");
|
|
3571
3571
|
try {
|
|
3572
3572
|
(H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A, Pe);
|
|
3573
|
-
} catch (
|
|
3574
|
-
console.warn("[use-chat] heartbeat callback failed",
|
|
3573
|
+
} catch (ct) {
|
|
3574
|
+
console.warn("[use-chat] heartbeat callback failed", ct);
|
|
3575
3575
|
}
|
|
3576
|
-
} else if (
|
|
3576
|
+
} else if (bt !== null && cancelAnimationFrame(bt), re(), Pe.type === "checkpoint")
|
|
3577
3577
|
x(Pe.checkpointId);
|
|
3578
3578
|
else if (Pe.type === "error") {
|
|
3579
|
-
const
|
|
3580
|
-
if (d(
|
|
3581
|
-
console.error("[use-chat] Auth error detected:",
|
|
3579
|
+
const ct = Pe;
|
|
3580
|
+
if (d(ct.message), D = "error", O = ct.message, ct.error_type === "auth_error" || ct.code === "TOKEN_EXPIRED" || ((te = ct.message) == null ? void 0 : te.includes("token")) || ((ie = ct.message) == null ? void 0 : ie.includes("401")) || ((ne = ct.message) == null ? void 0 : ne.includes("unauthorized")) || ((De = ct.message) == null ? void 0 : De.includes("Unauthorized"))) {
|
|
3581
|
+
console.error("[use-chat] Auth error detected:", ct.message);
|
|
3582
3582
|
try {
|
|
3583
|
-
(Q = A == null ? void 0 : A.onAuthError) == null || Q.call(A,
|
|
3583
|
+
(Q = A == null ? void 0 : A.onAuthError) == null || Q.call(A, ct.message);
|
|
3584
3584
|
} catch (Dn) {
|
|
3585
3585
|
console.warn("[use-chat] onAuthError handler failed", Dn);
|
|
3586
3586
|
}
|
|
@@ -3590,12 +3590,12 @@ function Kx(e = {}) {
|
|
|
3590
3590
|
}
|
|
3591
3591
|
}
|
|
3592
3592
|
re(), D === null && !B.signal.aborted && (D = "complete");
|
|
3593
|
-
} catch (
|
|
3594
|
-
if (
|
|
3593
|
+
} catch (xe) {
|
|
3594
|
+
if (xe.name === "AbortError")
|
|
3595
3595
|
D = D ?? "aborted";
|
|
3596
3596
|
else {
|
|
3597
|
-
const
|
|
3598
|
-
D = "error", O =
|
|
3597
|
+
const pe = xe.message || String(xe);
|
|
3598
|
+
D = "error", O = pe, d(pe), (se = A == null ? void 0 : A.onError) == null || se.call(A, pe);
|
|
3599
3599
|
}
|
|
3600
3600
|
} finally {
|
|
3601
3601
|
try {
|
|
@@ -3604,7 +3604,7 @@ function Kx(e = {}) {
|
|
|
3604
3604
|
} finally {
|
|
3605
3605
|
(Te = nt.releaseLock) == null || Te.call(nt);
|
|
3606
3606
|
}
|
|
3607
|
-
|
|
3607
|
+
bt !== null && typeof window < "u" && window.cancelAnimationFrame(bt), clearInterval(He);
|
|
3608
3608
|
}
|
|
3609
3609
|
} catch ($e) {
|
|
3610
3610
|
if ($e.name === "AbortError")
|
|
@@ -3633,7 +3633,7 @@ function Kx(e = {}) {
|
|
|
3633
3633
|
},
|
|
3634
3634
|
[t, n, r, e.autoAppendAssistant]
|
|
3635
3635
|
);
|
|
3636
|
-
return
|
|
3636
|
+
return Ct(() => () => {
|
|
3637
3637
|
var j;
|
|
3638
3638
|
T.current = !1, (j = b.current) == null || j.abort();
|
|
3639
3639
|
}, []), {
|
|
@@ -3845,7 +3845,7 @@ function Yx({
|
|
|
3845
3845
|
), N = Ie(() => {
|
|
3846
3846
|
p.current && (p.current.manualStop = !0), b();
|
|
3847
3847
|
}, [b]);
|
|
3848
|
-
return
|
|
3848
|
+
return at(
|
|
3849
3849
|
() => ({
|
|
3850
3850
|
startStream: k,
|
|
3851
3851
|
stop: N,
|
|
@@ -3872,8 +3872,8 @@ function Xx({
|
|
|
3872
3872
|
onAuthError: c,
|
|
3873
3873
|
onThreadChange: d
|
|
3874
3874
|
}) {
|
|
3875
|
-
const { api: f, baseUrl: p } = Tu(), h =
|
|
3876
|
-
|
|
3875
|
+
const { api: f, baseUrl: p } = Tu(), h = at(() => _n(p), [p]), [x, y] = ge([]), [m, g] = ge(t), [w, b] = ge(!1), [T, C] = ge(null), [S, k] = ge(!1), [N, I] = ge(null), { state: E, seed: _, prepend: L, pushUser: F, onEvent: j } = Bx(), [$, A] = ge(!1), [B, D] = ge(!1), [O, J] = ge(null), [X, fe] = ge([]), [Ee, Ne] = ge(!1), { setCacheForThread: G, checkpointExists: ee } = Lx(), W = Ze(m), M = Ze(null);
|
|
3876
|
+
Ct(() => {
|
|
3877
3877
|
W.current = m;
|
|
3878
3878
|
}, [m]);
|
|
3879
3879
|
const H = Ze(), { startStream: te, stop: ie, isStreaming: ne, error: De, setAuthToken: Q } = Yx({
|
|
@@ -3920,8 +3920,8 @@ function Xx({
|
|
|
3920
3920
|
async (re, we) => {
|
|
3921
3921
|
try {
|
|
3922
3922
|
await f.updateThread(re, we), await se();
|
|
3923
|
-
} catch (
|
|
3924
|
-
l == null || l(String(
|
|
3923
|
+
} catch (Be) {
|
|
3924
|
+
l == null || l(String(Be));
|
|
3925
3925
|
}
|
|
3926
3926
|
},
|
|
3927
3927
|
[f, se, l]
|
|
@@ -3930,29 +3930,29 @@ function Xx({
|
|
|
3930
3930
|
if (re) {
|
|
3931
3931
|
k(!0), I(null);
|
|
3932
3932
|
try {
|
|
3933
|
-
const
|
|
3933
|
+
const Be = await f.getStateHistory({
|
|
3934
3934
|
threadId: re,
|
|
3935
3935
|
checkpointId: we
|
|
3936
|
-
}), { checkpoints:
|
|
3937
|
-
checkpointId:
|
|
3938
|
-
checkpointNs:
|
|
3939
|
-
createdAt:
|
|
3936
|
+
}), { checkpoints: He } = Ur(Be), mt = He.filter((pe) => pe.checkpointId).map((pe) => ({
|
|
3937
|
+
checkpointId: pe.checkpointId,
|
|
3938
|
+
checkpointNs: pe.checkpointNs ?? void 0,
|
|
3939
|
+
createdAt: pe.createdAt ?? ""
|
|
3940
3940
|
}));
|
|
3941
|
-
G(re,
|
|
3942
|
-
const
|
|
3943
|
-
(
|
|
3944
|
-
) ??
|
|
3941
|
+
G(re, mt);
|
|
3942
|
+
const xe = He.find(
|
|
3943
|
+
(pe) => pe.messages && pe.messages.length > 0
|
|
3944
|
+
) ?? He[0];
|
|
3945
3945
|
console.log("[ChatSessionProvider] Loaded thread:", {
|
|
3946
3946
|
requestedCheckpointId: we,
|
|
3947
|
-
dataCheckpointId:
|
|
3948
|
-
totalCheckpoints:
|
|
3949
|
-
}), _((
|
|
3950
|
-
checkpointId: (
|
|
3951
|
-
checkpointNs: (
|
|
3952
|
-
}),
|
|
3953
|
-
} catch (
|
|
3954
|
-
const
|
|
3955
|
-
I(
|
|
3947
|
+
dataCheckpointId: xe == null ? void 0 : xe.checkpointId,
|
|
3948
|
+
totalCheckpoints: He.length
|
|
3949
|
+
}), _((xe == null ? void 0 : xe.messages) ?? [], {
|
|
3950
|
+
checkpointId: (xe == null ? void 0 : xe.checkpointId) ?? null,
|
|
3951
|
+
checkpointNs: (xe == null ? void 0 : xe.checkpointNs) ?? null
|
|
3952
|
+
}), fe(He), A(!!(xe != null && xe.nextCursor)), J((xe == null ? void 0 : xe.nextCursor) ?? null);
|
|
3953
|
+
} catch (Be) {
|
|
3954
|
+
const He = String(Be);
|
|
3955
|
+
I(He), l == null || l(He);
|
|
3956
3956
|
} finally {
|
|
3957
3957
|
k(!1);
|
|
3958
3958
|
}
|
|
@@ -3960,38 +3960,44 @@ function Xx({
|
|
|
3960
3960
|
},
|
|
3961
3961
|
[f, _, l, G]
|
|
3962
3962
|
);
|
|
3963
|
-
|
|
3963
|
+
Ct(() => {
|
|
3964
3964
|
H.current = ze;
|
|
3965
3965
|
}, [ze]);
|
|
3966
3966
|
const $e = Ie(
|
|
3967
3967
|
async (re, we) => {
|
|
3968
|
-
const
|
|
3969
|
-
if (
|
|
3968
|
+
const Be = W.current;
|
|
3969
|
+
if (Be) {
|
|
3970
3970
|
Ne(!0);
|
|
3971
3971
|
try {
|
|
3972
|
-
const
|
|
3973
|
-
threadId:
|
|
3972
|
+
const He = await f.getStateHistory({
|
|
3973
|
+
threadId: Be,
|
|
3974
3974
|
checkpointId: re,
|
|
3975
3975
|
checkpointNs: we ?? void 0
|
|
3976
|
-
}), { checkpoints:
|
|
3977
|
-
|
|
3976
|
+
}), { checkpoints: mt } = Ur(He), xe = mt.filter((st) => st.checkpointId).map((st) => ({
|
|
3977
|
+
checkpointId: st.checkpointId,
|
|
3978
|
+
checkpointNs: st.checkpointNs ?? void 0,
|
|
3979
|
+
createdAt: st.createdAt ?? ""
|
|
3980
|
+
}));
|
|
3981
|
+
G(Be, xe);
|
|
3982
|
+
const pe = mt.find(
|
|
3983
|
+
(st) => st.checkpointId === re && (we ? st.checkpointNs === we : !0)
|
|
3978
3984
|
);
|
|
3979
|
-
if (!
|
|
3985
|
+
if (!pe) {
|
|
3980
3986
|
console.warn("[ChatSessionProvider] Requested checkpoint not found in response:", { checkpointId: re, checkpointNs: we });
|
|
3981
3987
|
return;
|
|
3982
3988
|
}
|
|
3983
|
-
_((
|
|
3984
|
-
checkpointId: (
|
|
3985
|
-
checkpointNs: (
|
|
3989
|
+
fe(mt), _((pe == null ? void 0 : pe.messages) ?? [], {
|
|
3990
|
+
checkpointId: (pe == null ? void 0 : pe.checkpointId) ?? null,
|
|
3991
|
+
checkpointNs: (pe == null ? void 0 : pe.checkpointNs) ?? null
|
|
3986
3992
|
});
|
|
3987
|
-
} catch (
|
|
3988
|
-
l == null || l(String(
|
|
3993
|
+
} catch (He) {
|
|
3994
|
+
l == null || l(String(He));
|
|
3989
3995
|
} finally {
|
|
3990
3996
|
Ne(!1);
|
|
3991
3997
|
}
|
|
3992
3998
|
}
|
|
3993
3999
|
},
|
|
3994
|
-
[f, _, l]
|
|
4000
|
+
[f, _, l, G]
|
|
3995
4001
|
), qe = Ie(
|
|
3996
4002
|
(re, we) => {
|
|
3997
4003
|
_(E.messages, {
|
|
@@ -4011,8 +4017,8 @@ function Xx({
|
|
|
4011
4017
|
checkpointId: O
|
|
4012
4018
|
}), { checkpoints: we } = Ur(re);
|
|
4013
4019
|
if (we.length > 0) {
|
|
4014
|
-
const
|
|
4015
|
-
L((
|
|
4020
|
+
const Be = we[we.length - 1];
|
|
4021
|
+
L((Be == null ? void 0 : Be.messages) ?? []), A(!!(Be != null && Be.nextCursor)), J((Be == null ? void 0 : Be.nextCursor) ?? null);
|
|
4016
4022
|
}
|
|
4017
4023
|
} catch (re) {
|
|
4018
4024
|
l == null || l(String(re));
|
|
@@ -4021,63 +4027,63 @@ function Xx({
|
|
|
4021
4027
|
}
|
|
4022
4028
|
}
|
|
4023
4029
|
}, [f, O, L, l]), Je = Ie(async () => {
|
|
4024
|
-
_([], {}),
|
|
4030
|
+
_([], {}), fe([]), A(!1), J(null);
|
|
4025
4031
|
}, [_]), nt = Ie(
|
|
4026
4032
|
async (re, we) => {
|
|
4027
4033
|
console.log("[ChatSessionProvider] Interrupt:", re, we);
|
|
4028
4034
|
},
|
|
4029
4035
|
[]
|
|
4030
4036
|
);
|
|
4031
|
-
|
|
4037
|
+
Ct(() => {
|
|
4032
4038
|
se();
|
|
4033
4039
|
}, [se]);
|
|
4034
4040
|
const jt = Ze();
|
|
4035
|
-
|
|
4041
|
+
Ct(() => {
|
|
4036
4042
|
jt.current = $e;
|
|
4037
|
-
}, [$e]),
|
|
4038
|
-
var
|
|
4043
|
+
}, [$e]), Ct(() => {
|
|
4044
|
+
var mt, xe;
|
|
4039
4045
|
if (!o || !m || S === !0 || M.current === m)
|
|
4040
4046
|
return;
|
|
4041
4047
|
M.current = m;
|
|
4042
4048
|
const re = localStorage.getItem("lastCheckpointId");
|
|
4043
4049
|
localStorage.getItem("lastCheckpointNs");
|
|
4044
|
-
const we = n,
|
|
4045
|
-
let
|
|
4046
|
-
|
|
4047
|
-
}, [o, m, S, ee, n, r]),
|
|
4050
|
+
const we = n, Be = r;
|
|
4051
|
+
let He = { id: re };
|
|
4052
|
+
He.id || (He = { id: we, ns: Be }), He.id ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", He.id), (mt = H.current) == null || mt.call(H, m, He.id)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (xe = H.current) == null || xe.call(H, m));
|
|
4053
|
+
}, [o, m, S, ee, n, r]), Ct(() => {
|
|
4048
4054
|
d == null || d(m);
|
|
4049
|
-
}, [m, d]),
|
|
4055
|
+
}, [m, d]), Ct(() => {
|
|
4050
4056
|
E.lastCheckpointId && (localStorage.setItem("lastCheckpointId", E.lastCheckpointId), E.lastCheckpointNs && localStorage.setItem("lastCheckpointNs", E.lastCheckpointNs));
|
|
4051
4057
|
}, [E.lastCheckpointId, E.lastCheckpointNs]);
|
|
4052
|
-
const
|
|
4058
|
+
const ut = Ie(
|
|
4053
4059
|
async (re, we) => {
|
|
4054
|
-
const
|
|
4055
|
-
if (!
|
|
4056
|
-
if (!
|
|
4060
|
+
const Be = W.current, He = (re == null ? void 0 : re.text) ?? "";
|
|
4061
|
+
if (!Be && !He) return;
|
|
4062
|
+
if (!Be) {
|
|
4057
4063
|
await Te("New Chat");
|
|
4058
4064
|
return;
|
|
4059
4065
|
}
|
|
4060
|
-
const { contentParts:
|
|
4066
|
+
const { contentParts: mt } = await wx(
|
|
4061
4067
|
f,
|
|
4062
4068
|
(re == null ? void 0 : re.attachments) ?? []
|
|
4063
|
-
),
|
|
4064
|
-
|
|
4065
|
-
const
|
|
4069
|
+
), xe = [...mt];
|
|
4070
|
+
He != null && He.trim() && xe.push({ type: "text", text: He });
|
|
4071
|
+
const pe = {
|
|
4066
4072
|
id: `msg-${Date.now()}`,
|
|
4067
4073
|
role: "user",
|
|
4068
|
-
content:
|
|
4074
|
+
content: xe,
|
|
4069
4075
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4070
4076
|
};
|
|
4071
|
-
F(
|
|
4072
|
-
const
|
|
4073
|
-
threadId:
|
|
4077
|
+
F(pe);
|
|
4078
|
+
const st = {
|
|
4079
|
+
threadId: Be,
|
|
4074
4080
|
checkpointId: (we == null ? void 0 : we.checkpointId) ?? E.lastCheckpointId ?? void 0,
|
|
4075
4081
|
checkpointNs: (we == null ? void 0 : we.checkpointNs) ?? E.lastCheckpointNs ?? void 0
|
|
4076
4082
|
};
|
|
4077
|
-
te(
|
|
4083
|
+
te(st);
|
|
4078
4084
|
},
|
|
4079
4085
|
[f, Te, F, E, te]
|
|
4080
|
-
),
|
|
4086
|
+
), lt = at(
|
|
4081
4087
|
() => ({
|
|
4082
4088
|
threads: x,
|
|
4083
4089
|
currentThreadId: m,
|
|
@@ -4092,7 +4098,7 @@ function Xx({
|
|
|
4092
4098
|
}
|
|
4093
4099
|
}),
|
|
4094
4100
|
[x, m, w, T, Te, je, Ke, se]
|
|
4095
|
-
),
|
|
4101
|
+
), Tt = at(
|
|
4096
4102
|
() => ({
|
|
4097
4103
|
threadId: m,
|
|
4098
4104
|
messages: E.messages,
|
|
@@ -4134,19 +4140,19 @@ function Xx({
|
|
|
4134
4140
|
ze,
|
|
4135
4141
|
nt
|
|
4136
4142
|
]
|
|
4137
|
-
),
|
|
4143
|
+
), bt = at(
|
|
4138
4144
|
() => ({
|
|
4139
4145
|
isStreaming: ne,
|
|
4140
4146
|
error: De,
|
|
4141
4147
|
connectionState: ne ? "connected" : "idle",
|
|
4142
|
-
submit:
|
|
4143
|
-
send:
|
|
4148
|
+
submit: ut,
|
|
4149
|
+
send: ut,
|
|
4144
4150
|
stop: ie,
|
|
4145
4151
|
setAuthToken: Q
|
|
4146
4152
|
}),
|
|
4147
|
-
[ne, De,
|
|
4153
|
+
[ne, De, ut, ie, Q]
|
|
4148
4154
|
);
|
|
4149
|
-
return /* @__PURE__ */ u.jsx(Au.Provider, { value:
|
|
4155
|
+
return /* @__PURE__ */ u.jsx(Au.Provider, { value: lt, children: /* @__PURE__ */ u.jsx(ju.Provider, { value: Tt, children: /* @__PURE__ */ u.jsx(_u.Provider, { value: bt, children: e }) }) });
|
|
4150
4156
|
}
|
|
4151
4157
|
function xa() {
|
|
4152
4158
|
const e = xs(Au);
|
|
@@ -4290,11 +4296,11 @@ function Qx({
|
|
|
4290
4296
|
try {
|
|
4291
4297
|
const X = l(A);
|
|
4292
4298
|
X && typeof X.then == "function" ? X.then(() => {
|
|
4293
|
-
var
|
|
4294
|
-
((
|
|
4299
|
+
var fe, Ee;
|
|
4300
|
+
((fe = S.current) == null ? void 0 : fe.id) === B && S.current.shouldClear && (x || (m(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((Ee = S.current) == null ? void 0 : Ee.id) === B && (S.current = null);
|
|
4295
4301
|
}).catch(() => {
|
|
4296
|
-
var
|
|
4297
|
-
((
|
|
4302
|
+
var fe;
|
|
4303
|
+
((fe = S.current) == null ? void 0 : fe.id) === B && (S.current = null);
|
|
4298
4304
|
}) : (((D = S.current) == null ? void 0 : D.id) === B && S.current.shouldClear && (x || (m(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((O = S.current) == null ? void 0 : O.id) === B && (S.current = null));
|
|
4299
4305
|
} catch {
|
|
4300
4306
|
((J = S.current) == null ? void 0 : J.id) === B && (S.current = null);
|
|
@@ -6278,7 +6284,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6278
6284
|
Lt(() => {
|
|
6279
6285
|
B && (X == null || X());
|
|
6280
6286
|
}, [B, X]);
|
|
6281
|
-
const
|
|
6287
|
+
const fe = (W = D.arrow) == null ? void 0 : W.x, Ee = (M = D.arrow) == null ? void 0 : M.y, Ne = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [G, ee] = v.useState();
|
|
6282
6288
|
return Lt(() => {
|
|
6283
6289
|
g && ee(window.getComputedStyle(g).zIndex);
|
|
6284
6290
|
}, [g]), /* @__PURE__ */ u.jsx(
|
|
@@ -6311,7 +6317,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6311
6317
|
scope: n,
|
|
6312
6318
|
placedSide: O,
|
|
6313
6319
|
onArrowChange: C,
|
|
6314
|
-
arrowX:
|
|
6320
|
+
arrowX: fe,
|
|
6315
6321
|
arrowY: Ee,
|
|
6316
6322
|
shouldHideArrow: Ne,
|
|
6317
6323
|
children: /* @__PURE__ */ u.jsx(
|
|
@@ -7277,15 +7283,15 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
|
|
|
7277
7283
|
...y
|
|
7278
7284
|
} = e, m = fr(an, n), g = yo(an, n), w = Ls(n), b = Rd(n), T = Gw(n), [C, S] = v.useState(null), k = v.useRef(null), N = Ve(t, k, m.onContentChange), I = v.useRef(0), E = v.useRef(""), _ = v.useRef(0), L = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = x ? Ds : v.Fragment, A = x ? { as: rb, allowPinchZoom: !0 } : void 0, B = (O) => {
|
|
7279
7285
|
var W, M;
|
|
7280
|
-
const J = E.current + O, X = T().filter((H) => !H.disabled),
|
|
7286
|
+
const J = E.current + O, X = T().filter((H) => !H.disabled), fe = document.activeElement, Ee = (W = X.find((H) => H.ref.current === fe)) == null ? void 0 : W.textValue, Ne = X.map((H) => H.textValue), G = mb(Ne, J, Ee), ee = (M = X.find((H) => H.textValue === G)) == null ? void 0 : M.ref.current;
|
|
7281
7287
|
(function H(te) {
|
|
7282
7288
|
E.current = te, window.clearTimeout(I.current), te !== "" && (I.current = window.setTimeout(() => H(""), 1e3));
|
|
7283
7289
|
})(J), ee && setTimeout(() => ee.focus());
|
|
7284
7290
|
};
|
|
7285
7291
|
v.useEffect(() => () => window.clearTimeout(I.current), []), ba();
|
|
7286
7292
|
const D = v.useCallback((O) => {
|
|
7287
|
-
var X,
|
|
7288
|
-
return F.current === ((X = L.current) == null ? void 0 : X.side) && xb(O, (
|
|
7293
|
+
var X, fe;
|
|
7294
|
+
return F.current === ((X = L.current) == null ? void 0 : X.side) && xb(O, (fe = L.current) == null ? void 0 : fe.area);
|
|
7289
7295
|
}, []);
|
|
7290
7296
|
return /* @__PURE__ */ u.jsx(
|
|
7291
7297
|
eb,
|
|
@@ -7362,8 +7368,8 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
|
|
|
7362
7368
|
ref: N,
|
|
7363
7369
|
style: { outline: "none", ...y.style },
|
|
7364
7370
|
onKeyDown: de(y.onKeyDown, (O) => {
|
|
7365
|
-
const X = O.target.closest("[data-radix-menu-content]") === O.currentTarget,
|
|
7366
|
-
X && (O.key === "Tab" && O.preventDefault(), !
|
|
7371
|
+
const X = O.target.closest("[data-radix-menu-content]") === O.currentTarget, fe = O.ctrlKey || O.altKey || O.metaKey, Ee = O.key.length === 1;
|
|
7372
|
+
X && (O.key === "Tab" && O.preventDefault(), !fe && Ee && B(O.key));
|
|
7367
7373
|
const Ne = k.current;
|
|
7368
7374
|
if (O.target !== Ne || !Vw.includes(O.key)) return;
|
|
7369
7375
|
O.preventDefault();
|
|
@@ -7378,8 +7384,8 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
|
|
|
7378
7384
|
to((O) => {
|
|
7379
7385
|
const J = O.target, X = j.current !== O.clientX;
|
|
7380
7386
|
if (O.currentTarget.contains(J) && X) {
|
|
7381
|
-
const
|
|
7382
|
-
F.current =
|
|
7387
|
+
const fe = O.clientX > j.current ? "right" : "left";
|
|
7388
|
+
F.current = fe, j.current = O.clientX;
|
|
7383
7389
|
}
|
|
7384
7390
|
})
|
|
7385
7391
|
)
|
|
@@ -8090,7 +8096,7 @@ function Bs(e, t) {
|
|
|
8090
8096
|
function p0(e, t) {
|
|
8091
8097
|
return t(e);
|
|
8092
8098
|
}
|
|
8093
|
-
function
|
|
8099
|
+
function yt(...e) {
|
|
8094
8100
|
return e;
|
|
8095
8101
|
}
|
|
8096
8102
|
function ot(e, t) {
|
|
@@ -8102,7 +8108,7 @@ function Me(e, t) {
|
|
|
8102
8108
|
function $a(e) {
|
|
8103
8109
|
e(Pr);
|
|
8104
8110
|
}
|
|
8105
|
-
function
|
|
8111
|
+
function Et(e) {
|
|
8106
8112
|
return e(vf);
|
|
8107
8113
|
}
|
|
8108
8114
|
function he(e, t) {
|
|
@@ -8125,7 +8131,7 @@ function mc(e) {
|
|
|
8125
8131
|
function bf(e, t) {
|
|
8126
8132
|
return e === t;
|
|
8127
8133
|
}
|
|
8128
|
-
function
|
|
8134
|
+
function xt(e = bf) {
|
|
8129
8135
|
let t;
|
|
8130
8136
|
return (n) => (r) => {
|
|
8131
8137
|
e(t, r) || (t = r, n(r));
|
|
@@ -8290,7 +8296,7 @@ function At(...e) {
|
|
|
8290
8296
|
};
|
|
8291
8297
|
}
|
|
8292
8298
|
function ke(e, t = bf) {
|
|
8293
|
-
return U(e,
|
|
8299
|
+
return U(e, xt(t));
|
|
8294
8300
|
}
|
|
8295
8301
|
function Yi(...e) {
|
|
8296
8302
|
return function(t, n) {
|
|
@@ -8317,7 +8323,7 @@ const y0 = {
|
|
|
8317
8323
|
return {
|
|
8318
8324
|
log: Y((t, n, r = 1) => {
|
|
8319
8325
|
var o;
|
|
8320
|
-
const s = (o = v0().VIRTUOSO_LOG_LEVEL) != null ? o :
|
|
8326
|
+
const s = (o = v0().VIRTUOSO_LOG_LEVEL) != null ? o : Et(e);
|
|
8321
8327
|
r >= s && console[y0[r]](
|
|
8322
8328
|
"%creact-virtuoso: %c%s %o",
|
|
8323
8329
|
"color: #0253b3; font-weight: bold",
|
|
@@ -8488,15 +8494,15 @@ function Cf(e, t) {
|
|
|
8488
8494
|
}
|
|
8489
8495
|
return s.push({ end: 1 / 0, start: r, value: o }), s;
|
|
8490
8496
|
}
|
|
8491
|
-
function
|
|
8497
|
+
function ft(e) {
|
|
8492
8498
|
return e === no;
|
|
8493
8499
|
}
|
|
8494
8500
|
function ro(e, t) {
|
|
8495
|
-
if (!
|
|
8501
|
+
if (!ft(e))
|
|
8496
8502
|
return t === e.k ? e.v : t < e.k ? ro(e.l, t) : ro(e.r, t);
|
|
8497
8503
|
}
|
|
8498
8504
|
function gn(e, t, n = "k") {
|
|
8499
|
-
if (
|
|
8505
|
+
if (ft(e))
|
|
8500
8506
|
return [-1 / 0, void 0];
|
|
8501
8507
|
if (Number(e[n]) === t)
|
|
8502
8508
|
return [e.k, e.v];
|
|
@@ -8507,24 +8513,24 @@ function gn(e, t, n = "k") {
|
|
|
8507
8513
|
return gn(e.l, t, n);
|
|
8508
8514
|
}
|
|
8509
8515
|
function Zt(e, t, n) {
|
|
8510
|
-
return
|
|
8516
|
+
return ft(e) ? Rf(t, n, 1) : t === e.k ? Pt(e, { k: t, v: n }) : t < e.k ? xc(Pt(e, { l: Zt(e.l, t, n) })) : xc(Pt(e, { r: Zt(e.r, t, n) }));
|
|
8511
8517
|
}
|
|
8512
8518
|
function Sr() {
|
|
8513
8519
|
return no;
|
|
8514
8520
|
}
|
|
8515
8521
|
function Hs(e, t, n) {
|
|
8516
|
-
if (
|
|
8522
|
+
if (ft(e))
|
|
8517
8523
|
return [];
|
|
8518
8524
|
const r = gn(e, t)[0];
|
|
8519
8525
|
return S0(Ji(e, r, n));
|
|
8520
8526
|
}
|
|
8521
8527
|
function Xi(e, t) {
|
|
8522
|
-
if (
|
|
8528
|
+
if (ft(e)) return no;
|
|
8523
8529
|
const { k: n, l: r, r: o } = e;
|
|
8524
8530
|
if (t === n) {
|
|
8525
|
-
if (
|
|
8531
|
+
if (ft(r))
|
|
8526
8532
|
return o;
|
|
8527
|
-
if (
|
|
8533
|
+
if (ft(o))
|
|
8528
8534
|
return r;
|
|
8529
8535
|
{
|
|
8530
8536
|
const [s, i] = kf(r);
|
|
@@ -8533,10 +8539,10 @@ function Xi(e, t) {
|
|
|
8533
8539
|
} else return t < n ? Vo(Pt(e, { l: Xi(r, t) })) : Vo(Pt(e, { r: Xi(o, t) }));
|
|
8534
8540
|
}
|
|
8535
8541
|
function tr(e) {
|
|
8536
|
-
return
|
|
8542
|
+
return ft(e) ? [] : [...tr(e.l), { k: e.k, v: e.v }, ...tr(e.r)];
|
|
8537
8543
|
}
|
|
8538
8544
|
function Ji(e, t, n) {
|
|
8539
|
-
if (
|
|
8545
|
+
if (ft(e))
|
|
8540
8546
|
return [];
|
|
8541
8547
|
const { k: r, l: o, r: s, v: i } = e;
|
|
8542
8548
|
let a = [];
|
|
@@ -8549,7 +8555,7 @@ function Vo(e) {
|
|
|
8549
8555
|
if (n > r.lvl + 1) {
|
|
8550
8556
|
if (Ci(t))
|
|
8551
8557
|
return Ef(Pt(e, { lvl: n - 1 }));
|
|
8552
|
-
if (!
|
|
8558
|
+
if (!ft(t) && !ft(t.r))
|
|
8553
8559
|
return Pt(t.r, {
|
|
8554
8560
|
l: Pt(t, { r: t.r.l }),
|
|
8555
8561
|
lvl: n,
|
|
@@ -8562,7 +8568,7 @@ function Vo(e) {
|
|
|
8562
8568
|
} else {
|
|
8563
8569
|
if (Ci(e))
|
|
8564
8570
|
return Zi(Pt(e, { lvl: n - 1 }));
|
|
8565
|
-
if (!
|
|
8571
|
+
if (!ft(r) && !ft(r.l)) {
|
|
8566
8572
|
const o = r.l, s = Ci(o) ? r.lvl - 1 : r.lvl;
|
|
8567
8573
|
return Pt(o, {
|
|
8568
8574
|
l: Pt(e, {
|
|
@@ -8586,13 +8592,13 @@ function Pt(e, t) {
|
|
|
8586
8592
|
);
|
|
8587
8593
|
}
|
|
8588
8594
|
function Tf(e) {
|
|
8589
|
-
return
|
|
8595
|
+
return ft(e.r) ? e.l : Vo(Pt(e, { r: Tf(e.r) }));
|
|
8590
8596
|
}
|
|
8591
8597
|
function Ci(e) {
|
|
8592
|
-
return
|
|
8598
|
+
return ft(e) || e.lvl > e.r.lvl;
|
|
8593
8599
|
}
|
|
8594
8600
|
function kf(e) {
|
|
8595
|
-
return
|
|
8601
|
+
return ft(e.r) ? [e.k, e.v] : kf(e.r);
|
|
8596
8602
|
}
|
|
8597
8603
|
function Rf(e, t, n, r = no, o = no) {
|
|
8598
8604
|
return { k: e, l: r, lvl: n, r: o, v: t };
|
|
@@ -8602,11 +8608,11 @@ function xc(e) {
|
|
|
8602
8608
|
}
|
|
8603
8609
|
function Ef(e) {
|
|
8604
8610
|
const { l: t } = e;
|
|
8605
|
-
return !
|
|
8611
|
+
return !ft(t) && t.lvl === e.lvl ? Pt(t, { r: Pt(e, { l: t.r }) }) : e;
|
|
8606
8612
|
}
|
|
8607
8613
|
function Zi(e) {
|
|
8608
8614
|
const { lvl: t, r: n } = e;
|
|
8609
|
-
return !
|
|
8615
|
+
return !ft(n) && !ft(n.r) && n.lvl === t && n.r.lvl === t ? Pt(n, { l: Pt(e, { r: n.l }), lvl: t + 1 }) : e;
|
|
8610
8616
|
}
|
|
8611
8617
|
function S0(e) {
|
|
8612
8618
|
return Cf(e, ({ k: t, v: n }) => ({ index: t, value: n }));
|
|
@@ -8651,7 +8657,7 @@ function Un(e, t) {
|
|
|
8651
8657
|
return Math.round(e.getBoundingClientRect()[t]);
|
|
8652
8658
|
}
|
|
8653
8659
|
function Us(e) {
|
|
8654
|
-
return !
|
|
8660
|
+
return !ft(e.groupOffsetTree);
|
|
8655
8661
|
}
|
|
8656
8662
|
function Ha({ index: e }, t) {
|
|
8657
8663
|
return t === e ? 0 : t < e ? -1 : 1;
|
|
@@ -8668,10 +8674,10 @@ function T0() {
|
|
|
8668
8674
|
};
|
|
8669
8675
|
}
|
|
8670
8676
|
function k0(e, t) {
|
|
8671
|
-
let n =
|
|
8677
|
+
let n = ft(e) ? 0 : 1 / 0;
|
|
8672
8678
|
for (const r of t) {
|
|
8673
8679
|
const { endIndex: o, size: s, startIndex: i } = r;
|
|
8674
|
-
if (n = Math.min(n, i),
|
|
8680
|
+
if (n = Math.min(n, i), ft(e)) {
|
|
8675
8681
|
e = Zt(e, 0, s);
|
|
8676
8682
|
continue;
|
|
8677
8683
|
}
|
|
@@ -8721,7 +8727,7 @@ function N0(e, [t, n, r, o]) {
|
|
|
8721
8727
|
t.length > 0 && r("received item sizes", t, Xt.DEBUG);
|
|
8722
8728
|
const s = e.sizeTree;
|
|
8723
8729
|
let i = s, a = 0;
|
|
8724
|
-
if (n.length > 0 &&
|
|
8730
|
+
if (n.length > 0 && ft(s) && t.length === 2) {
|
|
8725
8731
|
const p = t[0].size, h = t[1].size;
|
|
8726
8732
|
i = n.reduce((x, y) => Zt(Zt(x, y, p), y + 1, h), i);
|
|
8727
8733
|
} else
|
|
@@ -8787,12 +8793,12 @@ const P0 = {
|
|
|
8787
8793
|
}, En = et(
|
|
8788
8794
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
8789
8795
|
const n = We(), r = We(), o = Ht(r, 0), s = We(), i = We(), a = Y(0), l = Y([]), c = Y(void 0), d = Y(void 0), f = Y((C, S) => Un(C, P0[S])), p = Y(void 0), h = Y(0), x = T0(), y = Ht(
|
|
8790
|
-
U(n, Le(l, e, h), Cn(N0, x),
|
|
8796
|
+
U(n, Le(l, e, h), Cn(N0, x), xt()),
|
|
8791
8797
|
x
|
|
8792
8798
|
), m = Ht(
|
|
8793
8799
|
U(
|
|
8794
8800
|
l,
|
|
8795
|
-
|
|
8801
|
+
xt(),
|
|
8796
8802
|
Cn((C, S) => ({ current: S, prev: C.current }), {
|
|
8797
8803
|
current: [],
|
|
8798
8804
|
prev: []
|
|
@@ -8841,7 +8847,7 @@ const P0 = {
|
|
|
8841
8847
|
he(
|
|
8842
8848
|
U(
|
|
8843
8849
|
d,
|
|
8844
|
-
Re((C) => C !== void 0 &&
|
|
8850
|
+
Re((C) => C !== void 0 && ft(Et(y).sizeTree)),
|
|
8845
8851
|
ce((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
|
|
8846
8852
|
),
|
|
8847
8853
|
n
|
|
@@ -8870,11 +8876,11 @@ const P0 = {
|
|
|
8870
8876
|
ce((C) => C.diff)
|
|
8871
8877
|
),
|
|
8872
8878
|
(C) => {
|
|
8873
|
-
const { groupIndices: S } =
|
|
8879
|
+
const { groupIndices: S } = Et(y);
|
|
8874
8880
|
if (C > 0)
|
|
8875
8881
|
Me(t, !0), Me(s, C + yc(C, S));
|
|
8876
8882
|
else if (C < 0) {
|
|
8877
|
-
const k =
|
|
8883
|
+
const k = Et(m);
|
|
8878
8884
|
k.length > 0 && (C -= yc(-C, k)), Me(i, C);
|
|
8879
8885
|
}
|
|
8880
8886
|
}
|
|
@@ -8963,10 +8969,10 @@ const P0 = {
|
|
|
8963
8969
|
Le(y, h),
|
|
8964
8970
|
ce(([C, S, k]) => {
|
|
8965
8971
|
if (S.groupIndices.length > 0) {
|
|
8966
|
-
if (
|
|
8972
|
+
if (ft(S.sizeTree))
|
|
8967
8973
|
return S;
|
|
8968
8974
|
let N = Sr();
|
|
8969
|
-
const I =
|
|
8975
|
+
const I = Et(m);
|
|
8970
8976
|
let E = 0, _ = 0, L = 0;
|
|
8971
8977
|
for (; E < -C; ) {
|
|
8972
8978
|
L = I[_];
|
|
@@ -9017,7 +9023,7 @@ const P0 = {
|
|
|
9017
9023
|
unshiftWith: s
|
|
9018
9024
|
};
|
|
9019
9025
|
},
|
|
9020
|
-
|
|
9026
|
+
yt(qn, Ba),
|
|
9021
9027
|
{ singleton: !0 }
|
|
9022
9028
|
);
|
|
9023
9029
|
function O0(e) {
|
|
@@ -9049,27 +9055,27 @@ const _f = et(
|
|
|
9049
9055
|
At(o, t, r),
|
|
9050
9056
|
Re(([l, c]) => Us(c)),
|
|
9051
9057
|
ce(([l, c, d]) => gn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
|
|
9052
|
-
|
|
9058
|
+
xt(),
|
|
9053
9059
|
ce((l) => [l])
|
|
9054
9060
|
),
|
|
9055
9061
|
i
|
|
9056
9062
|
), { groupCounts: s, topItemsIndexes: i };
|
|
9057
9063
|
},
|
|
9058
|
-
|
|
9064
|
+
yt(En, Wt)
|
|
9059
9065
|
), Gn = et(
|
|
9060
9066
|
([{ log: e }]) => {
|
|
9061
9067
|
const t = Y(!1), n = en(
|
|
9062
9068
|
U(
|
|
9063
9069
|
t,
|
|
9064
9070
|
Re((r) => r),
|
|
9065
|
-
|
|
9071
|
+
xt()
|
|
9066
9072
|
)
|
|
9067
9073
|
);
|
|
9068
9074
|
return ot(t, (r) => {
|
|
9069
|
-
r &&
|
|
9075
|
+
r && Et(e)("props updated", {}, Xt.DEBUG);
|
|
9070
9076
|
}), { didMount: n, propsReady: t };
|
|
9071
9077
|
},
|
|
9072
|
-
|
|
9078
|
+
yt(qn),
|
|
9073
9079
|
{ singleton: !0 }
|
|
9074
9080
|
), M0 = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
9075
9081
|
function Pf(e) {
|
|
@@ -9111,7 +9117,7 @@ const vo = et(
|
|
|
9111
9117
|
const $ = Pf(T), { align: A, behavior: B, offset: D } = $, O = k - 1, J = jf($, C, O);
|
|
9112
9118
|
let X = so(J, C.offsetTree, L) + I;
|
|
9113
9119
|
A === "end" ? (X += F + gn(C.sizeTree, J)[1] - S + j, J === O && (X += E)) : A === "center" ? X += (F + gn(C.sizeTree, J)[1] - S + j) / 2 : X -= N, D && (X += D);
|
|
9114
|
-
const
|
|
9120
|
+
const fe = (Ee) => {
|
|
9115
9121
|
b(), Ee ? (_("retrying to scroll to", { location: T }, Xt.DEBUG), Me(h, T)) : (Me(x, !0), _("list did not change, scroll successful", {}, Xt.DEBUG));
|
|
9116
9122
|
};
|
|
9117
9123
|
if (b(), B === "smooth") {
|
|
@@ -9119,10 +9125,10 @@ const vo = et(
|
|
|
9119
9125
|
w = ot(t, (Ne) => {
|
|
9120
9126
|
Ee = Ee || Ne;
|
|
9121
9127
|
}), m = pn(d, () => {
|
|
9122
|
-
|
|
9128
|
+
fe(Ee);
|
|
9123
9129
|
});
|
|
9124
9130
|
} else
|
|
9125
|
-
m = pn(U(t, D0(150)),
|
|
9131
|
+
m = pn(U(t, D0(150)), fe);
|
|
9126
9132
|
return g = setTimeout(() => {
|
|
9127
9133
|
b();
|
|
9128
9134
|
}, 1200), Me(l, !0), _("scrolling from index to", { behavior: B, index: J, top: X }, Xt.DEBUG), { behavior: B, top: X };
|
|
@@ -9136,7 +9142,7 @@ const vo = et(
|
|
|
9136
9142
|
topListHeight: y
|
|
9137
9143
|
};
|
|
9138
9144
|
},
|
|
9139
|
-
|
|
9145
|
+
yt(En, Wt, qn),
|
|
9140
9146
|
{ singleton: !0 }
|
|
9141
9147
|
);
|
|
9142
9148
|
function D0(e) {
|
|
@@ -9181,7 +9187,7 @@ const wo = et(
|
|
|
9181
9187
|
U(
|
|
9182
9188
|
At(t, i),
|
|
9183
9189
|
Le(a, n, e, c),
|
|
9184
|
-
Re(([[, d], f, { sizeTree: p }, h, x]) => d && (!
|
|
9190
|
+
Re(([[, d], f, { sizeTree: p }, h, x]) => d && (!ft(p) || Fa(h)) && !f && !x),
|
|
9185
9191
|
Le(l)
|
|
9186
9192
|
),
|
|
9187
9193
|
([, d]) => {
|
|
@@ -9199,7 +9205,7 @@ const wo = et(
|
|
|
9199
9205
|
scrolledToInitialItem: a
|
|
9200
9206
|
};
|
|
9201
9207
|
},
|
|
9202
|
-
|
|
9208
|
+
yt(En, Wt, vo, Gn),
|
|
9203
9209
|
{ singleton: !0 }
|
|
9204
9210
|
);
|
|
9205
9211
|
function Of(e, t) {
|
|
@@ -9218,18 +9224,18 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9218
9224
|
const i = Y(!1), a = Y(!0), l = We(), c = We(), d = Y(4), f = Y($0), p = Ht(
|
|
9219
9225
|
U(
|
|
9220
9226
|
Yi(U(ke(o), ar(1), wn(!0)), U(ke(o), ar(1), wn(!1), mc(100))),
|
|
9221
|
-
|
|
9227
|
+
xt()
|
|
9222
9228
|
),
|
|
9223
9229
|
!1
|
|
9224
9230
|
), h = Ht(
|
|
9225
|
-
U(Yi(U(n, wn(!0)), U(n, wn(!1), mc(200))),
|
|
9231
|
+
U(Yi(U(n, wn(!0)), U(n, wn(!1), mc(200))), xt()),
|
|
9226
9232
|
!1
|
|
9227
9233
|
);
|
|
9228
9234
|
he(
|
|
9229
9235
|
U(
|
|
9230
9236
|
At(ke(o), ke(f)),
|
|
9231
9237
|
ce(([w, b]) => w <= b),
|
|
9232
|
-
|
|
9238
|
+
xt()
|
|
9233
9239
|
),
|
|
9234
9240
|
a
|
|
9235
9241
|
), he(U(a, An(50)), c);
|
|
@@ -9258,7 +9264,7 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9258
9264
|
state: E
|
|
9259
9265
|
};
|
|
9260
9266
|
}, F0),
|
|
9261
|
-
|
|
9267
|
+
xt((w, b) => w && w.atBottom === b.atBottom)
|
|
9262
9268
|
)
|
|
9263
9269
|
), y = Ht(
|
|
9264
9270
|
U(
|
|
@@ -9306,9 +9312,9 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9306
9312
|
U(
|
|
9307
9313
|
r,
|
|
9308
9314
|
ce(({ scrollTop: w }) => w),
|
|
9309
|
-
|
|
9315
|
+
xt(),
|
|
9310
9316
|
Cn(
|
|
9311
|
-
(w, b) =>
|
|
9317
|
+
(w, b) => Et(h) ? { direction: w.direction, prevScrollTop: b } : { direction: b < w.prevScrollTop ? io : Vr, prevScrollTop: b },
|
|
9312
9318
|
{ direction: Vr, prevScrollTop: 0 }
|
|
9313
9319
|
),
|
|
9314
9320
|
ce((w) => w.direction)
|
|
@@ -9346,7 +9352,7 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9346
9352
|
scrollDirection: m,
|
|
9347
9353
|
scrollVelocity: g
|
|
9348
9354
|
};
|
|
9349
|
-
},
|
|
9355
|
+
}, yt(Wt)), ss = "top", is = "bottom", vc = "none";
|
|
9350
9356
|
function wc(e, t, n) {
|
|
9351
9357
|
return typeof e == "number" ? n === io && t === ss || n === Vr && t === is ? e : 0 : n === io ? t === ss ? e.main : e.reverse : t === is ? e.main : e.reverse;
|
|
9352
9358
|
}
|
|
@@ -9391,7 +9397,7 @@ const Va = et(
|
|
|
9391
9397
|
}
|
|
9392
9398
|
),
|
|
9393
9399
|
Re((d) => d != null),
|
|
9394
|
-
|
|
9400
|
+
xt(oo)
|
|
9395
9401
|
),
|
|
9396
9402
|
[0, 0]
|
|
9397
9403
|
);
|
|
@@ -9405,7 +9411,7 @@ const Va = et(
|
|
|
9405
9411
|
visibleRange: c
|
|
9406
9412
|
};
|
|
9407
9413
|
},
|
|
9408
|
-
|
|
9414
|
+
yt(Wt),
|
|
9409
9415
|
{ singleton: !0 }
|
|
9410
9416
|
);
|
|
9411
9417
|
function z0(e, t, n) {
|
|
@@ -9538,12 +9544,12 @@ const hr = et(
|
|
|
9538
9544
|
j,
|
|
9539
9545
|
$
|
|
9540
9546
|
]) => {
|
|
9541
|
-
const A = I, { offsetTree: B, sizeTree: D } = A, O =
|
|
9547
|
+
const A = I, { offsetTree: B, sizeTree: D } = A, O = Et(m);
|
|
9542
9548
|
if (N === 0)
|
|
9543
9549
|
return { ...Ti, totalCount: N };
|
|
9544
9550
|
if (S === 0 && k === 0)
|
|
9545
9551
|
return O === 0 ? { ...Ti, totalCount: N } : Mf(O, E, I, F, j, $ || []);
|
|
9546
|
-
if (
|
|
9552
|
+
if (ft(D))
|
|
9547
9553
|
return O > 0 ? null : Ko(
|
|
9548
9554
|
z0(Wa(E, N), A, $),
|
|
9549
9555
|
[],
|
|
@@ -9564,11 +9570,11 @@ const hr = et(
|
|
|
9564
9570
|
}
|
|
9565
9571
|
if (!_)
|
|
9566
9572
|
return Ko([], J, N, j, A, F);
|
|
9567
|
-
const X = L.length > 0 ? L[L.length - 1] + 1 : 0,
|
|
9568
|
-
if (
|
|
9573
|
+
const X = L.length > 0 ? L[L.length - 1] + 1 : 0, fe = I0(B, S, k, X);
|
|
9574
|
+
if (fe.length === 0)
|
|
9569
9575
|
return null;
|
|
9570
9576
|
const Ee = N - 1, Ne = Bs([], (G) => {
|
|
9571
|
-
for (const ee of
|
|
9577
|
+
for (const ee of fe) {
|
|
9572
9578
|
const W = ee.value;
|
|
9573
9579
|
let M = W.offset, H = ee.start;
|
|
9574
9580
|
const te = W.size;
|
|
@@ -9588,7 +9594,7 @@ const hr = et(
|
|
|
9588
9594
|
),
|
|
9589
9595
|
//@ts-expect-error filter needs to be fixed
|
|
9590
9596
|
Re((S) => S !== null),
|
|
9591
|
-
|
|
9597
|
+
xt()
|
|
9592
9598
|
),
|
|
9593
9599
|
Ti
|
|
9594
9600
|
);
|
|
@@ -9625,7 +9631,7 @@ const hr = et(
|
|
|
9625
9631
|
Le(o, e),
|
|
9626
9632
|
Re(([{ items: S }, k]) => S[S.length - 1].originalIndex === k - 1),
|
|
9627
9633
|
ce(([, S, k]) => [S - 1, k]),
|
|
9628
|
-
|
|
9634
|
+
xt(oo),
|
|
9629
9635
|
ce(([S]) => S)
|
|
9630
9636
|
)
|
|
9631
9637
|
), T = en(
|
|
@@ -9634,7 +9640,7 @@ const hr = et(
|
|
|
9634
9640
|
An(200),
|
|
9635
9641
|
Re(({ items: S, topItems: k }) => S.length > 0 && S[0].originalIndex === k.length),
|
|
9636
9642
|
ce(({ items: S }) => S[0].index),
|
|
9637
|
-
|
|
9643
|
+
xt()
|
|
9638
9644
|
)
|
|
9639
9645
|
), C = en(
|
|
9640
9646
|
U(
|
|
@@ -9651,12 +9657,12 @@ const hr = et(
|
|
|
9651
9657
|
startIndex: S[k].index
|
|
9652
9658
|
};
|
|
9653
9659
|
}),
|
|
9654
|
-
|
|
9660
|
+
xt(If)
|
|
9655
9661
|
)
|
|
9656
9662
|
);
|
|
9657
9663
|
return { endReached: b, initialItemCount: m, itemsRendered: g, listState: w, rangeChanged: C, startReached: T, topItemsIndexes: y, ...p };
|
|
9658
9664
|
},
|
|
9659
|
-
|
|
9665
|
+
yt(
|
|
9660
9666
|
En,
|
|
9661
9667
|
_f,
|
|
9662
9668
|
Va,
|
|
@@ -9678,7 +9684,7 @@ const hr = et(
|
|
|
9678
9684
|
);
|
|
9679
9685
|
return he(ke(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
9680
9686
|
},
|
|
9681
|
-
|
|
9687
|
+
yt(Wt, hr),
|
|
9682
9688
|
{ singleton: !0 }
|
|
9683
9689
|
), B0 = et(
|
|
9684
9690
|
([{ viewportHeight: e }, { totalListHeight: t }]) => {
|
|
@@ -9688,13 +9694,13 @@ const hr = et(
|
|
|
9688
9694
|
Re(([o]) => o),
|
|
9689
9695
|
ce(([, o, s]) => Math.max(0, o - s)),
|
|
9690
9696
|
An(0),
|
|
9691
|
-
|
|
9697
|
+
xt()
|
|
9692
9698
|
),
|
|
9693
9699
|
0
|
|
9694
9700
|
);
|
|
9695
9701
|
return { alignToBottom: n, paddingTopAddition: r };
|
|
9696
9702
|
},
|
|
9697
|
-
|
|
9703
|
+
yt(Wt, Df),
|
|
9698
9704
|
{ singleton: !0 }
|
|
9699
9705
|
), Lf = et(() => ({
|
|
9700
9706
|
context: Y(null)
|
|
@@ -9730,7 +9736,7 @@ const hr = et(
|
|
|
9730
9736
|
Re(($) => !$),
|
|
9731
9737
|
// skips the initial publish of false, and the cleanup call.
|
|
9732
9738
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
9733
|
-
ar(
|
|
9739
|
+
ar(Et(i) ? 1 : 2)
|
|
9734
9740
|
),
|
|
9735
9741
|
k
|
|
9736
9742
|
) : k && k(), j;
|
|
@@ -9742,7 +9748,7 @@ const hr = et(
|
|
|
9742
9748
|
scrollIntoView: d
|
|
9743
9749
|
};
|
|
9744
9750
|
},
|
|
9745
|
-
|
|
9751
|
+
yt(En, Wt, vo, hr, qn),
|
|
9746
9752
|
{ singleton: !0 }
|
|
9747
9753
|
);
|
|
9748
9754
|
function Cc(e) {
|
|
@@ -9780,16 +9786,16 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9780
9786
|
Re(({ shouldFollow: C }) => C)
|
|
9781
9787
|
),
|
|
9782
9788
|
({ followOutputBehavior: C, totalCount: S }) => {
|
|
9783
|
-
m && (m(), m = null),
|
|
9784
|
-
|
|
9789
|
+
m && (m(), m = null), Et(n) ? requestAnimationFrame(() => {
|
|
9790
|
+
Et(d)("following output to ", { totalCount: S }, Xt.DEBUG), g(C);
|
|
9785
9791
|
}) : m = pn(e, () => {
|
|
9786
|
-
|
|
9792
|
+
Et(d)("following output to ", { totalCount: S }, Xt.DEBUG), g(C), m = null;
|
|
9787
9793
|
});
|
|
9788
9794
|
}
|
|
9789
9795
|
);
|
|
9790
9796
|
function w(C) {
|
|
9791
9797
|
const S = pn(o, (k) => {
|
|
9792
|
-
C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !m && (
|
|
9798
|
+
C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !m && (Et(d)("scrolling to bottom due to increased size", {}, Xt.DEBUG), g("auto"));
|
|
9793
9799
|
});
|
|
9794
9800
|
setTimeout(S, 100);
|
|
9795
9801
|
}
|
|
@@ -9805,10 +9811,10 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9805
9811
|
Le(x, t)
|
|
9806
9812
|
),
|
|
9807
9813
|
([, C]) => {
|
|
9808
|
-
|
|
9814
|
+
Et(a) && w(C !== !1);
|
|
9809
9815
|
}
|
|
9810
9816
|
), ot(y, () => {
|
|
9811
|
-
w(
|
|
9817
|
+
w(Et(x) !== !1);
|
|
9812
9818
|
}), ot(At(ke(x), o), ([C, S]) => {
|
|
9813
9819
|
C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
|
|
9814
9820
|
});
|
|
@@ -9834,15 +9840,15 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9834
9840
|
An(0)
|
|
9835
9841
|
),
|
|
9836
9842
|
(C) => {
|
|
9837
|
-
m && (m(), m = null),
|
|
9838
|
-
|
|
9843
|
+
m && (m(), m = null), Et(n) ? requestAnimationFrame(() => {
|
|
9844
|
+
Et(d)("scrolling into view", {}), Me(h, C);
|
|
9839
9845
|
}) : m = pn(e, () => {
|
|
9840
|
-
|
|
9846
|
+
Et(d)("scrolling into view", {}), Me(h, C), m = null;
|
|
9841
9847
|
});
|
|
9842
9848
|
}
|
|
9843
9849
|
), { autoscrollToBottom: y, followOutput: x, scrollIntoViewOnChange: b };
|
|
9844
9850
|
},
|
|
9845
|
-
|
|
9851
|
+
yt(
|
|
9846
9852
|
En,
|
|
9847
9853
|
bo,
|
|
9848
9854
|
vo,
|
|
@@ -9864,7 +9870,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9864
9870
|
),
|
|
9865
9871
|
i
|
|
9866
9872
|
), {}),
|
|
9867
|
-
|
|
9873
|
+
yt(En, wo, hr, Gn),
|
|
9868
9874
|
{ singleton: !0 }
|
|
9869
9875
|
), K0 = et(
|
|
9870
9876
|
([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
|
|
@@ -9894,7 +9900,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9894
9900
|
initialScrollTop: r
|
|
9895
9901
|
};
|
|
9896
9902
|
},
|
|
9897
|
-
|
|
9903
|
+
yt(Gn, Wt, hr),
|
|
9898
9904
|
{ singleton: !0 }
|
|
9899
9905
|
), $f = et(
|
|
9900
9906
|
([{ scrollVelocity: e }]) => {
|
|
@@ -9913,7 +9919,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9913
9919
|
return !0;
|
|
9914
9920
|
return i;
|
|
9915
9921
|
}),
|
|
9916
|
-
|
|
9922
|
+
xt()
|
|
9917
9923
|
),
|
|
9918
9924
|
t
|
|
9919
9925
|
), ot(
|
|
@@ -9923,7 +9929,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9923
9929
|
}
|
|
9924
9930
|
), { isSeeking: t, scrollSeekConfiguration: r, scrollSeekRangeChanged: n, scrollVelocity: e };
|
|
9925
9931
|
},
|
|
9926
|
-
|
|
9932
|
+
yt(bo),
|
|
9927
9933
|
{ singleton: !0 }
|
|
9928
9934
|
), Ka = et(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
9929
9935
|
const n = We(), r = We(), o = We(), s = Y(!1), i = Y(void 0);
|
|
@@ -9957,7 +9963,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9957
9963
|
windowScrollTo: o,
|
|
9958
9964
|
windowViewportRect: r
|
|
9959
9965
|
};
|
|
9960
|
-
},
|
|
9966
|
+
}, yt(Wt)), q0 = et(
|
|
9961
9967
|
([
|
|
9962
9968
|
{ sizeRanges: e, sizes: t },
|
|
9963
9969
|
{ headerHeight: n, scrollTop: r },
|
|
@@ -9980,7 +9986,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9980
9986
|
s,
|
|
9981
9987
|
Le(d),
|
|
9982
9988
|
Re(([, h]) => h !== void 0),
|
|
9983
|
-
|
|
9989
|
+
xt(),
|
|
9984
9990
|
ce(([, h]) => h.ranges)
|
|
9985
9991
|
),
|
|
9986
9992
|
e
|
|
@@ -9989,7 +9995,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = et(
|
|
|
9989
9995
|
restoreStateFrom: d
|
|
9990
9996
|
};
|
|
9991
9997
|
},
|
|
9992
|
-
|
|
9998
|
+
yt(En, Wt, wo, Gn, Ka)
|
|
9993
9999
|
);
|
|
9994
10000
|
function G0(e) {
|
|
9995
10001
|
return { align: "start", index: 0, offset: e.scrollTop };
|
|
@@ -10004,7 +10010,7 @@ const Y0 = et(([{ topItemsIndexes: e }]) => {
|
|
|
10004
10010
|
),
|
|
10005
10011
|
e
|
|
10006
10012
|
), { topItemCount: t };
|
|
10007
|
-
},
|
|
10013
|
+
}, yt(hr));
|
|
10008
10014
|
function zf(e) {
|
|
10009
10015
|
let t = !1, n;
|
|
10010
10016
|
return () => (t || (t = !0, n = e()), n);
|
|
@@ -10087,7 +10093,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10087
10093
|
}
|
|
10088
10094
|
), { deviation: e };
|
|
10089
10095
|
},
|
|
10090
|
-
|
|
10096
|
+
yt(Wt, bo, hr, En, qn, Ba)
|
|
10091
10097
|
), Z0 = et(
|
|
10092
10098
|
([
|
|
10093
10099
|
e,
|
|
@@ -10114,7 +10120,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10114
10120
|
...c,
|
|
10115
10121
|
...d
|
|
10116
10122
|
}),
|
|
10117
|
-
|
|
10123
|
+
yt(
|
|
10118
10124
|
Va,
|
|
10119
10125
|
V0,
|
|
10120
10126
|
Gn,
|
|
@@ -10190,7 +10196,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10190
10196
|
sizes: l,
|
|
10191
10197
|
...m
|
|
10192
10198
|
}),
|
|
10193
|
-
|
|
10199
|
+
yt(
|
|
10194
10200
|
En,
|
|
10195
10201
|
wo,
|
|
10196
10202
|
Wt,
|
|
@@ -10269,11 +10275,11 @@ function Hf(e, t, n) {
|
|
|
10269
10275
|
);
|
|
10270
10276
|
return z.useSyncExternalStore(
|
|
10271
10277
|
w,
|
|
10272
|
-
() =>
|
|
10273
|
-
() =>
|
|
10278
|
+
() => Et(g),
|
|
10279
|
+
() => Et(g)
|
|
10274
10280
|
);
|
|
10275
10281
|
}, x = (m) => {
|
|
10276
|
-
const g = z.useContext(a)[m], [w, b] = z.useState(hc(
|
|
10282
|
+
const g = z.useContext(a)[m], [w, b] = z.useState(hc(Et, g));
|
|
10277
10283
|
return _o(
|
|
10278
10284
|
() => ot(g, (T) => {
|
|
10279
10285
|
T !== w && b(pc(T));
|
|
@@ -10363,7 +10369,7 @@ const tS = /* @__PURE__ */ et(() => {
|
|
|
10363
10369
|
U(
|
|
10364
10370
|
n,
|
|
10365
10371
|
ce((c) => c[a]),
|
|
10366
|
-
|
|
10372
|
+
xt()
|
|
10367
10373
|
),
|
|
10368
10374
|
l
|
|
10369
10375
|
);
|
|
@@ -10386,7 +10392,7 @@ const tS = /* @__PURE__ */ et(() => {
|
|
|
10386
10392
|
};
|
|
10387
10393
|
}), nS = /* @__PURE__ */ et(
|
|
10388
10394
|
([e, t]) => ({ ...e, ...t }),
|
|
10389
|
-
|
|
10395
|
+
yt(Bf, tS)
|
|
10390
10396
|
), rS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), oS = { overflowAnchor: "none", position: qa(), zIndex: 1 }, qf = { overflowAnchor: "none" }, sS = { ...qf, display: "inline-block", height: "100%" }, kc = /* @__PURE__ */ z.memo(function({ showTopList: e = !1 }) {
|
|
10391
10397
|
const t = Ae("listState"), n = on("sizeRanges"), r = Ae("useWindowScroll"), o = Ae("customScrollParent"), s = on("windowScrollContainerState"), i = on("scrollContainerState"), a = o || r ? s : i, l = Ae("itemContent"), c = Ae("context"), d = Ae("groupContent"), f = Ae("trackItemSizes"), p = Ae("itemSize"), h = Ae("log"), x = on("gap"), y = Ae("horizontalDirection"), { callbackRef: m } = w0(
|
|
10392
10398
|
n,
|
|
@@ -10676,7 +10682,7 @@ const fS = ({ children: e }) => {
|
|
|
10676
10682
|
U(
|
|
10677
10683
|
s,
|
|
10678
10684
|
ce((f) => f[c]),
|
|
10679
|
-
|
|
10685
|
+
xt()
|
|
10680
10686
|
),
|
|
10681
10687
|
d
|
|
10682
10688
|
);
|
|
@@ -10701,7 +10707,7 @@ const fS = ({ children: e }) => {
|
|
|
10701
10707
|
GroupComponent: l("Group", "tr")
|
|
10702
10708
|
};
|
|
10703
10709
|
});
|
|
10704
|
-
|
|
10710
|
+
yt(Bf, wS);
|
|
10705
10711
|
qa();
|
|
10706
10712
|
const Rc = {
|
|
10707
10713
|
bottom: 0,
|
|
@@ -10745,7 +10751,7 @@ const TS = /* @__PURE__ */ et(
|
|
|
10745
10751
|
{ customScrollParent: m, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
|
|
10746
10752
|
C
|
|
10747
10753
|
]) => {
|
|
10748
|
-
const S = Y(0), k = Y(0), N = Y(Rc), I = Y({ height: 0, width: 0 }), E = Y({ height: 0, width: 0 }), _ = We(), L = We(), F = Y(0), j = Y(null), $ = Y({ column: 0, row: 0 }), A = We(), B = We(), D = Y(!1), O = Y(0), J = Y(!0), X = Y(!1),
|
|
10754
|
+
const S = Y(0), k = Y(0), N = Y(Rc), I = Y({ height: 0, width: 0 }), E = Y({ height: 0, width: 0 }), _ = We(), L = We(), F = Y(0), j = Y(null), $ = Y({ column: 0, row: 0 }), A = We(), B = We(), D = Y(!1), O = Y(0), J = Y(!0), X = Y(!1), fe = Y(!1);
|
|
10749
10755
|
ot(
|
|
10750
10756
|
U(
|
|
10751
10757
|
x,
|
|
@@ -10845,8 +10851,8 @@ const TS = /* @__PURE__ */ et(
|
|
|
10845
10851
|
const Qe = Xf(Ge, qe, Ke);
|
|
10846
10852
|
let Je, nt;
|
|
10847
10853
|
Te ? H === 0 && te === 0 && se > 0 ? (Je = 0, nt = se - 1) : (Je = Qe * as((H + ze) / ($e + ze)), nt = Qe * Ec((te + ze) / ($e + ze)) - 1, nt = Ei(M - 1, Kr(nt, Qe - 1)), Je = Ei(nt, Kr(0, Je))) : (Je = 0, nt = -1);
|
|
10848
|
-
const jt = Nc(Je, nt, Q), { bottom:
|
|
10849
|
-
return { bottom:
|
|
10854
|
+
const jt = Nc(Je, nt, Q), { bottom: ut, top: lt } = Ac(De, ie, ne, jt), Tt = Ec(M / Qe), bt = Tt * $e + (Tt - 1) * ze - ut;
|
|
10855
|
+
return { bottom: ut, itemHeight: $e, items: jt, itemWidth: qe, offsetBottom: bt, offsetTop: lt, top: lt };
|
|
10850
10856
|
}
|
|
10851
10857
|
)
|
|
10852
10858
|
),
|
|
@@ -10866,7 +10872,7 @@ const TS = /* @__PURE__ */ et(
|
|
|
10866
10872
|
const { bottom: ne, top: De } = Ac(M, ie, H, te);
|
|
10867
10873
|
return [De, ne];
|
|
10868
10874
|
}),
|
|
10869
|
-
|
|
10875
|
+
xt(oo)
|
|
10870
10876
|
),
|
|
10871
10877
|
t
|
|
10872
10878
|
);
|
|
@@ -10889,14 +10895,14 @@ const TS = /* @__PURE__ */ et(
|
|
|
10889
10895
|
return (te || M.bottom > 0 && M.itemHeight > 0 && M.offsetBottom === 0 && M.items.length === H) && ie;
|
|
10890
10896
|
}),
|
|
10891
10897
|
ce(([[, M]]) => M - 1),
|
|
10892
|
-
|
|
10898
|
+
xt()
|
|
10893
10899
|
)
|
|
10894
10900
|
), G = en(
|
|
10895
10901
|
U(
|
|
10896
10902
|
ke(N),
|
|
10897
10903
|
Re(({ items: M }) => M.length > 0 && M[0].index === 0),
|
|
10898
10904
|
wn(0),
|
|
10899
|
-
|
|
10905
|
+
xt()
|
|
10900
10906
|
)
|
|
10901
10907
|
), ee = en(
|
|
10902
10908
|
U(
|
|
@@ -10907,7 +10913,7 @@ const TS = /* @__PURE__ */ et(
|
|
|
10907
10913
|
endIndex: M[M.length - 1].index,
|
|
10908
10914
|
startIndex: M[0].index
|
|
10909
10915
|
})),
|
|
10910
|
-
|
|
10916
|
+
xt(If),
|
|
10911
10917
|
An(0)
|
|
10912
10918
|
)
|
|
10913
10919
|
);
|
|
@@ -10967,7 +10973,7 @@ const TS = /* @__PURE__ */ et(
|
|
|
10967
10973
|
...h,
|
|
10968
10974
|
// output
|
|
10969
10975
|
gridState: N,
|
|
10970
|
-
horizontalDirection:
|
|
10976
|
+
horizontalDirection: fe,
|
|
10971
10977
|
initialTopMostItemIndex: O,
|
|
10972
10978
|
totalListHeight: W,
|
|
10973
10979
|
...p,
|
|
@@ -10980,7 +10986,7 @@ const TS = /* @__PURE__ */ et(
|
|
|
10980
10986
|
...C
|
|
10981
10987
|
};
|
|
10982
10988
|
},
|
|
10983
|
-
|
|
10989
|
+
yt(Va, Wt, bo, $f, Gn, Ka, qn)
|
|
10984
10990
|
);
|
|
10985
10991
|
function Xf(e, t, n) {
|
|
10986
10992
|
return Kr(1, as((e + n) / (as(t) + n)));
|
|
@@ -11001,7 +11007,7 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11001
11007
|
U(
|
|
11002
11008
|
t,
|
|
11003
11009
|
ce((h) => h[f]),
|
|
11004
|
-
|
|
11010
|
+
xt()
|
|
11005
11011
|
),
|
|
11006
11012
|
p
|
|
11007
11013
|
), c = Y(!1), d = Y(!1);
|
|
@@ -11025,9 +11031,9 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11025
11031
|
};
|
|
11026
11032
|
}), RS = /* @__PURE__ */ et(
|
|
11027
11033
|
([e, t]) => ({ ...e, ...t }),
|
|
11028
|
-
|
|
11034
|
+
yt(TS, kS)
|
|
11029
11035
|
), ES = /* @__PURE__ */ z.memo(function() {
|
|
11030
|
-
const e =
|
|
11036
|
+
const e = wt("gridState"), t = wt("listClassName"), n = wt("itemClassName"), r = wt("itemContent"), o = wt("computeItemKey"), s = wt("isSeeking"), i = sn("scrollHeight"), a = wt("ItemComponent"), l = wt("ListComponent"), c = wt("ScrollSeekPlaceholder"), d = wt("context"), f = sn("itemDimensions"), p = sn("gap"), h = wt("log"), x = wt("stateRestoreInProgress"), y = sn("reportReadyState"), m = pr(
|
|
11031
11037
|
z.useMemo(
|
|
11032
11038
|
() => (g) => {
|
|
11033
11039
|
const w = g.parentElement.parentElement.scrollHeight;
|
|
@@ -11082,7 +11088,7 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11082
11088
|
}
|
|
11083
11089
|
);
|
|
11084
11090
|
}), IS = z.memo(function() {
|
|
11085
|
-
const e =
|
|
11091
|
+
const e = wt("HeaderComponent"), t = sn("headerHeight"), n = wt("headerFooterTag"), r = pr(
|
|
11086
11092
|
z.useMemo(
|
|
11087
11093
|
() => (s) => {
|
|
11088
11094
|
t(Un(s, "height"));
|
|
@@ -11091,10 +11097,10 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11091
11097
|
),
|
|
11092
11098
|
!0,
|
|
11093
11099
|
!1
|
|
11094
|
-
), o =
|
|
11100
|
+
), o = wt("context");
|
|
11095
11101
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Bt(e, o) }) }) : null;
|
|
11096
11102
|
}), NS = z.memo(function() {
|
|
11097
|
-
const e =
|
|
11103
|
+
const e = wt("FooterComponent"), t = sn("footerHeight"), n = wt("headerFooterTag"), r = pr(
|
|
11098
11104
|
z.useMemo(
|
|
11099
11105
|
() => (s) => {
|
|
11100
11106
|
t(Un(s, "height"));
|
|
@@ -11103,7 +11109,7 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11103
11109
|
),
|
|
11104
11110
|
!0,
|
|
11105
11111
|
!1
|
|
11106
|
-
), o =
|
|
11112
|
+
), o = wt("context");
|
|
11107
11113
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Bt(e, o) }) }) : null;
|
|
11108
11114
|
}), AS = ({ children: e }) => {
|
|
11109
11115
|
const t = z.useContext(Wf), n = sn("itemDimensions"), r = sn("viewportDimensions"), o = pr(
|
|
@@ -11120,12 +11126,12 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11120
11126
|
t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
|
|
11121
11127
|
}, [t, r, n]), /* @__PURE__ */ u.jsx("div", { ref: o, style: Ws(!1), children: e });
|
|
11122
11128
|
}, jS = ({ children: e }) => {
|
|
11123
|
-
const t = z.useContext(Wf), n = sn("windowViewportRect"), r = sn("itemDimensions"), o =
|
|
11129
|
+
const t = z.useContext(Wf), n = sn("windowViewportRect"), r = sn("itemDimensions"), o = wt("customScrollParent"), s = Sf(n, o, !1);
|
|
11124
11130
|
return z.useEffect(() => {
|
|
11125
11131
|
t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
|
|
11126
11132
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style: Ws(!1), children: e });
|
|
11127
11133
|
}, _S = /* @__PURE__ */ z.memo(function({ ...e }) {
|
|
11128
|
-
const t =
|
|
11134
|
+
const t = wt("useWindowScroll"), n = wt("customScrollParent"), r = n || t ? OS : PS, o = n || t ? jS : AS, s = wt("context");
|
|
11129
11135
|
return /* @__PURE__ */ u.jsx(r, { ...e, ...Bt(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
|
|
11130
11136
|
/* @__PURE__ */ u.jsx(IS, {}),
|
|
11131
11137
|
/* @__PURE__ */ u.jsx(ES, {}),
|
|
@@ -11133,7 +11139,7 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11133
11139
|
] }) });
|
|
11134
11140
|
}), {
|
|
11135
11141
|
useEmitter: Jf,
|
|
11136
|
-
useEmitterValue:
|
|
11142
|
+
useEmitterValue: wt,
|
|
11137
11143
|
usePublisher: sn
|
|
11138
11144
|
} = /* @__PURE__ */ Hf(
|
|
11139
11145
|
RS,
|
|
@@ -11176,7 +11182,7 @@ const kS = /* @__PURE__ */ et(() => {
|
|
|
11176
11182
|
}
|
|
11177
11183
|
},
|
|
11178
11184
|
_S
|
|
11179
|
-
), PS = /* @__PURE__ */ Gf({ useEmitter: Jf, useEmitterValue:
|
|
11185
|
+
), PS = /* @__PURE__ */ Gf({ useEmitter: Jf, useEmitterValue: wt, usePublisher: sn }), OS = /* @__PURE__ */ Yf({ useEmitter: Jf, useEmitterValue: wt, usePublisher: sn });
|
|
11180
11186
|
function jc(e, t, n) {
|
|
11181
11187
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Xt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
11182
11188
|
}
|
|
@@ -11787,7 +11793,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
11787
11793
|
}
|
|
11788
11794
|
}
|
|
11789
11795
|
}, [n]);
|
|
11790
|
-
|
|
11796
|
+
Ct(() => {
|
|
11791
11797
|
e && n && p();
|
|
11792
11798
|
}, [e, n, p]);
|
|
11793
11799
|
const h = async () => {
|
|
@@ -11929,7 +11935,7 @@ function Np(e) {
|
|
|
11929
11935
|
return e.replace(cC, (t, n) => (n = n.toLowerCase(), n === "colon" ? ":" : n.charAt(0) === "#" ? n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)) : ""));
|
|
11930
11936
|
}
|
|
11931
11937
|
const uC = /(^|[^\[])\^/g;
|
|
11932
|
-
function
|
|
11938
|
+
function pt(e, t) {
|
|
11933
11939
|
e = typeof e == "string" ? e : e.source, t = t || "";
|
|
11934
11940
|
const n = {
|
|
11935
11941
|
replace: (r, o) => (o = o.source || o, o = o.replace(uC, "$1"), e = e.replace(r, o), n),
|
|
@@ -12472,7 +12478,7 @@ class tl {
|
|
|
12472
12478
|
}
|
|
12473
12479
|
}
|
|
12474
12480
|
}
|
|
12475
|
-
const
|
|
12481
|
+
const ve = {
|
|
12476
12482
|
newline: /^(?: *(?:\n|$))+/,
|
|
12477
12483
|
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
12478
12484
|
fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
@@ -12489,37 +12495,37 @@ const ye = {
|
|
|
12489
12495
|
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
|
|
12490
12496
|
text: /^[^\n]+/
|
|
12491
12497
|
};
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12496
|
-
|
|
12497
|
-
|
|
12498
|
-
|
|
12499
|
-
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
...
|
|
12498
|
+
ve._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
|
|
12499
|
+
ve._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
|
|
12500
|
+
ve.def = pt(ve.def).replace("label", ve._label).replace("title", ve._title).getRegex();
|
|
12501
|
+
ve.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
12502
|
+
ve.listItemStart = pt(/^( *)(bull) */).replace("bull", ve.bullet).getRegex();
|
|
12503
|
+
ve.list = pt(ve.list).replace(/bull/g, ve.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + ve.def.source + ")").getRegex();
|
|
12504
|
+
ve._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";
|
|
12505
|
+
ve._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
|
|
12506
|
+
ve.html = pt(ve.html, "i").replace("comment", ve._comment).replace("tag", ve._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
12507
|
+
ve.paragraph = pt(ve._paragraph).replace("hr", ve.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", ve._tag).getRegex();
|
|
12508
|
+
ve.blockquote = pt(ve.blockquote).replace("paragraph", ve.paragraph).getRegex();
|
|
12509
|
+
ve.normal = { ...ve };
|
|
12510
|
+
ve.gfm = {
|
|
12511
|
+
...ve.normal,
|
|
12506
12512
|
table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
12507
12513
|
// Cells
|
|
12508
12514
|
};
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
...
|
|
12513
|
-
html:
|
|
12515
|
+
ve.gfm.table = pt(ve.gfm.table).replace("hr", ve.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", ve._tag).getRegex();
|
|
12516
|
+
ve.gfm.paragraph = pt(ve._paragraph).replace("hr", ve.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", ve.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", ve._tag).getRegex();
|
|
12517
|
+
ve.pedantic = {
|
|
12518
|
+
...ve.normal,
|
|
12519
|
+
html: pt(
|
|
12514
12520
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
12515
|
-
).replace("comment",
|
|
12521
|
+
).replace("comment", ve._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(),
|
|
12516
12522
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
12517
12523
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
12518
12524
|
fences: us,
|
|
12519
12525
|
// fences not supported
|
|
12520
12526
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
12521
|
-
paragraph:
|
|
12522
|
-
]`).replace("lheading",
|
|
12527
|
+
paragraph: pt(ve.normal._paragraph).replace("hr", ve.hr).replace("heading", ` *#{1,6} *[^
|
|
12528
|
+
]`).replace("lheading", ve.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
|
|
12523
12529
|
};
|
|
12524
12530
|
const ue = {
|
|
12525
12531
|
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
@@ -12546,26 +12552,26 @@ const ue = {
|
|
|
12546
12552
|
punctuation: /^([\spunctuation])/
|
|
12547
12553
|
};
|
|
12548
12554
|
ue._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
|
|
12549
|
-
ue.punctuation =
|
|
12555
|
+
ue.punctuation = pt(ue.punctuation).replace(/punctuation/g, ue._punctuation).getRegex();
|
|
12550
12556
|
ue.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
|
|
12551
12557
|
ue.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
|
|
12552
|
-
ue._comment =
|
|
12553
|
-
ue.emStrong.lDelim =
|
|
12554
|
-
ue.emStrong.rDelimAst =
|
|
12555
|
-
ue.emStrong.rDelimUnd =
|
|
12558
|
+
ue._comment = pt(ve._comment).replace("(?:-->|$)", "-->").getRegex();
|
|
12559
|
+
ue.emStrong.lDelim = pt(ue.emStrong.lDelim).replace(/punct/g, ue._punctuation).getRegex();
|
|
12560
|
+
ue.emStrong.rDelimAst = pt(ue.emStrong.rDelimAst, "g").replace(/punct/g, ue._punctuation).getRegex();
|
|
12561
|
+
ue.emStrong.rDelimUnd = pt(ue.emStrong.rDelimUnd, "g").replace(/punct/g, ue._punctuation).getRegex();
|
|
12556
12562
|
ue._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
|
|
12557
12563
|
ue._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
|
|
12558
12564
|
ue._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
|
|
12559
|
-
ue.autolink =
|
|
12565
|
+
ue.autolink = pt(ue.autolink).replace("scheme", ue._scheme).replace("email", ue._email).getRegex();
|
|
12560
12566
|
ue._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
|
|
12561
|
-
ue.tag =
|
|
12567
|
+
ue.tag = pt(ue.tag).replace("comment", ue._comment).replace("attribute", ue._attribute).getRegex();
|
|
12562
12568
|
ue._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
12563
12569
|
ue._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
|
|
12564
12570
|
ue._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
|
|
12565
|
-
ue.link =
|
|
12566
|
-
ue.reflink =
|
|
12567
|
-
ue.nolink =
|
|
12568
|
-
ue.reflinkSearch =
|
|
12571
|
+
ue.link = pt(ue.link).replace("label", ue._label).replace("href", ue._href).replace("title", ue._title).getRegex();
|
|
12572
|
+
ue.reflink = pt(ue.reflink).replace("label", ue._label).replace("ref", ve._label).getRegex();
|
|
12573
|
+
ue.nolink = pt(ue.nolink).replace("ref", ve._label).getRegex();
|
|
12574
|
+
ue.reflinkSearch = pt(ue.reflinkSearch, "g").replace("reflink", ue.reflink).replace("nolink", ue.nolink).getRegex();
|
|
12569
12575
|
ue.normal = { ...ue };
|
|
12570
12576
|
ue.pedantic = {
|
|
12571
12577
|
...ue.normal,
|
|
@@ -12581,23 +12587,23 @@ ue.pedantic = {
|
|
|
12581
12587
|
endAst: /\*(?!\*)/g,
|
|
12582
12588
|
endUnd: /_(?!_)/g
|
|
12583
12589
|
},
|
|
12584
|
-
link:
|
|
12585
|
-
reflink:
|
|
12590
|
+
link: pt(/^!?\[(label)\]\((.*?)\)/).replace("label", ue._label).getRegex(),
|
|
12591
|
+
reflink: pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", ue._label).getRegex()
|
|
12586
12592
|
};
|
|
12587
12593
|
ue.gfm = {
|
|
12588
12594
|
...ue.normal,
|
|
12589
|
-
escape:
|
|
12595
|
+
escape: pt(ue.escape).replace("])", "~|])").getRegex(),
|
|
12590
12596
|
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
|
|
12591
12597
|
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
|
|
12592
12598
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
12593
12599
|
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
12594
12600
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
12595
12601
|
};
|
|
12596
|
-
ue.gfm.url =
|
|
12602
|
+
ue.gfm.url = pt(ue.gfm.url, "i").replace("email", ue.gfm._extended_email).getRegex();
|
|
12597
12603
|
ue.breaks = {
|
|
12598
12604
|
...ue.gfm,
|
|
12599
|
-
br:
|
|
12600
|
-
text:
|
|
12605
|
+
br: pt(ue.br).replace("{2,}", "*").getRegex(),
|
|
12606
|
+
text: pt(ue.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
12601
12607
|
};
|
|
12602
12608
|
function wC(e) {
|
|
12603
12609
|
return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
|
|
@@ -12617,17 +12623,17 @@ class Wn {
|
|
|
12617
12623
|
top: !0
|
|
12618
12624
|
};
|
|
12619
12625
|
const n = {
|
|
12620
|
-
block:
|
|
12626
|
+
block: ve.normal,
|
|
12621
12627
|
inline: ue.normal
|
|
12622
12628
|
};
|
|
12623
|
-
this.options.pedantic ? (n.block =
|
|
12629
|
+
this.options.pedantic ? (n.block = ve.pedantic, n.inline = ue.pedantic) : this.options.gfm && (n.block = ve.gfm, this.options.breaks ? n.inline = ue.breaks : n.inline = ue.gfm), this.tokenizer.rules = n;
|
|
12624
12630
|
}
|
|
12625
12631
|
/**
|
|
12626
12632
|
* Expose Rules
|
|
12627
12633
|
*/
|
|
12628
12634
|
static get rules() {
|
|
12629
12635
|
return {
|
|
12630
|
-
block:
|
|
12636
|
+
block: ve,
|
|
12631
12637
|
inline: ue
|
|
12632
12638
|
};
|
|
12633
12639
|
}
|
|
@@ -13436,7 +13442,7 @@ function fs({
|
|
|
13436
13442
|
allowHtml: n = !1,
|
|
13437
13443
|
style: r
|
|
13438
13444
|
}) {
|
|
13439
|
-
const o =
|
|
13445
|
+
const o = at(() => {
|
|
13440
13446
|
try {
|
|
13441
13447
|
if (!n) {
|
|
13442
13448
|
const i = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
|
|
@@ -13446,7 +13452,7 @@ function fs({
|
|
|
13446
13452
|
} catch (i) {
|
|
13447
13453
|
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>`;
|
|
13448
13454
|
}
|
|
13449
|
-
}, [e, n]), s =
|
|
13455
|
+
}, [e, n]), s = at(() => {
|
|
13450
13456
|
const i = {
|
|
13451
13457
|
color: "currentColor",
|
|
13452
13458
|
...r
|
|
@@ -13549,7 +13555,7 @@ function zc(e) {
|
|
|
13549
13555
|
}
|
|
13550
13556
|
function RC({ className: e }) {
|
|
13551
13557
|
const [t, n] = ge(0);
|
|
13552
|
-
return
|
|
13558
|
+
return Ct(() => {
|
|
13553
13559
|
const r = setInterval(() => n((o) => (o + 1) % 4), 500);
|
|
13554
13560
|
return () => clearInterval(r);
|
|
13555
13561
|
}, []), /* @__PURE__ */ u.jsxs(
|
|
@@ -13591,7 +13597,7 @@ const Bc = z.memo(function({
|
|
|
13591
13597
|
defaultCheckpointId: N = null,
|
|
13592
13598
|
messageParentCheckpointId: I = null
|
|
13593
13599
|
}) {
|
|
13594
|
-
const [E, _] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", O = t.role, J = O === "tool", X =
|
|
13600
|
+
const [E, _] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", O = t.role, J = O === "tool", X = at(() => "type" in t && t.type === "default_message" ? t : null, [t]), fe = !!X, Ee = !(r && O !== "user"), {
|
|
13595
13601
|
uploadingFiles: Ne,
|
|
13596
13602
|
handleFileClick: G,
|
|
13597
13603
|
fileViewerOpen: ee,
|
|
@@ -13610,27 +13616,27 @@ const Bc = z.memo(function({
|
|
|
13610
13616
|
default:
|
|
13611
13617
|
return "text-[hsl(var(--chat-bubble-ai-text))]";
|
|
13612
13618
|
}
|
|
13613
|
-
}, [O]), te =
|
|
13619
|
+
}, [O]), te = at(() => X ? "" : CC(t.content), [X, t]), ie = at(() => X ? {} : Pp(t), [X, t]), ne = at(
|
|
13614
13620
|
() => X ? [] : t.content.filter((V) => V.type === "image_url"),
|
|
13615
13621
|
[X, t]
|
|
13616
|
-
), De =
|
|
13622
|
+
), De = at(
|
|
13617
13623
|
() => X ? [] : t.content.filter((V) => V.type === "file"),
|
|
13618
13624
|
[X, t]
|
|
13619
|
-
), Q =
|
|
13625
|
+
), Q = at(
|
|
13620
13626
|
() => X ? [] : t.content.filter((V) => V.type === "interrupt"),
|
|
13621
13627
|
[X, t]
|
|
13622
|
-
), se = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), Te = Mo(se), je = g == null ? void 0 : g.value, Ke =
|
|
13628
|
+
), se = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), Te = Mo(se), je = g == null ? void 0 : g.value, Ke = at(() => X ? "" : TC(t.content), [X, t]), ze = z.useCallback(async () => {
|
|
13623
13629
|
const V = J ? Ke : te;
|
|
13624
|
-
async function be(
|
|
13630
|
+
async function be(ye) {
|
|
13625
13631
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
13626
|
-
await navigator.clipboard.writeText(
|
|
13632
|
+
await navigator.clipboard.writeText(ye);
|
|
13627
13633
|
return;
|
|
13628
13634
|
}
|
|
13629
13635
|
if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
|
|
13630
|
-
const
|
|
13636
|
+
const ht = new Blob([ye], { type: "text/plain" });
|
|
13631
13637
|
await navigator.clipboard.write([
|
|
13632
13638
|
new ClipboardItem({
|
|
13633
|
-
"text/plain":
|
|
13639
|
+
"text/plain": ht
|
|
13634
13640
|
})
|
|
13635
13641
|
]);
|
|
13636
13642
|
return;
|
|
@@ -13639,8 +13645,8 @@ const Bc = z.memo(function({
|
|
|
13639
13645
|
}
|
|
13640
13646
|
try {
|
|
13641
13647
|
await be(V), _(!0), setTimeout(() => _(!1), 2e3), m == null || m(V);
|
|
13642
|
-
} catch (
|
|
13643
|
-
console.error("Failed to copy:",
|
|
13648
|
+
} catch (ye) {
|
|
13649
|
+
console.error("Failed to copy:", ye);
|
|
13644
13650
|
}
|
|
13645
13651
|
}, [J, Ke, te, m]), $e = z.useCallback(() => {
|
|
13646
13652
|
if (!h) return;
|
|
@@ -13680,7 +13686,7 @@ const Bc = z.memo(function({
|
|
|
13680
13686
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
13681
13687
|
D && "px-3 py-2 text-sm"
|
|
13682
13688
|
);
|
|
13683
|
-
if (
|
|
13689
|
+
if (fe)
|
|
13684
13690
|
return Z(
|
|
13685
13691
|
V,
|
|
13686
13692
|
"w-full",
|
|
@@ -13714,8 +13720,8 @@ const Bc = z.memo(function({
|
|
|
13714
13720
|
"border border-border/60 dark:border-border/40"
|
|
13715
13721
|
);
|
|
13716
13722
|
}
|
|
13717
|
-
}, [D,
|
|
13718
|
-
if (
|
|
13723
|
+
}, [D, fe, O]);
|
|
13724
|
+
if (fe && X)
|
|
13719
13725
|
return /* @__PURE__ */ u.jsx("div", { className: Z(Qe(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Z(Je(), p.content), children: [
|
|
13720
13726
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
13721
13727
|
/* @__PURE__ */ u.jsx(si, { className: Z("h-4 w-4", H) }),
|
|
@@ -13741,8 +13747,8 @@ const Bc = z.memo(function({
|
|
|
13741
13747
|
}
|
|
13742
13748
|
try {
|
|
13743
13749
|
b == null || b(), await B(be, !0);
|
|
13744
|
-
} catch (
|
|
13745
|
-
console.error("Failed to approve interrupt:",
|
|
13750
|
+
} catch (ye) {
|
|
13751
|
+
console.error("Failed to approve interrupt:", ye);
|
|
13746
13752
|
} finally {
|
|
13747
13753
|
T == null || T();
|
|
13748
13754
|
}
|
|
@@ -13758,51 +13764,51 @@ const Bc = z.memo(function({
|
|
|
13758
13764
|
}
|
|
13759
13765
|
try {
|
|
13760
13766
|
b == null || b(), await B(be, !1);
|
|
13761
|
-
} catch (
|
|
13762
|
-
console.error("Failed to reject interrupt:",
|
|
13767
|
+
} catch (ye) {
|
|
13768
|
+
console.error("Failed to reject interrupt:", ye);
|
|
13763
13769
|
} finally {
|
|
13764
13770
|
T == null || T();
|
|
13765
13771
|
}
|
|
13766
|
-
}, [w, T, b, B]),
|
|
13772
|
+
}, [w, T, b, B]), ut = z.useCallback(({ part: V, i: be }) => {
|
|
13767
13773
|
if (V.type === "text") {
|
|
13768
|
-
const
|
|
13769
|
-
return
|
|
13774
|
+
const ye = V.text ?? "", ht = ye.trim(), gt = Ja(ht);
|
|
13775
|
+
return gt && O !== "tool" ? /* @__PURE__ */ u.jsx(Op, { data: gt }, be) : O === "user" && c && ht.length > d ? /* @__PURE__ */ u.jsx(
|
|
13770
13776
|
NC,
|
|
13771
13777
|
{
|
|
13772
|
-
text:
|
|
13778
|
+
text: ht,
|
|
13773
13779
|
expanded: j,
|
|
13774
13780
|
onExpandedChange: $,
|
|
13775
13781
|
previewLength: d,
|
|
13776
13782
|
isCompact: D
|
|
13777
13783
|
},
|
|
13778
13784
|
be
|
|
13779
|
-
) : /* @__PURE__ */ u.jsx(fs, { content:
|
|
13785
|
+
) : /* @__PURE__ */ u.jsx(fs, { content: ye, allowHtml: !1 }, be);
|
|
13780
13786
|
}
|
|
13781
13787
|
if (V.type === "image_url") {
|
|
13782
|
-
const
|
|
13788
|
+
const ye = V;
|
|
13783
13789
|
return /* @__PURE__ */ u.jsx("div", { className: "my-2", children: /* @__PURE__ */ u.jsx(
|
|
13784
13790
|
"img",
|
|
13785
13791
|
{
|
|
13786
|
-
src:
|
|
13787
|
-
alt:
|
|
13792
|
+
src: ye.url,
|
|
13793
|
+
alt: ye.alt ?? "",
|
|
13788
13794
|
loading: "lazy",
|
|
13789
13795
|
className: "border rounded max-h-[420px] w-auto object-contain"
|
|
13790
13796
|
}
|
|
13791
13797
|
) }, be);
|
|
13792
13798
|
}
|
|
13793
13799
|
if (V.type === "file") {
|
|
13794
|
-
const
|
|
13800
|
+
const ye = V, ht = ye.name || "file";
|
|
13795
13801
|
return /* @__PURE__ */ u.jsxs(
|
|
13796
13802
|
"a",
|
|
13797
13803
|
{
|
|
13798
|
-
href:
|
|
13799
|
-
onClick: (
|
|
13804
|
+
href: ye.url,
|
|
13805
|
+
onClick: (gt) => G(gt, ye, be),
|
|
13800
13806
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
13801
13807
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
13802
13808
|
children: [
|
|
13803
13809
|
Ne[be] ? /* @__PURE__ */ u.jsx(ua, { className: "h-4 w-4 animate-spin" }) : null,
|
|
13804
13810
|
/* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
13805
|
-
|
|
13811
|
+
ht,
|
|
13806
13812
|
Ne[be] ? " (processing)" : ""
|
|
13807
13813
|
] })
|
|
13808
13814
|
]
|
|
@@ -13811,9 +13817,9 @@ const Bc = z.memo(function({
|
|
|
13811
13817
|
);
|
|
13812
13818
|
}
|
|
13813
13819
|
if (V.type === "interrupt") {
|
|
13814
|
-
const
|
|
13815
|
-
(
|
|
13816
|
-
),
|
|
13820
|
+
const ye = V, ht = Mo(
|
|
13821
|
+
(ye == null ? void 0 : ye.id) ?? (ye == null ? void 0 : ye.interrupt_id)
|
|
13822
|
+
), gt = !!(Te && ht && ht === Te), kt = gt ? je ?? (ye == null ? void 0 : ye.value) : ye == null ? void 0 : ye.value, Pe = ht ? { ...ye, id: ht, interrupt_id: ht } : ye;
|
|
13817
13823
|
return /* @__PURE__ */ u.jsx(
|
|
13818
13824
|
EC,
|
|
13819
13825
|
{
|
|
@@ -13821,8 +13827,8 @@ const Bc = z.memo(function({
|
|
|
13821
13827
|
onApprove: nt,
|
|
13822
13828
|
onReject: jt,
|
|
13823
13829
|
disabled: w,
|
|
13824
|
-
isActive:
|
|
13825
|
-
payload:
|
|
13830
|
+
isActive: gt,
|
|
13831
|
+
payload: kt
|
|
13826
13832
|
},
|
|
13827
13833
|
be
|
|
13828
13834
|
);
|
|
@@ -13843,13 +13849,13 @@ const Bc = z.memo(function({
|
|
|
13843
13849
|
g,
|
|
13844
13850
|
w,
|
|
13845
13851
|
Q
|
|
13846
|
-
]),
|
|
13852
|
+
]), lt = z.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
|
|
13847
13853
|
/* @__PURE__ */ u.jsx(ji, { className: "h-4 w-4 text-muted-foreground" }),
|
|
13848
13854
|
/* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
|
|
13849
|
-
] }), []),
|
|
13855
|
+
] }), []), Tt = z.useCallback(() => {
|
|
13850
13856
|
const V = te.trim().length > 0 || ne.length > 0 || De.length > 0 || Q.length > 0;
|
|
13851
13857
|
if (!J && De.length > 0 && !r)
|
|
13852
|
-
return
|
|
13858
|
+
return lt();
|
|
13853
13859
|
if (!J && !V && !r)
|
|
13854
13860
|
return null;
|
|
13855
13861
|
if (J)
|
|
@@ -13862,11 +13868,11 @@ const Bc = z.memo(function({
|
|
|
13862
13868
|
t.id
|
|
13863
13869
|
);
|
|
13864
13870
|
if (!J && !X) {
|
|
13865
|
-
const be = t,
|
|
13871
|
+
const be = t, ye = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: be.content.map((ht, gt) => /* @__PURE__ */ u.jsx(ut, { part: ht, i: gt }, gt)) });
|
|
13866
13872
|
return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
13867
|
-
|
|
13873
|
+
ye,
|
|
13868
13874
|
/* @__PURE__ */ u.jsx(RC, { className: H })
|
|
13869
|
-
] }) :
|
|
13875
|
+
] }) : ye;
|
|
13870
13876
|
}
|
|
13871
13877
|
}, [
|
|
13872
13878
|
te,
|
|
@@ -13876,33 +13882,33 @@ const Bc = z.memo(function({
|
|
|
13876
13882
|
r,
|
|
13877
13883
|
J,
|
|
13878
13884
|
L,
|
|
13879
|
-
|
|
13885
|
+
lt,
|
|
13880
13886
|
H
|
|
13881
|
-
]),
|
|
13887
|
+
]), bt = at(() => X ? "Assistant" : kC(t), [X, t]), re = z.useMemo(() => X ? [] : Array.isArray(C) ? C : [], [C, X]), we = z.useMemo(() => {
|
|
13882
13888
|
var V;
|
|
13883
13889
|
return re.length ? N && re.some((be) => be.id === N) ? N : ((V = re[0]) == null ? void 0 : V.id) ?? null : null;
|
|
13884
|
-
}, [N, re]),
|
|
13890
|
+
}, [N, re]), He = z.useMemo(() => !re.length || !S ? null : re.some((V) => V.id === S) ? S : null, [S, re]) ?? we, mt = O === "user" && re.length > 0 && typeof k == "function", xe = z.useCallback(
|
|
13885
13891
|
(V) => {
|
|
13886
13892
|
if (!k) return;
|
|
13887
|
-
const be = (V == null ? void 0 : V.id) ?? null,
|
|
13888
|
-
k(be,
|
|
13893
|
+
const be = (V == null ? void 0 : V.id) ?? null, ye = (V == null ? void 0 : V.parentId) ?? I ?? null;
|
|
13894
|
+
k(be, ye);
|
|
13889
13895
|
},
|
|
13890
13896
|
[I, k]
|
|
13891
|
-
),
|
|
13897
|
+
), pe = z.useMemo(() => He ? re.findIndex((V) => V.id === He) : -1, [He, re]), st = z.useMemo(() => pe < 0 ? null : re[pe] ?? null, [pe, re]), _t = z.useCallback((V) => {
|
|
13892
13898
|
const be = [];
|
|
13893
13899
|
if (V.step !== null && be.push(`Step ${V.step}`), V.source && be.push(V.source), !V.createdAt)
|
|
13894
13900
|
return be.length ? be.join(" • ") : V.id.slice(0, 8);
|
|
13895
|
-
let
|
|
13901
|
+
let ye = "";
|
|
13896
13902
|
try {
|
|
13897
|
-
const
|
|
13898
|
-
Number.isNaN(
|
|
13903
|
+
const ht = new Date(V.createdAt);
|
|
13904
|
+
Number.isNaN(ht.getTime()) || (ye = new Intl.DateTimeFormat(void 0, {
|
|
13899
13905
|
hour: "2-digit",
|
|
13900
13906
|
minute: "2-digit"
|
|
13901
|
-
}).format(
|
|
13907
|
+
}).format(ht));
|
|
13902
13908
|
} catch {
|
|
13903
|
-
|
|
13909
|
+
ye = "";
|
|
13904
13910
|
}
|
|
13905
|
-
return `${
|
|
13911
|
+
return `${ye}`;
|
|
13906
13912
|
}, []);
|
|
13907
13913
|
return J && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
13908
13914
|
/* @__PURE__ */ u.jsx("div", { className: Z(Qe(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Z(Je(), p.content), children: [
|
|
@@ -13918,7 +13924,7 @@ const Bc = z.memo(function({
|
|
|
13918
13924
|
children: [
|
|
13919
13925
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
13920
13926
|
Ge(),
|
|
13921
|
-
a &&
|
|
13927
|
+
a && bt && /* @__PURE__ */ u.jsx("span", { className: Z("font-medium", D ? "text-xs" : "text-sm"), children: bt }),
|
|
13922
13928
|
J && /* @__PURE__ */ u.jsxs(
|
|
13923
13929
|
Zf,
|
|
13924
13930
|
{
|
|
@@ -13945,32 +13951,32 @@ const Bc = z.memo(function({
|
|
|
13945
13951
|
)
|
|
13946
13952
|
] }),
|
|
13947
13953
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
13948
|
-
|
|
13954
|
+
mt && st && pe >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
13949
13955
|
/* @__PURE__ */ u.jsx(
|
|
13950
13956
|
"button",
|
|
13951
13957
|
{
|
|
13952
13958
|
type: "button",
|
|
13953
13959
|
className: Z(
|
|
13954
13960
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
13955
|
-
|
|
13961
|
+
pe > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
13956
13962
|
),
|
|
13957
13963
|
onClick: () => {
|
|
13958
|
-
if (
|
|
13959
|
-
const V = re[
|
|
13960
|
-
V &&
|
|
13964
|
+
if (pe <= 0) return;
|
|
13965
|
+
const V = re[pe - 1];
|
|
13966
|
+
V && xe(V);
|
|
13961
13967
|
},
|
|
13962
13968
|
"aria-label": "Previous checkpoint",
|
|
13963
|
-
disabled:
|
|
13969
|
+
disabled: pe <= 0,
|
|
13964
13970
|
children: /* @__PURE__ */ u.jsx(xm, { className: "h-3 w-3" })
|
|
13965
13971
|
}
|
|
13966
13972
|
),
|
|
13967
13973
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
13968
13974
|
/* @__PURE__ */ u.jsxs("span", { className: "whitespace-nowrap", children: [
|
|
13969
|
-
|
|
13975
|
+
pe + 1,
|
|
13970
13976
|
" / ",
|
|
13971
13977
|
re.length
|
|
13972
13978
|
] }),
|
|
13973
|
-
/* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children: _t(
|
|
13979
|
+
/* @__PURE__ */ u.jsx("span", { className: "text-muted-foreground", children: _t(st) })
|
|
13974
13980
|
] }),
|
|
13975
13981
|
/* @__PURE__ */ u.jsx(
|
|
13976
13982
|
"button",
|
|
@@ -13978,15 +13984,15 @@ const Bc = z.memo(function({
|
|
|
13978
13984
|
type: "button",
|
|
13979
13985
|
className: Z(
|
|
13980
13986
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
13981
|
-
|
|
13987
|
+
pe < re.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
13982
13988
|
),
|
|
13983
13989
|
onClick: () => {
|
|
13984
|
-
if (
|
|
13985
|
-
const V = re[
|
|
13986
|
-
V &&
|
|
13990
|
+
if (pe >= re.length - 1) return;
|
|
13991
|
+
const V = re[pe + 1];
|
|
13992
|
+
V && xe(V);
|
|
13987
13993
|
},
|
|
13988
13994
|
"aria-label": "Next checkpoint",
|
|
13989
|
-
disabled:
|
|
13995
|
+
disabled: pe >= re.length - 1,
|
|
13990
13996
|
children: /* @__PURE__ */ u.jsx(Xc, { className: "h-3 w-3" })
|
|
13991
13997
|
}
|
|
13992
13998
|
)
|
|
@@ -14050,7 +14056,7 @@ const Bc = z.memo(function({
|
|
|
14050
14056
|
]
|
|
14051
14057
|
}
|
|
14052
14058
|
),
|
|
14053
|
-
/* @__PURE__ */ u.jsx("div", { className: "relative", children:
|
|
14059
|
+
/* @__PURE__ */ u.jsx("div", { className: "relative", children: Tt() }),
|
|
14054
14060
|
J && L === "expanded" && (ie.toolCallId || ie.name) && /* @__PURE__ */ u.jsxs("div", { className: Z("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", D && "text-xs"), children: [
|
|
14055
14061
|
ie.name && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
14056
14062
|
"Function: ",
|
|
@@ -14380,9 +14386,9 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14380
14386
|
onSelectCheckpoint: E,
|
|
14381
14387
|
timelineCheckpoints: _
|
|
14382
14388
|
}, L) => {
|
|
14383
|
-
const F = Ze(null), j = Ze(null), $ = Ze(!1), [A, B] = ge(!0), D =
|
|
14389
|
+
const F = Ze(null), j = Ze(null), $ = Ze(!1), [A, B] = ge(!0), D = at(() => w ? e.some((Q) => "type" in Q && Q.type === "default_message" ? !1 : Array.isArray(Q == null ? void 0 : Q.content) && Q.content.some(
|
|
14384
14390
|
(se) => se && se.type === "interrupt" && (se.id ?? se.interrupt_id) === w.id
|
|
14385
|
-
)) : !1, [w, e]), O =
|
|
14391
|
+
)) : !1, [w, e]), O = at(() => {
|
|
14386
14392
|
if (!w || D)
|
|
14387
14393
|
return null;
|
|
14388
14394
|
const Q = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
|
|
@@ -14405,7 +14411,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14405
14411
|
}
|
|
14406
14412
|
]
|
|
14407
14413
|
};
|
|
14408
|
-
}, [w, D]), J =
|
|
14414
|
+
}, [w, D]), J = at(() => O ? [...e, O] : e, [e, O]), X = at(() => S ? J : J.filter((Q) => (Q == null ? void 0 : Q.role) !== "tool"), [J, S]), fe = at(() => {
|
|
14409
14415
|
const Q = /* @__PURE__ */ new Set(), se = [];
|
|
14410
14416
|
for (let Te = X.length - 1; Te >= 0; Te--) {
|
|
14411
14417
|
const je = X[Te];
|
|
@@ -14420,7 +14426,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14420
14426
|
return se.reverse();
|
|
14421
14427
|
}, [X]), Ee = Ie((Q) => {
|
|
14422
14428
|
B(Q), m && m(!Q), g && g(Q);
|
|
14423
|
-
}, [m, g]), Ne =
|
|
14429
|
+
}, [m, g]), Ne = at(() => {
|
|
14424
14430
|
if (a)
|
|
14425
14431
|
return async () => {
|
|
14426
14432
|
if (!$.current) {
|
|
@@ -14432,7 +14438,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14432
14438
|
}
|
|
14433
14439
|
}
|
|
14434
14440
|
};
|
|
14435
|
-
}, [a]), G =
|
|
14441
|
+
}, [a]), G = at(() => !x || y ? !1 : A ? "auto" : !1, [A, x, y]), ee = at(() => _ ?? [], [_]), W = I ?? (ee.length ? ee[ee.length - 1].id : null), M = ee.length > 0, H = at(() => {
|
|
14436
14442
|
if (typeof h != "string") return null;
|
|
14437
14443
|
const Q = h.trim();
|
|
14438
14444
|
return Q ? {
|
|
@@ -14508,14 +14514,14 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14508
14514
|
onCancelEdit: () => {
|
|
14509
14515
|
}
|
|
14510
14516
|
}
|
|
14511
|
-
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), De =
|
|
14517
|
+
) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), De = fe.length > 0;
|
|
14512
14518
|
return lm(
|
|
14513
14519
|
L,
|
|
14514
14520
|
() => ({
|
|
14515
14521
|
scrollToLatest: () => {
|
|
14516
14522
|
var Q, se;
|
|
14517
|
-
if (F.current &&
|
|
14518
|
-
const Te =
|
|
14523
|
+
if (F.current && fe.length > 0) {
|
|
14524
|
+
const Te = fe.length - 1;
|
|
14519
14525
|
(se = (Q = F.current).scrollToIndex) == null || se.call(Q, {
|
|
14520
14526
|
index: Te,
|
|
14521
14527
|
align: "end",
|
|
@@ -14525,14 +14531,14 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14525
14531
|
},
|
|
14526
14532
|
scrollToTop: () => {
|
|
14527
14533
|
var Q, se;
|
|
14528
|
-
F.current &&
|
|
14534
|
+
F.current && fe.length > 0 ? (se = (Q = F.current).scrollToIndex) == null || se.call(Q, {
|
|
14529
14535
|
index: 0,
|
|
14530
14536
|
align: "start",
|
|
14531
14537
|
behavior: "auto"
|
|
14532
14538
|
}) : j.current && (j.current.scrollTop = 0);
|
|
14533
14539
|
}
|
|
14534
14540
|
}),
|
|
14535
|
-
[
|
|
14541
|
+
[fe]
|
|
14536
14542
|
), /* @__PURE__ */ u.jsxs("div", { className: ie, style: p, children: [
|
|
14537
14543
|
te,
|
|
14538
14544
|
/* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: De ? /* @__PURE__ */ u.jsx(
|
|
@@ -14544,7 +14550,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14544
14550
|
scrollerRef: (Q) => {
|
|
14545
14551
|
j.current = Q instanceof HTMLDivElement ? Q : null;
|
|
14546
14552
|
},
|
|
14547
|
-
data:
|
|
14553
|
+
data: fe,
|
|
14548
14554
|
followOutput: G,
|
|
14549
14555
|
overscan: 200,
|
|
14550
14556
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
@@ -14562,14 +14568,14 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14562
14568
|
const Te = Hc(se, Q), je = "type" in se && se.type === "default_message";
|
|
14563
14569
|
let Ke = [], ze = null, $e = {}, qe = {}, Ge = null, Qe = null;
|
|
14564
14570
|
if (!je) {
|
|
14565
|
-
const jt = se,
|
|
14571
|
+
const jt = se, ut = jt.checkpointId ?? null;
|
|
14566
14572
|
$e = jt.additionalKwargs ?? {}, qe = jt.responseMetadata ?? {};
|
|
14567
|
-
const
|
|
14568
|
-
Ge = typeof $e.step == "number" ? $e.step : typeof qe.step == "number" ? qe.step : (
|
|
14569
|
-
const
|
|
14570
|
-
Qe =
|
|
14571
|
-
const
|
|
14572
|
-
|
|
14573
|
+
const lt = ut && k ? k.get(ut) ?? null : null;
|
|
14574
|
+
Ge = typeof $e.step == "number" ? $e.step : typeof qe.step == "number" ? qe.step : (lt == null ? void 0 : lt.step) ?? null;
|
|
14575
|
+
const Tt = typeof $e.source == "string" ? $e.source : typeof qe.source == "string" ? qe.source : (lt == null ? void 0 : lt.source) ?? null;
|
|
14576
|
+
Qe = Tt ? String(Tt) : null;
|
|
14577
|
+
const bt = Ge !== null && Qe ? `${Ge}:${Qe}` : null;
|
|
14578
|
+
bt && (N != null && N.has(bt)) ? Ke = N.get(bt) ?? [] : ut && lt && (Ke = [lt]), ze = ut ?? ((nt = Ke[0]) == null ? void 0 : nt.id) ?? null;
|
|
14573
14579
|
}
|
|
14574
14580
|
const Je = (() => {
|
|
14575
14581
|
if (typeof $e.parentCheckpointId == "string")
|
|
@@ -14654,17 +14660,17 @@ function Ai({
|
|
|
14654
14660
|
checkpoints: E,
|
|
14655
14661
|
interrupt: _,
|
|
14656
14662
|
metadata: L
|
|
14657
|
-
} = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), D = g ?? m ?? null, O = (I == null ? void 0 : I.id) ?? null, J = (I == null ? void 0 : I.namespace) ?? null, X = (L == null ? void 0 : L.assemblingMessageId) ?? null,
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
}, [
|
|
14663
|
+
} = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), D = g ?? m ?? null, O = (I == null ? void 0 : I.id) ?? null, J = (I == null ? void 0 : I.namespace) ?? null, X = (L == null ? void 0 : L.assemblingMessageId) ?? null, fe = _, [Ee, Ne] = ge(!1);
|
|
14664
|
+
Ct(() => {
|
|
14665
|
+
fe || Ne(!1);
|
|
14666
|
+
}, [fe]);
|
|
14661
14667
|
const G = Ie(() => {
|
|
14662
14668
|
Ne(!0);
|
|
14663
14669
|
}, []), ee = Ie(() => {
|
|
14664
14670
|
Ne(!1);
|
|
14665
|
-
}, []), W = !!
|
|
14666
|
-
Uc.value = q,
|
|
14667
|
-
}, []), [V, be] = ge(!1),
|
|
14671
|
+
}, []), W = !!fe || Ee, [M, H] = ge(null), [te, ie] = ge(""), [ne, De] = ge(null), [Q, se] = ge(null), [Te, je] = ge([]), [Ke, ze] = ge(0), [$e, qe] = ge(0), [Ge, Qe] = ge(!1), [Je, nt] = ge(null), [jt, ut] = ge(null), [lt, Tt] = ge(!1), [bt, re] = ge(null), [we, Be] = ge(!1), He = Ze(!1), [mt, xe] = ge(() => Uc.value), pe = Ze(mt), st = Ze(null), _t = Ie((q) => {
|
|
14672
|
+
Uc.value = q, xe(q);
|
|
14673
|
+
}, []), [V, be] = ge(!1), ye = Ze(null), ht = Ie((q) => {
|
|
14668
14674
|
if (!Array.isArray(q))
|
|
14669
14675
|
return { text: null, messageId: null };
|
|
14670
14676
|
for (let oe = q.length - 1; oe >= 0; oe--) {
|
|
@@ -14677,25 +14683,25 @@ function Ai({
|
|
|
14677
14683
|
};
|
|
14678
14684
|
}
|
|
14679
14685
|
return { text: null, messageId: null };
|
|
14680
|
-
}, []),
|
|
14686
|
+
}, []), gt = Ie(
|
|
14681
14687
|
(q, oe) => {
|
|
14682
14688
|
if (!q || typeof q != "object") return null;
|
|
14683
14689
|
const le = q[oe];
|
|
14684
14690
|
return typeof le == "number" ? le : null;
|
|
14685
14691
|
},
|
|
14686
14692
|
[]
|
|
14687
|
-
),
|
|
14693
|
+
), kt = Ie(
|
|
14688
14694
|
(q, oe) => {
|
|
14689
14695
|
if (!q || typeof q != "object") return null;
|
|
14690
14696
|
const le = q[oe];
|
|
14691
14697
|
return typeof le == "string" && le.trim() ? le : null;
|
|
14692
14698
|
},
|
|
14693
14699
|
[]
|
|
14694
|
-
), Pe =
|
|
14700
|
+
), Pe = at(() => {
|
|
14695
14701
|
const q = (Ce) => {
|
|
14696
14702
|
if (!Array.isArray(Ce) || Ce.length === 0)
|
|
14697
14703
|
return null;
|
|
14698
|
-
const
|
|
14704
|
+
const dt = Ce.map((Xe) => {
|
|
14699
14705
|
if (typeof Xe == "string")
|
|
14700
14706
|
return Xe.trim();
|
|
14701
14707
|
if (Xe && typeof Xe == "object" && "type" in Xe) {
|
|
@@ -14705,69 +14711,69 @@ function Ai({
|
|
|
14705
14711
|
}
|
|
14706
14712
|
return null;
|
|
14707
14713
|
}).filter((Xe) => !!(Xe && Xe.length));
|
|
14708
|
-
return
|
|
14714
|
+
return dt.length ? dt.join(", ") : null;
|
|
14709
14715
|
}, oe = Array.isArray(E) ? E.map((Ce) => {
|
|
14710
|
-
const
|
|
14711
|
-
return
|
|
14716
|
+
const dt = q(Ce.next);
|
|
14717
|
+
return dt ? {
|
|
14712
14718
|
...Ce,
|
|
14713
14719
|
metadata: {
|
|
14714
14720
|
...Ce.metadata ?? {},
|
|
14715
|
-
next:
|
|
14721
|
+
next: dt
|
|
14716
14722
|
}
|
|
14717
14723
|
} : Ce;
|
|
14718
14724
|
}) : [];
|
|
14719
|
-
return oe.some((Ce) =>
|
|
14720
|
-
const Xe =
|
|
14725
|
+
return oe.some((Ce) => gt(Ce.metadata, "step") !== null) && oe.sort((Ce, dt) => {
|
|
14726
|
+
const Xe = gt(Ce.metadata, "step"), tt = gt(dt.metadata, "step");
|
|
14721
14727
|
if (Xe !== null || tt !== null)
|
|
14722
14728
|
return (tt ?? Number.NEGATIVE_INFINITY) - (Xe ?? Number.NEGATIVE_INFINITY);
|
|
14723
|
-
const Mt = Date.parse(Ce.createdAt ?? ""), tn = Date.parse(
|
|
14729
|
+
const Mt = Date.parse(Ce.createdAt ?? ""), tn = Date.parse(dt.createdAt ?? "");
|
|
14724
14730
|
return Number.isNaN(Mt) || Number.isNaN(tn) ? 0 : tn - Mt;
|
|
14725
14731
|
}), oe;
|
|
14726
|
-
}, [E,
|
|
14732
|
+
}, [E, gt]), { checkpointMetaById: Vt, checkpointIndexByKey: ct } = at(() => {
|
|
14727
14733
|
const q = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
|
|
14728
14734
|
for (const le of Pe) {
|
|
14729
14735
|
const Ce = le.checkpointId ?? null;
|
|
14730
14736
|
if (!Ce) continue;
|
|
14731
|
-
const
|
|
14737
|
+
const dt = gt(le.metadata, "step"), Xe = kt(le.metadata, "source"), tt = {
|
|
14732
14738
|
id: Ce,
|
|
14733
|
-
step:
|
|
14739
|
+
step: dt,
|
|
14734
14740
|
source: Xe,
|
|
14735
14741
|
createdAt: le.createdAt ?? null,
|
|
14736
14742
|
namespace: le.checkpointNs ?? null,
|
|
14737
14743
|
parentId: le.parentId ?? null
|
|
14738
14744
|
};
|
|
14739
|
-
if (q.set(Ce, tt),
|
|
14740
|
-
const Mt = `${
|
|
14745
|
+
if (q.set(Ce, tt), dt !== null && Xe) {
|
|
14746
|
+
const Mt = `${dt}:${Xe}`, tn = oe.get(Mt) ?? [];
|
|
14741
14747
|
tn.push(tt), oe.set(Mt, tn);
|
|
14742
14748
|
}
|
|
14743
14749
|
}
|
|
14744
14750
|
for (const le of oe.values())
|
|
14745
|
-
le.sort((Ce,
|
|
14751
|
+
le.sort((Ce, dt) => {
|
|
14746
14752
|
const Xe = Ce.createdAt ?? "";
|
|
14747
|
-
return (
|
|
14753
|
+
return (dt.createdAt ?? "").localeCompare(Xe);
|
|
14748
14754
|
});
|
|
14749
14755
|
return { checkpointMetaById: q, checkpointIndexByKey: oe };
|
|
14750
|
-
}, [Pe,
|
|
14756
|
+
}, [Pe, gt, kt]), Rt = at(() => {
|
|
14751
14757
|
var Xe;
|
|
14752
14758
|
if (!Pe.length) return [];
|
|
14753
14759
|
const q = [...Pe].reverse(), oe = (tt, Mt) => {
|
|
14754
14760
|
const tn = tt.checkpointId ?? null;
|
|
14755
14761
|
if (!tn) return null;
|
|
14756
|
-
const Zn =
|
|
14757
|
-
|
|
14758
|
-
const { text: ll, messageId: nm } =
|
|
14762
|
+
const Zn = kt(tt.metadata, "source");
|
|
14763
|
+
kt(tt.metadata, "next");
|
|
14764
|
+
const { text: ll, messageId: nm } = ht(tt.messages), oi = ll && ll.replace(/\s+/g, " ").trim() || kt(tt.metadata, "title") || kt(tt.metadata, "label") || Mt || Zn || "Checkpoint", rm = oi.length > 60 ? `${oi.slice(0, 57)}…` : oi;
|
|
14759
14765
|
return {
|
|
14760
14766
|
id: tn,
|
|
14761
14767
|
label: rm,
|
|
14762
14768
|
messageId: nm ?? null,
|
|
14763
14769
|
createdAt: tt.createdAt ?? null,
|
|
14764
|
-
step:
|
|
14770
|
+
step: gt(tt.metadata, "step"),
|
|
14765
14771
|
source: Zn ?? null,
|
|
14766
|
-
next:
|
|
14772
|
+
next: kt(tt.metadata, "next")
|
|
14767
14773
|
};
|
|
14768
14774
|
}, le = [], Ce = /* @__PURE__ */ new Set();
|
|
14769
14775
|
for (const tt of q) {
|
|
14770
|
-
const Mt = ((Xe =
|
|
14776
|
+
const Mt = ((Xe = kt(tt.metadata, "source")) == null ? void 0 : Xe.toLowerCase()) ?? null;
|
|
14771
14777
|
if (!(Mt === "input" || Mt === "user_input" || Mt === "user")) continue;
|
|
14772
14778
|
const Zn = oe(tt, "User input");
|
|
14773
14779
|
Zn && !Ce.has(Zn.id) && (le.push(Zn), Ce.add(Zn.id));
|
|
@@ -14777,16 +14783,16 @@ function Ai({
|
|
|
14777
14783
|
const Mt = oe(tt);
|
|
14778
14784
|
Mt && !Ce.has(Mt.id) && (le.push(Mt), Ce.add(Mt.id));
|
|
14779
14785
|
}
|
|
14780
|
-
const
|
|
14786
|
+
const dt = Pe.find((tt) => {
|
|
14781
14787
|
var tn;
|
|
14782
|
-
return (((tn =
|
|
14788
|
+
return (((tn = kt(tt.metadata, "source")) == null ? void 0 : tn.toLowerCase()) ?? null) === "loop";
|
|
14783
14789
|
});
|
|
14784
|
-
if (
|
|
14785
|
-
const tt = oe(
|
|
14790
|
+
if (dt) {
|
|
14791
|
+
const tt = oe(dt, "Latest loop");
|
|
14786
14792
|
tt && !Ce.has(tt.id) && (le.push(tt), Ce.add(tt.id));
|
|
14787
14793
|
}
|
|
14788
14794
|
return le;
|
|
14789
|
-
}, [Pe,
|
|
14795
|
+
}, [Pe, ht, gt, kt]), Dn = Ze(null), Jn = Ze(null), Ln = Ie(() => {
|
|
14790
14796
|
Dn.current && (Dn.current.value = ""), Jn.current && (Jn.current.value = ""), ze((q) => q + 1), qe((q) => q + 1);
|
|
14791
14797
|
}, []), ti = Ie(
|
|
14792
14798
|
(q) => {
|
|
@@ -14794,26 +14800,26 @@ function Ai({
|
|
|
14794
14800
|
},
|
|
14795
14801
|
[_t]
|
|
14796
14802
|
), So = Ze(!1);
|
|
14797
|
-
|
|
14803
|
+
Ct(() => {
|
|
14798
14804
|
So.current && !F && (je([]), Ln()), So.current = F;
|
|
14799
14805
|
}, [F, Ln]);
|
|
14800
14806
|
const [ni, ri] = ge("desktop");
|
|
14801
|
-
|
|
14807
|
+
Ct(() => {
|
|
14802
14808
|
const q = () => {
|
|
14803
14809
|
const oe = window.innerWidth;
|
|
14804
14810
|
ri(oe < 640 ? "phone" : oe < 1024 ? "tablet" : "desktop");
|
|
14805
14811
|
};
|
|
14806
14812
|
return q(), window.addEventListener("resize", q), () => window.removeEventListener("resize", q);
|
|
14807
|
-
}, []),
|
|
14808
|
-
|
|
14809
|
-
}, [D]),
|
|
14810
|
-
|
|
14811
|
-
}, [
|
|
14813
|
+
}, []), Ct(() => {
|
|
14814
|
+
Be(!1), He.current = !1;
|
|
14815
|
+
}, [D]), Ct(() => {
|
|
14816
|
+
pe.current = mt;
|
|
14817
|
+
}, [mt]), Ct(() => {
|
|
14812
14818
|
if (!M) {
|
|
14813
|
-
|
|
14819
|
+
st.current = null;
|
|
14814
14820
|
return;
|
|
14815
14821
|
}
|
|
14816
|
-
|
|
14822
|
+
st.current === null && (st.current = pe.current), _t(te ?? "");
|
|
14817
14823
|
}, [te, M, _t]);
|
|
14818
14824
|
const R = Ie(async () => {
|
|
14819
14825
|
if (!(!b || T || !we))
|
|
@@ -14823,7 +14829,7 @@ function Ai({
|
|
|
14823
14829
|
console.warn("loadOlder failed", q);
|
|
14824
14830
|
}
|
|
14825
14831
|
}, [b, we, T, S]);
|
|
14826
|
-
|
|
14832
|
+
Ct(() => {
|
|
14827
14833
|
(async () => {
|
|
14828
14834
|
if (!y.baseUrl) {
|
|
14829
14835
|
re(null);
|
|
@@ -14836,9 +14842,9 @@ function Ai({
|
|
|
14836
14842
|
console.warn("Failed to fetch default message:", oe), re(null);
|
|
14837
14843
|
}
|
|
14838
14844
|
})();
|
|
14839
|
-
}, [y.baseUrl]),
|
|
14840
|
-
j && !
|
|
14841
|
-
}, [j,
|
|
14845
|
+
}, [y.baseUrl]), Ct(() => {
|
|
14846
|
+
j && !lt && (x == null || x(j));
|
|
14847
|
+
}, [j, lt, x]);
|
|
14842
14848
|
const K = (q) => {
|
|
14843
14849
|
if (q.length > Wo)
|
|
14844
14850
|
return `Message too long (${q.length}/${Wo} characters)`;
|
|
@@ -14858,7 +14864,7 @@ function Ai({
|
|
|
14858
14864
|
}
|
|
14859
14865
|
}
|
|
14860
14866
|
try {
|
|
14861
|
-
const le = O ?? void 0, Ce = J ?? void 0,
|
|
14867
|
+
const le = O ?? void 0, Ce = J ?? void 0, dt = M ? {
|
|
14862
14868
|
edit: !0,
|
|
14863
14869
|
originalMessageId: M,
|
|
14864
14870
|
...ne != null && ne.checkpointId ? { originalCheckpointId: ne.checkpointId } : {},
|
|
@@ -14868,7 +14874,7 @@ function Ai({
|
|
|
14868
14874
|
{
|
|
14869
14875
|
text: oe || "",
|
|
14870
14876
|
attachments: Te,
|
|
14871
|
-
messageAdditionalKwargs:
|
|
14877
|
+
messageAdditionalKwargs: dt
|
|
14872
14878
|
},
|
|
14873
14879
|
{
|
|
14874
14880
|
checkpointId: le,
|
|
@@ -14882,31 +14888,31 @@ function Ai({
|
|
|
14882
14888
|
}
|
|
14883
14889
|
}, Se = z.useCallback(
|
|
14884
14890
|
(q, oe, le) => {
|
|
14885
|
-
c && (
|
|
14891
|
+
c && (st.current = mt, H(q), ie(oe), _t(oe), se(null), De({
|
|
14886
14892
|
checkpointId: (le == null ? void 0 : le.checkpointId) ?? null,
|
|
14887
14893
|
checkpointNs: (le == null ? void 0 : le.checkpointNs) ?? null
|
|
14888
14894
|
}));
|
|
14889
14895
|
},
|
|
14890
|
-
[
|
|
14896
|
+
[mt, c, _t]
|
|
14891
14897
|
), Ye = z.useCallback(() => {
|
|
14892
|
-
H(null), ie(""), De(null), se(null), _t(
|
|
14893
|
-
}, [
|
|
14898
|
+
H(null), ie(""), De(null), se(null), _t(st.current ?? mt), st.current = null;
|
|
14899
|
+
}, [mt, _t]), it = Ie(
|
|
14894
14900
|
(q, oe, le) => {
|
|
14895
14901
|
Se(q, oe, le);
|
|
14896
14902
|
},
|
|
14897
14903
|
[Se]
|
|
14898
|
-
),
|
|
14904
|
+
), Ue = Ie((q) => {
|
|
14899
14905
|
for (let oe = q - 1; oe >= 0; oe--)
|
|
14900
14906
|
if (w[oe].role === "user") {
|
|
14901
|
-
const le = w[oe].content || [],
|
|
14907
|
+
const le = w[oe].content || [], dt = le.filter((Xe) => Xe.type === "text").map((Xe) => Xe.text).join("") || (() => {
|
|
14902
14908
|
try {
|
|
14903
14909
|
return JSON.stringify(le, null, 2);
|
|
14904
14910
|
} catch {
|
|
14905
14911
|
return String(le);
|
|
14906
14912
|
}
|
|
14907
14913
|
})();
|
|
14908
|
-
|
|
14909
|
-
{ text:
|
|
14914
|
+
dt && A(
|
|
14915
|
+
{ text: dt },
|
|
14910
14916
|
{
|
|
14911
14917
|
checkpointId: O ?? void 0,
|
|
14912
14918
|
checkpointNs: J ?? void 0
|
|
@@ -14919,13 +14925,13 @@ function Ai({
|
|
|
14919
14925
|
je((le) => [...le, ...oe]), q.target.value = "";
|
|
14920
14926
|
}, Ot = (q) => {
|
|
14921
14927
|
je((oe) => {
|
|
14922
|
-
const le = oe.filter((Ce,
|
|
14928
|
+
const le = oe.filter((Ce, dt) => q !== dt);
|
|
14923
14929
|
return le.length === 0 && Ln(), le;
|
|
14924
14930
|
});
|
|
14925
|
-
},
|
|
14931
|
+
}, St = async (q) => {
|
|
14926
14932
|
const oe = (q.target.files || [])[0];
|
|
14927
14933
|
if (oe) {
|
|
14928
|
-
nt(null),
|
|
14934
|
+
nt(null), ut(null), Qe(!0);
|
|
14929
14935
|
try {
|
|
14930
14936
|
await A(
|
|
14931
14937
|
{ attachments: [oe] },
|
|
@@ -14935,7 +14941,7 @@ function Ai({
|
|
|
14935
14941
|
}
|
|
14936
14942
|
);
|
|
14937
14943
|
const le = `Uploaded ${oe.name} - processing through chat stream`;
|
|
14938
|
-
|
|
14944
|
+
ut(le);
|
|
14939
14945
|
} catch (le) {
|
|
14940
14946
|
const Ce = le instanceof Error ? le.message : "Failed to upload Excel file";
|
|
14941
14947
|
console.error("Excel upload failed", le), nt(Ce), x == null || x(Ce);
|
|
@@ -14943,21 +14949,21 @@ function Ai({
|
|
|
14943
14949
|
Qe(!1), q.target.value = "", Ln();
|
|
14944
14950
|
}
|
|
14945
14951
|
}
|
|
14946
|
-
},
|
|
14952
|
+
}, vt = async (q) => {
|
|
14947
14953
|
if (m) {
|
|
14948
14954
|
be(!0);
|
|
14949
14955
|
try {
|
|
14950
14956
|
if (!q) {
|
|
14951
|
-
await N(),
|
|
14957
|
+
await N(), Be(!1), requestAnimationFrame(() => {
|
|
14952
14958
|
var Ce;
|
|
14953
|
-
(Ce =
|
|
14959
|
+
(Ce = ye.current) == null || Ce.scrollToLatest();
|
|
14954
14960
|
});
|
|
14955
14961
|
return;
|
|
14956
14962
|
}
|
|
14957
14963
|
const oe = Pe.find((Ce) => Ce.checkpointId === q), le = (oe == null ? void 0 : oe.checkpointNs) ?? null;
|
|
14958
|
-
await k(q, le),
|
|
14964
|
+
await k(q, le), Be(!0), requestAnimationFrame(() => {
|
|
14959
14965
|
var Ce;
|
|
14960
|
-
(Ce =
|
|
14966
|
+
(Ce = ye.current) == null || Ce.scrollToTop();
|
|
14961
14967
|
});
|
|
14962
14968
|
} finally {
|
|
14963
14969
|
be(!1);
|
|
@@ -14965,29 +14971,29 @@ function Ai({
|
|
|
14965
14971
|
}
|
|
14966
14972
|
}, Kt = Ie(
|
|
14967
14973
|
async (q) => {
|
|
14968
|
-
await
|
|
14974
|
+
await vt(q);
|
|
14969
14975
|
},
|
|
14970
|
-
[
|
|
14976
|
+
[vt]
|
|
14971
14977
|
), Fn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${f.container || ""}`, Nn = `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 ${f.messagesArea || ""}`, Ft = `flex-shrink-0 w-full border-t p-4 bg-transparent ${f.inputArea || ""}`, Dr = Ie(
|
|
14972
14978
|
(q) => {
|
|
14973
14979
|
if (!q)
|
|
14974
14980
|
return "Latest";
|
|
14975
14981
|
const oe = [];
|
|
14976
14982
|
q.step !== null && oe.push(`Step ${q.step}`), q.source && oe.push(q.source);
|
|
14977
|
-
const le = q.createdAt ? new Date(q.createdAt) : null, Ce = le && !Number.isNaN(le.getTime()) ? le.toLocaleString() : q.createdAt ?? q.id,
|
|
14978
|
-
return `${Ce}${
|
|
14983
|
+
const le = q.createdAt ? new Date(q.createdAt) : null, Ce = le && !Number.isNaN(le.getTime()) ? le.toLocaleString() : q.createdAt ?? q.id, dt = oe.length ? ` — ${oe.join(" • ")}` : "";
|
|
14984
|
+
return `${Ce}${dt}`;
|
|
14979
14985
|
},
|
|
14980
14986
|
[]
|
|
14981
14987
|
);
|
|
14982
14988
|
return /* @__PURE__ */ u.jsxs("div", { className: Fn, children: [
|
|
14983
|
-
!!j && !
|
|
14989
|
+
!!j && !lt && /* @__PURE__ */ u.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: [
|
|
14984
14990
|
/* @__PURE__ */ u.jsx("span", { children: j }),
|
|
14985
14991
|
/* @__PURE__ */ u.jsx(
|
|
14986
14992
|
rt,
|
|
14987
14993
|
{
|
|
14988
14994
|
variant: "ghost",
|
|
14989
14995
|
size: "sm",
|
|
14990
|
-
onClick: () =>
|
|
14996
|
+
onClick: () => Tt(!0),
|
|
14991
14997
|
className: "text-red-800 hover:bg-red-100",
|
|
14992
14998
|
"aria-label": "Dismiss error",
|
|
14993
14999
|
children: /* @__PURE__ */ u.jsx(vr, { size: 16 })
|
|
@@ -15003,7 +15009,7 @@ function Ai({
|
|
|
15003
15009
|
value: O ?? "",
|
|
15004
15010
|
onChange: (q) => {
|
|
15005
15011
|
const oe = q.target.value || null;
|
|
15006
|
-
|
|
15012
|
+
vt(oe);
|
|
15007
15013
|
},
|
|
15008
15014
|
children: [
|
|
15009
15015
|
/* @__PURE__ */ u.jsx("option", { value: "", children: "Latest" }),
|
|
@@ -15024,7 +15030,7 @@ function Ai({
|
|
|
15024
15030
|
/* @__PURE__ */ u.jsx(
|
|
15025
15031
|
Mp,
|
|
15026
15032
|
{
|
|
15027
|
-
ref:
|
|
15033
|
+
ref: ye,
|
|
15028
15034
|
className: "h-full",
|
|
15029
15035
|
style: { height: "100%" },
|
|
15030
15036
|
messages: w,
|
|
@@ -15039,27 +15045,27 @@ function Ai({
|
|
|
15039
15045
|
we && R();
|
|
15040
15046
|
},
|
|
15041
15047
|
onScrollAway: (q) => {
|
|
15042
|
-
if (!
|
|
15043
|
-
|
|
15048
|
+
if (!He.current) {
|
|
15049
|
+
He.current = !0;
|
|
15044
15050
|
return;
|
|
15045
15051
|
}
|
|
15046
|
-
q &&
|
|
15052
|
+
q && Be(!0);
|
|
15047
15053
|
},
|
|
15048
|
-
onEdit:
|
|
15049
|
-
onRegenerate:
|
|
15054
|
+
onEdit: it,
|
|
15055
|
+
onRegenerate: Ue,
|
|
15050
15056
|
onCancelEdit: Ye,
|
|
15051
|
-
emptyMessage:
|
|
15057
|
+
emptyMessage: bt ?? void 0,
|
|
15052
15058
|
isNavigatingCheckpoint: V,
|
|
15053
|
-
activeInterrupt:
|
|
15059
|
+
activeInterrupt: fe,
|
|
15054
15060
|
disableInterruptActions: Ee,
|
|
15055
15061
|
onInterruptActionStart: G,
|
|
15056
15062
|
onInterruptActionEnd: ee,
|
|
15057
15063
|
showToolMessages: d,
|
|
15058
15064
|
checkpointMetaById: Vt,
|
|
15059
|
-
checkpointIndexByKey:
|
|
15065
|
+
checkpointIndexByKey: ct,
|
|
15060
15066
|
activeCheckpointId: O,
|
|
15061
15067
|
onSelectCheckpoint: Kt,
|
|
15062
|
-
timelineCheckpoints:
|
|
15068
|
+
timelineCheckpoints: Rt
|
|
15063
15069
|
}
|
|
15064
15070
|
),
|
|
15065
15071
|
($ === "reconnecting" || $ === "connecting") && /* @__PURE__ */ u.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__ */ u.jsxs("span", { className: "flex items-center gap-2", children: [
|
|
@@ -15131,7 +15137,7 @@ function Ai({
|
|
|
15131
15137
|
ref: Jn,
|
|
15132
15138
|
type: "file",
|
|
15133
15139
|
accept: ".xls,.xlsx,.xlsm",
|
|
15134
|
-
onChange:
|
|
15140
|
+
onChange: St,
|
|
15135
15141
|
className: "hidden"
|
|
15136
15142
|
},
|
|
15137
15143
|
$e
|
|
@@ -15188,7 +15194,7 @@ function Ai({
|
|
|
15188
15194
|
{
|
|
15189
15195
|
initialValue: te,
|
|
15190
15196
|
editingMessageId: M,
|
|
15191
|
-
value:
|
|
15197
|
+
value: mt,
|
|
15192
15198
|
onValueChange: ti,
|
|
15193
15199
|
placeholder: M ? "Edit your message..." : t,
|
|
15194
15200
|
isStreaming: F,
|
|
@@ -15785,14 +15791,14 @@ function Kc({
|
|
|
15785
15791
|
isLoading: x,
|
|
15786
15792
|
actions: y
|
|
15787
15793
|
} = xa(), { loadThread: m } = ya(), { createThread: g, deleteThread: w, renameThread: b } = y, [T, C] = ge(Array.isArray(f) ? f : []), S = Ze(T.length > 0), k = Ze(null), N = Ze(0), [I, E] = ge(null), [_, L] = ge(""), [F, j] = ge(!1);
|
|
15788
|
-
|
|
15794
|
+
Ct(() => {
|
|
15789
15795
|
const G = Array.isArray(f) ? f : [];
|
|
15790
15796
|
if (G.length > 0) {
|
|
15791
15797
|
S.current = !0, C(G);
|
|
15792
15798
|
return;
|
|
15793
15799
|
}
|
|
15794
15800
|
x || (S.current = !1, C(G));
|
|
15795
|
-
}, [f, x]),
|
|
15801
|
+
}, [f, x]), Ct(() => {
|
|
15796
15802
|
if (!k.current) return;
|
|
15797
15803
|
const G = k.current.querySelector(
|
|
15798
15804
|
"[data-radix-scroll-area-viewport]"
|
|
@@ -15848,7 +15854,7 @@ function Kc({
|
|
|
15848
15854
|
E(null), L("");
|
|
15849
15855
|
}, X = (G, ee) => {
|
|
15850
15856
|
G.key === "Enter" ? O(ee) : G.key === "Escape" && J();
|
|
15851
|
-
},
|
|
15857
|
+
}, fe = (G) => {
|
|
15852
15858
|
if (!G) return "";
|
|
15853
15859
|
try {
|
|
15854
15860
|
const ee = new Date(G), M = (/* @__PURE__ */ new Date()).getTime() - ee.getTime(), H = Math.floor(M / (1e3 * 60 * 60 * 24));
|
|
@@ -15900,7 +15906,7 @@ function Kc({
|
|
|
15900
15906
|
/* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ne(G) }),
|
|
15901
15907
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
15902
15908
|
/* @__PURE__ */ u.jsx(Cm, { size: 10 }),
|
|
15903
|
-
/* @__PURE__ */ u.jsx("span", { children:
|
|
15909
|
+
/* @__PURE__ */ u.jsx("span", { children: fe(G.updatedAt || G.createdAt) })
|
|
15904
15910
|
] })
|
|
15905
15911
|
] }) }),
|
|
15906
15912
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
@@ -16461,7 +16467,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
|
|
|
16461
16467
|
const [J, X] = Lh((W) => {
|
|
16462
16468
|
const M = L().filter((ie) => !ie.disabled), H = M.find((ie) => ie.ref.current === document.activeElement), te = Fh(M, W, H);
|
|
16463
16469
|
te && setTimeout(() => te.ref.current.focus());
|
|
16464
|
-
}),
|
|
16470
|
+
}), fe = v.useCallback(
|
|
16465
16471
|
(W, M, H) => {
|
|
16466
16472
|
const te = !$.current && !H;
|
|
16467
16473
|
(w.value !== void 0 && w.value === M || te) && (I(W), te && ($.current = !0));
|
|
@@ -16492,7 +16498,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
|
|
|
16492
16498
|
content: b,
|
|
16493
16499
|
viewport: C,
|
|
16494
16500
|
onViewportChange: S,
|
|
16495
|
-
itemRefCallback:
|
|
16501
|
+
itemRefCallback: fe,
|
|
16496
16502
|
selectedItem: N,
|
|
16497
16503
|
onItemLeave: Ee,
|
|
16498
16504
|
itemTextRefCallback: Ne,
|
|
@@ -16586,7 +16592,7 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
|
|
|
16586
16592
|
]);
|
|
16587
16593
|
a.style.minWidth = Q + "px", a.style.right = je + "px";
|
|
16588
16594
|
}
|
|
16589
|
-
const _ = p(), L = window.innerHeight - dn * 2, F = y.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), O = $ + A + F + D + B, J = Math.min(m.offsetHeight * 5, O), X = window.getComputedStyle(y),
|
|
16595
|
+
const _ = p(), L = window.innerHeight - dn * 2, F = y.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), O = $ + A + F + D + B, J = Math.min(m.offsetHeight * 5, O), X = window.getComputedStyle(y), fe = parseInt(X.paddingTop, 10), Ee = parseInt(X.paddingBottom, 10), Ne = k.top + k.height / 2 - dn, G = L - Ne, ee = m.offsetHeight / 2, W = m.offsetTop + ee, M = $ + A + W, H = O - M;
|
|
16590
16596
|
if (M <= Ne) {
|
|
16591
16597
|
const ie = _.length > 0 && m === _[_.length - 1].ref.current;
|
|
16592
16598
|
a.style.bottom = "0px";
|
|
@@ -16602,7 +16608,7 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
|
|
|
16602
16608
|
const De = Math.max(
|
|
16603
16609
|
Ne,
|
|
16604
16610
|
$ + y.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
16605
|
-
(ie ?
|
|
16611
|
+
(ie ? fe : 0) + ee
|
|
16606
16612
|
) + H;
|
|
16607
16613
|
a.style.height = De + "px", y.scrollTop = M - Ne + y.offsetTop;
|
|
16608
16614
|
}
|
|
@@ -17259,10 +17265,10 @@ const HT = {
|
|
|
17259
17265
|
};
|
|
17260
17266
|
function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
17261
17267
|
const [r, o] = ge(!1), [s, i] = ge(!1), [a, l] = ge(e), [c, d] = ge(!1), { toast: f } = Xa();
|
|
17262
|
-
|
|
17268
|
+
Ct(() => {
|
|
17263
17269
|
const m = JSON.stringify(a) !== JSON.stringify(e);
|
|
17264
17270
|
d(m);
|
|
17265
|
-
}, [a, e]),
|
|
17271
|
+
}, [a, e]), Ct(() => {
|
|
17266
17272
|
l(e);
|
|
17267
17273
|
}, [e]);
|
|
17268
17274
|
const p = () => {
|