teodor-new-chat-ui 4.3.235 → 4.3.236
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 +729 -744
- package/dist/index.umd.js +32 -32
- 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
|
|
5
|
+
import z, { createContext as co, useContext as xs, useRef as Je, useCallback as Ce, useReducer as im, useEffect as Et, 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";
|
|
@@ -64,12 +64,12 @@ function Dm() {
|
|
|
64
64
|
}
|
|
65
65
|
function b(R, K, ie) {
|
|
66
66
|
{
|
|
67
|
-
var we = g.ReactDebugCurrentFrame,
|
|
68
|
-
|
|
69
|
-
var
|
|
67
|
+
var we = g.ReactDebugCurrentFrame, Ge = we.getStackAddendum();
|
|
68
|
+
Ge !== "" && (K += "%s", ie = ie.concat([Ge]));
|
|
69
|
+
var it = ie.map(function(He) {
|
|
70
70
|
return String(He);
|
|
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, E;
|
|
@@ -85,8 +85,8 @@ function Dm() {
|
|
|
85
85
|
var we = R.displayName;
|
|
86
86
|
if (we)
|
|
87
87
|
return we;
|
|
88
|
-
var
|
|
89
|
-
return
|
|
88
|
+
var Ge = K.displayName || K.name || "";
|
|
89
|
+
return Ge !== "" ? ie + "(" + Ge + ")" : ie;
|
|
90
90
|
}
|
|
91
91
|
function L(R) {
|
|
92
92
|
return R.displayName || "Context";
|
|
@@ -126,9 +126,9 @@ function Dm() {
|
|
|
126
126
|
var we = R.displayName || null;
|
|
127
127
|
return we !== null ? we : F(R.type) || "Memo";
|
|
128
128
|
case p: {
|
|
129
|
-
var
|
|
129
|
+
var Ge = R, it = Ge._payload, He = Ge._init;
|
|
130
130
|
try {
|
|
131
|
-
return F(He(
|
|
131
|
+
return F(He(it));
|
|
132
132
|
} catch {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -140,7 +140,7 @@ function Dm() {
|
|
|
140
140
|
function Re() {
|
|
141
141
|
}
|
|
142
142
|
Re.__reactDisabledLog = !0;
|
|
143
|
-
function
|
|
143
|
+
function Ee() {
|
|
144
144
|
{
|
|
145
145
|
if ($ === 0) {
|
|
146
146
|
A = console.log, B = console.info, D = console.warn, M = console.error, Z = console.group, J = console.groupCollapsed, pe = console.groupEnd;
|
|
@@ -163,7 +163,7 @@ function Dm() {
|
|
|
163
163
|
$++;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function W() {
|
|
167
167
|
{
|
|
168
168
|
if ($--, $ === 0) {
|
|
169
169
|
var R = {
|
|
@@ -204,8 +204,8 @@ function Dm() {
|
|
|
204
204
|
if (q === void 0)
|
|
205
205
|
try {
|
|
206
206
|
throw Error();
|
|
207
|
-
} catch (
|
|
208
|
-
var we =
|
|
207
|
+
} catch (Ge) {
|
|
208
|
+
var we = Ge.stack.trim().match(/\n( *(at )?)/);
|
|
209
209
|
q = we && we[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
@@ -227,10 +227,10 @@ function Dm() {
|
|
|
227
227
|
}
|
|
228
228
|
var we;
|
|
229
229
|
H = !0;
|
|
230
|
-
var
|
|
230
|
+
var Ge = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
|
-
var
|
|
233
|
-
|
|
232
|
+
var it;
|
|
233
|
+
it = ee.current, ee.current = null, Ee();
|
|
234
234
|
try {
|
|
235
235
|
if (K) {
|
|
236
236
|
var He = function() {
|
|
@@ -283,12 +283,12 @@ function Dm() {
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
H = !1, ee.current =
|
|
286
|
+
H = !1, ee.current = it, W(), Error.prepareStackTrace = Ge;
|
|
287
287
|
}
|
|
288
288
|
var Fn = R ? R.displayName || R.name : "", Nn = Fn ? P(Fn) : "";
|
|
289
289
|
return typeof R == "function" && te.set(R, Nn), Nn;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Me(R, K, ie) {
|
|
292
292
|
return ne(R, !1);
|
|
293
293
|
}
|
|
294
294
|
function Y(R) {
|
|
@@ -311,20 +311,20 @@ function Dm() {
|
|
|
311
311
|
if (typeof R == "object")
|
|
312
312
|
switch (R.$$typeof) {
|
|
313
313
|
case l:
|
|
314
|
-
return
|
|
314
|
+
return Me(R.render);
|
|
315
315
|
case f:
|
|
316
316
|
return de(R.type, K, ie);
|
|
317
317
|
case p: {
|
|
318
|
-
var we = R,
|
|
318
|
+
var we = R, Ge = we._payload, it = we._init;
|
|
319
319
|
try {
|
|
320
|
-
return de(
|
|
320
|
+
return de(it(Ge), K, ie);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var ke = Object.prototype.hasOwnProperty,
|
|
327
|
+
var ke = Object.prototype.hasOwnProperty, Ne = {}, ze = g.ReactDebugCurrentFrame;
|
|
328
328
|
function Be(R) {
|
|
329
329
|
if (R) {
|
|
330
330
|
var K = R._owner, ie = de(R.type, R._source, K ? K.type : null);
|
|
@@ -332,11 +332,11 @@ function Dm() {
|
|
|
332
332
|
} else
|
|
333
333
|
ze.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function Ue(R, K, ie, we,
|
|
335
|
+
function Ue(R, K, ie, we, Ge) {
|
|
336
336
|
{
|
|
337
|
-
var
|
|
337
|
+
var it = Function.call.bind(ke);
|
|
338
338
|
for (var He in R)
|
|
339
|
-
if (
|
|
339
|
+
if (it(R, He)) {
|
|
340
340
|
var $e = void 0;
|
|
341
341
|
try {
|
|
342
342
|
if (typeof R[He] != "function") {
|
|
@@ -347,7 +347,7 @@ function Dm() {
|
|
|
347
347
|
} catch (bt) {
|
|
348
348
|
$e = bt;
|
|
349
349
|
}
|
|
350
|
-
$e && !($e instanceof Error) && (Be(
|
|
350
|
+
$e && !($e instanceof Error) && (Be(Ge), 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).", we || "React class", ie, He, typeof $e), Be(null)), $e instanceof Error && !($e.message in Ne) && (Ne[$e.message] = !0, Be(Ge), w("Failed %s type: %s", ie, $e.message), Be(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
@@ -355,27 +355,27 @@ function Dm() {
|
|
|
355
355
|
function qe(R) {
|
|
356
356
|
return Ke(R);
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function Ze(R) {
|
|
359
359
|
{
|
|
360
360
|
var K = typeof Symbol == "function" && Symbol.toStringTag, ie = K && R[Symbol.toStringTag] || R.constructor.name || "Object";
|
|
361
361
|
return ie;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Xe(R) {
|
|
365
365
|
try {
|
|
366
|
-
return
|
|
366
|
+
return rt(R), !1;
|
|
367
367
|
} catch {
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function rt(R) {
|
|
372
372
|
return "" + R;
|
|
373
373
|
}
|
|
374
374
|
function St(R) {
|
|
375
|
-
if (
|
|
376
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
375
|
+
if (Xe(R))
|
|
376
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ze(R)), rt(R);
|
|
377
377
|
}
|
|
378
|
-
var mt = g.ReactCurrentOwner,
|
|
378
|
+
var mt = g.ReactCurrentOwner, lt = {
|
|
379
379
|
key: !0,
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
@@ -389,7 +389,7 @@ function Dm() {
|
|
|
389
389
|
}
|
|
390
390
|
return R.ref !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Qe(R) {
|
|
393
393
|
if (ke.call(R, "key")) {
|
|
394
394
|
var K = Object.getOwnPropertyDescriptor(R, "key").get;
|
|
395
395
|
if (K && K.isReactWarning)
|
|
@@ -397,10 +397,10 @@ function Dm() {
|
|
|
397
397
|
}
|
|
398
398
|
return R.key !== void 0;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function je(R, K) {
|
|
401
401
|
typeof R.ref == "string" && mt.current;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function De(R, K) {
|
|
404
404
|
{
|
|
405
405
|
var ie = function() {
|
|
406
406
|
Ct || (Ct = !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));
|
|
@@ -411,7 +411,7 @@ function Dm() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function ut(R, K) {
|
|
415
415
|
{
|
|
416
416
|
var ie = function() {
|
|
417
417
|
ce || (ce = !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));
|
|
@@ -422,7 +422,7 @@ function Dm() {
|
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var
|
|
425
|
+
var et = function(R, K, ie, we, Ge, it, He) {
|
|
426
426
|
var $e = {
|
|
427
427
|
// This tag allows us to uniquely identify this as a React Element
|
|
428
428
|
$$typeof: t,
|
|
@@ -432,7 +432,7 @@ function Dm() {
|
|
|
432
432
|
ref: ie,
|
|
433
433
|
props: He,
|
|
434
434
|
// Record the component responsible for creating this element.
|
|
435
|
-
_owner:
|
|
435
|
+
_owner: it
|
|
436
436
|
};
|
|
437
437
|
return $e._store = {}, Object.defineProperty($e._store, "validated", {
|
|
438
438
|
configurable: !1,
|
|
@@ -448,25 +448,25 @@ function Dm() {
|
|
|
448
448
|
configurable: !1,
|
|
449
449
|
enumerable: !1,
|
|
450
450
|
writable: !1,
|
|
451
|
-
value:
|
|
451
|
+
value: Ge
|
|
452
452
|
}), Object.freeze && (Object.freeze($e.props), Object.freeze($e)), $e;
|
|
453
453
|
};
|
|
454
|
-
function Fe(R, K, ie, we,
|
|
454
|
+
function Fe(R, K, ie, we, Ge) {
|
|
455
455
|
{
|
|
456
|
-
var
|
|
457
|
-
ie !== void 0 && (St(ie), $e = "" + ie),
|
|
458
|
-
for (
|
|
459
|
-
ke.call(K,
|
|
456
|
+
var it, He = {}, $e = null, Ot = null;
|
|
457
|
+
ie !== void 0 && (St(ie), $e = "" + ie), Qe(K) && (St(K.key), $e = "" + K.key), re(K) && (Ot = K.ref, je(K, Ge));
|
|
458
|
+
for (it in K)
|
|
459
|
+
ke.call(K, it) && !lt.hasOwnProperty(it) && (He[it] = K[it]);
|
|
460
460
|
if (R && R.defaultProps) {
|
|
461
461
|
var bt = R.defaultProps;
|
|
462
|
-
for (
|
|
463
|
-
He[
|
|
462
|
+
for (it in bt)
|
|
463
|
+
He[it] === void 0 && (He[it] = bt[it]);
|
|
464
464
|
}
|
|
465
465
|
if ($e || Ot) {
|
|
466
466
|
var vt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
|
|
467
|
-
$e &&
|
|
467
|
+
$e && De(He, vt), Ot && ut(He, vt);
|
|
468
468
|
}
|
|
469
|
-
return
|
|
469
|
+
return et(R, $e, Ot, Ge, we, mt.current, He);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
var Pt = g.ReactCurrentOwner, jt = g.ReactDebugCurrentFrame;
|
|
@@ -523,7 +523,7 @@ Check the top-level render call using <` + ie + ">.");
|
|
|
523
523
|
R && R._owner && R._owner !== Pt.current && (we = " 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.', ie, we), V(null);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function ct(R, K) {
|
|
527
527
|
{
|
|
528
528
|
if (typeof R != "object")
|
|
529
529
|
return;
|
|
@@ -535,9 +535,9 @@ Check the top-level render call using <` + ie + ">.");
|
|
|
535
535
|
else if (xe(R))
|
|
536
536
|
R._store && (R._store.validated = !0);
|
|
537
537
|
else if (R) {
|
|
538
|
-
var
|
|
539
|
-
if (typeof
|
|
540
|
-
for (var
|
|
538
|
+
var Ge = y(R);
|
|
539
|
+
if (typeof Ge == "function" && Ge !== R.entries)
|
|
540
|
+
for (var it = Ge.call(R), He; !(He = it.next()).done; )
|
|
541
541
|
xe(He.value) && Vt(He.value, K);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
@@ -561,8 +561,8 @@ Check the top-level render call using <` + ie + ">.");
|
|
|
561
561
|
Ue(ie, R.props, "prop", we, R);
|
|
562
562
|
} else if (K.PropTypes !== void 0 && !ve) {
|
|
563
563
|
ve = !0;
|
|
564
|
-
var
|
|
565
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
564
|
+
var Ge = F(K);
|
|
565
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ge || "Unknown");
|
|
566
566
|
}
|
|
567
567
|
typeof K.getDefaultProps == "function" && !K.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
568
568
|
}
|
|
@@ -580,7 +580,7 @@ Check the top-level render call using <` + ie + ">.");
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
var Jn = {};
|
|
583
|
-
function Ln(R, K, ie, we,
|
|
583
|
+
function Ln(R, K, ie, we, Ge, it) {
|
|
584
584
|
{
|
|
585
585
|
var He = I(R);
|
|
586
586
|
if (!He) {
|
|
@@ -591,7 +591,7 @@ Check the top-level render call using <` + ie + ">.");
|
|
|
591
591
|
var bt;
|
|
592
592
|
R === null ? bt = "null" : qe(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + (F(R.type) || "Unknown") + " />", $e = " Did you accidentally export a JSX literal instead of a component?") : bt = 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", bt, $e);
|
|
593
593
|
}
|
|
594
|
-
var vt = Fe(R, K, ie,
|
|
594
|
+
var vt = Fe(R, K, ie, Ge, it);
|
|
595
595
|
if (vt == null)
|
|
596
596
|
return vt;
|
|
597
597
|
if (He) {
|
|
@@ -600,12 +600,12 @@ Check the top-level render call using <` + ie + ">.");
|
|
|
600
600
|
if (we)
|
|
601
601
|
if (qe(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 (ke.call(K, "key")) {
|
|
611
611
|
var Nn = F(R), Ft = Object.keys(K).filter(function(oe) {
|
|
@@ -1882,11 +1882,11 @@ const xu = (e) => {
|
|
|
1882
1882
|
duplex: "half"
|
|
1883
1883
|
}), pe;
|
|
1884
1884
|
if (_.isFormData(g) && (pe = J.headers.get("content-type")) && N.setContentType(pe), J.body) {
|
|
1885
|
-
const [Re,
|
|
1885
|
+
const [Re, Ee] = wl(
|
|
1886
1886
|
$,
|
|
1887
1887
|
Xo(bl(S))
|
|
1888
1888
|
);
|
|
1889
|
-
g = Cl(J.body, Tl, Re,
|
|
1889
|
+
g = Cl(J.body, Tl, Re, Ee);
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
1892
|
_.isString(E) || (E = E ? "include" : "omit");
|
|
@@ -1904,16 +1904,16 @@ const xu = (e) => {
|
|
|
1904
1904
|
const M = d && (k === "stream" || k === "response");
|
|
1905
1905
|
if (d && (C || M && j)) {
|
|
1906
1906
|
const J = {};
|
|
1907
|
-
["status", "statusText", "headers"].forEach((
|
|
1908
|
-
J[
|
|
1907
|
+
["status", "statusText", "headers"].forEach((W) => {
|
|
1908
|
+
J[W] = D[W];
|
|
1909
1909
|
});
|
|
1910
|
-
const pe = _.toFiniteNumber(D.headers.get("content-length")), [Re,
|
|
1910
|
+
const pe = _.toFiniteNumber(D.headers.get("content-length")), [Re, Ee] = C && wl(
|
|
1911
1911
|
pe,
|
|
1912
1912
|
Xo(bl(C), !0)
|
|
1913
1913
|
) || [];
|
|
1914
1914
|
D = new r(
|
|
1915
1915
|
Cl(D.body, Tl, Re, () => {
|
|
1916
|
-
|
|
1916
|
+
Ee && Ee(), j && j();
|
|
1917
1917
|
}),
|
|
1918
1918
|
J
|
|
1919
1919
|
);
|
|
@@ -2951,7 +2951,7 @@ function Dx(e, t) {
|
|
|
2951
2951
|
return r ? Object.keys(n).length ? n : void 0 : e;
|
|
2952
2952
|
}
|
|
2953
2953
|
function Lx() {
|
|
2954
|
-
const e =
|
|
2954
|
+
const e = Je(/* @__PURE__ */ new Map()), t = Ce(
|
|
2955
2955
|
(a, l) => {
|
|
2956
2956
|
const c = e.current.get(a), d = /* @__PURE__ */ new Map();
|
|
2957
2957
|
c && c.forEach((f) => {
|
|
@@ -3052,7 +3052,7 @@ function zx(e, t) {
|
|
|
3052
3052
|
}
|
|
3053
3053
|
}
|
|
3054
3054
|
function Bx(e = []) {
|
|
3055
|
-
const [t, n] = im(zx, { ...$x, messages: e }), r =
|
|
3055
|
+
const [t, n] = im(zx, { ...$x, messages: e }), r = Je([]), o = Je(null), s = Je(null), i = Ce(() => {
|
|
3056
3056
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
|
|
3057
3057
|
const d = r.current;
|
|
3058
3058
|
d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
|
|
@@ -3064,7 +3064,7 @@ function Bx(e = []) {
|
|
|
3064
3064
|
Et(() => () => {
|
|
3065
3065
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
|
|
3066
3066
|
}, []);
|
|
3067
|
-
const c =
|
|
3067
|
+
const c = at(() => ({
|
|
3068
3068
|
reset: (d) => n({ type: "reset", payload: { messages: d } }),
|
|
3069
3069
|
seed: (d, f) => n({ type: "seed", payload: { messages: d, ...f ?? {} } }),
|
|
3070
3070
|
prepend: (d) => n({ type: "prepend", payload: { messages: d } }),
|
|
@@ -3398,7 +3398,7 @@ function Vx(e) {
|
|
|
3398
3398
|
return t[t.length - 1] || null;
|
|
3399
3399
|
}
|
|
3400
3400
|
function Kx(e = {}) {
|
|
3401
|
-
const t =
|
|
3401
|
+
const t = at(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ge(e.token ?? null), s = Je(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ge(!1), [c, d] = ge(null), [f, p] = ge(""), [h, m] = ge(null), [x, y] = ge(0), [g, w] = ge(!1), b = Je(null), T = Je(!0), C = Je(0), S = Je(null), k = Je(null), N = Je(null), E = Je(null), I = Ce((j) => {
|
|
3402
3402
|
o(j);
|
|
3403
3403
|
}, []), O = Ce(() => {
|
|
3404
3404
|
p(""), m(null), d(null), k.current = null, N.current = null, E.current = null;
|
|
@@ -3415,14 +3415,14 @@ function Kx(e = {}) {
|
|
|
3415
3415
|
threadId: j.threadId ?? null,
|
|
3416
3416
|
headers: {}
|
|
3417
3417
|
}, (async () => {
|
|
3418
|
-
var pe, Re,
|
|
3418
|
+
var pe, Re, Ee, W, ee, q, P, H, te, se, ne, Me, Y, de, ke, Ne, ze, Be;
|
|
3419
3419
|
const J = (Ue) => {
|
|
3420
3420
|
var Ke;
|
|
3421
3421
|
try {
|
|
3422
3422
|
const qe = JSON.parse(JSON.stringify(Ue));
|
|
3423
|
-
return (Ke = qe == null ? void 0 : qe.payload) != null && Ke.files_info && Array.isArray(qe.payload.files_info) && (qe.payload.files_info = qe.payload.files_info.map((
|
|
3424
|
-
...
|
|
3425
|
-
data:
|
|
3423
|
+
return (Ke = qe == null ? void 0 : qe.payload) != null && Ke.files_info && Array.isArray(qe.payload.files_info) && (qe.payload.files_info = qe.payload.files_info.map((Ze) => ({
|
|
3424
|
+
...Ze,
|
|
3425
|
+
data: Ze != null && Ze.data ? `<base64 ${String(Ze.data).length} chars>` : Ze == null ? void 0 : Ze.data
|
|
3426
3426
|
}))), qe;
|
|
3427
3427
|
} catch {
|
|
3428
3428
|
return Ue;
|
|
@@ -3438,7 +3438,7 @@ function Kx(e = {}) {
|
|
|
3438
3438
|
let jt = null;
|
|
3439
3439
|
try {
|
|
3440
3440
|
const ve = (Re = window.localStorage) == null ? void 0 : Re.getItem("chat-settings");
|
|
3441
|
-
ve && (jt = ((
|
|
3441
|
+
ve && (jt = ((Ee = JSON.parse(ve)) == null ? void 0 : Ee.apiKey) || null);
|
|
3442
3442
|
} catch {
|
|
3443
3443
|
}
|
|
3444
3444
|
const V = Fe || Pt || jt || null;
|
|
@@ -3454,66 +3454,66 @@ function Kx(e = {}) {
|
|
|
3454
3454
|
let Ke = {};
|
|
3455
3455
|
if (typeof window < "u")
|
|
3456
3456
|
try {
|
|
3457
|
-
const
|
|
3458
|
-
|
|
3457
|
+
const et = (W = window.localStorage) == null ? void 0 : W.getItem("authSessionId");
|
|
3458
|
+
et && (Ke = { "X-Session-Id": et });
|
|
3459
3459
|
} catch {
|
|
3460
3460
|
}
|
|
3461
3461
|
const qe = {
|
|
3462
3462
|
...Ue,
|
|
3463
3463
|
...Ke,
|
|
3464
3464
|
...s.current
|
|
3465
|
-
},
|
|
3465
|
+
}, Ze = {
|
|
3466
3466
|
"Content-Type": "application/json",
|
|
3467
3467
|
Accept: "text/event-stream",
|
|
3468
3468
|
...qe
|
|
3469
|
-
},
|
|
3469
|
+
}, Xe = await fetch(t + n, {
|
|
3470
3470
|
method: "POST",
|
|
3471
|
-
headers:
|
|
3471
|
+
headers: Ze,
|
|
3472
3472
|
body: JSON.stringify(j),
|
|
3473
3473
|
signal: B.signal,
|
|
3474
3474
|
credentials: i
|
|
3475
3475
|
});
|
|
3476
|
-
if (S.current && (S.current.headers = qe), !
|
|
3477
|
-
const
|
|
3476
|
+
if (S.current && (S.current.headers = qe), !Xe.ok || !Xe.body) {
|
|
3477
|
+
const et = await Xe.text().catch(() => "");
|
|
3478
3478
|
console.debug(
|
|
3479
3479
|
"[use-chat] non-OK response",
|
|
3480
|
-
|
|
3481
|
-
|
|
3480
|
+
Xe.status,
|
|
3481
|
+
et == null ? void 0 : et.slice(0, 500)
|
|
3482
3482
|
);
|
|
3483
|
-
const Fe = `stream ${
|
|
3483
|
+
const Fe = `stream ${Xe.status}${et ? ": " + et : ""}`;
|
|
3484
3484
|
throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A, Fe), Z = !0, D = "error", M = Fe, new Error(Fe);
|
|
3485
3485
|
}
|
|
3486
3486
|
w(!0);
|
|
3487
|
-
const
|
|
3488
|
-
let mt = "",
|
|
3487
|
+
const rt = Xe.body.getReader(), St = new TextDecoder();
|
|
3488
|
+
let mt = "", lt = [];
|
|
3489
3489
|
C.current = 0, y(0);
|
|
3490
3490
|
let Ct = 0, ce = null;
|
|
3491
3491
|
const re = () => {
|
|
3492
|
-
if (
|
|
3493
|
-
const
|
|
3494
|
-
|
|
3492
|
+
if (lt.length) {
|
|
3493
|
+
const et = lt.join("");
|
|
3494
|
+
lt = [], T.current && p((Fe) => Fe + et);
|
|
3495
3495
|
}
|
|
3496
3496
|
ce = null;
|
|
3497
|
-
},
|
|
3497
|
+
}, Qe = () => {
|
|
3498
3498
|
typeof window < "u" && ce == null && (ce = requestAnimationFrame(re));
|
|
3499
3499
|
};
|
|
3500
|
-
let
|
|
3501
|
-
const
|
|
3502
|
-
var
|
|
3503
|
-
if (Date.now() -
|
|
3500
|
+
let je = Date.now();
|
|
3501
|
+
const De = setInterval(() => {
|
|
3502
|
+
var et;
|
|
3503
|
+
if (Date.now() - je > 18e5) {
|
|
3504
3504
|
const Fe = "Stream idle timeout";
|
|
3505
|
-
d(Fe), D = "error", M = Fe, B.abort(), (
|
|
3505
|
+
d(Fe), D = "error", M = Fe, B.abort(), (et = A == null ? void 0 : A.onError) == null || et.call(A, Fe);
|
|
3506
3506
|
}
|
|
3507
|
-
}, 5e3),
|
|
3507
|
+
}, 5e3), ut = 1024 * 1024;
|
|
3508
3508
|
try {
|
|
3509
|
-
const
|
|
3509
|
+
const et = Xe.headers.get("X-Thread-Id") || Xe.headers.get("x-thread-id"), Fe = Xe.headers.get("X-Thread-Created") || Xe.headers.get("x-thread-created"), Pt = et ?? null, jt = String(Fe ?? "").toLowerCase() === "true";
|
|
3510
3510
|
for (S.current && !S.current.threadId && (S.current = {
|
|
3511
3511
|
...S.current,
|
|
3512
3512
|
threadId: Pt
|
|
3513
3513
|
}), (q = A == null ? void 0 : A.onOpen) == null || q.call(A, { threadId: Pt, created: jt }); ; ) {
|
|
3514
|
-
const { value: V, done: ve } = await
|
|
3514
|
+
const { value: V, done: ve } = await rt.read();
|
|
3515
3515
|
if (ve) break;
|
|
3516
|
-
mt += St.decode(V, { stream: !0 }), mt.length >
|
|
3516
|
+
mt += St.decode(V, { stream: !0 }), mt.length > ut && (mt = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
3517
3517
|
let xe;
|
|
3518
3518
|
for (; (xe = mt.indexOf(`
|
|
3519
3519
|
|
|
@@ -3530,7 +3530,7 @@ function Kx(e = {}) {
|
|
|
3530
3530
|
continue;
|
|
3531
3531
|
}
|
|
3532
3532
|
const _e = qx(Tt) ? Tt.data : Tt;
|
|
3533
|
-
|
|
3533
|
+
je = Date.now();
|
|
3534
3534
|
const Vt = _e.seq;
|
|
3535
3535
|
if (Vt !== void 0) {
|
|
3536
3536
|
if (Vt <= Ct) {
|
|
@@ -3543,9 +3543,9 @@ function Kx(e = {}) {
|
|
|
3543
3543
|
seq: _e.seq,
|
|
3544
3544
|
type: _e.type,
|
|
3545
3545
|
preview: (() => {
|
|
3546
|
-
var
|
|
3546
|
+
var ct;
|
|
3547
3547
|
try {
|
|
3548
|
-
return _e.type === "message_delta" ? { deltaTypes: (
|
|
3548
|
+
return _e.type === "message_delta" ? { deltaTypes: (ct = _e.delta) == null ? void 0 : ct.map((kt) => kt.type), textLen: (_e.delta || []).filter((kt) => kt.type === "text").map((kt) => String(kt.text || "").length) } : _e.content || _e.delta ? { hasContent: !0 } : {};
|
|
3549
3549
|
} catch (kt) {
|
|
3550
3550
|
return { err: String(kt) };
|
|
3551
3551
|
}
|
|
@@ -3557,35 +3557,35 @@ function Kx(e = {}) {
|
|
|
3557
3557
|
try {
|
|
3558
3558
|
const kt = Ur(_e).latest;
|
|
3559
3559
|
kt && (k.current = kt.checkpointId ?? null, N.current = kt.checkpointNs ?? null, m(kt.checkpointId ?? null));
|
|
3560
|
-
} catch (
|
|
3561
|
-
console.warn("[use-chat] Failed to hydrate state_history payload",
|
|
3560
|
+
} catch (ct) {
|
|
3561
|
+
console.warn("[use-chat] Failed to hydrate state_history payload", ct);
|
|
3562
3562
|
}
|
|
3563
3563
|
}
|
|
3564
3564
|
try {
|
|
3565
3565
|
$ == null || $(_e);
|
|
3566
|
-
} catch (
|
|
3567
|
-
console.error("[use-chat] Error in onEvent callback:",
|
|
3566
|
+
} catch (ct) {
|
|
3567
|
+
console.error("[use-chat] Error in onEvent callback:", ct, "for event:", _e.type);
|
|
3568
3568
|
}
|
|
3569
3569
|
if (_e.type === "token" && e.autoAppendAssistant !== !1)
|
|
3570
|
-
|
|
3570
|
+
lt.push(_e.content), Qe();
|
|
3571
3571
|
else if (_e.type === "message_delta") {
|
|
3572
|
-
const
|
|
3573
|
-
|
|
3572
|
+
const ct = _e.delta.filter((kt) => kt.type === "text").map((kt) => kt.text).join("");
|
|
3573
|
+
ct && e.autoAppendAssistant !== !1 && (lt.push(ct), Qe());
|
|
3574
3574
|
} else if (_e.type === "heartbeat") {
|
|
3575
3575
|
console.debug("[use-chat] heartbeat received");
|
|
3576
3576
|
try {
|
|
3577
3577
|
(H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A, _e);
|
|
3578
|
-
} catch (
|
|
3579
|
-
console.warn("[use-chat] heartbeat callback failed",
|
|
3578
|
+
} catch (ct) {
|
|
3579
|
+
console.warn("[use-chat] heartbeat callback failed", ct);
|
|
3580
3580
|
}
|
|
3581
3581
|
} else if (ce !== null && cancelAnimationFrame(ce), re(), _e.type === "checkpoint")
|
|
3582
3582
|
m(_e.checkpointId);
|
|
3583
3583
|
else if (_e.type === "error") {
|
|
3584
|
-
const
|
|
3585
|
-
if (d(
|
|
3586
|
-
console.error("[use-chat] Auth error detected:",
|
|
3584
|
+
const ct = _e;
|
|
3585
|
+
if (d(ct.message), D = "error", M = ct.message, ct.error_type === "auth_error" || ct.code === "TOKEN_EXPIRED" || ((te = ct.message) == null ? void 0 : te.includes("token")) || ((se = ct.message) == null ? void 0 : se.includes("401")) || ((ne = ct.message) == null ? void 0 : ne.includes("unauthorized")) || ((Me = ct.message) == null ? void 0 : Me.includes("Unauthorized"))) {
|
|
3586
|
+
console.error("[use-chat] Auth error detected:", ct.message);
|
|
3587
3587
|
try {
|
|
3588
|
-
(Y = A == null ? void 0 : A.onAuthError) == null || Y.call(A,
|
|
3588
|
+
(Y = A == null ? void 0 : A.onAuthError) == null || Y.call(A, ct.message);
|
|
3589
3589
|
} catch (Dn) {
|
|
3590
3590
|
console.warn("[use-chat] onAuthError handler failed", Dn);
|
|
3591
3591
|
}
|
|
@@ -3595,42 +3595,42 @@ function Kx(e = {}) {
|
|
|
3595
3595
|
}
|
|
3596
3596
|
}
|
|
3597
3597
|
re(), D === null && !B.signal.aborted && (D = "complete");
|
|
3598
|
-
} catch (
|
|
3599
|
-
if (
|
|
3598
|
+
} catch (et) {
|
|
3599
|
+
if (et.name === "AbortError")
|
|
3600
3600
|
D = D ?? "aborted";
|
|
3601
3601
|
else {
|
|
3602
|
-
const Fe =
|
|
3602
|
+
const Fe = et.message || String(et);
|
|
3603
3603
|
D = "error", M = Fe, d(Fe), (de = A == null ? void 0 : A.onError) == null || de.call(A, Fe);
|
|
3604
3604
|
}
|
|
3605
3605
|
} finally {
|
|
3606
3606
|
try {
|
|
3607
|
-
await
|
|
3607
|
+
await rt.cancel();
|
|
3608
3608
|
} catch {
|
|
3609
3609
|
} finally {
|
|
3610
|
-
(ke =
|
|
3610
|
+
(ke = rt.releaseLock) == null || ke.call(rt);
|
|
3611
3611
|
}
|
|
3612
|
-
ce !== null && typeof window < "u" && window.cancelAnimationFrame(ce), clearInterval(
|
|
3612
|
+
ce !== null && typeof window < "u" && window.cancelAnimationFrame(ce), clearInterval(De);
|
|
3613
3613
|
}
|
|
3614
3614
|
} catch (Ue) {
|
|
3615
3615
|
if (Ue.name === "AbortError")
|
|
3616
3616
|
D = D ?? "aborted";
|
|
3617
3617
|
else {
|
|
3618
3618
|
const Ke = Ue.message || String(Ue);
|
|
3619
|
-
D = "error", M = Ke, d(Ke), (
|
|
3619
|
+
D = "error", M = Ke, d(Ke), (Ne = A == null ? void 0 : A.onError) == null || Ne.call(A, Ke), Z || ((ze = A == null ? void 0 : A.onConnectionError) == null || ze.call(A, Ke), Z = !0);
|
|
3620
3620
|
}
|
|
3621
3621
|
} finally {
|
|
3622
|
-
const Ue = C.current, Ke = k.current, qe = N.current,
|
|
3622
|
+
const Ue = C.current, Ke = k.current, qe = N.current, Ze = E.current, Xe = D ?? (B.signal.aborted ? "aborted" : M ? "error" : "complete");
|
|
3623
3623
|
try {
|
|
3624
3624
|
(Be = A == null ? void 0 : A.onClosed) == null || Be.call(A, {
|
|
3625
|
-
reason:
|
|
3625
|
+
reason: Xe,
|
|
3626
3626
|
lastSeq: Ue,
|
|
3627
3627
|
lastCheckpointId: Ke,
|
|
3628
3628
|
lastCheckpointNs: qe,
|
|
3629
|
-
lastStateHistory:
|
|
3629
|
+
lastStateHistory: Ze,
|
|
3630
3630
|
error: M
|
|
3631
3631
|
});
|
|
3632
|
-
} catch (
|
|
3633
|
-
console.warn("[use-chat] onClosed callback failed",
|
|
3632
|
+
} catch (rt) {
|
|
3633
|
+
console.warn("[use-chat] onClosed callback failed", rt);
|
|
3634
3634
|
}
|
|
3635
3635
|
l(!1), w(!1), b.current = null, C.current = 0, y(0), S.current = null;
|
|
3636
3636
|
}
|
|
@@ -3679,7 +3679,7 @@ function Yx({
|
|
|
3679
3679
|
onAuthError: a,
|
|
3680
3680
|
onHeartbeat: l
|
|
3681
3681
|
}) {
|
|
3682
|
-
const c =
|
|
3682
|
+
const c = Je(null), d = Je(null), f = Je(/* @__PURE__ */ new Map()), p = Je(null), h = Ce((E) => {
|
|
3683
3683
|
try {
|
|
3684
3684
|
const I = globalThis.structuredClone;
|
|
3685
3685
|
if (typeof I == "function")
|
|
@@ -3850,7 +3850,7 @@ function Yx({
|
|
|
3850
3850
|
), N = Ce(() => {
|
|
3851
3851
|
p.current && (p.current.manualStop = !0), b();
|
|
3852
3852
|
}, [b]);
|
|
3853
|
-
return
|
|
3853
|
+
return at(
|
|
3854
3854
|
() => ({
|
|
3855
3855
|
startStream: k,
|
|
3856
3856
|
stop: N,
|
|
@@ -3875,18 +3875,18 @@ function Xx({
|
|
|
3875
3875
|
onThreadChange: a,
|
|
3876
3876
|
checkpointMetadataCache: l
|
|
3877
3877
|
}) {
|
|
3878
|
-
const { api: c, baseUrl: d } = Tu(), f =
|
|
3878
|
+
const { api: c, baseUrl: d } = Tu(), f = at(() => _n(d), [d]), [p, h] = ge([]), [m, x] = ge(t), [y, g] = ge(!1), [w, b] = ge(null), [T, C] = ge(!1), [S, k] = ge(null), { state: N, seed: E, prepend: I, pushUser: O, onEvent: L } = Bx(), [F, j] = ge(!1), [$, A] = ge(!1), [B, D] = ge(null), [M, Z] = ge([]), [J, pe] = ge(!1), Re = l ?? Lx(), { setCacheForThread: Ee } = Re, W = Je(m), ee = Je(null), q = Je(!1);
|
|
3879
3879
|
Et(() => {
|
|
3880
|
-
|
|
3880
|
+
W.current = m;
|
|
3881
3881
|
}, [m]);
|
|
3882
|
-
const P =
|
|
3882
|
+
const P = Je(), { startStream: H, stop: te, isStreaming: se, error: ne, setAuthToken: Me } = Yx({
|
|
3883
3883
|
baseUrl: f,
|
|
3884
3884
|
onThreadInfo: (ce) => {
|
|
3885
|
-
if (console.log("[ChatSessionProvider] Thread info:", ce.threadId),
|
|
3885
|
+
if (console.log("[ChatSessionProvider] Thread info:", ce.threadId), W.current === null) {
|
|
3886
3886
|
console.log("[ChatSessionProvider] Ignoring thread info: no active thread (new chat mode)");
|
|
3887
3887
|
return;
|
|
3888
3888
|
}
|
|
3889
|
-
|
|
3889
|
+
W.current !== ce.threadId && x(ce.threadId);
|
|
3890
3890
|
},
|
|
3891
3891
|
onMessageEvent: L,
|
|
3892
3892
|
onUnhandledEvent: (ce) => {
|
|
@@ -3917,50 +3917,50 @@ function Xx({
|
|
|
3917
3917
|
), ke = Ce(
|
|
3918
3918
|
async (ce) => {
|
|
3919
3919
|
try {
|
|
3920
|
-
await c.deleteThread(ce),
|
|
3920
|
+
await c.deleteThread(ce), W.current === ce && (x(null), E([], {})), await Y();
|
|
3921
3921
|
} catch (re) {
|
|
3922
3922
|
s == null || s(String(re));
|
|
3923
3923
|
}
|
|
3924
3924
|
},
|
|
3925
3925
|
[c, Y, E, s]
|
|
3926
|
-
),
|
|
3926
|
+
), Ne = Ce(
|
|
3927
3927
|
async (ce, re) => {
|
|
3928
3928
|
try {
|
|
3929
3929
|
await c.updateThread(ce, re), await Y();
|
|
3930
|
-
} catch (
|
|
3931
|
-
s == null || s(String(
|
|
3930
|
+
} catch (Qe) {
|
|
3931
|
+
s == null || s(String(Qe));
|
|
3932
3932
|
}
|
|
3933
3933
|
},
|
|
3934
3934
|
[c, Y, s]
|
|
3935
3935
|
), ze = Ce(
|
|
3936
|
-
(ce, re,
|
|
3937
|
-
const
|
|
3938
|
-
checkpointId:
|
|
3939
|
-
checkpointNs:
|
|
3940
|
-
createdAt:
|
|
3936
|
+
(ce, re, Qe) => {
|
|
3937
|
+
const je = re.filter((De) => De.checkpointId).map((De) => ({
|
|
3938
|
+
checkpointId: De.checkpointId,
|
|
3939
|
+
checkpointNs: De.checkpointNs ?? void 0,
|
|
3940
|
+
createdAt: De.createdAt ?? ""
|
|
3941
3941
|
}));
|
|
3942
|
-
console.log(`[ChatSessionProvider] Cached metadata for ${
|
|
3942
|
+
console.log(`[ChatSessionProvider] Cached metadata for ${je.length} checkpoints from ${Qe}`), Ee(ce, je);
|
|
3943
3943
|
},
|
|
3944
|
-
[
|
|
3944
|
+
[Ee]
|
|
3945
3945
|
), Be = Ce(
|
|
3946
3946
|
async (ce, re) => {
|
|
3947
3947
|
if (ce) {
|
|
3948
3948
|
C(!0), k(null);
|
|
3949
3949
|
try {
|
|
3950
|
-
const
|
|
3950
|
+
const Qe = await c.getStateHistory({
|
|
3951
3951
|
threadId: ce,
|
|
3952
3952
|
checkpointId: re || void 0
|
|
3953
3953
|
// Let backend pick latest if not specified
|
|
3954
|
-
}), { checkpoints:
|
|
3955
|
-
ze(ce,
|
|
3956
|
-
const
|
|
3957
|
-
E((
|
|
3958
|
-
checkpointId: (
|
|
3959
|
-
checkpointNs: (
|
|
3960
|
-
}), Z(
|
|
3961
|
-
} catch (
|
|
3962
|
-
const
|
|
3963
|
-
k(
|
|
3954
|
+
}), { checkpoints: je } = Ur(Qe);
|
|
3955
|
+
ze(ce, je, `thread load (requested: ${re})`);
|
|
3956
|
+
const De = je.find((ut) => ut.messages && ut.messages.length > 0) ?? (re ? je.find((ut) => ut.checkpointId === re) : null) ?? je[0];
|
|
3957
|
+
E((De == null ? void 0 : De.messages) ?? [], {
|
|
3958
|
+
checkpointId: (De == null ? void 0 : De.checkpointId) ?? null,
|
|
3959
|
+
checkpointNs: (De == null ? void 0 : De.checkpointNs) ?? null
|
|
3960
|
+
}), Z(je), j(!!(De != null && De.nextCursor)), D((De == null ? void 0 : De.nextCursor) ?? null);
|
|
3961
|
+
} catch (Qe) {
|
|
3962
|
+
const je = String(Qe);
|
|
3963
|
+
k(je), s == null || s(je);
|
|
3964
3964
|
} finally {
|
|
3965
3965
|
C(!1);
|
|
3966
3966
|
}
|
|
@@ -3973,29 +3973,29 @@ function Xx({
|
|
|
3973
3973
|
}, [Be]);
|
|
3974
3974
|
const Ue = Ce(
|
|
3975
3975
|
async (ce, re) => {
|
|
3976
|
-
const
|
|
3977
|
-
if (
|
|
3976
|
+
const Qe = W.current;
|
|
3977
|
+
if (Qe) {
|
|
3978
3978
|
pe(!0);
|
|
3979
3979
|
try {
|
|
3980
|
-
const
|
|
3981
|
-
threadId:
|
|
3980
|
+
const je = await c.getStateHistory({
|
|
3981
|
+
threadId: Qe,
|
|
3982
3982
|
checkpointId: ce,
|
|
3983
3983
|
checkpointNs: re ?? void 0
|
|
3984
|
-
}), { checkpoints:
|
|
3985
|
-
ze(
|
|
3986
|
-
const
|
|
3987
|
-
(
|
|
3984
|
+
}), { checkpoints: De } = Ur(je);
|
|
3985
|
+
ze(Qe, De, "checkpoint navigation");
|
|
3986
|
+
const ut = De.find(
|
|
3987
|
+
(et) => et.checkpointId === ce && (re ? et.checkpointNs === re : !0)
|
|
3988
3988
|
);
|
|
3989
|
-
if (!
|
|
3989
|
+
if (!ut) {
|
|
3990
3990
|
console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: ce, checkpointNs: re });
|
|
3991
3991
|
return;
|
|
3992
3992
|
}
|
|
3993
|
-
Z(
|
|
3994
|
-
checkpointId:
|
|
3995
|
-
checkpointNs:
|
|
3993
|
+
Z(De), E(ut.messages ?? [], {
|
|
3994
|
+
checkpointId: ut.checkpointId ?? null,
|
|
3995
|
+
checkpointNs: ut.checkpointNs ?? null
|
|
3996
3996
|
});
|
|
3997
|
-
} catch (
|
|
3998
|
-
s == null || s(String(
|
|
3997
|
+
} catch (je) {
|
|
3998
|
+
s == null || s(String(je));
|
|
3999
3999
|
} finally {
|
|
4000
4000
|
pe(!1);
|
|
4001
4001
|
}
|
|
@@ -4011,9 +4011,9 @@ function Xx({
|
|
|
4011
4011
|
},
|
|
4012
4012
|
[E, N.messages]
|
|
4013
4013
|
), qe = Ce(async () => {
|
|
4014
|
-
|
|
4015
|
-
}, [Be]),
|
|
4016
|
-
if (!
|
|
4014
|
+
W.current && await Be(W.current);
|
|
4015
|
+
}, [Be]), Ze = Ce(async () => {
|
|
4016
|
+
if (!W.current || !B) return;
|
|
4017
4017
|
if (q.current) {
|
|
4018
4018
|
console.log("[ChatSessionProvider] Skipping history load - thread cleanup in progress");
|
|
4019
4019
|
return;
|
|
@@ -4022,45 +4022,30 @@ function Xx({
|
|
|
4022
4022
|
let ce = !0;
|
|
4023
4023
|
try {
|
|
4024
4024
|
const re = await c.getStateHistory({
|
|
4025
|
-
threadId:
|
|
4025
|
+
threadId: W.current,
|
|
4026
4026
|
checkpointId: B
|
|
4027
4027
|
});
|
|
4028
4028
|
if (q.current) {
|
|
4029
4029
|
console.log("[ChatSessionProvider] Discarding history fetch - thread was cleared"), ce = !1;
|
|
4030
4030
|
return;
|
|
4031
4031
|
}
|
|
4032
|
-
const { checkpoints:
|
|
4033
|
-
if (
|
|
4034
|
-
const
|
|
4035
|
-
I((
|
|
4032
|
+
const { checkpoints: Qe } = Ur(re);
|
|
4033
|
+
if (Qe.length > 0) {
|
|
4034
|
+
const je = Qe[Qe.length - 1];
|
|
4035
|
+
I((je == null ? void 0 : je.messages) ?? []), j(!!(je != null && je.nextCursor)), D((je == null ? void 0 : je.nextCursor) ?? null);
|
|
4036
4036
|
}
|
|
4037
4037
|
} catch (re) {
|
|
4038
4038
|
q.current ? (console.log("[ChatSessionProvider] Error during history fetch, but cleanup in progress - ignoring"), ce = !1) : s == null || s(String(re));
|
|
4039
4039
|
} finally {
|
|
4040
4040
|
ce && A(!1);
|
|
4041
4041
|
}
|
|
4042
|
-
}, [c, B, I, s]),
|
|
4043
|
-
q.current = !0, te(),
|
|
4044
|
-
}, [E, te]),
|
|
4045
|
-
async (ce, re
|
|
4046
|
-
|
|
4047
|
-
if (!Ee)
|
|
4048
|
-
throw new Error("No active thread to handle interrupt");
|
|
4049
|
-
const Oe = re ? Ge ?? !0 : !1;
|
|
4050
|
-
try {
|
|
4051
|
-
const et = {
|
|
4052
|
-
threadId: Ee,
|
|
4053
|
-
checkpointId: N.lastCheckpointId ?? void 0,
|
|
4054
|
-
checkpointNs: N.lastCheckpointNs ?? void 0,
|
|
4055
|
-
// The command is the key: backend extracts this and routes to LangGraph
|
|
4056
|
-
command: { kind: "resume", value: Oe }
|
|
4057
|
-
};
|
|
4058
|
-
H(et);
|
|
4059
|
-
} catch (et) {
|
|
4060
|
-
throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${ce}:`, et), et;
|
|
4061
|
-
}
|
|
4042
|
+
}, [c, B, I, s]), Xe = Ce(async () => {
|
|
4043
|
+
q.current = !0, te(), W.current = null, ee.current = null, E([], {}), Z([]), j(!1), D(null), x(null), await Promise.resolve(), q.current = !1;
|
|
4044
|
+
}, [E, te]), rt = Ce(
|
|
4045
|
+
async (ce, re) => {
|
|
4046
|
+
console.log("[ChatSessionProvider] Interrupt:", ce, re);
|
|
4062
4047
|
},
|
|
4063
|
-
[
|
|
4048
|
+
[]
|
|
4064
4049
|
);
|
|
4065
4050
|
Et(() => {
|
|
4066
4051
|
Y();
|
|
@@ -4072,33 +4057,33 @@ function Xx({
|
|
|
4072
4057
|
}, [m, a]);
|
|
4073
4058
|
const St = Ce(
|
|
4074
4059
|
async (ce, re) => {
|
|
4075
|
-
const
|
|
4076
|
-
if (!
|
|
4077
|
-
if (!
|
|
4060
|
+
const Qe = W.current, je = (ce == null ? void 0 : ce.text) ?? "";
|
|
4061
|
+
if (!Qe && !je) return;
|
|
4062
|
+
if (!Qe) {
|
|
4078
4063
|
await de("New Chat");
|
|
4079
4064
|
return;
|
|
4080
4065
|
}
|
|
4081
|
-
const { contentParts:
|
|
4066
|
+
const { contentParts: De } = await wx(
|
|
4082
4067
|
c,
|
|
4083
4068
|
(ce == null ? void 0 : ce.attachments) ?? []
|
|
4084
|
-
),
|
|
4085
|
-
|
|
4086
|
-
const
|
|
4069
|
+
), ut = [...De];
|
|
4070
|
+
je != null && je.trim() && ut.push({ type: "text", text: je });
|
|
4071
|
+
const et = {
|
|
4087
4072
|
id: `msg-${Date.now()}`,
|
|
4088
4073
|
role: "user",
|
|
4089
|
-
content:
|
|
4074
|
+
content: ut,
|
|
4090
4075
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4091
4076
|
};
|
|
4092
|
-
O(
|
|
4077
|
+
O(et);
|
|
4093
4078
|
const Fe = {
|
|
4094
|
-
threadId:
|
|
4079
|
+
threadId: Qe,
|
|
4095
4080
|
checkpointId: (re == null ? void 0 : re.checkpointId) ?? N.lastCheckpointId ?? void 0,
|
|
4096
4081
|
checkpointNs: (re == null ? void 0 : re.checkpointNs) ?? N.lastCheckpointNs ?? void 0
|
|
4097
4082
|
};
|
|
4098
4083
|
H(Fe);
|
|
4099
4084
|
},
|
|
4100
4085
|
[c, de, O, N, H]
|
|
4101
|
-
), mt =
|
|
4086
|
+
), mt = at(
|
|
4102
4087
|
() => ({
|
|
4103
4088
|
threads: p,
|
|
4104
4089
|
currentThreadId: m,
|
|
@@ -4108,12 +4093,12 @@ function Xx({
|
|
|
4108
4093
|
actions: {
|
|
4109
4094
|
createThread: de,
|
|
4110
4095
|
deleteThread: ke,
|
|
4111
|
-
renameThread:
|
|
4096
|
+
renameThread: Ne,
|
|
4112
4097
|
refreshThreads: Y
|
|
4113
4098
|
}
|
|
4114
4099
|
}),
|
|
4115
|
-
[p, m, y, w, de, ke,
|
|
4116
|
-
),
|
|
4100
|
+
[p, m, y, w, de, ke, Ne, Y]
|
|
4101
|
+
), lt = at(
|
|
4117
4102
|
() => ({
|
|
4118
4103
|
threadId: m,
|
|
4119
4104
|
messages: N.messages,
|
|
@@ -4129,14 +4114,14 @@ function Xx({
|
|
|
4129
4114
|
isLoadingCheckpoint: J,
|
|
4130
4115
|
error: S,
|
|
4131
4116
|
hasMore: F,
|
|
4132
|
-
loadOlder:
|
|
4133
|
-
clearState:
|
|
4117
|
+
loadOlder: Ze,
|
|
4118
|
+
clearState: Xe,
|
|
4134
4119
|
navigateToCheckpoint: Ue,
|
|
4135
4120
|
setCurrentCheckpointId: Ke,
|
|
4136
4121
|
returnToLatest: qe,
|
|
4137
4122
|
loadThread: Be,
|
|
4138
|
-
clearThread:
|
|
4139
|
-
respondToInterrupt:
|
|
4123
|
+
clearThread: Xe,
|
|
4124
|
+
respondToInterrupt: rt
|
|
4140
4125
|
}),
|
|
4141
4126
|
[
|
|
4142
4127
|
m,
|
|
@@ -4147,15 +4132,15 @@ function Xx({
|
|
|
4147
4132
|
J,
|
|
4148
4133
|
S,
|
|
4149
4134
|
F,
|
|
4150
|
-
|
|
4151
|
-
|
|
4135
|
+
Ze,
|
|
4136
|
+
Xe,
|
|
4152
4137
|
Ue,
|
|
4153
4138
|
Ke,
|
|
4154
4139
|
qe,
|
|
4155
4140
|
Be,
|
|
4156
|
-
|
|
4141
|
+
rt
|
|
4157
4142
|
]
|
|
4158
|
-
), Ct =
|
|
4143
|
+
), Ct = at(
|
|
4159
4144
|
() => ({
|
|
4160
4145
|
isStreaming: se,
|
|
4161
4146
|
error: ne,
|
|
@@ -4163,11 +4148,11 @@ function Xx({
|
|
|
4163
4148
|
submit: St,
|
|
4164
4149
|
send: St,
|
|
4165
4150
|
stop: te,
|
|
4166
|
-
setAuthToken:
|
|
4151
|
+
setAuthToken: Me
|
|
4167
4152
|
}),
|
|
4168
|
-
[se, ne, St, te,
|
|
4153
|
+
[se, ne, St, te, Me]
|
|
4169
4154
|
);
|
|
4170
|
-
return /* @__PURE__ */ u.jsx(Au.Provider, { value: mt, children: /* @__PURE__ */ u.jsx(ju.Provider, { value:
|
|
4155
|
+
return /* @__PURE__ */ u.jsx(Au.Provider, { value: mt, children: /* @__PURE__ */ u.jsx(ju.Provider, { value: lt, children: /* @__PURE__ */ u.jsx(_u.Provider, { value: Ct, children: e }) }) });
|
|
4171
4156
|
}
|
|
4172
4157
|
function xa() {
|
|
4173
4158
|
const e = xs(Au);
|
|
@@ -4238,7 +4223,7 @@ const Zx = vs(
|
|
|
4238
4223
|
size: "default"
|
|
4239
4224
|
}
|
|
4240
4225
|
}
|
|
4241
|
-
),
|
|
4226
|
+
), ot = v.forwardRef(
|
|
4242
4227
|
({ className: e, variant: t, size: n, asChild: r = !1, ...o }, s) => {
|
|
4243
4228
|
const i = r ? _m : "button";
|
|
4244
4229
|
return /* @__PURE__ */ u.jsx(
|
|
@@ -4251,7 +4236,7 @@ const Zx = vs(
|
|
|
4251
4236
|
);
|
|
4252
4237
|
}
|
|
4253
4238
|
);
|
|
4254
|
-
|
|
4239
|
+
ot.displayName = "Button";
|
|
4255
4240
|
const Pu = v.forwardRef(
|
|
4256
4241
|
({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
4257
4242
|
"textarea",
|
|
@@ -4352,7 +4337,7 @@ function Qx({
|
|
|
4352
4337
|
}
|
|
4353
4338
|
) }),
|
|
4354
4339
|
/* @__PURE__ */ u.jsx("div", { children: r ? /* @__PURE__ */ u.jsx(
|
|
4355
|
-
|
|
4340
|
+
ot,
|
|
4356
4341
|
{
|
|
4357
4342
|
type: "button",
|
|
4358
4343
|
onClick: () => {
|
|
@@ -4366,7 +4351,7 @@ function Qx({
|
|
|
4366
4351
|
children: /* @__PURE__ */ u.jsx(cm, { size: 16 })
|
|
4367
4352
|
}
|
|
4368
4353
|
) : /* @__PURE__ */ u.jsx(
|
|
4369
|
-
|
|
4354
|
+
ot,
|
|
4370
4355
|
{
|
|
4371
4356
|
type: "submit",
|
|
4372
4357
|
size: "icon",
|
|
@@ -4541,7 +4526,7 @@ var iy = [
|
|
|
4541
4526
|
"span",
|
|
4542
4527
|
"svg",
|
|
4543
4528
|
"ul"
|
|
4544
|
-
],
|
|
4529
|
+
], Ae = iy.reduce((e, t) => {
|
|
4545
4530
|
const n = Tr(`Primitive.${t}`), r = v.forwardRef((o, s) => {
|
|
4546
4531
|
const { asChild: i, ...a } = o, l = i ? n : t;
|
|
4547
4532
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u.jsx(l, { ...a, ref: s });
|
|
@@ -4648,7 +4633,7 @@ var cy = "DismissableLayer", Bi = "dismissableLayer.update", uy = "dismissableLa
|
|
|
4648
4633
|
const k = () => h({});
|
|
4649
4634
|
return document.addEventListener(Bi, k), () => document.removeEventListener(Bi, k);
|
|
4650
4635
|
}, []), /* @__PURE__ */ u.jsx(
|
|
4651
|
-
|
|
4636
|
+
Ae.div,
|
|
4652
4637
|
{
|
|
4653
4638
|
...l,
|
|
4654
4639
|
ref: m,
|
|
@@ -4675,7 +4660,7 @@ var fy = "DismissableLayerBranch", py = v.forwardRef((e, t) => {
|
|
|
4675
4660
|
return n.branches.add(s), () => {
|
|
4676
4661
|
n.branches.delete(s);
|
|
4677
4662
|
};
|
|
4678
|
-
}, [n.branches]), /* @__PURE__ */ u.jsx(
|
|
4663
|
+
}, [n.branches]), /* @__PURE__ */ u.jsx(Ae.div, { ...e, ref: o });
|
|
4679
4664
|
});
|
|
4680
4665
|
py.displayName = fy;
|
|
4681
4666
|
function hy(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -4807,7 +4792,7 @@ var hi = "focusScope.autoFocusOnMount", mi = "focusScope.autoFocusOnUnmount", Kl
|
|
|
4807
4792
|
},
|
|
4808
4793
|
[n, r, h.paused]
|
|
4809
4794
|
);
|
|
4810
|
-
return /* @__PURE__ */ u.jsx(
|
|
4795
|
+
return /* @__PURE__ */ u.jsx(Ae.div, { tabIndex: -1, ...i, ref: p, onKeyDown: m });
|
|
4811
4796
|
});
|
|
4812
4797
|
Is.displayName = gy;
|
|
4813
4798
|
function xy(e, { select: t = !1 } = {}) {
|
|
@@ -6193,7 +6178,7 @@ const Ev = (e) => {
|
|
|
6193
6178
|
var Mv = "Arrow", Yu = v.forwardRef((e, t) => {
|
|
6194
6179
|
const { children: n, width: r = 10, height: o = 5, ...s } = e;
|
|
6195
6180
|
return /* @__PURE__ */ u.jsx(
|
|
6196
|
-
|
|
6181
|
+
Ae.svg,
|
|
6197
6182
|
{
|
|
6198
6183
|
...s,
|
|
6199
6184
|
ref: t,
|
|
@@ -6240,7 +6225,7 @@ var ed = "PopperAnchor", td = v.forwardRef(
|
|
|
6240
6225
|
return v.useEffect(() => {
|
|
6241
6226
|
const c = l.current;
|
|
6242
6227
|
l.current = (r == null ? void 0 : r.current) || i.current, c !== l.current && s.onAnchorChange(l.current);
|
|
6243
|
-
}), r ? null : /* @__PURE__ */ u.jsx(
|
|
6228
|
+
}), r ? null : /* @__PURE__ */ u.jsx(Ae.div, { ...o, ref: a });
|
|
6244
6229
|
}
|
|
6245
6230
|
);
|
|
6246
6231
|
td.displayName = ed;
|
|
@@ -6262,7 +6247,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6262
6247
|
updatePositionStrategy: h = "optimized",
|
|
6263
6248
|
onPlaced: m,
|
|
6264
6249
|
...x
|
|
6265
|
-
} = e, y = Zu(Na, n), [g, w] = v.useState(null), b = Ve(t, (
|
|
6250
|
+
} = e, y = Zu(Na, n), [g, w] = v.useState(null), b = Ve(t, (Me) => w(Me)), [T, C] = v.useState(null), S = Xu(T), k = (S == null ? void 0 : S.width) ?? 0, N = (S == null ? void 0 : S.height) ?? 0, E = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], L = O.length > 0, F = {
|
|
6266
6251
|
padding: I,
|
|
6267
6252
|
boundary: O.filter(Bv),
|
|
6268
6253
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
@@ -6271,7 +6256,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6271
6256
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
6272
6257
|
strategy: "fixed",
|
|
6273
6258
|
placement: E,
|
|
6274
|
-
whileElementsMounted: (...
|
|
6259
|
+
whileElementsMounted: (...Me) => gv(...Me, {
|
|
6275
6260
|
animationFrame: h === "always"
|
|
6276
6261
|
}),
|
|
6277
6262
|
elements: {
|
|
@@ -6288,9 +6273,9 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6288
6273
|
l && jv({ ...F }),
|
|
6289
6274
|
_v({
|
|
6290
6275
|
...F,
|
|
6291
|
-
apply: ({ elements:
|
|
6292
|
-
const { width:
|
|
6293
|
-
Be.setProperty("--radix-popper-available-width", `${de}px`), Be.setProperty("--radix-popper-available-height", `${ke}px`), Be.setProperty("--radix-popper-anchor-width", `${
|
|
6276
|
+
apply: ({ elements: Me, rects: Y, availableWidth: de, availableHeight: ke }) => {
|
|
6277
|
+
const { width: Ne, height: ze } = Y.reference, Be = Me.floating.style;
|
|
6278
|
+
Be.setProperty("--radix-popper-available-width", `${de}px`), Be.setProperty("--radix-popper-available-height", `${ke}px`), Be.setProperty("--radix-popper-anchor-width", `${Ne}px`), Be.setProperty("--radix-popper-anchor-height", `${ze}px`);
|
|
6294
6279
|
}
|
|
6295
6280
|
}),
|
|
6296
6281
|
T && Ov({ element: T, padding: a }),
|
|
@@ -6301,7 +6286,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6301
6286
|
Lt(() => {
|
|
6302
6287
|
B && (J == null || J());
|
|
6303
6288
|
}, [B, J]);
|
|
6304
|
-
const pe = (q = D.arrow) == null ? void 0 : q.x, Re = (P = D.arrow) == null ? void 0 : P.y,
|
|
6289
|
+
const pe = (q = D.arrow) == null ? void 0 : q.x, Re = (P = D.arrow) == null ? void 0 : P.y, Ee = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [W, ee] = v.useState();
|
|
6305
6290
|
return Lt(() => {
|
|
6306
6291
|
g && ee(window.getComputedStyle(g).zIndex);
|
|
6307
6292
|
}, [g]), /* @__PURE__ */ u.jsx(
|
|
@@ -6314,7 +6299,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6314
6299
|
transform: B ? $.transform : "translate(0, -200%)",
|
|
6315
6300
|
// keep off the page when measuring
|
|
6316
6301
|
minWidth: "max-content",
|
|
6317
|
-
zIndex:
|
|
6302
|
+
zIndex: W,
|
|
6318
6303
|
"--radix-popper-transform-origin": [
|
|
6319
6304
|
(te = D.transformOrigin) == null ? void 0 : te.x,
|
|
6320
6305
|
(se = D.transformOrigin) == null ? void 0 : se.y
|
|
@@ -6336,9 +6321,9 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
|
|
|
6336
6321
|
onArrowChange: C,
|
|
6337
6322
|
arrowX: pe,
|
|
6338
6323
|
arrowY: Re,
|
|
6339
|
-
shouldHideArrow:
|
|
6324
|
+
shouldHideArrow: Ee,
|
|
6340
6325
|
children: /* @__PURE__ */ u.jsx(
|
|
6341
|
-
|
|
6326
|
+
Ae.div,
|
|
6342
6327
|
{
|
|
6343
6328
|
"data-side": M,
|
|
6344
6329
|
"data-align": Z,
|
|
@@ -6432,7 +6417,7 @@ var id = Qu, ad = td, ld = nd, cd = od, Uv = "Portal", Os = v.forwardRef((e, t)
|
|
|
6432
6417
|
const { container: n, ...r } = e, [o, s] = v.useState(!1);
|
|
6433
6418
|
Lt(() => s(!0), []);
|
|
6434
6419
|
const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
6435
|
-
return i ? Zc.createPortal(/* @__PURE__ */ u.jsx(
|
|
6420
|
+
return i ? Zc.createPortal(/* @__PURE__ */ u.jsx(Ae.div, { ...r, ref: t }), i) : null;
|
|
6436
6421
|
});
|
|
6437
6422
|
Os.displayName = Uv;
|
|
6438
6423
|
function Wv(e, t) {
|
|
@@ -6551,7 +6536,7 @@ var Zv = v.forwardRef((e, t) => {
|
|
|
6551
6536
|
[]
|
|
6552
6537
|
),
|
|
6553
6538
|
children: /* @__PURE__ */ u.jsx(
|
|
6554
|
-
|
|
6539
|
+
Ae.div,
|
|
6555
6540
|
{
|
|
6556
6541
|
tabIndex: g || S === 0 ? -1 : 0,
|
|
6557
6542
|
"data-orientation": r,
|
|
@@ -6600,7 +6585,7 @@ var Zv = v.forwardRef((e, t) => {
|
|
|
6600
6585
|
focusable: r,
|
|
6601
6586
|
active: o,
|
|
6602
6587
|
children: /* @__PURE__ */ u.jsx(
|
|
6603
|
-
|
|
6588
|
+
Ae.span,
|
|
6604
6589
|
{
|
|
6605
6590
|
tabIndex: f ? 0 : -1,
|
|
6606
6591
|
"data-orientation": d.orientation,
|
|
@@ -7300,7 +7285,7 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
|
|
|
7300
7285
|
...x
|
|
7301
7286
|
} = e, y = 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, y.onContentChange), E = v.useRef(0), I = v.useRef(""), O = v.useRef(0), L = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = m ? Ds : v.Fragment, A = m ? { as: rb, allowPinchZoom: !0 } : void 0, B = (M) => {
|
|
7302
7287
|
var q, P;
|
|
7303
|
-
const Z = I.current + M, J = T().filter((H) => !H.disabled), pe = document.activeElement, Re = (q = J.find((H) => H.ref.current === pe)) == null ? void 0 : q.textValue,
|
|
7288
|
+
const Z = I.current + M, J = T().filter((H) => !H.disabled), pe = document.activeElement, Re = (q = J.find((H) => H.ref.current === pe)) == null ? void 0 : q.textValue, Ee = J.map((H) => H.textValue), W = mb(Ee, Z, Re), ee = (P = J.find((H) => H.textValue === W)) == null ? void 0 : P.ref.current;
|
|
7304
7289
|
(function H(te) {
|
|
7305
7290
|
I.current = te, window.clearTimeout(E.current), te !== "" && (E.current = window.setTimeout(() => H(""), 1e3));
|
|
7306
7291
|
})(Z), ee && setTimeout(() => ee.focus());
|
|
@@ -7387,8 +7372,8 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
|
|
|
7387
7372
|
onKeyDown: fe(x.onKeyDown, (M) => {
|
|
7388
7373
|
const J = M.target.closest("[data-radix-menu-content]") === M.currentTarget, pe = M.ctrlKey || M.altKey || M.metaKey, Re = M.key.length === 1;
|
|
7389
7374
|
J && (M.key === "Tab" && M.preventDefault(), !pe && Re && B(M.key));
|
|
7390
|
-
const
|
|
7391
|
-
if (M.target !==
|
|
7375
|
+
const Ee = k.current;
|
|
7376
|
+
if (M.target !== Ee || !Vw.includes(M.key)) return;
|
|
7392
7377
|
M.preventDefault();
|
|
7393
7378
|
const ee = T().filter((q) => !q.disabled).map((q) => q.ref.current);
|
|
7394
7379
|
Td.includes(M.key) && ee.reverse(), pb(ee);
|
|
@@ -7422,14 +7407,14 @@ Ad.displayName = an;
|
|
|
7422
7407
|
var ob = "MenuGroup", Ma = v.forwardRef(
|
|
7423
7408
|
(e, t) => {
|
|
7424
7409
|
const { __scopeMenu: n, ...r } = e;
|
|
7425
|
-
return /* @__PURE__ */ u.jsx(
|
|
7410
|
+
return /* @__PURE__ */ u.jsx(Ae.div, { role: "group", ...r, ref: t });
|
|
7426
7411
|
}
|
|
7427
7412
|
);
|
|
7428
7413
|
Ma.displayName = ob;
|
|
7429
7414
|
var sb = "MenuLabel", jd = v.forwardRef(
|
|
7430
7415
|
(e, t) => {
|
|
7431
7416
|
const { __scopeMenu: n, ...r } = e;
|
|
7432
|
-
return /* @__PURE__ */ u.jsx(
|
|
7417
|
+
return /* @__PURE__ */ u.jsx(Ae.div, { ...r, ref: t });
|
|
7433
7418
|
}
|
|
7434
7419
|
);
|
|
7435
7420
|
jd.displayName = sb;
|
|
@@ -7479,7 +7464,7 @@ var _d = v.forwardRef(
|
|
|
7479
7464
|
disabled: r,
|
|
7480
7465
|
textValue: o ?? p,
|
|
7481
7466
|
children: /* @__PURE__ */ u.jsx(ow, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ u.jsx(
|
|
7482
|
-
|
|
7467
|
+
Ae.div,
|
|
7483
7468
|
{
|
|
7484
7469
|
role: "menuitem",
|
|
7485
7470
|
"data-highlighted": d ? "" : void 0,
|
|
@@ -7571,7 +7556,7 @@ var Da = "MenuItemIndicator", [Fd, cb] = dr(
|
|
|
7571
7556
|
{
|
|
7572
7557
|
present: r || rs(s.checked) || s.checked === !0,
|
|
7573
7558
|
children: /* @__PURE__ */ u.jsx(
|
|
7574
|
-
|
|
7559
|
+
Ae.span,
|
|
7575
7560
|
{
|
|
7576
7561
|
...o,
|
|
7577
7562
|
ref: t,
|
|
@@ -7587,7 +7572,7 @@ var ub = "MenuSeparator", zd = v.forwardRef(
|
|
|
7587
7572
|
(e, t) => {
|
|
7588
7573
|
const { __scopeMenu: n, ...r } = e;
|
|
7589
7574
|
return /* @__PURE__ */ u.jsx(
|
|
7590
|
-
|
|
7575
|
+
Ae.div,
|
|
7591
7576
|
{
|
|
7592
7577
|
role: "separator",
|
|
7593
7578
|
"aria-orientation": "horizontal",
|
|
@@ -7793,7 +7778,7 @@ var Yd = "DropdownMenuTrigger", Xd = v.forwardRef(
|
|
|
7793
7778
|
(e, t) => {
|
|
7794
7779
|
const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = qd(Yd, n), i = Ut(n);
|
|
7795
7780
|
return /* @__PURE__ */ u.jsx(vb, { asChild: !0, ...i, children: /* @__PURE__ */ u.jsx(
|
|
7796
|
-
|
|
7781
|
+
Ae.button,
|
|
7797
7782
|
{
|
|
7798
7783
|
type: "button",
|
|
7799
7784
|
id: s.triggerId,
|
|
@@ -8116,10 +8101,10 @@ function p0(e, t) {
|
|
|
8116
8101
|
function yt(...e) {
|
|
8117
8102
|
return e;
|
|
8118
8103
|
}
|
|
8119
|
-
function
|
|
8104
|
+
function st(e, t) {
|
|
8120
8105
|
return e(Kn, t);
|
|
8121
8106
|
}
|
|
8122
|
-
function
|
|
8107
|
+
function Oe(e, t) {
|
|
8123
8108
|
e(zs, t);
|
|
8124
8109
|
}
|
|
8125
8110
|
function $a(e) {
|
|
@@ -8129,7 +8114,7 @@ function Rt(e) {
|
|
|
8129
8114
|
return e(vf);
|
|
8130
8115
|
}
|
|
8131
8116
|
function he(e, t) {
|
|
8132
|
-
return
|
|
8117
|
+
return st(e, d0(t, zs));
|
|
8133
8118
|
}
|
|
8134
8119
|
function pn(e, t) {
|
|
8135
8120
|
const n = e(Kn, (r) => {
|
|
@@ -8167,7 +8152,7 @@ function wn(e) {
|
|
|
8167
8152
|
t(e);
|
|
8168
8153
|
};
|
|
8169
8154
|
}
|
|
8170
|
-
function
|
|
8155
|
+
function U(e, ...t) {
|
|
8171
8156
|
const n = h0(...t);
|
|
8172
8157
|
return (r, o) => {
|
|
8173
8158
|
switch (r) {
|
|
@@ -8175,7 +8160,7 @@ function W(e, ...t) {
|
|
|
8175
8160
|
$a(e);
|
|
8176
8161
|
return;
|
|
8177
8162
|
case Kn:
|
|
8178
|
-
return
|
|
8163
|
+
return st(e, n(o));
|
|
8179
8164
|
}
|
|
8180
8165
|
};
|
|
8181
8166
|
}
|
|
@@ -8203,7 +8188,7 @@ function Le(...e) {
|
|
|
8203
8188
|
const o = Math.pow(2, e.length) - 1;
|
|
8204
8189
|
return e.forEach((s, i) => {
|
|
8205
8190
|
const a = Math.pow(2, i);
|
|
8206
|
-
|
|
8191
|
+
st(s, (l) => {
|
|
8207
8192
|
const c = n;
|
|
8208
8193
|
n = n | a, t[i] = l, c !== o && n === o && r && (r(), r = null);
|
|
8209
8194
|
});
|
|
@@ -8223,7 +8208,7 @@ function m0(e) {
|
|
|
8223
8208
|
return function(o, s) {
|
|
8224
8209
|
switch (o) {
|
|
8225
8210
|
case Kn:
|
|
8226
|
-
return s ? n === s ? void 0 : (r(), n = s, t =
|
|
8211
|
+
return s ? n === s ? void 0 : (r(), n = s, t = st(e, s), t) : (r(), Or);
|
|
8227
8212
|
case Pr:
|
|
8228
8213
|
r(), n = null;
|
|
8229
8214
|
return;
|
|
@@ -8274,7 +8259,7 @@ function We() {
|
|
|
8274
8259
|
function en(e) {
|
|
8275
8260
|
return Bs(We(), (t) => he(e, t));
|
|
8276
8261
|
}
|
|
8277
|
-
function
|
|
8262
|
+
function tt(e, t = [], { singleton: n } = { singleton: !0 }) {
|
|
8278
8263
|
return {
|
|
8279
8264
|
constructor: e,
|
|
8280
8265
|
dependencies: t,
|
|
@@ -8298,8 +8283,8 @@ function At(...e) {
|
|
|
8298
8283
|
const o = Math.pow(2, e.length) - 1;
|
|
8299
8284
|
return e.forEach((s, i) => {
|
|
8300
8285
|
const a = Math.pow(2, i);
|
|
8301
|
-
|
|
8302
|
-
n[i] = l, r = r | a, r === o &&
|
|
8286
|
+
st(s, (l) => {
|
|
8287
|
+
n[i] = l, r = r | a, r === o && Oe(t, n);
|
|
8303
8288
|
});
|
|
8304
8289
|
}), function(s, i) {
|
|
8305
8290
|
switch (s) {
|
|
@@ -8308,12 +8293,12 @@ function At(...e) {
|
|
|
8308
8293
|
return;
|
|
8309
8294
|
}
|
|
8310
8295
|
case Kn:
|
|
8311
|
-
return r === o && i(n),
|
|
8296
|
+
return r === o && i(n), st(t, i);
|
|
8312
8297
|
}
|
|
8313
8298
|
};
|
|
8314
8299
|
}
|
|
8315
8300
|
function Se(e, t = bf) {
|
|
8316
|
-
return
|
|
8301
|
+
return U(e, xt(t));
|
|
8317
8302
|
}
|
|
8318
8303
|
function Yi(...e) {
|
|
8319
8304
|
return function(t, n) {
|
|
@@ -8321,7 +8306,7 @@ function Yi(...e) {
|
|
|
8321
8306
|
case Pr:
|
|
8322
8307
|
return;
|
|
8323
8308
|
case Kn:
|
|
8324
|
-
return f0(...e.map((r) =>
|
|
8309
|
+
return f0(...e.map((r) => st(r, n)));
|
|
8325
8310
|
}
|
|
8326
8311
|
};
|
|
8327
8312
|
}
|
|
@@ -8331,7 +8316,7 @@ const y0 = {
|
|
|
8331
8316
|
3: "error",
|
|
8332
8317
|
1: "log",
|
|
8333
8318
|
2: "warn"
|
|
8334
|
-
}, v0 = () => typeof globalThis > "u" ? window : globalThis, qn =
|
|
8319
|
+
}, v0 = () => typeof globalThis > "u" ? window : globalThis, qn = tt(
|
|
8335
8320
|
() => {
|
|
8336
8321
|
const e = X(
|
|
8337
8322
|
3
|
|
@@ -8459,17 +8444,17 @@ function Sf(e, t, n) {
|
|
|
8459
8444
|
}
|
|
8460
8445
|
}, [a, t, i]), s;
|
|
8461
8446
|
}
|
|
8462
|
-
const Wt =
|
|
8447
|
+
const Wt = tt(
|
|
8463
8448
|
() => {
|
|
8464
8449
|
const e = We(), t = We(), n = X(0), r = We(), o = X(0), s = We(), i = We(), a = X(0), l = X(0), c = X(0), d = X(0), f = We(), p = We(), h = X(!1), m = X(!1), x = X(!1);
|
|
8465
8450
|
return he(
|
|
8466
|
-
|
|
8451
|
+
U(
|
|
8467
8452
|
e,
|
|
8468
8453
|
le(({ scrollTop: y }) => y)
|
|
8469
8454
|
),
|
|
8470
8455
|
t
|
|
8471
8456
|
), he(
|
|
8472
|
-
|
|
8457
|
+
U(
|
|
8473
8458
|
e,
|
|
8474
8459
|
le(({ scrollHeight: y }) => y)
|
|
8475
8460
|
),
|
|
@@ -8640,7 +8625,7 @@ function If(e, t) {
|
|
|
8640
8625
|
function oo(e, t) {
|
|
8641
8626
|
return !!(e && e[0] === t[0] && e[1] === t[1]);
|
|
8642
8627
|
}
|
|
8643
|
-
const Ba =
|
|
8628
|
+
const Ba = tt(
|
|
8644
8629
|
() => ({ recalcInProgress: X(!1) }),
|
|
8645
8630
|
[],
|
|
8646
8631
|
{ singleton: !0 }
|
|
@@ -8807,13 +8792,13 @@ function _0(e) {
|
|
|
8807
8792
|
const P0 = {
|
|
8808
8793
|
offsetHeight: "height",
|
|
8809
8794
|
offsetWidth: "width"
|
|
8810
|
-
}, En =
|
|
8795
|
+
}, En = tt(
|
|
8811
8796
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
8812
8797
|
const n = We(), r = We(), o = Ht(r, 0), s = We(), i = We(), a = X(0), l = X([]), c = X(void 0), d = X(void 0), f = X((C, S) => Un(C, P0[S])), p = X(void 0), h = X(0), m = T0(), x = Ht(
|
|
8813
|
-
|
|
8798
|
+
U(n, Le(l, e, h), Cn(N0, m), xt()),
|
|
8814
8799
|
m
|
|
8815
8800
|
), y = Ht(
|
|
8816
|
-
|
|
8801
|
+
U(
|
|
8817
8802
|
l,
|
|
8818
8803
|
xt(),
|
|
8819
8804
|
Cn((C, S) => ({ current: S, prev: C.current }), {
|
|
@@ -8825,7 +8810,7 @@ const P0 = {
|
|
|
8825
8810
|
[]
|
|
8826
8811
|
);
|
|
8827
8812
|
he(
|
|
8828
|
-
|
|
8813
|
+
U(
|
|
8829
8814
|
l,
|
|
8830
8815
|
Te((C) => C.length > 0),
|
|
8831
8816
|
Le(x, h),
|
|
@@ -8840,7 +8825,7 @@ const P0 = {
|
|
|
8840
8825
|
),
|
|
8841
8826
|
x
|
|
8842
8827
|
), he(
|
|
8843
|
-
|
|
8828
|
+
U(
|
|
8844
8829
|
r,
|
|
8845
8830
|
Le(x),
|
|
8846
8831
|
Te(([C, { lastIndex: S }]) => C < S),
|
|
@@ -8855,14 +8840,14 @@ const P0 = {
|
|
|
8855
8840
|
n
|
|
8856
8841
|
), he(c, d);
|
|
8857
8842
|
const g = Ht(
|
|
8858
|
-
|
|
8843
|
+
U(
|
|
8859
8844
|
c,
|
|
8860
8845
|
le((C) => C === void 0)
|
|
8861
8846
|
),
|
|
8862
8847
|
!0
|
|
8863
8848
|
);
|
|
8864
8849
|
he(
|
|
8865
|
-
|
|
8850
|
+
U(
|
|
8866
8851
|
d,
|
|
8867
8852
|
Te((C) => C !== void 0 && ft(Rt(x).sizeTree)),
|
|
8868
8853
|
le((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
|
|
@@ -8870,7 +8855,7 @@ const P0 = {
|
|
|
8870
8855
|
n
|
|
8871
8856
|
);
|
|
8872
8857
|
const w = en(
|
|
8873
|
-
|
|
8858
|
+
U(
|
|
8874
8859
|
n,
|
|
8875
8860
|
Le(x),
|
|
8876
8861
|
Cn(
|
|
@@ -8883,8 +8868,8 @@ const P0 = {
|
|
|
8883
8868
|
le((C) => C.changed)
|
|
8884
8869
|
)
|
|
8885
8870
|
);
|
|
8886
|
-
|
|
8887
|
-
|
|
8871
|
+
st(
|
|
8872
|
+
U(
|
|
8888
8873
|
a,
|
|
8889
8874
|
Cn(
|
|
8890
8875
|
(C, S) => ({ diff: C.prev - S, prev: S }),
|
|
@@ -8895,13 +8880,13 @@ const P0 = {
|
|
|
8895
8880
|
(C) => {
|
|
8896
8881
|
const { groupIndices: S } = Rt(x);
|
|
8897
8882
|
if (C > 0)
|
|
8898
|
-
|
|
8883
|
+
Oe(t, !0), Oe(s, C + yc(C, S));
|
|
8899
8884
|
else if (C < 0) {
|
|
8900
8885
|
const k = Rt(y);
|
|
8901
|
-
k.length > 0 && (C -= yc(-C, k)),
|
|
8886
|
+
k.length > 0 && (C -= yc(-C, k)), Oe(i, C);
|
|
8902
8887
|
}
|
|
8903
8888
|
}
|
|
8904
|
-
),
|
|
8889
|
+
), st(U(a, Le(e)), ([C, S]) => {
|
|
8905
8890
|
C < 0 && S(
|
|
8906
8891
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
8907
8892
|
{ firstItemIndex: a },
|
|
@@ -8910,7 +8895,7 @@ const P0 = {
|
|
|
8910
8895
|
});
|
|
8911
8896
|
const b = en(s);
|
|
8912
8897
|
he(
|
|
8913
|
-
|
|
8898
|
+
U(
|
|
8914
8899
|
s,
|
|
8915
8900
|
Le(x),
|
|
8916
8901
|
le(([C, S]) => {
|
|
@@ -8971,7 +8956,7 @@ const P0 = {
|
|
|
8971
8956
|
n
|
|
8972
8957
|
);
|
|
8973
8958
|
const T = en(
|
|
8974
|
-
|
|
8959
|
+
U(
|
|
8975
8960
|
i,
|
|
8976
8961
|
Le(x, h),
|
|
8977
8962
|
le(([C, { offsetTree: S }, k]) => {
|
|
@@ -8981,7 +8966,7 @@ const P0 = {
|
|
|
8981
8966
|
)
|
|
8982
8967
|
);
|
|
8983
8968
|
return he(
|
|
8984
|
-
|
|
8969
|
+
U(
|
|
8985
8970
|
i,
|
|
8986
8971
|
Le(x, h),
|
|
8987
8972
|
le(([C, S, k]) => {
|
|
@@ -9052,23 +9037,23 @@ function O0(e) {
|
|
|
9052
9037
|
}
|
|
9053
9038
|
);
|
|
9054
9039
|
}
|
|
9055
|
-
const _f =
|
|
9040
|
+
const _f = tt(
|
|
9056
9041
|
([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
|
|
9057
|
-
const s = We(), i = We(), a = en(
|
|
9042
|
+
const s = We(), i = We(), a = en(U(s, le(O0)));
|
|
9058
9043
|
return he(
|
|
9059
|
-
|
|
9044
|
+
U(
|
|
9060
9045
|
a,
|
|
9061
9046
|
le((l) => l.totalCount)
|
|
9062
9047
|
),
|
|
9063
9048
|
n
|
|
9064
9049
|
), he(
|
|
9065
|
-
|
|
9050
|
+
U(
|
|
9066
9051
|
a,
|
|
9067
9052
|
le((l) => l.groupIndices)
|
|
9068
9053
|
),
|
|
9069
9054
|
e
|
|
9070
9055
|
), he(
|
|
9071
|
-
|
|
9056
|
+
U(
|
|
9072
9057
|
At(o, t, r),
|
|
9073
9058
|
Te(([l, c]) => Us(c)),
|
|
9074
9059
|
le(([l, c, d]) => gn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
|
|
@@ -9079,16 +9064,16 @@ const _f = nt(
|
|
|
9079
9064
|
), { groupCounts: s, topItemsIndexes: i };
|
|
9080
9065
|
},
|
|
9081
9066
|
yt(En, Wt)
|
|
9082
|
-
), Gn =
|
|
9067
|
+
), Gn = tt(
|
|
9083
9068
|
([{ log: e }]) => {
|
|
9084
9069
|
const t = X(!1), n = en(
|
|
9085
|
-
|
|
9070
|
+
U(
|
|
9086
9071
|
t,
|
|
9087
9072
|
Te((r) => r),
|
|
9088
9073
|
xt()
|
|
9089
9074
|
)
|
|
9090
9075
|
);
|
|
9091
|
-
return
|
|
9076
|
+
return st(t, (r) => {
|
|
9092
9077
|
r && Rt(e)("props updated", {}, Xt.DEBUG);
|
|
9093
9078
|
}), { didMount: n, propsReady: t };
|
|
9094
9079
|
},
|
|
@@ -9099,7 +9084,7 @@ function Pf(e) {
|
|
|
9099
9084
|
const t = typeof e == "number" ? { index: e } : e;
|
|
9100
9085
|
return t.align || (t.align = "start"), (!t.behavior || !M0) && (t.behavior = "auto"), t.offset || (t.offset = 0), t;
|
|
9101
9086
|
}
|
|
9102
|
-
const vo =
|
|
9087
|
+
const vo = tt(
|
|
9103
9088
|
([
|
|
9104
9089
|
{ gap: e, listRefresh: t, sizes: n, totalCount: r },
|
|
9105
9090
|
{
|
|
@@ -9117,10 +9102,10 @@ const vo = nt(
|
|
|
9117
9102
|
const h = We(), m = We(), x = X(0);
|
|
9118
9103
|
let y = null, g = null, w = null;
|
|
9119
9104
|
function b() {
|
|
9120
|
-
y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null),
|
|
9105
|
+
y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Oe(l, !1);
|
|
9121
9106
|
}
|
|
9122
9107
|
return he(
|
|
9123
|
-
|
|
9108
|
+
U(
|
|
9124
9109
|
h,
|
|
9125
9110
|
Le(n, f, r, x, a, i, p),
|
|
9126
9111
|
Le(e, s, o),
|
|
@@ -9135,20 +9120,20 @@ const vo = nt(
|
|
|
9135
9120
|
let J = so(Z, C.offsetTree, L) + E;
|
|
9136
9121
|
A === "end" ? (J += F + gn(C.sizeTree, Z)[1] - S + j, Z === M && (J += I)) : A === "center" ? J += (F + gn(C.sizeTree, Z)[1] - S + j) / 2 : J -= N, D && (J += D);
|
|
9137
9122
|
const pe = (Re) => {
|
|
9138
|
-
b(), Re ? (O("retrying to scroll to", { location: T }, Xt.DEBUG),
|
|
9123
|
+
b(), Re ? (O("retrying to scroll to", { location: T }, Xt.DEBUG), Oe(h, T)) : (Oe(m, !0), O("list did not change, scroll successful", {}, Xt.DEBUG));
|
|
9139
9124
|
};
|
|
9140
9125
|
if (b(), B === "smooth") {
|
|
9141
9126
|
let Re = !1;
|
|
9142
|
-
w =
|
|
9143
|
-
Re = Re ||
|
|
9127
|
+
w = st(t, (Ee) => {
|
|
9128
|
+
Re = Re || Ee;
|
|
9144
9129
|
}), y = pn(d, () => {
|
|
9145
9130
|
pe(Re);
|
|
9146
9131
|
});
|
|
9147
9132
|
} else
|
|
9148
|
-
y = pn(
|
|
9133
|
+
y = pn(U(t, D0(150)), pe);
|
|
9149
9134
|
return g = setTimeout(() => {
|
|
9150
9135
|
b();
|
|
9151
|
-
}, 1200),
|
|
9136
|
+
}, 1200), Oe(l, !0), O("scrolling from index to", { behavior: B, index: Z, top: J }, Xt.DEBUG), { behavior: B, top: J };
|
|
9152
9137
|
}
|
|
9153
9138
|
)
|
|
9154
9139
|
),
|
|
@@ -9181,11 +9166,11 @@ function Wa(e, t) {
|
|
|
9181
9166
|
const n = t - 1;
|
|
9182
9167
|
return typeof e == "number" ? e : e.index === "LAST" ? n : e.index;
|
|
9183
9168
|
}
|
|
9184
|
-
const wo =
|
|
9169
|
+
const wo = tt(
|
|
9185
9170
|
([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
|
|
9186
9171
|
const a = X(!0), l = X(0), c = X(!0);
|
|
9187
9172
|
return he(
|
|
9188
|
-
|
|
9173
|
+
U(
|
|
9189
9174
|
i,
|
|
9190
9175
|
Le(l),
|
|
9191
9176
|
Te(([d, f]) => !!f),
|
|
@@ -9193,15 +9178,15 @@ const wo = nt(
|
|
|
9193
9178
|
),
|
|
9194
9179
|
a
|
|
9195
9180
|
), he(
|
|
9196
|
-
|
|
9181
|
+
U(
|
|
9197
9182
|
i,
|
|
9198
9183
|
Le(l),
|
|
9199
9184
|
Te(([d, f]) => !!f),
|
|
9200
9185
|
wn(!1)
|
|
9201
9186
|
),
|
|
9202
9187
|
c
|
|
9203
|
-
),
|
|
9204
|
-
|
|
9188
|
+
), st(
|
|
9189
|
+
U(
|
|
9205
9190
|
At(t, i),
|
|
9206
9191
|
Le(a, n, e, c),
|
|
9207
9192
|
Te(([[, d], f, { sizeTree: p }, h, m]) => d && (!ft(p) || Fa(h)) && !f && !m),
|
|
@@ -9209,11 +9194,11 @@ const wo = nt(
|
|
|
9209
9194
|
),
|
|
9210
9195
|
([, d]) => {
|
|
9211
9196
|
pn(o, () => {
|
|
9212
|
-
|
|
9197
|
+
Oe(c, !0);
|
|
9213
9198
|
}), Ua(4, () => {
|
|
9214
9199
|
pn(r, () => {
|
|
9215
|
-
|
|
9216
|
-
}),
|
|
9200
|
+
Oe(a, !0);
|
|
9201
|
+
}), Oe(s, d);
|
|
9217
9202
|
});
|
|
9218
9203
|
}
|
|
9219
9204
|
), {
|
|
@@ -9237,27 +9222,27 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9237
9222
|
scrollTop: 0,
|
|
9238
9223
|
viewportHeight: 0
|
|
9239
9224
|
}
|
|
9240
|
-
}, $0 = 0, bo =
|
|
9225
|
+
}, $0 = 0, bo = tt(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
9241
9226
|
const i = X(!1), a = X(!0), l = We(), c = We(), d = X(4), f = X($0), p = Ht(
|
|
9242
|
-
|
|
9243
|
-
Yi(
|
|
9227
|
+
U(
|
|
9228
|
+
Yi(U(Se(o), ar(1), wn(!0)), U(Se(o), ar(1), wn(!1), mc(100))),
|
|
9244
9229
|
xt()
|
|
9245
9230
|
),
|
|
9246
9231
|
!1
|
|
9247
9232
|
), h = Ht(
|
|
9248
|
-
|
|
9233
|
+
U(Yi(U(n, wn(!0)), U(n, wn(!1), mc(200))), xt()),
|
|
9249
9234
|
!1
|
|
9250
9235
|
);
|
|
9251
9236
|
he(
|
|
9252
|
-
|
|
9237
|
+
U(
|
|
9253
9238
|
At(Se(o), Se(f)),
|
|
9254
9239
|
le(([w, b]) => w <= b),
|
|
9255
9240
|
xt()
|
|
9256
9241
|
),
|
|
9257
9242
|
a
|
|
9258
|
-
), he(
|
|
9243
|
+
), he(U(a, An(50)), c);
|
|
9259
9244
|
const m = en(
|
|
9260
|
-
|
|
9245
|
+
U(
|
|
9261
9246
|
At(r, Se(s), Se(t), Se(e), Se(d)),
|
|
9262
9247
|
Cn((w, [{ scrollHeight: b, scrollTop: T }, C, S, k, N]) => {
|
|
9263
9248
|
const E = T + C - b > -N, I = {
|
|
@@ -9284,7 +9269,7 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9284
9269
|
xt((w, b) => w && w.atBottom === b.atBottom)
|
|
9285
9270
|
)
|
|
9286
9271
|
), x = Ht(
|
|
9287
|
-
|
|
9272
|
+
U(
|
|
9288
9273
|
r,
|
|
9289
9274
|
Cn(
|
|
9290
9275
|
(w, { scrollHeight: b, scrollTop: T, viewportHeight: C }) => {
|
|
@@ -9318,15 +9303,15 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9318
9303
|
0
|
|
9319
9304
|
);
|
|
9320
9305
|
he(
|
|
9321
|
-
|
|
9306
|
+
U(
|
|
9322
9307
|
m,
|
|
9323
9308
|
le((w) => w.atBottom)
|
|
9324
9309
|
),
|
|
9325
9310
|
i
|
|
9326
|
-
), he(
|
|
9311
|
+
), he(U(i, An(50)), l);
|
|
9327
9312
|
const y = X(Vr);
|
|
9328
9313
|
he(
|
|
9329
|
-
|
|
9314
|
+
U(
|
|
9330
9315
|
r,
|
|
9331
9316
|
le(({ scrollTop: w }) => w),
|
|
9332
9317
|
xt(),
|
|
@@ -9337,17 +9322,17 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
|
|
|
9337
9322
|
le((w) => w.direction)
|
|
9338
9323
|
),
|
|
9339
9324
|
y
|
|
9340
|
-
), he(
|
|
9325
|
+
), he(U(r, An(50), wn(L0)), y);
|
|
9341
9326
|
const g = X(0);
|
|
9342
9327
|
return he(
|
|
9343
|
-
|
|
9328
|
+
U(
|
|
9344
9329
|
p,
|
|
9345
9330
|
Te((w) => !w),
|
|
9346
9331
|
wn(0)
|
|
9347
9332
|
),
|
|
9348
9333
|
g
|
|
9349
9334
|
), he(
|
|
9350
|
-
|
|
9335
|
+
U(
|
|
9351
9336
|
o,
|
|
9352
9337
|
An(100),
|
|
9353
9338
|
Le(p),
|
|
@@ -9377,10 +9362,10 @@ function bc(e, t) {
|
|
|
9377
9362
|
var n;
|
|
9378
9363
|
return typeof e == "number" ? e : (n = e[t]) != null ? n : 0;
|
|
9379
9364
|
}
|
|
9380
|
-
const Va =
|
|
9365
|
+
const Va = tt(
|
|
9381
9366
|
([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
|
|
9382
9367
|
const s = We(), i = X(0), a = X(0), l = X(0), c = Ht(
|
|
9383
|
-
|
|
9368
|
+
U(
|
|
9384
9369
|
At(
|
|
9385
9370
|
Se(r),
|
|
9386
9371
|
Se(o),
|
|
@@ -9515,7 +9500,7 @@ function Sc(e, t, n) {
|
|
|
9515
9500
|
}
|
|
9516
9501
|
return s;
|
|
9517
9502
|
}
|
|
9518
|
-
const hr =
|
|
9503
|
+
const hr = tt(
|
|
9519
9504
|
([
|
|
9520
9505
|
{ data: e, firstItemIndex: t, gap: n, sizes: r, totalCount: o },
|
|
9521
9506
|
s,
|
|
@@ -9529,7 +9514,7 @@ const hr = nt(
|
|
|
9529
9514
|
const x = X([]), y = X(0), g = We();
|
|
9530
9515
|
he(s.topItemsIndexes, x);
|
|
9531
9516
|
const w = Ht(
|
|
9532
|
-
|
|
9517
|
+
U(
|
|
9533
9518
|
At(
|
|
9534
9519
|
h,
|
|
9535
9520
|
m,
|
|
@@ -9577,10 +9562,10 @@ const hr = nt(
|
|
|
9577
9562
|
);
|
|
9578
9563
|
const Z = [];
|
|
9579
9564
|
if (L.length > 0) {
|
|
9580
|
-
const
|
|
9565
|
+
const W = L[0], ee = L[L.length - 1];
|
|
9581
9566
|
let q = 0;
|
|
9582
|
-
for (const P of Hs(D,
|
|
9583
|
-
const H = P.value, te = Math.max(P.start,
|
|
9567
|
+
for (const P of Hs(D, W, ee)) {
|
|
9568
|
+
const H = P.value, te = Math.max(P.start, W), se = Math.min(P.end, ee);
|
|
9584
9569
|
for (let ne = te; ne <= se; ne++)
|
|
9585
9570
|
Z.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: q, size: H }), q += H;
|
|
9586
9571
|
}
|
|
@@ -9590,7 +9575,7 @@ const hr = nt(
|
|
|
9590
9575
|
const J = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = I0(B, S, k, J);
|
|
9591
9576
|
if (pe.length === 0)
|
|
9592
9577
|
return null;
|
|
9593
|
-
const Re = N - 1,
|
|
9578
|
+
const Re = N - 1, Ee = Bs([], (W) => {
|
|
9594
9579
|
for (const ee of pe) {
|
|
9595
9580
|
const q = ee.value;
|
|
9596
9581
|
let P = q.offset, H = ee.start;
|
|
@@ -9603,10 +9588,10 @@ const hr = nt(
|
|
|
9603
9588
|
H < J && (P += (J - H) * te, H = J);
|
|
9604
9589
|
const se = Math.min(ee.end, Re);
|
|
9605
9590
|
for (let ne = H; ne <= se && !(P >= k); ne++)
|
|
9606
|
-
|
|
9591
|
+
W.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: P, size: te }), P += te + j;
|
|
9607
9592
|
}
|
|
9608
9593
|
});
|
|
9609
|
-
return Ko(
|
|
9594
|
+
return Ko(Ee, Z, N, j, A, F);
|
|
9610
9595
|
}
|
|
9611
9596
|
),
|
|
9612
9597
|
//@ts-expect-error filter needs to be fixed
|
|
@@ -9616,33 +9601,33 @@ const hr = nt(
|
|
|
9616
9601
|
Ti
|
|
9617
9602
|
);
|
|
9618
9603
|
he(
|
|
9619
|
-
|
|
9604
|
+
U(
|
|
9620
9605
|
e,
|
|
9621
9606
|
Te(Fa),
|
|
9622
9607
|
le((S) => S == null ? void 0 : S.length)
|
|
9623
9608
|
),
|
|
9624
9609
|
o
|
|
9625
9610
|
), he(
|
|
9626
|
-
|
|
9611
|
+
U(
|
|
9627
9612
|
w,
|
|
9628
9613
|
le((S) => S.topListHeight)
|
|
9629
9614
|
),
|
|
9630
9615
|
f
|
|
9631
9616
|
), he(f, a), he(
|
|
9632
|
-
|
|
9617
|
+
U(
|
|
9633
9618
|
w,
|
|
9634
9619
|
le((S) => [S.top, S.bottom])
|
|
9635
9620
|
),
|
|
9636
9621
|
i
|
|
9637
9622
|
), he(
|
|
9638
|
-
|
|
9623
|
+
U(
|
|
9639
9624
|
w,
|
|
9640
9625
|
le((S) => S.items)
|
|
9641
9626
|
),
|
|
9642
9627
|
g
|
|
9643
9628
|
);
|
|
9644
9629
|
const b = en(
|
|
9645
|
-
|
|
9630
|
+
U(
|
|
9646
9631
|
w,
|
|
9647
9632
|
Te(({ items: S }) => S.length > 0),
|
|
9648
9633
|
Le(o, e),
|
|
@@ -9652,7 +9637,7 @@ const hr = nt(
|
|
|
9652
9637
|
le(([S]) => S)
|
|
9653
9638
|
)
|
|
9654
9639
|
), T = en(
|
|
9655
|
-
|
|
9640
|
+
U(
|
|
9656
9641
|
w,
|
|
9657
9642
|
An(200),
|
|
9658
9643
|
Te(({ items: S, topItems: k }) => S.length > 0 && S[0].originalIndex === k.length),
|
|
@@ -9660,7 +9645,7 @@ const hr = nt(
|
|
|
9660
9645
|
xt()
|
|
9661
9646
|
)
|
|
9662
9647
|
), C = en(
|
|
9663
|
-
|
|
9648
|
+
U(
|
|
9664
9649
|
w,
|
|
9665
9650
|
Te(({ items: S }) => S.length > 0),
|
|
9666
9651
|
le(({ items: S }) => {
|
|
@@ -9690,10 +9675,10 @@ const hr = nt(
|
|
|
9690
9675
|
Ba
|
|
9691
9676
|
),
|
|
9692
9677
|
{ singleton: !0 }
|
|
9693
|
-
), Df =
|
|
9678
|
+
), Df = tt(
|
|
9694
9679
|
([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
|
|
9695
9680
|
const s = We(), i = Ht(
|
|
9696
|
-
|
|
9681
|
+
U(
|
|
9697
9682
|
At(n, e, r, t, o),
|
|
9698
9683
|
le(([a, l, c, d, f]) => a + l + c + d + f.offsetBottom + f.bottom)
|
|
9699
9684
|
),
|
|
@@ -9703,10 +9688,10 @@ const hr = nt(
|
|
|
9703
9688
|
},
|
|
9704
9689
|
yt(Wt, hr),
|
|
9705
9690
|
{ singleton: !0 }
|
|
9706
|
-
), B0 =
|
|
9691
|
+
), B0 = tt(
|
|
9707
9692
|
([{ viewportHeight: e }, { totalListHeight: t }]) => {
|
|
9708
9693
|
const n = X(!1), r = Ht(
|
|
9709
|
-
|
|
9694
|
+
U(
|
|
9710
9695
|
At(n, e, t),
|
|
9711
9696
|
Te(([o]) => o),
|
|
9712
9697
|
le(([, o, s]) => Math.max(0, o - s)),
|
|
@@ -9719,7 +9704,7 @@ const hr = nt(
|
|
|
9719
9704
|
},
|
|
9720
9705
|
yt(Wt, Df),
|
|
9721
9706
|
{ singleton: !0 }
|
|
9722
|
-
), Lf =
|
|
9707
|
+
), Lf = tt(() => ({
|
|
9723
9708
|
context: X(null)
|
|
9724
9709
|
})), H0 = ({
|
|
9725
9710
|
itemBottom: e,
|
|
@@ -9727,7 +9712,7 @@ const hr = nt(
|
|
|
9727
9712
|
locationParams: { align: n, behavior: r, ...o },
|
|
9728
9713
|
viewportBottom: s,
|
|
9729
9714
|
viewportTop: i
|
|
9730
|
-
}) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Ff =
|
|
9715
|
+
}) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Ff = tt(
|
|
9731
9716
|
([
|
|
9732
9717
|
{ gap: e, sizes: t, totalCount: n },
|
|
9733
9718
|
{ fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: l },
|
|
@@ -9735,7 +9720,7 @@ const hr = nt(
|
|
|
9735
9720
|
]) => {
|
|
9736
9721
|
const d = We();
|
|
9737
9722
|
return he(
|
|
9738
|
-
|
|
9723
|
+
U(
|
|
9739
9724
|
d,
|
|
9740
9725
|
Le(t, l, n, s, o, r, a),
|
|
9741
9726
|
Le(e),
|
|
@@ -9748,7 +9733,7 @@ const hr = nt(
|
|
|
9748
9733
|
viewportTop: L
|
|
9749
9734
|
});
|
|
9750
9735
|
return j ? k && pn(
|
|
9751
|
-
|
|
9736
|
+
U(
|
|
9752
9737
|
i,
|
|
9753
9738
|
Te(($) => !$),
|
|
9754
9739
|
// skips the initial publish of false, and the cleanup call.
|
|
@@ -9771,7 +9756,7 @@ const hr = nt(
|
|
|
9771
9756
|
function Cc(e) {
|
|
9772
9757
|
return e ? e === "smooth" ? "smooth" : "auto" : !1;
|
|
9773
9758
|
}
|
|
9774
|
-
const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 =
|
|
9759
|
+
const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
|
|
9775
9760
|
([
|
|
9776
9761
|
{ listRefresh: e, totalCount: t, fixedItemSize: n, data: r },
|
|
9777
9762
|
{ atBottomState: o, isAtBottom: s },
|
|
@@ -9786,15 +9771,15 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9786
9771
|
const m = X(!1), x = We();
|
|
9787
9772
|
let y = null;
|
|
9788
9773
|
function g(C) {
|
|
9789
|
-
|
|
9774
|
+
Oe(i, {
|
|
9790
9775
|
align: "end",
|
|
9791
9776
|
behavior: C,
|
|
9792
9777
|
index: "LAST"
|
|
9793
9778
|
});
|
|
9794
9779
|
}
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
At(
|
|
9780
|
+
st(
|
|
9781
|
+
U(
|
|
9782
|
+
At(U(Se(t), ar(1)), l),
|
|
9798
9783
|
Le(Se(m), s, a, f),
|
|
9799
9784
|
le(([[C, S], k, N, E, I]) => {
|
|
9800
9785
|
let O = S && E, L = "auto";
|
|
@@ -9816,8 +9801,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9816
9801
|
});
|
|
9817
9802
|
setTimeout(S, 100);
|
|
9818
9803
|
}
|
|
9819
|
-
|
|
9820
|
-
|
|
9804
|
+
st(
|
|
9805
|
+
U(
|
|
9821
9806
|
At(Se(m), t, c),
|
|
9822
9807
|
Te(([C, , S]) => C && S),
|
|
9823
9808
|
Cn(
|
|
@@ -9830,27 +9815,27 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9830
9815
|
([, C]) => {
|
|
9831
9816
|
Rt(a) && w(C !== !1);
|
|
9832
9817
|
}
|
|
9833
|
-
),
|
|
9818
|
+
), st(x, () => {
|
|
9834
9819
|
w(Rt(m) !== !1);
|
|
9835
|
-
}),
|
|
9820
|
+
}), st(At(Se(m), o), ([C, S]) => {
|
|
9836
9821
|
C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
|
|
9837
9822
|
});
|
|
9838
9823
|
const b = X(null), T = We();
|
|
9839
9824
|
return he(
|
|
9840
9825
|
Yi(
|
|
9841
|
-
|
|
9826
|
+
U(
|
|
9842
9827
|
Se(r),
|
|
9843
9828
|
le((C) => {
|
|
9844
9829
|
var S;
|
|
9845
9830
|
return (S = C == null ? void 0 : C.length) != null ? S : 0;
|
|
9846
9831
|
})
|
|
9847
9832
|
),
|
|
9848
|
-
|
|
9833
|
+
U(Se(t))
|
|
9849
9834
|
),
|
|
9850
9835
|
T
|
|
9851
|
-
),
|
|
9852
|
-
|
|
9853
|
-
At(
|
|
9836
|
+
), st(
|
|
9837
|
+
U(
|
|
9838
|
+
At(U(T, ar(1)), l),
|
|
9854
9839
|
Le(Se(b), a, f, p),
|
|
9855
9840
|
le(([[C, S], k, N, E, I]) => S && N && (k == null ? void 0 : k({ context: I, totalCount: C, scrollingInProgress: E }))),
|
|
9856
9841
|
Te((C) => !!C),
|
|
@@ -9858,9 +9843,9 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9858
9843
|
),
|
|
9859
9844
|
(C) => {
|
|
9860
9845
|
y && (y(), y = null), Rt(n) ? requestAnimationFrame(() => {
|
|
9861
|
-
Rt(d)("scrolling into view", {}),
|
|
9846
|
+
Rt(d)("scrolling into view", {}), Oe(h, C);
|
|
9862
9847
|
}) : y = pn(e, () => {
|
|
9863
|
-
Rt(d)("scrolling into view", {}),
|
|
9848
|
+
Rt(d)("scrolling into view", {}), Oe(h, C), y = null;
|
|
9864
9849
|
});
|
|
9865
9850
|
}
|
|
9866
9851
|
), { autoscrollToBottom: x, followOutput: m, scrollIntoViewOnChange: b };
|
|
@@ -9876,9 +9861,9 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9876
9861
|
Lf,
|
|
9877
9862
|
Ff
|
|
9878
9863
|
)
|
|
9879
|
-
), V0 =
|
|
9864
|
+
), V0 = tt(
|
|
9880
9865
|
([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (he(
|
|
9881
|
-
|
|
9866
|
+
U(
|
|
9882
9867
|
a,
|
|
9883
9868
|
Le(s),
|
|
9884
9869
|
Te(([, l]) => l !== 0),
|
|
@@ -9889,11 +9874,11 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9889
9874
|
), {}),
|
|
9890
9875
|
yt(En, wo, hr, Gn),
|
|
9891
9876
|
{ singleton: !0 }
|
|
9892
|
-
), K0 =
|
|
9877
|
+
), K0 = tt(
|
|
9893
9878
|
([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
|
|
9894
9879
|
const r = X(0);
|
|
9895
|
-
return
|
|
9896
|
-
|
|
9880
|
+
return st(
|
|
9881
|
+
U(
|
|
9897
9882
|
e,
|
|
9898
9883
|
Le(r),
|
|
9899
9884
|
Te(([, o]) => o !== 0),
|
|
@@ -9901,14 +9886,14 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9901
9886
|
),
|
|
9902
9887
|
(o) => {
|
|
9903
9888
|
pn(
|
|
9904
|
-
|
|
9889
|
+
U(
|
|
9905
9890
|
n,
|
|
9906
9891
|
ar(1),
|
|
9907
9892
|
Te((s) => s.items.length > 1)
|
|
9908
9893
|
),
|
|
9909
9894
|
() => {
|
|
9910
9895
|
requestAnimationFrame(() => {
|
|
9911
|
-
|
|
9896
|
+
Oe(t, o);
|
|
9912
9897
|
});
|
|
9913
9898
|
}
|
|
9914
9899
|
);
|
|
@@ -9919,11 +9904,11 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9919
9904
|
},
|
|
9920
9905
|
yt(Gn, Wt, hr),
|
|
9921
9906
|
{ singleton: !0 }
|
|
9922
|
-
), $f =
|
|
9907
|
+
), $f = tt(
|
|
9923
9908
|
([{ scrollVelocity: e }]) => {
|
|
9924
9909
|
const t = X(!1), n = We(), r = X(!1);
|
|
9925
9910
|
return he(
|
|
9926
|
-
|
|
9911
|
+
U(
|
|
9927
9912
|
e,
|
|
9928
9913
|
Le(r, t, n),
|
|
9929
9914
|
Te(([o, s]) => !!s),
|
|
@@ -9939,8 +9924,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9939
9924
|
xt()
|
|
9940
9925
|
),
|
|
9941
9926
|
t
|
|
9942
|
-
),
|
|
9943
|
-
|
|
9927
|
+
), st(
|
|
9928
|
+
U(At(t, e, n), Le(r)),
|
|
9944
9929
|
([[o, s, i], a]) => {
|
|
9945
9930
|
o && a && a.change && a.change(s, i);
|
|
9946
9931
|
}
|
|
@@ -9948,10 +9933,10 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9948
9933
|
},
|
|
9949
9934
|
yt(bo),
|
|
9950
9935
|
{ singleton: !0 }
|
|
9951
|
-
), Ka =
|
|
9936
|
+
), Ka = tt(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
9952
9937
|
const n = We(), r = We(), o = We(), s = X(!1), i = X(void 0);
|
|
9953
9938
|
return he(
|
|
9954
|
-
|
|
9939
|
+
U(
|
|
9955
9940
|
At(n, r),
|
|
9956
9941
|
le(([{ scrollHeight: a, scrollTop: l, viewportHeight: c }, { offsetTop: d }]) => ({
|
|
9957
9942
|
scrollHeight: a,
|
|
@@ -9961,7 +9946,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9961
9946
|
),
|
|
9962
9947
|
e
|
|
9963
9948
|
), he(
|
|
9964
|
-
|
|
9949
|
+
U(
|
|
9965
9950
|
t,
|
|
9966
9951
|
Le(r),
|
|
9967
9952
|
le(([a, { offsetTop: l }]) => ({
|
|
@@ -9980,7 +9965,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9980
9965
|
windowScrollTo: o,
|
|
9981
9966
|
windowViewportRect: r
|
|
9982
9967
|
};
|
|
9983
|
-
}, yt(Wt)), q0 =
|
|
9968
|
+
}, yt(Wt)), q0 = tt(
|
|
9984
9969
|
([
|
|
9985
9970
|
{ sizeRanges: e, sizes: t },
|
|
9986
9971
|
{ headerHeight: n, scrollTop: r },
|
|
@@ -9989,8 +9974,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9989
9974
|
{ useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
|
|
9990
9975
|
]) => {
|
|
9991
9976
|
const c = We(), d = X(void 0), f = X(null), p = X(null);
|
|
9992
|
-
return he(a, f), he(l, p),
|
|
9993
|
-
|
|
9977
|
+
return he(a, f), he(l, p), st(
|
|
9978
|
+
U(
|
|
9994
9979
|
c,
|
|
9995
9980
|
Le(t, r, i, f, p, n)
|
|
9996
9981
|
),
|
|
@@ -9998,8 +9983,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
9998
9983
|
const T = A0(m.sizeTree);
|
|
9999
9984
|
y && g !== null && w !== null && (x = g.scrollTop - w.offsetTop), x -= b, h({ ranges: T, scrollTop: x });
|
|
10000
9985
|
}
|
|
10001
|
-
), he(
|
|
10002
|
-
|
|
9986
|
+
), he(U(d, Te(Fa), le(G0)), o), he(
|
|
9987
|
+
U(
|
|
10003
9988
|
s,
|
|
10004
9989
|
Le(d),
|
|
10005
9990
|
Te(([, h]) => h !== void 0),
|
|
@@ -10017,10 +10002,10 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
|
|
|
10017
10002
|
function G0(e) {
|
|
10018
10003
|
return { align: "start", index: 0, offset: e.scrollTop };
|
|
10019
10004
|
}
|
|
10020
|
-
const Y0 =
|
|
10005
|
+
const Y0 = tt(([{ topItemsIndexes: e }]) => {
|
|
10021
10006
|
const t = X(0);
|
|
10022
10007
|
return he(
|
|
10023
|
-
|
|
10008
|
+
U(
|
|
10024
10009
|
t,
|
|
10025
10010
|
Te((n) => n >= 0),
|
|
10026
10011
|
le((n) => Array.from({ length: n }).map((r, o) => o))
|
|
@@ -10032,7 +10017,7 @@ function zf(e) {
|
|
|
10032
10017
|
let t = !1, n;
|
|
10033
10018
|
return () => (t || (t = !0, n = e()), n);
|
|
10034
10019
|
}
|
|
10035
|
-
const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), J0 =
|
|
10020
|
+
const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), J0 = tt(
|
|
10036
10021
|
([
|
|
10037
10022
|
{ deviation: e, scrollBy: t, scrollingInProgress: n, scrollTop: r },
|
|
10038
10023
|
{ isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
|
|
@@ -10042,7 +10027,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10042
10027
|
{ recalcInProgress: m }
|
|
10043
10028
|
]) => {
|
|
10044
10029
|
const x = en(
|
|
10045
|
-
|
|
10030
|
+
U(
|
|
10046
10031
|
l,
|
|
10047
10032
|
Le(i),
|
|
10048
10033
|
Cn(
|
|
@@ -10060,12 +10045,12 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10060
10045
|
)
|
|
10061
10046
|
);
|
|
10062
10047
|
function y(g) {
|
|
10063
|
-
g > 0 ? (
|
|
10048
|
+
g > 0 ? (Oe(t, { behavior: "auto", top: -g }), Oe(e, 0)) : (Oe(e, 0), Oe(t, { behavior: "auto", top: -g }));
|
|
10064
10049
|
}
|
|
10065
|
-
return
|
|
10066
|
-
b && X0() ?
|
|
10067
|
-
}),
|
|
10068
|
-
|
|
10050
|
+
return st(U(x, Le(e, s)), ([g, w, b]) => {
|
|
10051
|
+
b && X0() ? Oe(e, w - g) : y(-g);
|
|
10052
|
+
}), st(
|
|
10053
|
+
U(
|
|
10069
10054
|
At(Ht(s, !1), e, m),
|
|
10070
10055
|
Te(([g, w, b]) => !g && !b && w !== 0),
|
|
10071
10056
|
le(([g, w]) => w),
|
|
@@ -10073,13 +10058,13 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10073
10058
|
),
|
|
10074
10059
|
y
|
|
10075
10060
|
), he(
|
|
10076
|
-
|
|
10061
|
+
U(
|
|
10077
10062
|
f,
|
|
10078
10063
|
le((g) => ({ top: -g }))
|
|
10079
10064
|
),
|
|
10080
10065
|
t
|
|
10081
|
-
),
|
|
10082
|
-
|
|
10066
|
+
), st(
|
|
10067
|
+
U(
|
|
10083
10068
|
c,
|
|
10084
10069
|
Le(p, d),
|
|
10085
10070
|
le(([g, { groupIndices: w, lastSize: b, sizeTree: T }, C]) => {
|
|
@@ -10102,16 +10087,16 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10102
10087
|
})
|
|
10103
10088
|
),
|
|
10104
10089
|
(g) => {
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10090
|
+
Oe(e, g), requestAnimationFrame(() => {
|
|
10091
|
+
Oe(t, { top: g }), requestAnimationFrame(() => {
|
|
10092
|
+
Oe(e, 0), Oe(m, !1);
|
|
10108
10093
|
});
|
|
10109
10094
|
});
|
|
10110
10095
|
}
|
|
10111
10096
|
), { deviation: e };
|
|
10112
10097
|
},
|
|
10113
10098
|
yt(Wt, bo, hr, En, qn, Ba)
|
|
10114
|
-
), Z0 =
|
|
10099
|
+
), Z0 = tt(
|
|
10115
10100
|
([
|
|
10116
10101
|
e,
|
|
10117
10102
|
t,
|
|
@@ -10150,7 +10135,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10150
10135
|
qn,
|
|
10151
10136
|
Lf
|
|
10152
10137
|
)
|
|
10153
|
-
), Bf =
|
|
10138
|
+
), Bf = tt(
|
|
10154
10139
|
([
|
|
10155
10140
|
{
|
|
10156
10141
|
data: e,
|
|
@@ -10177,7 +10162,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
10177
10162
|
{ groupCounts: N },
|
|
10178
10163
|
E
|
|
10179
10164
|
]) => (he(T.rangeChanged, E.scrollSeekRangeChanged), he(
|
|
10180
|
-
|
|
10165
|
+
U(
|
|
10181
10166
|
E.windowViewportRect,
|
|
10182
10167
|
le((I) => I.visibleHeight)
|
|
10183
10168
|
),
|
|
@@ -10241,22 +10226,22 @@ const _o = typeof document < "u" ? z.useLayoutEffect : z.useEffect;
|
|
|
10241
10226
|
function Hf(e, t, n) {
|
|
10242
10227
|
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = z.createContext({});
|
|
10243
10228
|
function l(y, g) {
|
|
10244
|
-
y.propsReady &&
|
|
10229
|
+
y.propsReady && Oe(y.propsReady, !1);
|
|
10245
10230
|
for (const w of r) {
|
|
10246
10231
|
const b = y[t.required[w]];
|
|
10247
|
-
|
|
10232
|
+
Oe(b, g[w]);
|
|
10248
10233
|
}
|
|
10249
10234
|
for (const w of o)
|
|
10250
10235
|
if (w in g) {
|
|
10251
10236
|
const b = y[t.optional[w]];
|
|
10252
|
-
|
|
10237
|
+
Oe(b, g[w]);
|
|
10253
10238
|
}
|
|
10254
|
-
y.propsReady &&
|
|
10239
|
+
y.propsReady && Oe(y.propsReady, !0);
|
|
10255
10240
|
}
|
|
10256
10241
|
function c(y) {
|
|
10257
10242
|
return s.reduce((g, w) => (g[w] = (b) => {
|
|
10258
10243
|
const T = y[t.methods[w]];
|
|
10259
|
-
|
|
10244
|
+
Oe(T, b);
|
|
10260
10245
|
}, g), {});
|
|
10261
10246
|
}
|
|
10262
10247
|
function d(y) {
|
|
@@ -10268,7 +10253,7 @@ function Hf(e, t, n) {
|
|
|
10268
10253
|
})), [C] = z.useState(hc(d, T));
|
|
10269
10254
|
_o(() => {
|
|
10270
10255
|
for (const k of i)
|
|
10271
|
-
k in b &&
|
|
10256
|
+
k in b && st(C[k], b[k]);
|
|
10272
10257
|
return () => {
|
|
10273
10258
|
Object.values(C).map($a);
|
|
10274
10259
|
};
|
|
@@ -10281,13 +10266,13 @@ function Hf(e, t, n) {
|
|
|
10281
10266
|
const g = z.useContext(a);
|
|
10282
10267
|
return z.useCallback(
|
|
10283
10268
|
(w) => {
|
|
10284
|
-
|
|
10269
|
+
Oe(g[y], w);
|
|
10285
10270
|
},
|
|
10286
10271
|
[g, y]
|
|
10287
10272
|
);
|
|
10288
10273
|
}, h = (y) => {
|
|
10289
10274
|
const g = z.useContext(a)[y], w = z.useCallback(
|
|
10290
|
-
(b) =>
|
|
10275
|
+
(b) => st(g, b),
|
|
10291
10276
|
[g]
|
|
10292
10277
|
);
|
|
10293
10278
|
return z.useSyncExternalStore(
|
|
@@ -10298,7 +10283,7 @@ function Hf(e, t, n) {
|
|
|
10298
10283
|
}, m = (y) => {
|
|
10299
10284
|
const g = z.useContext(a)[y], [w, b] = z.useState(hc(Rt, g));
|
|
10300
10285
|
return _o(
|
|
10301
|
-
() =>
|
|
10286
|
+
() => st(g, (T) => {
|
|
10302
10287
|
T !== w && b(pc(T));
|
|
10303
10288
|
}),
|
|
10304
10289
|
[g, w]
|
|
@@ -10308,7 +10293,7 @@ function Hf(e, t, n) {
|
|
|
10308
10293
|
Component: f,
|
|
10309
10294
|
useEmitter: (y, g) => {
|
|
10310
10295
|
const w = z.useContext(a)[y];
|
|
10311
|
-
_o(() =>
|
|
10296
|
+
_o(() => st(w, g), [g, w]);
|
|
10312
10297
|
},
|
|
10313
10298
|
useEmitterValue: x,
|
|
10314
10299
|
usePublisher: p
|
|
@@ -10381,9 +10366,9 @@ const Ri = "-webkit-sticky", Tc = "sticky", qa = zf(() => {
|
|
|
10381
10366
|
function Ga(e) {
|
|
10382
10367
|
return e;
|
|
10383
10368
|
}
|
|
10384
|
-
const tS = /* @__PURE__ */
|
|
10369
|
+
const tS = /* @__PURE__ */ tt(() => {
|
|
10385
10370
|
const e = X((a) => `Item ${a}`), t = X((a) => `Group ${a}`), n = X({}), r = X(Ga), o = X("div"), s = X(Or), i = (a, l = null) => Ht(
|
|
10386
|
-
|
|
10371
|
+
U(
|
|
10387
10372
|
n,
|
|
10388
10373
|
le((c) => c[a]),
|
|
10389
10374
|
xt()
|
|
@@ -10407,11 +10392,11 @@ const tS = /* @__PURE__ */ nt(() => {
|
|
|
10407
10392
|
ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
|
|
10408
10393
|
TopItemListComponent: i("TopItemList")
|
|
10409
10394
|
};
|
|
10410
|
-
}), nS = /* @__PURE__ */
|
|
10395
|
+
}), nS = /* @__PURE__ */ tt(
|
|
10411
10396
|
([e, t]) => ({ ...e, ...t }),
|
|
10412
10397
|
yt(Bf, tS)
|
|
10413
10398
|
), 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 }) {
|
|
10414
|
-
const t =
|
|
10399
|
+
const t = Ie("listState"), n = on("sizeRanges"), r = Ie("useWindowScroll"), o = Ie("customScrollParent"), s = on("windowScrollContainerState"), i = on("scrollContainerState"), a = o || r ? s : i, l = Ie("itemContent"), c = Ie("context"), d = Ie("groupContent"), f = Ie("trackItemSizes"), p = Ie("itemSize"), h = Ie("log"), m = on("gap"), x = Ie("horizontalDirection"), { callbackRef: y } = w0(
|
|
10415
10400
|
n,
|
|
10416
10401
|
p,
|
|
10417
10402
|
f,
|
|
@@ -10420,12 +10405,12 @@ const tS = /* @__PURE__ */ nt(() => {
|
|
|
10420
10405
|
m,
|
|
10421
10406
|
o,
|
|
10422
10407
|
x,
|
|
10423
|
-
|
|
10408
|
+
Ie("skipAnimationFrameInResizeObserver")
|
|
10424
10409
|
), [g, w] = z.useState(0);
|
|
10425
10410
|
Ya("deviation", (j) => {
|
|
10426
10411
|
g !== j && w(j);
|
|
10427
10412
|
});
|
|
10428
|
-
const b =
|
|
10413
|
+
const b = Ie("EmptyPlaceholder"), T = Ie("ScrollSeekPlaceholder") || rS, C = Ie("ListComponent"), S = Ie("ItemComponent"), k = Ie("GroupComponent"), N = Ie("computeItemKey"), E = Ie("isSeeking"), I = Ie("groupIndices").length > 0, O = Ie("alignToBottom"), L = Ie("initialItemFinalLocationReached"), F = e ? {} : {
|
|
10429
10414
|
boxSizing: "border-box",
|
|
10430
10415
|
...x ? {
|
|
10431
10416
|
display: "inline-block",
|
|
@@ -10518,7 +10503,7 @@ function cS(e, t) {
|
|
|
10518
10503
|
return { item: typeof e == "string" ? void 0 : t };
|
|
10519
10504
|
}
|
|
10520
10505
|
const uS = /* @__PURE__ */ z.memo(function() {
|
|
10521
|
-
const e =
|
|
10506
|
+
const e = Ie("HeaderComponent"), t = on("headerHeight"), n = Ie("HeaderFooterTag"), r = pr(
|
|
10522
10507
|
z.useMemo(
|
|
10523
10508
|
() => (s) => {
|
|
10524
10509
|
t(Un(s, "height"));
|
|
@@ -10526,11 +10511,11 @@ const uS = /* @__PURE__ */ z.memo(function() {
|
|
|
10526
10511
|
[t]
|
|
10527
10512
|
),
|
|
10528
10513
|
!0,
|
|
10529
|
-
|
|
10530
|
-
), o =
|
|
10514
|
+
Ie("skipAnimationFrameInResizeObserver")
|
|
10515
|
+
), o = Ie("context");
|
|
10531
10516
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Bt(e, o) }) }) : null;
|
|
10532
10517
|
}), dS = /* @__PURE__ */ z.memo(function() {
|
|
10533
|
-
const e =
|
|
10518
|
+
const e = Ie("FooterComponent"), t = on("footerHeight"), n = Ie("HeaderFooterTag"), r = pr(
|
|
10534
10519
|
z.useMemo(
|
|
10535
10520
|
() => (s) => {
|
|
10536
10521
|
t(Un(s, "height"));
|
|
@@ -10538,8 +10523,8 @@ const uS = /* @__PURE__ */ z.memo(function() {
|
|
|
10538
10523
|
[t]
|
|
10539
10524
|
),
|
|
10540
10525
|
!0,
|
|
10541
|
-
|
|
10542
|
-
), o =
|
|
10526
|
+
Ie("skipAnimationFrameInResizeObserver")
|
|
10527
|
+
), o = Ie("context");
|
|
10543
10528
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Bt(e, o) }) }) : null;
|
|
10544
10529
|
});
|
|
10545
10530
|
function Gf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
@@ -10595,27 +10580,27 @@ function Yf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10595
10580
|
});
|
|
10596
10581
|
}
|
|
10597
10582
|
const fS = ({ children: e }) => {
|
|
10598
|
-
const t = z.useContext(Uf), n = on("viewportHeight"), r = on("fixedItemHeight"), o =
|
|
10583
|
+
const t = z.useContext(Uf), n = on("viewportHeight"), r = on("fixedItemHeight"), o = Ie("alignToBottom"), s = Ie("horizontalDirection"), i = z.useMemo(
|
|
10599
10584
|
() => wf(n, (l) => Un(l, s ? "width" : "height")),
|
|
10600
10585
|
[n, s]
|
|
10601
|
-
), a = pr(i, !0,
|
|
10586
|
+
), a = pr(i, !0, Ie("skipAnimationFrameInResizeObserver"));
|
|
10602
10587
|
return z.useEffect(() => {
|
|
10603
10588
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
10604
10589
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Ws(o), children: e });
|
|
10605
10590
|
}, pS = ({ children: e }) => {
|
|
10606
|
-
const t = z.useContext(Uf), n = on("windowViewportRect"), r = on("fixedItemHeight"), o =
|
|
10591
|
+
const t = z.useContext(Uf), n = on("windowViewportRect"), r = on("fixedItemHeight"), o = Ie("customScrollParent"), s = Sf(
|
|
10607
10592
|
n,
|
|
10608
10593
|
o,
|
|
10609
|
-
|
|
10610
|
-
), i =
|
|
10594
|
+
Ie("skipAnimationFrameInResizeObserver")
|
|
10595
|
+
), i = Ie("alignToBottom");
|
|
10611
10596
|
return z.useEffect(() => {
|
|
10612
10597
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
10613
10598
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Ws(i), children: e });
|
|
10614
10599
|
}, hS = ({ children: e }) => {
|
|
10615
|
-
const t =
|
|
10600
|
+
const t = Ie("TopItemListComponent") || "div", n = Ie("headerHeight"), r = { ...lS, marginTop: `${n}px` }, o = Ie("context");
|
|
10616
10601
|
return /* @__PURE__ */ u.jsx(t, { style: r, ...Bt(t, o), children: e });
|
|
10617
10602
|
}, mS = /* @__PURE__ */ z.memo(function(e) {
|
|
10618
|
-
const t =
|
|
10603
|
+
const t = Ie("useWindowScroll"), n = Ie("topItemsIndexes").length > 0, r = Ie("customScrollParent"), o = Ie("context");
|
|
10619
10604
|
return /* @__PURE__ */ u.jsxs(r || t ? yS : xS, { ...e, context: o, children: [
|
|
10620
10605
|
n && /* @__PURE__ */ u.jsx(hS, { children: /* @__PURE__ */ u.jsx(kc, { showTopList: !0 }) }),
|
|
10621
10606
|
/* @__PURE__ */ u.jsxs(r || t ? pS : fS, { children: [
|
|
@@ -10627,7 +10612,7 @@ const fS = ({ children: e }) => {
|
|
|
10627
10612
|
}), {
|
|
10628
10613
|
Component: gS,
|
|
10629
10614
|
useEmitter: Ya,
|
|
10630
|
-
useEmitterValue:
|
|
10615
|
+
useEmitterValue: Ie,
|
|
10631
10616
|
usePublisher: on
|
|
10632
10617
|
} = /* @__PURE__ */ Hf(
|
|
10633
10618
|
nS,
|
|
@@ -10688,7 +10673,7 @@ const fS = ({ children: e }) => {
|
|
|
10688
10673
|
}
|
|
10689
10674
|
},
|
|
10690
10675
|
mS
|
|
10691
|
-
), xS = /* @__PURE__ */ Gf({ useEmitter: Ya, useEmitterValue:
|
|
10676
|
+
), xS = /* @__PURE__ */ Gf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), yS = /* @__PURE__ */ Yf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), vS = gS, wS = /* @__PURE__ */ tt(() => {
|
|
10692
10677
|
const e = X((c) => /* @__PURE__ */ u.jsxs("td", { children: [
|
|
10693
10678
|
"Item $",
|
|
10694
10679
|
c
|
|
@@ -10696,7 +10681,7 @@ const fS = ({ children: e }) => {
|
|
|
10696
10681
|
"Group ",
|
|
10697
10682
|
c
|
|
10698
10683
|
] })), r = X(null), o = X(null), s = X({}), i = X(Ga), a = X(Or), l = (c, d = null) => Ht(
|
|
10699
|
-
|
|
10684
|
+
U(
|
|
10700
10685
|
s,
|
|
10701
10686
|
le((f) => f[c]),
|
|
10702
10687
|
xt()
|
|
@@ -10758,7 +10743,7 @@ function Po(e, t) {
|
|
|
10758
10743
|
function CS(e, t) {
|
|
10759
10744
|
return e && e.column === t.column && e.row === t.row;
|
|
10760
10745
|
}
|
|
10761
|
-
const TS = /* @__PURE__ */
|
|
10746
|
+
const TS = /* @__PURE__ */ tt(
|
|
10762
10747
|
([
|
|
10763
10748
|
{ increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
|
|
10764
10749
|
{ footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: l, scrollTop: c, smoothScrollTargetReached: d, viewportHeight: f },
|
|
@@ -10769,53 +10754,53 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10769
10754
|
C
|
|
10770
10755
|
]) => {
|
|
10771
10756
|
const S = X(0), k = X(0), N = X(Rc), E = X({ height: 0, width: 0 }), I = X({ height: 0, width: 0 }), O = We(), L = We(), F = X(0), j = X(null), $ = X({ column: 0, row: 0 }), A = We(), B = We(), D = X(!1), M = X(0), Z = X(!0), J = X(!1), pe = X(!1);
|
|
10772
|
-
|
|
10773
|
-
|
|
10757
|
+
st(
|
|
10758
|
+
U(
|
|
10774
10759
|
m,
|
|
10775
10760
|
Le(M),
|
|
10776
10761
|
Te(([P, H]) => !!H)
|
|
10777
10762
|
),
|
|
10778
10763
|
() => {
|
|
10779
|
-
|
|
10764
|
+
Oe(Z, !1);
|
|
10780
10765
|
}
|
|
10781
|
-
),
|
|
10782
|
-
|
|
10766
|
+
), st(
|
|
10767
|
+
U(
|
|
10783
10768
|
At(m, Z, I, E, M, J),
|
|
10784
10769
|
Te(([P, H, te, se, , ne]) => P && !H && te.height !== 0 && se.height !== 0 && !ne)
|
|
10785
10770
|
),
|
|
10786
10771
|
([, , , , P]) => {
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
}), pn(
|
|
10790
|
-
|
|
10772
|
+
Oe(J, !0), Ua(1, () => {
|
|
10773
|
+
Oe(O, P);
|
|
10774
|
+
}), pn(U(c), () => {
|
|
10775
|
+
Oe(t, [0, 0]), Oe(Z, !0);
|
|
10791
10776
|
});
|
|
10792
10777
|
}
|
|
10793
10778
|
), he(
|
|
10794
|
-
|
|
10779
|
+
U(
|
|
10795
10780
|
B,
|
|
10796
10781
|
Te((P) => P != null && P.scrollTop > 0),
|
|
10797
10782
|
wn(0)
|
|
10798
10783
|
),
|
|
10799
10784
|
k
|
|
10800
|
-
),
|
|
10801
|
-
|
|
10785
|
+
), st(
|
|
10786
|
+
U(
|
|
10802
10787
|
m,
|
|
10803
10788
|
Le(B),
|
|
10804
10789
|
Te(([, P]) => P != null)
|
|
10805
10790
|
),
|
|
10806
10791
|
([, P]) => {
|
|
10807
|
-
P && (
|
|
10808
|
-
|
|
10809
|
-
}),
|
|
10792
|
+
P && (Oe(E, P.viewport), Oe(I, P.item), Oe($, P.gap), P.scrollTop > 0 && (Oe(D, !0), pn(U(c, ar(1)), (H) => {
|
|
10793
|
+
Oe(D, !1);
|
|
10794
|
+
}), Oe(l, { top: P.scrollTop })));
|
|
10810
10795
|
}
|
|
10811
10796
|
), he(
|
|
10812
|
-
|
|
10797
|
+
U(
|
|
10813
10798
|
E,
|
|
10814
10799
|
le(({ height: P }) => P)
|
|
10815
10800
|
),
|
|
10816
10801
|
f
|
|
10817
10802
|
), he(
|
|
10818
|
-
|
|
10803
|
+
U(
|
|
10819
10804
|
At(
|
|
10820
10805
|
Se(E, Po),
|
|
10821
10806
|
Se(I, Po),
|
|
@@ -10831,7 +10816,7 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10831
10816
|
),
|
|
10832
10817
|
A
|
|
10833
10818
|
), he(
|
|
10834
|
-
|
|
10819
|
+
U(
|
|
10835
10820
|
At(
|
|
10836
10821
|
Se(S),
|
|
10837
10822
|
r,
|
|
@@ -10851,43 +10836,43 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10851
10836
|
[H, te],
|
|
10852
10837
|
se,
|
|
10853
10838
|
ne,
|
|
10854
|
-
|
|
10839
|
+
Me,
|
|
10855
10840
|
Y,
|
|
10856
10841
|
de,
|
|
10857
10842
|
,
|
|
10858
10843
|
ke,
|
|
10859
|
-
|
|
10844
|
+
Ne
|
|
10860
10845
|
]) => {
|
|
10861
|
-
const { column: ze, row: Be } = se, { height: Ue, width: Ke } = ne, { width: qe } =
|
|
10846
|
+
const { column: ze, row: Be } = se, { height: Ue, width: Ke } = ne, { width: qe } = Me;
|
|
10862
10847
|
if (de === 0 && (P === 0 || qe === 0))
|
|
10863
10848
|
return Rc;
|
|
10864
10849
|
if (Ke === 0) {
|
|
10865
|
-
const re = Wa(
|
|
10866
|
-
return SS(Nc(re,
|
|
10850
|
+
const re = Wa(Ne, P), Qe = re + Math.max(de - 1, 0);
|
|
10851
|
+
return SS(Nc(re, Qe, Y));
|
|
10867
10852
|
}
|
|
10868
|
-
const
|
|
10869
|
-
let
|
|
10870
|
-
ke ? H === 0 && te === 0 && de > 0 ? (
|
|
10871
|
-
const St = Nc(
|
|
10872
|
-
return { bottom: mt, itemHeight: Ue, items: St, itemWidth: Ke, offsetBottom: ce, offsetTop:
|
|
10853
|
+
const Ze = Xf(qe, Ke, ze);
|
|
10854
|
+
let Xe, rt;
|
|
10855
|
+
ke ? H === 0 && te === 0 && de > 0 ? (Xe = 0, rt = de - 1) : (Xe = Ze * as((H + Be) / (Ue + Be)), rt = Ze * Ec((te + Be) / (Ue + Be)) - 1, rt = Ei(P - 1, Kr(rt, Ze - 1)), Xe = Ei(rt, Kr(0, Xe))) : (Xe = 0, rt = -1);
|
|
10856
|
+
const St = Nc(Xe, rt, Y), { bottom: mt, top: lt } = Ac(Me, se, ne, St), Ct = Ec(P / Ze), ce = Ct * Ue + (Ct - 1) * Be - mt;
|
|
10857
|
+
return { bottom: mt, itemHeight: Ue, items: St, itemWidth: Ke, offsetBottom: ce, offsetTop: lt, top: lt };
|
|
10873
10858
|
}
|
|
10874
10859
|
)
|
|
10875
10860
|
),
|
|
10876
10861
|
N
|
|
10877
10862
|
), he(
|
|
10878
|
-
|
|
10863
|
+
U(
|
|
10879
10864
|
j,
|
|
10880
10865
|
Te((P) => P !== null),
|
|
10881
10866
|
le((P) => P.length)
|
|
10882
10867
|
),
|
|
10883
10868
|
S
|
|
10884
10869
|
), he(
|
|
10885
|
-
|
|
10870
|
+
U(
|
|
10886
10871
|
At(E, I, N, $),
|
|
10887
10872
|
Te(([P, H, { items: te }]) => te.length > 0 && H.height !== 0 && P.height !== 0),
|
|
10888
10873
|
le(([P, H, { items: te }, se]) => {
|
|
10889
|
-
const { bottom: ne, top:
|
|
10890
|
-
return [
|
|
10874
|
+
const { bottom: ne, top: Me } = Ac(P, se, H, te);
|
|
10875
|
+
return [Me, ne];
|
|
10891
10876
|
}),
|
|
10892
10877
|
xt(oo)
|
|
10893
10878
|
),
|
|
@@ -10895,15 +10880,15 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10895
10880
|
);
|
|
10896
10881
|
const Re = X(!1);
|
|
10897
10882
|
he(
|
|
10898
|
-
|
|
10883
|
+
U(
|
|
10899
10884
|
c,
|
|
10900
10885
|
Le(Re),
|
|
10901
10886
|
le(([P, H]) => H || P !== 0)
|
|
10902
10887
|
),
|
|
10903
10888
|
Re
|
|
10904
10889
|
);
|
|
10905
|
-
const
|
|
10906
|
-
|
|
10890
|
+
const Ee = en(
|
|
10891
|
+
U(
|
|
10907
10892
|
At(N, S),
|
|
10908
10893
|
Te(([{ items: P }]) => P.length > 0),
|
|
10909
10894
|
Le(Re),
|
|
@@ -10914,15 +10899,15 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10914
10899
|
le(([[, P]]) => P - 1),
|
|
10915
10900
|
xt()
|
|
10916
10901
|
)
|
|
10917
|
-
),
|
|
10918
|
-
|
|
10902
|
+
), W = en(
|
|
10903
|
+
U(
|
|
10919
10904
|
Se(N),
|
|
10920
10905
|
Te(({ items: P }) => P.length > 0 && P[0].index === 0),
|
|
10921
10906
|
wn(0),
|
|
10922
10907
|
xt()
|
|
10923
10908
|
)
|
|
10924
10909
|
), ee = en(
|
|
10925
|
-
|
|
10910
|
+
U(
|
|
10926
10911
|
Se(N),
|
|
10927
10912
|
Le(D),
|
|
10928
10913
|
Te(([{ items: P }, H]) => P.length > 0 && !H),
|
|
@@ -10935,28 +10920,28 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10935
10920
|
)
|
|
10936
10921
|
);
|
|
10937
10922
|
he(ee, h.scrollSeekRangeChanged), he(
|
|
10938
|
-
|
|
10923
|
+
U(
|
|
10939
10924
|
O,
|
|
10940
10925
|
Le(E, I, S, $),
|
|
10941
10926
|
le(([P, H, te, se, ne]) => {
|
|
10942
|
-
const
|
|
10943
|
-
let
|
|
10944
|
-
|
|
10945
|
-
let ze = ea(H, ne, te,
|
|
10927
|
+
const Me = Pf(P), { align: Y, behavior: de, offset: ke } = Me;
|
|
10928
|
+
let Ne = Me.index;
|
|
10929
|
+
Ne === "LAST" && (Ne = se - 1), Ne = Kr(0, Ne, Ei(se - 1, Ne));
|
|
10930
|
+
let ze = ea(H, ne, te, Ne);
|
|
10946
10931
|
return Y === "end" ? ze = Ic(ze - H.height + te.height) : Y === "center" && (ze = Ic(ze - H.height / 2 + te.height / 2)), ke && (ze += ke), { behavior: de, top: ze };
|
|
10947
10932
|
})
|
|
10948
10933
|
),
|
|
10949
10934
|
l
|
|
10950
10935
|
);
|
|
10951
10936
|
const q = Ht(
|
|
10952
|
-
|
|
10937
|
+
U(
|
|
10953
10938
|
N,
|
|
10954
10939
|
le((P) => P.offsetBottom + P.bottom)
|
|
10955
10940
|
),
|
|
10956
10941
|
0
|
|
10957
10942
|
);
|
|
10958
10943
|
return he(
|
|
10959
|
-
|
|
10944
|
+
U(
|
|
10960
10945
|
T,
|
|
10961
10946
|
le((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
|
|
10962
10947
|
),
|
|
@@ -10994,10 +10979,10 @@ const TS = /* @__PURE__ */ nt(
|
|
|
10994
10979
|
initialTopMostItemIndex: M,
|
|
10995
10980
|
totalListHeight: q,
|
|
10996
10981
|
...p,
|
|
10997
|
-
endReached:
|
|
10982
|
+
endReached: Ee,
|
|
10998
10983
|
propsReady: x,
|
|
10999
10984
|
rangeChanged: ee,
|
|
11000
|
-
startReached:
|
|
10985
|
+
startReached: W,
|
|
11001
10986
|
stateChanged: A,
|
|
11002
10987
|
stateRestoreInProgress: D,
|
|
11003
10988
|
...C
|
|
@@ -11019,9 +11004,9 @@ function ea(e, t, n, r) {
|
|
|
11019
11004
|
const o = Xf(e.width, n.width, t.column), s = as(r / o), i = s * n.height + Kr(0, s - 1) * t.row;
|
|
11020
11005
|
return i > 0 ? i + t.row : i;
|
|
11021
11006
|
}
|
|
11022
|
-
const kS = /* @__PURE__ */
|
|
11007
|
+
const kS = /* @__PURE__ */ tt(() => {
|
|
11023
11008
|
const e = X((f) => `Item ${f}`), t = X({}), n = X(null), r = X("virtuoso-grid-item"), o = X("virtuoso-grid-list"), s = X(Ga), i = X("div"), a = X(Or), l = (f, p = null) => Ht(
|
|
11024
|
-
|
|
11009
|
+
U(
|
|
11025
11010
|
t,
|
|
11026
11011
|
le((h) => h[f]),
|
|
11027
11012
|
xt()
|
|
@@ -11046,7 +11031,7 @@ const kS = /* @__PURE__ */ nt(() => {
|
|
|
11046
11031
|
scrollerRef: a,
|
|
11047
11032
|
ScrollSeekPlaceholder: l("ScrollSeekPlaceholder", "div")
|
|
11048
11033
|
};
|
|
11049
|
-
}), RS = /* @__PURE__ */
|
|
11034
|
+
}), RS = /* @__PURE__ */ tt(
|
|
11050
11035
|
([e, t]) => ({ ...e, ...t }),
|
|
11051
11036
|
yt(TS, kS)
|
|
11052
11037
|
), ES = /* @__PURE__ */ z.memo(function() {
|
|
@@ -11519,7 +11504,7 @@ var sp = "DialogTrigger", ip = v.forwardRef(
|
|
|
11519
11504
|
(e, t) => {
|
|
11520
11505
|
const { __scopeDialog: n, ...r } = e, o = yn(sp, n), s = Ve(t, o.triggerRef);
|
|
11521
11506
|
return /* @__PURE__ */ u.jsx(
|
|
11522
|
-
|
|
11507
|
+
Ae.button,
|
|
11523
11508
|
{
|
|
11524
11509
|
type: "button",
|
|
11525
11510
|
"aria-haspopup": "dialog",
|
|
@@ -11555,7 +11540,7 @@ var qS = Tr("DialogOverlay.RemoveScroll"), GS = v.forwardRef(
|
|
|
11555
11540
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
11556
11541
|
// ie. when `Overlay` and `Content` are siblings
|
|
11557
11542
|
/* @__PURE__ */ u.jsx(Ds, { as: qS, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ u.jsx(
|
|
11558
|
-
|
|
11543
|
+
Ae.div,
|
|
11559
11544
|
{
|
|
11560
11545
|
"data-state": el(o.open),
|
|
11561
11546
|
...r,
|
|
@@ -11659,14 +11644,14 @@ var YS = v.forwardRef(
|
|
|
11659
11644
|
), Qa = "DialogTitle", fp = v.forwardRef(
|
|
11660
11645
|
(e, t) => {
|
|
11661
11646
|
const { __scopeDialog: n, ...r } = e, o = yn(Qa, n);
|
|
11662
|
-
return /* @__PURE__ */ u.jsx(
|
|
11647
|
+
return /* @__PURE__ */ u.jsx(Ae.h2, { id: o.titleId, ...r, ref: t });
|
|
11663
11648
|
}
|
|
11664
11649
|
);
|
|
11665
11650
|
fp.displayName = Qa;
|
|
11666
11651
|
var pp = "DialogDescription", hp = v.forwardRef(
|
|
11667
11652
|
(e, t) => {
|
|
11668
11653
|
const { __scopeDialog: n, ...r } = e, o = yn(pp, n);
|
|
11669
|
-
return /* @__PURE__ */ u.jsx(
|
|
11654
|
+
return /* @__PURE__ */ u.jsx(Ae.p, { id: o.descriptionId, ...r, ref: t });
|
|
11670
11655
|
}
|
|
11671
11656
|
);
|
|
11672
11657
|
hp.displayName = pp;
|
|
@@ -11674,7 +11659,7 @@ var mp = "DialogClose", gp = v.forwardRef(
|
|
|
11674
11659
|
(e, t) => {
|
|
11675
11660
|
const { __scopeDialog: n, ...r } = e, o = yn(mp, n);
|
|
11676
11661
|
return /* @__PURE__ */ u.jsx(
|
|
11677
|
-
|
|
11662
|
+
Ae.button,
|
|
11678
11663
|
{
|
|
11679
11664
|
type: "button",
|
|
11680
11665
|
...r,
|
|
@@ -11834,7 +11819,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
11834
11819
|
] }) : c ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
11835
11820
|
/* @__PURE__ */ u.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
|
|
11836
11821
|
/* @__PURE__ */ u.jsx("p", { className: "text-red-600 mb-4", children: c }),
|
|
11837
|
-
/* @__PURE__ */ u.jsx(
|
|
11822
|
+
/* @__PURE__ */ u.jsx(ot, { onClick: p, variant: "outline", children: "Try Again" })
|
|
11838
11823
|
] }) : a ? o.startsWith("image/") ? /* @__PURE__ */ u.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ u.jsx(
|
|
11839
11824
|
"img",
|
|
11840
11825
|
{
|
|
@@ -11874,7 +11859,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
11874
11859
|
] }),
|
|
11875
11860
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11876
11861
|
/* @__PURE__ */ u.jsxs(
|
|
11877
|
-
|
|
11862
|
+
ot,
|
|
11878
11863
|
{
|
|
11879
11864
|
variant: "outline",
|
|
11880
11865
|
size: "sm",
|
|
@@ -11887,7 +11872,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
11887
11872
|
}
|
|
11888
11873
|
),
|
|
11889
11874
|
/* @__PURE__ */ u.jsxs(
|
|
11890
|
-
|
|
11875
|
+
ot,
|
|
11891
11876
|
{
|
|
11892
11877
|
variant: "outline",
|
|
11893
11878
|
size: "sm",
|
|
@@ -13459,7 +13444,7 @@ function fs({
|
|
|
13459
13444
|
allowHtml: n = !1,
|
|
13460
13445
|
style: r
|
|
13461
13446
|
}) {
|
|
13462
|
-
const o =
|
|
13447
|
+
const o = at(() => {
|
|
13463
13448
|
try {
|
|
13464
13449
|
if (!n) {
|
|
13465
13450
|
const i = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
|
|
@@ -13469,7 +13454,7 @@ function fs({
|
|
|
13469
13454
|
} catch (i) {
|
|
13470
13455
|
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>`;
|
|
13471
13456
|
}
|
|
13472
|
-
}, [e, n]), s =
|
|
13457
|
+
}, [e, n]), s = at(() => {
|
|
13473
13458
|
const i = {
|
|
13474
13459
|
color: "currentColor",
|
|
13475
13460
|
...r
|
|
@@ -13614,9 +13599,9 @@ const Bc = z.memo(function({
|
|
|
13614
13599
|
defaultCheckpointId: N = null,
|
|
13615
13600
|
messageParentCheckpointId: E = null
|
|
13616
13601
|
}) {
|
|
13617
|
-
const [I, O] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", M = t.role, Z = M === "tool", J =
|
|
13618
|
-
uploadingFiles:
|
|
13619
|
-
handleFileClick:
|
|
13602
|
+
const [I, O] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", M = t.role, Z = M === "tool", J = at(() => "type" in t && t.type === "default_message" ? t : null, [t]), pe = !!J, Re = !(r && M !== "user"), {
|
|
13603
|
+
uploadingFiles: Ee,
|
|
13604
|
+
handleFileClick: W,
|
|
13620
13605
|
fileViewerOpen: ee,
|
|
13621
13606
|
currentFileInfo: q,
|
|
13622
13607
|
closeFileViewer: P
|
|
@@ -13633,16 +13618,16 @@ const Bc = z.memo(function({
|
|
|
13633
13618
|
default:
|
|
13634
13619
|
return "text-[hsl(var(--chat-bubble-ai-text))]";
|
|
13635
13620
|
}
|
|
13636
|
-
}, [M]), te =
|
|
13621
|
+
}, [M]), te = at(() => J ? "" : CC(t.content), [J, t]), se = at(() => J ? {} : Pp(t), [J, t]), ne = at(
|
|
13637
13622
|
() => J ? [] : t.content.filter((V) => V.type === "image_url"),
|
|
13638
13623
|
[J, t]
|
|
13639
|
-
),
|
|
13624
|
+
), Me = at(
|
|
13640
13625
|
() => J ? [] : t.content.filter((V) => V.type === "file"),
|
|
13641
13626
|
[J, t]
|
|
13642
|
-
), Y =
|
|
13627
|
+
), Y = at(
|
|
13643
13628
|
() => J ? [] : t.content.filter((V) => V.type === "interrupt"),
|
|
13644
13629
|
[J, t]
|
|
13645
|
-
), de = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), ke = Mo(de),
|
|
13630
|
+
), de = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), ke = Mo(de), Ne = g == null ? void 0 : g.value, ze = at(() => J ? "" : TC(t.content), [J, t]), Be = z.useCallback(async () => {
|
|
13646
13631
|
const V = Z ? ze : te;
|
|
13647
13632
|
async function ve(xe) {
|
|
13648
13633
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
@@ -13686,7 +13671,7 @@ const Bc = z.memo(function({
|
|
|
13686
13671
|
default:
|
|
13687
13672
|
return /* @__PURE__ */ u.jsx(si, { className: ve });
|
|
13688
13673
|
}
|
|
13689
|
-
}, [D, H, M]),
|
|
13674
|
+
}, [D, H, M]), Ze = z.useCallback(() => {
|
|
13690
13675
|
const V = "group relative mb-4 flex w-full";
|
|
13691
13676
|
switch (M) {
|
|
13692
13677
|
case "user":
|
|
@@ -13698,7 +13683,7 @@ const Bc = z.memo(function({
|
|
|
13698
13683
|
default:
|
|
13699
13684
|
return V;
|
|
13700
13685
|
}
|
|
13701
|
-
}, [M]),
|
|
13686
|
+
}, [M]), Xe = z.useCallback(() => {
|
|
13702
13687
|
const V = Q(
|
|
13703
13688
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
13704
13689
|
D && "px-3 py-2 text-sm"
|
|
@@ -13739,7 +13724,7 @@ const Bc = z.memo(function({
|
|
|
13739
13724
|
}
|
|
13740
13725
|
}, [D, pe, M]);
|
|
13741
13726
|
if (pe && J)
|
|
13742
|
-
return /* @__PURE__ */ u.jsx("div", { className: Q(
|
|
13727
|
+
return /* @__PURE__ */ u.jsx("div", { className: Q(Ze(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Xe(), p.content), children: [
|
|
13743
13728
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
13744
13729
|
/* @__PURE__ */ u.jsx(si, { className: Q("h-4 w-4", H) }),
|
|
13745
13730
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
@@ -13752,7 +13737,7 @@ const Bc = z.memo(function({
|
|
|
13752
13737
|
}
|
|
13753
13738
|
)
|
|
13754
13739
|
] }) });
|
|
13755
|
-
const
|
|
13740
|
+
const rt = z.useCallback(async (V) => {
|
|
13756
13741
|
if (w)
|
|
13757
13742
|
return;
|
|
13758
13743
|
const ve = Mo(
|
|
@@ -13819,14 +13804,14 @@ const Bc = z.memo(function({
|
|
|
13819
13804
|
"a",
|
|
13820
13805
|
{
|
|
13821
13806
|
href: xe.url,
|
|
13822
|
-
onClick: (gt) =>
|
|
13807
|
+
onClick: (gt) => W(gt, xe, ve),
|
|
13823
13808
|
className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
13824
13809
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
|
|
13825
13810
|
children: [
|
|
13826
|
-
|
|
13811
|
+
Ee[ve] ? /* @__PURE__ */ u.jsx(ua, { className: "h-4 w-4 animate-spin" }) : null,
|
|
13827
13812
|
/* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
13828
13813
|
ht,
|
|
13829
|
-
|
|
13814
|
+
Ee[ve] ? " (processing)" : ""
|
|
13830
13815
|
] })
|
|
13831
13816
|
]
|
|
13832
13817
|
},
|
|
@@ -13836,12 +13821,12 @@ const Bc = z.memo(function({
|
|
|
13836
13821
|
if (V.type === "interrupt") {
|
|
13837
13822
|
const xe = V, ht = Mo(
|
|
13838
13823
|
(xe == null ? void 0 : xe.id) ?? (xe == null ? void 0 : xe.interrupt_id)
|
|
13839
|
-
), gt = !!(ke && ht && ht === ke), Tt = gt ?
|
|
13824
|
+
), gt = !!(ke && ht && ht === ke), Tt = gt ? Ne ?? (xe == null ? void 0 : xe.value) : xe == null ? void 0 : xe.value, _e = ht ? { ...xe, id: ht, interrupt_id: ht } : xe;
|
|
13840
13825
|
return /* @__PURE__ */ u.jsx(
|
|
13841
13826
|
EC,
|
|
13842
13827
|
{
|
|
13843
13828
|
interruptPart: _e,
|
|
13844
|
-
onApprove:
|
|
13829
|
+
onApprove: rt,
|
|
13845
13830
|
onReject: St,
|
|
13846
13831
|
disabled: w,
|
|
13847
13832
|
isActive: gt,
|
|
@@ -13852,9 +13837,9 @@ const Bc = z.memo(function({
|
|
|
13852
13837
|
}
|
|
13853
13838
|
return null;
|
|
13854
13839
|
}, [
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13840
|
+
W,
|
|
13841
|
+
Ee,
|
|
13842
|
+
rt,
|
|
13858
13843
|
St,
|
|
13859
13844
|
M,
|
|
13860
13845
|
c,
|
|
@@ -13862,17 +13847,17 @@ const Bc = z.memo(function({
|
|
|
13862
13847
|
j,
|
|
13863
13848
|
D,
|
|
13864
13849
|
ke,
|
|
13865
|
-
|
|
13850
|
+
Ne,
|
|
13866
13851
|
g,
|
|
13867
13852
|
w,
|
|
13868
13853
|
Y
|
|
13869
|
-
]),
|
|
13854
|
+
]), lt = z.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
|
|
13870
13855
|
/* @__PURE__ */ u.jsx(ji, { className: "h-4 w-4 text-muted-foreground" }),
|
|
13871
13856
|
/* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
|
|
13872
13857
|
] }), []), Ct = z.useCallback(() => {
|
|
13873
|
-
const V = te.trim().length > 0 || ne.length > 0 ||
|
|
13874
|
-
if (!Z &&
|
|
13875
|
-
return
|
|
13858
|
+
const V = te.trim().length > 0 || ne.length > 0 || Me.length > 0 || Y.length > 0;
|
|
13859
|
+
if (!Z && Me.length > 0 && !r)
|
|
13860
|
+
return lt();
|
|
13876
13861
|
if (!Z && !V && !r)
|
|
13877
13862
|
return null;
|
|
13878
13863
|
if (Z)
|
|
@@ -13894,24 +13879,24 @@ const Bc = z.memo(function({
|
|
|
13894
13879
|
}, [
|
|
13895
13880
|
te,
|
|
13896
13881
|
ne.length,
|
|
13897
|
-
|
|
13882
|
+
Me.length,
|
|
13898
13883
|
Y.length,
|
|
13899
13884
|
r,
|
|
13900
13885
|
Z,
|
|
13901
13886
|
L,
|
|
13902
|
-
|
|
13887
|
+
lt,
|
|
13903
13888
|
H
|
|
13904
|
-
]), ce =
|
|
13889
|
+
]), ce = at(() => J ? "Assistant" : kC(t), [J, t]), re = z.useMemo(() => J ? [] : Array.isArray(C) ? C : [], [C, J]), Qe = z.useMemo(() => {
|
|
13905
13890
|
var V;
|
|
13906
13891
|
return re.length ? N && re.some((ve) => ve.id === N) ? N : ((V = re[0]) == null ? void 0 : V.id) ?? null : null;
|
|
13907
|
-
}, [N, re]),
|
|
13892
|
+
}, [N, re]), De = z.useMemo(() => !re.length || !S ? null : re.some((V) => V.id === S) ? S : null, [S, re]) ?? Qe, ut = M === "user" && re.length > 0 && typeof k == "function", et = z.useCallback(
|
|
13908
13893
|
(V) => {
|
|
13909
13894
|
if (!k) return;
|
|
13910
13895
|
const ve = (V == null ? void 0 : V.id) ?? null, xe = (V == null ? void 0 : V.parentId) ?? E ?? null;
|
|
13911
13896
|
k(ve, xe);
|
|
13912
13897
|
},
|
|
13913
13898
|
[E, k]
|
|
13914
|
-
), Fe = z.useMemo(() =>
|
|
13899
|
+
), Fe = z.useMemo(() => De ? re.findIndex((V) => V.id === De) : -1, [De, re]), Pt = z.useMemo(() => Fe < 0 ? null : re[Fe] ?? null, [Fe, re]), jt = z.useCallback((V) => {
|
|
13915
13900
|
const ve = [];
|
|
13916
13901
|
if (V.step !== null && ve.push(`Step ${V.step}`), V.source && ve.push(V.source), !V.createdAt)
|
|
13917
13902
|
return ve.length ? ve.join(" • ") : V.id.slice(0, 8);
|
|
@@ -13928,7 +13913,7 @@ const Bc = z.memo(function({
|
|
|
13928
13913
|
return `${xe}`;
|
|
13929
13914
|
}, []);
|
|
13930
13915
|
return Z && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
13931
|
-
/* @__PURE__ */ u.jsx("div", { className: Q(
|
|
13916
|
+
/* @__PURE__ */ u.jsx("div", { className: Q(Ze(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Xe(), p.content), children: [
|
|
13932
13917
|
(i || a || Z) && /* @__PURE__ */ u.jsxs(
|
|
13933
13918
|
"div",
|
|
13934
13919
|
{
|
|
@@ -13968,7 +13953,7 @@ const Bc = z.memo(function({
|
|
|
13968
13953
|
)
|
|
13969
13954
|
] }),
|
|
13970
13955
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
13971
|
-
|
|
13956
|
+
ut && Pt && Fe >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
13972
13957
|
/* @__PURE__ */ u.jsx(
|
|
13973
13958
|
"button",
|
|
13974
13959
|
{
|
|
@@ -13980,7 +13965,7 @@ const Bc = z.memo(function({
|
|
|
13980
13965
|
onClick: () => {
|
|
13981
13966
|
if (Fe <= 0) return;
|
|
13982
13967
|
const V = re[Fe - 1];
|
|
13983
|
-
V &&
|
|
13968
|
+
V && et(V);
|
|
13984
13969
|
},
|
|
13985
13970
|
"aria-label": "Previous checkpoint",
|
|
13986
13971
|
disabled: Fe <= 0,
|
|
@@ -14006,7 +13991,7 @@ const Bc = z.memo(function({
|
|
|
14006
13991
|
onClick: () => {
|
|
14007
13992
|
if (Fe >= re.length - 1) return;
|
|
14008
13993
|
const V = re[Fe + 1];
|
|
14009
|
-
V &&
|
|
13994
|
+
V && et(V);
|
|
14010
13995
|
},
|
|
14011
13996
|
"aria-label": "Next checkpoint",
|
|
14012
13997
|
disabled: Fe >= re.length - 1,
|
|
@@ -14033,7 +14018,7 @@ const Bc = z.memo(function({
|
|
|
14033
14018
|
),
|
|
14034
14019
|
children: [
|
|
14035
14020
|
/* @__PURE__ */ u.jsx("div", { className: "relative", children: /* @__PURE__ */ u.jsx(
|
|
14036
|
-
|
|
14021
|
+
ot,
|
|
14037
14022
|
{
|
|
14038
14023
|
variant: "ghost",
|
|
14039
14024
|
size: "sm",
|
|
@@ -14045,7 +14030,7 @@ const Bc = z.memo(function({
|
|
|
14045
14030
|
}
|
|
14046
14031
|
) }),
|
|
14047
14032
|
M === "user" && h && /* @__PURE__ */ u.jsx(
|
|
14048
|
-
|
|
14033
|
+
ot,
|
|
14049
14034
|
{
|
|
14050
14035
|
variant: "ghost",
|
|
14051
14036
|
size: "sm",
|
|
@@ -14056,7 +14041,7 @@ const Bc = z.memo(function({
|
|
|
14056
14041
|
}
|
|
14057
14042
|
),
|
|
14058
14043
|
M === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
14059
|
-
|
|
14044
|
+
ot,
|
|
14060
14045
|
{
|
|
14061
14046
|
variant: "ghost",
|
|
14062
14047
|
size: "sm",
|
|
@@ -14094,7 +14079,7 @@ const Bc = z.memo(function({
|
|
|
14094
14079
|
),
|
|
14095
14080
|
children: [
|
|
14096
14081
|
/* @__PURE__ */ u.jsx(
|
|
14097
|
-
|
|
14082
|
+
ot,
|
|
14098
14083
|
{
|
|
14099
14084
|
variant: "ghost",
|
|
14100
14085
|
size: "sm",
|
|
@@ -14104,7 +14089,7 @@ const Bc = z.memo(function({
|
|
|
14104
14089
|
}
|
|
14105
14090
|
),
|
|
14106
14091
|
M === "user" && h && /* @__PURE__ */ u.jsx(
|
|
14107
|
-
|
|
14092
|
+
ot,
|
|
14108
14093
|
{
|
|
14109
14094
|
variant: "ghost",
|
|
14110
14095
|
size: "sm",
|
|
@@ -14114,7 +14099,7 @@ const Bc = z.memo(function({
|
|
|
14114
14099
|
}
|
|
14115
14100
|
),
|
|
14116
14101
|
M === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
14117
|
-
|
|
14102
|
+
ot,
|
|
14118
14103
|
{
|
|
14119
14104
|
variant: "ghost",
|
|
14120
14105
|
size: "sm",
|
|
@@ -14189,7 +14174,7 @@ function EC({
|
|
|
14189
14174
|
a && /* @__PURE__ */ u.jsx(Xr, { className: "pt-0 pb-3", children: a }),
|
|
14190
14175
|
/* @__PURE__ */ u.jsx(ep, { className: "pt-0", children: /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2 ml-auto", children: [
|
|
14191
14176
|
/* @__PURE__ */ u.jsx(
|
|
14192
|
-
|
|
14177
|
+
ot,
|
|
14193
14178
|
{
|
|
14194
14179
|
size: "sm",
|
|
14195
14180
|
variant: "outline",
|
|
@@ -14200,7 +14185,7 @@ function EC({
|
|
|
14200
14185
|
}
|
|
14201
14186
|
),
|
|
14202
14187
|
/* @__PURE__ */ u.jsx(
|
|
14203
|
-
|
|
14188
|
+
ot,
|
|
14204
14189
|
{
|
|
14205
14190
|
size: "sm",
|
|
14206
14191
|
onClick: () => t(e),
|
|
@@ -14309,7 +14294,7 @@ function NC({
|
|
|
14309
14294
|
}
|
|
14310
14295
|
) }),
|
|
14311
14296
|
/* @__PURE__ */ u.jsx(
|
|
14312
|
-
|
|
14297
|
+
ot,
|
|
14313
14298
|
{
|
|
14314
14299
|
type: "button",
|
|
14315
14300
|
variant: "ghost",
|
|
@@ -14403,17 +14388,17 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14403
14388
|
onSelectCheckpoint: I,
|
|
14404
14389
|
timelineCheckpoints: O
|
|
14405
14390
|
}, L) => {
|
|
14406
|
-
const F =
|
|
14391
|
+
const F = Je(null), j = Je(null), $ = Je(!1), [A, B] = ge(!0), D = at(() => w ? e.some((Y) => "type" in Y && Y.type === "default_message" ? !1 : Array.isArray(Y == null ? void 0 : Y.content) && Y.content.some(
|
|
14407
14392
|
(de) => de && de.type === "interrupt" && (de.id ?? de.interrupt_id) === w.id
|
|
14408
|
-
)) : !1, [w, e]), M =
|
|
14393
|
+
)) : !1, [w, e]), M = at(() => {
|
|
14409
14394
|
if (!w || D)
|
|
14410
14395
|
return null;
|
|
14411
14396
|
const Y = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
|
|
14412
14397
|
let de;
|
|
14413
14398
|
const ke = w.value;
|
|
14414
14399
|
if (ke && typeof ke == "object" && !Array.isArray(ke)) {
|
|
14415
|
-
const
|
|
14416
|
-
typeof
|
|
14400
|
+
const Ne = ke.title;
|
|
14401
|
+
typeof Ne == "string" && Ne.trim() && (de = Ne.trim());
|
|
14417
14402
|
}
|
|
14418
14403
|
return {
|
|
14419
14404
|
id: `interrupt-${Y}`,
|
|
@@ -14428,22 +14413,22 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14428
14413
|
}
|
|
14429
14414
|
]
|
|
14430
14415
|
};
|
|
14431
|
-
}, [w, D]), Z =
|
|
14416
|
+
}, [w, D]), Z = at(() => M ? [...e, M] : e, [e, M]), J = at(() => S ? Z : Z.filter((Y) => (Y == null ? void 0 : Y.role) !== "tool"), [Z, S]), pe = at(() => {
|
|
14432
14417
|
const Y = /* @__PURE__ */ new Set(), de = [];
|
|
14433
14418
|
for (let ke = J.length - 1; ke >= 0; ke--) {
|
|
14434
|
-
const
|
|
14435
|
-
if (!
|
|
14436
|
-
if ("type" in
|
|
14437
|
-
de.push(
|
|
14419
|
+
const Ne = J[ke];
|
|
14420
|
+
if (!Ne) continue;
|
|
14421
|
+
if ("type" in Ne && Ne.type === "default_message") {
|
|
14422
|
+
de.push(Ne);
|
|
14438
14423
|
continue;
|
|
14439
14424
|
}
|
|
14440
|
-
const ze =
|
|
14425
|
+
const ze = Ne, Be = jC(ze);
|
|
14441
14426
|
Y.has(Be) || (Y.add(Be), de.push(ze));
|
|
14442
14427
|
}
|
|
14443
14428
|
return de.reverse();
|
|
14444
14429
|
}, [J]), Re = Ce((Y) => {
|
|
14445
14430
|
B(Y), y && y(!Y), g && g(Y);
|
|
14446
|
-
}, [y, g]),
|
|
14431
|
+
}, [y, g]), Ee = at(() => {
|
|
14447
14432
|
if (a)
|
|
14448
14433
|
return async () => {
|
|
14449
14434
|
if (!$.current) {
|
|
@@ -14455,7 +14440,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14455
14440
|
}
|
|
14456
14441
|
}
|
|
14457
14442
|
};
|
|
14458
|
-
}, [a]),
|
|
14443
|
+
}, [a]), W = at(() => !m || x ? !1 : A ? "auto" : !1, [A, m, x]), ee = at(() => O ?? [], [O]), q = E ?? (ee.length ? ee[ee.length - 1].id : null), P = ee.length > 0, H = at(() => {
|
|
14459
14444
|
if (typeof h != "string") return null;
|
|
14460
14445
|
const Y = h.trim();
|
|
14461
14446
|
return Y ? {
|
|
@@ -14531,7 +14516,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14531
14516
|
onCancelEdit: () => {
|
|
14532
14517
|
}
|
|
14533
14518
|
}
|
|
14534
|
-
) }) }) : /* @__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!" }),
|
|
14519
|
+
) }) }) : /* @__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!" }), Me = pe.length > 0;
|
|
14535
14520
|
return lm(
|
|
14536
14521
|
L,
|
|
14537
14522
|
() => ({
|
|
@@ -14558,7 +14543,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14558
14543
|
[pe]
|
|
14559
14544
|
), /* @__PURE__ */ u.jsxs("div", { className: se, style: p, children: [
|
|
14560
14545
|
te,
|
|
14561
|
-
/* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children:
|
|
14546
|
+
/* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Me ? /* @__PURE__ */ u.jsx(
|
|
14562
14547
|
vS,
|
|
14563
14548
|
{
|
|
14564
14549
|
ref: (Y) => {
|
|
@@ -14568,33 +14553,33 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14568
14553
|
j.current = Y instanceof HTMLDivElement ? Y : null;
|
|
14569
14554
|
},
|
|
14570
14555
|
data: pe,
|
|
14571
|
-
followOutput:
|
|
14556
|
+
followOutput: W,
|
|
14572
14557
|
overscan: 200,
|
|
14573
14558
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
14574
14559
|
defaultItemHeight: 80,
|
|
14575
14560
|
atBottomThreshold: 50,
|
|
14576
14561
|
alignToBottom: !1,
|
|
14577
14562
|
startReached: () => {
|
|
14578
|
-
|
|
14563
|
+
Ee && Ee();
|
|
14579
14564
|
},
|
|
14580
14565
|
atBottomStateChange: Re,
|
|
14581
14566
|
style: { height: "100%", overscrollBehavior: "contain" },
|
|
14582
14567
|
computeItemKey: (Y, de) => Hc(de, Y),
|
|
14583
14568
|
itemContent: (Y, de) => {
|
|
14584
|
-
var
|
|
14585
|
-
const ke = Hc(de, Y),
|
|
14586
|
-
let ze = [], Be = null, Ue = {}, Ke = {}, qe = null,
|
|
14587
|
-
if (!
|
|
14569
|
+
var rt;
|
|
14570
|
+
const ke = Hc(de, Y), Ne = "type" in de && de.type === "default_message";
|
|
14571
|
+
let ze = [], Be = null, Ue = {}, Ke = {}, qe = null, Ze = null;
|
|
14572
|
+
if (!Ne) {
|
|
14588
14573
|
const St = de, mt = St.checkpointId ?? null;
|
|
14589
14574
|
Ue = St.additionalKwargs ?? {}, Ke = St.responseMetadata ?? {};
|
|
14590
|
-
const
|
|
14591
|
-
qe = typeof Ue.step == "number" ? Ue.step : typeof Ke.step == "number" ? Ke.step : (
|
|
14592
|
-
const Ct = typeof Ue.source == "string" ? Ue.source : typeof Ke.source == "string" ? Ke.source : (
|
|
14593
|
-
|
|
14594
|
-
const ce = qe !== null &&
|
|
14595
|
-
ce && (N != null && N.has(ce)) ? ze = N.get(ce) ?? [] : mt &&
|
|
14575
|
+
const lt = mt && k ? k.get(mt) ?? null : null;
|
|
14576
|
+
qe = typeof Ue.step == "number" ? Ue.step : typeof Ke.step == "number" ? Ke.step : (lt == null ? void 0 : lt.step) ?? null;
|
|
14577
|
+
const Ct = typeof Ue.source == "string" ? Ue.source : typeof Ke.source == "string" ? Ke.source : (lt == null ? void 0 : lt.source) ?? null;
|
|
14578
|
+
Ze = Ct ? String(Ct) : null;
|
|
14579
|
+
const ce = qe !== null && Ze ? `${qe}:${Ze}` : null;
|
|
14580
|
+
ce && (N != null && N.has(ce)) ? ze = N.get(ce) ?? [] : mt && lt && (ze = [lt]), Be = mt ?? ((rt = ze[0]) == null ? void 0 : rt.id) ?? null;
|
|
14596
14581
|
}
|
|
14597
|
-
const
|
|
14582
|
+
const Xe = (() => {
|
|
14598
14583
|
if (typeof Ue.parentCheckpointId == "string")
|
|
14599
14584
|
return Ue.parentCheckpointId;
|
|
14600
14585
|
if (typeof Ke.parentCheckpointId == "string")
|
|
@@ -14633,7 +14618,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
|
|
|
14633
14618
|
activeCheckpointId: E ?? null,
|
|
14634
14619
|
onSelectCheckpoint: I,
|
|
14635
14620
|
defaultCheckpointId: Be,
|
|
14636
|
-
messageParentCheckpointId:
|
|
14621
|
+
messageParentCheckpointId: Xe
|
|
14637
14622
|
}
|
|
14638
14623
|
)
|
|
14639
14624
|
}
|
|
@@ -14677,23 +14662,23 @@ function Ai({
|
|
|
14677
14662
|
checkpoints: I,
|
|
14678
14663
|
interrupt: O,
|
|
14679
14664
|
metadata: L
|
|
14680
|
-
} = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), D = g ?? y ?? null, M = (E == null ? void 0 : E.id) ?? null, Z = (E == null ? void 0 : E.namespace) ?? null, J = (L == null ? void 0 : L.assemblingMessageId) ?? null, pe = O, [Re,
|
|
14665
|
+
} = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), D = g ?? y ?? null, M = (E == null ? void 0 : E.id) ?? null, Z = (E == null ? void 0 : E.namespace) ?? null, J = (L == null ? void 0 : L.assemblingMessageId) ?? null, pe = O, [Re, Ee] = ge(!1);
|
|
14681
14666
|
Et(() => {
|
|
14682
|
-
pe ||
|
|
14667
|
+
pe || Ee(!1);
|
|
14683
14668
|
}, [pe]);
|
|
14684
|
-
const
|
|
14685
|
-
|
|
14669
|
+
const W = Ce(() => {
|
|
14670
|
+
Ee(!0);
|
|
14686
14671
|
}, []), ee = Ce(() => {
|
|
14687
|
-
|
|
14688
|
-
}, []), q = !!pe || Re, [P, H] = ge(null), [te, se] = ge(""), [ne,
|
|
14689
|
-
Uc.value = G,
|
|
14690
|
-
}, []), [V, ve] = ge(!1), xe =
|
|
14672
|
+
Ee(!1);
|
|
14673
|
+
}, []), q = !!pe || Re, [P, H] = ge(null), [te, se] = ge(""), [ne, Me] = ge(null), [Y, de] = ge(null), [ke, Ne] = ge([]), [ze, Be] = ge(0), [Ue, Ke] = ge(0), [qe, Ze] = ge(!1), [Xe, rt] = ge(null), [St, mt] = ge(null), [lt, Ct] = ge(!1), [ce, re] = ge(null), [Qe, je] = ge(!1), De = Je(!1), [ut, et] = ge(() => Uc.value), Fe = Je(ut), Pt = Je(null), jt = Ce((G) => {
|
|
14674
|
+
Uc.value = G, et(G);
|
|
14675
|
+
}, []), [V, ve] = ge(!1), xe = Je(null), ht = Ce((G) => {
|
|
14691
14676
|
if (!Array.isArray(G))
|
|
14692
14677
|
return { text: null, messageId: null };
|
|
14693
14678
|
for (let oe = G.length - 1; oe >= 0; oe--) {
|
|
14694
14679
|
const ae = G[oe];
|
|
14695
14680
|
if (!ae || ae.role !== "user") continue;
|
|
14696
|
-
const be = (ae.content ?? []).filter((
|
|
14681
|
+
const be = (ae.content ?? []).filter((Ye) => (Ye == null ? void 0 : Ye.type) === "text").map((Ye) => Ye.text).filter((Ye) => typeof Ye == "string" && Ye.trim().length > 0);
|
|
14697
14682
|
return {
|
|
14698
14683
|
text: be.length ? be.join(" ").trim() : null,
|
|
14699
14684
|
messageId: ae.id ?? null
|
|
@@ -14714,20 +14699,20 @@ function Ai({
|
|
|
14714
14699
|
return typeof ae == "string" && ae.trim() ? ae : null;
|
|
14715
14700
|
},
|
|
14716
14701
|
[]
|
|
14717
|
-
), _e =
|
|
14702
|
+
), _e = at(() => {
|
|
14718
14703
|
const G = (be) => {
|
|
14719
14704
|
if (!Array.isArray(be) || be.length === 0)
|
|
14720
14705
|
return null;
|
|
14721
|
-
const dt = be.map((
|
|
14722
|
-
if (typeof
|
|
14723
|
-
return
|
|
14724
|
-
if (
|
|
14725
|
-
const
|
|
14726
|
-
if (typeof
|
|
14727
|
-
return
|
|
14706
|
+
const dt = be.map((Ye) => {
|
|
14707
|
+
if (typeof Ye == "string")
|
|
14708
|
+
return Ye.trim();
|
|
14709
|
+
if (Ye && typeof Ye == "object" && "type" in Ye) {
|
|
14710
|
+
const nt = Ye;
|
|
14711
|
+
if (typeof nt.type == "string")
|
|
14712
|
+
return nt.type;
|
|
14728
14713
|
}
|
|
14729
14714
|
return null;
|
|
14730
|
-
}).filter((
|
|
14715
|
+
}).filter((Ye) => !!(Ye && Ye.length));
|
|
14731
14716
|
return dt.length ? dt.join(", ") : null;
|
|
14732
14717
|
}, oe = Array.isArray(I) ? I.map((be) => {
|
|
14733
14718
|
const dt = G(be.next);
|
|
@@ -14740,85 +14725,85 @@ function Ai({
|
|
|
14740
14725
|
} : be;
|
|
14741
14726
|
}) : [];
|
|
14742
14727
|
return oe.some((be) => gt(be.metadata, "step") !== null) && oe.sort((be, dt) => {
|
|
14743
|
-
const
|
|
14744
|
-
if (
|
|
14745
|
-
return (
|
|
14728
|
+
const Ye = gt(be.metadata, "step"), nt = gt(dt.metadata, "step");
|
|
14729
|
+
if (Ye !== null || nt !== null)
|
|
14730
|
+
return (nt ?? Number.NEGATIVE_INFINITY) - (Ye ?? Number.NEGATIVE_INFINITY);
|
|
14746
14731
|
const Mt = Date.parse(be.createdAt ?? ""), tn = Date.parse(dt.createdAt ?? "");
|
|
14747
14732
|
return Number.isNaN(Mt) || Number.isNaN(tn) ? 0 : tn - Mt;
|
|
14748
14733
|
}), oe;
|
|
14749
|
-
}, [I, gt]), { checkpointMetaById: Vt, checkpointIndexByKey:
|
|
14734
|
+
}, [I, gt]), { checkpointMetaById: Vt, checkpointIndexByKey: ct } = at(() => {
|
|
14750
14735
|
const G = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
|
|
14751
14736
|
for (const ae of _e) {
|
|
14752
14737
|
const be = ae.checkpointId ?? null;
|
|
14753
14738
|
if (!be) continue;
|
|
14754
|
-
const dt = gt(ae.metadata, "step"),
|
|
14739
|
+
const dt = gt(ae.metadata, "step"), Ye = Tt(ae.metadata, "source"), nt = {
|
|
14755
14740
|
id: be,
|
|
14756
14741
|
step: dt,
|
|
14757
|
-
source:
|
|
14742
|
+
source: Ye,
|
|
14758
14743
|
createdAt: ae.createdAt ?? null,
|
|
14759
14744
|
namespace: ae.checkpointNs ?? null,
|
|
14760
14745
|
parentId: ae.parentId ?? null
|
|
14761
14746
|
};
|
|
14762
|
-
if (G.set(be,
|
|
14763
|
-
const Mt = `${dt}:${
|
|
14764
|
-
tn.push(
|
|
14747
|
+
if (G.set(be, nt), dt !== null && Ye) {
|
|
14748
|
+
const Mt = `${dt}:${Ye}`, tn = oe.get(Mt) ?? [];
|
|
14749
|
+
tn.push(nt), oe.set(Mt, tn);
|
|
14765
14750
|
}
|
|
14766
14751
|
}
|
|
14767
14752
|
for (const ae of oe.values())
|
|
14768
14753
|
ae.sort((be, dt) => {
|
|
14769
|
-
const
|
|
14770
|
-
return (dt.createdAt ?? "").localeCompare(
|
|
14754
|
+
const Ye = be.createdAt ?? "";
|
|
14755
|
+
return (dt.createdAt ?? "").localeCompare(Ye);
|
|
14771
14756
|
});
|
|
14772
14757
|
return { checkpointMetaById: G, checkpointIndexByKey: oe };
|
|
14773
|
-
}, [_e, gt, Tt]), kt =
|
|
14774
|
-
var
|
|
14758
|
+
}, [_e, gt, Tt]), kt = at(() => {
|
|
14759
|
+
var Ye;
|
|
14775
14760
|
if (!_e.length) return [];
|
|
14776
|
-
const G = [..._e].reverse(), oe = (
|
|
14777
|
-
const tn =
|
|
14761
|
+
const G = [..._e].reverse(), oe = (nt, Mt) => {
|
|
14762
|
+
const tn = nt.checkpointId ?? null;
|
|
14778
14763
|
if (!tn) return null;
|
|
14779
|
-
const Zn = Tt(
|
|
14780
|
-
Tt(
|
|
14781
|
-
const { text: ll, messageId: nm } = ht(
|
|
14764
|
+
const Zn = Tt(nt.metadata, "source");
|
|
14765
|
+
Tt(nt.metadata, "next");
|
|
14766
|
+
const { text: ll, messageId: nm } = ht(nt.messages), oi = ll && ll.replace(/\s+/g, " ").trim() || Tt(nt.metadata, "title") || Tt(nt.metadata, "label") || Mt || Zn || "Checkpoint", rm = oi.length > 60 ? `${oi.slice(0, 57)}…` : oi;
|
|
14782
14767
|
return {
|
|
14783
14768
|
id: tn,
|
|
14784
14769
|
label: rm,
|
|
14785
14770
|
messageId: nm ?? null,
|
|
14786
|
-
createdAt:
|
|
14787
|
-
step: gt(
|
|
14771
|
+
createdAt: nt.createdAt ?? null,
|
|
14772
|
+
step: gt(nt.metadata, "step"),
|
|
14788
14773
|
source: Zn ?? null,
|
|
14789
|
-
next: Tt(
|
|
14774
|
+
next: Tt(nt.metadata, "next")
|
|
14790
14775
|
};
|
|
14791
14776
|
}, ae = [], be = /* @__PURE__ */ new Set();
|
|
14792
|
-
for (const
|
|
14793
|
-
const Mt = ((
|
|
14777
|
+
for (const nt of G) {
|
|
14778
|
+
const Mt = ((Ye = Tt(nt.metadata, "source")) == null ? void 0 : Ye.toLowerCase()) ?? null;
|
|
14794
14779
|
if (!(Mt === "input" || Mt === "user_input" || Mt === "user")) continue;
|
|
14795
|
-
const Zn = oe(
|
|
14780
|
+
const Zn = oe(nt, "User input");
|
|
14796
14781
|
Zn && !be.has(Zn.id) && (ae.push(Zn), be.add(Zn.id));
|
|
14797
14782
|
}
|
|
14798
14783
|
if (!ae.length)
|
|
14799
|
-
for (const
|
|
14800
|
-
const Mt = oe(
|
|
14784
|
+
for (const nt of G) {
|
|
14785
|
+
const Mt = oe(nt);
|
|
14801
14786
|
Mt && !be.has(Mt.id) && (ae.push(Mt), be.add(Mt.id));
|
|
14802
14787
|
}
|
|
14803
|
-
const dt = _e.find((
|
|
14788
|
+
const dt = _e.find((nt) => {
|
|
14804
14789
|
var tn;
|
|
14805
|
-
return (((tn = Tt(
|
|
14790
|
+
return (((tn = Tt(nt.metadata, "source")) == null ? void 0 : tn.toLowerCase()) ?? null) === "loop";
|
|
14806
14791
|
});
|
|
14807
14792
|
if (dt) {
|
|
14808
|
-
const
|
|
14809
|
-
|
|
14793
|
+
const nt = oe(dt, "Latest loop");
|
|
14794
|
+
nt && !be.has(nt.id) && (ae.push(nt), be.add(nt.id));
|
|
14810
14795
|
}
|
|
14811
14796
|
return ae;
|
|
14812
|
-
}, [_e, ht, gt, Tt]), Dn =
|
|
14797
|
+
}, [_e, ht, gt, Tt]), Dn = Je(null), Jn = Je(null), Ln = Ce(() => {
|
|
14813
14798
|
Dn.current && (Dn.current.value = ""), Jn.current && (Jn.current.value = ""), Be((G) => G + 1), Ke((G) => G + 1);
|
|
14814
14799
|
}, []), ti = Ce(
|
|
14815
14800
|
(G) => {
|
|
14816
14801
|
jt(G);
|
|
14817
14802
|
},
|
|
14818
14803
|
[jt]
|
|
14819
|
-
), So =
|
|
14804
|
+
), So = Je(!1);
|
|
14820
14805
|
Et(() => {
|
|
14821
|
-
So.current && !F && (
|
|
14806
|
+
So.current && !F && (Ne([]), Ln()), So.current = F;
|
|
14822
14807
|
}, [F, Ln]);
|
|
14823
14808
|
const [ni, ri] = ge("desktop");
|
|
14824
14809
|
Et(() => {
|
|
@@ -14828,10 +14813,10 @@ function Ai({
|
|
|
14828
14813
|
};
|
|
14829
14814
|
return G(), window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
|
|
14830
14815
|
}, []), Et(() => {
|
|
14831
|
-
|
|
14816
|
+
je(!1), De.current = !1;
|
|
14832
14817
|
}, [D]), Et(() => {
|
|
14833
|
-
Fe.current =
|
|
14834
|
-
}, [
|
|
14818
|
+
Fe.current = ut;
|
|
14819
|
+
}, [ut]), Et(() => {
|
|
14835
14820
|
if (!P) {
|
|
14836
14821
|
Pt.current = null;
|
|
14837
14822
|
return;
|
|
@@ -14839,13 +14824,13 @@ function Ai({
|
|
|
14839
14824
|
Pt.current === null && (Pt.current = Fe.current), jt(te ?? "");
|
|
14840
14825
|
}, [te, P, jt]);
|
|
14841
14826
|
const R = Ce(async () => {
|
|
14842
|
-
if (!(!b || T || !
|
|
14827
|
+
if (!(!b || T || !Qe))
|
|
14843
14828
|
try {
|
|
14844
14829
|
await S();
|
|
14845
14830
|
} catch (G) {
|
|
14846
14831
|
console.warn("loadOlder failed", G);
|
|
14847
14832
|
}
|
|
14848
|
-
}, [b,
|
|
14833
|
+
}, [b, Qe, T, S]);
|
|
14849
14834
|
Et(() => {
|
|
14850
14835
|
(async () => {
|
|
14851
14836
|
if (!x.baseUrl) {
|
|
@@ -14860,8 +14845,8 @@ function Ai({
|
|
|
14860
14845
|
}
|
|
14861
14846
|
})();
|
|
14862
14847
|
}, [x.baseUrl]), Et(() => {
|
|
14863
|
-
j && !
|
|
14864
|
-
}, [j,
|
|
14848
|
+
j && !lt && (m == null || m(j));
|
|
14849
|
+
}, [j, lt, m]);
|
|
14865
14850
|
const K = (G) => {
|
|
14866
14851
|
if (G.length > Wo)
|
|
14867
14852
|
return `Message too long (${G.length}/${Wo} characters)`;
|
|
@@ -14897,7 +14882,7 @@ function Ai({
|
|
|
14897
14882
|
checkpointId: ae,
|
|
14898
14883
|
checkpointNs: be
|
|
14899
14884
|
}
|
|
14900
|
-
), p == null || p(oe), jt(""), de(null),
|
|
14885
|
+
), p == null || p(oe), jt(""), de(null), Ne([]), Ln(), H(null), se(""), Me(null);
|
|
14901
14886
|
} catch (ae) {
|
|
14902
14887
|
const be = (ae == null ? void 0 : ae.message) || "Failed to send message";
|
|
14903
14888
|
de(be), m == null || m(be);
|
|
@@ -14905,15 +14890,15 @@ function Ai({
|
|
|
14905
14890
|
}
|
|
14906
14891
|
}, we = z.useCallback(
|
|
14907
14892
|
(G, oe, ae) => {
|
|
14908
|
-
c && (Pt.current =
|
|
14893
|
+
c && (Pt.current = ut, H(G), se(oe), jt(oe), de(null), Me({
|
|
14909
14894
|
checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? null,
|
|
14910
14895
|
checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null
|
|
14911
14896
|
}));
|
|
14912
14897
|
},
|
|
14913
|
-
[
|
|
14914
|
-
),
|
|
14915
|
-
H(null), se(""),
|
|
14916
|
-
}, [
|
|
14898
|
+
[ut, c, jt]
|
|
14899
|
+
), Ge = z.useCallback(() => {
|
|
14900
|
+
H(null), se(""), Me(null), de(null), jt(Pt.current ?? ut), Pt.current = null;
|
|
14901
|
+
}, [ut, jt]), it = Ce(
|
|
14917
14902
|
(G, oe, ae) => {
|
|
14918
14903
|
we(G, oe, ae);
|
|
14919
14904
|
},
|
|
@@ -14921,7 +14906,7 @@ function Ai({
|
|
|
14921
14906
|
), He = Ce((G) => {
|
|
14922
14907
|
for (let oe = G - 1; oe >= 0; oe--)
|
|
14923
14908
|
if (w[oe].role === "user") {
|
|
14924
|
-
const ae = w[oe].content || [], dt = ae.filter((
|
|
14909
|
+
const ae = w[oe].content || [], dt = ae.filter((Ye) => Ye.type === "text").map((Ye) => Ye.text).join("") || (() => {
|
|
14925
14910
|
try {
|
|
14926
14911
|
return JSON.stringify(ae, null, 2);
|
|
14927
14912
|
} catch {
|
|
@@ -14939,16 +14924,16 @@ function Ai({
|
|
|
14939
14924
|
}
|
|
14940
14925
|
}, [w, A, M, Z]), $e = (G) => {
|
|
14941
14926
|
const oe = Array.from(G.target.files || []);
|
|
14942
|
-
|
|
14927
|
+
Ne((ae) => [...ae, ...oe]), G.target.value = "";
|
|
14943
14928
|
}, Ot = (G) => {
|
|
14944
|
-
|
|
14929
|
+
Ne((oe) => {
|
|
14945
14930
|
const ae = oe.filter((be, dt) => G !== dt);
|
|
14946
14931
|
return ae.length === 0 && Ln(), ae;
|
|
14947
14932
|
});
|
|
14948
14933
|
}, bt = async (G) => {
|
|
14949
14934
|
const oe = (G.target.files || [])[0];
|
|
14950
14935
|
if (oe) {
|
|
14951
|
-
|
|
14936
|
+
rt(null), mt(null), Ze(!0);
|
|
14952
14937
|
try {
|
|
14953
14938
|
await A(
|
|
14954
14939
|
{ attachments: [oe] },
|
|
@@ -14961,9 +14946,9 @@ function Ai({
|
|
|
14961
14946
|
mt(ae);
|
|
14962
14947
|
} catch (ae) {
|
|
14963
14948
|
const be = ae instanceof Error ? ae.message : "Failed to upload Excel file";
|
|
14964
|
-
console.error("Excel upload failed", ae),
|
|
14949
|
+
console.error("Excel upload failed", ae), rt(be), m == null || m(be);
|
|
14965
14950
|
} finally {
|
|
14966
|
-
|
|
14951
|
+
Ze(!1), G.target.value = "", Ln();
|
|
14967
14952
|
}
|
|
14968
14953
|
}
|
|
14969
14954
|
}, vt = async (G) => {
|
|
@@ -14971,14 +14956,14 @@ function Ai({
|
|
|
14971
14956
|
ve(!0);
|
|
14972
14957
|
try {
|
|
14973
14958
|
if (!G) {
|
|
14974
|
-
await N(),
|
|
14959
|
+
await N(), je(!1), requestAnimationFrame(() => {
|
|
14975
14960
|
var be;
|
|
14976
14961
|
(be = xe.current) == null || be.scrollToLatest();
|
|
14977
14962
|
});
|
|
14978
14963
|
return;
|
|
14979
14964
|
}
|
|
14980
14965
|
const oe = _e.find((be) => be.checkpointId === G), ae = (oe == null ? void 0 : oe.checkpointNs) ?? null;
|
|
14981
|
-
await k(G, ae),
|
|
14966
|
+
await k(G, ae), je(!0), requestAnimationFrame(() => {
|
|
14982
14967
|
var be;
|
|
14983
14968
|
(be = xe.current) == null || be.scrollToTop();
|
|
14984
14969
|
});
|
|
@@ -15003,10 +14988,10 @@ function Ai({
|
|
|
15003
14988
|
[]
|
|
15004
14989
|
);
|
|
15005
14990
|
return /* @__PURE__ */ u.jsxs("div", { className: Fn, children: [
|
|
15006
|
-
!!j && !
|
|
14991
|
+
!!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: [
|
|
15007
14992
|
/* @__PURE__ */ u.jsx("span", { children: j }),
|
|
15008
14993
|
/* @__PURE__ */ u.jsx(
|
|
15009
|
-
|
|
14994
|
+
ot,
|
|
15010
14995
|
{
|
|
15011
14996
|
variant: "ghost",
|
|
15012
14997
|
size: "sm",
|
|
@@ -15059,27 +15044,27 @@ function Ai({
|
|
|
15059
15044
|
enableMessageEditing: c,
|
|
15060
15045
|
editingMessageId: P,
|
|
15061
15046
|
onStartReached: () => {
|
|
15062
|
-
|
|
15047
|
+
Qe && R();
|
|
15063
15048
|
},
|
|
15064
15049
|
onScrollAway: (G) => {
|
|
15065
|
-
if (!
|
|
15066
|
-
|
|
15050
|
+
if (!De.current) {
|
|
15051
|
+
De.current = !0;
|
|
15067
15052
|
return;
|
|
15068
15053
|
}
|
|
15069
|
-
G &&
|
|
15054
|
+
G && je(!0);
|
|
15070
15055
|
},
|
|
15071
|
-
onEdit:
|
|
15056
|
+
onEdit: it,
|
|
15072
15057
|
onRegenerate: He,
|
|
15073
|
-
onCancelEdit:
|
|
15058
|
+
onCancelEdit: Ge,
|
|
15074
15059
|
emptyMessage: ce ?? void 0,
|
|
15075
15060
|
isNavigatingCheckpoint: V,
|
|
15076
15061
|
activeInterrupt: pe,
|
|
15077
15062
|
disableInterruptActions: Re,
|
|
15078
|
-
onInterruptActionStart:
|
|
15063
|
+
onInterruptActionStart: W,
|
|
15079
15064
|
onInterruptActionEnd: ee,
|
|
15080
15065
|
showToolMessages: d,
|
|
15081
15066
|
checkpointMetaById: Vt,
|
|
15082
|
-
checkpointIndexByKey:
|
|
15067
|
+
checkpointIndexByKey: ct,
|
|
15083
15068
|
activeCheckpointId: M,
|
|
15084
15069
|
onSelectCheckpoint: Kt,
|
|
15085
15070
|
timelineCheckpoints: kt
|
|
@@ -15108,11 +15093,11 @@ function Ai({
|
|
|
15108
15093
|
/* @__PURE__ */ u.jsx("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
|
|
15109
15094
|
] }),
|
|
15110
15095
|
/* @__PURE__ */ u.jsx(
|
|
15111
|
-
|
|
15096
|
+
ot,
|
|
15112
15097
|
{
|
|
15113
15098
|
variant: "ghost",
|
|
15114
15099
|
size: "sm",
|
|
15115
|
-
onClick:
|
|
15100
|
+
onClick: Ge,
|
|
15116
15101
|
className: "text-blue-600 hover:bg-blue-100",
|
|
15117
15102
|
children: /* @__PURE__ */ u.jsx(vr, { size: 16 })
|
|
15118
15103
|
}
|
|
@@ -15135,7 +15120,7 @@ function Ai({
|
|
|
15135
15120
|
/* @__PURE__ */ u.jsx(ji, { size: 14 }),
|
|
15136
15121
|
/* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: G.name }),
|
|
15137
15122
|
/* @__PURE__ */ u.jsx(
|
|
15138
|
-
|
|
15123
|
+
ot,
|
|
15139
15124
|
{
|
|
15140
15125
|
variant: "ghost",
|
|
15141
15126
|
size: "sm",
|
|
@@ -15164,14 +15149,14 @@ function Ai({
|
|
|
15164
15149
|
" Uploading Excel file..."
|
|
15165
15150
|
] }),
|
|
15166
15151
|
St && !qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: St }),
|
|
15167
|
-
|
|
15152
|
+
Xe && !qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Xe })
|
|
15168
15153
|
] })
|
|
15169
15154
|
] }),
|
|
15170
15155
|
Y && /* @__PURE__ */ u.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: Y }),
|
|
15171
15156
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
15172
15157
|
(a || l) && /* @__PURE__ */ u.jsxs(Qb, { children: [
|
|
15173
15158
|
/* @__PURE__ */ u.jsx(e0, { asChild: !0, children: /* @__PURE__ */ u.jsx(
|
|
15174
|
-
|
|
15159
|
+
ot,
|
|
15175
15160
|
{
|
|
15176
15161
|
type: "button",
|
|
15177
15162
|
size: "icon",
|
|
@@ -15211,14 +15196,14 @@ function Ai({
|
|
|
15211
15196
|
{
|
|
15212
15197
|
initialValue: te,
|
|
15213
15198
|
editingMessageId: P,
|
|
15214
|
-
value:
|
|
15199
|
+
value: ut,
|
|
15215
15200
|
onValueChange: ti,
|
|
15216
15201
|
placeholder: P ? "Edit your message..." : t,
|
|
15217
15202
|
isStreaming: F,
|
|
15218
15203
|
disabled: q,
|
|
15219
15204
|
maxLength: Wo,
|
|
15220
15205
|
onSend: ie,
|
|
15221
|
-
onCancelEdit:
|
|
15206
|
+
onCancelEdit: Ge,
|
|
15222
15207
|
onStop: B,
|
|
15223
15208
|
allowEmptySend: ke.length > 0,
|
|
15224
15209
|
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${P ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Y ? "border-red-400" : ""} ${f.textarea || ""}`
|
|
@@ -15281,7 +15266,7 @@ var rl = "ScrollArea", [Dp, vk] = Mn(rl), [PC, un] = Dp(rl), Lp = v.forwardRef(
|
|
|
15281
15266
|
onCornerWidthChange: w,
|
|
15282
15267
|
onCornerHeightChange: T,
|
|
15283
15268
|
children: /* @__PURE__ */ u.jsx(
|
|
15284
|
-
|
|
15269
|
+
Ae.div,
|
|
15285
15270
|
{
|
|
15286
15271
|
dir: I,
|
|
15287
15272
|
...i,
|
|
@@ -15314,7 +15299,7 @@ var Fp = "ScrollAreaViewport", $p = v.forwardRef(
|
|
|
15314
15299
|
}
|
|
15315
15300
|
),
|
|
15316
15301
|
/* @__PURE__ */ u.jsx(
|
|
15317
|
-
|
|
15302
|
+
Ae.div,
|
|
15318
15303
|
{
|
|
15319
15304
|
"data-radix-scroll-area-viewport": "",
|
|
15320
15305
|
...s,
|
|
@@ -15603,7 +15588,7 @@ var OC = v.forwardRef((e, t) => {
|
|
|
15603
15588
|
onThumbPositionChange: S,
|
|
15604
15589
|
onThumbPointerDown: Dt(a),
|
|
15605
15590
|
children: /* @__PURE__ */ u.jsx(
|
|
15606
|
-
|
|
15591
|
+
Ae.div,
|
|
15607
15592
|
{
|
|
15608
15593
|
...p,
|
|
15609
15594
|
ref: y,
|
|
@@ -15645,7 +15630,7 @@ var OC = v.forwardRef((e, t) => {
|
|
|
15645
15630
|
return a(), f.addEventListener("scroll", p), () => f.removeEventListener("scroll", p);
|
|
15646
15631
|
}
|
|
15647
15632
|
}, [s.viewport, d, a]), /* @__PURE__ */ u.jsx(
|
|
15648
|
-
|
|
15633
|
+
Ae.div,
|
|
15649
15634
|
{
|
|
15650
15635
|
"data-state": i.hasThumb ? "visible" : "hidden",
|
|
15651
15636
|
...o,
|
|
@@ -15683,7 +15668,7 @@ var zC = v.forwardRef((e, t) => {
|
|
|
15683
15668
|
const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
|
|
15684
15669
|
o.onCornerWidthChange(d), i(d);
|
|
15685
15670
|
}), c ? /* @__PURE__ */ u.jsx(
|
|
15686
|
-
|
|
15671
|
+
Ae.div,
|
|
15687
15672
|
{
|
|
15688
15673
|
...r,
|
|
15689
15674
|
ref: t,
|
|
@@ -15807,85 +15792,85 @@ function Kc({
|
|
|
15807
15792
|
setCurrentThreadId: h,
|
|
15808
15793
|
isLoading: m,
|
|
15809
15794
|
actions: x
|
|
15810
|
-
} = xa(), { loadThread: y } = ya(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ge(Array.isArray(f) ? f : []), S =
|
|
15795
|
+
} = xa(), { loadThread: y } = ya(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ge(Array.isArray(f) ? f : []), S = Je(T.length > 0), k = Je(null), N = Je(0), [E, I] = ge(null), [O, L] = ge(""), [F, j] = ge(!1);
|
|
15811
15796
|
Et(() => {
|
|
15812
|
-
const
|
|
15813
|
-
if (
|
|
15814
|
-
S.current = !0, C(
|
|
15797
|
+
const W = Array.isArray(f) ? f : [];
|
|
15798
|
+
if (W.length > 0) {
|
|
15799
|
+
S.current = !0, C(W);
|
|
15815
15800
|
return;
|
|
15816
15801
|
}
|
|
15817
|
-
m || (S.current = !1, C(
|
|
15802
|
+
m || (S.current = !1, C(W));
|
|
15818
15803
|
}, [f, m]), Et(() => {
|
|
15819
15804
|
if (!k.current) return;
|
|
15820
|
-
const
|
|
15805
|
+
const W = k.current.querySelector(
|
|
15821
15806
|
"[data-radix-scroll-area-viewport]"
|
|
15822
15807
|
);
|
|
15823
|
-
if (!
|
|
15808
|
+
if (!W) return;
|
|
15824
15809
|
let ee = null, q = null;
|
|
15825
15810
|
return ee = requestAnimationFrame(() => {
|
|
15826
15811
|
q = requestAnimationFrame(() => {
|
|
15827
|
-
|
|
15812
|
+
W.scrollTop = N.current;
|
|
15828
15813
|
});
|
|
15829
15814
|
}), () => {
|
|
15830
15815
|
ee !== null && cancelAnimationFrame(ee), q !== null && cancelAnimationFrame(q);
|
|
15831
15816
|
};
|
|
15832
15817
|
}, [T]);
|
|
15833
|
-
const $ = async (
|
|
15818
|
+
const $ = async (W) => {
|
|
15834
15819
|
try {
|
|
15835
|
-
h(
|
|
15820
|
+
h(W), await y(W), a == null || a(W), l == null || l(W);
|
|
15836
15821
|
} catch (ee) {
|
|
15837
15822
|
console.error("Failed to select thread:", ee);
|
|
15838
15823
|
}
|
|
15839
15824
|
}, A = async () => {
|
|
15840
15825
|
try {
|
|
15841
15826
|
j(!0);
|
|
15842
|
-
const
|
|
15843
|
-
|
|
15844
|
-
} catch (
|
|
15845
|
-
console.error("Failed to create thread:",
|
|
15827
|
+
const W = await g();
|
|
15828
|
+
W && (c == null || c(W), a == null || a(W));
|
|
15829
|
+
} catch (W) {
|
|
15830
|
+
console.error("Failed to create thread:", W);
|
|
15846
15831
|
} finally {
|
|
15847
15832
|
j(!1);
|
|
15848
15833
|
}
|
|
15849
|
-
}, B = async (
|
|
15834
|
+
}, B = async (W, ee) => {
|
|
15850
15835
|
if (ee.stopPropagation(), !!confirm("Delete this thread?")) {
|
|
15851
15836
|
if (k.current) {
|
|
15852
15837
|
const q = k.current.querySelector("[data-radix-scroll-area-viewport]");
|
|
15853
15838
|
q && (N.current = q.scrollTop);
|
|
15854
15839
|
}
|
|
15855
15840
|
try {
|
|
15856
|
-
await w(
|
|
15841
|
+
await w(W), d == null || d(W);
|
|
15857
15842
|
} catch (q) {
|
|
15858
15843
|
console.error("Failed to delete thread:", q);
|
|
15859
15844
|
}
|
|
15860
15845
|
}
|
|
15861
|
-
}, D = (
|
|
15862
|
-
ee.stopPropagation(), I(
|
|
15863
|
-
}, M = async (
|
|
15846
|
+
}, D = (W, ee) => {
|
|
15847
|
+
ee.stopPropagation(), I(W.threadId), L(W.title || `Thread ${W.threadId.slice(0, 8)}`);
|
|
15848
|
+
}, M = async (W) => {
|
|
15864
15849
|
if (O.trim())
|
|
15865
15850
|
try {
|
|
15866
|
-
await b(
|
|
15851
|
+
await b(W, O.trim()), I(null), L("");
|
|
15867
15852
|
} catch (ee) {
|
|
15868
15853
|
console.error("Failed to update title:", ee);
|
|
15869
15854
|
}
|
|
15870
15855
|
}, Z = () => {
|
|
15871
15856
|
I(null), L("");
|
|
15872
|
-
}, J = (
|
|
15873
|
-
|
|
15874
|
-
}, pe = (
|
|
15875
|
-
if (!
|
|
15857
|
+
}, J = (W, ee) => {
|
|
15858
|
+
W.key === "Enter" ? M(ee) : W.key === "Escape" && Z();
|
|
15859
|
+
}, pe = (W) => {
|
|
15860
|
+
if (!W) return "";
|
|
15876
15861
|
try {
|
|
15877
|
-
const ee = new Date(
|
|
15862
|
+
const ee = new Date(W), P = (/* @__PURE__ */ new Date()).getTime() - ee.getTime(), H = Math.floor(P / (1e3 * 60 * 60 * 24));
|
|
15878
15863
|
return H === 0 ? ee.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : H === 1 ? "Yesterday" : H < 7 ? `${H} days ago` : ee.toLocaleDateString();
|
|
15879
15864
|
} catch {
|
|
15880
15865
|
return "";
|
|
15881
15866
|
}
|
|
15882
|
-
}, Re = (
|
|
15883
|
-
const ee = Re(
|
|
15867
|
+
}, Re = (W) => W.title || `Thread ${W.threadId.slice(0, 8)}`, Ee = (W) => {
|
|
15868
|
+
const ee = Re(W);
|
|
15884
15869
|
return ee.length <= Vc ? ee : `${ee.slice(0, Vc)}...`;
|
|
15885
15870
|
};
|
|
15886
15871
|
return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
15887
15872
|
t && /* @__PURE__ */ u.jsx("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ u.jsx(
|
|
15888
|
-
|
|
15873
|
+
ot,
|
|
15889
15874
|
{
|
|
15890
15875
|
onClick: A,
|
|
15891
15876
|
disabled: F || m,
|
|
@@ -15908,32 +15893,32 @@ function Kc({
|
|
|
15908
15893
|
] }) : T.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
|
|
15909
15894
|
/* @__PURE__ */ u.jsx(Sm, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
|
|
15910
15895
|
/* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
|
|
15911
|
-
] }) : T.slice().sort((
|
|
15896
|
+
] }) : T.slice().sort((W, ee) => new Date(ee.updatedAt || ee.createdAt || "").getTime() - new Date(W.updatedAt || W.createdAt || "").getTime()).map((W) => /* @__PURE__ */ u.jsxs(
|
|
15912
15897
|
"div",
|
|
15913
15898
|
{
|
|
15914
|
-
onClick: () => $(
|
|
15915
|
-
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) ===
|
|
15899
|
+
onClick: () => $(W.threadId),
|
|
15900
|
+
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) === W.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
|
|
15916
15901
|
children: [
|
|
15917
15902
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15918
|
-
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: E ===
|
|
15919
|
-
/* @__PURE__ */ u.jsx(ps, { value: O, onChange: (ee) => L(ee.target.value), onKeyDown: (ee) => J(ee,
|
|
15920
|
-
/* @__PURE__ */ u.jsx(
|
|
15921
|
-
/* @__PURE__ */ u.jsx(
|
|
15903
|
+
/* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: E === W.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (ee) => ee.stopPropagation(), children: [
|
|
15904
|
+
/* @__PURE__ */ u.jsx(ps, { value: O, onChange: (ee) => L(ee.target.value), onKeyDown: (ee) => J(ee, W.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
15905
|
+
/* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: () => M(W.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ca, { size: 12 }) }),
|
|
15906
|
+
/* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: Z, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(vr, { size: 12 }) })
|
|
15922
15907
|
] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
15923
|
-
/* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children:
|
|
15908
|
+
/* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ee(W) }),
|
|
15924
15909
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
15925
15910
|
/* @__PURE__ */ u.jsx(Cm, { size: 10 }),
|
|
15926
|
-
/* @__PURE__ */ u.jsx("span", { children: pe(
|
|
15911
|
+
/* @__PURE__ */ u.jsx("span", { children: pe(W.updatedAt || W.createdAt) })
|
|
15927
15912
|
] })
|
|
15928
15913
|
] }) }),
|
|
15929
15914
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
15930
|
-
r && E !==
|
|
15915
|
+
r && E !== W.threadId && /* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: (ee) => D(W, ee), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Jc, { size: 12 }) }),
|
|
15931
15916
|
n && /* @__PURE__ */ u.jsx(
|
|
15932
|
-
|
|
15917
|
+
ot,
|
|
15933
15918
|
{
|
|
15934
15919
|
variant: "ghost",
|
|
15935
15920
|
size: "sm",
|
|
15936
|
-
onClick: (ee) => B(
|
|
15921
|
+
onClick: (ee) => B(W.threadId, ee),
|
|
15937
15922
|
className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
|
|
15938
15923
|
title: "Delete thread",
|
|
15939
15924
|
children: /* @__PURE__ */ u.jsx(Tm, { size: 12 })
|
|
@@ -15941,10 +15926,10 @@ function Kc({
|
|
|
15941
15926
|
)
|
|
15942
15927
|
] })
|
|
15943
15928
|
] }),
|
|
15944
|
-
i ===
|
|
15929
|
+
i === W.threadId && /* @__PURE__ */ u.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-400 rounded-r" })
|
|
15945
15930
|
]
|
|
15946
15931
|
},
|
|
15947
|
-
|
|
15932
|
+
W.threadId
|
|
15948
15933
|
)) })
|
|
15949
15934
|
}
|
|
15950
15935
|
)
|
|
@@ -16053,7 +16038,7 @@ function bk(e) {
|
|
|
16053
16038
|
}), YC(e);
|
|
16054
16039
|
}
|
|
16055
16040
|
var XC = "Label", th = v.forwardRef((e, t) => /* @__PURE__ */ u.jsx(
|
|
16056
|
-
|
|
16041
|
+
Ae.label,
|
|
16057
16042
|
{
|
|
16058
16043
|
...e,
|
|
16059
16044
|
ref: t,
|
|
@@ -16101,7 +16086,7 @@ var Js = "Switch", [ZC, Sk] = Mn(Js), [QC, eT] = ZC(Js), oh = v.forwardRef(
|
|
|
16101
16086
|
});
|
|
16102
16087
|
return /* @__PURE__ */ u.jsxs(QC, { scope: n, checked: g, disabled: a, children: [
|
|
16103
16088
|
/* @__PURE__ */ u.jsx(
|
|
16104
|
-
|
|
16089
|
+
Ae.button,
|
|
16105
16090
|
{
|
|
16106
16091
|
type: "button",
|
|
16107
16092
|
role: "switch",
|
|
@@ -16140,7 +16125,7 @@ var sh = "SwitchThumb", ih = v.forwardRef(
|
|
|
16140
16125
|
(e, t) => {
|
|
16141
16126
|
const { __scopeSwitch: n, ...r } = e, o = eT(sh, n);
|
|
16142
16127
|
return /* @__PURE__ */ u.jsx(
|
|
16143
|
-
|
|
16128
|
+
Ae.span,
|
|
16144
16129
|
{
|
|
16145
16130
|
"data-state": lh(o.checked),
|
|
16146
16131
|
"data-disabled": o.disabled ? "" : void 0,
|
|
@@ -16231,7 +16216,7 @@ var uh = Object.freeze({
|
|
|
16231
16216
|
wordWrap: "normal"
|
|
16232
16217
|
}), rT = "VisuallyHidden", oT = v.forwardRef(
|
|
16233
16218
|
(e, t) => /* @__PURE__ */ u.jsx(
|
|
16234
|
-
|
|
16219
|
+
Ae.span,
|
|
16235
16220
|
{
|
|
16236
16221
|
...e,
|
|
16237
16222
|
ref: t,
|
|
@@ -16342,7 +16327,7 @@ var fh = "SelectTrigger", ph = v.forwardRef(
|
|
|
16342
16327
|
});
|
|
16343
16328
|
};
|
|
16344
16329
|
return /* @__PURE__ */ u.jsx(ad, { asChild: !0, ...s, children: /* @__PURE__ */ u.jsx(
|
|
16345
|
-
|
|
16330
|
+
Ae.button,
|
|
16346
16331
|
{
|
|
16347
16332
|
type: "button",
|
|
16348
16333
|
role: "combobox",
|
|
@@ -16380,7 +16365,7 @@ var hh = "SelectValue", mh = v.forwardRef(
|
|
|
16380
16365
|
return Lt(() => {
|
|
16381
16366
|
c(d);
|
|
16382
16367
|
}, [c, d]), /* @__PURE__ */ u.jsx(
|
|
16383
|
-
|
|
16368
|
+
Ae.span,
|
|
16384
16369
|
{
|
|
16385
16370
|
...a,
|
|
16386
16371
|
ref: f,
|
|
@@ -16394,7 +16379,7 @@ mh.displayName = hh;
|
|
|
16394
16379
|
var dT = "SelectIcon", gh = v.forwardRef(
|
|
16395
16380
|
(e, t) => {
|
|
16396
16381
|
const { __scopeSelect: n, children: r, ...o } = e;
|
|
16397
|
-
return /* @__PURE__ */ u.jsx(
|
|
16382
|
+
return /* @__PURE__ */ u.jsx(Ae.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
|
|
16398
16383
|
}
|
|
16399
16384
|
);
|
|
16400
16385
|
gh.displayName = dT;
|
|
@@ -16490,13 +16475,13 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
|
|
|
16490
16475
|
(w.value !== void 0 && w.value === P || te) && (E(q), te && ($.current = !0));
|
|
16491
16476
|
},
|
|
16492
16477
|
[w.value]
|
|
16493
|
-
), Re = v.useCallback(() => b == null ? void 0 : b.focus(), [b]),
|
|
16478
|
+
), Re = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ee = v.useCallback(
|
|
16494
16479
|
(q, P, H) => {
|
|
16495
16480
|
const te = !$.current && !H;
|
|
16496
16481
|
(w.value !== void 0 && w.value === P || te) && O(q);
|
|
16497
16482
|
},
|
|
16498
16483
|
[w.value]
|
|
16499
|
-
),
|
|
16484
|
+
), W = r === "popper" ? na : bh, ee = W === na ? {
|
|
16500
16485
|
side: a,
|
|
16501
16486
|
sideOffset: l,
|
|
16502
16487
|
align: c,
|
|
@@ -16518,7 +16503,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
|
|
|
16518
16503
|
itemRefCallback: pe,
|
|
16519
16504
|
selectedItem: N,
|
|
16520
16505
|
onItemLeave: Re,
|
|
16521
|
-
itemTextRefCallback:
|
|
16506
|
+
itemTextRefCallback: Ee,
|
|
16522
16507
|
focusSelectedItem: B,
|
|
16523
16508
|
selectedItemText: I,
|
|
16524
16509
|
position: r,
|
|
@@ -16546,7 +16531,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
|
|
|
16546
16531
|
onFocusOutside: (q) => q.preventDefault(),
|
|
16547
16532
|
onDismiss: () => w.onOpenChange(!1),
|
|
16548
16533
|
children: /* @__PURE__ */ u.jsx(
|
|
16549
|
-
|
|
16534
|
+
W,
|
|
16550
16535
|
{
|
|
16551
16536
|
role: "listbox",
|
|
16552
16537
|
id: w.contentId,
|
|
@@ -16592,7 +16577,7 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
|
|
|
16592
16577
|
if (s.trigger && s.valueNode && a && c && x && y && g) {
|
|
16593
16578
|
const k = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), E = s.valueNode.getBoundingClientRect(), I = g.getBoundingClientRect();
|
|
16594
16579
|
if (s.dir !== "rtl") {
|
|
16595
|
-
const se = I.left - N.left, ne = E.left - se,
|
|
16580
|
+
const se = I.left - N.left, ne = E.left - se, Me = k.left - ne, Y = k.width + Me, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
|
|
16596
16581
|
dn,
|
|
16597
16582
|
// Prevents the content from going off the starting edge of the
|
|
16598
16583
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -16601,33 +16586,33 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
|
|
|
16601
16586
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
16602
16587
|
Math.max(dn, ke - de)
|
|
16603
16588
|
]);
|
|
16604
|
-
a.style.minWidth = Y + "px", a.style.left =
|
|
16589
|
+
a.style.minWidth = Y + "px", a.style.left = Ne + "px";
|
|
16605
16590
|
} else {
|
|
16606
|
-
const se = N.right - I.right, ne = window.innerWidth - E.right - se,
|
|
16591
|
+
const se = N.right - I.right, ne = window.innerWidth - E.right - se, Me = window.innerWidth - k.right - ne, Y = k.width + Me, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
|
|
16607
16592
|
dn,
|
|
16608
16593
|
Math.max(dn, ke - de)
|
|
16609
16594
|
]);
|
|
16610
|
-
a.style.minWidth = Y + "px", a.style.right =
|
|
16595
|
+
a.style.minWidth = Y + "px", a.style.right = Ne + "px";
|
|
16611
16596
|
}
|
|
16612
|
-
const O = p(), L = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), M = $ + A + F + D + B, Z = Math.min(y.offsetHeight * 5, M), J = window.getComputedStyle(x), pe = parseInt(J.paddingTop, 10), Re = parseInt(J.paddingBottom, 10),
|
|
16613
|
-
if (P <=
|
|
16597
|
+
const O = p(), L = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), M = $ + A + F + D + B, Z = Math.min(y.offsetHeight * 5, M), J = window.getComputedStyle(x), pe = parseInt(J.paddingTop, 10), Re = parseInt(J.paddingBottom, 10), Ee = k.top + k.height / 2 - dn, W = L - Ee, ee = y.offsetHeight / 2, q = y.offsetTop + ee, P = $ + A + q, H = M - P;
|
|
16598
|
+
if (P <= Ee) {
|
|
16614
16599
|
const se = O.length > 0 && y === O[O.length - 1].ref.current;
|
|
16615
16600
|
a.style.bottom = "0px";
|
|
16616
|
-
const ne = c.clientHeight - x.offsetTop - x.offsetHeight,
|
|
16617
|
-
|
|
16601
|
+
const ne = c.clientHeight - x.offsetTop - x.offsetHeight, Me = Math.max(
|
|
16602
|
+
W,
|
|
16618
16603
|
ee + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
16619
16604
|
(se ? Re : 0) + ne + B
|
|
16620
|
-
), Y = P +
|
|
16605
|
+
), Y = P + Me;
|
|
16621
16606
|
a.style.height = Y + "px";
|
|
16622
16607
|
} else {
|
|
16623
16608
|
const se = O.length > 0 && y === O[0].ref.current;
|
|
16624
16609
|
a.style.top = "0px";
|
|
16625
|
-
const
|
|
16626
|
-
|
|
16610
|
+
const Me = Math.max(
|
|
16611
|
+
Ee,
|
|
16627
16612
|
$ + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
16628
16613
|
(se ? pe : 0) + ee
|
|
16629
16614
|
) + H;
|
|
16630
|
-
a.style.height =
|
|
16615
|
+
a.style.height = Me + "px", x.scrollTop = P - Ee + x.offsetTop;
|
|
16631
16616
|
}
|
|
16632
16617
|
a.style.margin = `${dn}px 0`, a.style.minHeight = Z + "px", a.style.maxHeight = L + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
|
|
16633
16618
|
}
|
|
@@ -16672,7 +16657,7 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
|
|
|
16672
16657
|
zIndex: T
|
|
16673
16658
|
},
|
|
16674
16659
|
children: /* @__PURE__ */ u.jsx(
|
|
16675
|
-
|
|
16660
|
+
Ae.div,
|
|
16676
16661
|
{
|
|
16677
16662
|
...o,
|
|
16678
16663
|
ref: f,
|
|
@@ -16735,7 +16720,7 @@ var [xT, al] = Mr(ur, {}), ra = "SelectViewport", Sh = v.forwardRef(
|
|
|
16735
16720
|
}
|
|
16736
16721
|
),
|
|
16737
16722
|
/* @__PURE__ */ u.jsx(Zs.Slot, { scope: n, children: /* @__PURE__ */ u.jsx(
|
|
16738
|
-
|
|
16723
|
+
Ae.div,
|
|
16739
16724
|
{
|
|
16740
16725
|
"data-radix-select-viewport": "",
|
|
16741
16726
|
role: "presentation",
|
|
@@ -16777,14 +16762,14 @@ Sh.displayName = ra;
|
|
|
16777
16762
|
var Ch = "SelectGroup", [yT, vT] = Mr(Ch), wT = v.forwardRef(
|
|
16778
16763
|
(e, t) => {
|
|
16779
16764
|
const { __scopeSelect: n, ...r } = e, o = jn();
|
|
16780
|
-
return /* @__PURE__ */ u.jsx(yT, { scope: n, id: o, children: /* @__PURE__ */ u.jsx(
|
|
16765
|
+
return /* @__PURE__ */ u.jsx(yT, { scope: n, id: o, children: /* @__PURE__ */ u.jsx(Ae.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
16781
16766
|
}
|
|
16782
16767
|
);
|
|
16783
16768
|
wT.displayName = Ch;
|
|
16784
16769
|
var Th = "SelectLabel", kh = v.forwardRef(
|
|
16785
16770
|
(e, t) => {
|
|
16786
16771
|
const { __scopeSelect: n, ...r } = e, o = vT(Th, n);
|
|
16787
|
-
return /* @__PURE__ */ u.jsx(
|
|
16772
|
+
return /* @__PURE__ */ u.jsx(Ae.div, { id: o.id, ...r, ref: t });
|
|
16788
16773
|
}
|
|
16789
16774
|
);
|
|
16790
16775
|
kh.displayName = Th;
|
|
@@ -16828,7 +16813,7 @@ var gs = "SelectItem", [bT, Rh] = Mr(gs), Eh = v.forwardRef(
|
|
|
16828
16813
|
disabled: o,
|
|
16829
16814
|
textValue: d,
|
|
16830
16815
|
children: /* @__PURE__ */ u.jsx(
|
|
16831
|
-
|
|
16816
|
+
Ae.div,
|
|
16832
16817
|
{
|
|
16833
16818
|
role: "option",
|
|
16834
16819
|
"aria-labelledby": x,
|
|
@@ -16887,7 +16872,7 @@ var Hr = "SelectItemText", Ih = v.forwardRef(
|
|
|
16887
16872
|
[l.disabled, l.value, h]
|
|
16888
16873
|
), { onNativeOptionAdd: x, onNativeOptionRemove: y } = c;
|
|
16889
16874
|
return Lt(() => (x(m), () => y(m)), [x, y, m]), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
16890
|
-
/* @__PURE__ */ u.jsx(
|
|
16875
|
+
/* @__PURE__ */ u.jsx(Ae.span, { id: l.textId, ...s, ref: p }),
|
|
16891
16876
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? ws.createPortal(s.children, i.valueNode) : null
|
|
16892
16877
|
] });
|
|
16893
16878
|
}
|
|
@@ -16896,7 +16881,7 @@ Ih.displayName = Hr;
|
|
|
16896
16881
|
var Nh = "SelectItemIndicator", Ah = v.forwardRef(
|
|
16897
16882
|
(e, t) => {
|
|
16898
16883
|
const { __scopeSelect: n, ...r } = e;
|
|
16899
|
-
return Rh(Nh, n).isSelected ? /* @__PURE__ */ u.jsx(
|
|
16884
|
+
return Rh(Nh, n).isSelected ? /* @__PURE__ */ u.jsx(Ae.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
16900
16885
|
}
|
|
16901
16886
|
);
|
|
16902
16887
|
Ah.displayName = Nh;
|
|
@@ -16957,7 +16942,7 @@ var Ph = v.forwardRef((e, t) => {
|
|
|
16957
16942
|
const c = a().find((f) => f.ref.current === document.activeElement);
|
|
16958
16943
|
(d = c == null ? void 0 : c.ref.current) == null || d.scrollIntoView({ block: "nearest" });
|
|
16959
16944
|
}, [a]), /* @__PURE__ */ u.jsx(
|
|
16960
|
-
|
|
16945
|
+
Ae.div,
|
|
16961
16946
|
{
|
|
16962
16947
|
"aria-hidden": !0,
|
|
16963
16948
|
...o,
|
|
@@ -16978,7 +16963,7 @@ var Ph = v.forwardRef((e, t) => {
|
|
|
16978
16963
|
}), ST = "SelectSeparator", Oh = v.forwardRef(
|
|
16979
16964
|
(e, t) => {
|
|
16980
16965
|
const { __scopeSelect: n, ...r } = e;
|
|
16981
|
-
return /* @__PURE__ */ u.jsx(
|
|
16966
|
+
return /* @__PURE__ */ u.jsx(Ae.div, { "aria-hidden": !0, ...r, ref: t });
|
|
16982
16967
|
}
|
|
16983
16968
|
);
|
|
16984
16969
|
Oh.displayName = ST;
|
|
@@ -17004,7 +16989,7 @@ var TT = "SelectBubbleInput", Mh = v.forwardRef(
|
|
|
17004
16989
|
d.call(a, t), a.dispatchEvent(f);
|
|
17005
16990
|
}
|
|
17006
16991
|
}, [i, t]), /* @__PURE__ */ u.jsx(
|
|
17007
|
-
|
|
16992
|
+
Ae.select,
|
|
17008
16993
|
{
|
|
17009
16994
|
...n,
|
|
17010
16995
|
style: { ...uh, ...n.style },
|
|
@@ -17152,7 +17137,7 @@ OT.displayName = Vh.displayName;
|
|
|
17152
17137
|
var MT = "Separator", Yc = "horizontal", DT = ["horizontal", "vertical"], Gh = v.forwardRef((e, t) => {
|
|
17153
17138
|
const { decorative: n, orientation: r = Yc, ...o } = e, s = LT(r) ? r : Yc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
|
|
17154
17139
|
return /* @__PURE__ */ u.jsx(
|
|
17155
|
-
|
|
17140
|
+
Ae.div,
|
|
17156
17141
|
{
|
|
17157
17142
|
"data-orientation": s,
|
|
17158
17143
|
...a,
|
|
@@ -17316,7 +17301,7 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17316
17301
|
}
|
|
17317
17302
|
};
|
|
17318
17303
|
return /* @__PURE__ */ u.jsxs(FT, { open: r, onOpenChange: o, children: [
|
|
17319
|
-
/* @__PURE__ */ u.jsx($T, { asChild: !0, children: /* @__PURE__ */ u.jsxs(
|
|
17304
|
+
/* @__PURE__ */ u.jsx($T, { asChild: !0, children: /* @__PURE__ */ u.jsxs(ot, { variant: "outline", size: "sm", className: n, children: [
|
|
17320
17305
|
/* @__PURE__ */ u.jsx(km, { className: "h-4 w-4 mr-2" }),
|
|
17321
17306
|
"Settings",
|
|
17322
17307
|
c && /* @__PURE__ */ u.jsx(Zf, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
|
|
@@ -17348,7 +17333,7 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17348
17333
|
placeholder: "http://localhost:8000/api"
|
|
17349
17334
|
}
|
|
17350
17335
|
),
|
|
17351
|
-
/* @__PURE__ */ u.jsx(
|
|
17336
|
+
/* @__PURE__ */ u.jsx(ot, { variant: "outline", onClick: x, children: "Test" })
|
|
17352
17337
|
] })
|
|
17353
17338
|
] }),
|
|
17354
17339
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -17382,7 +17367,7 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17382
17367
|
}
|
|
17383
17368
|
),
|
|
17384
17369
|
/* @__PURE__ */ u.jsx(
|
|
17385
|
-
|
|
17370
|
+
ot,
|
|
17386
17371
|
{
|
|
17387
17372
|
variant: "outline",
|
|
17388
17373
|
size: "icon",
|
|
@@ -17550,13 +17535,13 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
17550
17535
|
] })
|
|
17551
17536
|
] }),
|
|
17552
17537
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
|
|
17553
|
-
/* @__PURE__ */ u.jsxs(
|
|
17538
|
+
/* @__PURE__ */ u.jsxs(ot, { variant: "outline", onClick: h, children: [
|
|
17554
17539
|
/* @__PURE__ */ u.jsx(_i, { className: "h-4 w-4 mr-2" }),
|
|
17555
17540
|
"Reset"
|
|
17556
17541
|
] }),
|
|
17557
17542
|
/* @__PURE__ */ u.jsxs("div", { className: "flex gap-2", children: [
|
|
17558
|
-
/* @__PURE__ */ u.jsx(
|
|
17559
|
-
/* @__PURE__ */ u.jsxs(
|
|
17543
|
+
/* @__PURE__ */ u.jsx(ot, { variant: "outline", onClick: m, children: "Cancel" }),
|
|
17544
|
+
/* @__PURE__ */ u.jsxs(ot, { onClick: p, disabled: !c, children: [
|
|
17560
17545
|
/* @__PURE__ */ u.jsx(jm, { className: "h-4 w-4 mr-2" }),
|
|
17561
17546
|
"Save Changes"
|
|
17562
17547
|
] })
|