teodor-new-chat-ui 3.0.90 → 3.0.91
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 +881 -879
- package/dist/index.umd.js +17 -17
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as f from "react";
|
|
2
|
-
import V, { useState as
|
|
2
|
+
import V, { useState as de, useRef as Ye, useCallback as Ke, useEffect as He, useReducer as Dp, useMemo as un, createContext as bc, useContext as wc, createElement as lo, useLayoutEffect as Lp } from "react";
|
|
3
3
|
import { Square as Fp, Send as Bp, X as Kn, ExternalLink as $p, Download as Hp, Image as yc, FileText as Wa, Loader as zp, ChevronUp as vr, ChevronDown as Gn, Copy as Va, Edit as Ga, RotateCcw as ri, Bot as Ka, Wrench as Up, User as Wp, ChevronRight as Vp, Check as Bi, Circle as Gp, Edit3 as Sc, Paperclip as Ya, Loader2 as Kp, Plus as Yp, FileSpreadsheet as qp, MessageSquarePlus as Xp, MessageSquare as Jp, Calendar as Zp, Trash2 as Qp, PanelLeft as em, Settings as tm, Server as nm, EyeOff as rm, Eye as om, Layout as sm, MessageCircle as im, Save as am } from "lucide-react";
|
|
4
4
|
import { Slot as rr, createSlot as Zn, createSlottable as lm } from "@radix-ui/react-slot";
|
|
5
5
|
import { cva as Fr } from "class-variance-authority";
|
|
@@ -54,14 +54,14 @@ function fm() {
|
|
|
54
54
|
var b = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
55
55
|
function w(E) {
|
|
56
56
|
{
|
|
57
|
-
for (var z = arguments.length, ne = new Array(z > 1 ? z - 1 : 0),
|
|
58
|
-
ne[
|
|
57
|
+
for (var z = arguments.length, ne = new Array(z > 1 ? z - 1 : 0), xe = 1; xe < z; xe++)
|
|
58
|
+
ne[xe - 1] = arguments[xe];
|
|
59
59
|
y("error", E, ne);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function y(E, z, ne) {
|
|
63
63
|
{
|
|
64
|
-
var
|
|
64
|
+
var xe = b.ReactDebugCurrentFrame, Pe = xe.getStackAddendum();
|
|
65
65
|
Pe !== "" && (z += "%s", ne = ne.concat([Pe]));
|
|
66
66
|
var Be = ne.map(function(Ne) {
|
|
67
67
|
return String(Ne);
|
|
@@ -79,9 +79,9 @@ function fm() {
|
|
|
79
79
|
E.$$typeof === I || E.getModuleId !== void 0));
|
|
80
80
|
}
|
|
81
81
|
function D(E, z, ne) {
|
|
82
|
-
var
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
82
|
+
var xe = E.displayName;
|
|
83
|
+
if (xe)
|
|
84
|
+
return xe;
|
|
85
85
|
var Pe = z.displayName || z.name || "";
|
|
86
86
|
return Pe !== "" ? ne + "(" + Pe + ")" : ne;
|
|
87
87
|
}
|
|
@@ -120,8 +120,8 @@ function fm() {
|
|
|
120
120
|
case c:
|
|
121
121
|
return D(E, E.render, "ForwardRef");
|
|
122
122
|
case h:
|
|
123
|
-
var
|
|
124
|
-
return
|
|
123
|
+
var xe = E.displayName || null;
|
|
124
|
+
return xe !== null ? xe : U(E.type) || "Memo";
|
|
125
125
|
case m: {
|
|
126
126
|
var Pe = E, Be = Pe._payload, Ne = Pe._init;
|
|
127
127
|
try {
|
|
@@ -133,18 +133,18 @@ function fm() {
|
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
|
-
var A = Object.assign, $ = 0,
|
|
137
|
-
function
|
|
136
|
+
var A = Object.assign, $ = 0, L, Z, _, O, G, Q, J;
|
|
137
|
+
function F() {
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
F.__reactDisabledLog = !0;
|
|
140
140
|
function K() {
|
|
141
141
|
{
|
|
142
142
|
if ($ === 0) {
|
|
143
|
-
|
|
143
|
+
L = console.log, Z = console.info, _ = console.warn, O = console.error, G = console.group, Q = console.groupCollapsed, J = console.groupEnd;
|
|
144
144
|
var E = {
|
|
145
145
|
configurable: !0,
|
|
146
146
|
enumerable: !0,
|
|
147
|
-
value:
|
|
147
|
+
value: F,
|
|
148
148
|
writable: !0
|
|
149
149
|
};
|
|
150
150
|
Object.defineProperties(console, {
|
|
@@ -160,7 +160,7 @@ function fm() {
|
|
|
160
160
|
$++;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function ye() {
|
|
164
164
|
{
|
|
165
165
|
if ($--, $ === 0) {
|
|
166
166
|
var E = {
|
|
@@ -170,64 +170,64 @@ function fm() {
|
|
|
170
170
|
};
|
|
171
171
|
Object.defineProperties(console, {
|
|
172
172
|
log: A({}, E, {
|
|
173
|
-
value:
|
|
173
|
+
value: L
|
|
174
174
|
}),
|
|
175
175
|
info: A({}, E, {
|
|
176
|
-
value:
|
|
176
|
+
value: Z
|
|
177
177
|
}),
|
|
178
178
|
warn: A({}, E, {
|
|
179
179
|
value: _
|
|
180
180
|
}),
|
|
181
181
|
error: A({}, E, {
|
|
182
|
-
value:
|
|
182
|
+
value: O
|
|
183
183
|
}),
|
|
184
184
|
group: A({}, E, {
|
|
185
|
-
value:
|
|
185
|
+
value: G
|
|
186
186
|
}),
|
|
187
187
|
groupCollapsed: A({}, E, {
|
|
188
|
-
value:
|
|
188
|
+
value: Q
|
|
189
189
|
}),
|
|
190
190
|
groupEnd: A({}, E, {
|
|
191
|
-
value:
|
|
191
|
+
value: J
|
|
192
192
|
})
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
$ < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
var
|
|
199
|
-
function
|
|
198
|
+
var ue = b.ReactCurrentDispatcher, Y;
|
|
199
|
+
function P(E, z, ne) {
|
|
200
200
|
{
|
|
201
|
-
if (
|
|
201
|
+
if (Y === void 0)
|
|
202
202
|
try {
|
|
203
203
|
throw Error();
|
|
204
204
|
} catch (Pe) {
|
|
205
|
-
var
|
|
206
|
-
|
|
205
|
+
var xe = Pe.stack.trim().match(/\n( *(at )?)/);
|
|
206
|
+
Y = xe && xe[1] || "";
|
|
207
207
|
}
|
|
208
208
|
return `
|
|
209
|
-
` +
|
|
209
|
+
` + Y + E;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
var
|
|
212
|
+
var q = !1, ee;
|
|
213
213
|
{
|
|
214
214
|
var ce = typeof WeakMap == "function" ? WeakMap : Map;
|
|
215
215
|
ee = new ce();
|
|
216
216
|
}
|
|
217
217
|
function oe(E, z) {
|
|
218
|
-
if (!E ||
|
|
218
|
+
if (!E || q)
|
|
219
219
|
return "";
|
|
220
220
|
{
|
|
221
221
|
var ne = ee.get(E);
|
|
222
222
|
if (ne !== void 0)
|
|
223
223
|
return ne;
|
|
224
224
|
}
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var xe;
|
|
226
|
+
q = !0;
|
|
227
227
|
var Pe = Error.prepareStackTrace;
|
|
228
228
|
Error.prepareStackTrace = void 0;
|
|
229
229
|
var Be;
|
|
230
|
-
Be =
|
|
230
|
+
Be = ue.current, ue.current = null, K();
|
|
231
231
|
try {
|
|
232
232
|
if (z) {
|
|
233
233
|
var Ne = function() {
|
|
@@ -241,14 +241,14 @@ function fm() {
|
|
|
241
241
|
try {
|
|
242
242
|
Reflect.construct(Ne, []);
|
|
243
243
|
} catch (nn) {
|
|
244
|
-
|
|
244
|
+
xe = nn;
|
|
245
245
|
}
|
|
246
246
|
Reflect.construct(E, [], Ne);
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
Ne.call();
|
|
250
250
|
} catch (nn) {
|
|
251
|
-
|
|
251
|
+
xe = nn;
|
|
252
252
|
}
|
|
253
253
|
E.call(Ne.prototype);
|
|
254
254
|
}
|
|
@@ -256,14 +256,14 @@ function fm() {
|
|
|
256
256
|
try {
|
|
257
257
|
throw Error();
|
|
258
258
|
} catch (nn) {
|
|
259
|
-
|
|
259
|
+
xe = nn;
|
|
260
260
|
}
|
|
261
261
|
E();
|
|
262
262
|
}
|
|
263
263
|
} catch (nn) {
|
|
264
|
-
if (nn &&
|
|
264
|
+
if (nn && xe && typeof nn.stack == "string") {
|
|
265
265
|
for (var Re = nn.stack.split(`
|
|
266
|
-
`), ft =
|
|
266
|
+
`), ft = xe.stack.split(`
|
|
267
267
|
`), qe = Re.length - 1, tt = ft.length - 1; qe >= 1 && tt >= 0 && Re[qe] !== ft[tt]; )
|
|
268
268
|
tt--;
|
|
269
269
|
for (; qe >= 1 && tt >= 0; qe--, tt--)
|
|
@@ -280,9 +280,9 @@ function fm() {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
} finally {
|
|
283
|
-
|
|
283
|
+
q = !1, ue.current = Be, ye(), Error.prepareStackTrace = Pe;
|
|
284
284
|
}
|
|
285
|
-
var Hn = E ? E.displayName || E.name : "", Ua = Hn ?
|
|
285
|
+
var Hn = E ? E.displayName || E.name : "", Ua = Hn ? P(Hn) : "";
|
|
286
286
|
return typeof E == "function" && ee.set(E, Ua), Ua;
|
|
287
287
|
}
|
|
288
288
|
function Ie(E, z, ne) {
|
|
@@ -298,12 +298,12 @@ function fm() {
|
|
|
298
298
|
if (typeof E == "function")
|
|
299
299
|
return oe(E, Me(E));
|
|
300
300
|
if (typeof E == "string")
|
|
301
|
-
return
|
|
301
|
+
return P(E);
|
|
302
302
|
switch (E) {
|
|
303
303
|
case u:
|
|
304
|
-
return
|
|
304
|
+
return P("Suspense");
|
|
305
305
|
case d:
|
|
306
|
-
return
|
|
306
|
+
return P("SuspenseList");
|
|
307
307
|
}
|
|
308
308
|
if (typeof E == "object")
|
|
309
309
|
switch (E.$$typeof) {
|
|
@@ -312,7 +312,7 @@ function fm() {
|
|
|
312
312
|
case h:
|
|
313
313
|
return De(E.type, z, ne);
|
|
314
314
|
case m: {
|
|
315
|
-
var
|
|
315
|
+
var xe = E, Pe = xe._payload, Be = xe._init;
|
|
316
316
|
try {
|
|
317
317
|
return De(Be(Pe), z, ne);
|
|
318
318
|
} catch {
|
|
@@ -321,36 +321,36 @@ function fm() {
|
|
|
321
321
|
}
|
|
322
322
|
return "";
|
|
323
323
|
}
|
|
324
|
-
var
|
|
324
|
+
var fe = Object.prototype.hasOwnProperty, Oe = {}, pe = b.ReactDebugCurrentFrame;
|
|
325
325
|
function Se(E) {
|
|
326
326
|
if (E) {
|
|
327
327
|
var z = E._owner, ne = De(E.type, E._source, z ? z.type : null);
|
|
328
|
-
|
|
328
|
+
pe.setExtraStackFrame(ne);
|
|
329
329
|
} else
|
|
330
|
-
|
|
330
|
+
pe.setExtraStackFrame(null);
|
|
331
331
|
}
|
|
332
|
-
function mt(E, z, ne,
|
|
332
|
+
function mt(E, z, ne, xe, Pe) {
|
|
333
333
|
{
|
|
334
|
-
var Be = Function.call.bind(
|
|
334
|
+
var Be = Function.call.bind(fe);
|
|
335
335
|
for (var Ne in E)
|
|
336
336
|
if (Be(E, Ne)) {
|
|
337
337
|
var Re = void 0;
|
|
338
338
|
try {
|
|
339
339
|
if (typeof E[Ne] != "function") {
|
|
340
|
-
var ft = Error((
|
|
340
|
+
var ft = Error((xe || "React class") + ": " + ne + " type `" + Ne + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof E[Ne] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
341
341
|
throw ft.name = "Invariant Violation", ft;
|
|
342
342
|
}
|
|
343
|
-
Re = E[Ne](z, Ne,
|
|
343
|
+
Re = E[Ne](z, Ne, xe, ne, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
344
344
|
} catch (qe) {
|
|
345
345
|
Re = qe;
|
|
346
346
|
}
|
|
347
|
-
Re && !(Re instanceof Error) && (Se(Pe), 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).",
|
|
347
|
+
Re && !(Re instanceof Error) && (Se(Pe), 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).", xe || "React class", ne, Ne, typeof Re), Se(null)), Re instanceof Error && !(Re.message in Oe) && (Oe[Re.message] = !0, Se(Pe), w("Failed %s type: %s", ne, Re.message), Se(null));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
var
|
|
351
|
+
var X = Array.isArray;
|
|
352
352
|
function ie(E) {
|
|
353
|
-
return
|
|
353
|
+
return X(E);
|
|
354
354
|
}
|
|
355
355
|
function Le(E) {
|
|
356
356
|
{
|
|
@@ -379,7 +379,7 @@ function fm() {
|
|
|
379
379
|
__source: !0
|
|
380
380
|
}, Qe, it;
|
|
381
381
|
function et(E) {
|
|
382
|
-
if (
|
|
382
|
+
if (fe.call(E, "ref")) {
|
|
383
383
|
var z = Object.getOwnPropertyDescriptor(E, "ref").get;
|
|
384
384
|
if (z && z.isReactWarning)
|
|
385
385
|
return !1;
|
|
@@ -387,7 +387,7 @@ function fm() {
|
|
|
387
387
|
return E.ref !== void 0;
|
|
388
388
|
}
|
|
389
389
|
function dt(E) {
|
|
390
|
-
if (
|
|
390
|
+
if (fe.call(E, "key")) {
|
|
391
391
|
var z = Object.getOwnPropertyDescriptor(E, "key").get;
|
|
392
392
|
if (z && z.isReactWarning)
|
|
393
393
|
return !1;
|
|
@@ -419,7 +419,7 @@ function fm() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var Ge = function(E, z, ne,
|
|
422
|
+
var Ge = function(E, z, ne, xe, Pe, Be, Ne) {
|
|
423
423
|
var Re = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: t,
|
|
@@ -440,7 +440,7 @@ function fm() {
|
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
|
-
value:
|
|
443
|
+
value: xe
|
|
444
444
|
}), Object.defineProperty(Re, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
@@ -448,12 +448,12 @@ function fm() {
|
|
|
448
448
|
value: Pe
|
|
449
449
|
}), Object.freeze && (Object.freeze(Re.props), Object.freeze(Re)), Re;
|
|
450
450
|
};
|
|
451
|
-
function se(E, z, ne,
|
|
451
|
+
function se(E, z, ne, xe, Pe) {
|
|
452
452
|
{
|
|
453
453
|
var Be, Ne = {}, Re = null, ft = null;
|
|
454
454
|
ne !== void 0 && (ut(ne), Re = "" + ne), dt(z) && (ut(z.key), Re = "" + z.key), et(z) && (ft = z.ref, an(z, Pe));
|
|
455
455
|
for (Be in z)
|
|
456
|
-
|
|
456
|
+
fe.call(z, Be) && !Ut.hasOwnProperty(Be) && (Ne[Be] = z[Be]);
|
|
457
457
|
if (E && E.defaultProps) {
|
|
458
458
|
var qe = E.defaultProps;
|
|
459
459
|
for (Be in qe)
|
|
@@ -463,7 +463,7 @@ function fm() {
|
|
|
463
463
|
var tt = typeof E == "function" ? E.displayName || E.name || "Unknown" : E;
|
|
464
464
|
Re && fr(Ne, tt), ft && Fn(Ne, tt);
|
|
465
465
|
}
|
|
466
|
-
return Ge(E, Re, ft, Pe,
|
|
466
|
+
return Ge(E, Re, ft, Pe, xe, gt.current, Ne);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var ae = b.ReactCurrentOwner, je = b.ReactDebugCurrentFrame;
|
|
@@ -516,8 +516,8 @@ Check the top-level render call using <` + ne + ">.");
|
|
|
516
516
|
if (hr[ne])
|
|
517
517
|
return;
|
|
518
518
|
hr[ne] = !0;
|
|
519
|
-
var
|
|
520
|
-
E && E._owner && E._owner !== ae.current && (
|
|
519
|
+
var xe = "";
|
|
520
|
+
E && E._owner && E._owner !== ae.current && (xe = " It was passed a child from " + U(E._owner.type) + "."), Fe(E), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, xe), Fe(null);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
function Ha(E, z) {
|
|
@@ -526,8 +526,8 @@ Check the top-level render call using <` + ne + ">.");
|
|
|
526
526
|
return;
|
|
527
527
|
if (ie(E))
|
|
528
528
|
for (var ne = 0; ne < E.length; ne++) {
|
|
529
|
-
var
|
|
530
|
-
yn(
|
|
529
|
+
var xe = E[ne];
|
|
530
|
+
yn(xe) && $n(xe, z);
|
|
531
531
|
}
|
|
532
532
|
else if (yn(E))
|
|
533
533
|
E._store && (E._store.validated = !0);
|
|
@@ -554,8 +554,8 @@ Check the top-level render call using <` + ne + ">.");
|
|
|
554
554
|
else
|
|
555
555
|
return;
|
|
556
556
|
if (ne) {
|
|
557
|
-
var
|
|
558
|
-
mt(ne, E.props, "prop",
|
|
557
|
+
var xe = U(z);
|
|
558
|
+
mt(ne, E.props, "prop", xe, E);
|
|
559
559
|
} else if (z.PropTypes !== void 0 && !en) {
|
|
560
560
|
en = !0;
|
|
561
561
|
var Pe = U(z);
|
|
@@ -567,16 +567,16 @@ Check the top-level render call using <` + ne + ">.");
|
|
|
567
567
|
function kp(E) {
|
|
568
568
|
{
|
|
569
569
|
for (var z = Object.keys(E.props), ne = 0; ne < z.length; ne++) {
|
|
570
|
-
var
|
|
571
|
-
if (
|
|
572
|
-
Fe(E), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
570
|
+
var xe = z[ne];
|
|
571
|
+
if (xe !== "children" && xe !== "key") {
|
|
572
|
+
Fe(E), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", xe), Fe(null);
|
|
573
573
|
break;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
E.ref !== null && (Fe(E), w("Invalid attribute `ref` supplied to `React.Fragment`."), Fe(null));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
function za(E, z, ne,
|
|
579
|
+
function za(E, z, ne, xe, Pe, Be) {
|
|
580
580
|
{
|
|
581
581
|
var Ne = k(E);
|
|
582
582
|
if (!Ne) {
|
|
@@ -593,7 +593,7 @@ Check the top-level render call using <` + ne + ">.");
|
|
|
593
593
|
if (Ne) {
|
|
594
594
|
var Rt = z.children;
|
|
595
595
|
if (Rt !== void 0)
|
|
596
|
-
if (
|
|
596
|
+
if (xe)
|
|
597
597
|
if (ie(Rt)) {
|
|
598
598
|
for (var Hn = 0; Hn < Rt.length; Hn++)
|
|
599
599
|
Ha(Rt[Hn], E);
|
|
@@ -856,10 +856,10 @@ const Km = (e) => {
|
|
|
856
856
|
asap: Xm,
|
|
857
857
|
isIterable: Jm
|
|
858
858
|
};
|
|
859
|
-
function
|
|
859
|
+
function be(e, t, n, r, o) {
|
|
860
860
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
861
861
|
}
|
|
862
|
-
j.inherits(
|
|
862
|
+
j.inherits(be, Error, {
|
|
863
863
|
toJSON: function() {
|
|
864
864
|
return {
|
|
865
865
|
// Standard
|
|
@@ -880,7 +880,7 @@ j.inherits(we, Error, {
|
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
882
|
});
|
|
883
|
-
const Pc =
|
|
883
|
+
const Pc = be.prototype, _c = {};
|
|
884
884
|
[
|
|
885
885
|
"ERR_BAD_OPTION_VALUE",
|
|
886
886
|
"ERR_BAD_OPTION",
|
|
@@ -898,15 +898,15 @@ const Pc = we.prototype, _c = {};
|
|
|
898
898
|
].forEach((e) => {
|
|
899
899
|
_c[e] = { value: e };
|
|
900
900
|
});
|
|
901
|
-
Object.defineProperties(
|
|
901
|
+
Object.defineProperties(be, _c);
|
|
902
902
|
Object.defineProperty(Pc, "isAxiosError", { value: !0 });
|
|
903
|
-
|
|
903
|
+
be.from = (e, t, n, r, o, s) => {
|
|
904
904
|
const i = Object.create(Pc);
|
|
905
905
|
j.toFlatObject(e, i, function(d) {
|
|
906
906
|
return d !== Error.prototype;
|
|
907
907
|
}, (u) => u !== "isAxiosError");
|
|
908
908
|
const a = e && e.message ? e.message : "Error", c = t == null && e ? e.code : t;
|
|
909
|
-
return
|
|
909
|
+
return be.call(i, a, c, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
|
|
910
910
|
};
|
|
911
911
|
const Zm = null;
|
|
912
912
|
function ii(e) {
|
|
@@ -946,7 +946,7 @@ function Xo(e, t, n) {
|
|
|
946
946
|
if (j.isBoolean(x))
|
|
947
947
|
return x.toString();
|
|
948
948
|
if (!c && j.isBlob(x))
|
|
949
|
-
throw new
|
|
949
|
+
throw new be("Blob is not supported. Use a Buffer instead.");
|
|
950
950
|
return j.isArrayBuffer(x) || j.isTypedArray(x) ? c && typeof Blob == "function" ? new Blob([x]) : Buffer.from(x) : x;
|
|
951
951
|
}
|
|
952
952
|
function d(x, g, p) {
|
|
@@ -1197,7 +1197,7 @@ const zr = {
|
|
|
1197
1197
|
return JSON.parse(t, this.parseReviver);
|
|
1198
1198
|
} catch (a) {
|
|
1199
1199
|
if (i)
|
|
1200
|
-
throw a.name === "SyntaxError" ?
|
|
1200
|
+
throw a.name === "SyntaxError" ? be.from(a, be.ERR_BAD_RESPONSE, this, null, this.response) : a;
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
1203
|
return t;
|
|
@@ -1440,16 +1440,16 @@ function Bc(e) {
|
|
|
1440
1440
|
return !!(e && e.__CANCEL__);
|
|
1441
1441
|
}
|
|
1442
1442
|
function sr(e, t, n) {
|
|
1443
|
-
|
|
1443
|
+
be.call(this, e ?? "canceled", be.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1444
1444
|
}
|
|
1445
|
-
j.inherits(sr,
|
|
1445
|
+
j.inherits(sr, be, {
|
|
1446
1446
|
__CANCEL__: !0
|
|
1447
1447
|
});
|
|
1448
1448
|
function $c(e, t, n) {
|
|
1449
1449
|
const r = n.config.validateStatus;
|
|
1450
|
-
!n.status || !r || r(n.status) ? e(n) : t(new
|
|
1450
|
+
!n.status || !r || r(n.status) ? e(n) : t(new be(
|
|
1451
1451
|
"Request failed with status code " + n.status,
|
|
1452
|
-
[
|
|
1452
|
+
[be.ERR_BAD_REQUEST, be.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
1453
1453
|
n.config,
|
|
1454
1454
|
n.request,
|
|
1455
1455
|
n
|
|
@@ -1672,16 +1672,16 @@ const zc = (e) => {
|
|
|
1672
1672
|
"onloadend" in p ? p.onloadend = b : p.onreadystatechange = function() {
|
|
1673
1673
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(b);
|
|
1674
1674
|
}, p.onabort = function() {
|
|
1675
|
-
p && (r(new
|
|
1675
|
+
p && (r(new be("Request aborted", be.ECONNABORTED, e, p)), p = null);
|
|
1676
1676
|
}, p.onerror = function(R) {
|
|
1677
|
-
const S = R && R.message ? R.message : "Network Error", T = new
|
|
1677
|
+
const S = R && R.message ? R.message : "Network Error", T = new be(S, be.ERR_NETWORK, e, p);
|
|
1678
1678
|
T.event = R || null, r(T), p = null;
|
|
1679
1679
|
}, p.ontimeout = function() {
|
|
1680
1680
|
let R = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1681
1681
|
const S = o.transitional || Lc;
|
|
1682
|
-
o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(new
|
|
1682
|
+
o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(new be(
|
|
1683
1683
|
R,
|
|
1684
|
-
S.clarifyTimeoutError ?
|
|
1684
|
+
S.clarifyTimeoutError ? be.ETIMEDOUT : be.ECONNABORTED,
|
|
1685
1685
|
e,
|
|
1686
1686
|
p
|
|
1687
1687
|
)), p = null;
|
|
@@ -1692,7 +1692,7 @@ const zc = (e) => {
|
|
|
1692
1692
|
}, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
|
|
1693
1693
|
const w = wg(o.url);
|
|
1694
1694
|
if (w && at.protocols.indexOf(w) === -1) {
|
|
1695
|
-
r(new
|
|
1695
|
+
r(new be("Unsupported protocol " + w + ":", be.ERR_BAD_REQUEST, e));
|
|
1696
1696
|
return;
|
|
1697
1697
|
}
|
|
1698
1698
|
p.send(s || null);
|
|
@@ -1705,11 +1705,11 @@ const zc = (e) => {
|
|
|
1705
1705
|
if (!o) {
|
|
1706
1706
|
o = !0, a();
|
|
1707
1707
|
const d = u instanceof Error ? u : this.reason;
|
|
1708
|
-
r.abort(d instanceof
|
|
1708
|
+
r.abort(d instanceof be ? d : new sr(d instanceof Error ? d.message : d));
|
|
1709
1709
|
}
|
|
1710
1710
|
};
|
|
1711
1711
|
let i = t && setTimeout(() => {
|
|
1712
|
-
i = null, s(new
|
|
1712
|
+
i = null, s(new be(`timeout ${t} of ms exceeded`, be.ETIMEDOUT));
|
|
1713
1713
|
}, t);
|
|
1714
1714
|
const a = () => {
|
|
1715
1715
|
e && (i && clearTimeout(i), i = null, e.forEach((u) => {
|
|
@@ -1814,7 +1814,7 @@ const zc = (e) => {
|
|
|
1814
1814
|
let b = g && g[x];
|
|
1815
1815
|
if (b)
|
|
1816
1816
|
return b.call(g);
|
|
1817
|
-
throw new
|
|
1817
|
+
throw new be(`Response type '${x}' is not supported`, be.ERR_NOT_SUPPORT, p);
|
|
1818
1818
|
});
|
|
1819
1819
|
});
|
|
1820
1820
|
const m = async (x) => {
|
|
@@ -1858,53 +1858,53 @@ const zc = (e) => {
|
|
|
1858
1858
|
let $;
|
|
1859
1859
|
try {
|
|
1860
1860
|
if (T && u && p !== "get" && p !== "head" && ($ = await v(N, b)) !== 0) {
|
|
1861
|
-
let
|
|
1861
|
+
let Q = new n(g, {
|
|
1862
1862
|
method: "POST",
|
|
1863
1863
|
body: b,
|
|
1864
1864
|
duplex: "half"
|
|
1865
|
-
}),
|
|
1866
|
-
if (j.isFormData(b) && (
|
|
1867
|
-
const [
|
|
1865
|
+
}), J;
|
|
1866
|
+
if (j.isFormData(b) && (J = Q.headers.get("content-type")) && N.setContentType(J), Q.body) {
|
|
1867
|
+
const [F, K] = nl(
|
|
1868
1868
|
$,
|
|
1869
1869
|
jo(rl(T))
|
|
1870
1870
|
);
|
|
1871
|
-
b = sl(
|
|
1871
|
+
b = sl(Q.body, il, F, K);
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
j.isString(I) || (I = I ? "include" : "omit");
|
|
1875
|
-
const
|
|
1875
|
+
const L = s && "credentials" in n.prototype, Z = {
|
|
1876
1876
|
...k,
|
|
1877
1877
|
signal: H,
|
|
1878
1878
|
method: p.toUpperCase(),
|
|
1879
1879
|
headers: N.normalize().toJSON(),
|
|
1880
1880
|
body: b,
|
|
1881
1881
|
duplex: "half",
|
|
1882
|
-
credentials:
|
|
1882
|
+
credentials: L ? I : void 0
|
|
1883
1883
|
};
|
|
1884
|
-
U = s && new n(g,
|
|
1885
|
-
let _ = await (s ? D(U, k) : D(g,
|
|
1886
|
-
const
|
|
1887
|
-
if (d && (S ||
|
|
1888
|
-
const
|
|
1889
|
-
["status", "statusText", "headers"].forEach((
|
|
1890
|
-
|
|
1884
|
+
U = s && new n(g, Z);
|
|
1885
|
+
let _ = await (s ? D(U, k) : D(g, Z));
|
|
1886
|
+
const O = d && (C === "stream" || C === "response");
|
|
1887
|
+
if (d && (S || O && A)) {
|
|
1888
|
+
const Q = {};
|
|
1889
|
+
["status", "statusText", "headers"].forEach((ye) => {
|
|
1890
|
+
Q[ye] = _[ye];
|
|
1891
1891
|
});
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1892
|
+
const J = j.toFiniteNumber(_.headers.get("content-length")), [F, K] = S && nl(
|
|
1893
|
+
J,
|
|
1894
1894
|
jo(rl(S), !0)
|
|
1895
1895
|
) || [];
|
|
1896
1896
|
_ = new r(
|
|
1897
|
-
sl(_.body, il,
|
|
1897
|
+
sl(_.body, il, F, () => {
|
|
1898
1898
|
K && K(), A && A();
|
|
1899
1899
|
}),
|
|
1900
|
-
|
|
1900
|
+
Q
|
|
1901
1901
|
);
|
|
1902
1902
|
}
|
|
1903
1903
|
C = C || "text";
|
|
1904
|
-
let
|
|
1905
|
-
return !
|
|
1906
|
-
$c(
|
|
1907
|
-
data:
|
|
1904
|
+
let G = await h[j.findKey(h, C) || "text"](_, x);
|
|
1905
|
+
return !O && A && A(), await new Promise((Q, J) => {
|
|
1906
|
+
$c(Q, J, {
|
|
1907
|
+
data: G,
|
|
1908
1908
|
headers: vt.from(_.headers),
|
|
1909
1909
|
status: _.status,
|
|
1910
1910
|
statusText: _.statusText,
|
|
@@ -1912,13 +1912,13 @@ const zc = (e) => {
|
|
|
1912
1912
|
request: U
|
|
1913
1913
|
});
|
|
1914
1914
|
});
|
|
1915
|
-
} catch (
|
|
1916
|
-
throw A && A(),
|
|
1917
|
-
new
|
|
1915
|
+
} catch (L) {
|
|
1916
|
+
throw A && A(), L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message) ? Object.assign(
|
|
1917
|
+
new be("Network Error", be.ERR_NETWORK, x, U),
|
|
1918
1918
|
{
|
|
1919
|
-
cause:
|
|
1919
|
+
cause: L.cause || L
|
|
1920
1920
|
}
|
|
1921
|
-
) :
|
|
1921
|
+
) : be.from(L, L && L.code, x, U);
|
|
1922
1922
|
}
|
|
1923
1923
|
};
|
|
1924
1924
|
}, Mg = /* @__PURE__ */ new Map(), Uc = (e) => {
|
|
@@ -1960,7 +1960,7 @@ const ul = (e) => `- ${e}`, Dg = (e) => j.isFunction(e) || e === null || e === !
|
|
|
1960
1960
|
r = e[i];
|
|
1961
1961
|
let a;
|
|
1962
1962
|
if (o = r, !Dg(r) && (o = li[(a = String(r)).toLowerCase()], o === void 0))
|
|
1963
|
-
throw new
|
|
1963
|
+
throw new be(`Unknown adapter '${a}'`);
|
|
1964
1964
|
if (o && (j.isFunction(o) || (o = o.get(t))))
|
|
1965
1965
|
break;
|
|
1966
1966
|
s[a || "#" + i] = o;
|
|
@@ -1972,7 +1972,7 @@ const ul = (e) => `- ${e}`, Dg = (e) => j.isFunction(e) || e === null || e === !
|
|
|
1972
1972
|
let a = n ? i.length > 1 ? `since :
|
|
1973
1973
|
` + i.map(ul).join(`
|
|
1974
1974
|
`) : " " + ul(i[0]) : "as no adapter specified";
|
|
1975
|
-
throw new
|
|
1975
|
+
throw new be(
|
|
1976
1976
|
"There is no suitable adapter to dispatch the request " + a,
|
|
1977
1977
|
"ERR_NOT_SUPPORT"
|
|
1978
1978
|
);
|
|
@@ -2016,9 +2016,9 @@ Jo.transitional = function(t, n, r) {
|
|
|
2016
2016
|
}
|
|
2017
2017
|
return (s, i, a) => {
|
|
2018
2018
|
if (t === !1)
|
|
2019
|
-
throw new
|
|
2019
|
+
throw new be(
|
|
2020
2020
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
2021
|
-
|
|
2021
|
+
be.ERR_DEPRECATED
|
|
2022
2022
|
);
|
|
2023
2023
|
return n && !fl[i] && (fl[i] = !0, console.warn(
|
|
2024
2024
|
o(
|
|
@@ -2033,7 +2033,7 @@ Jo.spelling = function(t) {
|
|
|
2033
2033
|
};
|
|
2034
2034
|
function Lg(e, t, n) {
|
|
2035
2035
|
if (typeof e != "object")
|
|
2036
|
-
throw new
|
|
2036
|
+
throw new be("options must be an object", be.ERR_BAD_OPTION_VALUE);
|
|
2037
2037
|
const r = Object.keys(e);
|
|
2038
2038
|
let o = r.length;
|
|
2039
2039
|
for (; o-- > 0; ) {
|
|
@@ -2041,11 +2041,11 @@ function Lg(e, t, n) {
|
|
|
2041
2041
|
if (i) {
|
|
2042
2042
|
const a = e[s], c = a === void 0 || i(a, s, e);
|
|
2043
2043
|
if (c !== !0)
|
|
2044
|
-
throw new
|
|
2044
|
+
throw new be("option " + s + " must be " + c, be.ERR_BAD_OPTION_VALUE);
|
|
2045
2045
|
continue;
|
|
2046
2046
|
}
|
|
2047
2047
|
if (n !== !0)
|
|
2048
|
-
throw new
|
|
2048
|
+
throw new be("Unknown option " + s, be.ERR_BAD_OPTION);
|
|
2049
2049
|
}
|
|
2050
2050
|
}
|
|
2051
2051
|
const fo = {
|
|
@@ -2338,7 +2338,7 @@ Je.CancelToken = Fg;
|
|
|
2338
2338
|
Je.isCancel = Bc;
|
|
2339
2339
|
Je.VERSION = Vc;
|
|
2340
2340
|
Je.toFormData = Xo;
|
|
2341
|
-
Je.AxiosError =
|
|
2341
|
+
Je.AxiosError = be;
|
|
2342
2342
|
Je.Cancel = Je.CanceledError;
|
|
2343
2343
|
Je.all = function(t) {
|
|
2344
2344
|
return Promise.all(t);
|
|
@@ -2504,7 +2504,7 @@ class Gg {
|
|
|
2504
2504
|
}
|
|
2505
2505
|
const In = new Gg();
|
|
2506
2506
|
function Kg(e = {}) {
|
|
2507
|
-
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] =
|
|
2507
|
+
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = de(e.token ?? null), s = Ye(e.headers ?? {}), [i, a] = de(!1), [c, u] = de(null), [d, h] = de(""), [m, v] = de(null), x = Ye(null), g = Ke((y) => {
|
|
2508
2508
|
o(y);
|
|
2509
2509
|
}, []), p = Ke(() => {
|
|
2510
2510
|
var y;
|
|
@@ -2527,11 +2527,11 @@ function Kg(e = {}) {
|
|
|
2527
2527
|
})(), N = (A) => {
|
|
2528
2528
|
var $;
|
|
2529
2529
|
try {
|
|
2530
|
-
const
|
|
2531
|
-
return ($ =
|
|
2532
|
-
...
|
|
2533
|
-
data:
|
|
2534
|
-
}))),
|
|
2530
|
+
const L = JSON.parse(JSON.stringify(A));
|
|
2531
|
+
return ($ = L == null ? void 0 : L.payload) != null && $.files_info && Array.isArray(L.payload.files_info) && (L.payload.files_info = L.payload.files_info.map((Z) => ({
|
|
2532
|
+
...Z,
|
|
2533
|
+
data: Z != null && Z.data ? `<base64 ${String(Z.data).length} chars>` : Z == null ? void 0 : Z.data
|
|
2534
|
+
}))), L;
|
|
2535
2535
|
} catch {
|
|
2536
2536
|
return A;
|
|
2537
2537
|
}
|
|
@@ -2542,15 +2542,15 @@ function Kg(e = {}) {
|
|
|
2542
2542
|
if (r)
|
|
2543
2543
|
A = { Authorization: `Bearer ${r}` };
|
|
2544
2544
|
else if (typeof window < "u") {
|
|
2545
|
-
const
|
|
2546
|
-
let
|
|
2545
|
+
const Q = window.__AUTH_TOKEN__, J = ((I = window.localStorage) == null ? void 0 : I.getItem("authToken")) || null;
|
|
2546
|
+
let F = null;
|
|
2547
2547
|
try {
|
|
2548
|
-
const
|
|
2549
|
-
|
|
2548
|
+
const ye = (k = window.localStorage) == null ? void 0 : k.getItem("chat-settings");
|
|
2549
|
+
ye && (F = ((D = JSON.parse(ye)) == null ? void 0 : D.apiKey) || null);
|
|
2550
2550
|
} catch {
|
|
2551
2551
|
}
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2552
|
+
const K = Q || J || F || null;
|
|
2553
|
+
K && (A = { Authorization: `Bearer ${K}` });
|
|
2554
2554
|
}
|
|
2555
2555
|
} catch {
|
|
2556
2556
|
}
|
|
@@ -2567,49 +2567,51 @@ function Kg(e = {}) {
|
|
|
2567
2567
|
signal: T.signal
|
|
2568
2568
|
});
|
|
2569
2569
|
if (!$.ok || !$.body) {
|
|
2570
|
-
const
|
|
2571
|
-
throw C && console.debug("[use-chat] non-OK response", $.status,
|
|
2570
|
+
const G = await $.text().catch(() => "");
|
|
2571
|
+
throw C && console.debug("[use-chat] non-OK response", $.status, G == null ? void 0 : G.slice(0, 500)), new Error(`stream ${$.status}${G ? ": " + G : ""}`);
|
|
2572
2572
|
}
|
|
2573
2573
|
try {
|
|
2574
|
-
const
|
|
2574
|
+
const G = $.headers.get("X-Thread-Id") || $.headers.get("x-thread-id"), Q = $.headers.get("X-Thread-Created") || $.headers.get("x-thread-created"), J = G ?? null, F = String(Q ?? "").toLowerCase() === "true";
|
|
2575
2575
|
try {
|
|
2576
|
-
(H = S == null ? void 0 : S.onOpen) == null || H.call(S, { threadId:
|
|
2577
|
-
} catch (
|
|
2578
|
-
C && console.debug("[use-chat] onOpen handler threw:",
|
|
2576
|
+
(H = S == null ? void 0 : S.onOpen) == null || H.call(S, { threadId: J, created: F });
|
|
2577
|
+
} catch (K) {
|
|
2578
|
+
C && console.debug("[use-chat] onOpen handler threw:", K);
|
|
2579
2579
|
}
|
|
2580
|
-
} catch (
|
|
2581
|
-
C && console.debug("[use-chat] failed to read headers:",
|
|
2580
|
+
} catch (G) {
|
|
2581
|
+
C && console.debug("[use-chat] failed to read headers:", G);
|
|
2582
2582
|
}
|
|
2583
|
-
const
|
|
2584
|
-
let _ = "";
|
|
2583
|
+
const L = $.body.getReader(), Z = new TextDecoder();
|
|
2584
|
+
let _ = "", O = "";
|
|
2585
2585
|
for (; ; ) {
|
|
2586
|
-
const { value:
|
|
2587
|
-
if (
|
|
2588
|
-
_ +=
|
|
2589
|
-
let
|
|
2590
|
-
for (; (
|
|
2586
|
+
const { value: G, done: Q } = await L.read();
|
|
2587
|
+
if (Q) break;
|
|
2588
|
+
_ += Z.decode(G, { stream: !0 });
|
|
2589
|
+
let J;
|
|
2590
|
+
for (; (J = _.indexOf(`
|
|
2591
2591
|
|
|
2592
2592
|
`)) >= 0; ) {
|
|
2593
|
-
const
|
|
2594
|
-
_ = _.slice(
|
|
2595
|
-
const
|
|
2596
|
-
if (!
|
|
2597
|
-
let
|
|
2593
|
+
const F = _.slice(0, J);
|
|
2594
|
+
_ = _.slice(J + 2);
|
|
2595
|
+
const K = qg(F);
|
|
2596
|
+
if (!K) continue;
|
|
2597
|
+
let ye;
|
|
2598
2598
|
try {
|
|
2599
|
-
|
|
2599
|
+
ye = JSON.parse(K);
|
|
2600
2600
|
} catch {
|
|
2601
|
-
C && console.debug("[use-chat] skip malformed SSE data:",
|
|
2601
|
+
C && console.debug("[use-chat] skip malformed SSE data:", K == null ? void 0 : K.slice(0, 200));
|
|
2602
2602
|
continue;
|
|
2603
2603
|
}
|
|
2604
|
-
const
|
|
2605
|
-
if (C && console.debug("[use-chat] event:",
|
|
2606
|
-
|
|
2607
|
-
else if (
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2610
|
-
} else
|
|
2604
|
+
const ue = Yg(ye) ? ye.data : ye;
|
|
2605
|
+
if (C && console.debug("[use-chat] event:", ue == null ? void 0 : ue.type, ue), ue.type === "token" && e.autoAppendAssistant !== !1)
|
|
2606
|
+
O += ue.content;
|
|
2607
|
+
else if (ue.type === "message_delta") {
|
|
2608
|
+
const Y = ue.delta.filter((P) => P.type === "text").map((P) => P.text).join("");
|
|
2609
|
+
Y && e.autoAppendAssistant !== !1 && (O += Y);
|
|
2610
|
+
} else
|
|
2611
|
+
O && (h((Y) => Y + O), O = ""), R == null || R(ue), ue.type === "checkpoint" ? v(ue.checkpointId) : ue.type === "error" && u(ue.message);
|
|
2611
2612
|
}
|
|
2612
2613
|
}
|
|
2614
|
+
O && h((G) => G + O);
|
|
2613
2615
|
} catch (A) {
|
|
2614
2616
|
if ((A == null ? void 0 : A.name) === "AbortError") return;
|
|
2615
2617
|
const $ = (A == null ? void 0 : A.message) || String(A);
|
|
@@ -2710,7 +2712,7 @@ function Zg(e = []) {
|
|
|
2710
2712
|
const d = r.current;
|
|
2711
2713
|
d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
|
|
2712
2714
|
}, []), a = Ke(() => {
|
|
2713
|
-
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i,
|
|
2715
|
+
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i, 8));
|
|
2714
2716
|
}, [i]), c = Ke((d) => {
|
|
2715
2717
|
r.current.push(d), a();
|
|
2716
2718
|
}, [a]);
|
|
@@ -2948,33 +2950,33 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2948
2950
|
// any extra headers caller wants
|
|
2949
2951
|
// Ensure the path matches the chat endpoint
|
|
2950
2952
|
streamPath: "/chat/runs/stream"
|
|
2951
|
-
}), [g, p] =
|
|
2953
|
+
}), [g, p] = de(() => typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
|
|
2952
2954
|
He(() => {
|
|
2953
2955
|
x(typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
|
|
2954
|
-
const
|
|
2956
|
+
const X = u.onTokenChange((ie) => {
|
|
2955
2957
|
p(ie), x(ie);
|
|
2956
2958
|
});
|
|
2957
2959
|
return () => {
|
|
2958
|
-
|
|
2960
|
+
X();
|
|
2959
2961
|
};
|
|
2960
2962
|
}, [u, x]);
|
|
2961
|
-
const b = Ke((
|
|
2962
|
-
u.setAuthToken(
|
|
2963
|
-
}, [u]), { state: w, seed: y, prepend: R, pushUser: S, onEvent: T, reset: C } = Zg(), N = s && s > 0 ? s : 6, [I, k] =
|
|
2964
|
-
(
|
|
2965
|
-
const Le = Array.isArray(
|
|
2963
|
+
const b = Ke((X) => {
|
|
2964
|
+
u.setAuthToken(X);
|
|
2965
|
+
}, [u]), { state: w, seed: y, prepend: R, pushUser: S, onEvent: T, reset: C } = Zg(), N = s && s > 0 ? s : 6, [I, k] = de(!1), [D, H] = de(!1), [U, A] = de(null), [$, L] = de(void 0), [Z, _] = de(void 0), O = Ke(
|
|
2966
|
+
(X, ie) => {
|
|
2967
|
+
const Le = Array.isArray(X == null ? void 0 : X.messages) ? X.messages : [];
|
|
2966
2968
|
ie === "replace" ? y(Le, {
|
|
2967
|
-
checkpointId: (
|
|
2968
|
-
checkpointNs: (
|
|
2969
|
-
}) : ie === "prepend" && Le.length ? (console.log("[ChatProvider] Calling prepend with", Le.length, "messages"), R(Le)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), A((
|
|
2969
|
+
checkpointId: (X == null ? void 0 : X.checkpointId) ?? null,
|
|
2970
|
+
checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? null
|
|
2971
|
+
}) : ie === "prepend" && Le.length ? (console.log("[ChatProvider] Calling prepend with", Le.length, "messages"), R(Le)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), A((X == null ? void 0 : X.nextCursor) ?? null), k(!!(X != null && X.hasMore)), L((Ve) => (X == null ? void 0 : X.checkpointId) ?? Ve ?? void 0), _((Ve) => (X == null ? void 0 : X.checkpointNs) ?? Ve ?? void 0);
|
|
2970
2972
|
},
|
|
2971
2973
|
[y, R]
|
|
2972
|
-
), [
|
|
2973
|
-
const
|
|
2974
|
-
X
|
|
2975
|
-
}, [u]), [
|
|
2976
|
-
async (
|
|
2977
|
-
const ie = (
|
|
2974
|
+
), [G, Q] = de([]), [J, F] = de(null), K = Ke(async () => {
|
|
2975
|
+
const X = await u.listThreads();
|
|
2976
|
+
Q(X);
|
|
2977
|
+
}, [u]), [ye, ue] = de(!1), Y = Ke(
|
|
2978
|
+
async (X) => {
|
|
2979
|
+
const ie = (X == null ? void 0 : X.maxAttempts) ?? 5, Le = (X == null ? void 0 : X.baseDelayMs) ?? 500, Ve = (X == null ? void 0 : X.timeoutMs) ?? 2e3;
|
|
2978
2980
|
if (!u.baseUrl) return !1;
|
|
2979
2981
|
const Ze = u.baseUrl.replace(/\/+$/, ""), ut = [
|
|
2980
2982
|
"/health",
|
|
@@ -3005,103 +3007,103 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3005
3007
|
Ze.endsWith("/api") && et.startsWith("/api") && (dt = et.replace(/^\/api/, "") || "/");
|
|
3006
3008
|
const an = dt === "/" ? Ze + "/" : Ze + dt;
|
|
3007
3009
|
if (console.debug(`[ChatProvider] checking ${an}`), await gt(an) || et === "/" && await Ut(Ze + "/"))
|
|
3008
|
-
return
|
|
3010
|
+
return ue(!0), !0;
|
|
3009
3011
|
}
|
|
3010
3012
|
const it = Le * Math.pow(2, Qe);
|
|
3011
3013
|
await new Promise((et) => setTimeout(et, it));
|
|
3012
3014
|
}
|
|
3013
|
-
return
|
|
3015
|
+
return ue(!1), !1;
|
|
3014
3016
|
},
|
|
3015
3017
|
[u.baseUrl]
|
|
3016
3018
|
);
|
|
3017
3019
|
He(() => {
|
|
3018
|
-
let
|
|
3020
|
+
let X = !0;
|
|
3019
3021
|
if (!u.baseUrl) {
|
|
3020
3022
|
console.debug("[ChatProvider] skipping initial refreshThreads: api.baseUrl not configured");
|
|
3021
3023
|
return;
|
|
3022
3024
|
}
|
|
3023
3025
|
return (async () => {
|
|
3024
3026
|
try {
|
|
3025
|
-
const ie = await
|
|
3026
|
-
if (!
|
|
3027
|
+
const ie = await Y();
|
|
3028
|
+
if (!X) return;
|
|
3027
3029
|
ie ? K().catch(() => {
|
|
3028
3030
|
}) : console.warn("[ChatProvider] backend health-check failed — skipping initial loads");
|
|
3029
3031
|
} catch {
|
|
3030
3032
|
}
|
|
3031
3033
|
})(), () => {
|
|
3032
|
-
|
|
3034
|
+
X = !1;
|
|
3033
3035
|
};
|
|
3034
|
-
}, [K, u.baseUrl,
|
|
3035
|
-
r == null || r(
|
|
3036
|
-
}, [
|
|
3037
|
-
const
|
|
3036
|
+
}, [K, u.baseUrl, Y]), He(() => {
|
|
3037
|
+
r == null || r(J);
|
|
3038
|
+
}, [J, r]);
|
|
3039
|
+
const P = Ye(null);
|
|
3038
3040
|
He(() => {
|
|
3039
3041
|
if (o && i) {
|
|
3040
3042
|
if (!u.baseUrl) {
|
|
3041
3043
|
console.debug("[ChatProvider] skipping initial load: api.baseUrl not configured");
|
|
3042
3044
|
return;
|
|
3043
3045
|
}
|
|
3044
|
-
if (!
|
|
3046
|
+
if (!ye) {
|
|
3045
3047
|
console.debug("[ChatProvider] deferring initial load until backend health-check passes");
|
|
3046
3048
|
return;
|
|
3047
3049
|
}
|
|
3048
|
-
|
|
3050
|
+
P.current !== o && (P.current = o, ee(o).catch(() => {
|
|
3049
3051
|
}));
|
|
3050
3052
|
}
|
|
3051
|
-
}, [o, i, u.baseUrl,
|
|
3052
|
-
const
|
|
3053
|
-
async (
|
|
3053
|
+
}, [o, i, u.baseUrl, ye]);
|
|
3054
|
+
const q = Ye(null), ee = Ke(
|
|
3055
|
+
async (X, ie, Le) => {
|
|
3054
3056
|
if (!u.baseUrl) {
|
|
3055
3057
|
console.debug("[ChatProvider] skipping loadThread: api.baseUrl not configured");
|
|
3056
3058
|
return;
|
|
3057
3059
|
}
|
|
3058
|
-
if (
|
|
3059
|
-
|
|
3060
|
+
if (q.current !== X) {
|
|
3061
|
+
q.current = X;
|
|
3060
3062
|
try {
|
|
3061
|
-
k(!1), A(null),
|
|
3063
|
+
k(!1), A(null), L(void 0), _(void 0);
|
|
3062
3064
|
const Ve = await u.getMessages({
|
|
3063
|
-
threadId:
|
|
3065
|
+
threadId: X,
|
|
3064
3066
|
checkpointId: ie,
|
|
3065
3067
|
checkpointNs: Le,
|
|
3066
3068
|
limit: N
|
|
3067
3069
|
});
|
|
3068
|
-
|
|
3070
|
+
F(X), O(Ve, "replace");
|
|
3069
3071
|
} finally {
|
|
3070
|
-
|
|
3072
|
+
q.current = null;
|
|
3071
3073
|
}
|
|
3072
3074
|
}
|
|
3073
3075
|
},
|
|
3074
|
-
[u,
|
|
3075
|
-
), ce = Ke(async (
|
|
3076
|
-
const ie = await u.listCheckpoints(
|
|
3077
|
-
return rx(ie,
|
|
3078
|
-
}, [u]), oe = Ke(async (
|
|
3079
|
-
if (!
|
|
3080
|
-
k(!1), A(null),
|
|
3076
|
+
[u, O]
|
|
3077
|
+
), ce = Ke(async (X) => {
|
|
3078
|
+
const ie = await u.listCheckpoints(X);
|
|
3079
|
+
return rx(ie, X);
|
|
3080
|
+
}, [u]), oe = Ke(async (X, ie) => {
|
|
3081
|
+
if (!J) throw new Error("No active thread");
|
|
3082
|
+
k(!1), A(null), L(void 0), _(void 0);
|
|
3081
3083
|
const Le = await u.getMessages({
|
|
3082
|
-
threadId:
|
|
3083
|
-
checkpointId:
|
|
3084
|
+
threadId: J,
|
|
3085
|
+
checkpointId: X,
|
|
3084
3086
|
checkpointNs: ie ?? void 0,
|
|
3085
3087
|
limit: N
|
|
3086
3088
|
});
|
|
3087
|
-
|
|
3088
|
-
}, [u,
|
|
3089
|
-
if (!
|
|
3090
|
-
await ee(
|
|
3091
|
-
}, [
|
|
3089
|
+
O(Le, "replace");
|
|
3090
|
+
}, [u, J, O, N]), Ie = Ke(async () => {
|
|
3091
|
+
if (!J) throw new Error("No active thread");
|
|
3092
|
+
await ee(J);
|
|
3093
|
+
}, [J, ee]), Me = Ye(!1);
|
|
3092
3094
|
He(() => {
|
|
3093
|
-
const
|
|
3094
|
-
if (Me.current = d,
|
|
3095
|
+
const X = Me.current;
|
|
3096
|
+
if (Me.current = d, X && !d && J) {
|
|
3095
3097
|
const ie = w.lastCheckpointId ?? void 0, Le = w.lastCheckpointNs ?? void 0;
|
|
3096
3098
|
(async () => {
|
|
3097
3099
|
try {
|
|
3098
3100
|
const Ve = await u.getMessages({
|
|
3099
|
-
threadId:
|
|
3101
|
+
threadId: J,
|
|
3100
3102
|
checkpointId: ie,
|
|
3101
3103
|
checkpointNs: Le,
|
|
3102
3104
|
limit: N
|
|
3103
3105
|
});
|
|
3104
|
-
|
|
3106
|
+
O(Ve, "replace");
|
|
3105
3107
|
} catch {
|
|
3106
3108
|
}
|
|
3107
3109
|
try {
|
|
@@ -3110,15 +3112,15 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3110
3112
|
}
|
|
3111
3113
|
})();
|
|
3112
3114
|
}
|
|
3113
|
-
}, [d,
|
|
3114
|
-
const De = Ke(async (
|
|
3115
|
-
const ie = await u.createThread(
|
|
3115
|
+
}, [d, J, w.lastCheckpointId, w.lastCheckpointNs, u, O, K]);
|
|
3116
|
+
const De = Ke(async (X) => {
|
|
3117
|
+
const ie = await u.createThread(X);
|
|
3116
3118
|
return await K(), await ee(ie.threadId), ie.threadId;
|
|
3117
|
-
}, [u, K, ee]),
|
|
3118
|
-
await u.deleteThread(
|
|
3119
|
-
}, [u, K,
|
|
3120
|
-
await u.updateThread(
|
|
3121
|
-
}, [u, K]),
|
|
3119
|
+
}, [u, K, ee]), fe = Ke(async (X) => {
|
|
3120
|
+
await u.deleteThread(X), await K(), J === X && (F(null), C([]), k(!1), A(null), L(void 0), _(void 0));
|
|
3121
|
+
}, [u, K, J, C]), Oe = Ke(async (X, ie) => {
|
|
3122
|
+
await u.updateThread(X, ie), await K();
|
|
3123
|
+
}, [u, K]), pe = Ke(async (X, ie) => {
|
|
3122
3124
|
var Fn;
|
|
3123
3125
|
const Le = (ie == null ? void 0 : ie.attachments) || [], { contentParts: Ve, filesInfo: Ze } = await ix(
|
|
3124
3126
|
u,
|
|
@@ -3126,9 +3128,9 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3126
3128
|
t == null ? void 0 : t.uploadPath,
|
|
3127
3129
|
a,
|
|
3128
3130
|
c,
|
|
3129
|
-
|
|
3131
|
+
J
|
|
3130
3132
|
), ut = [];
|
|
3131
|
-
|
|
3133
|
+
X && ut.push({ type: "text", text: X });
|
|
3132
3134
|
for (const Ge of Ve) ut.push(Ge);
|
|
3133
3135
|
const gt = {
|
|
3134
3136
|
id: ((Fn = crypto.randomUUID) == null ? void 0 : Fn.call(crypto)) || `user-${Date.now()}`,
|
|
@@ -3143,7 +3145,7 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3143
3145
|
...gt,
|
|
3144
3146
|
content: gt.content.filter((Ge) => Ge.type === "text" || Ge.type === "image_url" || Ge.type === "file")
|
|
3145
3147
|
}, Qe = { ...(ie == null ? void 0 : ie.payloadExtras) ?? {} }, it = !!Qe.edit, et = Qe.originalMessageId, dt = typeof et == "string" ? et : void 0, an = Le && Le.length > 0, fr = {
|
|
3146
|
-
...
|
|
3148
|
+
...J ? { threadId: J } : {},
|
|
3147
3149
|
payload: {
|
|
3148
3150
|
messages: [Ut],
|
|
3149
3151
|
attachments: gt.content.filter((Ge) => Ge.type === "file").map((Ge) => ({ type: "file", url: Ge.url, mimeType: Ge.mimeType, name: Ge.name, size: Ge.size })),
|
|
@@ -3164,41 +3166,41 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3164
3166
|
{
|
|
3165
3167
|
onError: (Ge) => console.warn("stream error", Ge),
|
|
3166
3168
|
onOpen: ({ threadId: Ge, created: se }) => {
|
|
3167
|
-
!
|
|
3169
|
+
!J && Ge && (F(Ge), se && K().catch(() => {
|
|
3168
3170
|
}));
|
|
3169
3171
|
}
|
|
3170
3172
|
}
|
|
3171
3173
|
);
|
|
3172
|
-
}, [
|
|
3173
|
-
async (
|
|
3174
|
-
if (!
|
|
3174
|
+
}, [J, S, m, T, w.lastCheckpointId, w.lastCheckpointNs, u, t == null ? void 0 : t.uploadPath, K, F, a, c]), Se = Ke(
|
|
3175
|
+
async (X) => {
|
|
3176
|
+
if (!J) throw new Error("No active thread");
|
|
3175
3177
|
if (D || !I) return;
|
|
3176
3178
|
const ie = U;
|
|
3177
3179
|
if (ie) {
|
|
3178
3180
|
H(!0);
|
|
3179
3181
|
try {
|
|
3180
3182
|
const Le = await u.getMessages({
|
|
3181
|
-
threadId:
|
|
3183
|
+
threadId: J,
|
|
3182
3184
|
checkpointId: $,
|
|
3183
|
-
checkpointNs:
|
|
3184
|
-
limit: (
|
|
3185
|
+
checkpointNs: Z,
|
|
3186
|
+
limit: (X == null ? void 0 : X.limit) ?? N,
|
|
3185
3187
|
beforeId: ie
|
|
3186
3188
|
});
|
|
3187
|
-
|
|
3189
|
+
O(Le, "prepend");
|
|
3188
3190
|
} finally {
|
|
3189
3191
|
H(!1);
|
|
3190
3192
|
}
|
|
3191
3193
|
}
|
|
3192
3194
|
},
|
|
3193
|
-
[u,
|
|
3195
|
+
[u, J, $, Z, U, I, D, O, N]
|
|
3194
3196
|
), mt = {
|
|
3195
3197
|
baseUrl: u.baseUrl,
|
|
3196
3198
|
token: g,
|
|
3197
3199
|
setToken: b,
|
|
3198
3200
|
api: u,
|
|
3199
|
-
threads:
|
|
3200
|
-
currentThreadId:
|
|
3201
|
-
setCurrentThreadId:
|
|
3201
|
+
threads: G,
|
|
3202
|
+
currentThreadId: J,
|
|
3203
|
+
setCurrentThreadId: F,
|
|
3202
3204
|
messages: w.messages,
|
|
3203
3205
|
isStreaming: d,
|
|
3204
3206
|
error: h,
|
|
@@ -3214,10 +3216,10 @@ function ho({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
3214
3216
|
returnToLatest: Ie,
|
|
3215
3217
|
refreshThreads: K,
|
|
3216
3218
|
createThread: De,
|
|
3217
|
-
deleteThread:
|
|
3219
|
+
deleteThread: fe,
|
|
3218
3220
|
renameThread: Oe,
|
|
3219
3221
|
loadThread: ee,
|
|
3220
|
-
send:
|
|
3222
|
+
send: pe,
|
|
3221
3223
|
stop: v
|
|
3222
3224
|
};
|
|
3223
3225
|
return /* @__PURE__ */ l.jsx(Yc.Provider, { value: mt, children: e });
|
|
@@ -3413,7 +3415,7 @@ function Ue(...e) {
|
|
|
3413
3415
|
function _e(e, t) {
|
|
3414
3416
|
return e(gn, t);
|
|
3415
3417
|
}
|
|
3416
|
-
function
|
|
3418
|
+
function we(e, t) {
|
|
3417
3419
|
e(Zo, t);
|
|
3418
3420
|
}
|
|
3419
3421
|
function Vi(e) {
|
|
@@ -3448,7 +3450,7 @@ function ze(e = Zc) {
|
|
|
3448
3450
|
e(t, r) || (t = r, n(r));
|
|
3449
3451
|
};
|
|
3450
3452
|
}
|
|
3451
|
-
function
|
|
3453
|
+
function me(e) {
|
|
3452
3454
|
return (t) => (n) => {
|
|
3453
3455
|
e(n) && t(n);
|
|
3454
3456
|
};
|
|
@@ -3593,7 +3595,7 @@ function nt(...e) {
|
|
|
3593
3595
|
return e.forEach((s, i) => {
|
|
3594
3596
|
const a = Math.pow(2, i);
|
|
3595
3597
|
_e(s, (c) => {
|
|
3596
|
-
n[i] = c, r = r | a, r === o &&
|
|
3598
|
+
n[i] = c, r = r | a, r === o && we(t, n);
|
|
3597
3599
|
});
|
|
3598
3600
|
}), function(s, i) {
|
|
3599
3601
|
switch (s) {
|
|
@@ -3606,7 +3608,7 @@ function nt(...e) {
|
|
|
3606
3608
|
}
|
|
3607
3609
|
};
|
|
3608
3610
|
}
|
|
3609
|
-
function
|
|
3611
|
+
function he(e, t = Zc) {
|
|
3610
3612
|
return B(e, ze(t));
|
|
3611
3613
|
}
|
|
3612
3614
|
function hi(...e) {
|
|
@@ -4121,7 +4123,7 @@ const _x = {
|
|
|
4121
4123
|
le(
|
|
4122
4124
|
B(
|
|
4123
4125
|
c,
|
|
4124
|
-
|
|
4126
|
+
me((S) => S.length > 0),
|
|
4125
4127
|
Ce(g, v),
|
|
4126
4128
|
re(([S, T, C]) => {
|
|
4127
4129
|
const N = S.reduce((I, k, D) => St(I, k, Ar(k, T.offsetTree, C) || D), Yn());
|
|
@@ -4137,7 +4139,7 @@ const _x = {
|
|
|
4137
4139
|
B(
|
|
4138
4140
|
r,
|
|
4139
4141
|
Ce(g),
|
|
4140
|
-
|
|
4142
|
+
me(([S, { lastIndex: T }]) => S < T),
|
|
4141
4143
|
re(([S, { lastIndex: T, lastSize: C }]) => [
|
|
4142
4144
|
{
|
|
4143
4145
|
endIndex: T,
|
|
@@ -4158,7 +4160,7 @@ const _x = {
|
|
|
4158
4160
|
le(
|
|
4159
4161
|
B(
|
|
4160
4162
|
d,
|
|
4161
|
-
|
|
4163
|
+
me((S) => S !== void 0 && $e(Xe(g).sizeTree)),
|
|
4162
4164
|
re((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
|
|
4163
4165
|
),
|
|
4164
4166
|
n
|
|
@@ -4189,10 +4191,10 @@ const _x = {
|
|
|
4189
4191
|
(S) => {
|
|
4190
4192
|
const { groupIndices: T } = Xe(g);
|
|
4191
4193
|
if (S > 0)
|
|
4192
|
-
|
|
4194
|
+
we(t, !0), we(s, S + Sl(S, T));
|
|
4193
4195
|
else if (S < 0) {
|
|
4194
4196
|
const C = Xe(p);
|
|
4195
|
-
C.length > 0 && (S -= Sl(-S, C)),
|
|
4197
|
+
C.length > 0 && (S -= Sl(-S, C)), we(i, S);
|
|
4196
4198
|
}
|
|
4197
4199
|
}
|
|
4198
4200
|
), _e(B(a, Ce(e)), ([S, T]) => {
|
|
@@ -4226,9 +4228,9 @@ const _x = {
|
|
|
4226
4228
|
}
|
|
4227
4229
|
const U = Tn(T.sizeTree);
|
|
4228
4230
|
return D !== S && U.shift(), U.reduce(
|
|
4229
|
-
(A, { k: $, v:
|
|
4230
|
-
let
|
|
4231
|
-
return A.prevSize !== 0 && (
|
|
4231
|
+
(A, { k: $, v: L }) => {
|
|
4232
|
+
let Z = A.ranges;
|
|
4233
|
+
return A.prevSize !== 0 && (Z = [
|
|
4232
4234
|
...A.ranges,
|
|
4233
4235
|
{
|
|
4234
4236
|
endIndex: $ + S - 1,
|
|
@@ -4237,8 +4239,8 @@ const _x = {
|
|
|
4237
4239
|
}
|
|
4238
4240
|
]), {
|
|
4239
4241
|
prevIndex: $ + S,
|
|
4240
|
-
prevSize:
|
|
4241
|
-
ranges:
|
|
4242
|
+
prevSize: L,
|
|
4243
|
+
ranges: Z
|
|
4242
4244
|
};
|
|
4243
4245
|
},
|
|
4244
4246
|
{
|
|
@@ -4364,7 +4366,7 @@ const cu = Ae(
|
|
|
4364
4366
|
), le(
|
|
4365
4367
|
B(
|
|
4366
4368
|
nt(o, t, r),
|
|
4367
|
-
|
|
4369
|
+
me(([c, u]) => ts(u)),
|
|
4368
4370
|
re(([c, u, d]) => Lt(u.groupOffsetTree, Math.max(c - d, 0), "v")[0]),
|
|
4369
4371
|
ze(),
|
|
4370
4372
|
re((c) => [c])
|
|
@@ -4378,7 +4380,7 @@ const cu = Ae(
|
|
|
4378
4380
|
const t = W(!1), n = Ct(
|
|
4379
4381
|
B(
|
|
4380
4382
|
t,
|
|
4381
|
-
|
|
4383
|
+
me((r) => r),
|
|
4382
4384
|
ze()
|
|
4383
4385
|
)
|
|
4384
4386
|
);
|
|
@@ -4411,7 +4413,7 @@ const Ur = Ae(
|
|
|
4411
4413
|
const v = Ee(), x = Ee(), g = W(0);
|
|
4412
4414
|
let p = null, b = null, w = null;
|
|
4413
4415
|
function y() {
|
|
4414
|
-
p && (p(), p = null), w && (w(), w = null), b && (clearTimeout(b), b = null),
|
|
4416
|
+
p && (p(), p = null), w && (w(), w = null), b && (clearTimeout(b), b = null), we(c, !1);
|
|
4415
4417
|
}
|
|
4416
4418
|
return le(
|
|
4417
4419
|
B(
|
|
@@ -4425,24 +4427,24 @@ const Ur = Ae(
|
|
|
4425
4427
|
U,
|
|
4426
4428
|
A
|
|
4427
4429
|
]) => {
|
|
4428
|
-
const $ = uu(R), { align:
|
|
4429
|
-
let
|
|
4430
|
-
|
|
4431
|
-
const
|
|
4432
|
-
y(),
|
|
4430
|
+
const $ = uu(R), { align: L, behavior: Z, offset: _ } = $, O = C - 1, G = lu($, S, O);
|
|
4431
|
+
let Q = Ar(G, S.offsetTree, H) + I;
|
|
4432
|
+
L === "end" ? (Q += U + Lt(S.sizeTree, G)[1] - T + A, G === O && (Q += k)) : L === "center" ? Q += (U + Lt(S.sizeTree, G)[1] - T + A) / 2 : Q -= N, _ && (Q += _);
|
|
4433
|
+
const J = (F) => {
|
|
4434
|
+
y(), F ? (D("retrying to scroll to", { location: R }, bt.DEBUG), we(v, R)) : (we(x, !0), D("list did not change, scroll successful", {}, bt.DEBUG));
|
|
4433
4435
|
};
|
|
4434
|
-
if (y(),
|
|
4435
|
-
let
|
|
4436
|
+
if (y(), Z === "smooth") {
|
|
4437
|
+
let F = !1;
|
|
4436
4438
|
w = _e(t, (K) => {
|
|
4437
|
-
|
|
4439
|
+
F = F || K;
|
|
4438
4440
|
}), p = Mt(d, () => {
|
|
4439
|
-
|
|
4441
|
+
J(F);
|
|
4440
4442
|
});
|
|
4441
4443
|
} else
|
|
4442
|
-
p = Mt(B(t, Dx(150)),
|
|
4444
|
+
p = Mt(B(t, Dx(150)), J);
|
|
4443
4445
|
return b = setTimeout(() => {
|
|
4444
4446
|
y();
|
|
4445
|
-
}, 1200),
|
|
4447
|
+
}, 1200), we(c, !0), D("scrolling from index to", { behavior: Z, index: G, top: Q }, bt.DEBUG), { behavior: Z, top: Q };
|
|
4446
4448
|
}
|
|
4447
4449
|
)
|
|
4448
4450
|
),
|
|
@@ -4482,7 +4484,7 @@ const Wr = Ae(
|
|
|
4482
4484
|
B(
|
|
4483
4485
|
i,
|
|
4484
4486
|
Ce(c),
|
|
4485
|
-
|
|
4487
|
+
me(([d, h]) => !!h),
|
|
4486
4488
|
Vt(!1)
|
|
4487
4489
|
),
|
|
4488
4490
|
a
|
|
@@ -4490,7 +4492,7 @@ const Wr = Ae(
|
|
|
4490
4492
|
B(
|
|
4491
4493
|
i,
|
|
4492
4494
|
Ce(c),
|
|
4493
|
-
|
|
4495
|
+
me(([d, h]) => !!h),
|
|
4494
4496
|
Vt(!1)
|
|
4495
4497
|
),
|
|
4496
4498
|
u
|
|
@@ -4498,16 +4500,16 @@ const Wr = Ae(
|
|
|
4498
4500
|
B(
|
|
4499
4501
|
nt(t, i),
|
|
4500
4502
|
Ce(a, n, e, u),
|
|
4501
|
-
|
|
4503
|
+
me(([[, d], h, { sizeTree: m }, v, x]) => d && (!$e(m) || Wi(v)) && !h && !x),
|
|
4502
4504
|
Ce(c)
|
|
4503
4505
|
),
|
|
4504
4506
|
([, d]) => {
|
|
4505
4507
|
Mt(o, () => {
|
|
4506
|
-
|
|
4508
|
+
we(u, !0);
|
|
4507
4509
|
}), qi(4, () => {
|
|
4508
4510
|
Mt(r, () => {
|
|
4509
|
-
|
|
4510
|
-
}),
|
|
4511
|
+
we(a, !0);
|
|
4512
|
+
}), we(s, d);
|
|
4511
4513
|
});
|
|
4512
4514
|
}
|
|
4513
4515
|
), {
|
|
@@ -4534,7 +4536,7 @@ const kr = "up", yr = "down", Lx = "none", Fx = {
|
|
|
4534
4536
|
}, Bx = 0, Vr = Ae(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
4535
4537
|
const i = W(!1), a = W(!0), c = Ee(), u = Ee(), d = W(4), h = W(Bx), m = ct(
|
|
4536
4538
|
B(
|
|
4537
|
-
hi(B(
|
|
4539
|
+
hi(B(he(o), jn(1), Vt(!0)), B(he(o), jn(1), Vt(!1), bl(100))),
|
|
4538
4540
|
ze()
|
|
4539
4541
|
),
|
|
4540
4542
|
!1
|
|
@@ -4544,7 +4546,7 @@ const kr = "up", yr = "down", Lx = "none", Fx = {
|
|
|
4544
4546
|
);
|
|
4545
4547
|
le(
|
|
4546
4548
|
B(
|
|
4547
|
-
nt(
|
|
4549
|
+
nt(he(o), he(h)),
|
|
4548
4550
|
re(([w, y]) => w <= y),
|
|
4549
4551
|
ze()
|
|
4550
4552
|
),
|
|
@@ -4552,7 +4554,7 @@ const kr = "up", yr = "down", Lx = "none", Fx = {
|
|
|
4552
4554
|
), le(B(a, rn(50)), u);
|
|
4553
4555
|
const x = Ct(
|
|
4554
4556
|
B(
|
|
4555
|
-
nt(r,
|
|
4557
|
+
nt(r, he(s), he(t), he(e), he(d)),
|
|
4556
4558
|
Kt((w, [{ scrollHeight: y, scrollTop: R }, S, T, C, N]) => {
|
|
4557
4559
|
const I = R + S - y > -N, k = {
|
|
4558
4560
|
scrollHeight: y,
|
|
@@ -4606,7 +4608,7 @@ const kr = "up", yr = "down", Lx = "none", Fx = {
|
|
|
4606
4608
|
},
|
|
4607
4609
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
4608
4610
|
),
|
|
4609
|
-
|
|
4611
|
+
me((w) => w.changed),
|
|
4610
4612
|
re((w) => w.jump)
|
|
4611
4613
|
),
|
|
4612
4614
|
0
|
|
@@ -4636,7 +4638,7 @@ const kr = "up", yr = "down", Lx = "none", Fx = {
|
|
|
4636
4638
|
return le(
|
|
4637
4639
|
B(
|
|
4638
4640
|
m,
|
|
4639
|
-
|
|
4641
|
+
me((w) => !w),
|
|
4640
4642
|
Vt(0)
|
|
4641
4643
|
),
|
|
4642
4644
|
b
|
|
@@ -4645,7 +4647,7 @@ const kr = "up", yr = "down", Lx = "none", Fx = {
|
|
|
4645
4647
|
o,
|
|
4646
4648
|
rn(100),
|
|
4647
4649
|
Ce(m),
|
|
4648
|
-
|
|
4650
|
+
me(([w, y]) => !!y),
|
|
4649
4651
|
Kt(([w, y], [R]) => [y, R], [0, 0]),
|
|
4650
4652
|
re(([w, y]) => y - w)
|
|
4651
4653
|
),
|
|
@@ -4676,15 +4678,15 @@ const Ji = Ae(
|
|
|
4676
4678
|
const s = Ee(), i = W(0), a = W(0), c = W(0), u = ct(
|
|
4677
4679
|
B(
|
|
4678
4680
|
nt(
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4681
|
+
he(r),
|
|
4682
|
+
he(o),
|
|
4683
|
+
he(n),
|
|
4684
|
+
he(s, jr),
|
|
4685
|
+
he(c),
|
|
4686
|
+
he(i),
|
|
4687
|
+
he(t),
|
|
4688
|
+
he(e),
|
|
4689
|
+
he(a)
|
|
4688
4690
|
),
|
|
4689
4691
|
re(
|
|
4690
4692
|
([
|
|
@@ -4707,7 +4709,7 @@ const Ji = Ae(
|
|
|
4707
4709
|
] : null;
|
|
4708
4710
|
}
|
|
4709
4711
|
),
|
|
4710
|
-
|
|
4712
|
+
me((d) => d != null),
|
|
4711
4713
|
ze(jr)
|
|
4712
4714
|
),
|
|
4713
4715
|
[0, 0]
|
|
@@ -4827,17 +4829,17 @@ const Mn = Ae(
|
|
|
4827
4829
|
nt(
|
|
4828
4830
|
v,
|
|
4829
4831
|
x,
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4832
|
+
he(c, jr),
|
|
4833
|
+
he(o),
|
|
4834
|
+
he(r),
|
|
4835
|
+
he(u),
|
|
4834
4836
|
d,
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4837
|
+
he(g),
|
|
4838
|
+
he(t),
|
|
4839
|
+
he(n),
|
|
4838
4840
|
e
|
|
4839
4841
|
),
|
|
4840
|
-
|
|
4842
|
+
me(([T, C, , N, , , , , , , I]) => {
|
|
4841
4843
|
const k = I && I.length !== N;
|
|
4842
4844
|
return T && !C && !k;
|
|
4843
4845
|
}),
|
|
@@ -4855,56 +4857,56 @@ const Mn = Ae(
|
|
|
4855
4857
|
A,
|
|
4856
4858
|
$
|
|
4857
4859
|
]) => {
|
|
4858
|
-
const
|
|
4860
|
+
const L = I, { offsetTree: Z, sizeTree: _ } = L, O = Xe(p);
|
|
4859
4861
|
if (N === 0)
|
|
4860
4862
|
return { ...Ls, totalCount: N };
|
|
4861
4863
|
if (T === 0 && C === 0)
|
|
4862
|
-
return
|
|
4864
|
+
return O === 0 ? { ...Ls, totalCount: N } : fu(O, k, I, U, A, $ || []);
|
|
4863
4865
|
if ($e(_))
|
|
4864
|
-
return
|
|
4865
|
-
$x(Xi(k, N),
|
|
4866
|
+
return O > 0 ? null : mo(
|
|
4867
|
+
$x(Xi(k, N), L, $),
|
|
4866
4868
|
[],
|
|
4867
4869
|
N,
|
|
4868
4870
|
A,
|
|
4869
|
-
|
|
4871
|
+
L,
|
|
4870
4872
|
U
|
|
4871
4873
|
);
|
|
4872
|
-
const
|
|
4874
|
+
const G = [];
|
|
4873
4875
|
if (H.length > 0) {
|
|
4874
|
-
const
|
|
4875
|
-
let
|
|
4876
|
-
for (const
|
|
4877
|
-
const
|
|
4876
|
+
const ye = H[0], ue = H[H.length - 1];
|
|
4877
|
+
let Y = 0;
|
|
4878
|
+
for (const P of es(_, ye, ue)) {
|
|
4879
|
+
const q = P.value, ee = Math.max(P.start, ye), ce = Math.min(P.end, ue);
|
|
4878
4880
|
for (let oe = ee; oe <= ce; oe++)
|
|
4879
|
-
|
|
4881
|
+
G.push({ data: $ == null ? void 0 : $[oe], index: oe, offset: Y, size: q }), Y += q;
|
|
4880
4882
|
}
|
|
4881
4883
|
}
|
|
4882
4884
|
if (!D)
|
|
4883
|
-
return mo([],
|
|
4884
|
-
const
|
|
4885
|
-
if (
|
|
4885
|
+
return mo([], G, N, A, L, U);
|
|
4886
|
+
const Q = H.length > 0 ? H[H.length - 1] + 1 : 0, J = Ix(Z, T, C, Q);
|
|
4887
|
+
if (J.length === 0)
|
|
4886
4888
|
return null;
|
|
4887
|
-
const
|
|
4888
|
-
for (const
|
|
4889
|
-
const
|
|
4890
|
-
let
|
|
4891
|
-
const ee =
|
|
4892
|
-
if (
|
|
4893
|
-
|
|
4894
|
-
const oe =
|
|
4895
|
-
|
|
4889
|
+
const F = N - 1, K = Qo([], (ye) => {
|
|
4890
|
+
for (const ue of J) {
|
|
4891
|
+
const Y = ue.value;
|
|
4892
|
+
let P = Y.offset, q = ue.start;
|
|
4893
|
+
const ee = Y.size;
|
|
4894
|
+
if (Y.offset < T) {
|
|
4895
|
+
q += Math.floor((T - Y.offset + A) / (ee + A));
|
|
4896
|
+
const oe = q - ue.start;
|
|
4897
|
+
P += oe * ee + oe * A;
|
|
4896
4898
|
}
|
|
4897
|
-
|
|
4898
|
-
const ce = Math.min(
|
|
4899
|
-
for (let oe =
|
|
4900
|
-
|
|
4899
|
+
q < Q && (P += (Q - q) * ee, q = Q);
|
|
4900
|
+
const ce = Math.min(ue.end, F);
|
|
4901
|
+
for (let oe = q; oe <= ce && !(P >= C); oe++)
|
|
4902
|
+
ye.push({ data: $ == null ? void 0 : $[oe], index: oe, offset: P, size: ee }), P += ee + A;
|
|
4901
4903
|
}
|
|
4902
4904
|
});
|
|
4903
|
-
return mo(K,
|
|
4905
|
+
return mo(K, G, N, A, L, U);
|
|
4904
4906
|
}
|
|
4905
4907
|
),
|
|
4906
4908
|
//@ts-expect-error filter needs to be fixed
|
|
4907
|
-
|
|
4909
|
+
me((T) => T !== null),
|
|
4908
4910
|
ze()
|
|
4909
4911
|
),
|
|
4910
4912
|
Ls
|
|
@@ -4912,7 +4914,7 @@ const Mn = Ae(
|
|
|
4912
4914
|
le(
|
|
4913
4915
|
B(
|
|
4914
4916
|
e,
|
|
4915
|
-
|
|
4917
|
+
me(Wi),
|
|
4916
4918
|
re((T) => T == null ? void 0 : T.length)
|
|
4917
4919
|
),
|
|
4918
4920
|
o
|
|
@@ -4938,9 +4940,9 @@ const Mn = Ae(
|
|
|
4938
4940
|
const y = Ct(
|
|
4939
4941
|
B(
|
|
4940
4942
|
w,
|
|
4941
|
-
|
|
4943
|
+
me(({ items: T }) => T.length > 0),
|
|
4942
4944
|
Ce(o, e),
|
|
4943
|
-
|
|
4945
|
+
me(([{ items: T }, C]) => T[T.length - 1].originalIndex === C - 1),
|
|
4944
4946
|
re(([, T, C]) => [T - 1, C]),
|
|
4945
4947
|
ze(jr),
|
|
4946
4948
|
re(([T]) => T)
|
|
@@ -4949,14 +4951,14 @@ const Mn = Ae(
|
|
|
4949
4951
|
B(
|
|
4950
4952
|
w,
|
|
4951
4953
|
rn(200),
|
|
4952
|
-
|
|
4954
|
+
me(({ items: T, topItems: C }) => T.length > 0 && T[0].originalIndex === C.length),
|
|
4953
4955
|
re(({ items: T }) => T[0].index),
|
|
4954
4956
|
ze()
|
|
4955
4957
|
)
|
|
4956
4958
|
), S = Ct(
|
|
4957
4959
|
B(
|
|
4958
4960
|
w,
|
|
4959
|
-
|
|
4961
|
+
me(({ items: T }) => T.length > 0),
|
|
4960
4962
|
re(({ items: T }) => {
|
|
4961
4963
|
let C = 0, N = T.length - 1;
|
|
4962
4964
|
for (; T[C].type === "group" && C < N; )
|
|
@@ -4993,7 +4995,7 @@ const Mn = Ae(
|
|
|
4993
4995
|
),
|
|
4994
4996
|
0
|
|
4995
4997
|
);
|
|
4996
|
-
return le(
|
|
4998
|
+
return le(he(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
4997
4999
|
},
|
|
4998
5000
|
Ue(ht, Mn),
|
|
4999
5001
|
{ singleton: !0 }
|
|
@@ -5002,7 +5004,7 @@ const Mn = Ae(
|
|
|
5002
5004
|
const n = W(!1), r = ct(
|
|
5003
5005
|
B(
|
|
5004
5006
|
nt(n, e, t),
|
|
5005
|
-
|
|
5007
|
+
me(([o]) => o),
|
|
5006
5008
|
re(([, o, s]) => Math.max(0, o - s)),
|
|
5007
5009
|
rn(0),
|
|
5008
5010
|
ze()
|
|
@@ -5044,7 +5046,7 @@ const Mn = Ae(
|
|
|
5044
5046
|
return A ? C && Mt(
|
|
5045
5047
|
B(
|
|
5046
5048
|
i,
|
|
5047
|
-
|
|
5049
|
+
me(($) => !$),
|
|
5048
5050
|
// skips the initial publish of false, and the cleanup call.
|
|
5049
5051
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
5050
5052
|
jn(Xe(i) ? 1 : 2)
|
|
@@ -5052,7 +5054,7 @@ const Mn = Ae(
|
|
|
5052
5054
|
C
|
|
5053
5055
|
) : C && C(), A;
|
|
5054
5056
|
}),
|
|
5055
|
-
|
|
5057
|
+
me((h) => h !== null)
|
|
5056
5058
|
),
|
|
5057
5059
|
u
|
|
5058
5060
|
), {
|
|
@@ -5080,7 +5082,7 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5080
5082
|
const x = W(!1), g = Ee();
|
|
5081
5083
|
let p = null;
|
|
5082
5084
|
function b(S) {
|
|
5083
|
-
|
|
5085
|
+
we(i, {
|
|
5084
5086
|
align: "end",
|
|
5085
5087
|
behavior: S,
|
|
5086
5088
|
index: "LAST"
|
|
@@ -5088,13 +5090,13 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5088
5090
|
}
|
|
5089
5091
|
_e(
|
|
5090
5092
|
B(
|
|
5091
|
-
nt(B(
|
|
5092
|
-
Ce(
|
|
5093
|
+
nt(B(he(t), jn(1)), c),
|
|
5094
|
+
Ce(he(x), s, a, h),
|
|
5093
5095
|
re(([[S, T], C, N, I, k]) => {
|
|
5094
5096
|
let D = T && I, H = "auto";
|
|
5095
5097
|
return D && (H = Ux(C, N || k), D = D && !!H), { followOutputBehavior: H, shouldFollow: D, totalCount: S };
|
|
5096
5098
|
}),
|
|
5097
|
-
|
|
5099
|
+
me(({ shouldFollow: S }) => S)
|
|
5098
5100
|
),
|
|
5099
5101
|
({ followOutputBehavior: S, totalCount: T }) => {
|
|
5100
5102
|
p && (p(), p = null), Xe(n) ? requestAnimationFrame(() => {
|
|
@@ -5112,13 +5114,13 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5112
5114
|
}
|
|
5113
5115
|
_e(
|
|
5114
5116
|
B(
|
|
5115
|
-
nt(
|
|
5116
|
-
|
|
5117
|
+
nt(he(x), t, u),
|
|
5118
|
+
me(([S, , T]) => S && T),
|
|
5117
5119
|
Kt(
|
|
5118
5120
|
({ value: S }, [, T]) => ({ refreshed: S === T, value: T }),
|
|
5119
5121
|
{ refreshed: !1, value: 0 }
|
|
5120
5122
|
),
|
|
5121
|
-
|
|
5123
|
+
me(({ refreshed: S }) => S),
|
|
5122
5124
|
Ce(x, t)
|
|
5123
5125
|
),
|
|
5124
5126
|
([, S]) => {
|
|
@@ -5126,35 +5128,35 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5126
5128
|
}
|
|
5127
5129
|
), _e(g, () => {
|
|
5128
5130
|
w(Xe(x) !== !1);
|
|
5129
|
-
}), _e(nt(
|
|
5131
|
+
}), _e(nt(he(x), o), ([S, T]) => {
|
|
5130
5132
|
S && !T.atBottom && T.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && b("auto");
|
|
5131
5133
|
});
|
|
5132
5134
|
const y = W(null), R = Ee();
|
|
5133
5135
|
return le(
|
|
5134
5136
|
hi(
|
|
5135
5137
|
B(
|
|
5136
|
-
|
|
5138
|
+
he(r),
|
|
5137
5139
|
re((S) => {
|
|
5138
5140
|
var T;
|
|
5139
5141
|
return (T = S == null ? void 0 : S.length) != null ? T : 0;
|
|
5140
5142
|
})
|
|
5141
5143
|
),
|
|
5142
|
-
B(
|
|
5144
|
+
B(he(t))
|
|
5143
5145
|
),
|
|
5144
5146
|
R
|
|
5145
5147
|
), _e(
|
|
5146
5148
|
B(
|
|
5147
5149
|
nt(B(R, jn(1)), c),
|
|
5148
|
-
Ce(
|
|
5150
|
+
Ce(he(y), a, h, m),
|
|
5149
5151
|
re(([[S, T], C, N, I, k]) => T && N && (C == null ? void 0 : C({ context: k, totalCount: S, scrollingInProgress: I }))),
|
|
5150
|
-
|
|
5152
|
+
me((S) => !!S),
|
|
5151
5153
|
rn(0)
|
|
5152
5154
|
),
|
|
5153
5155
|
(S) => {
|
|
5154
5156
|
p && (p(), p = null), Xe(n) ? requestAnimationFrame(() => {
|
|
5155
|
-
Xe(d)("scrolling into view", {}),
|
|
5157
|
+
Xe(d)("scrolling into view", {}), we(v, S);
|
|
5156
5158
|
}) : p = Mt(e, () => {
|
|
5157
|
-
Xe(d)("scrolling into view", {}),
|
|
5159
|
+
Xe(d)("scrolling into view", {}), we(v, S), p = null;
|
|
5158
5160
|
});
|
|
5159
5161
|
}
|
|
5160
5162
|
), { autoscrollToBottom: g, followOutput: x, scrollIntoViewOnChange: y };
|
|
@@ -5175,7 +5177,7 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5175
5177
|
B(
|
|
5176
5178
|
a,
|
|
5177
5179
|
Ce(s),
|
|
5178
|
-
|
|
5180
|
+
me(([, c]) => c !== 0),
|
|
5179
5181
|
Ce(o, r, t, n, e),
|
|
5180
5182
|
re(([[, c], u, d, h, m, v = []]) => fu(c, u, d, h, m, v))
|
|
5181
5183
|
),
|
|
@@ -5190,7 +5192,7 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5190
5192
|
B(
|
|
5191
5193
|
e,
|
|
5192
5194
|
Ce(r),
|
|
5193
|
-
|
|
5195
|
+
me(([, o]) => o !== 0),
|
|
5194
5196
|
re(([, o]) => ({ top: o }))
|
|
5195
5197
|
),
|
|
5196
5198
|
(o) => {
|
|
@@ -5198,11 +5200,11 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5198
5200
|
B(
|
|
5199
5201
|
n,
|
|
5200
5202
|
jn(1),
|
|
5201
|
-
|
|
5203
|
+
me((s) => s.items.length > 1)
|
|
5202
5204
|
),
|
|
5203
5205
|
() => {
|
|
5204
5206
|
requestAnimationFrame(() => {
|
|
5205
|
-
|
|
5207
|
+
we(t, o);
|
|
5206
5208
|
});
|
|
5207
5209
|
}
|
|
5208
5210
|
);
|
|
@@ -5220,7 +5222,7 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5220
5222
|
B(
|
|
5221
5223
|
e,
|
|
5222
5224
|
Ce(r, t, n),
|
|
5223
|
-
|
|
5225
|
+
me(([o, s]) => !!s),
|
|
5224
5226
|
re(([o, s, i, a]) => {
|
|
5225
5227
|
const { enter: c, exit: u } = s;
|
|
5226
5228
|
if (i) {
|
|
@@ -5292,11 +5294,11 @@ const Ux = (e, t) => typeof e == "function" ? Nl(e(t)) : t && Nl(e), Wx = Ae(
|
|
|
5292
5294
|
const R = Ax(x.sizeTree);
|
|
5293
5295
|
p && b !== null && w !== null && (g = b.scrollTop - w.offsetTop), g -= y, v({ ranges: R, scrollTop: g });
|
|
5294
5296
|
}
|
|
5295
|
-
), le(B(d,
|
|
5297
|
+
), le(B(d, me(Wi), re(Yx)), o), le(
|
|
5296
5298
|
B(
|
|
5297
5299
|
s,
|
|
5298
5300
|
Ce(d),
|
|
5299
|
-
|
|
5301
|
+
me(([, v]) => v !== void 0),
|
|
5300
5302
|
ze(),
|
|
5301
5303
|
re(([, v]) => v.ranges)
|
|
5302
5304
|
),
|
|
@@ -5316,7 +5318,7 @@ const qx = Ae(([{ topItemsIndexes: e }]) => {
|
|
|
5316
5318
|
return le(
|
|
5317
5319
|
B(
|
|
5318
5320
|
t,
|
|
5319
|
-
|
|
5321
|
+
me((n) => n >= 0),
|
|
5320
5322
|
re((n) => Array.from({ length: n }).map((r, o) => o))
|
|
5321
5323
|
),
|
|
5322
5324
|
e
|
|
@@ -5347,21 +5349,21 @@ const Xx = xu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5347
5349
|
},
|
|
5348
5350
|
[0, [], 0, 0]
|
|
5349
5351
|
),
|
|
5350
|
-
|
|
5352
|
+
me(([b]) => b !== 0),
|
|
5351
5353
|
Ce(r, a, n, o, v, x),
|
|
5352
|
-
|
|
5354
|
+
me(([, b, w, y, , , R]) => !R && !y && b !== 0 && w === kr),
|
|
5353
5355
|
re(([[b], , , , , w]) => (w("Upward scrolling compensation", { amount: b }, bt.DEBUG), b))
|
|
5354
5356
|
)
|
|
5355
5357
|
);
|
|
5356
5358
|
function p(b) {
|
|
5357
|
-
b > 0 ? (
|
|
5359
|
+
b > 0 ? (we(t, { behavior: "auto", top: -b }), we(e, 0)) : (we(e, 0), we(t, { behavior: "auto", top: -b }));
|
|
5358
5360
|
}
|
|
5359
5361
|
return _e(B(g, Ce(e, s)), ([b, w, y]) => {
|
|
5360
|
-
y && Xx() ?
|
|
5362
|
+
y && Xx() ? we(e, w - b) : p(-b);
|
|
5361
5363
|
}), _e(
|
|
5362
5364
|
B(
|
|
5363
5365
|
nt(ct(s, !1), e, x),
|
|
5364
|
-
|
|
5366
|
+
me(([b, w, y]) => !b && !y && w !== 0),
|
|
5365
5367
|
re(([b, w]) => w),
|
|
5366
5368
|
rn(1)
|
|
5367
5369
|
),
|
|
@@ -5396,9 +5398,9 @@ const Xx = xu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
5396
5398
|
})
|
|
5397
5399
|
),
|
|
5398
5400
|
(b) => {
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5401
|
+
we(e, b), requestAnimationFrame(() => {
|
|
5402
|
+
we(t, { top: b }), requestAnimationFrame(() => {
|
|
5403
|
+
we(e, 0), we(x, !1);
|
|
5402
5404
|
});
|
|
5403
5405
|
});
|
|
5404
5406
|
}
|
|
@@ -5535,22 +5537,22 @@ const Qr = typeof document < "u" ? V.useLayoutEffect : V.useEffect;
|
|
|
5535
5537
|
function bu(e, t, n) {
|
|
5536
5538
|
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = V.createContext({});
|
|
5537
5539
|
function c(p, b) {
|
|
5538
|
-
p.propsReady &&
|
|
5540
|
+
p.propsReady && we(p.propsReady, !1);
|
|
5539
5541
|
for (const w of r) {
|
|
5540
5542
|
const y = p[t.required[w]];
|
|
5541
|
-
|
|
5543
|
+
we(y, b[w]);
|
|
5542
5544
|
}
|
|
5543
5545
|
for (const w of o)
|
|
5544
5546
|
if (w in b) {
|
|
5545
5547
|
const y = p[t.optional[w]];
|
|
5546
|
-
|
|
5548
|
+
we(y, b[w]);
|
|
5547
5549
|
}
|
|
5548
|
-
p.propsReady &&
|
|
5550
|
+
p.propsReady && we(p.propsReady, !0);
|
|
5549
5551
|
}
|
|
5550
5552
|
function u(p) {
|
|
5551
5553
|
return s.reduce((b, w) => (b[w] = (y) => {
|
|
5552
5554
|
const R = p[t.methods[w]];
|
|
5553
|
-
|
|
5555
|
+
we(R, y);
|
|
5554
5556
|
}, b), {});
|
|
5555
5557
|
}
|
|
5556
5558
|
function d(p) {
|
|
@@ -5575,7 +5577,7 @@ function bu(e, t, n) {
|
|
|
5575
5577
|
const b = V.useContext(a);
|
|
5576
5578
|
return V.useCallback(
|
|
5577
5579
|
(w) => {
|
|
5578
|
-
|
|
5580
|
+
we(b[p], w);
|
|
5579
5581
|
},
|
|
5580
5582
|
[b, p]
|
|
5581
5583
|
);
|
|
@@ -5705,7 +5707,7 @@ const tv = /* @__PURE__ */ Ae(() => {
|
|
|
5705
5707
|
([e, t]) => ({ ...e, ...t }),
|
|
5706
5708
|
Ue(vu, tv)
|
|
5707
5709
|
), rv = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), ov = { overflowAnchor: "none", position: Qi(), zIndex: 1 }, Tu = { overflowAnchor: "none" }, sv = { ...Tu, display: "inline-block", height: "100%" }, jl = /* @__PURE__ */ V.memo(function({ showTopList: e = !1 }) {
|
|
5708
|
-
const t =
|
|
5710
|
+
const t = ve("listState"), n = It("sizeRanges"), r = ve("useWindowScroll"), o = ve("customScrollParent"), s = It("windowScrollContainerState"), i = It("scrollContainerState"), a = o || r ? s : i, c = ve("itemContent"), u = ve("context"), d = ve("groupContent"), h = ve("trackItemSizes"), m = ve("itemSize"), v = ve("log"), x = It("gap"), g = ve("horizontalDirection"), { callbackRef: p } = wx(
|
|
5709
5711
|
n,
|
|
5710
5712
|
m,
|
|
5711
5713
|
h,
|
|
@@ -5714,12 +5716,12 @@ const tv = /* @__PURE__ */ Ae(() => {
|
|
|
5714
5716
|
x,
|
|
5715
5717
|
o,
|
|
5716
5718
|
g,
|
|
5717
|
-
|
|
5719
|
+
ve("skipAnimationFrameInResizeObserver")
|
|
5718
5720
|
), [b, w] = V.useState(0);
|
|
5719
5721
|
ta("deviation", (A) => {
|
|
5720
5722
|
b !== A && w(A);
|
|
5721
5723
|
});
|
|
5722
|
-
const y =
|
|
5724
|
+
const y = ve("EmptyPlaceholder"), R = ve("ScrollSeekPlaceholder") || rv, S = ve("ListComponent"), T = ve("ItemComponent"), C = ve("GroupComponent"), N = ve("computeItemKey"), I = ve("isSeeking"), k = ve("groupIndices").length > 0, D = ve("alignToBottom"), H = ve("initialItemFinalLocationReached"), U = e ? {} : {
|
|
5723
5725
|
boxSizing: "border-box",
|
|
5724
5726
|
...g ? {
|
|
5725
5727
|
display: "inline-block",
|
|
@@ -5743,14 +5745,14 @@ const tv = /* @__PURE__ */ Ae(() => {
|
|
|
5743
5745
|
ref: p,
|
|
5744
5746
|
style: U,
|
|
5745
5747
|
children: (e ? t.topItems : t.items).map((A) => {
|
|
5746
|
-
const $ = A.originalIndex,
|
|
5748
|
+
const $ = A.originalIndex, L = N($ + t.firstItemIndex, A.data, u);
|
|
5747
5749
|
return I ? /* @__PURE__ */ lo(
|
|
5748
5750
|
R,
|
|
5749
5751
|
{
|
|
5750
5752
|
...lt(R, u),
|
|
5751
5753
|
height: A.size,
|
|
5752
5754
|
index: A.index,
|
|
5753
|
-
key:
|
|
5755
|
+
key: L,
|
|
5754
5756
|
type: A.type || "item",
|
|
5755
5757
|
...A.type === "group" ? {} : { groupIndex: A.groupIndex }
|
|
5756
5758
|
}
|
|
@@ -5761,7 +5763,7 @@ const tv = /* @__PURE__ */ Ae(() => {
|
|
|
5761
5763
|
"data-index": $,
|
|
5762
5764
|
"data-item-index": A.index,
|
|
5763
5765
|
"data-known-size": A.size,
|
|
5764
|
-
key:
|
|
5766
|
+
key: L,
|
|
5765
5767
|
style: ov
|
|
5766
5768
|
},
|
|
5767
5769
|
d(A.index, u)
|
|
@@ -5774,7 +5776,7 @@ const tv = /* @__PURE__ */ Ae(() => {
|
|
|
5774
5776
|
"data-item-group-index": A.groupIndex,
|
|
5775
5777
|
"data-item-index": A.index,
|
|
5776
5778
|
"data-known-size": A.size,
|
|
5777
|
-
key:
|
|
5779
|
+
key: L,
|
|
5778
5780
|
style: g ? sv : Tu
|
|
5779
5781
|
},
|
|
5780
5782
|
k ? c(A.index, A.groupIndex, A.data, u) : c(A.index, A.data, u)
|
|
@@ -5812,7 +5814,7 @@ function cv(e, t) {
|
|
|
5812
5814
|
return { item: typeof e == "string" ? void 0 : t };
|
|
5813
5815
|
}
|
|
5814
5816
|
const uv = /* @__PURE__ */ V.memo(function() {
|
|
5815
|
-
const e =
|
|
5817
|
+
const e = ve("HeaderComponent"), t = It("headerHeight"), n = ve("HeaderFooterTag"), r = On(
|
|
5816
5818
|
V.useMemo(
|
|
5817
5819
|
() => (s) => {
|
|
5818
5820
|
t(fn(s, "height"));
|
|
@@ -5820,11 +5822,11 @@ const uv = /* @__PURE__ */ V.memo(function() {
|
|
|
5820
5822
|
[t]
|
|
5821
5823
|
),
|
|
5822
5824
|
!0,
|
|
5823
|
-
|
|
5824
|
-
), o =
|
|
5825
|
+
ve("skipAnimationFrameInResizeObserver")
|
|
5826
|
+
), o = ve("context");
|
|
5825
5827
|
return e ? /* @__PURE__ */ l.jsx(n, { ref: r, children: /* @__PURE__ */ l.jsx(e, { ...lt(e, o) }) }) : null;
|
|
5826
5828
|
}), dv = /* @__PURE__ */ V.memo(function() {
|
|
5827
|
-
const e =
|
|
5829
|
+
const e = ve("FooterComponent"), t = It("footerHeight"), n = ve("HeaderFooterTag"), r = On(
|
|
5828
5830
|
V.useMemo(
|
|
5829
5831
|
() => (s) => {
|
|
5830
5832
|
t(fn(s, "height"));
|
|
@@ -5832,8 +5834,8 @@ const uv = /* @__PURE__ */ V.memo(function() {
|
|
|
5832
5834
|
[t]
|
|
5833
5835
|
),
|
|
5834
5836
|
!0,
|
|
5835
|
-
|
|
5836
|
-
), o =
|
|
5837
|
+
ve("skipAnimationFrameInResizeObserver")
|
|
5838
|
+
), o = ve("context");
|
|
5837
5839
|
return e ? /* @__PURE__ */ l.jsx(n, { ref: r, children: /* @__PURE__ */ l.jsx(e, { ...lt(e, o) }) }) : null;
|
|
5838
5840
|
});
|
|
5839
5841
|
function Ru({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
@@ -5889,27 +5891,27 @@ function Eu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
5889
5891
|
});
|
|
5890
5892
|
}
|
|
5891
5893
|
const fv = ({ children: e }) => {
|
|
5892
|
-
const t = V.useContext(wu), n = It("viewportHeight"), r = It("fixedItemHeight"), o =
|
|
5894
|
+
const t = V.useContext(wu), n = It("viewportHeight"), r = It("fixedItemHeight"), o = ve("alignToBottom"), s = ve("horizontalDirection"), i = V.useMemo(
|
|
5893
5895
|
() => Jc(n, (c) => fn(c, s ? "width" : "height")),
|
|
5894
5896
|
[n, s]
|
|
5895
|
-
), a = On(i, !0,
|
|
5897
|
+
), a = On(i, !0, ve("skipAnimationFrameInResizeObserver"));
|
|
5896
5898
|
return V.useEffect(() => {
|
|
5897
5899
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
5898
5900
|
}, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "element", ref: a, style: ns(o), children: e });
|
|
5899
5901
|
}, hv = ({ children: e }) => {
|
|
5900
|
-
const t = V.useContext(wu), n = It("windowViewportRect"), r = It("fixedItemHeight"), o =
|
|
5902
|
+
const t = V.useContext(wu), n = It("windowViewportRect"), r = It("fixedItemHeight"), o = ve("customScrollParent"), s = Qc(
|
|
5901
5903
|
n,
|
|
5902
5904
|
o,
|
|
5903
|
-
|
|
5904
|
-
), i =
|
|
5905
|
+
ve("skipAnimationFrameInResizeObserver")
|
|
5906
|
+
), i = ve("alignToBottom");
|
|
5905
5907
|
return V.useEffect(() => {
|
|
5906
5908
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
5907
5909
|
}, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "window", ref: s, style: ns(i), children: e });
|
|
5908
5910
|
}, pv = ({ children: e }) => {
|
|
5909
|
-
const t =
|
|
5911
|
+
const t = ve("TopItemListComponent") || "div", n = ve("headerHeight"), r = { ...lv, marginTop: `${n}px` }, o = ve("context");
|
|
5910
5912
|
return /* @__PURE__ */ l.jsx(t, { style: r, ...lt(t, o), children: e });
|
|
5911
5913
|
}, mv = /* @__PURE__ */ V.memo(function(e) {
|
|
5912
|
-
const t =
|
|
5914
|
+
const t = ve("useWindowScroll"), n = ve("topItemsIndexes").length > 0, r = ve("customScrollParent"), o = ve("context");
|
|
5913
5915
|
return /* @__PURE__ */ l.jsxs(r || t ? vv : xv, { ...e, context: o, children: [
|
|
5914
5916
|
n && /* @__PURE__ */ l.jsx(pv, { children: /* @__PURE__ */ l.jsx(jl, { showTopList: !0 }) }),
|
|
5915
5917
|
/* @__PURE__ */ l.jsxs(r || t ? hv : fv, { children: [
|
|
@@ -5921,7 +5923,7 @@ const fv = ({ children: e }) => {
|
|
|
5921
5923
|
}), {
|
|
5922
5924
|
Component: gv,
|
|
5923
5925
|
useEmitter: ta,
|
|
5924
|
-
useEmitterValue:
|
|
5926
|
+
useEmitterValue: ve,
|
|
5925
5927
|
usePublisher: It
|
|
5926
5928
|
} = /* @__PURE__ */ bu(
|
|
5927
5929
|
nv,
|
|
@@ -5982,7 +5984,7 @@ const fv = ({ children: e }) => {
|
|
|
5982
5984
|
}
|
|
5983
5985
|
},
|
|
5984
5986
|
mv
|
|
5985
|
-
), xv = /* @__PURE__ */ Ru({ useEmitter: ta, useEmitterValue:
|
|
5987
|
+
), xv = /* @__PURE__ */ Ru({ useEmitter: ta, useEmitterValue: ve, usePublisher: It }), vv = /* @__PURE__ */ Eu({ useEmitter: ta, useEmitterValue: ve, usePublisher: It }), bv = gv, wv = /* @__PURE__ */ Ae(() => {
|
|
5986
5988
|
const e = W((u) => /* @__PURE__ */ l.jsxs("td", { children: [
|
|
5987
5989
|
"Item $",
|
|
5988
5990
|
u
|
|
@@ -6062,108 +6064,108 @@ const Tv = /* @__PURE__ */ Ae(
|
|
|
6062
6064
|
{ customScrollParent: p, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: y, windowViewportRect: R },
|
|
6063
6065
|
S
|
|
6064
6066
|
]) => {
|
|
6065
|
-
const T = W(0), C = W(0), N = W(Al), I = W({ height: 0, width: 0 }), k = W({ height: 0, width: 0 }), D = Ee(), H = Ee(), U = W(0), A = W(null), $ = W({ column: 0, row: 0 }),
|
|
6067
|
+
const T = W(0), C = W(0), N = W(Al), I = W({ height: 0, width: 0 }), k = W({ height: 0, width: 0 }), D = Ee(), H = Ee(), U = W(0), A = W(null), $ = W({ column: 0, row: 0 }), L = Ee(), Z = Ee(), _ = W(!1), O = W(0), G = W(!0), Q = W(!1), J = W(!1);
|
|
6066
6068
|
_e(
|
|
6067
6069
|
B(
|
|
6068
6070
|
x,
|
|
6069
|
-
Ce(
|
|
6070
|
-
|
|
6071
|
+
Ce(O),
|
|
6072
|
+
me(([P, q]) => !!q)
|
|
6071
6073
|
),
|
|
6072
6074
|
() => {
|
|
6073
|
-
|
|
6075
|
+
we(G, !1);
|
|
6074
6076
|
}
|
|
6075
6077
|
), _e(
|
|
6076
6078
|
B(
|
|
6077
|
-
nt(x,
|
|
6078
|
-
|
|
6079
|
+
nt(x, G, k, I, O, Q),
|
|
6080
|
+
me(([P, q, ee, ce, , oe]) => P && !q && ee.height !== 0 && ce.height !== 0 && !oe)
|
|
6079
6081
|
),
|
|
6080
|
-
([, , , ,
|
|
6081
|
-
|
|
6082
|
-
|
|
6082
|
+
([, , , , P]) => {
|
|
6083
|
+
we(Q, !0), qi(1, () => {
|
|
6084
|
+
we(D, P);
|
|
6083
6085
|
}), Mt(B(u), () => {
|
|
6084
|
-
|
|
6086
|
+
we(t, [0, 0]), we(G, !0);
|
|
6085
6087
|
});
|
|
6086
6088
|
}
|
|
6087
6089
|
), le(
|
|
6088
6090
|
B(
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
+
Z,
|
|
6092
|
+
me((P) => P != null && P.scrollTop > 0),
|
|
6091
6093
|
Vt(0)
|
|
6092
6094
|
),
|
|
6093
6095
|
C
|
|
6094
6096
|
), _e(
|
|
6095
6097
|
B(
|
|
6096
6098
|
x,
|
|
6097
|
-
Ce(
|
|
6098
|
-
|
|
6099
|
+
Ce(Z),
|
|
6100
|
+
me(([, P]) => P != null)
|
|
6099
6101
|
),
|
|
6100
|
-
([,
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
}),
|
|
6102
|
+
([, P]) => {
|
|
6103
|
+
P && (we(I, P.viewport), we(k, P.item), we($, P.gap), P.scrollTop > 0 && (we(_, !0), Mt(B(u, jn(1)), (q) => {
|
|
6104
|
+
we(_, !1);
|
|
6105
|
+
}), we(c, { top: P.scrollTop })));
|
|
6104
6106
|
}
|
|
6105
6107
|
), le(
|
|
6106
6108
|
B(
|
|
6107
6109
|
I,
|
|
6108
|
-
re(({ height:
|
|
6110
|
+
re(({ height: P }) => P)
|
|
6109
6111
|
),
|
|
6110
6112
|
h
|
|
6111
6113
|
), le(
|
|
6112
6114
|
B(
|
|
6113
6115
|
nt(
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6116
|
+
he(I, eo),
|
|
6117
|
+
he(k, eo),
|
|
6118
|
+
he($, (P, q) => P && P.column === q.column && P.row === q.row),
|
|
6119
|
+
he(u)
|
|
6118
6120
|
),
|
|
6119
|
-
re(([
|
|
6121
|
+
re(([P, q, ee, ce]) => ({
|
|
6120
6122
|
gap: ee,
|
|
6121
|
-
item:
|
|
6123
|
+
item: q,
|
|
6122
6124
|
scrollTop: ce,
|
|
6123
|
-
viewport:
|
|
6125
|
+
viewport: P
|
|
6124
6126
|
}))
|
|
6125
6127
|
),
|
|
6126
|
-
|
|
6128
|
+
L
|
|
6127
6129
|
), le(
|
|
6128
6130
|
B(
|
|
6129
6131
|
nt(
|
|
6130
|
-
|
|
6132
|
+
he(T),
|
|
6131
6133
|
r,
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6134
|
+
he($, Cv),
|
|
6135
|
+
he(k, eo),
|
|
6136
|
+
he(I, eo),
|
|
6137
|
+
he(A),
|
|
6138
|
+
he(C),
|
|
6139
|
+
he(_),
|
|
6140
|
+
he(G),
|
|
6141
|
+
he(O)
|
|
6140
6142
|
),
|
|
6141
|
-
|
|
6143
|
+
me(([, , , , , , , P]) => !P),
|
|
6142
6144
|
re(
|
|
6143
6145
|
([
|
|
6144
|
-
|
|
6145
|
-
[
|
|
6146
|
+
P,
|
|
6147
|
+
[q, ee],
|
|
6146
6148
|
ce,
|
|
6147
6149
|
oe,
|
|
6148
6150
|
Ie,
|
|
6149
6151
|
Me,
|
|
6150
6152
|
De,
|
|
6151
6153
|
,
|
|
6152
|
-
|
|
6154
|
+
fe,
|
|
6153
6155
|
Oe
|
|
6154
6156
|
]) => {
|
|
6155
|
-
const { column:
|
|
6156
|
-
if (De === 0 && (
|
|
6157
|
+
const { column: pe, row: Se } = ce, { height: mt, width: X } = oe, { width: ie } = Ie;
|
|
6158
|
+
if (De === 0 && (P === 0 || ie === 0))
|
|
6157
6159
|
return Al;
|
|
6158
|
-
if (
|
|
6159
|
-
const et = Xi(Oe,
|
|
6160
|
+
if (X === 0) {
|
|
6161
|
+
const et = Xi(Oe, P), dt = et + Math.max(De - 1, 0);
|
|
6160
6162
|
return Sv(_l(et, dt, Me));
|
|
6161
6163
|
}
|
|
6162
|
-
const Le = Nu(ie,
|
|
6164
|
+
const Le = Nu(ie, X, pe);
|
|
6163
6165
|
let Ve, Ze;
|
|
6164
|
-
|
|
6165
|
-
const ut = _l(Ve, Ze, Me), { bottom: gt, top: Ut } = Ol(Ie, ce, oe, ut), Qe = kl(
|
|
6166
|
-
return { bottom: gt, itemHeight: mt, items: ut, itemWidth:
|
|
6166
|
+
fe ? q === 0 && ee === 0 && De > 0 ? (Ve = 0, Ze = De - 1) : (Ve = Le * Oo((q + Se) / (mt + Se)), Ze = Le * kl((ee + Se) / (mt + Se)) - 1, Ze = $s(P - 1, Sr(Ze, Le - 1)), Ve = $s(Ze, Sr(0, Ve))) : (Ve = 0, Ze = -1);
|
|
6167
|
+
const ut = _l(Ve, Ze, Me), { bottom: gt, top: Ut } = Ol(Ie, ce, oe, ut), Qe = kl(P / Le), it = Qe * mt + (Qe - 1) * Se - gt;
|
|
6168
|
+
return { bottom: gt, itemHeight: mt, items: ut, itemWidth: X, offsetBottom: it, offsetTop: Ut, top: Ut };
|
|
6167
6169
|
}
|
|
6168
6170
|
)
|
|
6169
6171
|
),
|
|
@@ -6171,88 +6173,88 @@ const Tv = /* @__PURE__ */ Ae(
|
|
|
6171
6173
|
), le(
|
|
6172
6174
|
B(
|
|
6173
6175
|
A,
|
|
6174
|
-
|
|
6175
|
-
re((
|
|
6176
|
+
me((P) => P !== null),
|
|
6177
|
+
re((P) => P.length)
|
|
6176
6178
|
),
|
|
6177
6179
|
T
|
|
6178
6180
|
), le(
|
|
6179
6181
|
B(
|
|
6180
6182
|
nt(I, k, N, $),
|
|
6181
|
-
|
|
6182
|
-
re(([
|
|
6183
|
-
const { bottom: oe, top: Ie } = Ol(
|
|
6183
|
+
me(([P, q, { items: ee }]) => ee.length > 0 && q.height !== 0 && P.height !== 0),
|
|
6184
|
+
re(([P, q, { items: ee }, ce]) => {
|
|
6185
|
+
const { bottom: oe, top: Ie } = Ol(P, ce, q, ee);
|
|
6184
6186
|
return [Ie, oe];
|
|
6185
6187
|
}),
|
|
6186
6188
|
ze(jr)
|
|
6187
6189
|
),
|
|
6188
6190
|
t
|
|
6189
6191
|
);
|
|
6190
|
-
const
|
|
6192
|
+
const F = W(!1);
|
|
6191
6193
|
le(
|
|
6192
6194
|
B(
|
|
6193
6195
|
u,
|
|
6194
|
-
Ce(
|
|
6195
|
-
re(([
|
|
6196
|
+
Ce(F),
|
|
6197
|
+
re(([P, q]) => q || P !== 0)
|
|
6196
6198
|
),
|
|
6197
|
-
|
|
6199
|
+
F
|
|
6198
6200
|
);
|
|
6199
6201
|
const K = Ct(
|
|
6200
6202
|
B(
|
|
6201
6203
|
nt(N, T),
|
|
6202
|
-
|
|
6203
|
-
Ce(
|
|
6204
|
-
|
|
6205
|
-
const ce =
|
|
6206
|
-
return (ee ||
|
|
6204
|
+
me(([{ items: P }]) => P.length > 0),
|
|
6205
|
+
Ce(F),
|
|
6206
|
+
me(([[P, q], ee]) => {
|
|
6207
|
+
const ce = P.items[P.items.length - 1].index === q - 1;
|
|
6208
|
+
return (ee || P.bottom > 0 && P.itemHeight > 0 && P.offsetBottom === 0 && P.items.length === q) && ce;
|
|
6207
6209
|
}),
|
|
6208
|
-
re(([[,
|
|
6210
|
+
re(([[, P]]) => P - 1),
|
|
6209
6211
|
ze()
|
|
6210
6212
|
)
|
|
6211
|
-
),
|
|
6213
|
+
), ye = Ct(
|
|
6212
6214
|
B(
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
+
he(N),
|
|
6216
|
+
me(({ items: P }) => P.length > 0 && P[0].index === 0),
|
|
6215
6217
|
Vt(0),
|
|
6216
6218
|
ze()
|
|
6217
6219
|
)
|
|
6218
|
-
),
|
|
6220
|
+
), ue = Ct(
|
|
6219
6221
|
B(
|
|
6220
|
-
|
|
6222
|
+
he(N),
|
|
6221
6223
|
Ce(_),
|
|
6222
|
-
|
|
6223
|
-
re(([{ items:
|
|
6224
|
-
endIndex:
|
|
6225
|
-
startIndex:
|
|
6224
|
+
me(([{ items: P }, q]) => P.length > 0 && !q),
|
|
6225
|
+
re(([{ items: P }]) => ({
|
|
6226
|
+
endIndex: P[P.length - 1].index,
|
|
6227
|
+
startIndex: P[0].index
|
|
6226
6228
|
})),
|
|
6227
6229
|
ze(su),
|
|
6228
6230
|
rn(0)
|
|
6229
6231
|
)
|
|
6230
6232
|
);
|
|
6231
|
-
le(
|
|
6233
|
+
le(ue, v.scrollSeekRangeChanged), le(
|
|
6232
6234
|
B(
|
|
6233
6235
|
D,
|
|
6234
6236
|
Ce(I, k, T, $),
|
|
6235
|
-
re(([
|
|
6236
|
-
const Ie = uu(
|
|
6237
|
+
re(([P, q, ee, ce, oe]) => {
|
|
6238
|
+
const Ie = uu(P), { align: Me, behavior: De, offset: fe } = Ie;
|
|
6237
6239
|
let Oe = Ie.index;
|
|
6238
6240
|
Oe === "LAST" && (Oe = ce - 1), Oe = Sr(0, Oe, $s(ce - 1, Oe));
|
|
6239
|
-
let
|
|
6240
|
-
return Me === "end" ?
|
|
6241
|
+
let pe = vi(q, oe, ee, Oe);
|
|
6242
|
+
return Me === "end" ? pe = Pl(pe - q.height + ee.height) : Me === "center" && (pe = Pl(pe - q.height / 2 + ee.height / 2)), fe && (pe += fe), { behavior: De, top: pe };
|
|
6241
6243
|
})
|
|
6242
6244
|
),
|
|
6243
6245
|
c
|
|
6244
6246
|
);
|
|
6245
|
-
const
|
|
6247
|
+
const Y = ct(
|
|
6246
6248
|
B(
|
|
6247
6249
|
N,
|
|
6248
|
-
re((
|
|
6250
|
+
re((P) => P.offsetBottom + P.bottom)
|
|
6249
6251
|
),
|
|
6250
6252
|
0
|
|
6251
6253
|
);
|
|
6252
6254
|
return le(
|
|
6253
6255
|
B(
|
|
6254
6256
|
R,
|
|
6255
|
-
re((
|
|
6257
|
+
re((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
|
|
6256
6258
|
),
|
|
6257
6259
|
I
|
|
6258
6260
|
), {
|
|
@@ -6267,7 +6269,7 @@ const Tv = /* @__PURE__ */ Ae(
|
|
|
6267
6269
|
initialItemCount: C,
|
|
6268
6270
|
itemDimensions: k,
|
|
6269
6271
|
overscan: n,
|
|
6270
|
-
restoreStateFrom:
|
|
6272
|
+
restoreStateFrom: Z,
|
|
6271
6273
|
scrollBy: i,
|
|
6272
6274
|
scrollContainerState: a,
|
|
6273
6275
|
scrollHeight: H,
|
|
@@ -6284,15 +6286,15 @@ const Tv = /* @__PURE__ */ Ae(
|
|
|
6284
6286
|
...v,
|
|
6285
6287
|
// output
|
|
6286
6288
|
gridState: N,
|
|
6287
|
-
horizontalDirection:
|
|
6288
|
-
initialTopMostItemIndex:
|
|
6289
|
-
totalListHeight:
|
|
6289
|
+
horizontalDirection: J,
|
|
6290
|
+
initialTopMostItemIndex: O,
|
|
6291
|
+
totalListHeight: Y,
|
|
6290
6292
|
...m,
|
|
6291
6293
|
endReached: K,
|
|
6292
6294
|
propsReady: g,
|
|
6293
|
-
rangeChanged:
|
|
6294
|
-
startReached:
|
|
6295
|
-
stateChanged:
|
|
6295
|
+
rangeChanged: ue,
|
|
6296
|
+
startReached: ye,
|
|
6297
|
+
stateChanged: L,
|
|
6296
6298
|
stateRestoreInProgress: _,
|
|
6297
6299
|
...S
|
|
6298
6300
|
};
|
|
@@ -6322,7 +6324,7 @@ const Rv = /* @__PURE__ */ Ae(() => {
|
|
|
6322
6324
|
),
|
|
6323
6325
|
m
|
|
6324
6326
|
), u = W(!1), d = W(!1);
|
|
6325
|
-
return le(
|
|
6327
|
+
return le(he(d), u), {
|
|
6326
6328
|
components: t,
|
|
6327
6329
|
computeItemKey: s,
|
|
6328
6330
|
context: n,
|
|
@@ -6678,7 +6680,7 @@ var Hv = [
|
|
|
6678
6680
|
"span",
|
|
6679
6681
|
"svg",
|
|
6680
6682
|
"ul"
|
|
6681
|
-
],
|
|
6683
|
+
], ge = Hv.reduce((e, t) => {
|
|
6682
6684
|
const n = Zn(`Primitive.${t}`), r = f.forwardRef((o, s) => {
|
|
6683
6685
|
const { asChild: i, ...a } = o, c = i ? n : t;
|
|
6684
6686
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l.jsx(c, { ...a, ref: s });
|
|
@@ -6785,7 +6787,7 @@ var rs = "Collapsible", [Kv, cR] = Ht(rs), [Yv, ra] = Kv(rs), ku = f.forwardRef(
|
|
|
6785
6787
|
open: c,
|
|
6786
6788
|
onOpenToggle: f.useCallback(() => u((d) => !d), [u]),
|
|
6787
6789
|
children: /* @__PURE__ */ l.jsx(
|
|
6788
|
-
|
|
6790
|
+
ge.div,
|
|
6789
6791
|
{
|
|
6790
6792
|
"data-state": sa(c),
|
|
6791
6793
|
"data-disabled": s ? "" : void 0,
|
|
@@ -6802,7 +6804,7 @@ var Pu = "CollapsibleTrigger", _u = f.forwardRef(
|
|
|
6802
6804
|
(e, t) => {
|
|
6803
6805
|
const { __scopeCollapsible: n, ...r } = e, o = ra(Pu, n);
|
|
6804
6806
|
return /* @__PURE__ */ l.jsx(
|
|
6805
|
-
|
|
6807
|
+
ge.button,
|
|
6806
6808
|
{
|
|
6807
6809
|
type: "button",
|
|
6808
6810
|
"aria-controls": o.contentId,
|
|
@@ -6841,7 +6843,7 @@ var Xv = f.forwardRef((e, t) => {
|
|
|
6841
6843
|
h.current = y.height, v.current = y.width, p.current || (w.style.transitionDuration = b.current.transitionDuration, w.style.animationName = b.current.animationName), c(r);
|
|
6842
6844
|
}
|
|
6843
6845
|
}, [i.open, r]), /* @__PURE__ */ l.jsx(
|
|
6844
|
-
|
|
6846
|
+
ge.div,
|
|
6845
6847
|
{
|
|
6846
6848
|
"data-state": sa(i.open),
|
|
6847
6849
|
"data-disabled": i.disabled ? "" : void 0,
|
|
@@ -7004,7 +7006,7 @@ function sb(e, t = !1) {
|
|
|
7004
7006
|
return `${e.length}:${n}:${r}`;
|
|
7005
7007
|
}
|
|
7006
7008
|
function ib(e, t) {
|
|
7007
|
-
const [n, r] =
|
|
7009
|
+
const [n, r] = de(e), o = Ye(e), s = Ye(null);
|
|
7008
7010
|
return He(() => {
|
|
7009
7011
|
if (!t) {
|
|
7010
7012
|
r(e);
|
|
@@ -7025,7 +7027,7 @@ function zs({
|
|
|
7025
7027
|
hideFallbackDuringStreaming: o = !0,
|
|
7026
7028
|
streamingThrottleMs: s = 36
|
|
7027
7029
|
}) {
|
|
7028
|
-
const i = ib(e, r), a = sb(i, r), [c, u] =
|
|
7030
|
+
const i = ib(e, r), a = sb(i, r), [c, u] = de(() => {
|
|
7029
7031
|
var v;
|
|
7030
7032
|
return ((v = xr.get(a)) == null ? void 0 : v.html) ?? null;
|
|
7031
7033
|
}), d = Ye(null), h = Ye([]);
|
|
@@ -7318,7 +7320,7 @@ var pb = "DismissableLayer", wi = "dismissableLayer.update", mb = "dismissableLa
|
|
|
7318
7320
|
const C = () => v({});
|
|
7319
7321
|
return document.addEventListener(wi, C), () => document.removeEventListener(wi, C);
|
|
7320
7322
|
}, []), /* @__PURE__ */ l.jsx(
|
|
7321
|
-
|
|
7323
|
+
ge.div,
|
|
7322
7324
|
{
|
|
7323
7325
|
...c,
|
|
7324
7326
|
ref: x,
|
|
@@ -7345,7 +7347,7 @@ var xb = "DismissableLayerBranch", vb = f.forwardRef((e, t) => {
|
|
|
7345
7347
|
return n.branches.add(s), () => {
|
|
7346
7348
|
n.branches.delete(s);
|
|
7347
7349
|
};
|
|
7348
|
-
}, [n.branches]), /* @__PURE__ */ l.jsx(
|
|
7350
|
+
}, [n.branches]), /* @__PURE__ */ l.jsx(ge.div, { ...e, ref: o });
|
|
7349
7351
|
});
|
|
7350
7352
|
vb.displayName = xb;
|
|
7351
7353
|
function bb(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -7464,7 +7466,7 @@ var Vs = "focusScope.autoFocusOnMount", Gs = "focusScope.autoFocusOnUnmount", Vl
|
|
|
7464
7466
|
},
|
|
7465
7467
|
[n, r, v.paused]
|
|
7466
7468
|
);
|
|
7467
|
-
return /* @__PURE__ */ l.jsx(
|
|
7469
|
+
return /* @__PURE__ */ l.jsx(ge.div, { tabIndex: -1, ...i, ref: m, onKeyDown: x });
|
|
7468
7470
|
});
|
|
7469
7471
|
ss.displayName = yb;
|
|
7470
7472
|
function Sb(e, { select: t = !1 } = {}) {
|
|
@@ -7534,7 +7536,7 @@ var Ib = "Portal", is = f.forwardRef((e, t) => {
|
|
|
7534
7536
|
const { container: n, ...r } = e, [o, s] = f.useState(!1);
|
|
7535
7537
|
ot(() => s(!0), []);
|
|
7536
7538
|
const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
7537
|
-
return i ? Cc.createPortal(/* @__PURE__ */ l.jsx(
|
|
7539
|
+
return i ? Cc.createPortal(/* @__PURE__ */ l.jsx(ge.div, { ...r, ref: t }), i) : null;
|
|
7538
7540
|
});
|
|
7539
7541
|
is.displayName = Ib;
|
|
7540
7542
|
var Ks = 0;
|
|
@@ -7577,7 +7579,7 @@ function Ys(e, t) {
|
|
|
7577
7579
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
7578
7580
|
}
|
|
7579
7581
|
function Pb(e, t) {
|
|
7580
|
-
var n =
|
|
7582
|
+
var n = de(function() {
|
|
7581
7583
|
return {
|
|
7582
7584
|
// value
|
|
7583
7585
|
value: e,
|
|
@@ -8106,7 +8108,7 @@ var Xu = "DialogTrigger", Ju = f.forwardRef(
|
|
|
8106
8108
|
(e, t) => {
|
|
8107
8109
|
const { __scopeDialog: n, ...r } = e, o = zt(Xu, n), s = Te(t, o.triggerRef);
|
|
8108
8110
|
return /* @__PURE__ */ l.jsx(
|
|
8109
|
-
|
|
8111
|
+
ge.button,
|
|
8110
8112
|
{
|
|
8111
8113
|
type: "button",
|
|
8112
8114
|
"aria-haspopup": "dialog",
|
|
@@ -8142,7 +8144,7 @@ var gw = Zn("DialogOverlay.RemoveScroll"), xw = f.forwardRef(
|
|
|
8142
8144
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
8143
8145
|
// ie. when `Overlay` and `Content` are siblings
|
|
8144
8146
|
/* @__PURE__ */ l.jsx(ls, { as: gw, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ l.jsx(
|
|
8145
|
-
|
|
8147
|
+
ge.div,
|
|
8146
8148
|
{
|
|
8147
8149
|
"data-state": fa(o.open),
|
|
8148
8150
|
...r,
|
|
@@ -8246,14 +8248,14 @@ var vw = f.forwardRef(
|
|
|
8246
8248
|
), da = "DialogTitle", rd = f.forwardRef(
|
|
8247
8249
|
(e, t) => {
|
|
8248
8250
|
const { __scopeDialog: n, ...r } = e, o = zt(da, n);
|
|
8249
|
-
return /* @__PURE__ */ l.jsx(
|
|
8251
|
+
return /* @__PURE__ */ l.jsx(ge.h2, { id: o.titleId, ...r, ref: t });
|
|
8250
8252
|
}
|
|
8251
8253
|
);
|
|
8252
8254
|
rd.displayName = da;
|
|
8253
8255
|
var od = "DialogDescription", sd = f.forwardRef(
|
|
8254
8256
|
(e, t) => {
|
|
8255
8257
|
const { __scopeDialog: n, ...r } = e, o = zt(od, n);
|
|
8256
|
-
return /* @__PURE__ */ l.jsx(
|
|
8258
|
+
return /* @__PURE__ */ l.jsx(ge.p, { id: o.descriptionId, ...r, ref: t });
|
|
8257
8259
|
}
|
|
8258
8260
|
);
|
|
8259
8261
|
sd.displayName = od;
|
|
@@ -8261,7 +8263,7 @@ var id = "DialogClose", ad = f.forwardRef(
|
|
|
8261
8263
|
(e, t) => {
|
|
8262
8264
|
const { __scopeDialog: n, ...r } = e, o = zt(id, n);
|
|
8263
8265
|
return /* @__PURE__ */ l.jsx(
|
|
8264
|
-
|
|
8266
|
+
ge.button,
|
|
8265
8267
|
{
|
|
8266
8268
|
type: "button",
|
|
8267
8269
|
...r,
|
|
@@ -8384,7 +8386,7 @@ const Ew = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
|
|
|
8384
8386
|
));
|
|
8385
8387
|
Ew.displayName = fs.displayName;
|
|
8386
8388
|
function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
8387
|
-
const [s, i] =
|
|
8389
|
+
const [s, i] = de(!1), [a, c] = de(null), [u, d] = de(null), { toast: h } = aa();
|
|
8388
8390
|
He(() => {
|
|
8389
8391
|
e && n && m();
|
|
8390
8392
|
}, [e, n]);
|
|
@@ -8493,7 +8495,7 @@ function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
8493
8495
|
}
|
|
8494
8496
|
const yo = "prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";
|
|
8495
8497
|
function Iw({ className: e }) {
|
|
8496
|
-
const [t, n] =
|
|
8498
|
+
const [t, n] = de(0);
|
|
8497
8499
|
return He(() => {
|
|
8498
8500
|
const r = setInterval(() => n((o) => (o + 1) % 4), 500);
|
|
8499
8501
|
return () => clearInterval(r);
|
|
@@ -8529,10 +8531,10 @@ const jw = V.memo(function({
|
|
|
8529
8531
|
onCancelEdit: b,
|
|
8530
8532
|
onCopy: w
|
|
8531
8533
|
}) {
|
|
8532
|
-
const [y, R] =
|
|
8534
|
+
const [y, R] = de(!1), [S, T] = de(!1), [C, N] = de(!1), [I, k] = de(!1), { currentThreadId: D } = Ui();
|
|
8533
8535
|
aa();
|
|
8534
|
-
const [H, U] =
|
|
8535
|
-
switch (
|
|
8536
|
+
const [H, U] = de({}), [A, $] = de(!1), [L, Z] = de(null), _ = u === "phone" || u === "half-screen", O = t.role, G = O === "tool", Q = V.useMemo(() => {
|
|
8537
|
+
switch (O) {
|
|
8536
8538
|
case "user":
|
|
8537
8539
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
8538
8540
|
case "assistant":
|
|
@@ -8544,20 +8546,20 @@ const jw = V.memo(function({
|
|
|
8544
8546
|
default:
|
|
8545
8547
|
return "text-[hsl(var(--chat-bubble-ai-text))]";
|
|
8546
8548
|
}
|
|
8547
|
-
}, [
|
|
8549
|
+
}, [O]), J = un(() => Aw(t.content), [t.content]), F = un(() => Mw(t.content), [t.content]), K = un(() => t.content.filter((fe) => fe.type === "image_url"), [t.content]), ye = un(() => t.content.filter((fe) => fe.type === "file"), [t.content]), ue = Lw(J, r), Y = async () => {
|
|
8548
8550
|
try {
|
|
8549
|
-
const
|
|
8550
|
-
await navigator.clipboard.writeText(
|
|
8551
|
-
} catch (
|
|
8552
|
-
console.error("Failed to copy:",
|
|
8551
|
+
const fe = G ? Vn(t.content) : J;
|
|
8552
|
+
await navigator.clipboard.writeText(fe), R(!0), setTimeout(() => R(!1), 2e3), w == null || w(fe);
|
|
8553
|
+
} catch (fe) {
|
|
8554
|
+
console.error("Failed to copy:", fe);
|
|
8553
8555
|
}
|
|
8554
|
-
},
|
|
8556
|
+
}, P = () => {
|
|
8555
8557
|
if (!g) return;
|
|
8556
|
-
const
|
|
8557
|
-
g(t.id,
|
|
8558
|
-
},
|
|
8559
|
-
const Oe = M(_ ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0",
|
|
8560
|
-
switch (
|
|
8558
|
+
const fe = G ? Vn(t.content) : J;
|
|
8559
|
+
g(t.id, fe);
|
|
8560
|
+
}, q = () => p == null ? void 0 : p(n), ee = () => {
|
|
8561
|
+
const Oe = M(_ ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Q);
|
|
8562
|
+
switch (O) {
|
|
8561
8563
|
case "user":
|
|
8562
8564
|
return /* @__PURE__ */ l.jsx(Wp, { className: Oe });
|
|
8563
8565
|
case "assistant":
|
|
@@ -8568,103 +8570,103 @@ const jw = V.memo(function({
|
|
|
8568
8570
|
return /* @__PURE__ */ l.jsx(Ka, { className: Oe });
|
|
8569
8571
|
}
|
|
8570
8572
|
}, ce = () => {
|
|
8571
|
-
const
|
|
8572
|
-
switch (
|
|
8573
|
+
const fe = "group relative mb-4 flex w-full";
|
|
8574
|
+
switch (O) {
|
|
8573
8575
|
case "user":
|
|
8574
|
-
return M(
|
|
8576
|
+
return M(fe, "justify-end");
|
|
8575
8577
|
case "assistant":
|
|
8576
8578
|
case "tool":
|
|
8577
8579
|
case "system":
|
|
8578
|
-
return M(
|
|
8580
|
+
return M(fe, "justify-start");
|
|
8579
8581
|
default:
|
|
8580
|
-
return
|
|
8582
|
+
return fe;
|
|
8581
8583
|
}
|
|
8582
8584
|
}, oe = () => {
|
|
8583
|
-
const
|
|
8585
|
+
const fe = M(
|
|
8584
8586
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
8585
8587
|
_ && "px-3 py-2 text-sm"
|
|
8586
8588
|
);
|
|
8587
|
-
switch (
|
|
8589
|
+
switch (O) {
|
|
8588
8590
|
case "user":
|
|
8589
8591
|
return M(
|
|
8590
|
-
|
|
8592
|
+
fe,
|
|
8591
8593
|
"w-full md:max-w-[95%]",
|
|
8592
8594
|
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
8593
8595
|
"border border-transparent"
|
|
8594
8596
|
);
|
|
8595
8597
|
case "assistant":
|
|
8596
8598
|
return M(
|
|
8597
|
-
|
|
8599
|
+
fe,
|
|
8598
8600
|
"w-full md:max-w-[95%]",
|
|
8599
8601
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
8600
8602
|
"border border-border/60 dark:border-border/40"
|
|
8601
8603
|
);
|
|
8602
8604
|
case "tool":
|
|
8603
|
-
return M(
|
|
8605
|
+
return M(fe, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
|
|
8604
8606
|
case "system":
|
|
8605
|
-
return M(
|
|
8607
|
+
return M(fe, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
|
|
8606
8608
|
default:
|
|
8607
8609
|
return M(
|
|
8608
|
-
|
|
8610
|
+
fe,
|
|
8609
8611
|
"w-full md:max-w-[95%]",
|
|
8610
8612
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
8611
8613
|
"border border-border/60 dark:border-border/40"
|
|
8612
8614
|
);
|
|
8613
8615
|
}
|
|
8614
|
-
}, Ie = (
|
|
8615
|
-
if (!
|
|
8616
|
+
}, Ie = (fe) => {
|
|
8617
|
+
if (!fe) return "";
|
|
8616
8618
|
try {
|
|
8617
|
-
return new Date(
|
|
8619
|
+
return new Date(fe).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
8618
8620
|
} catch {
|
|
8619
8621
|
return "";
|
|
8620
8622
|
}
|
|
8621
8623
|
}, Me = () => {
|
|
8622
8624
|
if (t.model === "reflection") {
|
|
8623
|
-
const
|
|
8625
|
+
const pe = J.trim(), Se = Zs(pe);
|
|
8624
8626
|
if (Se && typeof Se == "object")
|
|
8625
8627
|
return /* @__PURE__ */ l.jsx(Fw, { data: Se });
|
|
8626
8628
|
}
|
|
8627
|
-
if (
|
|
8628
|
-
const
|
|
8629
|
+
if (G && F.name === "get_issues") {
|
|
8630
|
+
const pe = t.content.find((X) => X.type === "tool_result"), Se = (pe == null ? void 0 : pe.output) ?? Vn(t.content), mt = vd(Se);
|
|
8629
8631
|
if (mt) return /* @__PURE__ */ l.jsx(Bw, { issues: mt });
|
|
8630
8632
|
}
|
|
8631
|
-
if (
|
|
8632
|
-
const
|
|
8633
|
+
if (G && !C) {
|
|
8634
|
+
const pe = Vn(t.content).slice(0, 80).replace(/\s+/g, " ");
|
|
8633
8635
|
return /* @__PURE__ */ l.jsx("div", { className: M("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", _ && "text-[10px]"), children: /* @__PURE__ */ l.jsxs("span", { className: "truncate max-w-full text-current", children: [
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
+
pe,
|
|
8637
|
+
pe.length >= 80 ? "…" : ""
|
|
8636
8638
|
] }) });
|
|
8637
8639
|
}
|
|
8638
|
-
if (
|
|
8639
|
-
const
|
|
8640
|
+
if (G && d) {
|
|
8641
|
+
const pe = Vn(t.content), Se = pe.length > h;
|
|
8640
8642
|
return /* @__PURE__ */ l.jsx(Ll, { open: S, onOpenChange: T, children: /* @__PURE__ */ l.jsxs("div", { className: "font-mono text-sm text-current", children: [
|
|
8641
|
-
/* @__PURE__ */ l.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", _ && "text-xs"), children: Se && !S ?
|
|
8643
|
+
/* @__PURE__ */ l.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", _ && "text-xs"), children: Se && !S ? pe.substring(0, h) + "..." : pe }),
|
|
8642
8644
|
Se && /* @__PURE__ */ l.jsx(Fl, { asChild: !0, children: /* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: S ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
8643
8645
|
/* @__PURE__ */ l.jsx(vr, { className: "h-3 w-3 mr-1" }),
|
|
8644
8646
|
"Show less"
|
|
8645
8647
|
] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
8646
8648
|
/* @__PURE__ */ l.jsx(Gn, { className: "h-3 w-3 mr-1" }),
|
|
8647
8649
|
"Show more (",
|
|
8648
|
-
|
|
8650
|
+
pe.length - h,
|
|
8649
8651
|
" chars)"
|
|
8650
8652
|
] }) }) })
|
|
8651
8653
|
] }) });
|
|
8652
8654
|
}
|
|
8653
|
-
if (
|
|
8654
|
-
const
|
|
8655
|
-
if (
|
|
8656
|
-
return /* @__PURE__ */ l.jsx(zs, { content:
|
|
8655
|
+
if (G && C && !d) {
|
|
8656
|
+
const pe = $w(t.content);
|
|
8657
|
+
if (pe && kw(pe))
|
|
8658
|
+
return /* @__PURE__ */ l.jsx(zs, { content: pe.trim(), hideFallbackDuringStreaming: !0 });
|
|
8657
8659
|
const Se = Vn(t.content);
|
|
8658
8660
|
return /* @__PURE__ */ l.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ l.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", _ && "text-xs"), children: Se }) });
|
|
8659
8661
|
}
|
|
8660
|
-
const
|
|
8662
|
+
const fe = K.length > 0 && O !== "tool", Oe = ye.length > 0 && O !== "tool" && !1;
|
|
8661
8663
|
return /* @__PURE__ */ l.jsxs("div", { children: [
|
|
8662
8664
|
r ? /* @__PURE__ */ l.jsxs("div", { className: "relative", children: [
|
|
8663
8665
|
(() => {
|
|
8664
|
-
const
|
|
8665
|
-
if (
|
|
8666
|
-
return /* @__PURE__ */ l.jsx(tc, { data:
|
|
8667
|
-
const Se = _w(Pw(
|
|
8666
|
+
const pe = Zs(ue);
|
|
8667
|
+
if (pe !== null)
|
|
8668
|
+
return /* @__PURE__ */ l.jsx(tc, { data: pe });
|
|
8669
|
+
const Se = _w(Pw(ue));
|
|
8668
8670
|
return /* @__PURE__ */ l.jsx(
|
|
8669
8671
|
"pre",
|
|
8670
8672
|
{
|
|
@@ -8676,12 +8678,12 @@ const jw = V.memo(function({
|
|
|
8676
8678
|
}
|
|
8677
8679
|
);
|
|
8678
8680
|
})(),
|
|
8679
|
-
/* @__PURE__ */ l.jsx(Iw, { className: M(
|
|
8681
|
+
/* @__PURE__ */ l.jsx(Iw, { className: M(Q, _ ? "text-xs" : "text-sm") })
|
|
8680
8682
|
] }) : (() => {
|
|
8681
|
-
const
|
|
8682
|
-
if (
|
|
8683
|
-
if (
|
|
8684
|
-
const Se =
|
|
8683
|
+
const pe = Zs(J.trim());
|
|
8684
|
+
if (pe !== null) return /* @__PURE__ */ l.jsx(tc, { data: pe });
|
|
8685
|
+
if (O === "user" && m) {
|
|
8686
|
+
const Se = J.trim();
|
|
8685
8687
|
if (Se.length > v)
|
|
8686
8688
|
return /* @__PURE__ */ l.jsxs(Ll, { open: I, onOpenChange: k, children: [
|
|
8687
8689
|
/* @__PURE__ */ l.jsx("div", { className: M("text-sm text-[hsl(var(--chat-bubble-user-text))]", _ && "text-xs"), children: I ? /* @__PURE__ */ l.jsx(zs, { content: Se, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ l.jsxs("pre", { className: M("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", _ && "text-xs"), children: [
|
|
@@ -8710,15 +8712,15 @@ const jw = V.memo(function({
|
|
|
8710
8712
|
return /* @__PURE__ */ l.jsx(
|
|
8711
8713
|
zs,
|
|
8712
8714
|
{
|
|
8713
|
-
content:
|
|
8715
|
+
content: J.trim(),
|
|
8714
8716
|
isStreaming: r,
|
|
8715
8717
|
hideFallbackDuringStreaming: !0,
|
|
8716
8718
|
streamingThrottleMs: o
|
|
8717
8719
|
}
|
|
8718
8720
|
);
|
|
8719
8721
|
})(),
|
|
8720
|
-
|
|
8721
|
-
/* @__PURE__ */ l.jsx("img", { src:
|
|
8722
|
+
fe && /* @__PURE__ */ l.jsx("div", { className: "mt-2 grid grid-cols-2 gap-2", children: K.map((pe, Se) => /* @__PURE__ */ l.jsxs("div", { className: "relative border rounded overflow-hidden", children: [
|
|
8723
|
+
/* @__PURE__ */ l.jsx("img", { src: pe.url, alt: pe.alt ?? "image", className: "w-full h-auto" }),
|
|
8722
8724
|
/* @__PURE__ */ l.jsxs("div", { className: "absolute top-1 right-1 bg-background/70 rounded px-1 py-0.5 text-[10px] flex items-center gap-1", children: [
|
|
8723
8725
|
/* @__PURE__ */ l.jsx(yc, { className: "h-3 w-3" }),
|
|
8724
8726
|
/* @__PURE__ */ l.jsx("span", { children: "image" })
|
|
@@ -8729,43 +8731,43 @@ const jw = V.memo(function({
|
|
|
8729
8731
|
}, De = un(() => Dw(t), [t]);
|
|
8730
8732
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
8731
8733
|
/* @__PURE__ */ l.jsx("div", { className: M(ce(), x.container), children: /* @__PURE__ */ l.jsxs("div", { className: M(oe(), x.content), children: [
|
|
8732
|
-
(a || c ||
|
|
8734
|
+
(a || c || G) && /* @__PURE__ */ l.jsxs(
|
|
8733
8735
|
"div",
|
|
8734
8736
|
{
|
|
8735
8737
|
className: M(
|
|
8736
8738
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
8737
8739
|
_ && "mb-1 pb-1",
|
|
8738
|
-
|
|
8740
|
+
Q,
|
|
8739
8741
|
x.header
|
|
8740
8742
|
),
|
|
8741
8743
|
children: [
|
|
8742
8744
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8743
8745
|
ee(),
|
|
8744
8746
|
c && De && /* @__PURE__ */ l.jsx("span", { className: M("font-medium", _ ? "text-xs" : "text-sm"), children: De }),
|
|
8745
|
-
|
|
8747
|
+
G && F.name && /* @__PURE__ */ l.jsxs(
|
|
8746
8748
|
ju,
|
|
8747
8749
|
{
|
|
8748
8750
|
variant: "outline",
|
|
8749
8751
|
className: M(
|
|
8750
8752
|
"text-xs flex items-center gap-1 cursor-pointer",
|
|
8751
|
-
|
|
8753
|
+
Q,
|
|
8752
8754
|
"border border-current/40",
|
|
8753
8755
|
_ && "text-xs h-4"
|
|
8754
8756
|
),
|
|
8755
|
-
onClick: () => N((
|
|
8757
|
+
onClick: () => N((fe) => !fe),
|
|
8756
8758
|
children: [
|
|
8757
|
-
/* @__PURE__ */ l.jsx("span", { children:
|
|
8759
|
+
/* @__PURE__ */ l.jsx("span", { children: F.name }),
|
|
8758
8760
|
/* @__PURE__ */ l.jsx("span", { className: "inline-flex items-center", children: C ? /* @__PURE__ */ l.jsx(vr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Gn, { className: "h-3 w-3" }) })
|
|
8759
8761
|
]
|
|
8760
8762
|
}
|
|
8761
8763
|
),
|
|
8762
|
-
|
|
8764
|
+
G && !F.name && /* @__PURE__ */ l.jsx(
|
|
8763
8765
|
ke,
|
|
8764
8766
|
{
|
|
8765
8767
|
variant: "ghost",
|
|
8766
8768
|
size: "sm",
|
|
8767
|
-
className: M("h-6 px-1",
|
|
8768
|
-
onClick: () => N((
|
|
8769
|
+
className: M("h-6 px-1", Q, "hover:bg-foreground/10"),
|
|
8770
|
+
onClick: () => N((fe) => !fe),
|
|
8769
8771
|
children: /* @__PURE__ */ l.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
|
|
8770
8772
|
"Tool Output ",
|
|
8771
8773
|
C ? /* @__PURE__ */ l.jsx(vr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Gn, { className: "h-3 w-3" })
|
|
@@ -8774,7 +8776,7 @@ const jw = V.memo(function({
|
|
|
8774
8776
|
)
|
|
8775
8777
|
] }),
|
|
8776
8778
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8777
|
-
a && /* @__PURE__ */ l.jsx("span", { className: M("text-xs opacity-60",
|
|
8779
|
+
a && /* @__PURE__ */ l.jsx("span", { className: M("text-xs opacity-60", Q, _ && "text-xs"), children: Ie(t.createdAt) }),
|
|
8778
8780
|
i && !s && /* @__PURE__ */ l.jsxs(
|
|
8779
8781
|
"div",
|
|
8780
8782
|
{
|
|
@@ -8789,37 +8791,37 @@ const jw = V.memo(function({
|
|
|
8789
8791
|
{
|
|
8790
8792
|
variant: "ghost",
|
|
8791
8793
|
size: "sm",
|
|
8792
|
-
onClick:
|
|
8793
|
-
className: M("h-6 w-6 p-0 hover:bg-foreground/10",
|
|
8794
|
+
onClick: Y,
|
|
8795
|
+
className: M("h-6 w-6 p-0 hover:bg-foreground/10", Q, _ && "h-5 w-5"),
|
|
8794
8796
|
children: /* @__PURE__ */ l.jsx(
|
|
8795
8797
|
Va,
|
|
8796
8798
|
{
|
|
8797
8799
|
className: M(
|
|
8798
|
-
y ? "text-success" :
|
|
8800
|
+
y ? "text-success" : Q,
|
|
8799
8801
|
_ ? "h-3 w-3" : "h-4 w-4"
|
|
8800
8802
|
)
|
|
8801
8803
|
}
|
|
8802
8804
|
)
|
|
8803
8805
|
}
|
|
8804
8806
|
),
|
|
8805
|
-
|
|
8807
|
+
O === "user" && g && /* @__PURE__ */ l.jsx(
|
|
8806
8808
|
ke,
|
|
8807
8809
|
{
|
|
8808
8810
|
variant: "ghost",
|
|
8809
8811
|
size: "sm",
|
|
8810
|
-
onClick:
|
|
8811
|
-
className: M("h-6 w-6 p-0 hover:bg-foreground/10",
|
|
8812
|
-
children: /* @__PURE__ */ l.jsx(Ga, { className: M(
|
|
8812
|
+
onClick: P,
|
|
8813
|
+
className: M("h-6 w-6 p-0 hover:bg-foreground/10", Q, _ && "h-5 w-5"),
|
|
8814
|
+
children: /* @__PURE__ */ l.jsx(Ga, { className: M(Q, _ ? "h-3 w-3" : "h-4 w-4") })
|
|
8813
8815
|
}
|
|
8814
8816
|
),
|
|
8815
|
-
|
|
8817
|
+
O === "assistant" && p && /* @__PURE__ */ l.jsx(
|
|
8816
8818
|
ke,
|
|
8817
8819
|
{
|
|
8818
8820
|
variant: "ghost",
|
|
8819
8821
|
size: "sm",
|
|
8820
|
-
onClick:
|
|
8821
|
-
className: M("h-6 w-6 p-0 hover:bg-foreground/10",
|
|
8822
|
-
children: /* @__PURE__ */ l.jsx(ri, { className: M(
|
|
8822
|
+
onClick: q,
|
|
8823
|
+
className: M("h-6 w-6 p-0 hover:bg-foreground/10", Q, _ && "h-5 w-5"),
|
|
8824
|
+
children: /* @__PURE__ */ l.jsx(ri, { className: M(Q, _ ? "h-3 w-3" : "h-4 w-4") })
|
|
8823
8825
|
}
|
|
8824
8826
|
)
|
|
8825
8827
|
]
|
|
@@ -8830,17 +8832,17 @@ const jw = V.memo(function({
|
|
|
8830
8832
|
}
|
|
8831
8833
|
),
|
|
8832
8834
|
/* @__PURE__ */ l.jsx("div", { className: "relative", children: Me() }),
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
+
G && C && (F.toolCallId || F.name) && /* @__PURE__ */ l.jsxs("div", { className: M("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", _ && "text-xs"), children: [
|
|
8836
|
+
F.name && /* @__PURE__ */ l.jsxs("div", { children: [
|
|
8835
8837
|
"Function: ",
|
|
8836
|
-
|
|
8838
|
+
F.name
|
|
8837
8839
|
] }),
|
|
8838
|
-
|
|
8840
|
+
F.toolCallId && /* @__PURE__ */ l.jsxs("div", { children: [
|
|
8839
8841
|
"Call ID: ",
|
|
8840
|
-
|
|
8842
|
+
F.toolCallId
|
|
8841
8843
|
] })
|
|
8842
8844
|
] }),
|
|
8843
|
-
!(a || c ||
|
|
8845
|
+
!(a || c || G) && i && !s && /* @__PURE__ */ l.jsxs(
|
|
8844
8846
|
"div",
|
|
8845
8847
|
{
|
|
8846
8848
|
className: M(
|
|
@@ -8854,27 +8856,27 @@ const jw = V.memo(function({
|
|
|
8854
8856
|
{
|
|
8855
8857
|
variant: "ghost",
|
|
8856
8858
|
size: "sm",
|
|
8857
|
-
onClick:
|
|
8859
|
+
onClick: Y,
|
|
8858
8860
|
className: M("h-6 w-6 p-0 hover:bg-background/50 text-current", _ && "h-5 w-5"),
|
|
8859
8861
|
children: /* @__PURE__ */ l.jsx(Va, { className: M(y ? "text-success" : "text-current", _ ? "h-3 w-3" : "h-4 w-4") })
|
|
8860
8862
|
}
|
|
8861
8863
|
),
|
|
8862
|
-
|
|
8864
|
+
O === "user" && g && /* @__PURE__ */ l.jsx(
|
|
8863
8865
|
ke,
|
|
8864
8866
|
{
|
|
8865
8867
|
variant: "ghost",
|
|
8866
8868
|
size: "sm",
|
|
8867
|
-
onClick:
|
|
8869
|
+
onClick: P,
|
|
8868
8870
|
className: M("h-6 w-6 p-0 hover:bg-background/50 text-current", _ && "h-5 w-5"),
|
|
8869
8871
|
children: /* @__PURE__ */ l.jsx(Ga, { className: M("text-current", _ ? "h-3 w-3" : "h-4 w-4") })
|
|
8870
8872
|
}
|
|
8871
8873
|
),
|
|
8872
|
-
|
|
8874
|
+
O === "assistant" && p && /* @__PURE__ */ l.jsx(
|
|
8873
8875
|
ke,
|
|
8874
8876
|
{
|
|
8875
8877
|
variant: "ghost",
|
|
8876
8878
|
size: "sm",
|
|
8877
|
-
onClick:
|
|
8879
|
+
onClick: q,
|
|
8878
8880
|
className: M("h-6 w-6 p-0 hover:bg-background/50 text-current", _ && "h-5 w-5"),
|
|
8879
8881
|
children: /* @__PURE__ */ l.jsx(ri, { className: M("text-current", _ ? "h-3 w-3" : "h-4 w-4") })
|
|
8880
8882
|
}
|
|
@@ -8883,16 +8885,16 @@ const jw = V.memo(function({
|
|
|
8883
8885
|
}
|
|
8884
8886
|
)
|
|
8885
8887
|
] }) }),
|
|
8886
|
-
|
|
8888
|
+
L && /* @__PURE__ */ l.jsx(
|
|
8887
8889
|
Nw,
|
|
8888
8890
|
{
|
|
8889
8891
|
isOpen: A,
|
|
8890
8892
|
onClose: () => {
|
|
8891
|
-
$(!1),
|
|
8893
|
+
$(!1), Z(null);
|
|
8892
8894
|
},
|
|
8893
|
-
fileId:
|
|
8894
|
-
fileName:
|
|
8895
|
-
mimeType:
|
|
8895
|
+
fileId: L.id,
|
|
8896
|
+
fileName: L.name,
|
|
8897
|
+
mimeType: L.mimeType
|
|
8896
8898
|
}
|
|
8897
8899
|
)
|
|
8898
8900
|
] });
|
|
@@ -9023,7 +9025,7 @@ function Dw(e) {
|
|
|
9023
9025
|
return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
|
|
9024
9026
|
}
|
|
9025
9027
|
function Lw(e, t) {
|
|
9026
|
-
const [n, r] =
|
|
9028
|
+
const [n, r] = de(e), o = Ye(e), s = Ye(null);
|
|
9027
9029
|
return He(() => {
|
|
9028
9030
|
if (!t) {
|
|
9029
9031
|
r(e);
|
|
@@ -9640,17 +9642,17 @@ const oy = (e) => ({
|
|
|
9640
9642
|
}, v = ga(o), x = ma(v), g = await i.getDimensions(u), p = v === "y", b = p ? "top" : "left", w = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", R = s.reference[x] + s.reference[v] - m[v] - s.floating[x], S = m[v] - s.reference[v], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
|
|
9641
9643
|
let C = T ? T[y] : 0;
|
|
9642
9644
|
(!C || !await (i.isElement == null ? void 0 : i.isElement(T))) && (C = a.floating[y] || s.floating[x]);
|
|
9643
|
-
const N = R / 2 - S / 2, I = C / 2 - g[x] / 2 - 1, k = pn(h[b], I), D = pn(h[w], I), H = k, U = C - g[x] - D, A = C / 2 - g[x] / 2 + N, $ = Si(H, A, U),
|
|
9645
|
+
const N = R / 2 - S / 2, I = C / 2 - g[x] / 2 - 1, k = pn(h[b], I), D = pn(h[w], I), H = k, U = C - g[x] - D, A = C / 2 - g[x] / 2 + N, $ = Si(H, A, U), L = !c.arrow && lr(o) != null && A !== $ && s.reference[x] / 2 - (A < H ? k : D) - g[x] / 2 < 0, Z = L ? A < H ? A - H : A - U : 0;
|
|
9644
9646
|
return {
|
|
9645
|
-
[v]: m[v] +
|
|
9647
|
+
[v]: m[v] + Z,
|
|
9646
9648
|
data: {
|
|
9647
9649
|
[v]: $,
|
|
9648
|
-
centerOffset: A - $ -
|
|
9649
|
-
...
|
|
9650
|
-
alignmentOffset:
|
|
9650
|
+
centerOffset: A - $ - Z,
|
|
9651
|
+
...L && {
|
|
9652
|
+
alignmentOffset: Z
|
|
9651
9653
|
}
|
|
9652
9654
|
},
|
|
9653
|
-
reset:
|
|
9655
|
+
reset: L
|
|
9654
9656
|
};
|
|
9655
9657
|
}
|
|
9656
9658
|
}), sy = function(e) {
|
|
@@ -9703,31 +9705,31 @@ const oy = (e) => ({
|
|
|
9703
9705
|
placement: $
|
|
9704
9706
|
}
|
|
9705
9707
|
};
|
|
9706
|
-
let
|
|
9707
|
-
if (!
|
|
9708
|
+
let L = (H = k.filter((Z) => Z.overflows[0] <= 0).sort((Z, _) => Z.overflows[1] - _.overflows[1])[0]) == null ? void 0 : H.placement;
|
|
9709
|
+
if (!L)
|
|
9708
9710
|
switch (v) {
|
|
9709
9711
|
case "bestFit": {
|
|
9710
9712
|
var U;
|
|
9711
|
-
const
|
|
9713
|
+
const Z = (U = k.filter((_) => {
|
|
9712
9714
|
if (T) {
|
|
9713
|
-
const
|
|
9714
|
-
return
|
|
9715
|
+
const O = Yt(_.placement);
|
|
9716
|
+
return O === w || // Create a bias to the `y` side axis due to horizontal
|
|
9715
9717
|
// reading directions favoring greater width.
|
|
9716
|
-
|
|
9718
|
+
O === "y";
|
|
9717
9719
|
}
|
|
9718
9720
|
return !0;
|
|
9719
|
-
}).map((_) => [_.placement, _.overflows.filter((
|
|
9720
|
-
|
|
9721
|
+
}).map((_) => [_.placement, _.overflows.filter((O) => O > 0).reduce((O, G) => O + G, 0)]).sort((_, O) => _[1] - O[1])[0]) == null ? void 0 : U[0];
|
|
9722
|
+
Z && (L = Z);
|
|
9721
9723
|
break;
|
|
9722
9724
|
}
|
|
9723
9725
|
case "initialPlacement":
|
|
9724
|
-
|
|
9726
|
+
L = a;
|
|
9725
9727
|
break;
|
|
9726
9728
|
}
|
|
9727
|
-
if (o !==
|
|
9729
|
+
if (o !== L)
|
|
9728
9730
|
return {
|
|
9729
9731
|
reset: {
|
|
9730
|
-
placement:
|
|
9732
|
+
placement: L
|
|
9731
9733
|
}
|
|
9732
9734
|
};
|
|
9733
9735
|
}
|
|
@@ -10556,17 +10558,17 @@ function Ky(e) {
|
|
|
10556
10558
|
strategy: n,
|
|
10557
10559
|
middleware: m
|
|
10558
10560
|
};
|
|
10559
|
-
D.current && (_.platform = D.current), Wy(T.current, C.current, _).then((
|
|
10560
|
-
const
|
|
10561
|
-
...
|
|
10561
|
+
D.current && (_.platform = D.current), Wy(T.current, C.current, _).then((O) => {
|
|
10562
|
+
const G = {
|
|
10563
|
+
...O,
|
|
10562
10564
|
// The floating element's position may be recomputed while it's closed
|
|
10563
10565
|
// but still mounted (such as when transitioning out). To ensure
|
|
10564
10566
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
10565
10567
|
// setting it to `true` when `open === false` (must be specified).
|
|
10566
10568
|
isPositioned: H.current !== !1
|
|
10567
10569
|
};
|
|
10568
|
-
A.current && !$o(N.current,
|
|
10569
|
-
h(
|
|
10570
|
+
A.current && !$o(N.current, G) && (N.current = G, Go.flushSync(() => {
|
|
10571
|
+
h(G);
|
|
10570
10572
|
}));
|
|
10571
10573
|
});
|
|
10572
10574
|
}, [m, t, n, D, H]);
|
|
@@ -10591,37 +10593,37 @@ function Ky(e) {
|
|
|
10591
10593
|
floating: C,
|
|
10592
10594
|
setReference: w,
|
|
10593
10595
|
setFloating: y
|
|
10594
|
-
}), [w, y]),
|
|
10596
|
+
}), [w, y]), L = f.useMemo(() => ({
|
|
10595
10597
|
reference: R,
|
|
10596
10598
|
floating: S
|
|
10597
|
-
}), [R, S]),
|
|
10599
|
+
}), [R, S]), Z = f.useMemo(() => {
|
|
10598
10600
|
const _ = {
|
|
10599
10601
|
position: n,
|
|
10600
10602
|
left: 0,
|
|
10601
10603
|
top: 0
|
|
10602
10604
|
};
|
|
10603
|
-
if (!
|
|
10605
|
+
if (!L.floating)
|
|
10604
10606
|
return _;
|
|
10605
|
-
const
|
|
10607
|
+
const O = fc(L.floating, d.x), G = fc(L.floating, d.y);
|
|
10606
10608
|
return a ? {
|
|
10607
10609
|
..._,
|
|
10608
|
-
transform: "translate(" +
|
|
10609
|
-
...jd(
|
|
10610
|
+
transform: "translate(" + O + "px, " + G + "px)",
|
|
10611
|
+
...jd(L.floating) >= 1.5 && {
|
|
10610
10612
|
willChange: "transform"
|
|
10611
10613
|
}
|
|
10612
10614
|
} : {
|
|
10613
10615
|
position: n,
|
|
10614
|
-
left:
|
|
10615
|
-
top:
|
|
10616
|
+
left: O,
|
|
10617
|
+
top: G
|
|
10616
10618
|
};
|
|
10617
|
-
}, [n, a,
|
|
10619
|
+
}, [n, a, L.floating, d.x, d.y]);
|
|
10618
10620
|
return f.useMemo(() => ({
|
|
10619
10621
|
...d,
|
|
10620
10622
|
update: U,
|
|
10621
10623
|
refs: $,
|
|
10622
|
-
elements:
|
|
10623
|
-
floatingStyles:
|
|
10624
|
-
}), [d, U, $,
|
|
10624
|
+
elements: L,
|
|
10625
|
+
floatingStyles: Z
|
|
10626
|
+
}), [d, U, $, L, Z]);
|
|
10625
10627
|
}
|
|
10626
10628
|
const Yy = (e) => {
|
|
10627
10629
|
function t(n) {
|
|
@@ -10669,7 +10671,7 @@ const Yy = (e) => {
|
|
|
10669
10671
|
var n0 = "Arrow", Ad = f.forwardRef((e, t) => {
|
|
10670
10672
|
const { children: n, width: r = 10, height: o = 5, ...s } = e;
|
|
10671
10673
|
return /* @__PURE__ */ l.jsx(
|
|
10672
|
-
|
|
10674
|
+
ge.svg,
|
|
10673
10675
|
{
|
|
10674
10676
|
...s,
|
|
10675
10677
|
ref: t,
|
|
@@ -10716,13 +10718,13 @@ var Md = "PopperAnchor", Dd = f.forwardRef(
|
|
|
10716
10718
|
return f.useEffect(() => {
|
|
10717
10719
|
const u = c.current;
|
|
10718
10720
|
c.current = (r == null ? void 0 : r.current) || i.current, u !== c.current && s.onAnchorChange(c.current);
|
|
10719
|
-
}), r ? null : /* @__PURE__ */ l.jsx(
|
|
10721
|
+
}), r ? null : /* @__PURE__ */ l.jsx(ge.div, { ...o, ref: a });
|
|
10720
10722
|
}
|
|
10721
10723
|
);
|
|
10722
10724
|
Dd.displayName = Md;
|
|
10723
10725
|
var ya = "PopperContent", [s0, i0] = Pd(ya), Ld = f.forwardRef(
|
|
10724
10726
|
(e, t) => {
|
|
10725
|
-
var
|
|
10727
|
+
var Y, P, q, ee, ce, oe;
|
|
10726
10728
|
const {
|
|
10727
10729
|
__scopePopper: n,
|
|
10728
10730
|
side: r = "bottom",
|
|
@@ -10743,7 +10745,7 @@ var ya = "PopperContent", [s0, i0] = Pd(ya), Ld = f.forwardRef(
|
|
|
10743
10745
|
boundary: D.filter(l0),
|
|
10744
10746
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
10745
10747
|
altBoundary: H
|
|
10746
|
-
}, { refs: A, floatingStyles: $, placement:
|
|
10748
|
+
}, { refs: A, floatingStyles: $, placement: L, isPositioned: Z, middlewareData: _ } = Ky({
|
|
10747
10749
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
10748
10750
|
strategy: "fixed",
|
|
10749
10751
|
placement: I,
|
|
@@ -10764,22 +10766,22 @@ var ya = "PopperContent", [s0, i0] = Pd(ya), Ld = f.forwardRef(
|
|
|
10764
10766
|
c && Zy({ ...U }),
|
|
10765
10767
|
Qy({
|
|
10766
10768
|
...U,
|
|
10767
|
-
apply: ({ elements: Ie, rects: Me, availableWidth: De, availableHeight:
|
|
10768
|
-
const { width: Oe, height:
|
|
10769
|
-
Se.setProperty("--radix-popper-available-width", `${De}px`), Se.setProperty("--radix-popper-available-height", `${
|
|
10769
|
+
apply: ({ elements: Ie, rects: Me, availableWidth: De, availableHeight: fe }) => {
|
|
10770
|
+
const { width: Oe, height: pe } = Me.reference, Se = Ie.floating.style;
|
|
10771
|
+
Se.setProperty("--radix-popper-available-width", `${De}px`), Se.setProperty("--radix-popper-available-height", `${fe}px`), Se.setProperty("--radix-popper-anchor-width", `${Oe}px`), Se.setProperty("--radix-popper-anchor-height", `${pe}px`);
|
|
10770
10772
|
}
|
|
10771
10773
|
}),
|
|
10772
10774
|
R && t0({ element: R, padding: a }),
|
|
10773
10775
|
c0({ arrowWidth: C, arrowHeight: N }),
|
|
10774
10776
|
m && e0({ strategy: "referenceHidden", ...U })
|
|
10775
10777
|
]
|
|
10776
|
-
}), [
|
|
10778
|
+
}), [O, G] = $d(L), Q = st(x);
|
|
10777
10779
|
ot(() => {
|
|
10778
|
-
|
|
10779
|
-
}, [
|
|
10780
|
-
const
|
|
10780
|
+
Z && (Q == null || Q());
|
|
10781
|
+
}, [Z, Q]);
|
|
10782
|
+
const J = (Y = _.arrow) == null ? void 0 : Y.x, F = (P = _.arrow) == null ? void 0 : P.y, K = ((q = _.arrow) == null ? void 0 : q.centerOffset) !== 0, [ye, ue] = f.useState();
|
|
10781
10783
|
return ot(() => {
|
|
10782
|
-
b &&
|
|
10784
|
+
b && ue(window.getComputedStyle(b).zIndex);
|
|
10783
10785
|
}, [b]), /* @__PURE__ */ l.jsx(
|
|
10784
10786
|
"div",
|
|
10785
10787
|
{
|
|
@@ -10787,10 +10789,10 @@ var ya = "PopperContent", [s0, i0] = Pd(ya), Ld = f.forwardRef(
|
|
|
10787
10789
|
"data-radix-popper-content-wrapper": "",
|
|
10788
10790
|
style: {
|
|
10789
10791
|
...$,
|
|
10790
|
-
transform:
|
|
10792
|
+
transform: Z ? $.transform : "translate(0, -200%)",
|
|
10791
10793
|
// keep off the page when measuring
|
|
10792
10794
|
minWidth: "max-content",
|
|
10793
|
-
zIndex:
|
|
10795
|
+
zIndex: ye,
|
|
10794
10796
|
"--radix-popper-transform-origin": [
|
|
10795
10797
|
(ee = _.transformOrigin) == null ? void 0 : ee.x,
|
|
10796
10798
|
(ce = _.transformOrigin) == null ? void 0 : ce.y
|
|
@@ -10808,23 +10810,23 @@ var ya = "PopperContent", [s0, i0] = Pd(ya), Ld = f.forwardRef(
|
|
|
10808
10810
|
s0,
|
|
10809
10811
|
{
|
|
10810
10812
|
scope: n,
|
|
10811
|
-
placedSide:
|
|
10813
|
+
placedSide: O,
|
|
10812
10814
|
onArrowChange: S,
|
|
10813
|
-
arrowX:
|
|
10814
|
-
arrowY:
|
|
10815
|
+
arrowX: J,
|
|
10816
|
+
arrowY: F,
|
|
10815
10817
|
shouldHideArrow: K,
|
|
10816
10818
|
children: /* @__PURE__ */ l.jsx(
|
|
10817
|
-
|
|
10819
|
+
ge.div,
|
|
10818
10820
|
{
|
|
10819
|
-
"data-side":
|
|
10820
|
-
"data-align":
|
|
10821
|
+
"data-side": O,
|
|
10822
|
+
"data-align": G,
|
|
10821
10823
|
...g,
|
|
10822
10824
|
ref: y,
|
|
10823
10825
|
style: {
|
|
10824
10826
|
...g.style,
|
|
10825
10827
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
10826
10828
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
10827
|
-
animation:
|
|
10829
|
+
animation: Z ? void 0 : "none"
|
|
10828
10830
|
}
|
|
10829
10831
|
}
|
|
10830
10832
|
)
|
|
@@ -10954,7 +10956,7 @@ var m0 = f.forwardRef((e, t) => {
|
|
|
10954
10956
|
[]
|
|
10955
10957
|
),
|
|
10956
10958
|
children: /* @__PURE__ */ l.jsx(
|
|
10957
|
-
|
|
10959
|
+
ge.div,
|
|
10958
10960
|
{
|
|
10959
10961
|
tabIndex: b || T === 0 ? -1 : 0,
|
|
10960
10962
|
"data-orientation": r,
|
|
@@ -10969,9 +10971,9 @@ var m0 = f.forwardRef((e, t) => {
|
|
|
10969
10971
|
if (N.target === N.currentTarget && I && !b) {
|
|
10970
10972
|
const k = new CustomEvent(ti, u0);
|
|
10971
10973
|
if (N.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
|
|
10972
|
-
const D = R().filter((
|
|
10974
|
+
const D = R().filter((L) => L.focusable), H = D.find((L) => L.active), U = D.find((L) => L.id === g), $ = [H, U, ...D].filter(
|
|
10973
10975
|
Boolean
|
|
10974
|
-
).map((
|
|
10976
|
+
).map((L) => L.ref.current);
|
|
10975
10977
|
Gd($, d);
|
|
10976
10978
|
}
|
|
10977
10979
|
}
|
|
@@ -11003,7 +11005,7 @@ var m0 = f.forwardRef((e, t) => {
|
|
|
11003
11005
|
focusable: r,
|
|
11004
11006
|
active: o,
|
|
11005
11007
|
children: /* @__PURE__ */ l.jsx(
|
|
11006
|
-
|
|
11008
|
+
ge.span,
|
|
11007
11009
|
{
|
|
11008
11010
|
tabIndex: h ? 0 : -1,
|
|
11009
11011
|
"data-orientation": d.orientation,
|
|
@@ -11181,17 +11183,17 @@ var At = "MenuContent", [P0, Ia] = Dn(At), Qd = f.forwardRef(
|
|
|
11181
11183
|
onDismiss: v,
|
|
11182
11184
|
disableOutsideScroll: x,
|
|
11183
11185
|
...g
|
|
11184
|
-
} = e, p = Ln(At, n), b = Xr(At, n), w = vs(n), y = qd(n), R = E0(n), [S, T] = f.useState(null), C = f.useRef(null), N = Te(t, C, p.onContentChange), I = f.useRef(0), k = f.useRef(""), D = f.useRef(0), H = f.useRef(null), U = f.useRef("right"), A = f.useRef(0), $ = x ? ls : f.Fragment,
|
|
11185
|
-
var
|
|
11186
|
-
const
|
|
11187
|
-
(function
|
|
11188
|
-
k.current = ee, window.clearTimeout(I.current), ee !== "" && (I.current = window.setTimeout(() =>
|
|
11189
|
-
})(
|
|
11186
|
+
} = e, p = Ln(At, n), b = Xr(At, n), w = vs(n), y = qd(n), R = E0(n), [S, T] = f.useState(null), C = f.useRef(null), N = Te(t, C, p.onContentChange), I = f.useRef(0), k = f.useRef(""), D = f.useRef(0), H = f.useRef(null), U = f.useRef("right"), A = f.useRef(0), $ = x ? ls : f.Fragment, L = x ? { as: M0, allowPinchZoom: !0 } : void 0, Z = (O) => {
|
|
11187
|
+
var Y, P;
|
|
11188
|
+
const G = k.current + O, Q = R().filter((q) => !q.disabled), J = document.activeElement, F = (Y = Q.find((q) => q.ref.current === J)) == null ? void 0 : Y.textValue, K = Q.map((q) => q.textValue), ye = K0(K, G, F), ue = (P = Q.find((q) => q.textValue === ye)) == null ? void 0 : P.ref.current;
|
|
11189
|
+
(function q(ee) {
|
|
11190
|
+
k.current = ee, window.clearTimeout(I.current), ee !== "" && (I.current = window.setTimeout(() => q(""), 1e3));
|
|
11191
|
+
})(G), ue && setTimeout(() => ue.focus());
|
|
11190
11192
|
};
|
|
11191
11193
|
f.useEffect(() => () => window.clearTimeout(I.current), []), la();
|
|
11192
|
-
const _ = f.useCallback((
|
|
11193
|
-
var
|
|
11194
|
-
return U.current === ((
|
|
11194
|
+
const _ = f.useCallback((O) => {
|
|
11195
|
+
var Q, J;
|
|
11196
|
+
return U.current === ((Q = H.current) == null ? void 0 : Q.side) && q0(O, (J = H.current) == null ? void 0 : J.area);
|
|
11195
11197
|
}, []);
|
|
11196
11198
|
return /* @__PURE__ */ l.jsx(
|
|
11197
11199
|
P0,
|
|
@@ -11199,36 +11201,36 @@ var At = "MenuContent", [P0, Ia] = Dn(At), Qd = f.forwardRef(
|
|
|
11199
11201
|
scope: n,
|
|
11200
11202
|
searchRef: k,
|
|
11201
11203
|
onItemEnter: f.useCallback(
|
|
11202
|
-
(
|
|
11203
|
-
_(
|
|
11204
|
+
(O) => {
|
|
11205
|
+
_(O) && O.preventDefault();
|
|
11204
11206
|
},
|
|
11205
11207
|
[_]
|
|
11206
11208
|
),
|
|
11207
11209
|
onItemLeave: f.useCallback(
|
|
11208
|
-
(
|
|
11209
|
-
var
|
|
11210
|
-
_(
|
|
11210
|
+
(O) => {
|
|
11211
|
+
var G;
|
|
11212
|
+
_(O) || ((G = C.current) == null || G.focus(), T(null));
|
|
11211
11213
|
},
|
|
11212
11214
|
[_]
|
|
11213
11215
|
),
|
|
11214
11216
|
onTriggerLeave: f.useCallback(
|
|
11215
|
-
(
|
|
11216
|
-
_(
|
|
11217
|
+
(O) => {
|
|
11218
|
+
_(O) && O.preventDefault();
|
|
11217
11219
|
},
|
|
11218
11220
|
[_]
|
|
11219
11221
|
),
|
|
11220
11222
|
pointerGraceTimerRef: D,
|
|
11221
|
-
onPointerGraceIntentChange: f.useCallback((
|
|
11222
|
-
H.current =
|
|
11223
|
+
onPointerGraceIntentChange: f.useCallback((O) => {
|
|
11224
|
+
H.current = O;
|
|
11223
11225
|
}, []),
|
|
11224
|
-
children: /* @__PURE__ */ l.jsx($, { ...
|
|
11226
|
+
children: /* @__PURE__ */ l.jsx($, { ...L, children: /* @__PURE__ */ l.jsx(
|
|
11225
11227
|
ss,
|
|
11226
11228
|
{
|
|
11227
11229
|
asChild: !0,
|
|
11228
11230
|
trapped: o,
|
|
11229
|
-
onMountAutoFocus: te(s, (
|
|
11230
|
-
var
|
|
11231
|
-
|
|
11231
|
+
onMountAutoFocus: te(s, (O) => {
|
|
11232
|
+
var G;
|
|
11233
|
+
O.preventDefault(), (G = C.current) == null || G.focus({ preventScroll: !0 });
|
|
11232
11234
|
}),
|
|
11233
11235
|
onUnmountAutoFocus: i,
|
|
11234
11236
|
children: /* @__PURE__ */ l.jsx(
|
|
@@ -11251,8 +11253,8 @@ var At = "MenuContent", [P0, Ia] = Dn(At), Qd = f.forwardRef(
|
|
|
11251
11253
|
loop: r,
|
|
11252
11254
|
currentTabStopId: S,
|
|
11253
11255
|
onCurrentTabStopIdChange: T,
|
|
11254
|
-
onEntryFocus: te(c, (
|
|
11255
|
-
b.isUsingKeyboardRef.current ||
|
|
11256
|
+
onEntryFocus: te(c, (O) => {
|
|
11257
|
+
b.isUsingKeyboardRef.current || O.preventDefault();
|
|
11256
11258
|
}),
|
|
11257
11259
|
preventScrollOnEntryFocus: !0,
|
|
11258
11260
|
children: /* @__PURE__ */ l.jsx(
|
|
@@ -11267,25 +11269,25 @@ var At = "MenuContent", [P0, Ia] = Dn(At), Qd = f.forwardRef(
|
|
|
11267
11269
|
...g,
|
|
11268
11270
|
ref: N,
|
|
11269
11271
|
style: { outline: "none", ...g.style },
|
|
11270
|
-
onKeyDown: te(g.onKeyDown, (
|
|
11271
|
-
const
|
|
11272
|
-
|
|
11272
|
+
onKeyDown: te(g.onKeyDown, (O) => {
|
|
11273
|
+
const Q = O.target.closest("[data-radix-menu-content]") === O.currentTarget, J = O.ctrlKey || O.altKey || O.metaKey, F = O.key.length === 1;
|
|
11274
|
+
Q && (O.key === "Tab" && O.preventDefault(), !J && F && Z(O.key));
|
|
11273
11275
|
const K = C.current;
|
|
11274
|
-
if (
|
|
11275
|
-
|
|
11276
|
-
const
|
|
11277
|
-
Kd.includes(
|
|
11276
|
+
if (O.target !== K || !C0.includes(O.key)) return;
|
|
11277
|
+
O.preventDefault();
|
|
11278
|
+
const ue = R().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
|
|
11279
|
+
Kd.includes(O.key) && ue.reverse(), V0(ue);
|
|
11278
11280
|
}),
|
|
11279
|
-
onBlur: te(e.onBlur, (
|
|
11280
|
-
|
|
11281
|
+
onBlur: te(e.onBlur, (O) => {
|
|
11282
|
+
O.currentTarget.contains(O.target) || (window.clearTimeout(I.current), k.current = "");
|
|
11281
11283
|
}),
|
|
11282
11284
|
onPointerMove: te(
|
|
11283
11285
|
e.onPointerMove,
|
|
11284
|
-
Mr((
|
|
11285
|
-
const
|
|
11286
|
-
if (
|
|
11287
|
-
const
|
|
11288
|
-
U.current =
|
|
11286
|
+
Mr((O) => {
|
|
11287
|
+
const G = O.target, Q = A.current !== O.clientX;
|
|
11288
|
+
if (O.currentTarget.contains(G) && Q) {
|
|
11289
|
+
const J = O.clientX > A.current ? "right" : "left";
|
|
11290
|
+
U.current = J, A.current = O.clientX;
|
|
11289
11291
|
}
|
|
11290
11292
|
})
|
|
11291
11293
|
)
|
|
@@ -11305,14 +11307,14 @@ Qd.displayName = At;
|
|
|
11305
11307
|
var D0 = "MenuGroup", Aa = f.forwardRef(
|
|
11306
11308
|
(e, t) => {
|
|
11307
11309
|
const { __scopeMenu: n, ...r } = e;
|
|
11308
|
-
return /* @__PURE__ */ l.jsx(
|
|
11310
|
+
return /* @__PURE__ */ l.jsx(ge.div, { role: "group", ...r, ref: t });
|
|
11309
11311
|
}
|
|
11310
11312
|
);
|
|
11311
11313
|
Aa.displayName = D0;
|
|
11312
11314
|
var L0 = "MenuLabel", ef = f.forwardRef(
|
|
11313
11315
|
(e, t) => {
|
|
11314
11316
|
const { __scopeMenu: n, ...r } = e;
|
|
11315
|
-
return /* @__PURE__ */ l.jsx(
|
|
11317
|
+
return /* @__PURE__ */ l.jsx(ge.div, { ...r, ref: t });
|
|
11316
11318
|
}
|
|
11317
11319
|
);
|
|
11318
11320
|
ef.displayName = L0;
|
|
@@ -11362,7 +11364,7 @@ var tf = f.forwardRef(
|
|
|
11362
11364
|
disabled: r,
|
|
11363
11365
|
textValue: o ?? m,
|
|
11364
11366
|
children: /* @__PURE__ */ l.jsx(y0, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ l.jsx(
|
|
11365
|
-
|
|
11367
|
+
ge.div,
|
|
11366
11368
|
{
|
|
11367
11369
|
role: "menuitem",
|
|
11368
11370
|
"data-highlighted": d ? "" : void 0,
|
|
@@ -11454,7 +11456,7 @@ var ka = "MenuItemIndicator", [lf, H0] = Dn(
|
|
|
11454
11456
|
{
|
|
11455
11457
|
present: r || zo(s.checked) || s.checked === !0,
|
|
11456
11458
|
children: /* @__PURE__ */ l.jsx(
|
|
11457
|
-
|
|
11459
|
+
ge.span,
|
|
11458
11460
|
{
|
|
11459
11461
|
...o,
|
|
11460
11462
|
ref: t,
|
|
@@ -11470,7 +11472,7 @@ var z0 = "MenuSeparator", uf = f.forwardRef(
|
|
|
11470
11472
|
(e, t) => {
|
|
11471
11473
|
const { __scopeMenu: n, ...r } = e;
|
|
11472
11474
|
return /* @__PURE__ */ l.jsx(
|
|
11473
|
-
|
|
11475
|
+
ge.div,
|
|
11474
11476
|
{
|
|
11475
11477
|
role: "separator",
|
|
11476
11478
|
"aria-orientation": "horizontal",
|
|
@@ -11676,7 +11678,7 @@ var bf = "DropdownMenuTrigger", wf = f.forwardRef(
|
|
|
11676
11678
|
(e, t) => {
|
|
11677
11679
|
const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = xf(bf, n), i = pt(n);
|
|
11678
11680
|
return /* @__PURE__ */ l.jsx(J0, { asChild: !0, ...i, children: /* @__PURE__ */ l.jsx(
|
|
11679
|
-
|
|
11681
|
+
ge.button,
|
|
11680
11682
|
{
|
|
11681
11683
|
type: "button",
|
|
11682
11684
|
id: s.triggerId,
|
|
@@ -11956,7 +11958,7 @@ function To({
|
|
|
11956
11958
|
isLoadingHistory: I,
|
|
11957
11959
|
loadOlderMessages: k,
|
|
11958
11960
|
api: D
|
|
11959
|
-
} = Ui(), [H, U] =
|
|
11961
|
+
} = Ui(), [H, U] = de(null), [A, $] = de(""), [L, Z] = de(null), [_, O] = de([]), [G, Q] = de(!1), [J, F] = de(null), [K, ye] = de(null), [ue, Y] = de(!1), [P, q] = de(null), [ee, ce] = de([]), [oe, Ie] = de(null), [Me, De] = de(null), fe = Ye(null), Oe = Ye(null), pe = Ye(null), [Se, mt] = de("desktop");
|
|
11960
11962
|
He(() => {
|
|
11961
11963
|
const se = () => {
|
|
11962
11964
|
const ae = window.innerWidth;
|
|
@@ -11966,14 +11968,14 @@ function To({
|
|
|
11966
11968
|
}, []), He(() => {
|
|
11967
11969
|
let se = !1;
|
|
11968
11970
|
if (!m) {
|
|
11969
|
-
ce([]), Ie(null), De(null),
|
|
11971
|
+
ce([]), Ie(null), De(null), pe.current = null;
|
|
11970
11972
|
return;
|
|
11971
11973
|
}
|
|
11972
11974
|
const ae = {
|
|
11973
11975
|
threadId: m,
|
|
11974
11976
|
checkpointId: y ?? null,
|
|
11975
11977
|
checkpointNs: R ?? null
|
|
11976
|
-
}, je =
|
|
11978
|
+
}, je = pe.current;
|
|
11977
11979
|
if (!(je && je.threadId === ae.threadId && je.checkpointId === ae.checkpointId && je.checkpointNs === ae.checkpointNs))
|
|
11978
11980
|
return S(m).then((Fe) => {
|
|
11979
11981
|
var hr;
|
|
@@ -11986,16 +11988,16 @@ function To({
|
|
|
11986
11988
|
const tn = en.find(($n) => $n.checkpointId === Bn);
|
|
11987
11989
|
Jr = (tn == null ? void 0 : tn.checkpointNs) ?? null;
|
|
11988
11990
|
}
|
|
11989
|
-
Ie(Bn), De(Jr),
|
|
11991
|
+
Ie(Bn), De(Jr), pe.current = ae;
|
|
11990
11992
|
}).catch((Fe) => {
|
|
11991
|
-
console.error("ChatInterface - listCheckpoints error:", Fe), se || (ce([]),
|
|
11993
|
+
console.error("ChatInterface - listCheckpoints error:", Fe), se || (ce([]), pe.current = null);
|
|
11992
11994
|
}), () => {
|
|
11993
11995
|
se = !0;
|
|
11994
11996
|
};
|
|
11995
11997
|
}, [m, y, R, oe, S]), He(() => {
|
|
11996
11998
|
y && (Ie(y), De(R ?? null));
|
|
11997
11999
|
}, [y, R]);
|
|
11998
|
-
const
|
|
12000
|
+
const X = Ke(async () => {
|
|
11999
12001
|
if (!(!N || I))
|
|
12000
12002
|
try {
|
|
12001
12003
|
await k();
|
|
@@ -12007,14 +12009,14 @@ function To({
|
|
|
12007
12009
|
(async () => {
|
|
12008
12010
|
try {
|
|
12009
12011
|
const ae = await D.getAgent("default");
|
|
12010
|
-
|
|
12012
|
+
q(ae.uiDefaultMessage || null);
|
|
12011
12013
|
} catch (ae) {
|
|
12012
|
-
console.warn("Failed to fetch default message:", ae),
|
|
12014
|
+
console.warn("Failed to fetch default message:", ae), q(null);
|
|
12013
12015
|
}
|
|
12014
12016
|
})();
|
|
12015
12017
|
}, [D]), He(() => {
|
|
12016
|
-
p && !
|
|
12017
|
-
}, [p,
|
|
12018
|
+
p && !ue && (h == null || h(p));
|
|
12019
|
+
}, [p, ue, h]);
|
|
12018
12020
|
const ie = (se) => {
|
|
12019
12021
|
if (se.length > So)
|
|
12020
12022
|
return `Message too long (${se.length}/${So} characters)`;
|
|
@@ -12037,7 +12039,7 @@ function To({
|
|
|
12037
12039
|
if (ae) {
|
|
12038
12040
|
const je = ie(ae);
|
|
12039
12041
|
if (je) {
|
|
12040
|
-
|
|
12042
|
+
Z(je);
|
|
12041
12043
|
return;
|
|
12042
12044
|
}
|
|
12043
12045
|
}
|
|
@@ -12047,16 +12049,16 @@ function To({
|
|
|
12047
12049
|
checkpointNs: Me ?? R ?? void 0,
|
|
12048
12050
|
payloadExtras: H ? { edit: !0, originalMessageId: H } : void 0,
|
|
12049
12051
|
attachments: _
|
|
12050
|
-
}), u == null || u(ae),
|
|
12052
|
+
}), u == null || u(ae), Z(null), O([]), U(null), $("");
|
|
12051
12053
|
} catch (je) {
|
|
12052
12054
|
const Fe = (je == null ? void 0 : je.message) || "Failed to send message";
|
|
12053
|
-
|
|
12055
|
+
Z(Fe), h == null || h(Fe);
|
|
12054
12056
|
}
|
|
12055
12057
|
}
|
|
12056
12058
|
}, Ze = V.useCallback((se, ae) => {
|
|
12057
|
-
a && (U(se), $(ae),
|
|
12059
|
+
a && (U(se), $(ae), Z(null));
|
|
12058
12060
|
}, [a]), ut = V.useCallback(() => {
|
|
12059
|
-
U(null), $(""),
|
|
12061
|
+
U(null), $(""), Z(null);
|
|
12060
12062
|
}, []), gt = Ke((se, ae) => {
|
|
12061
12063
|
Ze(se, ae);
|
|
12062
12064
|
}, [Ze]), Ut = Ke((se) => {
|
|
@@ -12071,11 +12073,11 @@ function To({
|
|
|
12071
12073
|
}
|
|
12072
12074
|
}, [v, b, oe, Me, y, R, Le]), Qe = (se) => {
|
|
12073
12075
|
const ae = Array.from(se.target.files || []);
|
|
12074
|
-
|
|
12075
|
-
}, it = (se) =>
|
|
12076
|
+
O((je) => [...je, ...ae]);
|
|
12077
|
+
}, it = (se) => O((ae) => ae.filter((je, Fe) => se !== Fe)), et = async (se) => {
|
|
12076
12078
|
const ae = (se.target.files || [])[0];
|
|
12077
12079
|
if (ae) {
|
|
12078
|
-
|
|
12080
|
+
F(null), ye(null), Q(!0);
|
|
12079
12081
|
try {
|
|
12080
12082
|
await b("", {
|
|
12081
12083
|
checkpointId: oe ?? y ?? void 0,
|
|
@@ -12083,12 +12085,12 @@ function To({
|
|
|
12083
12085
|
attachments: [ae]
|
|
12084
12086
|
});
|
|
12085
12087
|
const je = `Uploaded ${ae.name} - processing through chat stream`;
|
|
12086
|
-
|
|
12088
|
+
ye(je);
|
|
12087
12089
|
} catch (je) {
|
|
12088
12090
|
const Fe = je instanceof Error ? je.message : "Failed to upload Excel file";
|
|
12089
|
-
console.error("Excel upload failed", je),
|
|
12091
|
+
console.error("Excel upload failed", je), F(Fe), h == null || h(Fe);
|
|
12090
12092
|
} finally {
|
|
12091
|
-
|
|
12093
|
+
Q(!1), se.target.value = "";
|
|
12092
12094
|
}
|
|
12093
12095
|
}
|
|
12094
12096
|
}, dt = (se) => {
|
|
@@ -12105,14 +12107,14 @@ function To({
|
|
|
12105
12107
|
await T(se, je), Ie(se), De(je);
|
|
12106
12108
|
}, fr = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${c.container || ""}`, Fn = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-y-auto overflow-x-auto overscroll-contain break-words break-anywhere p-4 bg-transparent ${c.messagesArea || ""}`, Ge = `flex-shrink-0 w-full border-t p-4 bg-transparent ${c.inputArea || ""}`;
|
|
12107
12109
|
return /* @__PURE__ */ l.jsxs("div", { className: fr, children: [
|
|
12108
|
-
!!p && !
|
|
12110
|
+
!!p && !ue && /* @__PURE__ */ l.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: [
|
|
12109
12111
|
/* @__PURE__ */ l.jsx("span", { children: p }),
|
|
12110
12112
|
/* @__PURE__ */ l.jsx(
|
|
12111
12113
|
ke,
|
|
12112
12114
|
{
|
|
12113
12115
|
variant: "ghost",
|
|
12114
12116
|
size: "sm",
|
|
12115
|
-
onClick: () =>
|
|
12117
|
+
onClick: () => Y(!0),
|
|
12116
12118
|
className: "text-red-800 hover:bg-red-100",
|
|
12117
12119
|
"aria-label": "Dismiss error",
|
|
12118
12120
|
children: /* @__PURE__ */ l.jsx(Kn, { size: 16 })
|
|
@@ -12153,12 +12155,12 @@ function To({
|
|
|
12153
12155
|
enableMessageEditing: a,
|
|
12154
12156
|
editingMessageId: H,
|
|
12155
12157
|
onStartReached: () => {
|
|
12156
|
-
|
|
12158
|
+
X();
|
|
12157
12159
|
},
|
|
12158
12160
|
onEdit: gt,
|
|
12159
12161
|
onRegenerate: Ut,
|
|
12160
12162
|
onCancelEdit: ut,
|
|
12161
|
-
emptyMessage:
|
|
12163
|
+
emptyMessage: P ?? void 0
|
|
12162
12164
|
}
|
|
12163
12165
|
),
|
|
12164
12166
|
/* @__PURE__ */ l.jsxs("div", { className: Ge, children: [
|
|
@@ -12183,7 +12185,7 @@ function To({
|
|
|
12183
12185
|
/* @__PURE__ */ l.jsx(
|
|
12184
12186
|
"input",
|
|
12185
12187
|
{
|
|
12186
|
-
ref:
|
|
12188
|
+
ref: fe,
|
|
12187
12189
|
type: "file",
|
|
12188
12190
|
multiple: !0,
|
|
12189
12191
|
onChange: (se) => Qe(se),
|
|
@@ -12217,15 +12219,15 @@ function To({
|
|
|
12217
12219
|
className: "hidden"
|
|
12218
12220
|
}
|
|
12219
12221
|
),
|
|
12220
|
-
|
|
12222
|
+
G && /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
12221
12223
|
/* @__PURE__ */ l.jsx(Kp, { className: "h-4 w-4 animate-spin" }),
|
|
12222
12224
|
" Uploading Excel file..."
|
|
12223
12225
|
] }),
|
|
12224
|
-
K && !
|
|
12225
|
-
|
|
12226
|
+
K && !G && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: K }),
|
|
12227
|
+
J && !G && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: J })
|
|
12226
12228
|
] })
|
|
12227
12229
|
] }),
|
|
12228
|
-
|
|
12230
|
+
L && /* @__PURE__ */ l.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: L }),
|
|
12229
12231
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
12230
12232
|
(s || i) && /* @__PURE__ */ l.jsxs(kS, { children: [
|
|
12231
12233
|
/* @__PURE__ */ l.jsx(PS, { asChild: !0, children: /* @__PURE__ */ l.jsx(
|
|
@@ -12243,7 +12245,7 @@ function To({
|
|
|
12243
12245
|
/* @__PURE__ */ l.jsxs(Hf, { align: "start", sideOffset: 6, className: "w-52", children: [
|
|
12244
12246
|
s && /* @__PURE__ */ l.jsxs(Ni, { onClick: () => {
|
|
12245
12247
|
var se;
|
|
12246
|
-
return (se =
|
|
12248
|
+
return (se = fe.current) == null ? void 0 : se.click();
|
|
12247
12249
|
}, className: "cursor-pointer", children: [
|
|
12248
12250
|
/* @__PURE__ */ l.jsx(Ya, { className: "h-4 w-4 mr-2" }),
|
|
12249
12251
|
" Attach files or images"
|
|
@@ -12253,9 +12255,9 @@ function To({
|
|
|
12253
12255
|
{
|
|
12254
12256
|
onClick: () => {
|
|
12255
12257
|
var se;
|
|
12256
|
-
|
|
12258
|
+
G || (se = Oe.current) == null || se.click();
|
|
12257
12259
|
},
|
|
12258
|
-
className: `cursor-pointer ${
|
|
12260
|
+
className: `cursor-pointer ${G ? "opacity-60 pointer-events-none" : ""}`,
|
|
12259
12261
|
children: [
|
|
12260
12262
|
/* @__PURE__ */ l.jsx(qp, { className: "h-4 w-4 mr-2" }),
|
|
12261
12263
|
" Upload Excel file"
|
|
@@ -12277,7 +12279,7 @@ function To({
|
|
|
12277
12279
|
onCancelEdit: ut,
|
|
12278
12280
|
onStop: w,
|
|
12279
12281
|
allowEmptySend: _.length > 0,
|
|
12280
|
-
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${H ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${
|
|
12282
|
+
textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${H ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${L ? "border-red-400" : ""} ${c.textarea || ""}`
|
|
12281
12283
|
}
|
|
12282
12284
|
) })
|
|
12283
12285
|
] })
|
|
@@ -12337,7 +12339,7 @@ var _a = "ScrollArea", [zf, pR] = Ht(_a), [$S, Pt] = zf(_a), Uf = f.forwardRef(
|
|
|
12337
12339
|
onCornerWidthChange: w,
|
|
12338
12340
|
onCornerHeightChange: R,
|
|
12339
12341
|
children: /* @__PURE__ */ l.jsx(
|
|
12340
|
-
|
|
12342
|
+
ge.div,
|
|
12341
12343
|
{
|
|
12342
12344
|
dir: k,
|
|
12343
12345
|
...i,
|
|
@@ -12370,7 +12372,7 @@ var Wf = "ScrollAreaViewport", Vf = f.forwardRef(
|
|
|
12370
12372
|
}
|
|
12371
12373
|
),
|
|
12372
12374
|
/* @__PURE__ */ l.jsx(
|
|
12373
|
-
|
|
12375
|
+
ge.div,
|
|
12374
12376
|
{
|
|
12375
12377
|
"data-radix-scroll-area-viewport": "",
|
|
12376
12378
|
...s,
|
|
@@ -12659,7 +12661,7 @@ var HS = f.forwardRef((e, t) => {
|
|
|
12659
12661
|
onThumbPositionChange: T,
|
|
12660
12662
|
onThumbPointerDown: st(a),
|
|
12661
12663
|
children: /* @__PURE__ */ l.jsx(
|
|
12662
|
-
|
|
12664
|
+
ge.div,
|
|
12663
12665
|
{
|
|
12664
12666
|
...m,
|
|
12665
12667
|
ref: p,
|
|
@@ -12701,7 +12703,7 @@ var HS = f.forwardRef((e, t) => {
|
|
|
12701
12703
|
return a(), h.addEventListener("scroll", m), () => h.removeEventListener("scroll", m);
|
|
12702
12704
|
}
|
|
12703
12705
|
}, [s.viewport, d, a]), /* @__PURE__ */ l.jsx(
|
|
12704
|
-
|
|
12706
|
+
ge.div,
|
|
12705
12707
|
{
|
|
12706
12708
|
"data-state": i.hasThumb ? "visible" : "hidden",
|
|
12707
12709
|
...o,
|
|
@@ -12739,7 +12741,7 @@ var KS = f.forwardRef((e, t) => {
|
|
|
12739
12741
|
const d = ((h = o.scrollbarY) == null ? void 0 : h.offsetWidth) || 0;
|
|
12740
12742
|
o.onCornerWidthChange(d), i(d);
|
|
12741
12743
|
}), u ? /* @__PURE__ */ l.jsx(
|
|
12742
|
-
|
|
12744
|
+
ge.div,
|
|
12743
12745
|
{
|
|
12744
12746
|
...r,
|
|
12745
12747
|
ref: t,
|
|
@@ -12864,55 +12866,55 @@ function ji({
|
|
|
12864
12866
|
createThread: g,
|
|
12865
12867
|
deleteThread: p,
|
|
12866
12868
|
renameThread: b
|
|
12867
|
-
} = Ui(), [w, y] =
|
|
12869
|
+
} = Ui(), [w, y] = de(m ?? []), [R, S] = de(!1), [T, C] = de(null), [N, I] = de(null), [k, D] = de(""), [H, U] = de(!1);
|
|
12868
12870
|
He(() => {
|
|
12869
12871
|
y(m ?? []);
|
|
12870
12872
|
}, [m]);
|
|
12871
|
-
const A = async (
|
|
12873
|
+
const A = async (F) => {
|
|
12872
12874
|
try {
|
|
12873
|
-
await h(
|
|
12875
|
+
await h(F), a == null || a(F), c == null || c(F);
|
|
12874
12876
|
} catch (K) {
|
|
12875
12877
|
console.error("Failed to select thread:", K);
|
|
12876
12878
|
}
|
|
12877
12879
|
}, $ = async () => {
|
|
12878
12880
|
try {
|
|
12879
12881
|
U(!0);
|
|
12880
|
-
const
|
|
12881
|
-
u == null || u(
|
|
12882
|
-
} catch (
|
|
12883
|
-
console.error("Failed to create thread:",
|
|
12882
|
+
const F = await g();
|
|
12883
|
+
u == null || u(F), a == null || a(F);
|
|
12884
|
+
} catch (F) {
|
|
12885
|
+
console.error("Failed to create thread:", F);
|
|
12884
12886
|
} finally {
|
|
12885
12887
|
U(!1);
|
|
12886
12888
|
}
|
|
12887
|
-
},
|
|
12889
|
+
}, L = async (F, K) => {
|
|
12888
12890
|
if (K.stopPropagation(), !!confirm("Delete this thread?"))
|
|
12889
12891
|
try {
|
|
12890
|
-
await p(
|
|
12891
|
-
} catch (
|
|
12892
|
-
console.error("Failed to delete thread:",
|
|
12892
|
+
await p(F), d == null || d(F);
|
|
12893
|
+
} catch (ye) {
|
|
12894
|
+
console.error("Failed to delete thread:", ye);
|
|
12893
12895
|
}
|
|
12894
|
-
},
|
|
12895
|
-
K.stopPropagation(), I(
|
|
12896
|
-
}, _ = async (
|
|
12896
|
+
}, Z = (F, K) => {
|
|
12897
|
+
K.stopPropagation(), I(F.threadId), D(F.title || `Thread ${F.threadId.slice(0, 8)}`);
|
|
12898
|
+
}, _ = async (F) => {
|
|
12897
12899
|
if (k.trim())
|
|
12898
12900
|
try {
|
|
12899
|
-
await b(
|
|
12901
|
+
await b(F, k.trim()), I(null), D("");
|
|
12900
12902
|
} catch (K) {
|
|
12901
12903
|
console.error("Failed to update title:", K);
|
|
12902
12904
|
}
|
|
12903
|
-
},
|
|
12905
|
+
}, O = () => {
|
|
12904
12906
|
I(null), D("");
|
|
12905
|
-
},
|
|
12906
|
-
|
|
12907
|
-
},
|
|
12908
|
-
if (!
|
|
12907
|
+
}, G = (F, K) => {
|
|
12908
|
+
F.key === "Enter" ? _(K) : F.key === "Escape" && O();
|
|
12909
|
+
}, Q = (F) => {
|
|
12910
|
+
if (!F) return "";
|
|
12909
12911
|
try {
|
|
12910
|
-
const K = new Date(
|
|
12911
|
-
return
|
|
12912
|
+
const K = new Date(F), ue = (/* @__PURE__ */ new Date()).getTime() - K.getTime(), Y = Math.floor(ue / (1e3 * 60 * 60 * 24));
|
|
12913
|
+
return Y === 0 ? K.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : Y === 1 ? "Yesterday" : Y < 7 ? `${Y} days ago` : K.toLocaleDateString();
|
|
12912
12914
|
} catch {
|
|
12913
12915
|
return "";
|
|
12914
12916
|
}
|
|
12915
|
-
},
|
|
12917
|
+
}, J = (F) => F.title || `Thread ${F.threadId.slice(0, 8)}`;
|
|
12916
12918
|
return /* @__PURE__ */ l.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
12917
12919
|
t && /* @__PURE__ */ l.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__ */ l.jsx(
|
|
12918
12920
|
ke,
|
|
@@ -12934,32 +12936,32 @@ function ji({
|
|
|
12934
12936
|
children: /* @__PURE__ */ l.jsx("div", { className: "p-2 space-y-1 pb-4", children: R ? /* @__PURE__ */ l.jsx("div", { className: "text-center py-8 text-slate-400", children: "Loading…" }) : w.length === 0 ? /* @__PURE__ */ l.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
|
|
12935
12937
|
/* @__PURE__ */ l.jsx(Jp, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
|
|
12936
12938
|
/* @__PURE__ */ l.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
|
|
12937
|
-
] }) : w.slice().sort((
|
|
12939
|
+
] }) : w.slice().sort((F, K) => new Date(K.updatedAt || K.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ l.jsxs(
|
|
12938
12940
|
"div",
|
|
12939
12941
|
{
|
|
12940
|
-
onClick: () => A(
|
|
12941
|
-
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? x) ===
|
|
12942
|
+
onClick: () => A(F.threadId),
|
|
12943
|
+
className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? x) === F.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`,
|
|
12942
12944
|
children: [
|
|
12943
12945
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
12944
|
-
/* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: N ===
|
|
12945
|
-
/* @__PURE__ */ l.jsx(Dr, { value: k, onChange: (K) => D(K.target.value), onKeyDown: (K) =>
|
|
12946
|
-
/* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick: () => _(
|
|
12947
|
-
/* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick:
|
|
12946
|
+
/* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: N === F.threadId ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", onClick: (K) => K.stopPropagation(), children: [
|
|
12947
|
+
/* @__PURE__ */ l.jsx(Dr, { value: k, onChange: (K) => D(K.target.value), onKeyDown: (K) => G(K, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
12948
|
+
/* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick: () => _(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Bi, { size: 12 }) }),
|
|
12949
|
+
/* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick: O, className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Kn, { size: 12 }) })
|
|
12948
12950
|
] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
12949
|
-
/* @__PURE__ */ l.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children:
|
|
12951
|
+
/* @__PURE__ */ l.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: J(F) }),
|
|
12950
12952
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
12951
12953
|
/* @__PURE__ */ l.jsx(Zp, { size: 10 }),
|
|
12952
|
-
/* @__PURE__ */ l.jsx("span", { children:
|
|
12954
|
+
/* @__PURE__ */ l.jsx("span", { children: Q(F.updatedAt || F.createdAt) })
|
|
12953
12955
|
] })
|
|
12954
12956
|
] }) }),
|
|
12955
12957
|
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
|
|
12956
|
-
r && N !==
|
|
12958
|
+
r && N !== F.threadId && /* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick: (K) => Z(F, K), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(Sc, { size: 12 }) }),
|
|
12957
12959
|
n && /* @__PURE__ */ l.jsx(
|
|
12958
12960
|
ke,
|
|
12959
12961
|
{
|
|
12960
12962
|
variant: "ghost",
|
|
12961
12963
|
size: "sm",
|
|
12962
|
-
onClick: (K) => F
|
|
12964
|
+
onClick: (K) => L(F.threadId, K),
|
|
12963
12965
|
className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
|
|
12964
12966
|
title: "Delete thread",
|
|
12965
12967
|
children: /* @__PURE__ */ l.jsx(Qp, { size: 12 })
|
|
@@ -12967,10 +12969,10 @@ function ji({
|
|
|
12967
12969
|
)
|
|
12968
12970
|
] })
|
|
12969
12971
|
] }),
|
|
12970
|
-
i ===
|
|
12972
|
+
i === F.threadId && /* @__PURE__ */ l.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-400 rounded-r" })
|
|
12971
12973
|
]
|
|
12972
12974
|
},
|
|
12973
|
-
|
|
12975
|
+
F.threadId
|
|
12974
12976
|
)) })
|
|
12975
12977
|
}
|
|
12976
12978
|
)
|
|
@@ -13089,7 +13091,7 @@ function rC() {
|
|
|
13089
13091
|
var oC = "Separator", mc = "horizontal", sC = ["horizontal", "vertical"], ah = f.forwardRef((e, t) => {
|
|
13090
13092
|
const { decorative: n, orientation: r = mc, ...o } = e, s = iC(r) ? r : mc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
|
|
13091
13093
|
return /* @__PURE__ */ l.jsx(
|
|
13092
|
-
|
|
13094
|
+
ge.div,
|
|
13093
13095
|
{
|
|
13094
13096
|
"data-orientation": s,
|
|
13095
13097
|
...a,
|
|
@@ -13224,7 +13226,7 @@ var ph = Object.freeze({
|
|
|
13224
13226
|
wordWrap: "normal"
|
|
13225
13227
|
}), uC = "VisuallyHidden", mh = f.forwardRef(
|
|
13226
13228
|
(e, t) => /* @__PURE__ */ l.jsx(
|
|
13227
|
-
|
|
13229
|
+
ge.span,
|
|
13228
13230
|
{
|
|
13229
13231
|
...e,
|
|
13230
13232
|
ref: t,
|
|
@@ -13325,7 +13327,7 @@ var ki = "TooltipTrigger", bh = f.forwardRef(
|
|
|
13325
13327
|
(e, t) => {
|
|
13326
13328
|
const { __scopeTooltip: n, ...r } = e, o = Rs(ki, n), s = Ba(ki, n), i = Ts(n), a = f.useRef(null), c = Te(t, a, o.onTriggerChange), u = f.useRef(!1), d = f.useRef(!1), h = f.useCallback(() => u.current = !1, []);
|
|
13327
13329
|
return f.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ l.jsx(Ca, { asChild: !0, ...i, children: /* @__PURE__ */ l.jsx(
|
|
13328
|
-
|
|
13330
|
+
ge.button,
|
|
13329
13331
|
{
|
|
13330
13332
|
"aria-describedby": o.open ? o.contentId : void 0,
|
|
13331
13333
|
"data-state": o.stateAttribute,
|
|
@@ -14091,7 +14093,7 @@ function yR({
|
|
|
14091
14093
|
] }) });
|
|
14092
14094
|
}
|
|
14093
14095
|
var ZC = "Label", Fh = f.forwardRef((e, t) => /* @__PURE__ */ l.jsx(
|
|
14094
|
-
|
|
14096
|
+
ge.label,
|
|
14095
14097
|
{
|
|
14096
14098
|
...e,
|
|
14097
14099
|
ref: t,
|
|
@@ -14139,7 +14141,7 @@ var Ns = "Switch", [eT, SR] = Ht(Ns), [tT, nT] = eT(Ns), Hh = f.forwardRef(
|
|
|
14139
14141
|
});
|
|
14140
14142
|
return /* @__PURE__ */ l.jsxs(tT, { scope: n, checked: b, disabled: a, children: [
|
|
14141
14143
|
/* @__PURE__ */ l.jsx(
|
|
14142
|
-
|
|
14144
|
+
ge.button,
|
|
14143
14145
|
{
|
|
14144
14146
|
type: "button",
|
|
14145
14147
|
role: "switch",
|
|
@@ -14178,7 +14180,7 @@ var zh = "SwitchThumb", Uh = f.forwardRef(
|
|
|
14178
14180
|
(e, t) => {
|
|
14179
14181
|
const { __scopeSwitch: n, ...r } = e, o = nT(zh, n);
|
|
14180
14182
|
return /* @__PURE__ */ l.jsx(
|
|
14181
|
-
|
|
14183
|
+
ge.span,
|
|
14182
14184
|
{
|
|
14183
14185
|
"data-state": Vh(o.checked),
|
|
14184
14186
|
"data-disabled": o.disabled ? "" : void 0,
|
|
@@ -14284,7 +14286,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Pn = "Sele
|
|
|
14284
14286
|
defaultProp: a,
|
|
14285
14287
|
onChange: c,
|
|
14286
14288
|
caller: Pn
|
|
14287
|
-
}), D = f.useRef(null), H = p ? x || !!p.closest("form") : !0, [U, A] = f.useState(/* @__PURE__ */ new Set()), $ = Array.from(U).map((
|
|
14289
|
+
}), D = f.useRef(null), H = p ? x || !!p.closest("form") : !0, [U, A] = f.useState(/* @__PURE__ */ new Set()), $ = Array.from(U).map((L) => L.props.value).join(";");
|
|
14288
14290
|
return /* @__PURE__ */ l.jsx(Sa, { ...g, children: /* @__PURE__ */ l.jsxs(
|
|
14289
14291
|
lT,
|
|
14290
14292
|
{
|
|
@@ -14309,13 +14311,13 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Pn = "Sele
|
|
|
14309
14311
|
cT,
|
|
14310
14312
|
{
|
|
14311
14313
|
scope: e.__scopeSelect,
|
|
14312
|
-
onNativeOptionAdd: f.useCallback((
|
|
14313
|
-
A((
|
|
14314
|
+
onNativeOptionAdd: f.useCallback((L) => {
|
|
14315
|
+
A((Z) => new Set(Z).add(L));
|
|
14314
14316
|
}, []),
|
|
14315
|
-
onNativeOptionRemove: f.useCallback((
|
|
14316
|
-
A((
|
|
14317
|
-
const _ = new Set(
|
|
14318
|
-
return _.delete(
|
|
14317
|
+
onNativeOptionRemove: f.useCallback((L) => {
|
|
14318
|
+
A((Z) => {
|
|
14319
|
+
const _ = new Set(Z);
|
|
14320
|
+
return _.delete(L), _;
|
|
14319
14321
|
});
|
|
14320
14322
|
}, []),
|
|
14321
14323
|
children: n
|
|
@@ -14330,7 +14332,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], Pn = "Sele
|
|
|
14330
14332
|
name: d,
|
|
14331
14333
|
autoComplete: h,
|
|
14332
14334
|
value: I,
|
|
14333
|
-
onChange: (
|
|
14335
|
+
onChange: (L) => k(L.target.value),
|
|
14334
14336
|
disabled: m,
|
|
14335
14337
|
form: x,
|
|
14336
14338
|
children: [
|
|
@@ -14357,7 +14359,7 @@ var Yh = "SelectTrigger", qh = f.forwardRef(
|
|
|
14357
14359
|
});
|
|
14358
14360
|
};
|
|
14359
14361
|
return /* @__PURE__ */ l.jsx(Ca, { asChild: !0, ...s, children: /* @__PURE__ */ l.jsx(
|
|
14360
|
-
|
|
14362
|
+
ge.button,
|
|
14361
14363
|
{
|
|
14362
14364
|
type: "button",
|
|
14363
14365
|
role: "combobox",
|
|
@@ -14395,7 +14397,7 @@ var Xh = "SelectValue", Jh = f.forwardRef(
|
|
|
14395
14397
|
return ot(() => {
|
|
14396
14398
|
u(d);
|
|
14397
14399
|
}, [u, d]), /* @__PURE__ */ l.jsx(
|
|
14398
|
-
|
|
14400
|
+
ge.span,
|
|
14399
14401
|
{
|
|
14400
14402
|
...a,
|
|
14401
14403
|
ref: h,
|
|
@@ -14409,7 +14411,7 @@ Jh.displayName = Xh;
|
|
|
14409
14411
|
var dT = "SelectIcon", Zh = f.forwardRef(
|
|
14410
14412
|
(e, t) => {
|
|
14411
14413
|
const { __scopeSelect: n, children: r, ...o } = e;
|
|
14412
|
-
return /* @__PURE__ */ l.jsx(
|
|
14414
|
+
return /* @__PURE__ */ l.jsx(ge.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
|
|
14413
14415
|
}
|
|
14414
14416
|
);
|
|
14415
14417
|
Zh.displayName = dT;
|
|
@@ -14453,65 +14455,65 @@ var Ot = 10, [tp, wn] = dr(_n), hT = "SelectContentImpl", pT = Zn("SelectContent
|
|
|
14453
14455
|
avoidCollisions: p,
|
|
14454
14456
|
//
|
|
14455
14457
|
...b
|
|
14456
|
-
} = e, w = bn(_n, n), [y, R] = f.useState(null), [S, T] = f.useState(null), C = Te(t, (
|
|
14458
|
+
} = e, w = bn(_n, n), [y, R] = f.useState(null), [S, T] = f.useState(null), C = Te(t, (Y) => R(Y)), [N, I] = f.useState(null), [k, D] = f.useState(
|
|
14457
14459
|
null
|
|
14458
14460
|
), H = js(n), [U, A] = f.useState(!1), $ = f.useRef(!1);
|
|
14459
14461
|
f.useEffect(() => {
|
|
14460
14462
|
if (y) return ca(y);
|
|
14461
14463
|
}, [y]), la();
|
|
14462
|
-
const
|
|
14463
|
-
(
|
|
14464
|
-
const [
|
|
14465
|
-
for (const oe of
|
|
14466
|
-
if (oe === ce || (oe == null || oe.scrollIntoView({ block: "nearest" }), oe ===
|
|
14464
|
+
const L = f.useCallback(
|
|
14465
|
+
(Y) => {
|
|
14466
|
+
const [P, ...q] = H().map((oe) => oe.ref.current), [ee] = q.slice(-1), ce = document.activeElement;
|
|
14467
|
+
for (const oe of Y)
|
|
14468
|
+
if (oe === ce || (oe == null || oe.scrollIntoView({ block: "nearest" }), oe === P && S && (S.scrollTop = 0), oe === ee && S && (S.scrollTop = S.scrollHeight), oe == null || oe.focus(), document.activeElement !== ce)) return;
|
|
14467
14469
|
},
|
|
14468
14470
|
[H, S]
|
|
14469
|
-
),
|
|
14470
|
-
() =>
|
|
14471
|
-
[
|
|
14471
|
+
), Z = f.useCallback(
|
|
14472
|
+
() => L([N, y]),
|
|
14473
|
+
[L, N, y]
|
|
14472
14474
|
);
|
|
14473
14475
|
f.useEffect(() => {
|
|
14474
|
-
U &&
|
|
14475
|
-
}, [U,
|
|
14476
|
-
const { onOpenChange: _, triggerPointerDownPosRef:
|
|
14476
|
+
U && Z();
|
|
14477
|
+
}, [U, Z]);
|
|
14478
|
+
const { onOpenChange: _, triggerPointerDownPosRef: O } = w;
|
|
14477
14479
|
f.useEffect(() => {
|
|
14478
14480
|
if (y) {
|
|
14479
|
-
let
|
|
14480
|
-
const
|
|
14481
|
+
let Y = { x: 0, y: 0 };
|
|
14482
|
+
const P = (ee) => {
|
|
14481
14483
|
var ce, oe;
|
|
14482
|
-
|
|
14483
|
-
x: Math.abs(Math.round(ee.pageX) - (((ce =
|
|
14484
|
-
y: Math.abs(Math.round(ee.pageY) - (((oe =
|
|
14484
|
+
Y = {
|
|
14485
|
+
x: Math.abs(Math.round(ee.pageX) - (((ce = O.current) == null ? void 0 : ce.x) ?? 0)),
|
|
14486
|
+
y: Math.abs(Math.round(ee.pageY) - (((oe = O.current) == null ? void 0 : oe.y) ?? 0))
|
|
14485
14487
|
};
|
|
14486
|
-
},
|
|
14487
|
-
|
|
14488
|
+
}, q = (ee) => {
|
|
14489
|
+
Y.x <= 10 && Y.y <= 10 ? ee.preventDefault() : y.contains(ee.target) || _(!1), document.removeEventListener("pointermove", P), O.current = null;
|
|
14488
14490
|
};
|
|
14489
|
-
return
|
|
14490
|
-
document.removeEventListener("pointermove",
|
|
14491
|
+
return O.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", q, { capture: !0, once: !0 })), () => {
|
|
14492
|
+
document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", q, { capture: !0 });
|
|
14491
14493
|
};
|
|
14492
14494
|
}
|
|
14493
|
-
}, [y, _,
|
|
14494
|
-
const
|
|
14495
|
-
return window.addEventListener("blur",
|
|
14496
|
-
window.removeEventListener("blur",
|
|
14495
|
+
}, [y, _, O]), f.useEffect(() => {
|
|
14496
|
+
const Y = () => _(!1);
|
|
14497
|
+
return window.addEventListener("blur", Y), window.addEventListener("resize", Y), () => {
|
|
14498
|
+
window.removeEventListener("blur", Y), window.removeEventListener("resize", Y);
|
|
14497
14499
|
};
|
|
14498
14500
|
}, [_]);
|
|
14499
|
-
const [
|
|
14500
|
-
const
|
|
14501
|
+
const [G, Q] = bp((Y) => {
|
|
14502
|
+
const P = H().filter((ce) => !ce.disabled), q = P.find((ce) => ce.ref.current === document.activeElement), ee = wp(P, Y, q);
|
|
14501
14503
|
ee && setTimeout(() => ee.ref.current.focus());
|
|
14502
|
-
}),
|
|
14503
|
-
(
|
|
14504
|
-
const ee = !$.current && !
|
|
14505
|
-
(w.value !== void 0 && w.value ===
|
|
14504
|
+
}), J = f.useCallback(
|
|
14505
|
+
(Y, P, q) => {
|
|
14506
|
+
const ee = !$.current && !q;
|
|
14507
|
+
(w.value !== void 0 && w.value === P || ee) && (I(Y), ee && ($.current = !0));
|
|
14506
14508
|
},
|
|
14507
14509
|
[w.value]
|
|
14508
|
-
),
|
|
14509
|
-
(
|
|
14510
|
-
const ee = !$.current && !
|
|
14511
|
-
(w.value !== void 0 && w.value ===
|
|
14510
|
+
), F = f.useCallback(() => y == null ? void 0 : y.focus(), [y]), K = f.useCallback(
|
|
14511
|
+
(Y, P, q) => {
|
|
14512
|
+
const ee = !$.current && !q;
|
|
14513
|
+
(w.value !== void 0 && w.value === P || ee) && D(Y);
|
|
14512
14514
|
},
|
|
14513
14515
|
[w.value]
|
|
14514
|
-
),
|
|
14516
|
+
), ye = r === "popper" ? Pi : rp, ue = ye === Pi ? {
|
|
14515
14517
|
side: a,
|
|
14516
14518
|
sideOffset: c,
|
|
14517
14519
|
align: u,
|
|
@@ -14530,26 +14532,26 @@ var Ot = 10, [tp, wn] = dr(_n), hT = "SelectContentImpl", pT = Zn("SelectContent
|
|
|
14530
14532
|
content: y,
|
|
14531
14533
|
viewport: S,
|
|
14532
14534
|
onViewportChange: T,
|
|
14533
|
-
itemRefCallback:
|
|
14535
|
+
itemRefCallback: J,
|
|
14534
14536
|
selectedItem: N,
|
|
14535
|
-
onItemLeave:
|
|
14537
|
+
onItemLeave: F,
|
|
14536
14538
|
itemTextRefCallback: K,
|
|
14537
|
-
focusSelectedItem:
|
|
14539
|
+
focusSelectedItem: Z,
|
|
14538
14540
|
selectedItemText: k,
|
|
14539
14541
|
position: r,
|
|
14540
14542
|
isPositioned: U,
|
|
14541
|
-
searchRef:
|
|
14543
|
+
searchRef: G,
|
|
14542
14544
|
children: /* @__PURE__ */ l.jsx(ls, { as: pT, allowPinchZoom: !0, children: /* @__PURE__ */ l.jsx(
|
|
14543
14545
|
ss,
|
|
14544
14546
|
{
|
|
14545
14547
|
asChild: !0,
|
|
14546
14548
|
trapped: w.open,
|
|
14547
|
-
onMountAutoFocus: (
|
|
14548
|
-
|
|
14549
|
+
onMountAutoFocus: (Y) => {
|
|
14550
|
+
Y.preventDefault();
|
|
14549
14551
|
},
|
|
14550
|
-
onUnmountAutoFocus: te(o, (
|
|
14551
|
-
var
|
|
14552
|
-
(
|
|
14552
|
+
onUnmountAutoFocus: te(o, (Y) => {
|
|
14553
|
+
var P;
|
|
14554
|
+
(P = w.trigger) == null || P.focus({ preventScroll: !0 }), Y.preventDefault();
|
|
14553
14555
|
}),
|
|
14554
14556
|
children: /* @__PURE__ */ l.jsx(
|
|
14555
14557
|
Gr,
|
|
@@ -14558,18 +14560,18 @@ var Ot = 10, [tp, wn] = dr(_n), hT = "SelectContentImpl", pT = Zn("SelectContent
|
|
|
14558
14560
|
disableOutsidePointerEvents: !0,
|
|
14559
14561
|
onEscapeKeyDown: s,
|
|
14560
14562
|
onPointerDownOutside: i,
|
|
14561
|
-
onFocusOutside: (
|
|
14563
|
+
onFocusOutside: (Y) => Y.preventDefault(),
|
|
14562
14564
|
onDismiss: () => w.onOpenChange(!1),
|
|
14563
14565
|
children: /* @__PURE__ */ l.jsx(
|
|
14564
|
-
|
|
14566
|
+
ye,
|
|
14565
14567
|
{
|
|
14566
14568
|
role: "listbox",
|
|
14567
14569
|
id: w.contentId,
|
|
14568
14570
|
"data-state": w.open ? "open" : "closed",
|
|
14569
14571
|
dir: w.dir,
|
|
14570
|
-
onContextMenu: (
|
|
14572
|
+
onContextMenu: (Y) => Y.preventDefault(),
|
|
14571
14573
|
...b,
|
|
14572
|
-
...
|
|
14574
|
+
...ue,
|
|
14573
14575
|
onPlaced: () => A(!0),
|
|
14574
14576
|
ref: C,
|
|
14575
14577
|
style: {
|
|
@@ -14580,15 +14582,15 @@ var Ot = 10, [tp, wn] = dr(_n), hT = "SelectContentImpl", pT = Zn("SelectContent
|
|
|
14580
14582
|
outline: "none",
|
|
14581
14583
|
...b.style
|
|
14582
14584
|
},
|
|
14583
|
-
onKeyDown: te(b.onKeyDown, (
|
|
14584
|
-
const
|
|
14585
|
-
if (
|
|
14585
|
+
onKeyDown: te(b.onKeyDown, (Y) => {
|
|
14586
|
+
const P = Y.ctrlKey || Y.altKey || Y.metaKey;
|
|
14587
|
+
if (Y.key === "Tab" && Y.preventDefault(), !P && Y.key.length === 1 && Q(Y.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(Y.key)) {
|
|
14586
14588
|
let ee = H().filter((ce) => !ce.disabled).map((ce) => ce.ref.current);
|
|
14587
|
-
if (["ArrowUp", "End"].includes(
|
|
14588
|
-
const ce =
|
|
14589
|
+
if (["ArrowUp", "End"].includes(Y.key) && (ee = ee.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(Y.key)) {
|
|
14590
|
+
const ce = Y.target, oe = ee.indexOf(ce);
|
|
14589
14591
|
ee = ee.slice(oe + 1);
|
|
14590
14592
|
}
|
|
14591
|
-
setTimeout(() =>
|
|
14593
|
+
setTimeout(() => L(ee)), Y.preventDefault();
|
|
14592
14594
|
}
|
|
14593
14595
|
})
|
|
14594
14596
|
}
|
|
@@ -14607,32 +14609,32 @@ var mT = "SelectItemAlignedPosition", rp = f.forwardRef((e, t) => {
|
|
|
14607
14609
|
if (s.trigger && s.valueNode && a && u && g && p && b) {
|
|
14608
14610
|
const C = s.trigger.getBoundingClientRect(), N = u.getBoundingClientRect(), I = s.valueNode.getBoundingClientRect(), k = b.getBoundingClientRect();
|
|
14609
14611
|
if (s.dir !== "rtl") {
|
|
14610
|
-
const ce = k.left - N.left, oe = I.left - ce, Ie = C.left - oe, Me = C.width + Ie, De = Math.max(Me, N.width),
|
|
14612
|
+
const ce = k.left - N.left, oe = I.left - ce, Ie = C.left - oe, Me = C.width + Ie, De = Math.max(Me, N.width), fe = window.innerWidth - Ot, Oe = Ii(oe, [
|
|
14611
14613
|
Ot,
|
|
14612
14614
|
// Prevents the content from going off the starting edge of the
|
|
14613
14615
|
// viewport. It may still go off the ending edge, but this can be
|
|
14614
14616
|
// controlled by the user since they may want to manage overflow in a
|
|
14615
14617
|
// specific way.
|
|
14616
14618
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
14617
|
-
Math.max(Ot,
|
|
14619
|
+
Math.max(Ot, fe - De)
|
|
14618
14620
|
]);
|
|
14619
14621
|
a.style.minWidth = Me + "px", a.style.left = Oe + "px";
|
|
14620
14622
|
} else {
|
|
14621
|
-
const ce = N.right - k.right, oe = window.innerWidth - I.right - ce, Ie = window.innerWidth - C.right - oe, Me = C.width + Ie, De = Math.max(Me, N.width),
|
|
14623
|
+
const ce = N.right - k.right, oe = window.innerWidth - I.right - ce, Ie = window.innerWidth - C.right - oe, Me = C.width + Ie, De = Math.max(Me, N.width), fe = window.innerWidth - Ot, Oe = Ii(oe, [
|
|
14622
14624
|
Ot,
|
|
14623
|
-
Math.max(Ot,
|
|
14625
|
+
Math.max(Ot, fe - De)
|
|
14624
14626
|
]);
|
|
14625
14627
|
a.style.minWidth = Me + "px", a.style.right = Oe + "px";
|
|
14626
14628
|
}
|
|
14627
|
-
const D = m(), H = window.innerHeight - Ot * 2, U = g.scrollHeight, A = window.getComputedStyle(u), $ = parseInt(A.borderTopWidth, 10),
|
|
14628
|
-
if (
|
|
14629
|
+
const D = m(), H = window.innerHeight - Ot * 2, U = g.scrollHeight, A = window.getComputedStyle(u), $ = parseInt(A.borderTopWidth, 10), L = parseInt(A.paddingTop, 10), Z = parseInt(A.borderBottomWidth, 10), _ = parseInt(A.paddingBottom, 10), O = $ + L + U + _ + Z, G = Math.min(p.offsetHeight * 5, O), Q = window.getComputedStyle(g), J = parseInt(Q.paddingTop, 10), F = parseInt(Q.paddingBottom, 10), K = C.top + C.height / 2 - Ot, ye = H - K, ue = p.offsetHeight / 2, Y = p.offsetTop + ue, P = $ + L + Y, q = O - P;
|
|
14630
|
+
if (P <= K) {
|
|
14629
14631
|
const ce = D.length > 0 && p === D[D.length - 1].ref.current;
|
|
14630
14632
|
a.style.bottom = "0px";
|
|
14631
14633
|
const oe = u.clientHeight - g.offsetTop - g.offsetHeight, Ie = Math.max(
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
(ce ?
|
|
14635
|
-
), Me =
|
|
14634
|
+
ye,
|
|
14635
|
+
ue + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
14636
|
+
(ce ? F : 0) + oe + Z
|
|
14637
|
+
), Me = P + Ie;
|
|
14636
14638
|
a.style.height = Me + "px";
|
|
14637
14639
|
} else {
|
|
14638
14640
|
const ce = D.length > 0 && p === D[0].ref.current;
|
|
@@ -14640,11 +14642,11 @@ var mT = "SelectItemAlignedPosition", rp = f.forwardRef((e, t) => {
|
|
|
14640
14642
|
const Ie = Math.max(
|
|
14641
14643
|
K,
|
|
14642
14644
|
$ + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
14643
|
-
(ce ?
|
|
14644
|
-
) +
|
|
14645
|
-
a.style.height = Ie + "px", g.scrollTop =
|
|
14645
|
+
(ce ? J : 0) + ue
|
|
14646
|
+
) + q;
|
|
14647
|
+
a.style.height = Ie + "px", g.scrollTop = P - K + g.offsetTop;
|
|
14646
14648
|
}
|
|
14647
|
-
a.style.margin = `${Ot}px 0`, a.style.minHeight =
|
|
14649
|
+
a.style.margin = `${Ot}px 0`, a.style.minHeight = G + "px", a.style.maxHeight = H + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
|
|
14648
14650
|
}
|
|
14649
14651
|
}, [
|
|
14650
14652
|
m,
|
|
@@ -14687,7 +14689,7 @@ var mT = "SelectItemAlignedPosition", rp = f.forwardRef((e, t) => {
|
|
|
14687
14689
|
zIndex: R
|
|
14688
14690
|
},
|
|
14689
14691
|
children: /* @__PURE__ */ l.jsx(
|
|
14690
|
-
|
|
14692
|
+
ge.div,
|
|
14691
14693
|
{
|
|
14692
14694
|
...o,
|
|
14693
14695
|
ref: h,
|
|
@@ -14750,7 +14752,7 @@ var [xT, $a] = dr(_n, {}), _i = "SelectViewport", op = f.forwardRef(
|
|
|
14750
14752
|
}
|
|
14751
14753
|
),
|
|
14752
14754
|
/* @__PURE__ */ l.jsx(Is.Slot, { scope: n, children: /* @__PURE__ */ l.jsx(
|
|
14753
|
-
|
|
14755
|
+
ge.div,
|
|
14754
14756
|
{
|
|
14755
14757
|
"data-radix-select-viewport": "",
|
|
14756
14758
|
role: "presentation",
|
|
@@ -14792,14 +14794,14 @@ op.displayName = _i;
|
|
|
14792
14794
|
var sp = "SelectGroup", [vT, bT] = dr(sp), wT = f.forwardRef(
|
|
14793
14795
|
(e, t) => {
|
|
14794
14796
|
const { __scopeSelect: n, ...r } = e, o = Dt();
|
|
14795
|
-
return /* @__PURE__ */ l.jsx(vT, { scope: n, id: o, children: /* @__PURE__ */ l.jsx(
|
|
14797
|
+
return /* @__PURE__ */ l.jsx(vT, { scope: n, id: o, children: /* @__PURE__ */ l.jsx(ge.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
14796
14798
|
}
|
|
14797
14799
|
);
|
|
14798
14800
|
wT.displayName = sp;
|
|
14799
14801
|
var ip = "SelectLabel", ap = f.forwardRef(
|
|
14800
14802
|
(e, t) => {
|
|
14801
14803
|
const { __scopeSelect: n, ...r } = e, o = bT(ip, n);
|
|
14802
|
-
return /* @__PURE__ */ l.jsx(
|
|
14804
|
+
return /* @__PURE__ */ l.jsx(ge.div, { id: o.id, ...r, ref: t });
|
|
14803
14805
|
}
|
|
14804
14806
|
);
|
|
14805
14807
|
ap.displayName = ip;
|
|
@@ -14843,7 +14845,7 @@ var Vo = "SelectItem", [yT, lp] = dr(Vo), cp = f.forwardRef(
|
|
|
14843
14845
|
disabled: o,
|
|
14844
14846
|
textValue: d,
|
|
14845
14847
|
children: /* @__PURE__ */ l.jsx(
|
|
14846
|
-
|
|
14848
|
+
ge.div,
|
|
14847
14849
|
{
|
|
14848
14850
|
role: "option",
|
|
14849
14851
|
"aria-labelledby": g,
|
|
@@ -14902,7 +14904,7 @@ var wr = "SelectItemText", up = f.forwardRef(
|
|
|
14902
14904
|
[c.disabled, c.value, v]
|
|
14903
14905
|
), { onNativeOptionAdd: g, onNativeOptionRemove: p } = u;
|
|
14904
14906
|
return ot(() => (g(x), () => p(x)), [g, p, x]), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
14905
|
-
/* @__PURE__ */ l.jsx(
|
|
14907
|
+
/* @__PURE__ */ l.jsx(ge.span, { id: c.textId, ...s, ref: m }),
|
|
14906
14908
|
c.isSelected && i.valueNode && !i.valueNodeHasChildren ? Go.createPortal(s.children, i.valueNode) : null
|
|
14907
14909
|
] });
|
|
14908
14910
|
}
|
|
@@ -14911,7 +14913,7 @@ up.displayName = wr;
|
|
|
14911
14913
|
var dp = "SelectItemIndicator", fp = f.forwardRef(
|
|
14912
14914
|
(e, t) => {
|
|
14913
14915
|
const { __scopeSelect: n, ...r } = e;
|
|
14914
|
-
return lp(dp, n).isSelected ? /* @__PURE__ */ l.jsx(
|
|
14916
|
+
return lp(dp, n).isSelected ? /* @__PURE__ */ l.jsx(ge.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
14915
14917
|
}
|
|
14916
14918
|
);
|
|
14917
14919
|
fp.displayName = dp;
|
|
@@ -14972,7 +14974,7 @@ var mp = f.forwardRef((e, t) => {
|
|
|
14972
14974
|
const u = a().find((h) => h.ref.current === document.activeElement);
|
|
14973
14975
|
(d = u == null ? void 0 : u.ref.current) == null || d.scrollIntoView({ block: "nearest" });
|
|
14974
14976
|
}, [a]), /* @__PURE__ */ l.jsx(
|
|
14975
|
-
|
|
14977
|
+
ge.div,
|
|
14976
14978
|
{
|
|
14977
14979
|
"aria-hidden": !0,
|
|
14978
14980
|
...o,
|
|
@@ -14993,7 +14995,7 @@ var mp = f.forwardRef((e, t) => {
|
|
|
14993
14995
|
}), ST = "SelectSeparator", gp = f.forwardRef(
|
|
14994
14996
|
(e, t) => {
|
|
14995
14997
|
const { __scopeSelect: n, ...r } = e;
|
|
14996
|
-
return /* @__PURE__ */ l.jsx(
|
|
14998
|
+
return /* @__PURE__ */ l.jsx(ge.div, { "aria-hidden": !0, ...r, ref: t });
|
|
14997
14999
|
}
|
|
14998
15000
|
);
|
|
14999
15001
|
gp.displayName = ST;
|
|
@@ -15019,7 +15021,7 @@ var TT = "SelectBubbleInput", xp = f.forwardRef(
|
|
|
15019
15021
|
d.call(a, t), a.dispatchEvent(h);
|
|
15020
15022
|
}
|
|
15021
15023
|
}, [i, t]), /* @__PURE__ */ l.jsx(
|
|
15022
|
-
|
|
15024
|
+
ge.select,
|
|
15023
15025
|
{
|
|
15024
15026
|
...n,
|
|
15025
15027
|
style: { ...ph, ...n.style },
|
|
@@ -15237,7 +15239,7 @@ const LT = {
|
|
|
15237
15239
|
}
|
|
15238
15240
|
};
|
|
15239
15241
|
function TR({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
15240
|
-
const [r, o] =
|
|
15242
|
+
const [r, o] = de(!1), [s, i] = de(!1), [a, c] = de(e), [u, d] = de(!1), { toast: h } = aa();
|
|
15241
15243
|
He(() => {
|
|
15242
15244
|
const p = JSON.stringify(a) !== JSON.stringify(e);
|
|
15243
15245
|
d(p);
|