teodor-new-chat-ui 4.3.654 → 4.3.655
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 +877 -876
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +18 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ var qs = (e, t, n) => vp(e, typeof t != "symbol" ? t + "" : t, n);
|
|
|
4
4
|
import { clsx as Nc } from "clsx";
|
|
5
5
|
import { twMerge as jc } from "tailwind-merge";
|
|
6
6
|
import * as b from "react";
|
|
7
|
-
import
|
|
7
|
+
import ee, { createContext as Tr, useContext as kr, useState as fe, useRef as Te, useCallback as ie, useEffect as Be, useMemo as Ne, useReducer as wp, createElement as Oo, memo as oo, useImperativeHandle as Sp, useLayoutEffect as Cp } from "react";
|
|
8
8
|
import { Slot as Tp, createSlot as qr } from "@radix-ui/react-slot";
|
|
9
9
|
import { cva as _c } from "class-variance-authority";
|
|
10
10
|
import * as Pc from "react-dom";
|
|
@@ -1241,9 +1241,9 @@ const ou = (e) => {
|
|
|
1241
1241
|
onDownloadProgress: S,
|
|
1242
1242
|
onUploadProgress: w,
|
|
1243
1243
|
responseType: T,
|
|
1244
|
-
headers:
|
|
1244
|
+
headers: N,
|
|
1245
1245
|
withCredentials: j = "same-origin",
|
|
1246
|
-
fetchOptions:
|
|
1246
|
+
fetchOptions: $
|
|
1247
1247
|
} = ou(m), F = t || fetch;
|
|
1248
1248
|
T = T ? (T + "").toLowerCase() : "text";
|
|
1249
1249
|
let U = cg([v, C && C.toAbortSignal()], R), Y = null;
|
|
@@ -1252,54 +1252,54 @@ const ou = (e) => {
|
|
|
1252
1252
|
});
|
|
1253
1253
|
let q;
|
|
1254
1254
|
try {
|
|
1255
|
-
if (w && l && x !== "get" && x !== "head" && (q = await p(
|
|
1256
|
-
let
|
|
1255
|
+
if (w && l && x !== "get" && x !== "head" && (q = await p(N, y)) !== 0) {
|
|
1256
|
+
let M = new n(g, {
|
|
1257
1257
|
method: "POST",
|
|
1258
1258
|
body: y,
|
|
1259
1259
|
duplex: "half"
|
|
1260
1260
|
}), A;
|
|
1261
|
-
if (z.isFormData(y) && (A =
|
|
1262
|
-
const [
|
|
1261
|
+
if (z.isFormData(y) && (A = M.headers.get("content-type")) && N.setContentType(A), M.body) {
|
|
1262
|
+
const [E, L] = il(
|
|
1263
1263
|
q,
|
|
1264
1264
|
Zo(al(w))
|
|
1265
1265
|
);
|
|
1266
|
-
y = cl(
|
|
1266
|
+
y = cl(M.body, ul, E, L);
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
z.isString(j) || (j = j ? "include" : "omit");
|
|
1270
|
-
const X = s && "credentials" in n.prototype,
|
|
1271
|
-
|
|
1270
|
+
const X = s && "credentials" in n.prototype, Q = {
|
|
1271
|
+
...$,
|
|
1272
1272
|
signal: U,
|
|
1273
1273
|
method: x.toUpperCase(),
|
|
1274
|
-
headers:
|
|
1274
|
+
headers: N.normalize().toJSON(),
|
|
1275
1275
|
body: y,
|
|
1276
1276
|
duplex: "half",
|
|
1277
1277
|
credentials: X ? j : void 0
|
|
1278
1278
|
};
|
|
1279
|
-
Y = s && new n(g,
|
|
1280
|
-
let H = await (s ? F(Y,
|
|
1279
|
+
Y = s && new n(g, Q);
|
|
1280
|
+
let H = await (s ? F(Y, $) : F(g, Q));
|
|
1281
1281
|
const B = u && (T === "stream" || T === "response");
|
|
1282
1282
|
if (u && (S || B && _)) {
|
|
1283
|
-
const
|
|
1283
|
+
const M = {};
|
|
1284
1284
|
["status", "statusText", "headers"].forEach((P) => {
|
|
1285
|
-
|
|
1285
|
+
M[P] = H[P];
|
|
1286
1286
|
});
|
|
1287
|
-
const A = z.toFiniteNumber(H.headers.get("content-length")), [
|
|
1287
|
+
const A = z.toFiniteNumber(H.headers.get("content-length")), [E, L] = S && il(
|
|
1288
1288
|
A,
|
|
1289
1289
|
Zo(al(S), !0)
|
|
1290
1290
|
) || [];
|
|
1291
1291
|
H = new r(
|
|
1292
|
-
cl(H.body, ul,
|
|
1293
|
-
|
|
1292
|
+
cl(H.body, ul, E, () => {
|
|
1293
|
+
L && L(), _ && _();
|
|
1294
1294
|
}),
|
|
1295
|
-
|
|
1295
|
+
M
|
|
1296
1296
|
);
|
|
1297
1297
|
}
|
|
1298
1298
|
T = T || "text";
|
|
1299
|
-
let
|
|
1300
|
-
return !B && _ && _(), await new Promise((
|
|
1301
|
-
nu(
|
|
1302
|
-
data:
|
|
1299
|
+
let ne = await f[z.findKey(f, T) || "text"](H, m);
|
|
1300
|
+
return !B && _ && _(), await new Promise((M, A) => {
|
|
1301
|
+
nu(M, A, {
|
|
1302
|
+
data: ne,
|
|
1303
1303
|
headers: Tt.from(H.headers),
|
|
1304
1304
|
status: H.status,
|
|
1305
1305
|
statusText: H.statusText,
|
|
@@ -2007,7 +2007,7 @@ var bl;
|
|
|
2007
2007
|
function Rg() {
|
|
2008
2008
|
if (bl) return Or;
|
|
2009
2009
|
bl = 1;
|
|
2010
|
-
var e =
|
|
2010
|
+
var e = ee, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
2011
2011
|
function i(a, c, l) {
|
|
2012
2012
|
var u, f = {}, h = null, p = null;
|
|
2013
2013
|
l !== void 0 && (h = "" + l), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (p = c.ref);
|
|
@@ -2030,45 +2030,45 @@ var Mr = {};
|
|
|
2030
2030
|
var vl;
|
|
2031
2031
|
function Ig() {
|
|
2032
2032
|
return vl || (vl = 1, process.env.NODE_ENV !== "production" && function() {
|
|
2033
|
-
var e =
|
|
2033
|
+
var e = ee, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), m = Symbol.iterator, g = "@@iterator";
|
|
2034
2034
|
function x(k) {
|
|
2035
2035
|
if (k === null || typeof k != "object")
|
|
2036
2036
|
return null;
|
|
2037
|
-
var
|
|
2038
|
-
return typeof
|
|
2037
|
+
var D = m && k[m] || k[g];
|
|
2038
|
+
return typeof D == "function" ? D : null;
|
|
2039
2039
|
}
|
|
2040
2040
|
var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2041
2041
|
function v(k) {
|
|
2042
2042
|
{
|
|
2043
|
-
for (var
|
|
2043
|
+
for (var D = arguments.length, V = new Array(D > 1 ? D - 1 : 0), oe = 1; oe < D; oe++)
|
|
2044
2044
|
V[oe - 1] = arguments[oe];
|
|
2045
2045
|
C("error", k, V);
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
|
-
function C(k,
|
|
2048
|
+
function C(k, D, V) {
|
|
2049
2049
|
{
|
|
2050
2050
|
var oe = y.ReactDebugCurrentFrame, ue = oe.getStackAddendum();
|
|
2051
|
-
ue !== "" && (
|
|
2051
|
+
ue !== "" && (D += "%s", V = V.concat([ue]));
|
|
2052
2052
|
var ve = V.map(function(we) {
|
|
2053
2053
|
return String(we);
|
|
2054
2054
|
});
|
|
2055
|
-
ve.unshift("Warning: " +
|
|
2055
|
+
ve.unshift("Warning: " + D), Function.prototype.apply.call(console[k], console, ve);
|
|
2056
2056
|
}
|
|
2057
2057
|
}
|
|
2058
|
-
var R = !1, S = !1, w = !1, T = !1,
|
|
2058
|
+
var R = !1, S = !1, w = !1, T = !1, N = !1, j;
|
|
2059
2059
|
j = Symbol.for("react.module.reference");
|
|
2060
|
-
function
|
|
2061
|
-
return !!(typeof k == "string" || typeof k == "function" || k === r || k === s ||
|
|
2060
|
+
function $(k) {
|
|
2061
|
+
return !!(typeof k == "string" || typeof k == "function" || k === r || k === s || N || k === o || k === l || k === u || T || k === p || R || S || w || typeof k == "object" && k !== null && (k.$$typeof === h || k.$$typeof === f || k.$$typeof === i || k.$$typeof === a || k.$$typeof === c || // This needs to include all possible module reference object
|
|
2062
2062
|
// types supported by any Flight configuration anywhere since
|
|
2063
2063
|
// we don't know which Flight build this will end up being used
|
|
2064
2064
|
// with.
|
|
2065
2065
|
k.$$typeof === j || k.getModuleId !== void 0));
|
|
2066
2066
|
}
|
|
2067
|
-
function F(k,
|
|
2067
|
+
function F(k, D, V) {
|
|
2068
2068
|
var oe = k.displayName;
|
|
2069
2069
|
if (oe)
|
|
2070
2070
|
return oe;
|
|
2071
|
-
var ue =
|
|
2071
|
+
var ue = D.displayName || D.name || "";
|
|
2072
2072
|
return ue !== "" ? V + "(" + ue + ")" : V;
|
|
2073
2073
|
}
|
|
2074
2074
|
function U(k) {
|
|
@@ -2098,8 +2098,8 @@ function Ig() {
|
|
|
2098
2098
|
if (typeof k == "object")
|
|
2099
2099
|
switch (k.$$typeof) {
|
|
2100
2100
|
case a:
|
|
2101
|
-
var
|
|
2102
|
-
return U(
|
|
2101
|
+
var D = k;
|
|
2102
|
+
return U(D) + ".Consumer";
|
|
2103
2103
|
case i:
|
|
2104
2104
|
var V = k;
|
|
2105
2105
|
return U(V._context) + ".Provider";
|
|
@@ -2119,18 +2119,18 @@ function Ig() {
|
|
|
2119
2119
|
}
|
|
2120
2120
|
return null;
|
|
2121
2121
|
}
|
|
2122
|
-
var _ = Object.assign, q = 0, X,
|
|
2123
|
-
function
|
|
2122
|
+
var _ = Object.assign, q = 0, X, Q, H, B, ne, M, A;
|
|
2123
|
+
function E() {
|
|
2124
2124
|
}
|
|
2125
|
-
|
|
2126
|
-
function
|
|
2125
|
+
E.__reactDisabledLog = !0;
|
|
2126
|
+
function L() {
|
|
2127
2127
|
{
|
|
2128
2128
|
if (q === 0) {
|
|
2129
|
-
X = console.log,
|
|
2129
|
+
X = console.log, Q = console.info, H = console.warn, B = console.error, ne = console.group, M = console.groupCollapsed, A = console.groupEnd;
|
|
2130
2130
|
var k = {
|
|
2131
2131
|
configurable: !0,
|
|
2132
2132
|
enumerable: !0,
|
|
2133
|
-
value:
|
|
2133
|
+
value: E,
|
|
2134
2134
|
writable: !0
|
|
2135
2135
|
};
|
|
2136
2136
|
Object.defineProperties(console, {
|
|
@@ -2159,7 +2159,7 @@ function Ig() {
|
|
|
2159
2159
|
value: X
|
|
2160
2160
|
}),
|
|
2161
2161
|
info: _({}, k, {
|
|
2162
|
-
value:
|
|
2162
|
+
value: Q
|
|
2163
2163
|
}),
|
|
2164
2164
|
warn: _({}, k, {
|
|
2165
2165
|
value: H
|
|
@@ -2168,10 +2168,10 @@ function Ig() {
|
|
|
2168
2168
|
value: B
|
|
2169
2169
|
}),
|
|
2170
2170
|
group: _({}, k, {
|
|
2171
|
-
value:
|
|
2171
|
+
value: ne
|
|
2172
2172
|
}),
|
|
2173
2173
|
groupCollapsed: _({}, k, {
|
|
2174
|
-
value:
|
|
2174
|
+
value: M
|
|
2175
2175
|
}),
|
|
2176
2176
|
groupEnd: _({}, k, {
|
|
2177
2177
|
value: A
|
|
@@ -2182,7 +2182,7 @@ function Ig() {
|
|
|
2182
2182
|
}
|
|
2183
2183
|
}
|
|
2184
2184
|
var W = y.ReactCurrentDispatcher, O;
|
|
2185
|
-
function I(k,
|
|
2185
|
+
function I(k, D, V) {
|
|
2186
2186
|
{
|
|
2187
2187
|
if (O === void 0)
|
|
2188
2188
|
try {
|
|
@@ -2200,7 +2200,7 @@ function Ig() {
|
|
|
2200
2200
|
var se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
2201
2201
|
J = new se();
|
|
2202
2202
|
}
|
|
2203
|
-
function ge(k,
|
|
2203
|
+
function ge(k, D) {
|
|
2204
2204
|
if (!k || K)
|
|
2205
2205
|
return "";
|
|
2206
2206
|
{
|
|
@@ -2213,9 +2213,9 @@ function Ig() {
|
|
|
2213
2213
|
var ue = Error.prepareStackTrace;
|
|
2214
2214
|
Error.prepareStackTrace = void 0;
|
|
2215
2215
|
var ve;
|
|
2216
|
-
ve = W.current, W.current = null,
|
|
2216
|
+
ve = W.current, W.current = null, L();
|
|
2217
2217
|
try {
|
|
2218
|
-
if (
|
|
2218
|
+
if (D) {
|
|
2219
2219
|
var we = function() {
|
|
2220
2220
|
throw Error();
|
|
2221
2221
|
};
|
|
@@ -2271,14 +2271,14 @@ function Ig() {
|
|
|
2271
2271
|
var lr = k ? k.displayName || k.name : "", Bn = lr ? I(lr) : "";
|
|
2272
2272
|
return typeof k == "function" && J.set(k, Bn), Bn;
|
|
2273
2273
|
}
|
|
2274
|
-
function Ce(k,
|
|
2274
|
+
function Ce(k, D, V) {
|
|
2275
2275
|
return ge(k, !1);
|
|
2276
2276
|
}
|
|
2277
2277
|
function Pe(k) {
|
|
2278
|
-
var
|
|
2279
|
-
return !!(
|
|
2278
|
+
var D = k.prototype;
|
|
2279
|
+
return !!(D && D.isReactComponent);
|
|
2280
2280
|
}
|
|
2281
|
-
function Ie(k,
|
|
2281
|
+
function Ie(k, D, V) {
|
|
2282
2282
|
if (k == null)
|
|
2283
2283
|
return "";
|
|
2284
2284
|
if (typeof k == "function")
|
|
@@ -2296,11 +2296,11 @@ function Ig() {
|
|
|
2296
2296
|
case c:
|
|
2297
2297
|
return Ce(k.render);
|
|
2298
2298
|
case f:
|
|
2299
|
-
return Ie(k.type,
|
|
2299
|
+
return Ie(k.type, D, V);
|
|
2300
2300
|
case h: {
|
|
2301
2301
|
var oe = k, ue = oe._payload, ve = oe._init;
|
|
2302
2302
|
try {
|
|
2303
|
-
return Ie(ve(ue),
|
|
2303
|
+
return Ie(ve(ue), D, V);
|
|
2304
2304
|
} catch {
|
|
2305
2305
|
}
|
|
2306
2306
|
}
|
|
@@ -2310,12 +2310,12 @@ function Ig() {
|
|
|
2310
2310
|
var Ke = Object.prototype.hasOwnProperty, Xe = {}, He = y.ReactDebugCurrentFrame;
|
|
2311
2311
|
function Ue(k) {
|
|
2312
2312
|
if (k) {
|
|
2313
|
-
var
|
|
2313
|
+
var D = k._owner, V = Ie(k.type, k._source, D ? D.type : null);
|
|
2314
2314
|
He.setExtraStackFrame(V);
|
|
2315
2315
|
} else
|
|
2316
2316
|
He.setExtraStackFrame(null);
|
|
2317
2317
|
}
|
|
2318
|
-
function it(k,
|
|
2318
|
+
function it(k, D, V, oe, ue) {
|
|
2319
2319
|
{
|
|
2320
2320
|
var ve = Function.call.bind(Ke);
|
|
2321
2321
|
for (var we in k)
|
|
@@ -2326,7 +2326,7 @@ function Ig() {
|
|
|
2326
2326
|
var qe = Error((oe || "React class") + ": " + V + " type `" + we + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof k[we] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
2327
2327
|
throw qe.name = "Invariant Violation", qe;
|
|
2328
2328
|
}
|
|
2329
|
-
Ee = k[we](
|
|
2329
|
+
Ee = k[we](D, we, oe, V, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
2330
2330
|
} catch (ze) {
|
|
2331
2331
|
Ee = ze;
|
|
2332
2332
|
}
|
|
@@ -2340,7 +2340,7 @@ function Ig() {
|
|
|
2340
2340
|
}
|
|
2341
2341
|
function gt(k) {
|
|
2342
2342
|
{
|
|
2343
|
-
var
|
|
2343
|
+
var D = typeof Symbol == "function" && Symbol.toStringTag, V = D && k[Symbol.toStringTag] || k.constructor.name || "Object";
|
|
2344
2344
|
return V;
|
|
2345
2345
|
}
|
|
2346
2346
|
}
|
|
@@ -2366,27 +2366,27 @@ function Ig() {
|
|
|
2366
2366
|
}, Ut, et;
|
|
2367
2367
|
function ct(k) {
|
|
2368
2368
|
if (Ke.call(k, "ref")) {
|
|
2369
|
-
var
|
|
2370
|
-
if (
|
|
2369
|
+
var D = Object.getOwnPropertyDescriptor(k, "ref").get;
|
|
2370
|
+
if (D && D.isReactWarning)
|
|
2371
2371
|
return !1;
|
|
2372
2372
|
}
|
|
2373
2373
|
return k.ref !== void 0;
|
|
2374
2374
|
}
|
|
2375
2375
|
function Ln(k) {
|
|
2376
2376
|
if (Ke.call(k, "key")) {
|
|
2377
|
-
var
|
|
2378
|
-
if (
|
|
2377
|
+
var D = Object.getOwnPropertyDescriptor(k, "key").get;
|
|
2378
|
+
if (D && D.isReactWarning)
|
|
2379
2379
|
return !1;
|
|
2380
2380
|
}
|
|
2381
2381
|
return k.key !== void 0;
|
|
2382
2382
|
}
|
|
2383
|
-
function Wt(k,
|
|
2383
|
+
function Wt(k, D) {
|
|
2384
2384
|
typeof k.ref == "string" && lt.current;
|
|
2385
2385
|
}
|
|
2386
|
-
function tn(k,
|
|
2386
|
+
function tn(k, D) {
|
|
2387
2387
|
{
|
|
2388
2388
|
var V = function() {
|
|
2389
|
-
Ut || (Ut = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
2389
|
+
Ut || (Ut = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", D));
|
|
2390
2390
|
};
|
|
2391
2391
|
V.isReactWarning = !0, Object.defineProperty(k, "key", {
|
|
2392
2392
|
get: V,
|
|
@@ -2394,10 +2394,10 @@ function Ig() {
|
|
|
2394
2394
|
});
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
function Dt(k,
|
|
2397
|
+
function Dt(k, D) {
|
|
2398
2398
|
{
|
|
2399
2399
|
var V = function() {
|
|
2400
|
-
et || (et = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",
|
|
2400
|
+
et || (et = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", D));
|
|
2401
2401
|
};
|
|
2402
2402
|
V.isReactWarning = !0, Object.defineProperty(k, "ref", {
|
|
2403
2403
|
get: V,
|
|
@@ -2405,13 +2405,13 @@ function Ig() {
|
|
|
2405
2405
|
});
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
|
-
var Vt = function(k,
|
|
2408
|
+
var Vt = function(k, D, V, oe, ue, ve, we) {
|
|
2409
2409
|
var Ee = {
|
|
2410
2410
|
// This tag allows us to uniquely identify this as a React Element
|
|
2411
2411
|
$$typeof: t,
|
|
2412
2412
|
// Built-in properties that belong on the element
|
|
2413
2413
|
type: k,
|
|
2414
|
-
key:
|
|
2414
|
+
key: D,
|
|
2415
2415
|
ref: V,
|
|
2416
2416
|
props: we,
|
|
2417
2417
|
// Record the component responsible for creating this element.
|
|
@@ -2434,12 +2434,12 @@ function Ig() {
|
|
|
2434
2434
|
value: ue
|
|
2435
2435
|
}), Object.freeze && (Object.freeze(Ee.props), Object.freeze(Ee)), Ee;
|
|
2436
2436
|
};
|
|
2437
|
-
function vn(k,
|
|
2437
|
+
function vn(k, D, V, oe, ue) {
|
|
2438
2438
|
{
|
|
2439
2439
|
var ve, we = {}, Ee = null, qe = null;
|
|
2440
|
-
V !== void 0 && (at(V), Ee = "" + V), Ln(
|
|
2441
|
-
for (ve in
|
|
2442
|
-
Ke.call(
|
|
2440
|
+
V !== void 0 && (at(V), Ee = "" + V), Ln(D) && (at(D.key), Ee = "" + D.key), ct(D) && (qe = D.ref, Wt(D, ue));
|
|
2441
|
+
for (ve in D)
|
|
2442
|
+
Ke.call(D, ve) && !It.hasOwnProperty(ve) && (we[ve] = D[ve]);
|
|
2443
2443
|
if (k && k.defaultProps) {
|
|
2444
2444
|
var ze = k.defaultProps;
|
|
2445
2445
|
for (ve in ze)
|
|
@@ -2455,7 +2455,7 @@ function Ig() {
|
|
|
2455
2455
|
var Lt = y.ReactCurrentOwner, Kt = y.ReactDebugCurrentFrame;
|
|
2456
2456
|
function Et(k) {
|
|
2457
2457
|
if (k) {
|
|
2458
|
-
var
|
|
2458
|
+
var D = k._owner, V = Ie(k.type, k._source, D ? D.type : null);
|
|
2459
2459
|
Kt.setExtraStackFrame(V);
|
|
2460
2460
|
} else
|
|
2461
2461
|
Kt.setExtraStackFrame(null);
|
|
@@ -2483,22 +2483,22 @@ Check the render method of \`` + k + "`.";
|
|
|
2483
2483
|
var qt = {};
|
|
2484
2484
|
function Sn(k) {
|
|
2485
2485
|
{
|
|
2486
|
-
var
|
|
2487
|
-
if (!
|
|
2486
|
+
var D = Je();
|
|
2487
|
+
if (!D) {
|
|
2488
2488
|
var V = typeof k == "string" ? k : k.displayName || k.name;
|
|
2489
|
-
V && (
|
|
2489
|
+
V && (D = `
|
|
2490
2490
|
|
|
2491
2491
|
Check the top-level render call using <` + V + ">.");
|
|
2492
2492
|
}
|
|
2493
|
-
return
|
|
2493
|
+
return D;
|
|
2494
2494
|
}
|
|
2495
2495
|
}
|
|
2496
|
-
function Gt(k,
|
|
2496
|
+
function Gt(k, D) {
|
|
2497
2497
|
{
|
|
2498
2498
|
if (!k._store || k._store.validated || k.key != null)
|
|
2499
2499
|
return;
|
|
2500
2500
|
k._store.validated = !0;
|
|
2501
|
-
var V = Sn(
|
|
2501
|
+
var V = Sn(D);
|
|
2502
2502
|
if (qt[V])
|
|
2503
2503
|
return;
|
|
2504
2504
|
qt[V] = !0;
|
|
@@ -2506,14 +2506,14 @@ Check the top-level render call using <` + V + ">.");
|
|
|
2506
2506
|
k && k._owner && k._owner !== Lt.current && (oe = " It was passed a child from " + Y(k._owner.type) + "."), Et(k), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', V, oe), Et(null);
|
|
2507
2507
|
}
|
|
2508
2508
|
}
|
|
2509
|
-
function nn(k,
|
|
2509
|
+
function nn(k, D) {
|
|
2510
2510
|
{
|
|
2511
2511
|
if (typeof k != "object")
|
|
2512
2512
|
return;
|
|
2513
2513
|
if (bt(k))
|
|
2514
2514
|
for (var V = 0; V < k.length; V++) {
|
|
2515
2515
|
var oe = k[V];
|
|
2516
|
-
Fe(oe) && Gt(oe,
|
|
2516
|
+
Fe(oe) && Gt(oe, D);
|
|
2517
2517
|
}
|
|
2518
2518
|
else if (Fe(k))
|
|
2519
2519
|
k._store && (k._store.validated = !0);
|
|
@@ -2521,39 +2521,39 @@ Check the top-level render call using <` + V + ">.");
|
|
|
2521
2521
|
var ue = x(k);
|
|
2522
2522
|
if (typeof ue == "function" && ue !== k.entries)
|
|
2523
2523
|
for (var ve = ue.call(k), we; !(we = ve.next()).done; )
|
|
2524
|
-
Fe(we.value) && Gt(we.value,
|
|
2524
|
+
Fe(we.value) && Gt(we.value, D);
|
|
2525
2525
|
}
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
2528
|
function Fn(k) {
|
|
2529
2529
|
{
|
|
2530
|
-
var
|
|
2531
|
-
if (
|
|
2530
|
+
var D = k.type;
|
|
2531
|
+
if (D == null || typeof D == "string")
|
|
2532
2532
|
return;
|
|
2533
2533
|
var V;
|
|
2534
|
-
if (typeof
|
|
2535
|
-
V =
|
|
2536
|
-
else if (typeof
|
|
2534
|
+
if (typeof D == "function")
|
|
2535
|
+
V = D.propTypes;
|
|
2536
|
+
else if (typeof D == "object" && (D.$$typeof === c || // Note: Memo only checks outer props here.
|
|
2537
2537
|
// Inner props are checked in the reconciler.
|
|
2538
|
-
|
|
2539
|
-
V =
|
|
2538
|
+
D.$$typeof === f))
|
|
2539
|
+
V = D.propTypes;
|
|
2540
2540
|
else
|
|
2541
2541
|
return;
|
|
2542
2542
|
if (V) {
|
|
2543
|
-
var oe = Y(
|
|
2543
|
+
var oe = Y(D);
|
|
2544
2544
|
it(V, k.props, "prop", oe, k);
|
|
2545
|
-
} else if (
|
|
2545
|
+
} else if (D.PropTypes !== void 0 && !$n) {
|
|
2546
2546
|
$n = !0;
|
|
2547
|
-
var ue = Y(
|
|
2547
|
+
var ue = Y(D);
|
|
2548
2548
|
v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ue || "Unknown");
|
|
2549
2549
|
}
|
|
2550
|
-
typeof
|
|
2550
|
+
typeof D.getDefaultProps == "function" && !D.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2551
2551
|
}
|
|
2552
2552
|
}
|
|
2553
2553
|
function zn(k) {
|
|
2554
2554
|
{
|
|
2555
|
-
for (var
|
|
2556
|
-
var oe =
|
|
2555
|
+
for (var D = Object.keys(k.props), V = 0; V < D.length; V++) {
|
|
2556
|
+
var oe = D[V];
|
|
2557
2557
|
if (oe !== "children" && oe !== "key") {
|
|
2558
2558
|
Et(k), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", oe), Et(null);
|
|
2559
2559
|
break;
|
|
@@ -2563,9 +2563,9 @@ Check the top-level render call using <` + V + ">.");
|
|
|
2563
2563
|
}
|
|
2564
2564
|
}
|
|
2565
2565
|
var rn = {};
|
|
2566
|
-
function Cn(k,
|
|
2566
|
+
function Cn(k, D, V, oe, ue, ve) {
|
|
2567
2567
|
{
|
|
2568
|
-
var we =
|
|
2568
|
+
var we = $(k);
|
|
2569
2569
|
if (!we) {
|
|
2570
2570
|
var Ee = "";
|
|
2571
2571
|
(k === void 0 || typeof k == "object" && k !== null && Object.keys(k).length === 0) && (Ee += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
@@ -2574,11 +2574,11 @@ Check the top-level render call using <` + V + ">.");
|
|
|
2574
2574
|
var ze;
|
|
2575
2575
|
k === null ? ze = "null" : bt(k) ? ze = "array" : k !== void 0 && k.$$typeof === t ? (ze = "<" + (Y(k.type) || "Unknown") + " />", Ee = " Did you accidentally export a JSX literal instead of a component?") : ze = typeof k, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ze, Ee);
|
|
2576
2576
|
}
|
|
2577
|
-
var Ze = vn(k,
|
|
2577
|
+
var Ze = vn(k, D, V, ue, ve);
|
|
2578
2578
|
if (Ze == null)
|
|
2579
2579
|
return Ze;
|
|
2580
2580
|
if (we) {
|
|
2581
|
-
var $t =
|
|
2581
|
+
var $t = D.children;
|
|
2582
2582
|
if ($t !== void 0)
|
|
2583
2583
|
if (oe)
|
|
2584
2584
|
if (bt($t)) {
|
|
@@ -2590,8 +2590,8 @@ Check the top-level render call using <` + V + ">.");
|
|
|
2590
2590
|
else
|
|
2591
2591
|
nn($t, k);
|
|
2592
2592
|
}
|
|
2593
|
-
if (Ke.call(
|
|
2594
|
-
var Bn = Y(k), vt = Object.keys(
|
|
2593
|
+
if (Ke.call(D, "key")) {
|
|
2594
|
+
var Bn = Y(k), vt = Object.keys(D).filter(function(yp) {
|
|
2595
2595
|
return yp !== "key";
|
|
2596
2596
|
}), Ks = vt.length > 0 ? "{key: someKey, " + vt.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
2597
2597
|
if (!rn[Bn + Ks]) {
|
|
@@ -2607,11 +2607,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2607
2607
|
return k === r ? zn(Ze) : Fn(Ze), Ze;
|
|
2608
2608
|
}
|
|
2609
2609
|
}
|
|
2610
|
-
function gn(k,
|
|
2611
|
-
return Cn(k,
|
|
2610
|
+
function gn(k, D, V) {
|
|
2611
|
+
return Cn(k, D, V, !0);
|
|
2612
2612
|
}
|
|
2613
|
-
function G(k,
|
|
2614
|
-
return Cn(k,
|
|
2613
|
+
function G(k, D, V) {
|
|
2614
|
+
return Cn(k, D, V, !1);
|
|
2615
2615
|
}
|
|
2616
2616
|
var de = G, re = gn;
|
|
2617
2617
|
Mr.Fragment = r, Mr.jsx = de, Mr.jsxs = re;
|
|
@@ -2877,12 +2877,12 @@ function mr(e) {
|
|
|
2877
2877
|
function Bg(e, t) {
|
|
2878
2878
|
var w, T;
|
|
2879
2879
|
if (!e) return null;
|
|
2880
|
-
const n = ((w = e.values) == null ? void 0 : w.activeAgent) ?? null, r = (T = e.values) == null ? void 0 : T.messages, s = (Array.isArray(r) ? r : []).map((
|
|
2880
|
+
const n = ((w = e.values) == null ? void 0 : w.activeAgent) ?? null, r = (T = e.values) == null ? void 0 : T.messages, s = (Array.isArray(r) ? r : []).map((N) => Ug(N, n)).filter((N) => !!N), i = Gn(e.metadata) ?? {}, a = wl(e.config), c = Gn(e.parentConfig), l = wl(c), u = Fr(a, ["checkpointId"]), f = Fr(a, ["checkpointNs"]), h = Fr(l, ["checkpointId"]), p = Gn(e.config), m = Array.isArray(e.tasks) ? e.tasks.map((N) => ({ ...N })) : e.tasks ?? null, g = Array.isArray(e.next) ? [...e.next] : e.next ?? null, x = typeof e.createdAt == "string" && e.createdAt.trim() ? e.createdAt : new Date(Date.now() - t).toISOString(), y = {
|
|
2881
2881
|
...i,
|
|
2882
2882
|
step: Og(i, ["step"]) ?? 0,
|
|
2883
2883
|
source: Fr(i, ["source"]) ?? null
|
|
2884
|
-
}, v = s.map((
|
|
2885
|
-
...
|
|
2884
|
+
}, v = s.map((N) => ({
|
|
2885
|
+
...N,
|
|
2886
2886
|
checkpointId: u ?? null
|
|
2887
2887
|
})), C = e.values, R = Array.isArray(e.interrupts) ? e.interrupts : Array.isArray(C == null ? void 0 : C.interrupts) ? C.interrupts : [], S = Hg(v);
|
|
2888
2888
|
return {
|
|
@@ -2980,40 +2980,40 @@ function Kg(e) {
|
|
|
2980
2980
|
return !!e && typeof e == "object" && "data" in e;
|
|
2981
2981
|
}
|
|
2982
2982
|
function qg(e = {}) {
|
|
2983
|
-
const t = e.baseUrl || "", n = e.streamPath ?? "/stream", [r, o] = fe(e.token ?? null), s = Te(e.headers ?? {}), i = e.credentials ?? "include", [a, c] = fe(!1), [l, u] = fe(null), [f, h] = fe(""), [p, m] = fe(null), [g, x] = fe(0), [y, v] = fe(!1), [C, R] = fe({}), [S, w] = fe(null), [T,
|
|
2983
|
+
const t = e.baseUrl || "", n = e.streamPath ?? "/stream", [r, o] = fe(e.token ?? null), s = Te(e.headers ?? {}), i = e.credentials ?? "include", [a, c] = fe(!1), [l, u] = fe(null), [f, h] = fe(""), [p, m] = fe(null), [g, x] = fe(0), [y, v] = fe(!1), [C, R] = fe({}), [S, w] = fe(null), [T, N] = fe({}), j = Te(null), $ = Te(!0), F = Te(0), U = Te(null), Y = Te(null), _ = Te(null), q = Te(null), X = Te({
|
|
2984
2984
|
messageId: null,
|
|
2985
2985
|
lastSeq: null,
|
|
2986
2986
|
lastText: ""
|
|
2987
|
-
}),
|
|
2988
|
-
o(
|
|
2987
|
+
}), Q = ie((M) => {
|
|
2988
|
+
o(M);
|
|
2989
2989
|
}, []), H = ie(() => {
|
|
2990
|
-
h(""), m(null), u(null), Y.current = null, _.current = null, q.current = null, R({}), w(null),
|
|
2990
|
+
h(""), m(null), u(null), Y.current = null, _.current = null, q.current = null, R({}), w(null), N({}), X.current = {
|
|
2991
2991
|
messageId: null,
|
|
2992
2992
|
lastSeq: null,
|
|
2993
2993
|
lastText: ""
|
|
2994
2994
|
};
|
|
2995
2995
|
}, []), B = ie(() => {
|
|
2996
|
-
var
|
|
2996
|
+
var L;
|
|
2997
2997
|
console.debug("[use-chat] stop() invoked - aborting stream");
|
|
2998
|
-
const
|
|
2998
|
+
const M = (L = U.current) == null ? void 0 : L.threadId, A = () => {
|
|
2999
2999
|
var P;
|
|
3000
3000
|
(P = j.current) == null || P.abort(), j.current = null, U.current = null, c(!1), v(!1), F.current = 0, x(0);
|
|
3001
3001
|
};
|
|
3002
|
-
(
|
|
3002
|
+
(M ? Jn.cancelRun(M).catch((P) => {
|
|
3003
3003
|
console.warn("[use-chat] cancel run failed:", P);
|
|
3004
3004
|
}) : Promise.resolve()).finally(A);
|
|
3005
|
-
}, []),
|
|
3006
|
-
(
|
|
3007
|
-
j.current && (j.current.abort(), j.current = null), c(!0), u(null), e.autoAppendAssistant !== !1 && h(""), m(null), Y.current = null, _.current = null, q.current = null, R({}), w(null),
|
|
3005
|
+
}, []), ne = ie(
|
|
3006
|
+
(M, A, E) => {
|
|
3007
|
+
j.current && (j.current.abort(), j.current = null), c(!0), u(null), e.autoAppendAssistant !== !1 && h(""), m(null), Y.current = null, _.current = null, q.current = null, R({}), w(null), N({}), X.current = {
|
|
3008
3008
|
messageId: null,
|
|
3009
3009
|
lastSeq: null,
|
|
3010
3010
|
lastText: ""
|
|
3011
3011
|
};
|
|
3012
|
-
const
|
|
3013
|
-
j.current =
|
|
3012
|
+
const L = new AbortController();
|
|
3013
|
+
j.current = L;
|
|
3014
3014
|
let P = null, W = null, O = !1;
|
|
3015
3015
|
return U.current = {
|
|
3016
|
-
threadId:
|
|
3016
|
+
threadId: M.threadId ?? null,
|
|
3017
3017
|
headers: {},
|
|
3018
3018
|
isStreaming: !0
|
|
3019
3019
|
}, (async () => {
|
|
@@ -3055,8 +3055,8 @@ function qg(e = {}) {
|
|
|
3055
3055
|
}, et = await fetch(t + n, {
|
|
3056
3056
|
method: "POST",
|
|
3057
3057
|
headers: Ut,
|
|
3058
|
-
body: JSON.stringify(
|
|
3059
|
-
signal:
|
|
3058
|
+
body: JSON.stringify(M),
|
|
3059
|
+
signal: L.signal,
|
|
3060
3060
|
credentials: i
|
|
3061
3061
|
});
|
|
3062
3062
|
if (U.current && (U.current.headers = It), !et.ok || !et.body) {
|
|
@@ -3067,7 +3067,7 @@ function qg(e = {}) {
|
|
|
3067
3067
|
Fe == null ? void 0 : Fe.slice(0, 500)
|
|
3068
3068
|
);
|
|
3069
3069
|
const Je = `stream ${et.status}${Fe ? ": " + Fe : ""}`;
|
|
3070
|
-
throw (ge =
|
|
3070
|
+
throw (ge = E == null ? void 0 : E.onConnectionError) == null || ge.call(E, Je), O = !0, P = "error", W = Je, new Error(Je);
|
|
3071
3071
|
}
|
|
3072
3072
|
v(!0);
|
|
3073
3073
|
const ct = et.body.getReader(), Ln = new TextDecoder();
|
|
@@ -3077,7 +3077,7 @@ function qg(e = {}) {
|
|
|
3077
3077
|
const vn = () => {
|
|
3078
3078
|
if (tn.length) {
|
|
3079
3079
|
const Fe = tn.join("");
|
|
3080
|
-
tn = [],
|
|
3080
|
+
tn = [], $.current && h((Je) => Je + Fe);
|
|
3081
3081
|
}
|
|
3082
3082
|
Vt = null;
|
|
3083
3083
|
}, Lt = () => {
|
|
@@ -3088,7 +3088,7 @@ function qg(e = {}) {
|
|
|
3088
3088
|
var Fe;
|
|
3089
3089
|
if (Date.now() - Kt > 18e5) {
|
|
3090
3090
|
const Je = "Stream idle timeout";
|
|
3091
|
-
u(Je), P = "error", W = Je,
|
|
3091
|
+
u(Je), P = "error", W = Je, L.abort(), (Fe = E == null ? void 0 : E.onError) == null || Fe.call(E, Je);
|
|
3092
3092
|
}
|
|
3093
3093
|
}, 5e3), $n = 1024 * 1024;
|
|
3094
3094
|
try {
|
|
@@ -3096,7 +3096,7 @@ function qg(e = {}) {
|
|
|
3096
3096
|
for (U.current && !U.current.threadId && (U.current = {
|
|
3097
3097
|
...U.current,
|
|
3098
3098
|
threadId: wn
|
|
3099
|
-
}), (Ce =
|
|
3099
|
+
}), (Ce = E == null ? void 0 : E.onOpen) == null || Ce.call(E, { threadId: wn, created: qt }); ; ) {
|
|
3100
3100
|
const { value: Sn, done: Gt } = await ct.read();
|
|
3101
3101
|
if (Gt) break;
|
|
3102
3102
|
Wt += Ln.decode(Sn, { stream: !0 }), Wt.length > $n && (Wt = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
@@ -3108,19 +3108,19 @@ function qg(e = {}) {
|
|
|
3108
3108
|
Wt = Wt.slice(nn + 2);
|
|
3109
3109
|
const zn = Fn.split(/\r?\n/), rn = [];
|
|
3110
3110
|
let Cn = null;
|
|
3111
|
-
for (const
|
|
3112
|
-
if (
|
|
3113
|
-
|
|
3111
|
+
for (const D of zn) {
|
|
3112
|
+
if (D.startsWith(":")) {
|
|
3113
|
+
D.startsWith(": heartbeat") && console.debug("[use-chat] SSE heartbeat comment received");
|
|
3114
3114
|
continue;
|
|
3115
3115
|
}
|
|
3116
|
-
if (
|
|
3117
|
-
if (
|
|
3118
|
-
const V =
|
|
3116
|
+
if (D) {
|
|
3117
|
+
if (D.startsWith("event:")) {
|
|
3118
|
+
const V = D.slice(6).trim();
|
|
3119
3119
|
V && (Cn = V);
|
|
3120
3120
|
continue;
|
|
3121
3121
|
}
|
|
3122
|
-
if (
|
|
3123
|
-
const V =
|
|
3122
|
+
if (D.startsWith("data:")) {
|
|
3123
|
+
const V = D.slice(5);
|
|
3124
3124
|
rn.push(V.startsWith(" ") ? V.slice(1) : V);
|
|
3125
3125
|
}
|
|
3126
3126
|
}
|
|
@@ -3149,7 +3149,7 @@ function qg(e = {}) {
|
|
|
3149
3149
|
console.debug("[use-chat] drop duplicate/out-of-order event", { seq: k, lastProcessedSeq: Dt, type: re.type });
|
|
3150
3150
|
continue;
|
|
3151
3151
|
}
|
|
3152
|
-
Dt > 0 && k > Dt + 1 && ((Pe =
|
|
3152
|
+
Dt > 0 && k > Dt + 1 && ((Pe = E == null ? void 0 : E.onGap) == null || Pe.call(E, { from: Dt, to: k })), Dt = k, F.current = k, x(k);
|
|
3153
3153
|
}
|
|
3154
3154
|
if (re.type === "checkpoint")
|
|
3155
3155
|
Y.current = re.checkpointId ?? null, _.current = re.checkpointNs ?? null, m(re.checkpointId ?? null);
|
|
@@ -3157,20 +3157,20 @@ function qg(e = {}) {
|
|
|
3157
3157
|
q.current = re;
|
|
3158
3158
|
try {
|
|
3159
3159
|
const V = mr(re).latest;
|
|
3160
|
-
V && (Y.current = V.checkpointId ?? null, _.current = V.checkpointNs ?? null, m(V.checkpointId ?? null),
|
|
3161
|
-
} catch (
|
|
3162
|
-
console.warn("[use-chat] Failed to hydrate state_history payload",
|
|
3160
|
+
V && (Y.current = V.checkpointId ?? null, _.current = V.checkpointNs ?? null, m(V.checkpointId ?? null), N(V.values ?? {}));
|
|
3161
|
+
} catch (D) {
|
|
3162
|
+
console.warn("[use-chat] Failed to hydrate state_history payload", D);
|
|
3163
3163
|
}
|
|
3164
3164
|
}
|
|
3165
3165
|
try {
|
|
3166
3166
|
A == null || A(re);
|
|
3167
|
-
} catch (
|
|
3168
|
-
console.error("[use-chat] Error in onEvent callback:",
|
|
3167
|
+
} catch (D) {
|
|
3168
|
+
console.error("[use-chat] Error in onEvent callback:", D, "for event:", re.type);
|
|
3169
3169
|
}
|
|
3170
3170
|
try {
|
|
3171
|
-
re.type === "tool.start" && (
|
|
3172
|
-
} catch (
|
|
3173
|
-
console.warn("[use-chat] Typed callback error:",
|
|
3171
|
+
re.type === "tool.start" && (E != null && E.onToolStart) ? E.onToolStart(re) : re.type === "tool.end" && (E != null && E.onToolEnd) ? E.onToolEnd(re) : re.type === "token" && (E != null && E.onToken) ? E.onToken(re.token) : re.type === "thread_info" && (E != null && E.onThreadInfo) && E.onThreadInfo(re);
|
|
3172
|
+
} catch (D) {
|
|
3173
|
+
console.warn("[use-chat] Typed callback error:", D);
|
|
3174
3174
|
}
|
|
3175
3175
|
if (re.type === "messages/partial") {
|
|
3176
3176
|
const V = re.messages;
|
|
@@ -3213,16 +3213,16 @@ function qg(e = {}) {
|
|
|
3213
3213
|
}
|
|
3214
3214
|
}
|
|
3215
3215
|
} else if (re.type === "updates") {
|
|
3216
|
-
const
|
|
3217
|
-
if (
|
|
3218
|
-
const V =
|
|
3216
|
+
const D = re;
|
|
3217
|
+
if (D.tools) {
|
|
3218
|
+
const V = D.tools;
|
|
3219
3219
|
if (V.status === "start") {
|
|
3220
3220
|
const oe = {
|
|
3221
3221
|
type: "tool.start",
|
|
3222
3222
|
id: V.id,
|
|
3223
3223
|
name: V.name,
|
|
3224
3224
|
args: V.args,
|
|
3225
|
-
seq:
|
|
3225
|
+
seq: D.seq,
|
|
3226
3226
|
callId: V.id
|
|
3227
3227
|
};
|
|
3228
3228
|
try {
|
|
@@ -3237,7 +3237,7 @@ function qg(e = {}) {
|
|
|
3237
3237
|
name: V.name,
|
|
3238
3238
|
content: V.output,
|
|
3239
3239
|
artifact: V.artifact,
|
|
3240
|
-
seq:
|
|
3240
|
+
seq: D.seq,
|
|
3241
3241
|
callId: V.id
|
|
3242
3242
|
};
|
|
3243
3243
|
try {
|
|
@@ -3251,33 +3251,33 @@ function qg(e = {}) {
|
|
|
3251
3251
|
} else if (re.type === "heartbeat") {
|
|
3252
3252
|
console.debug("[use-chat] heartbeat received");
|
|
3253
3253
|
try {
|
|
3254
|
-
(Ie =
|
|
3255
|
-
} catch (
|
|
3256
|
-
console.warn("[use-chat] heartbeat callback failed",
|
|
3254
|
+
(Ie = E == null ? void 0 : E.onHeartbeat) == null || Ie.call(E, re);
|
|
3255
|
+
} catch (D) {
|
|
3256
|
+
console.warn("[use-chat] heartbeat callback failed", D);
|
|
3257
3257
|
}
|
|
3258
3258
|
} else if (Vt !== null && cancelAnimationFrame(Vt), vn(), re.type === "checkpoint")
|
|
3259
3259
|
m(re.checkpointId ?? null);
|
|
3260
3260
|
else if (re.type === "error") {
|
|
3261
|
-
const
|
|
3262
|
-
if (u(
|
|
3263
|
-
console.error("[use-chat] Auth error detected:",
|
|
3261
|
+
const D = re;
|
|
3262
|
+
if (u(D.message), P = "error", W = D.message, D.error_type === "auth_error" || D.code === "TOKEN_EXPIRED" || ((Ke = D.message) == null ? void 0 : Ke.includes("token")) || ((Xe = D.message) == null ? void 0 : Xe.includes("401")) || ((He = D.message) == null ? void 0 : He.includes("unauthorized")) || ((Ue = D.message) == null ? void 0 : Ue.includes("Unauthorized"))) {
|
|
3263
|
+
console.error("[use-chat] Auth error detected:", D.message);
|
|
3264
3264
|
try {
|
|
3265
|
-
(it =
|
|
3265
|
+
(it = E == null ? void 0 : E.onAuthError) == null || it.call(E, D.message);
|
|
3266
3266
|
} catch (oe) {
|
|
3267
3267
|
console.warn("[use-chat] onAuthError handler failed", oe);
|
|
3268
3268
|
}
|
|
3269
|
-
|
|
3269
|
+
L.abort();
|
|
3270
3270
|
}
|
|
3271
3271
|
}
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
vn(), P === null && !
|
|
3274
|
+
vn(), P === null && !L.signal.aborted && (P = "complete");
|
|
3275
3275
|
} catch (Fe) {
|
|
3276
3276
|
if (Fe.name === "AbortError")
|
|
3277
3277
|
P = P ?? "aborted";
|
|
3278
3278
|
else {
|
|
3279
3279
|
const Je = Fe.message || String(Fe);
|
|
3280
|
-
P = "error", W = Je, u(Je), (mt =
|
|
3280
|
+
P = "error", W = Je, u(Je), (mt = E == null ? void 0 : E.onError) == null || mt.call(E, Je);
|
|
3281
3281
|
}
|
|
3282
3282
|
} finally {
|
|
3283
3283
|
try {
|
|
@@ -3293,12 +3293,12 @@ function qg(e = {}) {
|
|
|
3293
3293
|
P = P ?? "aborted";
|
|
3294
3294
|
else {
|
|
3295
3295
|
const lt = at.message || String(at);
|
|
3296
|
-
P = "error", W = lt, u(lt), (gt =
|
|
3296
|
+
P = "error", W = lt, u(lt), (gt = E == null ? void 0 : E.onError) == null || gt.call(E, lt), O || ((Qe = E == null ? void 0 : E.onConnectionError) == null || Qe.call(E, lt), O = !0);
|
|
3297
3297
|
}
|
|
3298
3298
|
} finally {
|
|
3299
|
-
const at = F.current, lt = Y.current, It = _.current, Ut = q.current, et = P ?? (
|
|
3299
|
+
const at = F.current, lt = Y.current, It = _.current, Ut = q.current, et = P ?? (L.signal.aborted ? "aborted" : W ? "error" : "complete");
|
|
3300
3300
|
try {
|
|
3301
|
-
(ot =
|
|
3301
|
+
(ot = E == null ? void 0 : E.onClosed) == null || ot.call(E, {
|
|
3302
3302
|
reason: et,
|
|
3303
3303
|
lastSeq: at,
|
|
3304
3304
|
lastCheckpointId: lt,
|
|
@@ -3311,13 +3311,13 @@ function qg(e = {}) {
|
|
|
3311
3311
|
}
|
|
3312
3312
|
c(!1), v(!1), j.current = null, F.current = 0, x(0), U.current = null;
|
|
3313
3313
|
}
|
|
3314
|
-
})(), { close: () =>
|
|
3314
|
+
})(), { close: () => L.abort() };
|
|
3315
3315
|
},
|
|
3316
3316
|
[t, n, r, e.autoAppendAssistant]
|
|
3317
3317
|
);
|
|
3318
3318
|
return Be(() => () => {
|
|
3319
|
-
var
|
|
3320
|
-
|
|
3319
|
+
var M;
|
|
3320
|
+
$.current = !1, (M = j.current) == null || M.abort();
|
|
3321
3321
|
}, []), {
|
|
3322
3322
|
isStreaming: a,
|
|
3323
3323
|
error: l,
|
|
@@ -3327,10 +3327,10 @@ function qg(e = {}) {
|
|
|
3327
3327
|
lastCheckpointId: p,
|
|
3328
3328
|
lastSeq: g,
|
|
3329
3329
|
connected: y,
|
|
3330
|
-
stream:
|
|
3330
|
+
stream: ne,
|
|
3331
3331
|
stop: B,
|
|
3332
3332
|
clear: H,
|
|
3333
|
-
setToken:
|
|
3333
|
+
setToken: Q,
|
|
3334
3334
|
values: T,
|
|
3335
3335
|
interrupt: () => Promise.resolve(),
|
|
3336
3336
|
resume: () => Promise.resolve(),
|
|
@@ -3393,7 +3393,7 @@ function Xg({
|
|
|
3393
3393
|
}, [a]), Be(() => {
|
|
3394
3394
|
t !== void 0 && t !== w.current && c(t);
|
|
3395
3395
|
}, [t]);
|
|
3396
|
-
const
|
|
3396
|
+
const N = ie(async () => {
|
|
3397
3397
|
u(!0), h(null);
|
|
3398
3398
|
try {
|
|
3399
3399
|
const H = await e.listThreads();
|
|
@@ -3417,34 +3417,34 @@ function Xg({
|
|
|
3417
3417
|
}
|
|
3418
3418
|
}, [e, n]);
|
|
3419
3419
|
Be(() => {
|
|
3420
|
-
|
|
3421
|
-
}, [
|
|
3420
|
+
N();
|
|
3421
|
+
}, [N]), Be(() => {
|
|
3422
3422
|
j();
|
|
3423
3423
|
}, [j]), Be(() => {
|
|
3424
3424
|
r == null || r(a);
|
|
3425
3425
|
}, [a, r]);
|
|
3426
|
-
const
|
|
3426
|
+
const $ = ie(
|
|
3427
3427
|
async (H, B) => {
|
|
3428
3428
|
try {
|
|
3429
|
-
const
|
|
3430
|
-
return c(
|
|
3431
|
-
} catch (
|
|
3432
|
-
const
|
|
3433
|
-
return n == null || n(
|
|
3429
|
+
const ne = B && typeof B == "object" ? { id: B.id, name: B.name ?? "" } : void 0, M = await e.createThread(H, ne);
|
|
3430
|
+
return c(M.threadId), await N(), M.threadId;
|
|
3431
|
+
} catch (ne) {
|
|
3432
|
+
const M = String(ne);
|
|
3433
|
+
return n == null || n(M), null;
|
|
3434
3434
|
}
|
|
3435
3435
|
},
|
|
3436
|
-
[e, n,
|
|
3436
|
+
[e, n, N]
|
|
3437
3437
|
), F = ie(
|
|
3438
3438
|
async (H) => {
|
|
3439
3439
|
const B = s;
|
|
3440
|
-
i((
|
|
3441
|
-
const
|
|
3442
|
-
T.current.set(H,
|
|
3440
|
+
i((M) => M.filter((A) => A.threadId !== H));
|
|
3441
|
+
const ne = new AbortController();
|
|
3442
|
+
T.current.set(H, ne);
|
|
3443
3443
|
try {
|
|
3444
3444
|
await e.deleteThread(H), w.current === H && (c(null), o == null || o());
|
|
3445
|
-
} catch (
|
|
3445
|
+
} catch (M) {
|
|
3446
3446
|
i(B);
|
|
3447
|
-
const A = String(
|
|
3447
|
+
const A = String(M);
|
|
3448
3448
|
n == null || n(A);
|
|
3449
3449
|
} finally {
|
|
3450
3450
|
T.current.delete(H);
|
|
@@ -3454,20 +3454,20 @@ function Xg({
|
|
|
3454
3454
|
), U = ie(
|
|
3455
3455
|
async (H, B) => {
|
|
3456
3456
|
try {
|
|
3457
|
-
await e.updateThread(H, B), await
|
|
3458
|
-
} catch (
|
|
3459
|
-
n == null || n(String(
|
|
3457
|
+
await e.updateThread(H, B), await N();
|
|
3458
|
+
} catch (ne) {
|
|
3459
|
+
n == null || n(String(ne));
|
|
3460
3460
|
}
|
|
3461
3461
|
},
|
|
3462
|
-
[e, n,
|
|
3462
|
+
[e, n, N]
|
|
3463
3463
|
), Y = ie(
|
|
3464
3464
|
async (H, B) => {
|
|
3465
3465
|
S(!0), C("Sharing thread…");
|
|
3466
3466
|
try {
|
|
3467
3467
|
await e.shareThread(H, B), await j(), C("Shared successfully");
|
|
3468
|
-
} catch (
|
|
3469
|
-
const
|
|
3470
|
-
throw n == null || n(
|
|
3468
|
+
} catch (ne) {
|
|
3469
|
+
const M = Yg(ne);
|
|
3470
|
+
throw n == null || n(M), C(`Failed to share: ${M}`), new Error(M);
|
|
3471
3471
|
} finally {
|
|
3472
3472
|
S(!1);
|
|
3473
3473
|
}
|
|
@@ -3477,23 +3477,23 @@ function Xg({
|
|
|
3477
3477
|
async (H, B) => {
|
|
3478
3478
|
try {
|
|
3479
3479
|
await e.unshareThread(H, B), await j();
|
|
3480
|
-
} catch (
|
|
3481
|
-
const
|
|
3482
|
-
throw n == null || n(
|
|
3480
|
+
} catch (ne) {
|
|
3481
|
+
const M = String(ne);
|
|
3482
|
+
throw n == null || n(M), ne;
|
|
3483
3483
|
}
|
|
3484
3484
|
},
|
|
3485
3485
|
[e, n, j]
|
|
3486
3486
|
), q = Ne(
|
|
3487
3487
|
() => ({
|
|
3488
|
-
createThread:
|
|
3488
|
+
createThread: $,
|
|
3489
3489
|
deleteThread: F,
|
|
3490
3490
|
renameThread: U,
|
|
3491
|
-
refreshThreads:
|
|
3491
|
+
refreshThreads: N,
|
|
3492
3492
|
refreshSharedThreads: j,
|
|
3493
3493
|
shareThread: Y,
|
|
3494
3494
|
unshareThread: _
|
|
3495
3495
|
}),
|
|
3496
|
-
[
|
|
3496
|
+
[$, F, U, N, j, Y, _]
|
|
3497
3497
|
), X = ie((H) => {
|
|
3498
3498
|
if (!(H != null && H.threadId)) return;
|
|
3499
3499
|
const B = {
|
|
@@ -3504,18 +3504,18 @@ function Xg({
|
|
|
3504
3504
|
updatedAt: H.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3505
3505
|
messageCount: H.messageCount ?? 1
|
|
3506
3506
|
};
|
|
3507
|
-
i((
|
|
3508
|
-
let
|
|
3509
|
-
const A =
|
|
3510
|
-
...
|
|
3511
|
-
title: B.title ??
|
|
3512
|
-
project: B.project ??
|
|
3513
|
-
updatedAt: B.updatedAt ??
|
|
3514
|
-
messageCount: B.messageCount ??
|
|
3515
|
-
}) :
|
|
3516
|
-
return
|
|
3507
|
+
i((ne) => {
|
|
3508
|
+
let M = !1;
|
|
3509
|
+
const A = ne.map((E) => E.threadId === B.threadId ? (M = !0, console.debug("[useThreadsState] thread_info: updating existing thread", B.threadId), {
|
|
3510
|
+
...E,
|
|
3511
|
+
title: B.title ?? E.title,
|
|
3512
|
+
project: B.project ?? E.project,
|
|
3513
|
+
updatedAt: B.updatedAt ?? E.updatedAt,
|
|
3514
|
+
messageCount: B.messageCount ?? E.messageCount
|
|
3515
|
+
}) : E);
|
|
3516
|
+
return M ? A : (console.debug("[useThreadsState] thread_info: adding thread to list", B.threadId), [B, ...ne]);
|
|
3517
3517
|
});
|
|
3518
|
-
}, []),
|
|
3518
|
+
}, []), Q = ie(() => C(null), []);
|
|
3519
3519
|
return {
|
|
3520
3520
|
threads: s,
|
|
3521
3521
|
currentThreadId: a,
|
|
@@ -3529,7 +3529,7 @@ function Xg({
|
|
|
3529
3529
|
addThreadFromEvent: X,
|
|
3530
3530
|
shareInFlight: R,
|
|
3531
3531
|
shareStatus: v,
|
|
3532
|
-
clearShareStatus:
|
|
3532
|
+
clearShareStatus: Q
|
|
3533
3533
|
};
|
|
3534
3534
|
}
|
|
3535
3535
|
const gu = Tr(null);
|
|
@@ -4344,41 +4344,41 @@ function Px({
|
|
|
4344
4344
|
const [u, f] = fe(null), p = Ne(
|
|
4345
4345
|
() => mr(u),
|
|
4346
4346
|
[u]
|
|
4347
|
-
).checkpoints, m = _x(p), g = m.timeline, [x, y] = fe(!1), [v, C] = fe(!1), [R, S] = fe(null), w = Te(r), T = Te(null),
|
|
4347
|
+
).checkpoints, m = _x(p), g = m.timeline, [x, y] = fe(!1), [v, C] = fe(!1), [R, S] = fe(null), w = Te(r), T = Te(null), N = Te(null), j = Te(null), $ = Te(null), F = Te(null), U = Te(/* @__PURE__ */ new Map()), Y = Te(null);
|
|
4348
4348
|
Be(() => {
|
|
4349
4349
|
w.current = r;
|
|
4350
4350
|
}, [r]);
|
|
4351
4351
|
const _ = ie(
|
|
4352
|
-
async (
|
|
4352
|
+
async (L) => {
|
|
4353
4353
|
var W, O;
|
|
4354
|
-
if (!
|
|
4355
|
-
const P =
|
|
4356
|
-
(W =
|
|
4354
|
+
if (!L.threadId) return;
|
|
4355
|
+
const P = L.threadId;
|
|
4356
|
+
(W = L.onStart) == null || W.call(L), L.setLoading(!0);
|
|
4357
4357
|
try {
|
|
4358
|
-
await
|
|
4358
|
+
await L.action(P);
|
|
4359
4359
|
} catch (I) {
|
|
4360
4360
|
if (!xl(I) && w.current === P) {
|
|
4361
4361
|
const J = String(I);
|
|
4362
|
-
(O =
|
|
4362
|
+
(O = L.handleError) == null || O.call(L, J), n == null || n(J);
|
|
4363
4363
|
}
|
|
4364
4364
|
throw I;
|
|
4365
4365
|
} finally {
|
|
4366
|
-
|
|
4366
|
+
L.setLoading(!1);
|
|
4367
4367
|
}
|
|
4368
4368
|
},
|
|
4369
4369
|
[n]
|
|
4370
4370
|
), q = ie(
|
|
4371
|
-
async (
|
|
4371
|
+
async (L, P) => {
|
|
4372
4372
|
var J;
|
|
4373
|
-
if (!
|
|
4374
|
-
const W = `${
|
|
4373
|
+
if (!L) return;
|
|
4374
|
+
const W = `${L}:${P ?? "latest"}`, O = U.current.get(W);
|
|
4375
4375
|
if (O)
|
|
4376
4376
|
return O;
|
|
4377
4377
|
(J = Y.current) == null || J.abort();
|
|
4378
4378
|
const I = new AbortController();
|
|
4379
4379
|
Y.current = I;
|
|
4380
4380
|
const K = _({
|
|
4381
|
-
threadId:
|
|
4381
|
+
threadId: L,
|
|
4382
4382
|
setLoading: y,
|
|
4383
4383
|
onStart: () => S(null),
|
|
4384
4384
|
handleError: (se) => S(se),
|
|
@@ -4408,32 +4408,32 @@ function Px({
|
|
|
4408
4408
|
} finally {
|
|
4409
4409
|
U.current.delete(W), Y.current === I && (Y.current = null);
|
|
4410
4410
|
}
|
|
4411
|
-
return w.current ===
|
|
4411
|
+
return w.current === L && (F.current = W), K;
|
|
4412
4412
|
},
|
|
4413
4413
|
[e, t, _]
|
|
4414
4414
|
), X = ie(
|
|
4415
|
-
async (
|
|
4416
|
-
|
|
4415
|
+
async (L, P) => {
|
|
4416
|
+
$.current = L;
|
|
4417
4417
|
try {
|
|
4418
|
-
await q(
|
|
4418
|
+
await q(L, P);
|
|
4419
4419
|
} catch (W) {
|
|
4420
4420
|
if (!xl(W))
|
|
4421
4421
|
throw W;
|
|
4422
4422
|
} finally {
|
|
4423
|
-
|
|
4423
|
+
$.current === L && ($.current = null);
|
|
4424
4424
|
}
|
|
4425
4425
|
},
|
|
4426
4426
|
[q]
|
|
4427
|
-
),
|
|
4428
|
-
|
|
4429
|
-
}, []), H = ie((
|
|
4430
|
-
j.current =
|
|
4427
|
+
), Q = ie((L) => {
|
|
4428
|
+
N.current = L;
|
|
4429
|
+
}, []), H = ie((L) => {
|
|
4430
|
+
j.current = L;
|
|
4431
4431
|
}, []), B = ie(
|
|
4432
|
-
(
|
|
4433
|
-
const P =
|
|
4432
|
+
(L) => {
|
|
4433
|
+
const P = L.threadId ?? w.current;
|
|
4434
4434
|
if (!P || w.current && w.current !== P)
|
|
4435
4435
|
return;
|
|
4436
|
-
const { checkpoints: W, latest: O } = mr(
|
|
4436
|
+
const { checkpoints: W, latest: O } = mr(L);
|
|
4437
4437
|
if (!W.length)
|
|
4438
4438
|
return;
|
|
4439
4439
|
const I = O, K = j.current === P;
|
|
@@ -4441,11 +4441,11 @@ function Px({
|
|
|
4441
4441
|
checkpointId: (I == null ? void 0 : I.checkpointId) ?? null,
|
|
4442
4442
|
checkpointNs: (I == null ? void 0 : I.checkpointNs) ?? null,
|
|
4443
4443
|
pendingInterrupt: (I == null ? void 0 : I.interrupt) ?? null
|
|
4444
|
-
}), f(
|
|
4444
|
+
}), f(L), F.current = `${P}:latest`, N.current = null, j.current === P && (j.current = null);
|
|
4445
4445
|
},
|
|
4446
4446
|
[t, c]
|
|
4447
|
-
),
|
|
4448
|
-
async (
|
|
4447
|
+
), ne = ie(
|
|
4448
|
+
async (L, P) => {
|
|
4449
4449
|
const W = w.current;
|
|
4450
4450
|
await _({
|
|
4451
4451
|
threadId: W,
|
|
@@ -4453,16 +4453,16 @@ function Px({
|
|
|
4453
4453
|
action: async (O) => {
|
|
4454
4454
|
const I = await e.getStateHistory({
|
|
4455
4455
|
threadId: O,
|
|
4456
|
-
checkpointId:
|
|
4456
|
+
checkpointId: L,
|
|
4457
4457
|
checkpointNs: P ?? void 0
|
|
4458
4458
|
});
|
|
4459
4459
|
if (w.current !== O)
|
|
4460
4460
|
return;
|
|
4461
4461
|
const { checkpoints: K } = mr(I), J = K.find(
|
|
4462
|
-
(se) => se.checkpointId ===
|
|
4462
|
+
(se) => se.checkpointId === L && (P ? se.checkpointNs === P : !0)
|
|
4463
4463
|
);
|
|
4464
4464
|
if (!J) {
|
|
4465
|
-
console.warn("[useThreadHistoryState] Requested checkpoint not found:", { checkpointId:
|
|
4465
|
+
console.warn("[useThreadHistoryState] Requested checkpoint not found:", { checkpointId: L, checkpointNs: P });
|
|
4466
4466
|
return;
|
|
4467
4467
|
}
|
|
4468
4468
|
f(I), t(J.messages ?? [], {
|
|
@@ -4474,10 +4474,10 @@ function Px({
|
|
|
4474
4474
|
});
|
|
4475
4475
|
},
|
|
4476
4476
|
[e, t, _]
|
|
4477
|
-
),
|
|
4478
|
-
(
|
|
4477
|
+
), M = ie(
|
|
4478
|
+
(L, P) => {
|
|
4479
4479
|
t(l(), {
|
|
4480
|
-
checkpointId:
|
|
4480
|
+
checkpointId: L ?? null,
|
|
4481
4481
|
checkpointNs: P ?? null
|
|
4482
4482
|
});
|
|
4483
4483
|
},
|
|
@@ -4488,24 +4488,24 @@ function Px({
|
|
|
4488
4488
|
Be(() => {
|
|
4489
4489
|
if (!a || !r || x || c)
|
|
4490
4490
|
return;
|
|
4491
|
-
if (
|
|
4492
|
-
|
|
4491
|
+
if (N.current === r) {
|
|
4492
|
+
N.current = null, T.current = r;
|
|
4493
4493
|
return;
|
|
4494
4494
|
}
|
|
4495
4495
|
if (j.current === r) {
|
|
4496
4496
|
T.current = r;
|
|
4497
4497
|
return;
|
|
4498
4498
|
}
|
|
4499
|
-
if (
|
|
4500
|
-
|
|
4499
|
+
if ($.current === r) {
|
|
4500
|
+
$.current = null, T.current = r;
|
|
4501
4501
|
return;
|
|
4502
4502
|
}
|
|
4503
4503
|
if (T.current === r)
|
|
4504
4504
|
return;
|
|
4505
4505
|
T.current = r;
|
|
4506
|
-
let
|
|
4506
|
+
let L;
|
|
4507
4507
|
const P = `${r}:latest`;
|
|
4508
|
-
F.current !== P && X(r,
|
|
4508
|
+
F.current !== P && X(r, L);
|
|
4509
4509
|
}, [
|
|
4510
4510
|
a,
|
|
4511
4511
|
r,
|
|
@@ -4516,8 +4516,8 @@ function Px({
|
|
|
4516
4516
|
c,
|
|
4517
4517
|
X
|
|
4518
4518
|
]);
|
|
4519
|
-
const
|
|
4520
|
-
f(null), y(!1), C(!1), S(null),
|
|
4519
|
+
const E = ie(() => {
|
|
4520
|
+
f(null), y(!1), C(!1), S(null), N.current = null, j.current = null, T.current = null, F.current = null, $.current = null;
|
|
4521
4521
|
}, []);
|
|
4522
4522
|
return {
|
|
4523
4523
|
threadCheckpoints: p,
|
|
@@ -4527,14 +4527,14 @@ function Px({
|
|
|
4527
4527
|
isLoadingCheckpoint: v,
|
|
4528
4528
|
threadStateError: R,
|
|
4529
4529
|
loadThread: X,
|
|
4530
|
-
navigateToCheckpoint:
|
|
4531
|
-
setCurrentCheckpointId:
|
|
4530
|
+
navigateToCheckpoint: ne,
|
|
4531
|
+
setCurrentCheckpointId: M,
|
|
4532
4532
|
returnToLatest: A,
|
|
4533
4533
|
handleStateHistoryEvent: B,
|
|
4534
|
-
markSkipNextLoad:
|
|
4534
|
+
markSkipNextLoad: Q,
|
|
4535
4535
|
markStreamPendingThread: H,
|
|
4536
|
-
resetHistoryState:
|
|
4537
|
-
clearState:
|
|
4536
|
+
resetHistoryState: E,
|
|
4537
|
+
clearState: E
|
|
4538
4538
|
};
|
|
4539
4539
|
}
|
|
4540
4540
|
const wu = Tr(null), Su = Tr(null);
|
|
@@ -4570,9 +4570,9 @@ function Mx({
|
|
|
4570
4570
|
setCurrentCheckpointId: S,
|
|
4571
4571
|
returnToLatest: w,
|
|
4572
4572
|
handleStateHistoryEvent: T,
|
|
4573
|
-
markSkipNextLoad:
|
|
4573
|
+
markSkipNextLoad: N,
|
|
4574
4574
|
markStreamPendingThread: j,
|
|
4575
|
-
resetHistoryState:
|
|
4575
|
+
resetHistoryState: $
|
|
4576
4576
|
} = Px({
|
|
4577
4577
|
api: a,
|
|
4578
4578
|
seed: u,
|
|
@@ -4586,33 +4586,33 @@ function Mx({
|
|
|
4586
4586
|
getMessages: ie(() => l.messages, [l.messages])
|
|
4587
4587
|
});
|
|
4588
4588
|
Be(() => {
|
|
4589
|
-
c || (u([], {}),
|
|
4590
|
-
}, [c, u,
|
|
4589
|
+
c || (u([], {}), $());
|
|
4590
|
+
}, [c, u, $]);
|
|
4591
4591
|
const F = Te(null), U = ie(
|
|
4592
|
-
(
|
|
4593
|
-
F.current =
|
|
4592
|
+
(M) => {
|
|
4593
|
+
F.current = M;
|
|
4594
4594
|
},
|
|
4595
4595
|
[]
|
|
4596
4596
|
), Y = Te(null), _ = ie(
|
|
4597
|
-
(
|
|
4598
|
-
Y.current =
|
|
4597
|
+
(M) => {
|
|
4598
|
+
Y.current = M;
|
|
4599
4599
|
},
|
|
4600
4600
|
[]
|
|
4601
4601
|
), q = Ne(() => ({ assemblingMessageId: l.assemblingId ?? null }), [l.assemblingId]), X = ie(
|
|
4602
|
-
(
|
|
4603
|
-
const
|
|
4602
|
+
(M, A) => {
|
|
4603
|
+
const E = pu(M, "user");
|
|
4604
4604
|
return h({
|
|
4605
4605
|
type: "user_message",
|
|
4606
4606
|
payload: {
|
|
4607
|
-
message:
|
|
4608
|
-
editingMessageId:
|
|
4607
|
+
message: E,
|
|
4608
|
+
editingMessageId: A == null ? void 0 : A.editingMessageId
|
|
4609
4609
|
}
|
|
4610
|
-
}),
|
|
4610
|
+
}), E;
|
|
4611
4611
|
},
|
|
4612
4612
|
[h]
|
|
4613
|
-
),
|
|
4614
|
-
F.current ? await F.current() : (u([], {}),
|
|
4615
|
-
}, [u,
|
|
4613
|
+
), Q = ie(async () => {
|
|
4614
|
+
F.current ? await F.current() : (u([], {}), $());
|
|
4615
|
+
}, [u, $]), H = Ne(() => lx(l.messages), [l.messages]), B = Ne(
|
|
4616
4616
|
() => ({
|
|
4617
4617
|
threadId: c,
|
|
4618
4618
|
messages: l.messages,
|
|
@@ -4632,32 +4632,32 @@ function Mx({
|
|
|
4632
4632
|
loadOlder: async () => {
|
|
4633
4633
|
},
|
|
4634
4634
|
// Placeholder
|
|
4635
|
-
seedFromSnapshot: (
|
|
4636
|
-
u(
|
|
4637
|
-
checkpointId:
|
|
4638
|
-
checkpointNs:
|
|
4639
|
-
pendingInterrupt:
|
|
4635
|
+
seedFromSnapshot: (M) => {
|
|
4636
|
+
u(M.messages, {
|
|
4637
|
+
checkpointId: M.checkpointId,
|
|
4638
|
+
checkpointNs: M.checkpointNs,
|
|
4639
|
+
pendingInterrupt: M.interrupt
|
|
4640
4640
|
});
|
|
4641
4641
|
},
|
|
4642
|
-
clearState:
|
|
4642
|
+
clearState: Q,
|
|
4643
4643
|
navigateToCheckpoint: R,
|
|
4644
4644
|
setCurrentCheckpointId: S,
|
|
4645
4645
|
returnToLatest: w,
|
|
4646
|
-
loadThread: async (
|
|
4647
|
-
await C(
|
|
4646
|
+
loadThread: async (M, A, E) => {
|
|
4647
|
+
await C(M, A, { clearProgress: !1 });
|
|
4648
4648
|
},
|
|
4649
|
-
clearThread:
|
|
4650
|
-
respondToInterrupt: async (
|
|
4651
|
-
Y.current && await Y.current(
|
|
4649
|
+
clearThread: Q,
|
|
4650
|
+
respondToInterrupt: async (M, A, E) => {
|
|
4651
|
+
Y.current && await Y.current(M, A, E);
|
|
4652
4652
|
},
|
|
4653
4653
|
messagePreviews: g.messagePreviews,
|
|
4654
4654
|
handleStateHistoryEvent: T,
|
|
4655
|
-
markSkipNextLoad:
|
|
4655
|
+
markSkipNextLoad: N,
|
|
4656
4656
|
markStreamPendingThread: j,
|
|
4657
|
-
resetHistoryState:
|
|
4657
|
+
resetHistoryState: $,
|
|
4658
4658
|
pushUser: X,
|
|
4659
4659
|
onEvent: f,
|
|
4660
|
-
artifacts:
|
|
4660
|
+
artifacts: H
|
|
4661
4661
|
}),
|
|
4662
4662
|
[
|
|
4663
4663
|
c,
|
|
@@ -4674,25 +4674,26 @@ function Mx({
|
|
|
4674
4674
|
y,
|
|
4675
4675
|
v,
|
|
4676
4676
|
u,
|
|
4677
|
-
|
|
4677
|
+
Q,
|
|
4678
4678
|
R,
|
|
4679
4679
|
S,
|
|
4680
4680
|
w,
|
|
4681
4681
|
C,
|
|
4682
4682
|
T,
|
|
4683
|
-
|
|
4683
|
+
N,
|
|
4684
4684
|
j,
|
|
4685
4685
|
X,
|
|
4686
|
-
f
|
|
4686
|
+
f,
|
|
4687
|
+
H
|
|
4687
4688
|
]
|
|
4688
|
-
),
|
|
4689
|
+
), ne = Ne(
|
|
4689
4690
|
() => ({
|
|
4690
4691
|
registerClearThread: U,
|
|
4691
4692
|
registerRespondToInterrupt: _
|
|
4692
4693
|
}),
|
|
4693
4694
|
[U, _]
|
|
4694
4695
|
);
|
|
4695
|
-
return /* @__PURE__ */ d.jsx(Su.Provider, { value:
|
|
4696
|
+
return /* @__PURE__ */ d.jsx(Su.Provider, { value: ne, children: /* @__PURE__ */ d.jsx(wu.Provider, { value: B, children: e }) });
|
|
4696
4697
|
}
|
|
4697
4698
|
function kl(e, t) {
|
|
4698
4699
|
if (!e) return null;
|
|
@@ -4793,32 +4794,32 @@ function zx({
|
|
|
4793
4794
|
markSkipNextLoad: S,
|
|
4794
4795
|
markStreamPendingThread: w,
|
|
4795
4796
|
resetHistoryState: T,
|
|
4796
|
-
pushUser:
|
|
4797
|
+
pushUser: N,
|
|
4797
4798
|
onEvent: j,
|
|
4798
|
-
messages:
|
|
4799
|
+
messages: $
|
|
4799
4800
|
} = Ts(), { registerClearThread: F, registerRespondToInterrupt: U } = Ox(), Y = ie(
|
|
4800
|
-
(
|
|
4801
|
-
g(
|
|
4801
|
+
(M) => {
|
|
4802
|
+
g(M), m.current !== M.threadId && ((M.created ?? !m.current) && S(M.threadId), w(M.threadId), p(M.threadId));
|
|
4802
4803
|
},
|
|
4803
4804
|
[g, S, w, p, m]
|
|
4804
4805
|
), _ = ie(
|
|
4805
|
-
(
|
|
4806
|
-
|
|
4806
|
+
(M) => {
|
|
4807
|
+
M.type === "thread_info" ? Y(M) : M.type === "state_history" ? R(M) : M.type === "tool.end" ? (j(M), i == null || i(M)) : j(M);
|
|
4807
4808
|
},
|
|
4808
4809
|
[Y, R, j, i]
|
|
4809
4810
|
), q = ie(
|
|
4810
|
-
(
|
|
4811
|
-
a(
|
|
4812
|
-
_(
|
|
4811
|
+
(M, A) => {
|
|
4812
|
+
a(M, (E) => {
|
|
4813
|
+
_(E), A == null || A(E);
|
|
4813
4814
|
}, {
|
|
4814
|
-
onError: (
|
|
4815
|
-
console.error("[StreamingProvider] Stream error:",
|
|
4815
|
+
onError: (E) => {
|
|
4816
|
+
console.error("[StreamingProvider] Stream error:", E), r == null || r(E);
|
|
4816
4817
|
},
|
|
4817
|
-
onAuthError: (
|
|
4818
|
-
console.error("[StreamingProvider] Auth error:",
|
|
4818
|
+
onAuthError: (E) => {
|
|
4819
|
+
console.error("[StreamingProvider] Auth error:", E), o == null || o(E);
|
|
4819
4820
|
},
|
|
4820
|
-
onConnectionError: (
|
|
4821
|
-
console.error("[StreamingProvider] Connection error:",
|
|
4821
|
+
onConnectionError: (E) => {
|
|
4822
|
+
console.error("[StreamingProvider] Connection error:", E), s == null || s(E);
|
|
4822
4823
|
}
|
|
4823
4824
|
});
|
|
4824
4825
|
},
|
|
@@ -4827,25 +4828,25 @@ function zx({
|
|
|
4827
4828
|
Be(() => {
|
|
4828
4829
|
X.current = v;
|
|
4829
4830
|
}, [v]);
|
|
4830
|
-
const
|
|
4831
|
-
async (
|
|
4832
|
-
const
|
|
4833
|
-
if (!
|
|
4831
|
+
const Q = ie(
|
|
4832
|
+
async (M, A, E) => {
|
|
4833
|
+
const L = m.current;
|
|
4834
|
+
if (!L)
|
|
4834
4835
|
throw new Error("No active thread to handle interrupt");
|
|
4835
|
-
const P =
|
|
4836
|
-
threadId:
|
|
4836
|
+
const P = M ? A ?? !0 : !1, W = X.current, O = {
|
|
4837
|
+
threadId: L,
|
|
4837
4838
|
checkpointId: W.id ?? void 0,
|
|
4838
4839
|
checkpointNs: W.namespace ?? void 0,
|
|
4839
4840
|
command: { kind: "resume", value: P },
|
|
4840
|
-
payload:
|
|
4841
|
+
payload: E == null ? void 0 : E.payload
|
|
4841
4842
|
};
|
|
4842
4843
|
q(O);
|
|
4843
4844
|
},
|
|
4844
4845
|
[m, q]
|
|
4845
4846
|
);
|
|
4846
4847
|
Be(() => {
|
|
4847
|
-
U(
|
|
4848
|
-
}, [
|
|
4848
|
+
U(Q);
|
|
4849
|
+
}, [Q, U]);
|
|
4849
4850
|
const H = ie(async () => {
|
|
4850
4851
|
c(), l(), T(), p(null);
|
|
4851
4852
|
}, [l, T, p, c]);
|
|
@@ -4853,21 +4854,21 @@ function zx({
|
|
|
4853
4854
|
F(H);
|
|
4854
4855
|
}, [H, F]);
|
|
4855
4856
|
const B = ie(
|
|
4856
|
-
async (
|
|
4857
|
+
async (M, A) => {
|
|
4857
4858
|
u && c();
|
|
4858
|
-
let
|
|
4859
|
-
const
|
|
4859
|
+
let E = m.current;
|
|
4860
|
+
const L = (M == null ? void 0 : M.text) ?? "", P = (M == null ? void 0 : M.attachments) ?? [], W = (L == null ? void 0 : L.trim()) ?? "", O = { ...(M == null ? void 0 : M.payload) ?? {} }, I = Array.isArray(O.messages) ? O.messages : void 0;
|
|
4860
4861
|
I && delete O.messages;
|
|
4861
|
-
const K = !!(I && I.length), J = !!(
|
|
4862
|
-
if (!
|
|
4863
|
-
if (!
|
|
4862
|
+
const K = !!(I && I.length), J = !!(M.contentParts && M.contentParts.length > 0);
|
|
4863
|
+
if (!E && !W && P.length === 0 && !K && !J) return;
|
|
4864
|
+
if (!E) {
|
|
4864
4865
|
const Qe = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), ot = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")).join("").slice(0, 16);
|
|
4865
|
-
|
|
4866
|
+
E = `${Qe}${ot}`, S(E), p(E);
|
|
4866
4867
|
}
|
|
4867
4868
|
let se = null;
|
|
4868
|
-
|
|
4869
|
+
M.contentParts && M.contentParts.length > 0 && (se = M.contentParts);
|
|
4869
4870
|
const { contentParts: ge, filesInfo: Ce } = se ? { contentParts: se, filesInfo: [] } : await _g(P), Pe = [...ge];
|
|
4870
|
-
W && Pe.push({ type: "text", text:
|
|
4871
|
+
W && Pe.push({ type: "text", text: L });
|
|
4871
4872
|
const Ie = A == null ? void 0 : A.originalMessageId, Ke = !!(A != null && A.edit && Ie), Xe = !K && Pe.length > 0;
|
|
4872
4873
|
let He = null;
|
|
4873
4874
|
if (Xe) {
|
|
@@ -4877,7 +4878,7 @@ function zx({
|
|
|
4877
4878
|
role: "user",
|
|
4878
4879
|
content: Pe,
|
|
4879
4880
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4880
|
-
}, "user"), Ke ?
|
|
4881
|
+
}, "user"), Ke ? N(He, { editingMessageId: Ie }) : N(He);
|
|
4881
4882
|
}
|
|
4882
4883
|
const Ue = K ? I : He ? [He] : [], it = {
|
|
4883
4884
|
...O,
|
|
@@ -4890,7 +4891,7 @@ function zx({
|
|
|
4890
4891
|
mt = Qe.checkpointId, bt = Qe.checkpointNs ?? void 0;
|
|
4891
4892
|
}
|
|
4892
4893
|
const gt = {
|
|
4893
|
-
threadId:
|
|
4894
|
+
threadId: E,
|
|
4894
4895
|
payload: it,
|
|
4895
4896
|
checkpointId: mt,
|
|
4896
4897
|
checkpointNs: bt,
|
|
@@ -4899,25 +4900,25 @@ function zx({
|
|
|
4899
4900
|
};
|
|
4900
4901
|
q(gt, A == null ? void 0 : A.onEvent);
|
|
4901
4902
|
},
|
|
4902
|
-
[v, m, u, S,
|
|
4903
|
-
),
|
|
4903
|
+
[v, m, u, S, N, q, c, C]
|
|
4904
|
+
), ne = Ne(
|
|
4904
4905
|
() => ({
|
|
4905
4906
|
isStreaming: u,
|
|
4906
4907
|
error: f,
|
|
4907
4908
|
connectionState: f ? "error" : u ? h ? "connected" : "connecting" : "idle",
|
|
4908
|
-
messages:
|
|
4909
|
+
messages: $,
|
|
4909
4910
|
submit: B,
|
|
4910
4911
|
stop: c,
|
|
4911
4912
|
interrupt: y,
|
|
4912
4913
|
resume: () => Promise.resolve(),
|
|
4913
|
-
goto: (
|
|
4914
|
+
goto: (M, A) => Promise.resolve(),
|
|
4914
4915
|
clearError: () => {
|
|
4915
4916
|
}
|
|
4916
4917
|
// TODO: Implement error clearing
|
|
4917
4918
|
}),
|
|
4918
|
-
[u, f, B, c, y, h,
|
|
4919
|
+
[u, f, B, c, y, h, $]
|
|
4919
4920
|
);
|
|
4920
|
-
return /* @__PURE__ */ d.jsx(Cu.Provider, { value:
|
|
4921
|
+
return /* @__PURE__ */ d.jsx(Cu.Provider, { value: ne, children: e });
|
|
4921
4922
|
}
|
|
4922
4923
|
function ku() {
|
|
4923
4924
|
const e = kr(Cu);
|
|
@@ -5282,7 +5283,7 @@ function ey(e) {
|
|
|
5282
5283
|
}
|
|
5283
5284
|
};
|
|
5284
5285
|
}
|
|
5285
|
-
function
|
|
5286
|
+
function te(e) {
|
|
5286
5287
|
let t = e;
|
|
5287
5288
|
const n = _e();
|
|
5288
5289
|
return (r, o) => {
|
|
@@ -5301,7 +5302,7 @@ function ne(e) {
|
|
|
5301
5302
|
};
|
|
5302
5303
|
}
|
|
5303
5304
|
function pt(e, t) {
|
|
5304
|
-
return Rs(
|
|
5305
|
+
return Rs(te(t), (n) => he(e, n));
|
|
5305
5306
|
}
|
|
5306
5307
|
function _e() {
|
|
5307
5308
|
const e = [];
|
|
@@ -5385,12 +5386,12 @@ const ry = {
|
|
|
5385
5386
|
2: "warn"
|
|
5386
5387
|
}, oy = () => typeof globalThis > "u" ? window : globalThis, On = Oe(
|
|
5387
5388
|
() => {
|
|
5388
|
-
const e =
|
|
5389
|
+
const e = te(
|
|
5389
5390
|
3
|
|
5390
5391
|
/* ERROR */
|
|
5391
5392
|
);
|
|
5392
5393
|
return {
|
|
5393
|
-
log:
|
|
5394
|
+
log: te((t, n, r = 1) => {
|
|
5394
5395
|
var o;
|
|
5395
5396
|
const s = (o = oy().VIRTUOSO_LOG_LEVEL) != null ? o : tt(e);
|
|
5396
5397
|
r >= s && console[ry[r]](
|
|
@@ -5411,10 +5412,10 @@ function rr(e, t, n) {
|
|
|
5411
5412
|
return ra(e, t, n).callbackRef;
|
|
5412
5413
|
}
|
|
5413
5414
|
function ra(e, t, n) {
|
|
5414
|
-
const r =
|
|
5415
|
+
const r = ee.useRef(null);
|
|
5415
5416
|
let o = (i) => {
|
|
5416
5417
|
};
|
|
5417
|
-
const s =
|
|
5418
|
+
const s = ee.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i) => {
|
|
5418
5419
|
const a = () => {
|
|
5419
5420
|
const c = i[0].target;
|
|
5420
5421
|
c.offsetParent !== null && e(c);
|
|
@@ -5426,7 +5427,7 @@ function ra(e, t, n) {
|
|
|
5426
5427
|
}, { callbackRef: o, ref: r };
|
|
5427
5428
|
}
|
|
5428
5429
|
function sy(e, t, n, r, o, s, i, a, c) {
|
|
5429
|
-
const l =
|
|
5430
|
+
const l = ee.useCallback(
|
|
5430
5431
|
(u) => {
|
|
5431
5432
|
const f = iy(u.children, t, a ? "offsetWidth" : "offsetHeight", o);
|
|
5432
5433
|
let h = u.parentElement;
|
|
@@ -5469,7 +5470,7 @@ function Nl(e, t, n) {
|
|
|
5469
5470
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
5470
5471
|
}
|
|
5471
5472
|
function Pu(e, t, n) {
|
|
5472
|
-
const r =
|
|
5473
|
+
const r = ee.useRef(null), o = ee.useCallback(
|
|
5473
5474
|
(c) => {
|
|
5474
5475
|
if (!(c != null && c.offsetParent))
|
|
5475
5476
|
return;
|
|
@@ -5490,10 +5491,10 @@ function Pu(e, t, n) {
|
|
|
5490
5491
|
},
|
|
5491
5492
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5492
5493
|
[e, t]
|
|
5493
|
-
), { callbackRef: s, ref: i } = ra(o, !0, n), a =
|
|
5494
|
+
), { callbackRef: s, ref: i } = ra(o, !0, n), a = ee.useCallback(() => {
|
|
5494
5495
|
o(i.current);
|
|
5495
5496
|
}, [o, i]);
|
|
5496
|
-
return
|
|
5497
|
+
return ee.useEffect(() => {
|
|
5497
5498
|
var c;
|
|
5498
5499
|
if (t) {
|
|
5499
5500
|
t.addEventListener("scroll", a);
|
|
@@ -5513,7 +5514,7 @@ function Pu(e, t, n) {
|
|
|
5513
5514
|
}
|
|
5514
5515
|
const xt = Oe(
|
|
5515
5516
|
() => {
|
|
5516
|
-
const e = _e(), t = _e(), n =
|
|
5517
|
+
const e = _e(), t = _e(), n = te(0), r = _e(), o = te(0), s = _e(), i = _e(), a = te(0), c = te(0), l = te(0), u = te(0), f = _e(), h = _e(), p = te(!1), m = te(!1), g = te(!1);
|
|
5517
5518
|
return he(
|
|
5518
5519
|
Z(
|
|
5519
5520
|
e,
|
|
@@ -5693,7 +5694,7 @@ function Jr(e, t) {
|
|
|
5693
5694
|
return !!(e && e[0] === t[0] && e[1] === t[1]);
|
|
5694
5695
|
}
|
|
5695
5696
|
const oa = Oe(
|
|
5696
|
-
() => ({ recalcInProgress:
|
|
5697
|
+
() => ({ recalcInProgress: te(!1) }),
|
|
5697
5698
|
[],
|
|
5698
5699
|
{ singleton: !0 }
|
|
5699
5700
|
);
|
|
@@ -5861,7 +5862,7 @@ const yy = {
|
|
|
5861
5862
|
offsetWidth: "width"
|
|
5862
5863
|
}, hn = Oe(
|
|
5863
5864
|
([{ log: e }, { recalcInProgress: t }]) => {
|
|
5864
|
-
const n = _e(), r = _e(), o = pt(r, 0), s = _e(), i = _e(), a =
|
|
5865
|
+
const n = _e(), r = _e(), o = pt(r, 0), s = _e(), i = _e(), a = te(0), c = te([]), l = te(void 0), u = te(void 0), f = te((S, w) => Rn(S, yy[w])), h = te(void 0), p = te(0), m = cy(), g = pt(
|
|
5865
5866
|
Z(n, Ae(c, e, p), ln(py, m), We()),
|
|
5866
5867
|
m
|
|
5867
5868
|
), x = pt(
|
|
@@ -5882,11 +5883,11 @@ const yy = {
|
|
|
5882
5883
|
ye((S) => S.length > 0),
|
|
5883
5884
|
Ae(g, p),
|
|
5884
5885
|
ae(([S, w, T]) => {
|
|
5885
|
-
const
|
|
5886
|
+
const N = S.reduce((j, $, F) => jt(j, $, Zr($, w.offsetTree, T) || F), xr());
|
|
5886
5887
|
return {
|
|
5887
5888
|
...w,
|
|
5888
5889
|
groupIndices: S,
|
|
5889
|
-
groupOffsetTree:
|
|
5890
|
+
groupOffsetTree: N
|
|
5890
5891
|
};
|
|
5891
5892
|
})
|
|
5892
5893
|
),
|
|
@@ -5966,17 +5967,17 @@ const yy = {
|
|
|
5966
5967
|
s,
|
|
5967
5968
|
Ae(g),
|
|
5968
5969
|
ae(([S, w]) => {
|
|
5969
|
-
const T = w.groupIndices.length > 0,
|
|
5970
|
+
const T = w.groupIndices.length > 0, N = [], j = w.lastSize;
|
|
5970
5971
|
if (T) {
|
|
5971
|
-
const
|
|
5972
|
+
const $ = Xr(w.sizeTree, 0);
|
|
5972
5973
|
let F = 0, U = 0;
|
|
5973
5974
|
for (; F < S; ) {
|
|
5974
5975
|
const _ = w.groupIndices[U], q = w.groupIndices.length === U + 1 ? 1 / 0 : w.groupIndices[U + 1] - _ - 1;
|
|
5975
|
-
|
|
5976
|
+
N.push({
|
|
5976
5977
|
endIndex: _,
|
|
5977
|
-
size:
|
|
5978
|
+
size: $,
|
|
5978
5979
|
startIndex: _
|
|
5979
|
-
}),
|
|
5980
|
+
}), N.push({
|
|
5980
5981
|
endIndex: _ + 1 + q - 1,
|
|
5981
5982
|
size: j,
|
|
5982
5983
|
startIndex: _ + 1
|
|
@@ -5985,8 +5986,8 @@ const yy = {
|
|
|
5985
5986
|
const Y = Un(w.sizeTree);
|
|
5986
5987
|
return F !== S && Y.shift(), Y.reduce(
|
|
5987
5988
|
(_, { k: q, v: X }) => {
|
|
5988
|
-
let
|
|
5989
|
-
return _.prevSize !== 0 && (
|
|
5989
|
+
let Q = _.ranges;
|
|
5990
|
+
return _.prevSize !== 0 && (Q = [
|
|
5990
5991
|
..._.ranges,
|
|
5991
5992
|
{
|
|
5992
5993
|
endIndex: q + S - 1,
|
|
@@ -5996,21 +5997,21 @@ const yy = {
|
|
|
5996
5997
|
]), {
|
|
5997
5998
|
prevIndex: q + S,
|
|
5998
5999
|
prevSize: X,
|
|
5999
|
-
ranges:
|
|
6000
|
+
ranges: Q
|
|
6000
6001
|
};
|
|
6001
6002
|
},
|
|
6002
6003
|
{
|
|
6003
6004
|
prevIndex: S,
|
|
6004
6005
|
prevSize: 0,
|
|
6005
|
-
ranges:
|
|
6006
|
+
ranges: N
|
|
6006
6007
|
}
|
|
6007
6008
|
).ranges;
|
|
6008
6009
|
}
|
|
6009
6010
|
return Un(w.sizeTree).reduce(
|
|
6010
|
-
(
|
|
6011
|
+
($, { k: F, v: U }) => ({
|
|
6011
6012
|
prevIndex: F + S,
|
|
6012
6013
|
prevSize: U,
|
|
6013
|
-
ranges: [
|
|
6014
|
+
ranges: [...$.ranges, { endIndex: F + S - 1, size: $.prevSize, startIndex: $.prevIndex }]
|
|
6014
6015
|
}),
|
|
6015
6016
|
{
|
|
6016
6017
|
prevIndex: 0,
|
|
@@ -6027,8 +6028,8 @@ const yy = {
|
|
|
6027
6028
|
i,
|
|
6028
6029
|
Ae(g, p),
|
|
6029
6030
|
ae(([S, { offsetTree: w }, T]) => {
|
|
6030
|
-
const
|
|
6031
|
-
return Zr(
|
|
6031
|
+
const N = -S;
|
|
6032
|
+
return Zr(N, w, T);
|
|
6032
6033
|
})
|
|
6033
6034
|
)
|
|
6034
6035
|
);
|
|
@@ -6040,31 +6041,31 @@ const yy = {
|
|
|
6040
6041
|
if (w.groupIndices.length > 0) {
|
|
6041
6042
|
if (De(w.sizeTree))
|
|
6042
6043
|
return w;
|
|
6043
|
-
let
|
|
6044
|
+
let N = xr();
|
|
6044
6045
|
const j = tt(x);
|
|
6045
|
-
let
|
|
6046
|
-
for (;
|
|
6046
|
+
let $ = 0, F = 0, U = 0;
|
|
6047
|
+
for (; $ < -S; ) {
|
|
6047
6048
|
U = j[F];
|
|
6048
6049
|
const Y = j[F + 1] - U - 1;
|
|
6049
|
-
F++,
|
|
6050
|
+
F++, $ += Y + 1;
|
|
6050
6051
|
}
|
|
6051
|
-
if (
|
|
6052
|
+
if (N = Un(w.sizeTree).reduce((Y, { k: _, v: q }) => jt(Y, Math.max(0, _ + S), q), N), $ !== -S) {
|
|
6052
6053
|
const Y = Xr(w.sizeTree, U);
|
|
6053
|
-
|
|
6054
|
+
N = jt(N, 0, Y);
|
|
6054
6055
|
const _ = Xt(w.sizeTree, -S + 1)[1];
|
|
6055
|
-
|
|
6056
|
+
N = jt(N, 1, _);
|
|
6056
6057
|
}
|
|
6057
6058
|
return {
|
|
6058
6059
|
...w,
|
|
6059
|
-
sizeTree:
|
|
6060
|
-
...ji(w.offsetTree, 0,
|
|
6060
|
+
sizeTree: N,
|
|
6061
|
+
...ji(w.offsetTree, 0, N, T)
|
|
6061
6062
|
};
|
|
6062
6063
|
} else {
|
|
6063
|
-
const
|
|
6064
|
+
const N = Un(w.sizeTree).reduce((j, { k: $, v: F }) => jt(j, Math.max(0, $ + S), F), xr());
|
|
6064
6065
|
return {
|
|
6065
6066
|
...w,
|
|
6066
|
-
sizeTree:
|
|
6067
|
-
...ji(w.offsetTree, 0,
|
|
6067
|
+
sizeTree: N,
|
|
6068
|
+
...ji(w.offsetTree, 0, N, T)
|
|
6068
6069
|
};
|
|
6069
6070
|
}
|
|
6070
6071
|
})
|
|
@@ -6133,7 +6134,7 @@ const Uu = Oe(
|
|
|
6133
6134
|
Ve(hn, xt)
|
|
6134
6135
|
), Mn = Oe(
|
|
6135
6136
|
([{ log: e }]) => {
|
|
6136
|
-
const t =
|
|
6137
|
+
const t = te(!1), n = _t(
|
|
6137
6138
|
Z(
|
|
6138
6139
|
t,
|
|
6139
6140
|
ye((r) => r),
|
|
@@ -6166,7 +6167,7 @@ const fo = Oe(
|
|
|
6166
6167
|
},
|
|
6167
6168
|
{ log: h }
|
|
6168
6169
|
]) => {
|
|
6169
|
-
const p = _e(), m = _e(), g =
|
|
6170
|
+
const p = _e(), m = _e(), g = te(0);
|
|
6170
6171
|
let x = null, y = null, v = null;
|
|
6171
6172
|
function C() {
|
|
6172
6173
|
x && (x(), x = null), v && (v(), v = null), y && (clearTimeout(y), y = null), Re(c, !1);
|
|
@@ -6178,29 +6179,29 @@ const fo = Oe(
|
|
|
6178
6179
|
Ae(e, s, o),
|
|
6179
6180
|
ae(
|
|
6180
6181
|
([
|
|
6181
|
-
[R, S, w, T,
|
|
6182
|
+
[R, S, w, T, N, j, $, F],
|
|
6182
6183
|
U,
|
|
6183
6184
|
Y,
|
|
6184
6185
|
_
|
|
6185
6186
|
]) => {
|
|
6186
|
-
const q = Wu(R), { align: X, behavior:
|
|
6187
|
-
let
|
|
6188
|
-
X === "end" ? (
|
|
6189
|
-
const A = (
|
|
6190
|
-
C(),
|
|
6187
|
+
const q = Wu(R), { align: X, behavior: Q, offset: H } = q, B = T - 1, ne = Hu(q, S, B);
|
|
6188
|
+
let M = Zr(ne, S.offsetTree, U) + j;
|
|
6189
|
+
X === "end" ? (M += Y + Xt(S.sizeTree, ne)[1] - w + _, ne === B && (M += $)) : X === "center" ? M += (Y + Xt(S.sizeTree, ne)[1] - w + _) / 2 : M -= N, H && (M += H);
|
|
6190
|
+
const A = (E) => {
|
|
6191
|
+
C(), E ? (F("retrying to scroll to", { location: R }, kt.DEBUG), Re(p, R)) : (Re(m, !0), F("list did not change, scroll successful", {}, kt.DEBUG));
|
|
6191
6192
|
};
|
|
6192
|
-
if (C(),
|
|
6193
|
-
let
|
|
6194
|
-
v = Me(t, (
|
|
6195
|
-
|
|
6193
|
+
if (C(), Q === "smooth") {
|
|
6194
|
+
let E = !1;
|
|
6195
|
+
v = Me(t, (L) => {
|
|
6196
|
+
E = E || L;
|
|
6196
6197
|
}), x = Yt(u, () => {
|
|
6197
|
-
A(
|
|
6198
|
+
A(E);
|
|
6198
6199
|
});
|
|
6199
6200
|
} else
|
|
6200
6201
|
x = Yt(Z(t, wy(150)), A);
|
|
6201
6202
|
return y = setTimeout(() => {
|
|
6202
6203
|
C();
|
|
6203
|
-
}, 1200), Re(c, !0), F("scrolling from index to", { behavior:
|
|
6204
|
+
}, 1200), Re(c, !0), F("scrolling from index to", { behavior: Q, index: ne, top: M }, kt.DEBUG), { behavior: Q, top: M };
|
|
6204
6205
|
}
|
|
6205
6206
|
)
|
|
6206
6207
|
),
|
|
@@ -6235,7 +6236,7 @@ function aa(e, t) {
|
|
|
6235
6236
|
}
|
|
6236
6237
|
const ho = Oe(
|
|
6237
6238
|
([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
|
|
6238
|
-
const a =
|
|
6239
|
+
const a = te(!0), c = te(0), l = te(!0);
|
|
6239
6240
|
return he(
|
|
6240
6241
|
Z(
|
|
6241
6242
|
i,
|
|
@@ -6290,7 +6291,7 @@ const Qr = "up", Hr = "down", Sy = "none", Cy = {
|
|
|
6290
6291
|
viewportHeight: 0
|
|
6291
6292
|
}
|
|
6292
6293
|
}, Ty = 0, po = Oe(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
|
|
6293
|
-
const i =
|
|
6294
|
+
const i = te(!1), a = te(!0), c = _e(), l = _e(), u = te(4), f = te(Ty), h = pt(
|
|
6294
6295
|
Z(
|
|
6295
6296
|
Ii(Z(xe(o), Zn(1), sn(!0)), Z(xe(o), Zn(1), sn(!1), Al(100))),
|
|
6296
6297
|
We()
|
|
@@ -6311,8 +6312,8 @@ const Qr = "up", Hr = "down", Sy = "none", Cy = {
|
|
|
6311
6312
|
const m = _t(
|
|
6312
6313
|
Z(
|
|
6313
6314
|
rt(r, xe(s), xe(t), xe(e), xe(u)),
|
|
6314
|
-
ln((v, [{ scrollHeight: C, scrollTop: R }, S, w, T,
|
|
6315
|
-
const j = R + S - C > -
|
|
6315
|
+
ln((v, [{ scrollHeight: C, scrollTop: R }, S, w, T, N]) => {
|
|
6316
|
+
const j = R + S - C > -N, $ = {
|
|
6316
6317
|
scrollHeight: C,
|
|
6317
6318
|
scrollTop: R,
|
|
6318
6319
|
viewportHeight: S
|
|
@@ -6323,14 +6324,14 @@ const Qr = "up", Hr = "down", Sy = "none", Cy = {
|
|
|
6323
6324
|
atBottom: !0,
|
|
6324
6325
|
atBottomBecause: U,
|
|
6325
6326
|
scrollTopDelta: Y,
|
|
6326
|
-
state:
|
|
6327
|
+
state: $
|
|
6327
6328
|
};
|
|
6328
6329
|
}
|
|
6329
6330
|
let F;
|
|
6330
|
-
return
|
|
6331
|
+
return $.scrollHeight > v.state.scrollHeight ? F = "SIZE_INCREASED" : S < v.state.viewportHeight ? F = "VIEWPORT_HEIGHT_DECREASING" : R < v.state.scrollTop ? F = "SCROLLING_UPWARDS" : F = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
6331
6332
|
atBottom: !1,
|
|
6332
6333
|
notAtBottomBecause: F,
|
|
6333
|
-
state:
|
|
6334
|
+
state: $
|
|
6334
6335
|
};
|
|
6335
6336
|
}, Cy),
|
|
6336
6337
|
We((v, C) => v && v.atBottom === C.atBottom)
|
|
@@ -6376,7 +6377,7 @@ const Qr = "up", Hr = "down", Sy = "none", Cy = {
|
|
|
6376
6377
|
),
|
|
6377
6378
|
i
|
|
6378
6379
|
), he(Z(i, xn(50)), c);
|
|
6379
|
-
const x =
|
|
6380
|
+
const x = te(Hr);
|
|
6380
6381
|
he(
|
|
6381
6382
|
Z(
|
|
6382
6383
|
r,
|
|
@@ -6390,7 +6391,7 @@ const Qr = "up", Hr = "down", Sy = "none", Cy = {
|
|
|
6390
6391
|
),
|
|
6391
6392
|
x
|
|
6392
6393
|
), he(Z(r, xn(50), sn(Sy)), x);
|
|
6393
|
-
const y =
|
|
6394
|
+
const y = te(0);
|
|
6394
6395
|
return he(
|
|
6395
6396
|
Z(
|
|
6396
6397
|
h,
|
|
@@ -6431,7 +6432,7 @@ function Ml(e, t) {
|
|
|
6431
6432
|
}
|
|
6432
6433
|
const la = Oe(
|
|
6433
6434
|
([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
|
|
6434
|
-
const s = _e(), i =
|
|
6435
|
+
const s = _e(), i = te(0), a = te(0), c = te(0), l = pt(
|
|
6435
6436
|
Z(
|
|
6436
6437
|
rt(
|
|
6437
6438
|
xe(r),
|
|
@@ -6458,9 +6459,9 @@ const la = Oe(
|
|
|
6458
6459
|
]) => {
|
|
6459
6460
|
const R = u - v, S = x + y, w = Math.max(h - R, 0);
|
|
6460
6461
|
let T = Pl;
|
|
6461
|
-
const
|
|
6462
|
-
return p -= v, p += h + y, m += h + y, m -= v, p > u + S -
|
|
6463
|
-
Math.max(R - h - Ol(g, ns, T) -
|
|
6462
|
+
const N = Ml(C, ns), j = Ml(C, rs);
|
|
6463
|
+
return p -= v, p += h + y, m += h + y, m -= v, p > u + S - N && (T = Qr), m < u - w + f + j && (T = Hr), T !== Pl ? [
|
|
6464
|
+
Math.max(R - h - Ol(g, ns, T) - N, 0),
|
|
6464
6465
|
R - w - y + f + Ol(g, rs, T) + j
|
|
6465
6466
|
] : null;
|
|
6466
6467
|
}
|
|
@@ -6578,7 +6579,7 @@ const or = Oe(
|
|
|
6578
6579
|
{ didMount: p },
|
|
6579
6580
|
{ recalcInProgress: m }
|
|
6580
6581
|
]) => {
|
|
6581
|
-
const g =
|
|
6582
|
+
const g = te([]), x = te(0), y = _e();
|
|
6582
6583
|
he(s.topItemsIndexes, g);
|
|
6583
6584
|
const v = pt(
|
|
6584
6585
|
Z(
|
|
@@ -6595,54 +6596,54 @@ const or = Oe(
|
|
|
6595
6596
|
xe(n),
|
|
6596
6597
|
e
|
|
6597
6598
|
),
|
|
6598
|
-
ye(([w, T, ,
|
|
6599
|
-
const
|
|
6600
|
-
return w && !T &&
|
|
6599
|
+
ye(([w, T, , N, , , , , , , j]) => {
|
|
6600
|
+
const $ = j && j.length !== N;
|
|
6601
|
+
return w && !T && !$;
|
|
6601
6602
|
}),
|
|
6602
6603
|
ae(
|
|
6603
6604
|
([
|
|
6604
6605
|
,
|
|
6605
6606
|
,
|
|
6606
6607
|
[w, T],
|
|
6607
|
-
|
|
6608
|
+
N,
|
|
6608
6609
|
j,
|
|
6609
|
-
|
|
6610
|
+
$,
|
|
6610
6611
|
F,
|
|
6611
6612
|
U,
|
|
6612
6613
|
Y,
|
|
6613
6614
|
_,
|
|
6614
6615
|
q
|
|
6615
6616
|
]) => {
|
|
6616
|
-
const X = j, { offsetTree:
|
|
6617
|
-
if (
|
|
6618
|
-
return { ...Qs, totalCount:
|
|
6617
|
+
const X = j, { offsetTree: Q, sizeTree: H } = X, B = tt(x);
|
|
6618
|
+
if (N === 0)
|
|
6619
|
+
return { ...Qs, totalCount: N };
|
|
6619
6620
|
if (w === 0 && T === 0)
|
|
6620
|
-
return B === 0 ? { ...Qs, totalCount:
|
|
6621
|
+
return B === 0 ? { ...Qs, totalCount: N } : Ku(B, $, j, Y, _, q || []);
|
|
6621
6622
|
if (De(H))
|
|
6622
6623
|
return B > 0 ? null : Uo(
|
|
6623
|
-
ky(aa(
|
|
6624
|
+
ky(aa($, N), X, q),
|
|
6624
6625
|
[],
|
|
6625
|
-
|
|
6626
|
+
N,
|
|
6626
6627
|
_,
|
|
6627
6628
|
X,
|
|
6628
6629
|
Y
|
|
6629
6630
|
);
|
|
6630
|
-
const
|
|
6631
|
+
const ne = [];
|
|
6631
6632
|
if (U.length > 0) {
|
|
6632
6633
|
const P = U[0], W = U[U.length - 1];
|
|
6633
6634
|
let O = 0;
|
|
6634
6635
|
for (const I of Is(H, P, W)) {
|
|
6635
6636
|
const K = I.value, J = Math.max(I.start, P), se = Math.min(I.end, W);
|
|
6636
6637
|
for (let ge = J; ge <= se; ge++)
|
|
6637
|
-
|
|
6638
|
+
ne.push({ data: q == null ? void 0 : q[ge], index: ge, offset: O, size: K }), O += K;
|
|
6638
6639
|
}
|
|
6639
6640
|
}
|
|
6640
6641
|
if (!F)
|
|
6641
|
-
return Uo([],
|
|
6642
|
-
const
|
|
6642
|
+
return Uo([], ne, N, _, X, Y);
|
|
6643
|
+
const M = U.length > 0 ? U[U.length - 1] + 1 : 0, A = hy(Q, w, T, M);
|
|
6643
6644
|
if (A.length === 0)
|
|
6644
6645
|
return null;
|
|
6645
|
-
const
|
|
6646
|
+
const E = N - 1, L = Rs([], (P) => {
|
|
6646
6647
|
for (const W of A) {
|
|
6647
6648
|
const O = W.value;
|
|
6648
6649
|
let I = O.offset, K = W.start;
|
|
@@ -6652,13 +6653,13 @@ const or = Oe(
|
|
|
6652
6653
|
const ge = K - W.start;
|
|
6653
6654
|
I += ge * J + ge * _;
|
|
6654
6655
|
}
|
|
6655
|
-
K <
|
|
6656
|
-
const se = Math.min(W.end,
|
|
6656
|
+
K < M && (I += (M - K) * J, K = M);
|
|
6657
|
+
const se = Math.min(W.end, E);
|
|
6657
6658
|
for (let ge = K; ge <= se && !(I >= T); ge++)
|
|
6658
6659
|
P.push({ data: q == null ? void 0 : q[ge], index: ge, offset: I, size: J }), I += J + _;
|
|
6659
6660
|
}
|
|
6660
6661
|
});
|
|
6661
|
-
return Uo(
|
|
6662
|
+
return Uo(L, ne, N, _, X, Y);
|
|
6662
6663
|
}
|
|
6663
6664
|
),
|
|
6664
6665
|
//@ts-expect-error filter needs to be fixed
|
|
@@ -6716,13 +6717,13 @@ const or = Oe(
|
|
|
6716
6717
|
v,
|
|
6717
6718
|
ye(({ items: w }) => w.length > 0),
|
|
6718
6719
|
ae(({ items: w }) => {
|
|
6719
|
-
let T = 0,
|
|
6720
|
-
for (; w[T].type === "group" && T <
|
|
6720
|
+
let T = 0, N = w.length - 1;
|
|
6721
|
+
for (; w[T].type === "group" && T < N; )
|
|
6721
6722
|
T++;
|
|
6722
|
-
for (; w[
|
|
6723
|
-
|
|
6723
|
+
for (; w[N].type === "group" && N > T; )
|
|
6724
|
+
N--;
|
|
6724
6725
|
return {
|
|
6725
|
-
endIndex: w[
|
|
6726
|
+
endIndex: w[N].index,
|
|
6726
6727
|
startIndex: w[T].index
|
|
6727
6728
|
};
|
|
6728
6729
|
}),
|
|
@@ -6757,7 +6758,7 @@ const or = Oe(
|
|
|
6757
6758
|
{ singleton: !0 }
|
|
6758
6759
|
), Ry = Oe(
|
|
6759
6760
|
([{ viewportHeight: e }, { totalListHeight: t }]) => {
|
|
6760
|
-
const n =
|
|
6761
|
+
const n = te(!1), r = pt(
|
|
6761
6762
|
Z(
|
|
6762
6763
|
rt(n, e, t),
|
|
6763
6764
|
ye(([o]) => o),
|
|
@@ -6772,7 +6773,7 @@ const or = Oe(
|
|
|
6772
6773
|
Ve(xt, qu),
|
|
6773
6774
|
{ singleton: !0 }
|
|
6774
6775
|
), Gu = Oe(() => ({
|
|
6775
|
-
context:
|
|
6776
|
+
context: te(null)
|
|
6776
6777
|
})), Iy = ({
|
|
6777
6778
|
itemBottom: e,
|
|
6778
6779
|
itemTop: t,
|
|
@@ -6792,10 +6793,10 @@ const or = Oe(
|
|
|
6792
6793
|
Ae(t, c, n, s, o, r, a),
|
|
6793
6794
|
Ae(e),
|
|
6794
6795
|
ae(([[f, h, p, m, g, x, y, v], C]) => {
|
|
6795
|
-
const { align: R, behavior: S, calculateViewLocation: w = Iy, done: T, ...
|
|
6796
|
+
const { align: R, behavior: S, calculateViewLocation: w = Iy, done: T, ...N } = f, j = Hu(f, h, m - 1), $ = Zr(j, h.offsetTree, C) + g + x, F = $ + Xt(h.sizeTree, j)[1], U = v + x, Y = v + p - y, _ = w({
|
|
6796
6797
|
itemBottom: F,
|
|
6797
|
-
itemTop:
|
|
6798
|
-
locationParams: { align: R, behavior: S, ...
|
|
6798
|
+
itemTop: $,
|
|
6799
|
+
locationParams: { align: R, behavior: S, ...N },
|
|
6799
6800
|
viewportBottom: Y,
|
|
6800
6801
|
viewportTop: U
|
|
6801
6802
|
});
|
|
@@ -6835,7 +6836,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
6835
6836
|
{ context: h },
|
|
6836
6837
|
{ scrollIntoView: p }
|
|
6837
6838
|
]) => {
|
|
6838
|
-
const m =
|
|
6839
|
+
const m = te(!1), g = _e();
|
|
6839
6840
|
let x = null;
|
|
6840
6841
|
function y(S) {
|
|
6841
6842
|
Re(i, {
|
|
@@ -6848,9 +6849,9 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
6848
6849
|
Z(
|
|
6849
6850
|
rt(Z(xe(t), Zn(1)), c),
|
|
6850
6851
|
Ae(xe(m), s, a, f),
|
|
6851
|
-
ae(([[S, w], T,
|
|
6852
|
+
ae(([[S, w], T, N, j, $]) => {
|
|
6852
6853
|
let F = w && j, U = "auto";
|
|
6853
|
-
return F && (U = Ey(T,
|
|
6854
|
+
return F && (U = Ey(T, N || $), F = F && !!U), { followOutputBehavior: U, shouldFollow: F, totalCount: S };
|
|
6854
6855
|
}),
|
|
6855
6856
|
ye(({ shouldFollow: S }) => S)
|
|
6856
6857
|
),
|
|
@@ -6887,7 +6888,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
6887
6888
|
}), Me(rt(xe(m), o), ([S, w]) => {
|
|
6888
6889
|
S && !w.atBottom && w.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && y("auto");
|
|
6889
6890
|
});
|
|
6890
|
-
const C =
|
|
6891
|
+
const C = te(null), R = _e();
|
|
6891
6892
|
return he(
|
|
6892
6893
|
Ii(
|
|
6893
6894
|
Z(
|
|
@@ -6904,7 +6905,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
6904
6905
|
Z(
|
|
6905
6906
|
rt(Z(R, Zn(1)), c),
|
|
6906
6907
|
Ae(xe(C), a, f, h),
|
|
6907
|
-
ae(([[S, w], T,
|
|
6908
|
+
ae(([[S, w], T, N, j, $]) => w && N && (T == null ? void 0 : T({ context: $, totalCount: S, scrollingInProgress: j }))),
|
|
6908
6909
|
ye((S) => !!S),
|
|
6909
6910
|
xn(0)
|
|
6910
6911
|
),
|
|
@@ -6943,7 +6944,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
6943
6944
|
{ singleton: !0 }
|
|
6944
6945
|
), jy = Oe(
|
|
6945
6946
|
([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
|
|
6946
|
-
const r =
|
|
6947
|
+
const r = te(0);
|
|
6947
6948
|
return Me(
|
|
6948
6949
|
Z(
|
|
6949
6950
|
e,
|
|
@@ -6973,7 +6974,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
6973
6974
|
{ singleton: !0 }
|
|
6974
6975
|
), Xu = Oe(
|
|
6975
6976
|
([{ scrollVelocity: e }]) => {
|
|
6976
|
-
const t =
|
|
6977
|
+
const t = te(!1), n = _e(), r = te(!1);
|
|
6977
6978
|
return he(
|
|
6978
6979
|
Z(
|
|
6979
6980
|
e,
|
|
@@ -7001,7 +7002,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
7001
7002
|
Ve(po),
|
|
7002
7003
|
{ singleton: !0 }
|
|
7003
7004
|
), ca = Oe(([{ scrollContainerState: e, scrollTo: t }]) => {
|
|
7004
|
-
const n = _e(), r = _e(), o = _e(), s =
|
|
7005
|
+
const n = _e(), r = _e(), o = _e(), s = te(!1), i = te(void 0);
|
|
7005
7006
|
return he(
|
|
7006
7007
|
Z(
|
|
7007
7008
|
rt(n, r),
|
|
@@ -7040,7 +7041,7 @@ const Ey = (e, t) => typeof e == "function" ? Ll(e(t)) : t && Ll(e), Ay = Oe(
|
|
|
7040
7041
|
{ didMount: s },
|
|
7041
7042
|
{ useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: c }
|
|
7042
7043
|
]) => {
|
|
7043
|
-
const l = _e(), u =
|
|
7044
|
+
const l = _e(), u = te(void 0), f = te(null), h = te(null);
|
|
7044
7045
|
return he(a, f), he(c, h), Me(
|
|
7045
7046
|
Z(
|
|
7046
7047
|
l,
|
|
@@ -7070,7 +7071,7 @@ function Py(e) {
|
|
|
7070
7071
|
return { align: "start", index: 0, offset: e.scrollTop };
|
|
7071
7072
|
}
|
|
7072
7073
|
const Oy = Oe(([{ topItemsIndexes: e }]) => {
|
|
7073
|
-
const t =
|
|
7074
|
+
const t = te(0);
|
|
7074
7075
|
return he(
|
|
7075
7076
|
Z(
|
|
7076
7077
|
t,
|
|
@@ -7098,10 +7099,10 @@ const My = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7098
7099
|
c,
|
|
7099
7100
|
Ae(i),
|
|
7100
7101
|
ln(
|
|
7101
|
-
([, y, v, C], [{ bottom: R, items: S, offsetBottom: w, totalCount: T },
|
|
7102
|
+
([, y, v, C], [{ bottom: R, items: S, offsetBottom: w, totalCount: T }, N]) => {
|
|
7102
7103
|
const j = R + w;
|
|
7103
|
-
let
|
|
7104
|
-
return v === T && y.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && y[0].originalIndex === 0 || (
|
|
7104
|
+
let $ = 0;
|
|
7105
|
+
return v === T && y.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && y[0].originalIndex === 0 || ($ = j - C, $ !== 0 && ($ += N))), [$, S, T, j];
|
|
7105
7106
|
},
|
|
7106
7107
|
[0, [], 0, 0]
|
|
7107
7108
|
),
|
|
@@ -7142,12 +7143,12 @@ const My = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7142
7143
|
return w(y);
|
|
7143
7144
|
{
|
|
7144
7145
|
let T = 0;
|
|
7145
|
-
const
|
|
7146
|
-
let j = 0,
|
|
7146
|
+
const N = Xr(R, 0);
|
|
7147
|
+
let j = 0, $ = 0;
|
|
7147
7148
|
for (; j < y; ) {
|
|
7148
|
-
j++, T +=
|
|
7149
|
-
let F = v.length ===
|
|
7150
|
-
j + F > y && (T -=
|
|
7149
|
+
j++, T += N;
|
|
7150
|
+
let F = v.length === $ + 1 ? 1 / 0 : v[$ + 1] - v[$] - 1;
|
|
7151
|
+
j + F > y && (T -= N, F = y - j + 1), j += F, T += w(F), $++;
|
|
7151
7152
|
}
|
|
7152
7153
|
return T;
|
|
7153
7154
|
}
|
|
@@ -7226,12 +7227,12 @@ const My = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7226
7227
|
{ scrollToIndex: S },
|
|
7227
7228
|
w,
|
|
7228
7229
|
{ topItemCount: T },
|
|
7229
|
-
{ groupCounts:
|
|
7230
|
+
{ groupCounts: N },
|
|
7230
7231
|
j
|
|
7231
7232
|
]) => (he(R.rangeChanged, j.scrollSeekRangeChanged), he(
|
|
7232
7233
|
Z(
|
|
7233
7234
|
j.windowViewportRect,
|
|
7234
|
-
ae((
|
|
7235
|
+
ae(($) => $.visibleHeight)
|
|
7235
7236
|
),
|
|
7236
7237
|
g.viewportHeight
|
|
7237
7238
|
), {
|
|
@@ -7240,7 +7241,7 @@ const My = Ju(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
7240
7241
|
firstItemIndex: n,
|
|
7241
7242
|
fixedItemHeight: r,
|
|
7242
7243
|
gap: o,
|
|
7243
|
-
groupCounts:
|
|
7244
|
+
groupCounts: N,
|
|
7244
7245
|
initialItemFinalLocationReached: h,
|
|
7245
7246
|
initialTopMostItemIndex: p,
|
|
7246
7247
|
scrolledToInitialItem: m,
|
|
@@ -7289,9 +7290,9 @@ function $y(e, t) {
|
|
|
7289
7290
|
Object.hasOwn(r, i) || (n[i] = t[i]);
|
|
7290
7291
|
return n;
|
|
7291
7292
|
}
|
|
7292
|
-
const So = typeof document < "u" ?
|
|
7293
|
+
const So = typeof document < "u" ? ee.useLayoutEffect : ee.useEffect;
|
|
7293
7294
|
function Qu(e, t, n) {
|
|
7294
|
-
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a =
|
|
7295
|
+
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = ee.createContext({});
|
|
7295
7296
|
function c(x, y) {
|
|
7296
7297
|
x.propsReady && Re(x.propsReady, !1);
|
|
7297
7298
|
for (const v of r) {
|
|
@@ -7314,10 +7315,10 @@ function Qu(e, t, n) {
|
|
|
7314
7315
|
function u(x) {
|
|
7315
7316
|
return i.reduce((y, v) => (y[v] = ey(x[t.events[v]]), y), {});
|
|
7316
7317
|
}
|
|
7317
|
-
const f =
|
|
7318
|
-
const { children: v, ...C } = x, [R] =
|
|
7318
|
+
const f = ee.forwardRef((x, y) => {
|
|
7319
|
+
const { children: v, ...C } = x, [R] = ee.useState(() => Rs(ny(e), (T) => {
|
|
7319
7320
|
c(T, C);
|
|
7320
|
-
})), [S] =
|
|
7321
|
+
})), [S] = ee.useState(El(u, R));
|
|
7321
7322
|
So(() => {
|
|
7322
7323
|
for (const T of i)
|
|
7323
7324
|
T in C && Me(S[T], C[T]);
|
|
@@ -7326,47 +7327,47 @@ function Qu(e, t, n) {
|
|
|
7326
7327
|
};
|
|
7327
7328
|
}, [C, S, R]), So(() => {
|
|
7328
7329
|
c(R, C);
|
|
7329
|
-
}),
|
|
7330
|
+
}), ee.useImperativeHandle(y, Il(l(R)));
|
|
7330
7331
|
const w = n;
|
|
7331
7332
|
return /* @__PURE__ */ d.jsx(a.Provider, { value: R, children: n ? /* @__PURE__ */ d.jsx(w, { ...$y([...r, ...o, ...i], C), children: v }) : v });
|
|
7332
7333
|
}), h = (x) => {
|
|
7333
|
-
const y =
|
|
7334
|
-
return
|
|
7334
|
+
const y = ee.useContext(a);
|
|
7335
|
+
return ee.useCallback(
|
|
7335
7336
|
(v) => {
|
|
7336
7337
|
Re(y[x], v);
|
|
7337
7338
|
},
|
|
7338
7339
|
[y, x]
|
|
7339
7340
|
);
|
|
7340
7341
|
}, p = (x) => {
|
|
7341
|
-
const y =
|
|
7342
|
+
const y = ee.useContext(a)[x], v = ee.useCallback(
|
|
7342
7343
|
(C) => Me(y, C),
|
|
7343
7344
|
[y]
|
|
7344
7345
|
);
|
|
7345
|
-
return
|
|
7346
|
+
return ee.useSyncExternalStore(
|
|
7346
7347
|
v,
|
|
7347
7348
|
() => tt(y),
|
|
7348
7349
|
() => tt(y)
|
|
7349
7350
|
);
|
|
7350
7351
|
}, m = (x) => {
|
|
7351
|
-
const y =
|
|
7352
|
+
const y = ee.useContext(a)[x], [v, C] = ee.useState(El(tt, y));
|
|
7352
7353
|
return So(
|
|
7353
7354
|
() => Me(y, (R) => {
|
|
7354
7355
|
R !== v && C(Il(R));
|
|
7355
7356
|
}),
|
|
7356
7357
|
[y, v]
|
|
7357
7358
|
), v;
|
|
7358
|
-
}, g =
|
|
7359
|
+
}, g = ee.version.startsWith("18") ? p : m;
|
|
7359
7360
|
return {
|
|
7360
7361
|
Component: f,
|
|
7361
7362
|
useEmitter: (x, y) => {
|
|
7362
|
-
const v =
|
|
7363
|
+
const v = ee.useContext(a)[x];
|
|
7363
7364
|
So(() => Me(v, y), [y, v]);
|
|
7364
7365
|
},
|
|
7365
7366
|
useEmitterValue: g,
|
|
7366
7367
|
usePublisher: h
|
|
7367
7368
|
};
|
|
7368
7369
|
}
|
|
7369
|
-
const ed =
|
|
7370
|
+
const ed = ee.createContext(void 0), td = ee.createContext(void 0), nd = typeof document < "u" ? ee.useLayoutEffect : ee.useEffect;
|
|
7370
7371
|
function ei(e) {
|
|
7371
7372
|
return "self" in e;
|
|
7372
7373
|
}
|
|
@@ -7374,7 +7375,7 @@ function Fy(e) {
|
|
|
7374
7375
|
return "body" in e;
|
|
7375
7376
|
}
|
|
7376
7377
|
function rd(e, t, n, r = Nr, o, s) {
|
|
7377
|
-
const i =
|
|
7378
|
+
const i = ee.useRef(null), a = ee.useRef(null), c = ee.useRef(null), l = ee.useCallback(
|
|
7378
7379
|
(h) => {
|
|
7379
7380
|
let p, m, g;
|
|
7380
7381
|
const x = h.target;
|
|
@@ -7394,7 +7395,7 @@ function rd(e, t, n, r = Nr, o, s) {
|
|
|
7394
7395
|
},
|
|
7395
7396
|
[e, t, s]
|
|
7396
7397
|
);
|
|
7397
|
-
|
|
7398
|
+
ee.useEffect(() => {
|
|
7398
7399
|
const h = o || i.current;
|
|
7399
7400
|
return r(o || i.current), l({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", l, { passive: !0 }), () => {
|
|
7400
7401
|
r(null), h.removeEventListener("scroll", l);
|
|
@@ -7434,7 +7435,7 @@ function da(e) {
|
|
|
7434
7435
|
return e;
|
|
7435
7436
|
}
|
|
7436
7437
|
const zy = /* @__PURE__ */ Oe(() => {
|
|
7437
|
-
const e =
|
|
7438
|
+
const e = te((a) => `Item ${a}`), t = te((a) => `Group ${a}`), n = te({}), r = te(da), o = te("div"), s = te(Nr), i = (a, c = null) => pt(
|
|
7438
7439
|
Z(
|
|
7439
7440
|
n,
|
|
7440
7441
|
ae((l) => l[a]),
|
|
@@ -7462,7 +7463,7 @@ const zy = /* @__PURE__ */ Oe(() => {
|
|
|
7462
7463
|
}), By = /* @__PURE__ */ Oe(
|
|
7463
7464
|
([e, t]) => ({ ...e, ...t }),
|
|
7464
7465
|
Ve(Zu, zy)
|
|
7465
|
-
), Hy = ({ height: e }) => /* @__PURE__ */ d.jsx("div", { style: { height: e } }), Uy = { overflowAnchor: "none", position: ua(), zIndex: 1 }, od = { overflowAnchor: "none" }, Wy = { ...od, display: "inline-block", height: "100%" }, Fl = /* @__PURE__ */
|
|
7466
|
+
), Hy = ({ height: e }) => /* @__PURE__ */ d.jsx("div", { style: { height: e } }), Uy = { overflowAnchor: "none", position: ua(), zIndex: 1 }, od = { overflowAnchor: "none" }, Wy = { ...od, display: "inline-block", height: "100%" }, Fl = /* @__PURE__ */ ee.memo(function({ showTopList: e = !1 }) {
|
|
7466
7467
|
const t = Se("listState"), n = Ft("sizeRanges"), r = Se("useWindowScroll"), o = Se("customScrollParent"), s = Ft("windowScrollContainerState"), i = Ft("scrollContainerState"), a = o || r ? s : i, c = Se("itemContent"), l = Se("context"), u = Se("groupContent"), f = Se("trackItemSizes"), h = Se("itemSize"), p = Se("log"), m = Ft("gap"), g = Se("horizontalDirection"), { callbackRef: x } = sy(
|
|
7467
7468
|
n,
|
|
7468
7469
|
h,
|
|
@@ -7473,11 +7474,11 @@ const zy = /* @__PURE__ */ Oe(() => {
|
|
|
7473
7474
|
o,
|
|
7474
7475
|
g,
|
|
7475
7476
|
Se("skipAnimationFrameInResizeObserver")
|
|
7476
|
-
), [y, v] =
|
|
7477
|
+
), [y, v] = ee.useState(0);
|
|
7477
7478
|
fa("deviation", (_) => {
|
|
7478
7479
|
y !== _ && v(_);
|
|
7479
7480
|
});
|
|
7480
|
-
const C = Se("EmptyPlaceholder"), R = Se("ScrollSeekPlaceholder") || Hy, S = Se("ListComponent"), w = Se("ItemComponent"), T = Se("GroupComponent"),
|
|
7481
|
+
const C = Se("EmptyPlaceholder"), R = Se("ScrollSeekPlaceholder") || Hy, S = Se("ListComponent"), w = Se("ItemComponent"), T = Se("GroupComponent"), N = Se("computeItemKey"), j = Se("isSeeking"), $ = Se("groupIndices").length > 0, F = Se("alignToBottom"), U = Se("initialItemFinalLocationReached"), Y = e ? {} : {
|
|
7481
7482
|
boxSizing: "border-box",
|
|
7482
7483
|
...g ? {
|
|
7483
7484
|
display: "inline-block",
|
|
@@ -7501,7 +7502,7 @@ const zy = /* @__PURE__ */ Oe(() => {
|
|
|
7501
7502
|
ref: x,
|
|
7502
7503
|
style: Y,
|
|
7503
7504
|
children: (e ? t.topItems : t.items).map((_) => {
|
|
7504
|
-
const q = _.originalIndex, X =
|
|
7505
|
+
const q = _.originalIndex, X = N(q + t.firstItemIndex, _.data, l);
|
|
7505
7506
|
return j ? /* @__PURE__ */ Oo(
|
|
7506
7507
|
R,
|
|
7507
7508
|
{
|
|
@@ -7535,7 +7536,7 @@ const zy = /* @__PURE__ */ Oe(() => {
|
|
|
7535
7536
|
key: X,
|
|
7536
7537
|
style: g ? Wy : od
|
|
7537
7538
|
},
|
|
7538
|
-
|
|
7539
|
+
$ ? c(_.index, _.groupIndex, _.data, l) : c(_.index, _.data, l)
|
|
7539
7540
|
);
|
|
7540
7541
|
})
|
|
7541
7542
|
}
|
|
@@ -7569,9 +7570,9 @@ function ft(e, t) {
|
|
|
7569
7570
|
function Gy(e, t) {
|
|
7570
7571
|
return { item: typeof e == "string" ? void 0 : t };
|
|
7571
7572
|
}
|
|
7572
|
-
const Yy = /* @__PURE__ */
|
|
7573
|
+
const Yy = /* @__PURE__ */ ee.memo(function() {
|
|
7573
7574
|
const e = Se("HeaderComponent"), t = Ft("headerHeight"), n = Se("HeaderFooterTag"), r = rr(
|
|
7574
|
-
|
|
7575
|
+
ee.useMemo(
|
|
7575
7576
|
() => (s) => {
|
|
7576
7577
|
t(Rn(s, "height"));
|
|
7577
7578
|
},
|
|
@@ -7581,9 +7582,9 @@ const Yy = /* @__PURE__ */ te.memo(function() {
|
|
|
7581
7582
|
Se("skipAnimationFrameInResizeObserver")
|
|
7582
7583
|
), o = Se("context");
|
|
7583
7584
|
return e ? /* @__PURE__ */ d.jsx(n, { ref: r, children: /* @__PURE__ */ d.jsx(e, { ...ft(e, o) }) }) : null;
|
|
7584
|
-
}), Xy = /* @__PURE__ */
|
|
7585
|
+
}), Xy = /* @__PURE__ */ ee.memo(function() {
|
|
7585
7586
|
const e = Se("FooterComponent"), t = Ft("footerHeight"), n = Se("HeaderFooterTag"), r = rr(
|
|
7586
|
-
|
|
7587
|
+
ee.useMemo(
|
|
7587
7588
|
() => (s) => {
|
|
7588
7589
|
t(Rn(s, "height"));
|
|
7589
7590
|
},
|
|
@@ -7595,7 +7596,7 @@ const Yy = /* @__PURE__ */ te.memo(function() {
|
|
|
7595
7596
|
return e ? /* @__PURE__ */ d.jsx(n, { ref: r, children: /* @__PURE__ */ d.jsx(e, { ...ft(e, o) }) }) : null;
|
|
7596
7597
|
});
|
|
7597
7598
|
function sd({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
7598
|
-
return
|
|
7599
|
+
return ee.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
7599
7600
|
const a = n("scrollContainerState"), c = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), u = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback: h, scrollerRef: p, scrollToCallback: m } = rd(
|
|
7600
7601
|
a,
|
|
7601
7602
|
l,
|
|
@@ -7620,8 +7621,8 @@ function sd({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
7620
7621
|
});
|
|
7621
7622
|
}
|
|
7622
7623
|
function id({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
7623
|
-
return
|
|
7624
|
-
const a = n("windowScrollContainerState"), c = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), u = t("totalListHeight"), f = t("deviation"), h = t("customScrollParent"), p =
|
|
7624
|
+
return ee.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
7625
|
+
const a = n("windowScrollContainerState"), c = t("ScrollerComponent"), l = n("smoothScrollTargetReached"), u = t("totalListHeight"), f = t("deviation"), h = t("customScrollParent"), p = ee.useRef(null), m = t("scrollerRef"), { scrollByCallback: g, scrollerRef: x, scrollToCallback: y } = rd(
|
|
7625
7626
|
a,
|
|
7626
7627
|
l,
|
|
7627
7628
|
c,
|
|
@@ -7647,26 +7648,26 @@ function id({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
7647
7648
|
});
|
|
7648
7649
|
}
|
|
7649
7650
|
const Jy = ({ children: e }) => {
|
|
7650
|
-
const t =
|
|
7651
|
+
const t = ee.useContext(ed), n = Ft("viewportHeight"), r = Ft("fixedItemHeight"), o = Se("alignToBottom"), s = Se("horizontalDirection"), i = ee.useMemo(
|
|
7651
7652
|
() => ju(n, (c) => Rn(c, s ? "width" : "height")),
|
|
7652
7653
|
[n, s]
|
|
7653
7654
|
), a = rr(i, !0, Se("skipAnimationFrameInResizeObserver"));
|
|
7654
|
-
return
|
|
7655
|
+
return ee.useEffect(() => {
|
|
7655
7656
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
7656
7657
|
}, [t, n, r]), /* @__PURE__ */ d.jsx("div", { "data-viewport-type": "element", ref: a, style: As(o), children: e });
|
|
7657
7658
|
}, Zy = ({ children: e }) => {
|
|
7658
|
-
const t =
|
|
7659
|
+
const t = ee.useContext(ed), n = Ft("windowViewportRect"), r = Ft("fixedItemHeight"), o = Se("customScrollParent"), s = Pu(
|
|
7659
7660
|
n,
|
|
7660
7661
|
o,
|
|
7661
7662
|
Se("skipAnimationFrameInResizeObserver")
|
|
7662
7663
|
), i = Se("alignToBottom");
|
|
7663
|
-
return
|
|
7664
|
+
return ee.useEffect(() => {
|
|
7664
7665
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
7665
7666
|
}, [t, n, r]), /* @__PURE__ */ d.jsx("div", { "data-viewport-type": "window", ref: s, style: As(i), children: e });
|
|
7666
7667
|
}, Qy = ({ children: e }) => {
|
|
7667
7668
|
const t = Se("TopItemListComponent") || "div", n = Se("headerHeight"), r = { ...qy, marginTop: `${n}px` }, o = Se("context");
|
|
7668
7669
|
return /* @__PURE__ */ d.jsx(t, { style: r, ...ft(t, o), children: e });
|
|
7669
|
-
}, eb = /* @__PURE__ */
|
|
7670
|
+
}, eb = /* @__PURE__ */ ee.memo(function(e) {
|
|
7670
7671
|
const t = Se("useWindowScroll"), n = Se("topItemsIndexes").length > 0, r = Se("customScrollParent"), o = Se("context");
|
|
7671
7672
|
return /* @__PURE__ */ d.jsxs(r || t ? rb : nb, { ...e, context: o, children: [
|
|
7672
7673
|
n && /* @__PURE__ */ d.jsx(Qy, { children: /* @__PURE__ */ d.jsx(Fl, { showTopList: !0 }) }),
|
|
@@ -7741,13 +7742,13 @@ const Jy = ({ children: e }) => {
|
|
|
7741
7742
|
},
|
|
7742
7743
|
eb
|
|
7743
7744
|
), nb = /* @__PURE__ */ sd({ useEmitter: fa, useEmitterValue: Se, usePublisher: Ft }), rb = /* @__PURE__ */ id({ useEmitter: fa, useEmitterValue: Se, usePublisher: Ft }), ob = tb, sb = /* @__PURE__ */ Oe(() => {
|
|
7744
|
-
const e =
|
|
7745
|
+
const e = te((l) => /* @__PURE__ */ d.jsxs("td", { children: [
|
|
7745
7746
|
"Item $",
|
|
7746
7747
|
l
|
|
7747
|
-
] })), t =
|
|
7748
|
+
] })), t = te(null), n = te((l) => /* @__PURE__ */ d.jsxs("td", { colSpan: 1e3, children: [
|
|
7748
7749
|
"Group ",
|
|
7749
7750
|
l
|
|
7750
|
-
] })), r =
|
|
7751
|
+
] })), r = te(null), o = te(null), s = te({}), i = te(da), a = te(Nr), c = (l, u = null) => pt(
|
|
7751
7752
|
Z(
|
|
7752
7753
|
s,
|
|
7753
7754
|
ae((f) => f[l]),
|
|
@@ -7820,7 +7821,7 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7820
7821
|
{ customScrollParent: x, useWindowScroll: y, windowScrollContainerState: v, windowScrollTo: C, windowViewportRect: R },
|
|
7821
7822
|
S
|
|
7822
7823
|
]) => {
|
|
7823
|
-
const w =
|
|
7824
|
+
const w = te(0), T = te(0), N = te(zl), j = te({ height: 0, width: 0 }), $ = te({ height: 0, width: 0 }), F = _e(), U = _e(), Y = te(0), _ = te(null), q = te({ column: 0, row: 0 }), X = _e(), Q = _e(), H = te(!1), B = te(0), ne = te(!0), M = te(!1), A = te(!1);
|
|
7824
7825
|
Me(
|
|
7825
7826
|
Z(
|
|
7826
7827
|
m,
|
|
@@ -7828,23 +7829,23 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7828
7829
|
ye(([I, K]) => !!K)
|
|
7829
7830
|
),
|
|
7830
7831
|
() => {
|
|
7831
|
-
Re(
|
|
7832
|
+
Re(ne, !1);
|
|
7832
7833
|
}
|
|
7833
7834
|
), Me(
|
|
7834
7835
|
Z(
|
|
7835
|
-
rt(m,
|
|
7836
|
+
rt(m, ne, $, j, B, M),
|
|
7836
7837
|
ye(([I, K, J, se, , ge]) => I && !K && J.height !== 0 && se.height !== 0 && !ge)
|
|
7837
7838
|
),
|
|
7838
7839
|
([, , , , I]) => {
|
|
7839
|
-
Re(
|
|
7840
|
+
Re(M, !0), ia(1, () => {
|
|
7840
7841
|
Re(F, I);
|
|
7841
7842
|
}), Yt(Z(l), () => {
|
|
7842
|
-
Re(t, [0, 0]), Re(
|
|
7843
|
+
Re(t, [0, 0]), Re(ne, !0);
|
|
7843
7844
|
});
|
|
7844
7845
|
}
|
|
7845
7846
|
), he(
|
|
7846
7847
|
Z(
|
|
7847
|
-
|
|
7848
|
+
Q,
|
|
7848
7849
|
ye((I) => I != null && I.scrollTop > 0),
|
|
7849
7850
|
sn(0)
|
|
7850
7851
|
),
|
|
@@ -7852,11 +7853,11 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7852
7853
|
), Me(
|
|
7853
7854
|
Z(
|
|
7854
7855
|
m,
|
|
7855
|
-
Ae(
|
|
7856
|
+
Ae(Q),
|
|
7856
7857
|
ye(([, I]) => I != null)
|
|
7857
7858
|
),
|
|
7858
7859
|
([, I]) => {
|
|
7859
|
-
I && (Re(j, I.viewport), Re(
|
|
7860
|
+
I && (Re(j, I.viewport), Re($, I.item), Re(q, I.gap), I.scrollTop > 0 && (Re(H, !0), Yt(Z(l, Zn(1)), (K) => {
|
|
7860
7861
|
Re(H, !1);
|
|
7861
7862
|
}), Re(c, { top: I.scrollTop })));
|
|
7862
7863
|
}
|
|
@@ -7870,7 +7871,7 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7870
7871
|
Z(
|
|
7871
7872
|
rt(
|
|
7872
7873
|
xe(j, Co),
|
|
7873
|
-
xe(
|
|
7874
|
+
xe($, Co),
|
|
7874
7875
|
xe(q, (I, K) => I && I.column === K.column && I.row === K.row),
|
|
7875
7876
|
xe(l)
|
|
7876
7877
|
),
|
|
@@ -7888,12 +7889,12 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7888
7889
|
xe(w),
|
|
7889
7890
|
r,
|
|
7890
7891
|
xe(q, lb),
|
|
7891
|
-
xe(
|
|
7892
|
+
xe($, Co),
|
|
7892
7893
|
xe(j, Co),
|
|
7893
7894
|
xe(_),
|
|
7894
7895
|
xe(T),
|
|
7895
7896
|
xe(H),
|
|
7896
|
-
xe(
|
|
7897
|
+
xe(ne),
|
|
7897
7898
|
xe(B)
|
|
7898
7899
|
),
|
|
7899
7900
|
ye(([, , , , , , , I]) => !I),
|
|
@@ -7925,7 +7926,7 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7925
7926
|
}
|
|
7926
7927
|
)
|
|
7927
7928
|
),
|
|
7928
|
-
|
|
7929
|
+
N
|
|
7929
7930
|
), he(
|
|
7930
7931
|
Z(
|
|
7931
7932
|
_,
|
|
@@ -7935,7 +7936,7 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7935
7936
|
w
|
|
7936
7937
|
), he(
|
|
7937
7938
|
Z(
|
|
7938
|
-
rt(j,
|
|
7939
|
+
rt(j, $, N, q),
|
|
7939
7940
|
ye(([I, K, { items: J }]) => J.length > 0 && K.height !== 0 && I.height !== 0),
|
|
7940
7941
|
ae(([I, K, { items: J }, se]) => {
|
|
7941
7942
|
const { bottom: ge, top: Ce } = Wl(I, se, K, J);
|
|
@@ -7945,20 +7946,20 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7945
7946
|
),
|
|
7946
7947
|
t
|
|
7947
7948
|
);
|
|
7948
|
-
const
|
|
7949
|
+
const E = te(!1);
|
|
7949
7950
|
he(
|
|
7950
7951
|
Z(
|
|
7951
7952
|
l,
|
|
7952
|
-
Ae(
|
|
7953
|
+
Ae(E),
|
|
7953
7954
|
ae(([I, K]) => K || I !== 0)
|
|
7954
7955
|
),
|
|
7955
|
-
|
|
7956
|
+
E
|
|
7956
7957
|
);
|
|
7957
|
-
const
|
|
7958
|
+
const L = _t(
|
|
7958
7959
|
Z(
|
|
7959
|
-
rt(
|
|
7960
|
+
rt(N, w),
|
|
7960
7961
|
ye(([{ items: I }]) => I.length > 0),
|
|
7961
|
-
Ae(
|
|
7962
|
+
Ae(E),
|
|
7962
7963
|
ye(([[I, K], J]) => {
|
|
7963
7964
|
const se = I.items[I.items.length - 1].index === K - 1;
|
|
7964
7965
|
return (J || I.bottom > 0 && I.itemHeight > 0 && I.offsetBottom === 0 && I.items.length === K) && se;
|
|
@@ -7968,14 +7969,14 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7968
7969
|
)
|
|
7969
7970
|
), P = _t(
|
|
7970
7971
|
Z(
|
|
7971
|
-
xe(
|
|
7972
|
+
xe(N),
|
|
7972
7973
|
ye(({ items: I }) => I.length > 0 && I[0].index === 0),
|
|
7973
7974
|
sn(0),
|
|
7974
7975
|
We()
|
|
7975
7976
|
)
|
|
7976
7977
|
), W = _t(
|
|
7977
7978
|
Z(
|
|
7978
|
-
xe(
|
|
7979
|
+
xe(N),
|
|
7979
7980
|
Ae(H),
|
|
7980
7981
|
ye(([{ items: I }, K]) => I.length > 0 && !K),
|
|
7981
7982
|
ae(([{ items: I }]) => ({
|
|
@@ -7989,7 +7990,7 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
7989
7990
|
he(W, p.scrollSeekRangeChanged), he(
|
|
7990
7991
|
Z(
|
|
7991
7992
|
F,
|
|
7992
|
-
Ae(j,
|
|
7993
|
+
Ae(j, $, w, q),
|
|
7993
7994
|
ae(([I, K, J, se, ge]) => {
|
|
7994
7995
|
const Ce = Wu(I), { align: Pe, behavior: Ie, offset: Ke } = Ce;
|
|
7995
7996
|
let Xe = Ce.index;
|
|
@@ -8002,7 +8003,7 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
8002
8003
|
);
|
|
8003
8004
|
const O = pt(
|
|
8004
8005
|
Z(
|
|
8005
|
-
|
|
8006
|
+
N,
|
|
8006
8007
|
ae((I) => I.offsetBottom + I.bottom)
|
|
8007
8008
|
),
|
|
8008
8009
|
0
|
|
@@ -8023,9 +8024,9 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
8023
8024
|
headerHeight: s,
|
|
8024
8025
|
increaseViewportBy: e,
|
|
8025
8026
|
initialItemCount: T,
|
|
8026
|
-
itemDimensions:
|
|
8027
|
+
itemDimensions: $,
|
|
8027
8028
|
overscan: n,
|
|
8028
|
-
restoreStateFrom:
|
|
8029
|
+
restoreStateFrom: Q,
|
|
8029
8030
|
scrollBy: i,
|
|
8030
8031
|
scrollContainerState: a,
|
|
8031
8032
|
scrollHeight: U,
|
|
@@ -8041,12 +8042,12 @@ const cb = /* @__PURE__ */ Oe(
|
|
|
8041
8042
|
windowViewportRect: R,
|
|
8042
8043
|
...p,
|
|
8043
8044
|
// output
|
|
8044
|
-
gridState:
|
|
8045
|
+
gridState: N,
|
|
8045
8046
|
horizontalDirection: A,
|
|
8046
8047
|
initialTopMostItemIndex: B,
|
|
8047
8048
|
totalListHeight: O,
|
|
8048
8049
|
...h,
|
|
8049
|
-
endReached:
|
|
8050
|
+
endReached: L,
|
|
8050
8051
|
propsReady: g,
|
|
8051
8052
|
rangeChanged: W,
|
|
8052
8053
|
startReached: P,
|
|
@@ -8072,14 +8073,14 @@ function _i(e, t, n, r) {
|
|
|
8072
8073
|
return i > 0 ? i + t.row : i;
|
|
8073
8074
|
}
|
|
8074
8075
|
const ub = /* @__PURE__ */ Oe(() => {
|
|
8075
|
-
const e =
|
|
8076
|
+
const e = te((f) => `Item ${f}`), t = te({}), n = te(null), r = te("virtuoso-grid-item"), o = te("virtuoso-grid-list"), s = te(da), i = te("div"), a = te(Nr), c = (f, h = null) => pt(
|
|
8076
8077
|
Z(
|
|
8077
8078
|
t,
|
|
8078
8079
|
ae((p) => p[f]),
|
|
8079
8080
|
We()
|
|
8080
8081
|
),
|
|
8081
8082
|
h
|
|
8082
|
-
), l =
|
|
8083
|
+
), l = te(!1), u = te(!1);
|
|
8083
8084
|
return he(xe(u), l), {
|
|
8084
8085
|
components: t,
|
|
8085
8086
|
computeItemKey: s,
|
|
@@ -8101,9 +8102,9 @@ const ub = /* @__PURE__ */ Oe(() => {
|
|
|
8101
8102
|
}), db = /* @__PURE__ */ Oe(
|
|
8102
8103
|
([e, t]) => ({ ...e, ...t }),
|
|
8103
8104
|
Ve(cb, ub)
|
|
8104
|
-
), fb = /* @__PURE__ */
|
|
8105
|
+
), fb = /* @__PURE__ */ ee.memo(function() {
|
|
8105
8106
|
const e = Ge("gridState"), t = Ge("listClassName"), n = Ge("itemClassName"), r = Ge("itemContent"), o = Ge("computeItemKey"), s = Ge("isSeeking"), i = zt("scrollHeight"), a = Ge("ItemComponent"), c = Ge("ListComponent"), l = Ge("ScrollSeekPlaceholder"), u = Ge("context"), f = zt("itemDimensions"), h = zt("gap"), p = Ge("log"), m = Ge("stateRestoreInProgress"), g = zt("reportReadyState"), x = rr(
|
|
8106
|
-
|
|
8107
|
+
ee.useMemo(
|
|
8107
8108
|
() => (y) => {
|
|
8108
8109
|
const v = y.parentElement.parentElement.scrollHeight;
|
|
8109
8110
|
i(v);
|
|
@@ -8156,9 +8157,9 @@ const ub = /* @__PURE__ */ Oe(() => {
|
|
|
8156
8157
|
})
|
|
8157
8158
|
}
|
|
8158
8159
|
);
|
|
8159
|
-
}), hb =
|
|
8160
|
+
}), hb = ee.memo(function() {
|
|
8160
8161
|
const e = Ge("HeaderComponent"), t = zt("headerHeight"), n = Ge("headerFooterTag"), r = rr(
|
|
8161
|
-
|
|
8162
|
+
ee.useMemo(
|
|
8162
8163
|
() => (s) => {
|
|
8163
8164
|
t(Rn(s, "height"));
|
|
8164
8165
|
},
|
|
@@ -8168,9 +8169,9 @@ const ub = /* @__PURE__ */ Oe(() => {
|
|
|
8168
8169
|
!1
|
|
8169
8170
|
), o = Ge("context");
|
|
8170
8171
|
return e ? /* @__PURE__ */ d.jsx(n, { ref: r, children: /* @__PURE__ */ d.jsx(e, { ...ft(e, o) }) }) : null;
|
|
8171
|
-
}), pb =
|
|
8172
|
+
}), pb = ee.memo(function() {
|
|
8172
8173
|
const e = Ge("FooterComponent"), t = zt("footerHeight"), n = Ge("headerFooterTag"), r = rr(
|
|
8173
|
-
|
|
8174
|
+
ee.useMemo(
|
|
8174
8175
|
() => (s) => {
|
|
8175
8176
|
t(Rn(s, "height"));
|
|
8176
8177
|
},
|
|
@@ -8181,8 +8182,8 @@ const ub = /* @__PURE__ */ Oe(() => {
|
|
|
8181
8182
|
), o = Ge("context");
|
|
8182
8183
|
return e ? /* @__PURE__ */ d.jsx(n, { ref: r, children: /* @__PURE__ */ d.jsx(e, { ...ft(e, o) }) }) : null;
|
|
8183
8184
|
}), mb = ({ children: e }) => {
|
|
8184
|
-
const t =
|
|
8185
|
-
|
|
8185
|
+
const t = ee.useContext(td), n = zt("itemDimensions"), r = zt("viewportDimensions"), o = rr(
|
|
8186
|
+
ee.useMemo(
|
|
8186
8187
|
() => (s) => {
|
|
8187
8188
|
r(s.getBoundingClientRect());
|
|
8188
8189
|
},
|
|
@@ -8191,15 +8192,15 @@ const ub = /* @__PURE__ */ Oe(() => {
|
|
|
8191
8192
|
!0,
|
|
8192
8193
|
!1
|
|
8193
8194
|
);
|
|
8194
|
-
return
|
|
8195
|
+
return ee.useEffect(() => {
|
|
8195
8196
|
t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
|
|
8196
8197
|
}, [t, r, n]), /* @__PURE__ */ d.jsx("div", { ref: o, style: As(!1), children: e });
|
|
8197
8198
|
}, gb = ({ children: e }) => {
|
|
8198
|
-
const t =
|
|
8199
|
-
return
|
|
8199
|
+
const t = ee.useContext(td), n = zt("windowViewportRect"), r = zt("itemDimensions"), o = Ge("customScrollParent"), s = Pu(n, o, !1);
|
|
8200
|
+
return ee.useEffect(() => {
|
|
8200
8201
|
t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
|
|
8201
8202
|
}, [t, n, r]), /* @__PURE__ */ d.jsx("div", { ref: s, style: As(!1), children: e });
|
|
8202
|
-
}, xb = /* @__PURE__ */
|
|
8203
|
+
}, xb = /* @__PURE__ */ ee.memo(function({ ...e }) {
|
|
8203
8204
|
const t = Ge("useWindowScroll"), n = Ge("customScrollParent"), r = n || t ? bb : yb, o = n || t ? gb : mb, s = Ge("context");
|
|
8204
8205
|
return /* @__PURE__ */ d.jsx(r, { ...e, ...ft(r, s), children: /* @__PURE__ */ d.jsxs(o, { children: [
|
|
8205
8206
|
/* @__PURE__ */ d.jsx(hb, {}),
|
|
@@ -8255,7 +8256,7 @@ const ub = /* @__PURE__ */ Oe(() => {
|
|
|
8255
8256
|
function Vl(e, t, n) {
|
|
8256
8257
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
8257
8258
|
}
|
|
8258
|
-
const mo =
|
|
8259
|
+
const mo = ee.memo(function({
|
|
8259
8260
|
role: t,
|
|
8260
8261
|
header: n,
|
|
8261
8262
|
content: r,
|
|
@@ -9824,12 +9825,12 @@ class En {
|
|
|
9824
9825
|
continue;
|
|
9825
9826
|
}
|
|
9826
9827
|
default: {
|
|
9827
|
-
const
|
|
9828
|
+
const N = 'Token with "' + p.type + '" type was not found.';
|
|
9828
9829
|
if (this.options.silent) {
|
|
9829
|
-
console.error(
|
|
9830
|
+
console.error(N);
|
|
9830
9831
|
return;
|
|
9831
9832
|
} else
|
|
9832
|
-
throw new Error(
|
|
9833
|
+
throw new Error(N);
|
|
9833
9834
|
}
|
|
9834
9835
|
}
|
|
9835
9836
|
}
|
|
@@ -10325,13 +10326,13 @@ function as({
|
|
|
10325
10326
|
return q;
|
|
10326
10327
|
}
|
|
10327
10328
|
return a.default;
|
|
10328
|
-
})(), w = C(), T = !o || t === "expanded",
|
|
10329
|
+
})(), w = C(), T = !o || t === "expanded", N = (T ? S == null ? void 0 : S({
|
|
10329
10330
|
message: e,
|
|
10330
10331
|
toolMeta: l,
|
|
10331
10332
|
toolPayload: m,
|
|
10332
10333
|
viewMode: t,
|
|
10333
10334
|
isStreaming: n
|
|
10334
|
-
}) : null) ?? null,
|
|
10335
|
+
}) : null) ?? null, $ = (() => {
|
|
10335
10336
|
if (!c)
|
|
10336
10337
|
return;
|
|
10337
10338
|
const _ = u == null ? void 0 : u.type;
|
|
@@ -10341,12 +10342,12 @@ function as({
|
|
|
10341
10342
|
return q;
|
|
10342
10343
|
}
|
|
10343
10344
|
return c.default;
|
|
10344
|
-
})(), F =
|
|
10345
|
+
})(), F = $ ? $({
|
|
10345
10346
|
artifact: u,
|
|
10346
10347
|
message: e,
|
|
10347
10348
|
toolPayload: m,
|
|
10348
10349
|
isStreaming: n
|
|
10349
|
-
}) : null, U =
|
|
10350
|
+
}) : null, U = N ?? w, Y = $ ? F : null;
|
|
10350
10351
|
return /* @__PURE__ */ d.jsxs("div", { className: "space-y-2", children: [
|
|
10351
10352
|
n && /* @__PURE__ */ d.jsx(
|
|
10352
10353
|
vb,
|
|
@@ -10551,21 +10552,21 @@ const kd = oo(function({
|
|
|
10551
10552
|
textContent: S,
|
|
10552
10553
|
imageParts: w,
|
|
10553
10554
|
fileParts: T,
|
|
10554
|
-
interruptParts:
|
|
10555
|
-
} = xa(t), j =
|
|
10555
|
+
interruptParts: N
|
|
10556
|
+
} = xa(t), j = N[0] || null, $ = ie(async () => {
|
|
10556
10557
|
const X = S;
|
|
10557
10558
|
try {
|
|
10558
10559
|
await navigator.clipboard.writeText(X), g(!0), setTimeout(() => g(!1), 2e3), u == null || u(X);
|
|
10559
|
-
} catch (
|
|
10560
|
-
console.error("Failed to copy assistant message:",
|
|
10560
|
+
} catch (Q) {
|
|
10561
|
+
console.error("Failed to copy assistant message:", Q);
|
|
10561
10562
|
}
|
|
10562
10563
|
}, [S, u]), F = ie(
|
|
10563
|
-
async (X,
|
|
10564
|
+
async (X, Q) => {
|
|
10564
10565
|
if (!(!j || !xu(j.id))) {
|
|
10565
10566
|
v(!0);
|
|
10566
10567
|
try {
|
|
10567
10568
|
const B = f == null ? void 0 : f(t);
|
|
10568
|
-
await x(X,
|
|
10569
|
+
await x(X, Q, B);
|
|
10569
10570
|
} finally {
|
|
10570
10571
|
v(!1);
|
|
10571
10572
|
}
|
|
@@ -10588,7 +10589,7 @@ const kd = oo(function({
|
|
|
10588
10589
|
showActions: !0,
|
|
10589
10590
|
isEditing: !1,
|
|
10590
10591
|
messageRole: t.role,
|
|
10591
|
-
onCopy:
|
|
10592
|
+
onCopy: $,
|
|
10592
10593
|
onRegenerate: U,
|
|
10593
10594
|
showCheckpointControls: !1,
|
|
10594
10595
|
attemptCount: 1,
|
|
@@ -10627,7 +10628,7 @@ const kd = oo(function({
|
|
|
10627
10628
|
interruptPart: j,
|
|
10628
10629
|
handleInterruptApprove: () => F(!0),
|
|
10629
10630
|
handleInterruptReject: () => F(!1),
|
|
10630
|
-
handleInterruptAlternative: (X,
|
|
10631
|
+
handleInterruptAlternative: (X, Q) => F(!0, { alternativeId: Q == null ? void 0 : Q.id }),
|
|
10631
10632
|
disableInterruptActions: y,
|
|
10632
10633
|
renderArtifactsInline: h,
|
|
10633
10634
|
iconForeground: "text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -10640,7 +10641,7 @@ const kd = oo(function({
|
|
|
10640
10641
|
{
|
|
10641
10642
|
variant: "ghost",
|
|
10642
10643
|
size: "sm",
|
|
10643
|
-
onClick:
|
|
10644
|
+
onClick: $,
|
|
10644
10645
|
className: ce("h-6 w-6 p-0 hover:bg-background/50", C && "h-5 w-5"),
|
|
10645
10646
|
children: /* @__PURE__ */ d.jsx(Vi, { className: ce(m ? "text-green-500" : "text-current", C ? "h-3 w-3" : "h-4 w-4") })
|
|
10646
10647
|
}
|
|
@@ -10726,9 +10727,9 @@ function tk({
|
|
|
10726
10727
|
iconForeground: S,
|
|
10727
10728
|
toolConfig: w,
|
|
10728
10729
|
handleInterruptApprove: T,
|
|
10729
|
-
handleInterruptReject:
|
|
10730
|
+
handleInterruptReject: N,
|
|
10730
10731
|
handleInterruptAlternative: j,
|
|
10731
|
-
disableInterruptActions:
|
|
10732
|
+
disableInterruptActions: $,
|
|
10732
10733
|
renderArtifactsInline: F = !0
|
|
10733
10734
|
}) {
|
|
10734
10735
|
const U = ie(() => /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
|
|
@@ -10744,7 +10745,7 @@ function tk({
|
|
|
10744
10745
|
), X = Ne(
|
|
10745
10746
|
() => q.map((O) => O.text ?? "").join(""),
|
|
10746
10747
|
[q]
|
|
10747
|
-
), { artifacts:
|
|
10748
|
+
), { artifacts: Q } = ha(e), H = Ne(() => {
|
|
10748
10749
|
if (!h)
|
|
10749
10750
|
return null;
|
|
10750
10751
|
const O = Kb(X);
|
|
@@ -10759,7 +10760,7 @@ function tk({
|
|
|
10759
10760
|
O ? /* @__PURE__ */ d.jsx(Wr, { content: O, allowHtml: !1 }) : null,
|
|
10760
10761
|
I ? /* @__PURE__ */ d.jsx(Wr, { content: I, allowHtml: !1 }) : null
|
|
10761
10762
|
] });
|
|
10762
|
-
}, [H]),
|
|
10763
|
+
}, [H]), ne = Ne(() => {
|
|
10763
10764
|
if (!h)
|
|
10764
10765
|
return _;
|
|
10765
10766
|
const O = [];
|
|
@@ -10776,9 +10777,9 @@ function tk({
|
|
|
10776
10777
|
O.push(K);
|
|
10777
10778
|
}
|
|
10778
10779
|
return O;
|
|
10779
|
-
}, [_, h]), A = (h ?
|
|
10780
|
+
}, [_, h]), A = (h ? ne : _).filter((O) => O.type !== "interrupt" && O.type !== "image_url");
|
|
10780
10781
|
Ne(() => n ? /* @__PURE__ */ d.jsx(Pi, { message: e }) : null, [e, n]);
|
|
10781
|
-
const
|
|
10782
|
+
const E = () => !s || s.length === 0 ? null : /* @__PURE__ */ d.jsx("div", { className: "flex flex-wrap gap-2 mb-2", children: s.map((O, I) => {
|
|
10782
10783
|
const K = O;
|
|
10783
10784
|
return /* @__PURE__ */ d.jsx("div", { className: "relative group", children: /* @__PURE__ */ d.jsx(
|
|
10784
10785
|
"img",
|
|
@@ -10790,7 +10791,7 @@ function tk({
|
|
|
10790
10791
|
className: "h-20 w-20 object-cover rounded-md border border-border/50 cursor-pointer hover:opacity-90 transition-opacity"
|
|
10791
10792
|
}
|
|
10792
10793
|
) }, I);
|
|
10793
|
-
}) }),
|
|
10794
|
+
}) }), L = ie(({ part: O, i: I }) => {
|
|
10794
10795
|
if (O.type === "text") {
|
|
10795
10796
|
if (h)
|
|
10796
10797
|
return null;
|
|
@@ -10846,8 +10847,8 @@ function tk({
|
|
|
10846
10847
|
if (!t && !P && !c)
|
|
10847
10848
|
return null;
|
|
10848
10849
|
if (a) {
|
|
10849
|
-
const O = a.value, I =
|
|
10850
|
-
}), J =
|
|
10850
|
+
const O = a.value, I = !$, K = T ?? (() => {
|
|
10851
|
+
}), J = N ?? (() => {
|
|
10851
10852
|
});
|
|
10852
10853
|
return /* @__PURE__ */ d.jsx(
|
|
10853
10854
|
pa,
|
|
@@ -10857,7 +10858,7 @@ function tk({
|
|
|
10857
10858
|
onApprove: K,
|
|
10858
10859
|
onReject: J,
|
|
10859
10860
|
onSelectAlternative: j,
|
|
10860
|
-
disabled:
|
|
10861
|
+
disabled: $,
|
|
10861
10862
|
isActive: I
|
|
10862
10863
|
}
|
|
10863
10864
|
);
|
|
@@ -10871,9 +10872,9 @@ function tk({
|
|
|
10871
10872
|
toolConfig: w
|
|
10872
10873
|
}
|
|
10873
10874
|
) }),
|
|
10874
|
-
A.map((O, I) => h && qb(O) ? B ? /* @__PURE__ */ d.jsx("div", { className: "space-y-2", children: B }, `streaming-md-${I}`) : null : /* @__PURE__ */ d.jsx(
|
|
10875
|
-
|
|
10876
|
-
F && (
|
|
10875
|
+
A.map((O, I) => h && qb(O) ? B ? /* @__PURE__ */ d.jsx("div", { className: "space-y-2", children: B }, `streaming-md-${I}`) : null : /* @__PURE__ */ d.jsx(L, { part: O, i: I }, I)),
|
|
10876
|
+
E(),
|
|
10877
|
+
F && (Q.length > 0 || !!e.artifact) && /* @__PURE__ */ d.jsxs("div", { className: "mt-4 pt-4 border-t border-border/40 space-y-4", children: [
|
|
10877
10878
|
!!e.artifact && /* @__PURE__ */ d.jsx(
|
|
10878
10879
|
as,
|
|
10879
10880
|
{
|
|
@@ -10882,7 +10883,7 @@ function tk({
|
|
|
10882
10883
|
toolConfig: w
|
|
10883
10884
|
}
|
|
10884
10885
|
),
|
|
10885
|
-
|
|
10886
|
+
Q.map((O, I) => /* @__PURE__ */ d.jsx(
|
|
10886
10887
|
as,
|
|
10887
10888
|
{
|
|
10888
10889
|
message: e,
|
|
@@ -11124,10 +11125,10 @@ const Id = oo(function({
|
|
|
11124
11125
|
checkpointNs: t.checkpointNs ?? null
|
|
11125
11126
|
};
|
|
11126
11127
|
i(t.id, x, _);
|
|
11127
|
-
}, [i, t, x]), { attemptCount: S, attemptIndex: w, attempts: T } = Ne(() => a ? jx(t.id, t.checkpointId, a) : { attemptCount: 1, attemptIndex: 0, attempts: [] }, [t.id, t.checkpointId, a]),
|
|
11128
|
+
}, [i, t, x]), { attemptCount: S, attemptIndex: w, attempts: T } = Ne(() => a ? jx(t.id, t.checkpointId, a) : { attemptCount: 1, attemptIndex: 0, attempts: [] }, [t.id, t.checkpointId, a]), N = S > 1 && !!c, j = ie(() => {
|
|
11128
11129
|
const _ = T[w + 1];
|
|
11129
11130
|
_ && c && c(_.id, void 0, !!_.isLatestAttempt);
|
|
11130
|
-
}, [T, w, c]),
|
|
11131
|
+
}, [T, w, c]), $ = ie(() => {
|
|
11131
11132
|
const _ = T[w - 1];
|
|
11132
11133
|
_ && c && c(_.id, void 0, !!_.isLatestAttempt);
|
|
11133
11134
|
}, [T, w, c]), F = /* @__PURE__ */ d.jsx(
|
|
@@ -11145,11 +11146,11 @@ const Id = oo(function({
|
|
|
11145
11146
|
messageRole: "user",
|
|
11146
11147
|
onCopy: C,
|
|
11147
11148
|
onEdit: s ? R : void 0,
|
|
11148
|
-
showCheckpointControls:
|
|
11149
|
+
showCheckpointControls: N,
|
|
11149
11150
|
attemptCount: S,
|
|
11150
11151
|
attemptIndex: w,
|
|
11151
11152
|
handleOlderAttemptSelect: j,
|
|
11152
|
-
handleNewerAttemptSelect:
|
|
11153
|
+
handleNewerAttemptSelect: $,
|
|
11153
11154
|
messageCreatedAt: t.createdAt,
|
|
11154
11155
|
copied: u,
|
|
11155
11156
|
customHeaderClass: l.header,
|
|
@@ -11208,7 +11209,7 @@ const Id = oo(function({
|
|
|
11208
11209
|
);
|
|
11209
11210
|
});
|
|
11210
11211
|
Id.displayName = "UserMessageComponent";
|
|
11211
|
-
const nk = (e) => `msg-${e}`, Ed =
|
|
11212
|
+
const nk = (e) => `msg-${e}`, Ed = ee.memo(function({
|
|
11212
11213
|
turn: t,
|
|
11213
11214
|
index: n,
|
|
11214
11215
|
layoutSize: r,
|
|
@@ -11237,7 +11238,7 @@ const nk = (e) => `msg-${e}`, Ed = te.memo(function({
|
|
|
11237
11238
|
isCompactLayout: g,
|
|
11238
11239
|
showActions: !0,
|
|
11239
11240
|
onCopy: () => {
|
|
11240
|
-
const w = m.map((T) => T.content.map((
|
|
11241
|
+
const w = m.map((T) => T.content.map((N) => N.type === "text" ? N.text : "").join("")).join(`
|
|
11241
11242
|
|
|
11242
11243
|
`);
|
|
11243
11244
|
navigator.clipboard.writeText(w);
|
|
@@ -11320,7 +11321,7 @@ const nk = (e) => `msg-${e}`, Ed = te.memo(function({
|
|
|
11320
11321
|
] });
|
|
11321
11322
|
});
|
|
11322
11323
|
Ed.displayName = "MessageRow";
|
|
11323
|
-
const Xb = Object.freeze({}), Ad =
|
|
11324
|
+
const Xb = Object.freeze({}), Ad = ee.forwardRef(({
|
|
11324
11325
|
messages: e = [],
|
|
11325
11326
|
streamingAssistantId: t,
|
|
11326
11327
|
streamingDebounceMs: n = 0,
|
|
@@ -11345,10 +11346,10 @@ const Xb = Object.freeze({}), Ad = te.forwardRef(({
|
|
|
11345
11346
|
onSelectCheckpoint: S,
|
|
11346
11347
|
pendingInterrupt: w,
|
|
11347
11348
|
getMessageCustomStyles: T,
|
|
11348
|
-
getInterruptOptions:
|
|
11349
|
+
getInterruptOptions: N,
|
|
11349
11350
|
renderArtifactsInline: j = !0
|
|
11350
|
-
},
|
|
11351
|
-
const F = Te(null), U = Te(null), Y = Te(!1), _ = Te(!1),
|
|
11351
|
+
}, $) => {
|
|
11352
|
+
const F = Te(null), U = Te(null), Y = Te(!1), _ = Te(!1), Q = ee.useMemo(() => {
|
|
11352
11353
|
const O = [];
|
|
11353
11354
|
let I = null;
|
|
11354
11355
|
const K = (J) => {
|
|
@@ -11391,7 +11392,7 @@ const Xb = Object.freeze({}), Ad = te.forwardRef(({
|
|
|
11391
11392
|
return O;
|
|
11392
11393
|
}, [e, t, w]), H = Ne(() => v ?? Xb, [v]), B = ie((O) => {
|
|
11393
11394
|
g && g(!O), x && x(O);
|
|
11394
|
-
}, [g, x]),
|
|
11395
|
+
}, [g, x]), ne = Ne(() => {
|
|
11395
11396
|
if (i)
|
|
11396
11397
|
return async () => {
|
|
11397
11398
|
if (!Y.current) {
|
|
@@ -11403,7 +11404,7 @@ const Xb = Object.freeze({}), Ad = te.forwardRef(({
|
|
|
11403
11404
|
}
|
|
11404
11405
|
}
|
|
11405
11406
|
};
|
|
11406
|
-
}, [i]),
|
|
11407
|
+
}, [i]), M = Ne(() => !p || m ? !1 : "auto", [p, m]), A = Q.length === 0 && h, E = ["flex h-full flex-col md:flex-row", u].filter(Boolean).join(" "), L = () => A ? /* @__PURE__ */ d.jsx("div", { className: "h-full w-full", children: h }) : /* @__PURE__ */ d.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: "No messages yet. Start a conversation!" }), P = Q.length, W = P > 0;
|
|
11407
11408
|
return Be(() => {
|
|
11408
11409
|
var O, I;
|
|
11409
11410
|
if (P === 0) {
|
|
@@ -11411,35 +11412,35 @@ const Xb = Object.freeze({}), Ad = te.forwardRef(({
|
|
|
11411
11412
|
return;
|
|
11412
11413
|
}
|
|
11413
11414
|
if (!_.current)
|
|
11414
|
-
if (_.current = !0, F.current &&
|
|
11415
|
-
const K =
|
|
11415
|
+
if (_.current = !0, F.current && Q.length > 0) {
|
|
11416
|
+
const K = Q.length - 1;
|
|
11416
11417
|
(I = (O = F.current).scrollToIndex) == null || I.call(O, { index: K, align: "end", behavior: "auto" });
|
|
11417
11418
|
} else U.current && (U.current.scrollTop = U.current.scrollHeight);
|
|
11418
|
-
}, [P,
|
|
11419
|
+
}, [P, Q.length]), Sp($, () => ({
|
|
11419
11420
|
scrollToLatest: () => {
|
|
11420
11421
|
var O, I;
|
|
11421
|
-
if (F.current &&
|
|
11422
|
-
const K =
|
|
11422
|
+
if (F.current && Q.length > 0) {
|
|
11423
|
+
const K = Q.length - 1;
|
|
11423
11424
|
(I = (O = F.current).scrollToIndex) == null || I.call(O, { index: K, align: "end", behavior: "auto" });
|
|
11424
11425
|
} else U.current && (U.current.scrollTop = U.current.scrollHeight);
|
|
11425
11426
|
},
|
|
11426
11427
|
scrollToTop: () => {
|
|
11427
11428
|
var O, I;
|
|
11428
|
-
F.current &&
|
|
11429
|
+
F.current && Q.length > 0 ? (I = (O = F.current).scrollToIndex) == null || I.call(O, { index: 0, align: "start", behavior: "auto" }) : U.current && (U.current.scrollTop = 0);
|
|
11429
11430
|
}
|
|
11430
|
-
}), [
|
|
11431
|
+
}), [Q]), /* @__PURE__ */ d.jsx("div", { className: E, style: f, children: /* @__PURE__ */ d.jsx("div", { className: "relative flex-1 min-h-0 min-w-0", children: W ? /* @__PURE__ */ d.jsx(
|
|
11431
11432
|
ob,
|
|
11432
11433
|
{
|
|
11433
11434
|
ref: (O) => F.current = O,
|
|
11434
11435
|
scrollerRef: (O) => U.current = O instanceof HTMLDivElement ? O : null,
|
|
11435
|
-
data:
|
|
11436
|
-
followOutput:
|
|
11436
|
+
data: Q,
|
|
11437
|
+
followOutput: M,
|
|
11437
11438
|
overscan: 200,
|
|
11438
11439
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
11439
11440
|
defaultItemHeight: 80,
|
|
11440
11441
|
atBottomThreshold: 50,
|
|
11441
11442
|
startReached: () => {
|
|
11442
|
-
|
|
11443
|
+
ne && ne();
|
|
11443
11444
|
},
|
|
11444
11445
|
atBottomStateChange: B,
|
|
11445
11446
|
style: { height: "100%", overscrollBehavior: "contain" },
|
|
@@ -11463,12 +11464,12 @@ const Xb = Object.freeze({}), Ad = te.forwardRef(({
|
|
|
11463
11464
|
activeCheckpointId: R,
|
|
11464
11465
|
onSelectCheckpoint: S,
|
|
11465
11466
|
getMessageCustomStyles: T,
|
|
11466
|
-
getInterruptOptions:
|
|
11467
|
+
getInterruptOptions: N,
|
|
11467
11468
|
renderArtifactsInline: j
|
|
11468
11469
|
}
|
|
11469
11470
|
)
|
|
11470
11471
|
}
|
|
11471
|
-
) :
|
|
11472
|
+
) : L() }) });
|
|
11472
11473
|
});
|
|
11473
11474
|
Ad.displayName = "MessageList";
|
|
11474
11475
|
function be(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
@@ -11648,27 +11649,27 @@ function jd(e) {
|
|
|
11648
11649
|
t,
|
|
11649
11650
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
11650
11651
|
), i = (g) => {
|
|
11651
|
-
const { scope: x, children: y } = g, v =
|
|
11652
|
+
const { scope: x, children: y } = g, v = ee.useRef(null), C = ee.useRef(/* @__PURE__ */ new Map()).current;
|
|
11652
11653
|
return /* @__PURE__ */ d.jsx(o, { scope: x, itemMap: C, collectionRef: v, children: y });
|
|
11653
11654
|
};
|
|
11654
11655
|
i.displayName = t;
|
|
11655
|
-
const a = e + "CollectionSlot", c = qr(a), l =
|
|
11656
|
+
const a = e + "CollectionSlot", c = qr(a), l = ee.forwardRef(
|
|
11656
11657
|
(g, x) => {
|
|
11657
11658
|
const { scope: y, children: v } = g, C = s(a, y), R = Ye(x, C.collectionRef);
|
|
11658
11659
|
return /* @__PURE__ */ d.jsx(c, { ref: R, children: v });
|
|
11659
11660
|
}
|
|
11660
11661
|
);
|
|
11661
11662
|
l.displayName = a;
|
|
11662
|
-
const u = e + "CollectionItemSlot", f = "data-radix-collection-item", h = qr(u), p =
|
|
11663
|
+
const u = e + "CollectionItemSlot", f = "data-radix-collection-item", h = qr(u), p = ee.forwardRef(
|
|
11663
11664
|
(g, x) => {
|
|
11664
|
-
const { scope: y, children: v, ...C } = g, R =
|
|
11665
|
-
return
|
|
11665
|
+
const { scope: y, children: v, ...C } = g, R = ee.useRef(null), S = Ye(x, R), w = s(u, y);
|
|
11666
|
+
return ee.useEffect(() => (w.itemMap.set(R, { ref: R, ...C }), () => void w.itemMap.delete(R))), /* @__PURE__ */ d.jsx(h, { [f]: "", ref: S, children: v });
|
|
11666
11667
|
}
|
|
11667
11668
|
);
|
|
11668
11669
|
p.displayName = u;
|
|
11669
11670
|
function m(g) {
|
|
11670
11671
|
const x = s(e + "CollectionConsumer", g);
|
|
11671
|
-
return
|
|
11672
|
+
return ee.useCallback(() => {
|
|
11672
11673
|
const v = x.collectionRef.current;
|
|
11673
11674
|
if (!v) return [];
|
|
11674
11675
|
const C = Array.from(v.querySelectorAll(`[${f}]`));
|
|
@@ -11721,11 +11722,11 @@ var sv = "DismissableLayer", Mi = "dismissableLayer.update", iv = "dismissableLa
|
|
|
11721
11722
|
onDismiss: a,
|
|
11722
11723
|
...c
|
|
11723
11724
|
} = e, l = b.useContext(_d), [u, f] = b.useState(null), h = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = b.useState({}), m = Ye(t, (T) => f(T)), g = Array.from(l.layers), [x] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), y = g.indexOf(x), v = u ? g.indexOf(u) : -1, C = l.layersWithOutsidePointerEventsDisabled.size > 0, R = v >= y, S = uv((T) => {
|
|
11724
|
-
const
|
|
11725
|
+
const N = T.target, j = [...l.branches].some(($) => $.contains(N));
|
|
11725
11726
|
!R || j || (o == null || o(T), i == null || i(T), T.defaultPrevented || a == null || a());
|
|
11726
11727
|
}, h), w = dv((T) => {
|
|
11727
|
-
const
|
|
11728
|
-
[...l.branches].some((
|
|
11728
|
+
const N = T.target;
|
|
11729
|
+
[...l.branches].some(($) => $.contains(N)) || (s == null || s(T), i == null || i(T), T.defaultPrevented || a == null || a());
|
|
11729
11730
|
}, h);
|
|
11730
11731
|
return ov((T) => {
|
|
11731
11732
|
v === l.layers.size - 1 && (r == null || r(T), !T.defaultPrevented && a && (T.preventDefault(), a()));
|
|
@@ -12256,14 +12257,14 @@ const Pv = (e) => ({
|
|
|
12256
12257
|
}, p = Ta(o), m = Ca(p), g = await i.getDimensions(l), x = p === "y", y = x ? "top" : "left", v = x ? "bottom" : "right", C = x ? "clientHeight" : "clientWidth", R = s.reference[m] + s.reference[p] - h[p] - s.floating[m], S = h[p] - s.reference[p], w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
|
|
12257
12258
|
let T = w ? w[C] : 0;
|
|
12258
12259
|
(!T || !await (i.isElement == null ? void 0 : i.isElement(w))) && (T = a.floating[C] || s.floating[m]);
|
|
12259
|
-
const
|
|
12260
|
+
const N = R / 2 - S / 2, j = T / 2 - g[m] / 2 - 1, $ = Nn(f[y], j), F = Nn(f[v], j), U = $, Y = T - g[m] - F, _ = T / 2 - g[m] / 2 + N, q = Di(U, _, Y), X = !c.arrow && jr(o) != null && _ !== q && s.reference[m] / 2 - (_ < U ? $ : F) - g[m] / 2 < 0, Q = X ? _ < U ? _ - U : _ - Y : 0;
|
|
12260
12261
|
return {
|
|
12261
|
-
[p]: h[p] +
|
|
12262
|
+
[p]: h[p] + Q,
|
|
12262
12263
|
data: {
|
|
12263
12264
|
[p]: q,
|
|
12264
|
-
centerOffset: _ - q -
|
|
12265
|
+
centerOffset: _ - q - Q,
|
|
12265
12266
|
...X && {
|
|
12266
|
-
alignmentOffset:
|
|
12267
|
+
alignmentOffset: Q
|
|
12267
12268
|
}
|
|
12268
12269
|
},
|
|
12269
12270
|
reset: X
|
|
@@ -12295,13 +12296,13 @@ const Pv = (e) => ({
|
|
|
12295
12296
|
return {};
|
|
12296
12297
|
const y = bn(o), v = cn(a), C = bn(a) === a, R = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), S = h || (C || !g ? [cs(a)] : Rv(a)), w = m !== "none";
|
|
12297
12298
|
!h && w && S.push(...Nv(a, g, m, R));
|
|
12298
|
-
const T = [a, ...S],
|
|
12299
|
-
let
|
|
12300
|
-
if (u && j.push(
|
|
12299
|
+
const T = [a, ...S], N = await eo(t, x), j = [];
|
|
12300
|
+
let $ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
12301
|
+
if (u && j.push(N[y]), f) {
|
|
12301
12302
|
const _ = kv(o, i, R);
|
|
12302
|
-
j.push(
|
|
12303
|
+
j.push(N[_[0]], N[_[1]]);
|
|
12303
12304
|
}
|
|
12304
|
-
if (
|
|
12305
|
+
if ($ = [...$, {
|
|
12305
12306
|
placement: o,
|
|
12306
12307
|
overflows: j
|
|
12307
12308
|
}], !j.every((_) => _ <= 0)) {
|
|
@@ -12309,22 +12310,22 @@ const Pv = (e) => ({
|
|
|
12309
12310
|
const _ = (((F = s.flip) == null ? void 0 : F.index) || 0) + 1, q = T[_];
|
|
12310
12311
|
if (q && (!(f === "alignment" ? v !== cn(q) : !1) || // We leave the current main axis only if every placement on that axis
|
|
12311
12312
|
// overflows the main axis.
|
|
12312
|
-
|
|
12313
|
+
$.every((H) => cn(H.placement) === v ? H.overflows[0] > 0 : !0)))
|
|
12313
12314
|
return {
|
|
12314
12315
|
data: {
|
|
12315
12316
|
index: _,
|
|
12316
|
-
overflows:
|
|
12317
|
+
overflows: $
|
|
12317
12318
|
},
|
|
12318
12319
|
reset: {
|
|
12319
12320
|
placement: q
|
|
12320
12321
|
}
|
|
12321
12322
|
};
|
|
12322
|
-
let X = (U =
|
|
12323
|
+
let X = (U = $.filter((Q) => Q.overflows[0] <= 0).sort((Q, H) => Q.overflows[1] - H.overflows[1])[0]) == null ? void 0 : U.placement;
|
|
12323
12324
|
if (!X)
|
|
12324
12325
|
switch (p) {
|
|
12325
12326
|
case "bestFit": {
|
|
12326
12327
|
var Y;
|
|
12327
|
-
const
|
|
12328
|
+
const Q = (Y = $.filter((H) => {
|
|
12328
12329
|
if (w) {
|
|
12329
12330
|
const B = cn(H.placement);
|
|
12330
12331
|
return B === v || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -12332,8 +12333,8 @@ const Pv = (e) => ({
|
|
|
12332
12333
|
B === "y";
|
|
12333
12334
|
}
|
|
12334
12335
|
return !0;
|
|
12335
|
-
}).map((H) => [H.placement, H.overflows.filter((B) => B > 0).reduce((B,
|
|
12336
|
-
|
|
12336
|
+
}).map((H) => [H.placement, H.overflows.filter((B) => B > 0).reduce((B, ne) => B + ne, 0)]).sort((H, B) => H[1] - B[1])[0]) == null ? void 0 : Y[0];
|
|
12337
|
+
Q && (X = Q);
|
|
12337
12338
|
break;
|
|
12338
12339
|
}
|
|
12339
12340
|
case "initialPlacement":
|
|
@@ -12573,14 +12574,14 @@ const Lv = function(e) {
|
|
|
12573
12574
|
let x, y;
|
|
12574
12575
|
f === "top" || f === "bottom" ? (x = f, y = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = f, x = h === "end" ? "top" : "bottom");
|
|
12575
12576
|
const v = g - u.top - u.bottom, C = m - u.left - u.right, R = Nn(g - u[x], v), S = Nn(m - u[y], C), w = !t.middlewareData.shift;
|
|
12576
|
-
let T = R,
|
|
12577
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (
|
|
12578
|
-
const
|
|
12579
|
-
p ?
|
|
12577
|
+
let T = R, N = S;
|
|
12578
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (N = C), (r = t.middlewareData.shift) != null && r.enabled.y && (T = v), w && !h) {
|
|
12579
|
+
const $ = Nt(u.left, 0), F = Nt(u.right, 0), U = Nt(u.top, 0), Y = Nt(u.bottom, 0);
|
|
12580
|
+
p ? N = m - 2 * ($ !== 0 || F !== 0 ? $ + F : Nt(u.left, u.right)) : T = g - 2 * (U !== 0 || Y !== 0 ? U + Y : Nt(u.top, u.bottom));
|
|
12580
12581
|
}
|
|
12581
12582
|
await c({
|
|
12582
12583
|
...t,
|
|
12583
|
-
availableWidth:
|
|
12584
|
+
availableWidth: N,
|
|
12584
12585
|
availableHeight: T
|
|
12585
12586
|
});
|
|
12586
12587
|
const j = await i.getDimensions(a.floating);
|
|
@@ -13164,7 +13165,7 @@ function Sw(e) {
|
|
|
13164
13165
|
H !== w.current && (w.current = H, g(H));
|
|
13165
13166
|
}, []), C = b.useCallback((H) => {
|
|
13166
13167
|
H !== T.current && (T.current = H, y(H));
|
|
13167
|
-
}, []), R = s || m, S = i || x, w = b.useRef(null), T = b.useRef(null),
|
|
13168
|
+
}, []), R = s || m, S = i || x, w = b.useRef(null), T = b.useRef(null), N = b.useRef(u), j = c != null, $ = ai(c), F = ai(o), U = ai(l), Y = b.useCallback(() => {
|
|
13168
13169
|
if (!w.current || !T.current)
|
|
13169
13170
|
return;
|
|
13170
13171
|
const H = {
|
|
@@ -13173,7 +13174,7 @@ function Sw(e) {
|
|
|
13173
13174
|
middleware: h
|
|
13174
13175
|
};
|
|
13175
13176
|
F.current && (H.platform = F.current), bw(w.current, T.current, H).then((B) => {
|
|
13176
|
-
const
|
|
13177
|
+
const ne = {
|
|
13177
13178
|
...B,
|
|
13178
13179
|
// The floating element's position may be recomputed while it's closed
|
|
13179
13180
|
// but still mounted (such as when transitioning out). To ensure
|
|
@@ -13181,13 +13182,13 @@ function Sw(e) {
|
|
|
13181
13182
|
// setting it to `true` when `open === false` (must be specified).
|
|
13182
13183
|
isPositioned: U.current !== !1
|
|
13183
13184
|
};
|
|
13184
|
-
_.current && !ds(
|
|
13185
|
-
f(
|
|
13185
|
+
_.current && !ds(N.current, ne) && (N.current = ne, Pc.flushSync(() => {
|
|
13186
|
+
f(ne);
|
|
13186
13187
|
}));
|
|
13187
13188
|
});
|
|
13188
13189
|
}, [h, t, n, F, U]);
|
|
13189
13190
|
Vo(() => {
|
|
13190
|
-
l === !1 &&
|
|
13191
|
+
l === !1 && N.current.isPositioned && (N.current.isPositioned = !1, f((H) => ({
|
|
13191
13192
|
...H,
|
|
13192
13193
|
isPositioned: !1
|
|
13193
13194
|
})));
|
|
@@ -13197,11 +13198,11 @@ function Sw(e) {
|
|
|
13197
13198
|
_.current = !1;
|
|
13198
13199
|
}), []), Vo(() => {
|
|
13199
13200
|
if (R && (w.current = R), S && (T.current = S), R && S) {
|
|
13200
|
-
if (
|
|
13201
|
-
return
|
|
13201
|
+
if ($.current)
|
|
13202
|
+
return $.current(R, S, Y);
|
|
13202
13203
|
Y();
|
|
13203
13204
|
}
|
|
13204
|
-
}, [R, S, Y,
|
|
13205
|
+
}, [R, S, Y, $, j]);
|
|
13205
13206
|
const q = b.useMemo(() => ({
|
|
13206
13207
|
reference: w,
|
|
13207
13208
|
floating: T,
|
|
@@ -13210,7 +13211,7 @@ function Sw(e) {
|
|
|
13210
13211
|
}), [v, C]), X = b.useMemo(() => ({
|
|
13211
13212
|
reference: R,
|
|
13212
13213
|
floating: S
|
|
13213
|
-
}), [R, S]),
|
|
13214
|
+
}), [R, S]), Q = b.useMemo(() => {
|
|
13214
13215
|
const H = {
|
|
13215
13216
|
position: n,
|
|
13216
13217
|
left: 0,
|
|
@@ -13218,17 +13219,17 @@ function Sw(e) {
|
|
|
13218
13219
|
};
|
|
13219
13220
|
if (!X.floating)
|
|
13220
13221
|
return H;
|
|
13221
|
-
const B = xc(X.floating, u.x),
|
|
13222
|
+
const B = xc(X.floating, u.x), ne = xc(X.floating, u.y);
|
|
13222
13223
|
return a ? {
|
|
13223
13224
|
...H,
|
|
13224
|
-
transform: "translate(" + B + "px, " +
|
|
13225
|
+
transform: "translate(" + B + "px, " + ne + "px)",
|
|
13225
13226
|
...Kd(X.floating) >= 1.5 && {
|
|
13226
13227
|
willChange: "transform"
|
|
13227
13228
|
}
|
|
13228
13229
|
} : {
|
|
13229
13230
|
position: n,
|
|
13230
13231
|
left: B,
|
|
13231
|
-
top:
|
|
13232
|
+
top: ne
|
|
13232
13233
|
};
|
|
13233
13234
|
}, [n, a, X.floating, u.x, u.y]);
|
|
13234
13235
|
return b.useMemo(() => ({
|
|
@@ -13236,8 +13237,8 @@ function Sw(e) {
|
|
|
13236
13237
|
update: Y,
|
|
13237
13238
|
refs: q,
|
|
13238
13239
|
elements: X,
|
|
13239
|
-
floatingStyles:
|
|
13240
|
-
}), [u, Y, q, X,
|
|
13240
|
+
floatingStyles: Q
|
|
13241
|
+
}), [u, Y, q, X, Q]);
|
|
13241
13242
|
}
|
|
13242
13243
|
const Cw = (e) => {
|
|
13243
13244
|
function t(n) {
|
|
@@ -13354,12 +13355,12 @@ var Aa = "PopperContent", [Mw, Dw] = Gd(Aa), ef = b.forwardRef(
|
|
|
13354
13355
|
updatePositionStrategy: p = "optimized",
|
|
13355
13356
|
onPlaced: m,
|
|
13356
13357
|
...g
|
|
13357
|
-
} = e, x = Xd(Aa, n), [y, v] = b.useState(null), C = Ye(t, (Ce) => v(Ce)), [R, S] = b.useState(null), w = Pw(R), T = (w == null ? void 0 : w.width) ?? 0,
|
|
13358
|
-
padding:
|
|
13358
|
+
} = e, x = Xd(Aa, n), [y, v] = b.useState(null), C = Ye(t, (Ce) => v(Ce)), [R, S] = b.useState(null), w = Pw(R), T = (w == null ? void 0 : w.width) ?? 0, N = (w == null ? void 0 : w.height) ?? 0, j = r + (s !== "center" ? "-" + s : ""), $ = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, F = Array.isArray(l) ? l : [l], U = F.length > 0, Y = {
|
|
13359
|
+
padding: $,
|
|
13359
13360
|
boundary: F.filter($w),
|
|
13360
13361
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
13361
13362
|
altBoundary: U
|
|
13362
|
-
}, { refs: _, floatingStyles: q, placement: X, isPositioned:
|
|
13363
|
+
}, { refs: _, floatingStyles: q, placement: X, isPositioned: Q, middlewareData: H } = Sw({
|
|
13363
13364
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
13364
13365
|
strategy: "fixed",
|
|
13365
13366
|
placement: j,
|
|
@@ -13370,7 +13371,7 @@ var Aa = "PopperContent", [Mw, Dw] = Gd(Aa), ef = b.forwardRef(
|
|
|
13370
13371
|
reference: x.anchor
|
|
13371
13372
|
},
|
|
13372
13373
|
middleware: [
|
|
13373
|
-
Tw({ mainAxis: o +
|
|
13374
|
+
Tw({ mainAxis: o + N, alignmentAxis: i }),
|
|
13374
13375
|
c && kw({
|
|
13375
13376
|
mainAxis: !0,
|
|
13376
13377
|
crossAxis: !1,
|
|
@@ -13386,14 +13387,14 @@ var Aa = "PopperContent", [Mw, Dw] = Gd(Aa), ef = b.forwardRef(
|
|
|
13386
13387
|
}
|
|
13387
13388
|
}),
|
|
13388
13389
|
R && Nw({ element: R, padding: a }),
|
|
13389
|
-
Fw({ arrowWidth: T, arrowHeight:
|
|
13390
|
+
Fw({ arrowWidth: T, arrowHeight: N }),
|
|
13390
13391
|
h && Aw({ strategy: "referenceHidden", ...Y })
|
|
13391
13392
|
]
|
|
13392
|
-
}), [B,
|
|
13393
|
+
}), [B, ne] = rf(X), M = ht(m);
|
|
13393
13394
|
dn(() => {
|
|
13394
|
-
|
|
13395
|
-
}, [
|
|
13396
|
-
const A = (O = H.arrow) == null ? void 0 : O.x,
|
|
13395
|
+
Q && (M == null || M());
|
|
13396
|
+
}, [Q, M]);
|
|
13397
|
+
const A = (O = H.arrow) == null ? void 0 : O.x, E = (I = H.arrow) == null ? void 0 : I.y, L = ((K = H.arrow) == null ? void 0 : K.centerOffset) !== 0, [P, W] = b.useState();
|
|
13397
13398
|
return dn(() => {
|
|
13398
13399
|
y && W(window.getComputedStyle(y).zIndex);
|
|
13399
13400
|
}, [y]), /* @__PURE__ */ d.jsx(
|
|
@@ -13403,7 +13404,7 @@ var Aa = "PopperContent", [Mw, Dw] = Gd(Aa), ef = b.forwardRef(
|
|
|
13403
13404
|
"data-radix-popper-content-wrapper": "",
|
|
13404
13405
|
style: {
|
|
13405
13406
|
...q,
|
|
13406
|
-
transform:
|
|
13407
|
+
transform: Q ? q.transform : "translate(0, -200%)",
|
|
13407
13408
|
// keep off the page when measuring
|
|
13408
13409
|
minWidth: "max-content",
|
|
13409
13410
|
zIndex: P,
|
|
@@ -13427,20 +13428,20 @@ var Aa = "PopperContent", [Mw, Dw] = Gd(Aa), ef = b.forwardRef(
|
|
|
13427
13428
|
placedSide: B,
|
|
13428
13429
|
onArrowChange: S,
|
|
13429
13430
|
arrowX: A,
|
|
13430
|
-
arrowY:
|
|
13431
|
-
shouldHideArrow:
|
|
13431
|
+
arrowY: E,
|
|
13432
|
+
shouldHideArrow: L,
|
|
13432
13433
|
children: /* @__PURE__ */ d.jsx(
|
|
13433
13434
|
je.div,
|
|
13434
13435
|
{
|
|
13435
13436
|
"data-side": B,
|
|
13436
|
-
"data-align":
|
|
13437
|
+
"data-align": ne,
|
|
13437
13438
|
...g,
|
|
13438
13439
|
ref: C,
|
|
13439
13440
|
style: {
|
|
13440
13441
|
...g.style,
|
|
13441
13442
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
13442
13443
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
13443
|
-
animation:
|
|
13444
|
+
animation: Q ? void 0 : "none"
|
|
13444
13445
|
}
|
|
13445
13446
|
}
|
|
13446
13447
|
)
|
|
@@ -13618,9 +13619,9 @@ var Qw = b.forwardRef((e, t) => {
|
|
|
13618
13619
|
caller: xo
|
|
13619
13620
|
}), [y, v] = b.useState(!1), C = ht(l), R = of(n), S = b.useRef(!1), [w, T] = b.useState(0);
|
|
13620
13621
|
return b.useEffect(() => {
|
|
13621
|
-
const
|
|
13622
|
-
if (
|
|
13623
|
-
return
|
|
13622
|
+
const N = h.current;
|
|
13623
|
+
if (N)
|
|
13624
|
+
return N.addEventListener(li, C), () => N.removeEventListener(li, C);
|
|
13624
13625
|
}, [C]), /* @__PURE__ */ d.jsx(
|
|
13625
13626
|
Jw,
|
|
13626
13627
|
{
|
|
@@ -13630,16 +13631,16 @@ var Qw = b.forwardRef((e, t) => {
|
|
|
13630
13631
|
loop: o,
|
|
13631
13632
|
currentTabStopId: g,
|
|
13632
13633
|
onItemFocus: b.useCallback(
|
|
13633
|
-
(
|
|
13634
|
+
(N) => x(N),
|
|
13634
13635
|
[x]
|
|
13635
13636
|
),
|
|
13636
13637
|
onItemShiftTab: b.useCallback(() => v(!0), []),
|
|
13637
13638
|
onFocusableItemAdd: b.useCallback(
|
|
13638
|
-
() => T((
|
|
13639
|
+
() => T((N) => N + 1),
|
|
13639
13640
|
[]
|
|
13640
13641
|
),
|
|
13641
13642
|
onFocusableItemRemove: b.useCallback(
|
|
13642
|
-
() => T((
|
|
13643
|
+
() => T((N) => N - 1),
|
|
13643
13644
|
[]
|
|
13644
13645
|
),
|
|
13645
13646
|
children: /* @__PURE__ */ d.jsx(
|
|
@@ -13653,11 +13654,11 @@ var Qw = b.forwardRef((e, t) => {
|
|
|
13653
13654
|
onMouseDown: be(e.onMouseDown, () => {
|
|
13654
13655
|
S.current = !0;
|
|
13655
13656
|
}),
|
|
13656
|
-
onFocus: be(e.onFocus, (
|
|
13657
|
+
onFocus: be(e.onFocus, (N) => {
|
|
13657
13658
|
const j = !S.current;
|
|
13658
|
-
if (
|
|
13659
|
-
const
|
|
13660
|
-
if (
|
|
13659
|
+
if (N.target === N.currentTarget && j && !y) {
|
|
13660
|
+
const $ = new CustomEvent(li, Gw);
|
|
13661
|
+
if (N.currentTarget.dispatchEvent($), !$.defaultPrevented) {
|
|
13661
13662
|
const F = R().filter((X) => X.focusable), U = F.find((X) => X.active), Y = F.find((X) => X.id === g), q = [U, Y, ...F].filter(
|
|
13662
13663
|
Boolean
|
|
13663
13664
|
).map((X) => X.ref.current);
|
|
@@ -14207,10 +14208,10 @@ function H0(e) {
|
|
|
14207
14208
|
var y = No(g), v = n.current, C = "deltaX" in g ? g.deltaX : v[0] - y[0], R = "deltaY" in g ? g.deltaY : v[1] - y[1], S, w = g.target, T = Math.abs(C) > Math.abs(R) ? "h" : "v";
|
|
14208
14209
|
if ("touches" in g && T === "h" && w.type === "range")
|
|
14209
14210
|
return !1;
|
|
14210
|
-
var
|
|
14211
|
-
if (!
|
|
14211
|
+
var N = vc(T, w);
|
|
14212
|
+
if (!N)
|
|
14212
14213
|
return !0;
|
|
14213
|
-
if (
|
|
14214
|
+
if (N ? S = T : (S = T === "v" ? "h" : "v", N = vc(T, w)), !N)
|
|
14214
14215
|
return !1;
|
|
14215
14216
|
if (!r.current && "changedTouches" in g && (C || R) && (r.current = S), !S)
|
|
14216
14217
|
return !0;
|
|
@@ -14390,23 +14391,23 @@ var Bt = "MenuContent", [tS, Oa] = ir(Bt), Rf = b.forwardRef(
|
|
|
14390
14391
|
onDismiss: p,
|
|
14391
14392
|
disableOutsideScroll: m,
|
|
14392
14393
|
...g
|
|
14393
|
-
} = e, x = ar(Bt, n), y = bo(Bt, n), v = Ls(n), C = Sf(n), R = Y0(n), [S, w] = b.useState(null), T = b.useRef(null),
|
|
14394
|
+
} = e, x = ar(Bt, n), y = bo(Bt, n), v = Ls(n), C = Sf(n), R = Y0(n), [S, w] = b.useState(null), T = b.useRef(null), N = Ye(t, T, x.onContentChange), j = b.useRef(0), $ = b.useRef(""), F = b.useRef(0), U = b.useRef(null), Y = b.useRef("right"), _ = b.useRef(0), q = m ? ja : b.Fragment, X = m ? { as: oS, allowPinchZoom: !0 } : void 0, Q = (B) => {
|
|
14394
14395
|
var O, I;
|
|
14395
|
-
const
|
|
14396
|
+
const ne = $.current + B, M = R().filter((K) => !K.disabled), A = document.activeElement, E = (O = M.find((K) => K.ref.current === A)) == null ? void 0 : O.textValue, L = M.map((K) => K.textValue), P = gS(L, ne, E), W = (I = M.find((K) => K.textValue === P)) == null ? void 0 : I.ref.current;
|
|
14396
14397
|
(function K(J) {
|
|
14397
|
-
|
|
14398
|
-
})(
|
|
14398
|
+
$.current = J, window.clearTimeout(j.current), J !== "" && (j.current = window.setTimeout(() => K(""), 1e3));
|
|
14399
|
+
})(ne), W && setTimeout(() => W.focus());
|
|
14399
14400
|
};
|
|
14400
14401
|
b.useEffect(() => () => window.clearTimeout(j.current), []), Od();
|
|
14401
14402
|
const H = b.useCallback((B) => {
|
|
14402
|
-
var
|
|
14403
|
-
return Y.current === ((
|
|
14403
|
+
var M, A;
|
|
14404
|
+
return Y.current === ((M = U.current) == null ? void 0 : M.side) && yS(B, (A = U.current) == null ? void 0 : A.area);
|
|
14404
14405
|
}, []);
|
|
14405
14406
|
return /* @__PURE__ */ d.jsx(
|
|
14406
14407
|
tS,
|
|
14407
14408
|
{
|
|
14408
14409
|
scope: n,
|
|
14409
|
-
searchRef:
|
|
14410
|
+
searchRef: $,
|
|
14410
14411
|
onItemEnter: b.useCallback(
|
|
14411
14412
|
(B) => {
|
|
14412
14413
|
H(B) && B.preventDefault();
|
|
@@ -14415,8 +14416,8 @@ var Bt = "MenuContent", [tS, Oa] = ir(Bt), Rf = b.forwardRef(
|
|
|
14415
14416
|
),
|
|
14416
14417
|
onItemLeave: b.useCallback(
|
|
14417
14418
|
(B) => {
|
|
14418
|
-
var
|
|
14419
|
-
H(B) || ((
|
|
14419
|
+
var ne;
|
|
14420
|
+
H(B) || ((ne = T.current) == null || ne.focus(), w(null));
|
|
14420
14421
|
},
|
|
14421
14422
|
[H]
|
|
14422
14423
|
),
|
|
@@ -14436,8 +14437,8 @@ var Bt = "MenuContent", [tS, Oa] = ir(Bt), Rf = b.forwardRef(
|
|
|
14436
14437
|
asChild: !0,
|
|
14437
14438
|
trapped: o,
|
|
14438
14439
|
onMountAutoFocus: be(s, (B) => {
|
|
14439
|
-
var
|
|
14440
|
-
B.preventDefault(), (
|
|
14440
|
+
var ne;
|
|
14441
|
+
B.preventDefault(), (ne = T.current) == null || ne.focus({ preventScroll: !0 });
|
|
14441
14442
|
}),
|
|
14442
14443
|
onUnmountAutoFocus: i,
|
|
14443
14444
|
children: /* @__PURE__ */ d.jsx(
|
|
@@ -14474,25 +14475,25 @@ var Bt = "MenuContent", [tS, Oa] = ir(Bt), Rf = b.forwardRef(
|
|
|
14474
14475
|
dir: y.dir,
|
|
14475
14476
|
...v,
|
|
14476
14477
|
...g,
|
|
14477
|
-
ref:
|
|
14478
|
+
ref: N,
|
|
14478
14479
|
style: { outline: "none", ...g.style },
|
|
14479
14480
|
onKeyDown: be(g.onKeyDown, (B) => {
|
|
14480
|
-
const
|
|
14481
|
-
|
|
14482
|
-
const
|
|
14483
|
-
if (B.target !==
|
|
14481
|
+
const M = B.target.closest("[data-radix-menu-content]") === B.currentTarget, A = B.ctrlKey || B.altKey || B.metaKey, E = B.key.length === 1;
|
|
14482
|
+
M && (B.key === "Tab" && B.preventDefault(), !A && E && Q(B.key));
|
|
14483
|
+
const L = T.current;
|
|
14484
|
+
if (B.target !== L || !K0.includes(B.key)) return;
|
|
14484
14485
|
B.preventDefault();
|
|
14485
14486
|
const W = R().filter((O) => !O.disabled).map((O) => O.ref.current);
|
|
14486
14487
|
vf.includes(B.key) && W.reverse(), pS(W);
|
|
14487
14488
|
}),
|
|
14488
14489
|
onBlur: be(e.onBlur, (B) => {
|
|
14489
|
-
B.currentTarget.contains(B.target) || (window.clearTimeout(j.current),
|
|
14490
|
+
B.currentTarget.contains(B.target) || (window.clearTimeout(j.current), $.current = "");
|
|
14490
14491
|
}),
|
|
14491
14492
|
onPointerMove: be(
|
|
14492
14493
|
e.onPointerMove,
|
|
14493
14494
|
ro((B) => {
|
|
14494
|
-
const
|
|
14495
|
-
if (B.currentTarget.contains(
|
|
14495
|
+
const ne = B.target, M = _.current !== B.clientX;
|
|
14496
|
+
if (B.currentTarget.contains(ne) && M) {
|
|
14496
14497
|
const A = B.clientX > _.current ? "right" : "left";
|
|
14497
14498
|
Y.current = A, _.current = B.clientX;
|
|
14498
14499
|
}
|
|
@@ -15168,54 +15169,54 @@ function aC({
|
|
|
15168
15169
|
validate: g,
|
|
15169
15170
|
onValidationError: x
|
|
15170
15171
|
}) {
|
|
15171
|
-
const y = i !== void 0, [v, C] =
|
|
15172
|
-
|
|
15172
|
+
const y = i !== void 0, [v, C] = ee.useState(e), R = (y ? i : v) ?? "", [S, w] = ee.useTransition(), T = ee.useRef(null), N = ee.useRef(0), j = ee.useRef(null), $ = ee.useRef("");
|
|
15173
|
+
ee.useEffect(() => {
|
|
15173
15174
|
if (!y && (C(e ?? ""), j.current = null, T.current)) {
|
|
15174
|
-
const
|
|
15175
|
-
|
|
15175
|
+
const L = !e || e.trim() === "", P = 44;
|
|
15176
|
+
L ? T.current.style.height = `${P}px` : (T.current.style.height = "auto", T.current.style.height = `${Math.max(T.current.scrollHeight, P)}px`);
|
|
15176
15177
|
}
|
|
15177
15178
|
}, [e, t, y]);
|
|
15178
|
-
const [F, U] =
|
|
15179
|
-
(
|
|
15179
|
+
const [F, U] = ee.useState(null), Y = ee.useCallback(
|
|
15180
|
+
(L) => L.length > s ? `Message too long (${L.length}/${s} characters)` : null,
|
|
15180
15181
|
[s]
|
|
15181
|
-
), _ =
|
|
15182
|
-
(
|
|
15183
|
-
const P = _(
|
|
15184
|
-
return U(P), x == null || x(P),
|
|
15182
|
+
), _ = ee.useMemo(() => g ?? Y, [g, Y]), q = ee.useCallback(
|
|
15183
|
+
(L) => {
|
|
15184
|
+
const P = _(L);
|
|
15185
|
+
return U(P), x == null || x(P), $.current = L, P;
|
|
15185
15186
|
},
|
|
15186
15187
|
[_, x]
|
|
15187
|
-
), X =
|
|
15188
|
-
const
|
|
15189
|
-
if (!
|
|
15190
|
-
const P = !
|
|
15188
|
+
), X = ee.useCallback(() => {
|
|
15189
|
+
const L = T.current;
|
|
15190
|
+
if (!L) return;
|
|
15191
|
+
const P = !L.value || L.value.trim() === "", W = 44;
|
|
15191
15192
|
if (P) {
|
|
15192
|
-
|
|
15193
|
+
L.style.height = `${W}px`;
|
|
15193
15194
|
return;
|
|
15194
15195
|
}
|
|
15195
|
-
|
|
15196
|
-
const O = Math.max(
|
|
15197
|
-
|
|
15196
|
+
L.style.height = "auto";
|
|
15197
|
+
const O = Math.max(L.scrollHeight, W);
|
|
15198
|
+
L.style.height = `${O}px`;
|
|
15198
15199
|
}, []);
|
|
15199
|
-
|
|
15200
|
+
ee.useEffect(() => {
|
|
15200
15201
|
X();
|
|
15201
|
-
}, [X, R]),
|
|
15202
|
+
}, [X, R]), ee.useEffect(() => {
|
|
15202
15203
|
if (!F)
|
|
15203
15204
|
return;
|
|
15204
|
-
const
|
|
15205
|
-
|
|
15205
|
+
const L = (R ?? "").trim();
|
|
15206
|
+
$.current !== L && q(L);
|
|
15206
15207
|
}, [R, F, q]);
|
|
15207
|
-
const
|
|
15208
|
-
(
|
|
15209
|
-
y || C(
|
|
15208
|
+
const Q = ee.useCallback(
|
|
15209
|
+
(L, { fromUser: P }) => {
|
|
15210
|
+
y || C(L), P && (a == null || a(L));
|
|
15210
15211
|
},
|
|
15211
15212
|
[y, a]
|
|
15212
|
-
), H =
|
|
15213
|
-
async (
|
|
15214
|
-
|
|
15213
|
+
), H = ee.useCallback(
|
|
15214
|
+
async (L) => {
|
|
15215
|
+
L && L.preventDefault();
|
|
15215
15216
|
const P = (R ?? "").trim();
|
|
15216
15217
|
if (!P && !p || q(P))
|
|
15217
15218
|
return;
|
|
15218
|
-
const W = ++
|
|
15219
|
+
const W = ++N.current;
|
|
15219
15220
|
j.current = {
|
|
15220
15221
|
id: W,
|
|
15221
15222
|
shouldClear: !0
|
|
@@ -15236,15 +15237,15 @@ function aC({
|
|
|
15236
15237
|
});
|
|
15237
15238
|
},
|
|
15238
15239
|
[R, c, p, y, a, q]
|
|
15239
|
-
), B =
|
|
15240
|
-
const P =
|
|
15241
|
-
|
|
15242
|
-
}, [
|
|
15243
|
-
(
|
|
15244
|
-
|
|
15240
|
+
), B = ee.useCallback((L) => {
|
|
15241
|
+
const P = L.target.value;
|
|
15242
|
+
Q(P, { fromUser: !0 }), j.current && (j.current.shouldClear = !1), T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`), F && q(P.trim());
|
|
15243
|
+
}, [Q, q, F]), ne = ee.useCallback(
|
|
15244
|
+
(L) => {
|
|
15245
|
+
L.key === "Enter" && !L.shiftKey ? (L.preventDefault(), H()) : L.key === "Escape" && t && (L.preventDefault(), l == null || l());
|
|
15245
15246
|
},
|
|
15246
15247
|
[H, t, l]
|
|
15247
|
-
),
|
|
15248
|
+
), E = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${h}`;
|
|
15248
15249
|
return /* @__PURE__ */ d.jsx("div", { className: `w-full ${f}`, children: /* @__PURE__ */ d.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
15249
15250
|
/* @__PURE__ */ d.jsxs("div", { className: "flex-1", children: [
|
|
15250
15251
|
/* @__PURE__ */ d.jsx(
|
|
@@ -15253,9 +15254,9 @@ function aC({
|
|
|
15253
15254
|
ref: T,
|
|
15254
15255
|
value: R,
|
|
15255
15256
|
onChange: B,
|
|
15256
|
-
onKeyDown:
|
|
15257
|
+
onKeyDown: ne,
|
|
15257
15258
|
placeholder: t ? "Edit your message..." : n,
|
|
15258
|
-
className:
|
|
15259
|
+
className: E,
|
|
15259
15260
|
disabled: o,
|
|
15260
15261
|
maxLength: s,
|
|
15261
15262
|
rows: 1,
|
|
@@ -15283,7 +15284,7 @@ function aC({
|
|
|
15283
15284
|
Le,
|
|
15284
15285
|
{
|
|
15285
15286
|
type: "button",
|
|
15286
|
-
onClick: (
|
|
15287
|
+
onClick: (L) => void H(L),
|
|
15287
15288
|
size: "icon",
|
|
15288
15289
|
className: `shrink-0 ${m ?? ""}`,
|
|
15289
15290
|
title: t ? "Save changes" : "Send message",
|
|
@@ -15293,7 +15294,7 @@ function aC({
|
|
|
15293
15294
|
) })
|
|
15294
15295
|
] }) });
|
|
15295
15296
|
}
|
|
15296
|
-
const lC =
|
|
15297
|
+
const lC = ee.memo(aC);
|
|
15297
15298
|
function ph({
|
|
15298
15299
|
composerValue: e,
|
|
15299
15300
|
onComposerChange: t,
|
|
@@ -15315,8 +15316,8 @@ function ph({
|
|
|
15315
15316
|
allowEmptySend: y = !1,
|
|
15316
15317
|
inputError: v = null
|
|
15317
15318
|
}) {
|
|
15318
|
-
const [C, R] = fe([]), S = Te(null), w = Te(null), [T,
|
|
15319
|
-
S.current && (S.current.value = ""), w.current && (w.current.value = ""),
|
|
15319
|
+
const [C, R] = fe([]), S = Te(null), w = Te(null), [T, N] = fe(0), [j, $] = fe(0), [F, U] = fe(!1), [Y, _] = fe(null), [q, X] = fe(null), Q = ie(() => {
|
|
15320
|
+
S.current && (S.current.value = ""), w.current && (w.current.value = ""), N((P) => P + 1), $((P) => P + 1);
|
|
15320
15321
|
}, []), H = ie((P) => {
|
|
15321
15322
|
R((W) => {
|
|
15322
15323
|
const O = [...W, ...P];
|
|
@@ -15328,12 +15329,12 @@ function ph({
|
|
|
15328
15329
|
H(W), P.target.value = "";
|
|
15329
15330
|
},
|
|
15330
15331
|
[H]
|
|
15331
|
-
),
|
|
15332
|
+
), ne = ie((P) => {
|
|
15332
15333
|
R((W) => {
|
|
15333
15334
|
const O = W.filter((I, K) => K !== P);
|
|
15334
|
-
return O.length === 0 &&
|
|
15335
|
+
return O.length === 0 && Q(), g == null || g(O), O;
|
|
15335
15336
|
});
|
|
15336
|
-
}, [g,
|
|
15337
|
+
}, [g, Q]), M = ie(
|
|
15337
15338
|
async (P) => {
|
|
15338
15339
|
const W = (P.target.files || [])[0];
|
|
15339
15340
|
if (W && (_(null), X(null), !!m)) {
|
|
@@ -15344,18 +15345,18 @@ function ph({
|
|
|
15344
15345
|
const I = O instanceof Error ? O.message : "Failed to upload Excel file";
|
|
15345
15346
|
X(I), x == null || x(I);
|
|
15346
15347
|
} finally {
|
|
15347
|
-
U(!1), P.target.value = "",
|
|
15348
|
+
U(!1), P.target.value = "", Q();
|
|
15348
15349
|
}
|
|
15349
15350
|
}
|
|
15350
15351
|
},
|
|
15351
|
-
[m, x,
|
|
15352
|
-
), A = Ne(() => y || C.length > 0, [y, C]),
|
|
15352
|
+
[m, x, Q]
|
|
15353
|
+
), A = Ne(() => y || C.length > 0, [y, C]), E = ie(
|
|
15353
15354
|
async (P) => {
|
|
15354
15355
|
const O = await n(P, C);
|
|
15355
|
-
return C.length > 0 && (R([]), g == null || g([]),
|
|
15356
|
+
return C.length > 0 && (R([]), g == null || g([]), Q()), O;
|
|
15356
15357
|
},
|
|
15357
|
-
[n,
|
|
15358
|
-
),
|
|
15358
|
+
[n, Q, C]
|
|
15359
|
+
), L = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${s ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${v ? "border-red-400" : ""} ${f.textarea || ""} ${u}`;
|
|
15359
15360
|
return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
15360
15361
|
(h || p) && /* @__PURE__ */ d.jsxs("div", { className: "mb-3 space-y-3", children: [
|
|
15361
15362
|
h && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
@@ -15382,7 +15383,7 @@ function ph({
|
|
|
15382
15383
|
{
|
|
15383
15384
|
variant: "ghost",
|
|
15384
15385
|
size: "sm",
|
|
15385
|
-
onClick: () =>
|
|
15386
|
+
onClick: () => ne(W),
|
|
15386
15387
|
className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
|
|
15387
15388
|
"aria-label": `Remove ${P.name}`,
|
|
15388
15389
|
children: /* @__PURE__ */ d.jsx(Jo, { size: 12 })
|
|
@@ -15400,7 +15401,7 @@ function ph({
|
|
|
15400
15401
|
ref: w,
|
|
15401
15402
|
type: "file",
|
|
15402
15403
|
accept: ".xls,.xlsx,.xlsm",
|
|
15403
|
-
onChange:
|
|
15404
|
+
onChange: M,
|
|
15404
15405
|
className: "hidden"
|
|
15405
15406
|
},
|
|
15406
15407
|
j
|
|
@@ -15468,18 +15469,18 @@ function ph({
|
|
|
15468
15469
|
placeholder: s ? "Edit your message..." : a,
|
|
15469
15470
|
isStreaming: c,
|
|
15470
15471
|
disabled: l,
|
|
15471
|
-
onSend:
|
|
15472
|
+
onSend: E,
|
|
15472
15473
|
onCancelEdit: r,
|
|
15473
15474
|
onStop: o,
|
|
15474
15475
|
allowEmptySend: A,
|
|
15475
|
-
textareaClassName:
|
|
15476
|
+
textareaClassName: L,
|
|
15476
15477
|
sendButtonClassName: f.sendButton
|
|
15477
15478
|
}
|
|
15478
15479
|
) })
|
|
15479
15480
|
] })
|
|
15480
15481
|
] });
|
|
15481
15482
|
}
|
|
15482
|
-
|
|
15483
|
+
ee.memo(ph);
|
|
15483
15484
|
function cC({
|
|
15484
15485
|
submit: e,
|
|
15485
15486
|
chatRequest: t,
|
|
@@ -15495,37 +15496,37 @@ function cC({
|
|
|
15495
15496
|
onEvent: f,
|
|
15496
15497
|
activeThreadId: h
|
|
15497
15498
|
}) {
|
|
15498
|
-
const { messages: p } = ku(), [m, g] = fe(null), [x, y] = fe(""), [v, C] = fe(null), [R, S] = fe(null), [w, T] = fe(!1), [
|
|
15499
|
+
const { messages: p } = ku(), [m, g] = fe(null), [x, y] = fe(""), [v, C] = fe(null), [R, S] = fe(null), [w, T] = fe(!1), [N, j] = fe(""), $ = Te(N), F = Te(null);
|
|
15499
15500
|
Be(() => {
|
|
15500
15501
|
if (!m)
|
|
15501
15502
|
if (h) {
|
|
15502
|
-
const
|
|
15503
|
-
j(
|
|
15503
|
+
const M = localStorage.getItem(Js(h));
|
|
15504
|
+
j(M || "");
|
|
15504
15505
|
} else
|
|
15505
15506
|
j("");
|
|
15506
15507
|
}, [h, m]);
|
|
15507
|
-
const U = ie((
|
|
15508
|
-
j(
|
|
15508
|
+
const U = ie((M) => {
|
|
15509
|
+
j(M), !m && h && localStorage.setItem(Js(h), M);
|
|
15509
15510
|
}, [h, m]);
|
|
15510
15511
|
Be(() => {
|
|
15511
|
-
|
|
15512
|
-
}, [
|
|
15512
|
+
$.current = N;
|
|
15513
|
+
}, [N]), Be(() => {
|
|
15513
15514
|
if (!m) {
|
|
15514
15515
|
F.current = null;
|
|
15515
15516
|
return;
|
|
15516
15517
|
}
|
|
15517
|
-
F.current === null && (F.current =
|
|
15518
|
+
F.current === null && (F.current = $.current), U(x ?? "");
|
|
15518
15519
|
}, [x, m, U]);
|
|
15519
15520
|
const Y = ie(
|
|
15520
|
-
(
|
|
15521
|
-
U(
|
|
15521
|
+
(M) => {
|
|
15522
|
+
U(M);
|
|
15522
15523
|
},
|
|
15523
15524
|
[U]
|
|
15524
|
-
), _ = async (
|
|
15525
|
-
const
|
|
15526
|
-
if (!(!W &&
|
|
15525
|
+
), _ = async (M, A) => {
|
|
15526
|
+
const E = Array.isArray(A) ? { files: A } : A ?? {}, L = E.files ?? [], P = E.contentParts ?? [], W = M.trim();
|
|
15527
|
+
if (!(!W && L.length === 0 && P.length === 0))
|
|
15527
15528
|
try {
|
|
15528
|
-
const O =
|
|
15529
|
+
const O = L.map(async (Ce) => {
|
|
15529
15530
|
try {
|
|
15530
15531
|
const Pe = await fu.uploadFile(Ce);
|
|
15531
15532
|
return { file: Ce, record: Pe };
|
|
@@ -15566,13 +15567,13 @@ function cC({
|
|
|
15566
15567
|
const I = (O == null ? void 0 : O.message) || "Failed to send message";
|
|
15567
15568
|
S(I), i == null || i(I), l(!1);
|
|
15568
15569
|
}
|
|
15569
|
-
}, q = (
|
|
15570
|
-
A || _(
|
|
15570
|
+
}, q = (M, A) => {
|
|
15571
|
+
A || _(M, { files: [] });
|
|
15571
15572
|
}, X = ie(
|
|
15572
|
-
async (
|
|
15573
|
+
async (M) => {
|
|
15573
15574
|
await e(
|
|
15574
15575
|
{
|
|
15575
|
-
attachments: [
|
|
15576
|
+
attachments: [M],
|
|
15576
15577
|
payload: t.payload
|
|
15577
15578
|
},
|
|
15578
15579
|
{
|
|
@@ -15582,34 +15583,34 @@ function cC({
|
|
|
15582
15583
|
config: t.config,
|
|
15583
15584
|
onEvent: f
|
|
15584
15585
|
}
|
|
15585
|
-
), s == null || s({ file:
|
|
15586
|
+
), s == null || s({ file: M });
|
|
15586
15587
|
},
|
|
15587
15588
|
[n, r, t, s, e]
|
|
15588
|
-
),
|
|
15589
|
-
(
|
|
15590
|
-
a && (F.current =
|
|
15591
|
-
checkpointId: (
|
|
15592
|
-
checkpointNs: (
|
|
15589
|
+
), Q = ie(
|
|
15590
|
+
(M, A, E) => {
|
|
15591
|
+
a && (F.current = N, g(M), y(A), C({
|
|
15592
|
+
checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
|
|
15593
|
+
checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
|
|
15593
15594
|
}), S(null));
|
|
15594
15595
|
},
|
|
15595
|
-
[
|
|
15596
|
+
[N, a]
|
|
15596
15597
|
), H = ie(() => {
|
|
15597
15598
|
g(null), y(""), C(null), S(null);
|
|
15598
|
-
const
|
|
15599
|
-
|
|
15600
|
-
}, []), B = ie((
|
|
15599
|
+
const M = F.current;
|
|
15600
|
+
M !== null && j(M), F.current = null;
|
|
15601
|
+
}, []), B = ie((M) => {
|
|
15601
15602
|
let A = null;
|
|
15602
|
-
for (let W =
|
|
15603
|
+
for (let W = M - 1; W >= 0; W--)
|
|
15603
15604
|
if (c[W].role === "user") {
|
|
15604
15605
|
A = c[W];
|
|
15605
15606
|
break;
|
|
15606
15607
|
}
|
|
15607
15608
|
if (!A) return;
|
|
15608
|
-
const
|
|
15609
|
+
const E = Array.isArray(A.content) ? A.content : [], P = E.filter((W) => (W == null ? void 0 : W.type) === "text").map((W) => W.text).join("") || (() => {
|
|
15609
15610
|
try {
|
|
15610
|
-
return JSON.stringify(
|
|
15611
|
+
return JSON.stringify(E, null, 2);
|
|
15611
15612
|
} catch {
|
|
15612
|
-
return String(
|
|
15613
|
+
return String(E);
|
|
15613
15614
|
}
|
|
15614
15615
|
})();
|
|
15615
15616
|
P && e(
|
|
@@ -15631,12 +15632,12 @@ function cC({
|
|
|
15631
15632
|
setInputError: S,
|
|
15632
15633
|
dismissError: w,
|
|
15633
15634
|
setDismissError: T,
|
|
15634
|
-
composerValue:
|
|
15635
|
+
composerValue: N,
|
|
15635
15636
|
handleComposerChange: Y,
|
|
15636
15637
|
handleSendMessage: _,
|
|
15637
15638
|
handleQuickPrompt: q,
|
|
15638
15639
|
handleExcelUpload: X,
|
|
15639
|
-
startEditing:
|
|
15640
|
+
startEditing: Q,
|
|
15640
15641
|
cancelEditing: H,
|
|
15641
15642
|
handleRegenerateCb: B,
|
|
15642
15643
|
displayMessages: p
|
|
@@ -15679,7 +15680,7 @@ function Go({
|
|
|
15679
15680
|
},
|
|
15680
15681
|
// Handled by stream state
|
|
15681
15682
|
activeThreadId: R ?? null
|
|
15682
|
-
}),
|
|
15683
|
+
}), N = ((I = S.metadata) == null ? void 0 : I.assemblingMessageId) ?? null, j = S.interrupt, $ = j ? xu(j.id) : null, F = $ !== null ? { type: "interrupt", id: $ } : null, [U, Y] = fe(!1), [_, q] = fe("desktop"), [X, Q] = fe(!1), H = Te(null);
|
|
15683
15684
|
Be(() => {
|
|
15684
15685
|
const J = () => {
|
|
15685
15686
|
const se = window.innerWidth;
|
|
@@ -15698,10 +15699,10 @@ function Go({
|
|
|
15698
15699
|
}
|
|
15699
15700
|
},
|
|
15700
15701
|
[S]
|
|
15701
|
-
),
|
|
15702
|
+
), ne = ie(
|
|
15702
15703
|
async (J) => {
|
|
15703
15704
|
var se, ge;
|
|
15704
|
-
|
|
15705
|
+
Q(!0);
|
|
15705
15706
|
try {
|
|
15706
15707
|
if (!J)
|
|
15707
15708
|
await S.returnToLatest(), (se = H.current) == null || se.scrollToLatest();
|
|
@@ -15710,21 +15711,21 @@ function Go({
|
|
|
15710
15711
|
await S.navigateToCheckpoint(J, (Ce == null ? void 0 : Ce.checkpointNs) ?? null), (ge = H.current) == null || ge.scrollToTop();
|
|
15711
15712
|
}
|
|
15712
15713
|
} finally {
|
|
15713
|
-
|
|
15714
|
+
Q(!1);
|
|
15714
15715
|
}
|
|
15715
15716
|
},
|
|
15716
15717
|
[S]
|
|
15717
|
-
),
|
|
15718
|
+
), M = l ?? {
|
|
15718
15719
|
toolRenderers: u,
|
|
15719
15720
|
toolArtifactRenderers: f,
|
|
15720
15721
|
getToolExpandable: (J) => J.name !== "ask_user_choice"
|
|
15721
|
-
}, A = !!j || U,
|
|
15722
|
-
return /* @__PURE__ */ d.jsxs("div", { className:
|
|
15722
|
+
}, A = !!j || U, E = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${p.container || ""}`, L = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 ${j ? "pb-32" : ""} bg-transparent ${p.messagesArea || ""}`, P = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${p.inputArea || ""}`;
|
|
15723
|
+
return /* @__PURE__ */ d.jsxs("div", { className: E, children: [
|
|
15723
15724
|
!!w.error && !T.dismissError && /* @__PURE__ */ d.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
|
|
15724
15725
|
/* @__PURE__ */ d.jsx("span", { children: w.error }),
|
|
15725
15726
|
/* @__PURE__ */ d.jsx(Le, { variant: "ghost", size: "sm", onClick: () => T.setDismissError(!0), className: "text-red-800 hover:bg-red-100", children: /* @__PURE__ */ d.jsx(Jo, { size: 16 }) })
|
|
15726
15727
|
] }),
|
|
15727
|
-
/* @__PURE__ */ d.jsxs("div", { className: `relative ${
|
|
15728
|
+
/* @__PURE__ */ d.jsxs("div", { className: `relative ${L}`, style: n ? { maxHeight: n } : void 0, children: [
|
|
15728
15729
|
/* @__PURE__ */ d.jsx(
|
|
15729
15730
|
Ad,
|
|
15730
15731
|
{
|
|
@@ -15733,7 +15734,7 @@ function Go({
|
|
|
15733
15734
|
style: { height: "100%" },
|
|
15734
15735
|
messages: T.displayMessages ?? S.messages,
|
|
15735
15736
|
isStreaming: w.isStreaming,
|
|
15736
|
-
streamingAssistantId:
|
|
15737
|
+
streamingAssistantId: N,
|
|
15737
15738
|
streamingDebounceMs: r,
|
|
15738
15739
|
followNewMessages: o,
|
|
15739
15740
|
layoutSize: _,
|
|
@@ -15745,10 +15746,10 @@ function Go({
|
|
|
15745
15746
|
emptyMessage: C,
|
|
15746
15747
|
isNavigatingCheckpoint: X,
|
|
15747
15748
|
showToolMessages: c,
|
|
15748
|
-
toolConfig:
|
|
15749
|
+
toolConfig: M,
|
|
15749
15750
|
checkpointIndex: S.checkpointIndex,
|
|
15750
15751
|
activeCheckpointId: (K = S.checkpoint) == null ? void 0 : K.id,
|
|
15751
|
-
onSelectCheckpoint:
|
|
15752
|
+
onSelectCheckpoint: ne,
|
|
15752
15753
|
showThinkingIndicator: w.isStreaming,
|
|
15753
15754
|
getMessageCustomStyles: m,
|
|
15754
15755
|
getInterruptOptions: () => {
|
|
@@ -16053,8 +16054,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16053
16054
|
}, [r, e, t]), null;
|
|
16054
16055
|
}, jh = xh, _h = vh, Wa = wh, Va = Sh, Vr = Th, Ph = Rh, AC = Eh, $r = '[cmdk-group=""]', mi = '[cmdk-group-items=""]', NC = '[cmdk-group-heading=""]', Oh = '[cmdk-item=""]', Rc = `${Oh}:not([aria-disabled="true"])`, Ui = "cmdk-item-select", fr = "data-value", jC = (e, t, n) => yC(e, t, n), Mh = b.createContext(void 0), vo = () => b.useContext(Mh), Dh = b.createContext(void 0), Ka = () => b.useContext(Dh), Lh = b.createContext(void 0), $h = b.forwardRef((e, t) => {
|
|
16055
16056
|
let n = hr(() => {
|
|
16056
|
-
var A,
|
|
16057
|
-
return { search: "", value: (
|
|
16057
|
+
var A, E;
|
|
16058
|
+
return { search: "", value: (E = (A = e.value) != null ? A : e.defaultValue) != null ? E : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
16058
16059
|
}), r = hr(() => /* @__PURE__ */ new Set()), o = hr(() => /* @__PURE__ */ new Map()), s = hr(() => /* @__PURE__ */ new Map()), i = hr(() => /* @__PURE__ */ new Set()), a = Fh(e), { label: c, children: l, value: u, onValueChange: f, filter: h, shouldFilter: p, loop: m, disablePointerSelection: g = !1, vimBindings: x = !0, ...y } = e, v = Pt(), C = Pt(), R = Pt(), S = b.useRef(null), w = HC();
|
|
16059
16060
|
tr(() => {
|
|
16060
16061
|
if (u !== void 0) {
|
|
@@ -16064,10 +16065,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16064
16065
|
}, [u]), tr(() => {
|
|
16065
16066
|
w(6, Y);
|
|
16066
16067
|
}, []);
|
|
16067
|
-
let T = b.useMemo(() => ({ subscribe: (A) => (i.current.add(A), () => i.current.delete(A)), snapshot: () => n.current, setState: (A,
|
|
16068
|
+
let T = b.useMemo(() => ({ subscribe: (A) => (i.current.add(A), () => i.current.delete(A)), snapshot: () => n.current, setState: (A, E, L) => {
|
|
16068
16069
|
var P, W, O, I;
|
|
16069
|
-
if (!Object.is(n.current[A],
|
|
16070
|
-
if (n.current[A] =
|
|
16070
|
+
if (!Object.is(n.current[A], E)) {
|
|
16071
|
+
if (n.current[A] = E, A === "search") U(), $(), w(1, F);
|
|
16071
16072
|
else if (A === "value") {
|
|
16072
16073
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
16073
16074
|
let K = document.getElementById(R);
|
|
@@ -16076,8 +16077,8 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16076
16077
|
if (w(7, () => {
|
|
16077
16078
|
var K;
|
|
16078
16079
|
n.current.selectedItemId = (K = _()) == null ? void 0 : K.id, T.emit();
|
|
16079
|
-
}),
|
|
16080
|
-
let K =
|
|
16080
|
+
}), L || w(5, Y), ((W = a.current) == null ? void 0 : W.value) !== void 0) {
|
|
16081
|
+
let K = E ?? "";
|
|
16081
16082
|
(I = (O = a.current).onValueChange) == null || I.call(O, K);
|
|
16082
16083
|
return;
|
|
16083
16084
|
}
|
|
@@ -16086,57 +16087,57 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16086
16087
|
}
|
|
16087
16088
|
}, emit: () => {
|
|
16088
16089
|
i.current.forEach((A) => A());
|
|
16089
|
-
} }), []),
|
|
16090
|
+
} }), []), N = b.useMemo(() => ({ value: (A, E, L) => {
|
|
16090
16091
|
var P;
|
|
16091
|
-
|
|
16092
|
-
|
|
16092
|
+
E !== ((P = s.current.get(A)) == null ? void 0 : P.value) && (s.current.set(A, { value: E, keywords: L }), n.current.filtered.items.set(A, j(E, L)), w(2, () => {
|
|
16093
|
+
$(), T.emit();
|
|
16093
16094
|
}));
|
|
16094
|
-
}, item: (A,
|
|
16095
|
-
U(),
|
|
16095
|
+
}, item: (A, E) => (r.current.add(A), E && (o.current.has(E) ? o.current.get(E).add(A) : o.current.set(E, /* @__PURE__ */ new Set([A]))), w(3, () => {
|
|
16096
|
+
U(), $(), n.current.value || F(), T.emit();
|
|
16096
16097
|
}), () => {
|
|
16097
16098
|
s.current.delete(A), r.current.delete(A), n.current.filtered.items.delete(A);
|
|
16098
|
-
let
|
|
16099
|
+
let L = _();
|
|
16099
16100
|
w(4, () => {
|
|
16100
|
-
U(), (
|
|
16101
|
+
U(), (L == null ? void 0 : L.getAttribute("id")) === A && F(), T.emit();
|
|
16101
16102
|
});
|
|
16102
16103
|
}), group: (A) => (o.current.has(A) || o.current.set(A, /* @__PURE__ */ new Set()), () => {
|
|
16103
16104
|
s.current.delete(A), o.current.delete(A);
|
|
16104
16105
|
}), filter: () => a.current.shouldFilter, label: c || e["aria-label"], getDisablePointerSelection: () => a.current.disablePointerSelection, listId: v, inputId: R, labelId: C, listInnerRef: S }), []);
|
|
16105
|
-
function j(A,
|
|
16106
|
-
var
|
|
16107
|
-
let W = (P = (
|
|
16108
|
-
return A ? W(A, n.current.search,
|
|
16106
|
+
function j(A, E) {
|
|
16107
|
+
var L, P;
|
|
16108
|
+
let W = (P = (L = a.current) == null ? void 0 : L.filter) != null ? P : jC;
|
|
16109
|
+
return A ? W(A, n.current.search, E) : 0;
|
|
16109
16110
|
}
|
|
16110
|
-
function
|
|
16111
|
+
function $() {
|
|
16111
16112
|
if (!n.current.search || a.current.shouldFilter === !1) return;
|
|
16112
|
-
let A = n.current.filtered.items,
|
|
16113
|
+
let A = n.current.filtered.items, E = [];
|
|
16113
16114
|
n.current.filtered.groups.forEach((P) => {
|
|
16114
16115
|
let W = o.current.get(P), O = 0;
|
|
16115
16116
|
W.forEach((I) => {
|
|
16116
16117
|
let K = A.get(I);
|
|
16117
16118
|
O = Math.max(K, O);
|
|
16118
|
-
}),
|
|
16119
|
+
}), E.push([P, O]);
|
|
16119
16120
|
});
|
|
16120
|
-
let
|
|
16121
|
+
let L = S.current;
|
|
16121
16122
|
q().sort((P, W) => {
|
|
16122
16123
|
var O, I;
|
|
16123
16124
|
let K = P.getAttribute("id"), J = W.getAttribute("id");
|
|
16124
16125
|
return ((O = A.get(J)) != null ? O : 0) - ((I = A.get(K)) != null ? I : 0);
|
|
16125
16126
|
}).forEach((P) => {
|
|
16126
16127
|
let W = P.closest(mi);
|
|
16127
|
-
W ? W.appendChild(P.parentElement === W ? P : P.closest(`${mi} > *`)) :
|
|
16128
|
-
}),
|
|
16128
|
+
W ? W.appendChild(P.parentElement === W ? P : P.closest(`${mi} > *`)) : L.appendChild(P.parentElement === L ? P : P.closest(`${mi} > *`));
|
|
16129
|
+
}), E.sort((P, W) => W[1] - P[1]).forEach((P) => {
|
|
16129
16130
|
var W;
|
|
16130
16131
|
let O = (W = S.current) == null ? void 0 : W.querySelector(`${$r}[${fr}="${encodeURIComponent(P[0])}"]`);
|
|
16131
16132
|
O == null || O.parentElement.appendChild(O);
|
|
16132
16133
|
});
|
|
16133
16134
|
}
|
|
16134
16135
|
function F() {
|
|
16135
|
-
let A = q().find((
|
|
16136
|
-
T.setState("value",
|
|
16136
|
+
let A = q().find((L) => L.getAttribute("aria-disabled") !== "true"), E = A == null ? void 0 : A.getAttribute(fr);
|
|
16137
|
+
T.setState("value", E || void 0);
|
|
16137
16138
|
}
|
|
16138
16139
|
function U() {
|
|
16139
|
-
var A,
|
|
16140
|
+
var A, E, L, P;
|
|
16140
16141
|
if (!n.current.search || a.current.shouldFilter === !1) {
|
|
16141
16142
|
n.current.filtered.count = r.current.size;
|
|
16142
16143
|
return;
|
|
@@ -16144,7 +16145,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16144
16145
|
n.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
16145
16146
|
let W = 0;
|
|
16146
16147
|
for (let O of r.current) {
|
|
16147
|
-
let I = (
|
|
16148
|
+
let I = (E = (A = s.current.get(O)) == null ? void 0 : A.value) != null ? E : "", K = (P = (L = s.current.get(O)) == null ? void 0 : L.keywords) != null ? P : [], J = j(I, K);
|
|
16148
16149
|
n.current.filtered.items.set(O, J), J > 0 && W++;
|
|
16149
16150
|
}
|
|
16150
16151
|
for (let [O, I] of o.current) for (let K of I) if (n.current.filtered.items.get(K) > 0) {
|
|
@@ -16154,9 +16155,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16154
16155
|
n.current.filtered.count = W;
|
|
16155
16156
|
}
|
|
16156
16157
|
function Y() {
|
|
16157
|
-
var A,
|
|
16158
|
+
var A, E, L;
|
|
16158
16159
|
let P = _();
|
|
16159
|
-
P && (((A = P.parentElement) == null ? void 0 : A.firstChild) === P && ((
|
|
16160
|
+
P && (((A = P.parentElement) == null ? void 0 : A.firstChild) === P && ((L = (E = P.closest($r)) == null ? void 0 : E.querySelector(NC)) == null || L.scrollIntoView({ block: "nearest" })), P.scrollIntoView({ block: "nearest" }));
|
|
16160
16161
|
}
|
|
16161
16162
|
function _() {
|
|
16162
16163
|
var A;
|
|
@@ -16167,45 +16168,45 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16167
16168
|
return Array.from(((A = S.current) == null ? void 0 : A.querySelectorAll(Rc)) || []);
|
|
16168
16169
|
}
|
|
16169
16170
|
function X(A) {
|
|
16170
|
-
let
|
|
16171
|
-
|
|
16171
|
+
let E = q()[A];
|
|
16172
|
+
E && T.setState("value", E.getAttribute(fr));
|
|
16172
16173
|
}
|
|
16173
|
-
function
|
|
16174
|
-
var
|
|
16175
|
-
let
|
|
16176
|
-
(
|
|
16174
|
+
function Q(A) {
|
|
16175
|
+
var E;
|
|
16176
|
+
let L = _(), P = q(), W = P.findIndex((I) => I === L), O = P[W + A];
|
|
16177
|
+
(E = a.current) != null && E.loop && (O = W + A < 0 ? P[P.length - 1] : W + A === P.length ? P[0] : P[W + A]), O && T.setState("value", O.getAttribute(fr));
|
|
16177
16178
|
}
|
|
16178
16179
|
function H(A) {
|
|
16179
|
-
let
|
|
16180
|
-
for (;
|
|
16181
|
-
P ? T.setState("value", P.getAttribute(fr)) :
|
|
16182
|
-
}
|
|
16183
|
-
let B = () => X(q().length - 1),
|
|
16184
|
-
A.preventDefault(), A.metaKey ? B() : A.altKey ? H(1) :
|
|
16185
|
-
},
|
|
16186
|
-
A.preventDefault(), A.metaKey ? X(0) : A.altKey ? H(-1) :
|
|
16180
|
+
let E = _(), L = E == null ? void 0 : E.closest($r), P;
|
|
16181
|
+
for (; L && !P; ) L = A > 0 ? zC(L, $r) : BC(L, $r), P = L == null ? void 0 : L.querySelector(Rc);
|
|
16182
|
+
P ? T.setState("value", P.getAttribute(fr)) : Q(A);
|
|
16183
|
+
}
|
|
16184
|
+
let B = () => X(q().length - 1), ne = (A) => {
|
|
16185
|
+
A.preventDefault(), A.metaKey ? B() : A.altKey ? H(1) : Q(1);
|
|
16186
|
+
}, M = (A) => {
|
|
16187
|
+
A.preventDefault(), A.metaKey ? X(0) : A.altKey ? H(-1) : Q(-1);
|
|
16187
16188
|
};
|
|
16188
16189
|
return b.createElement(je.div, { ref: t, tabIndex: -1, ...y, "cmdk-root": "", onKeyDown: (A) => {
|
|
16189
|
-
var
|
|
16190
|
-
(
|
|
16191
|
-
let
|
|
16192
|
-
if (!(A.defaultPrevented ||
|
|
16190
|
+
var E;
|
|
16191
|
+
(E = y.onKeyDown) == null || E.call(y, A);
|
|
16192
|
+
let L = A.nativeEvent.isComposing || A.keyCode === 229;
|
|
16193
|
+
if (!(A.defaultPrevented || L)) switch (A.key) {
|
|
16193
16194
|
case "n":
|
|
16194
16195
|
case "j": {
|
|
16195
|
-
x && A.ctrlKey &&
|
|
16196
|
+
x && A.ctrlKey && ne(A);
|
|
16196
16197
|
break;
|
|
16197
16198
|
}
|
|
16198
16199
|
case "ArrowDown": {
|
|
16199
|
-
|
|
16200
|
+
ne(A);
|
|
16200
16201
|
break;
|
|
16201
16202
|
}
|
|
16202
16203
|
case "p":
|
|
16203
16204
|
case "k": {
|
|
16204
|
-
x && A.ctrlKey &&
|
|
16205
|
+
x && A.ctrlKey && M(A);
|
|
16205
16206
|
break;
|
|
16206
16207
|
}
|
|
16207
16208
|
case "ArrowUp": {
|
|
16208
|
-
|
|
16209
|
+
M(A);
|
|
16209
16210
|
break;
|
|
16210
16211
|
}
|
|
16211
16212
|
case "Home": {
|
|
@@ -16225,7 +16226,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
16225
16226
|
}
|
|
16226
16227
|
}
|
|
16227
16228
|
}
|
|
16228
|
-
} }, b.createElement("label", { "cmdk-label": "", htmlFor:
|
|
16229
|
+
} }, b.createElement("label", { "cmdk-label": "", htmlFor: N.inputId, id: N.labelId, style: WC }, c), Hs(e, (A) => b.createElement(Dh.Provider, { value: T }, b.createElement(Mh.Provider, { value: N }, A))));
|
|
16229
16230
|
}), _C = b.forwardRef((e, t) => {
|
|
16230
16231
|
var n, r;
|
|
16231
16232
|
let o = Pt(), s = b.useRef(null), i = b.useContext(Lh), a = vo(), c = Fh(e), l = (r = (n = c.current) == null ? void 0 : n.forceMount) != null ? r : i == null ? void 0 : i.forceMount;
|
|
@@ -16522,13 +16523,13 @@ var qa = "ScrollArea", [Jh, ak] = Dn(qa), [JC, Ht] = Jh(qa), Zh = b.forwardRef(
|
|
|
16522
16523
|
dir: o,
|
|
16523
16524
|
scrollHideDelay: s = 600,
|
|
16524
16525
|
...i
|
|
16525
|
-
} = e, [a, c] = b.useState(null), [l, u] = b.useState(null), [f, h] = b.useState(null), [p, m] = b.useState(null), [g, x] = b.useState(null), [y, v] = b.useState(0), [C, R] = b.useState(0), [S, w] = b.useState(!1), [T,
|
|
16526
|
+
} = e, [a, c] = b.useState(null), [l, u] = b.useState(null), [f, h] = b.useState(null), [p, m] = b.useState(null), [g, x] = b.useState(null), [y, v] = b.useState(0), [C, R] = b.useState(0), [S, w] = b.useState(!1), [T, N] = b.useState(!1), j = Ye(t, (F) => c(F)), $ = ba(o);
|
|
16526
16527
|
return /* @__PURE__ */ d.jsx(
|
|
16527
16528
|
JC,
|
|
16528
16529
|
{
|
|
16529
16530
|
scope: n,
|
|
16530
16531
|
type: r,
|
|
16531
|
-
dir:
|
|
16532
|
+
dir: $,
|
|
16532
16533
|
scrollHideDelay: s,
|
|
16533
16534
|
scrollArea: a,
|
|
16534
16535
|
viewport: l,
|
|
@@ -16542,13 +16543,13 @@ var qa = "ScrollArea", [Jh, ak] = Dn(qa), [JC, Ht] = Jh(qa), Zh = b.forwardRef(
|
|
|
16542
16543
|
scrollbarY: g,
|
|
16543
16544
|
onScrollbarYChange: x,
|
|
16544
16545
|
scrollbarYEnabled: T,
|
|
16545
|
-
onScrollbarYEnabledChange:
|
|
16546
|
+
onScrollbarYEnabledChange: N,
|
|
16546
16547
|
onCornerWidthChange: v,
|
|
16547
16548
|
onCornerHeightChange: R,
|
|
16548
16549
|
children: /* @__PURE__ */ d.jsx(
|
|
16549
16550
|
je.div,
|
|
16550
16551
|
{
|
|
16551
|
-
dir:
|
|
16552
|
+
dir: $,
|
|
16552
16553
|
...i,
|
|
16553
16554
|
ref: j,
|
|
16554
16555
|
style: {
|
|
@@ -16845,16 +16846,16 @@ var ZC = b.forwardRef((e, t) => {
|
|
|
16845
16846
|
onResize: f,
|
|
16846
16847
|
...h
|
|
16847
16848
|
} = e, p = Ht(mn, n), [m, g] = b.useState(null), x = Ye(t, (j) => g(j)), y = b.useRef(null), v = b.useRef(""), C = p.viewport, R = r.content - r.viewport, S = ht(u), w = ht(c), T = Ws(f, 10);
|
|
16848
|
-
function
|
|
16849
|
+
function N(j) {
|
|
16849
16850
|
if (y.current) {
|
|
16850
|
-
const
|
|
16851
|
-
l({ x:
|
|
16851
|
+
const $ = j.clientX - y.current.left, F = j.clientY - y.current.top;
|
|
16852
|
+
l({ x: $, y: F });
|
|
16852
16853
|
}
|
|
16853
16854
|
}
|
|
16854
16855
|
return b.useEffect(() => {
|
|
16855
|
-
const j = (
|
|
16856
|
-
const F =
|
|
16857
|
-
(m == null ? void 0 : m.contains(F)) && S(
|
|
16856
|
+
const j = ($) => {
|
|
16857
|
+
const F = $.target;
|
|
16858
|
+
(m == null ? void 0 : m.contains(F)) && S($, R);
|
|
16858
16859
|
};
|
|
16859
16860
|
return document.addEventListener("wheel", j, { passive: !1 }), () => document.removeEventListener("wheel", j, { passive: !1 });
|
|
16860
16861
|
}, [C, m, R, S]), b.useEffect(w, [r, w]), Cr(m, T), Cr(p.content, T), /* @__PURE__ */ d.jsx(
|
|
@@ -16874,12 +16875,12 @@ var ZC = b.forwardRef((e, t) => {
|
|
|
16874
16875
|
ref: x,
|
|
16875
16876
|
style: { position: "absolute", ...h.style },
|
|
16876
16877
|
onPointerDown: be(e.onPointerDown, (j) => {
|
|
16877
|
-
j.button === 0 && (j.target.setPointerCapture(j.pointerId), y.current = m.getBoundingClientRect(), v.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"),
|
|
16878
|
+
j.button === 0 && (j.target.setPointerCapture(j.pointerId), y.current = m.getBoundingClientRect(), v.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", p.viewport && (p.viewport.style.scrollBehavior = "auto"), N(j));
|
|
16878
16879
|
}),
|
|
16879
|
-
onPointerMove: be(e.onPointerMove,
|
|
16880
|
+
onPointerMove: be(e.onPointerMove, N),
|
|
16880
16881
|
onPointerUp: be(e.onPointerUp, (j) => {
|
|
16881
|
-
const
|
|
16882
|
-
|
|
16882
|
+
const $ = j.target;
|
|
16883
|
+
$.hasPointerCapture(j.pointerId) && $.releasePointerCapture(j.pointerId), document.body.style.webkitUserSelect = v.current, p.viewport && (p.viewport.style.scrollBehavior = ""), y.current = null;
|
|
16883
16884
|
})
|
|
16884
16885
|
}
|
|
16885
16886
|
)
|
|
@@ -17308,17 +17309,17 @@ function Wi({
|
|
|
17308
17309
|
menuItem: S
|
|
17309
17310
|
}) {
|
|
17310
17311
|
const { chatApi: w, authApi: T } = uo(), {
|
|
17311
|
-
threads:
|
|
17312
|
+
threads: N,
|
|
17312
17313
|
sharedThreads: j,
|
|
17313
|
-
currentThreadId:
|
|
17314
|
+
currentThreadId: $,
|
|
17314
17315
|
setCurrentThreadId: F,
|
|
17315
17316
|
isLoading: U,
|
|
17316
17317
|
isLoadingSharedThreads: Y,
|
|
17317
17318
|
actions: _,
|
|
17318
17319
|
shareInFlight: q,
|
|
17319
17320
|
shareStatus: X,
|
|
17320
|
-
clearShareStatus:
|
|
17321
|
-
} = Ss(), { createThread: H, deleteThread: B, renameThread:
|
|
17321
|
+
clearShareStatus: Q
|
|
17322
|
+
} = Ss(), { createThread: H, deleteThread: B, renameThread: ne, shareThread: M } = _, { loadThread: A } = Ts(), E = i ?? $, [L, P] = fe(Array.isArray(N) ? N : []), W = Te(L.length > 0), O = Te(null), I = Te(0), [K, J] = fe(null), [se, ge] = fe(""), [Ce, Pe] = fe(!1), [Ie, Ke] = fe(!1), [Xe, He] = fe(null), [Ue, it] = fe(""), [mt, bt] = fe([]), [gt, Qe] = fe(!1), ot = ie((G) => ge(G), []);
|
|
17322
17323
|
Be(() => {
|
|
17323
17324
|
Ie && !y && mt.length === 0 && !gt && (async () => {
|
|
17324
17325
|
Qe(!0);
|
|
@@ -17346,26 +17347,26 @@ function Wi({
|
|
|
17346
17347
|
), Wt = It.find((G) => G.key === ct) ?? It[0], tn = (G) => {
|
|
17347
17348
|
He(G), it(""), Ke(!0);
|
|
17348
17349
|
}, Dt = () => {
|
|
17349
|
-
Ke(!1), He(null), it(""),
|
|
17350
|
+
Ke(!1), He(null), it(""), Q();
|
|
17350
17351
|
}, Vt = ie(
|
|
17351
17352
|
async (G) => {
|
|
17352
17353
|
if (!(!Xe || q) && G.id)
|
|
17353
17354
|
try {
|
|
17354
|
-
await
|
|
17355
|
+
await M(Xe, G.id), setTimeout(() => Dt(), 600);
|
|
17355
17356
|
} catch (de) {
|
|
17356
17357
|
console.error("Failed to share thread:", de);
|
|
17357
17358
|
}
|
|
17358
17359
|
},
|
|
17359
|
-
[Dt, q, Xe,
|
|
17360
|
+
[Dt, q, Xe, M]
|
|
17360
17361
|
), vn = Ne(() => {
|
|
17361
17362
|
const G = at, de = Ue.trim().toLowerCase();
|
|
17362
17363
|
return de ? C ? G.filter((re) => C(re, de)) : G.filter((re) => `${re.label} ${re.secondaryLabel ?? ""}`.toLowerCase().includes(de)) : G;
|
|
17363
|
-
}, [y, Ue, C]), Lt = ct === "shared", Kt = Lt ? j :
|
|
17364
|
+
}, [y, Ue, C]), Lt = ct === "shared", Kt = Lt ? j : L, Et = Ne(() => {
|
|
17364
17365
|
if (!R || Lt) return null;
|
|
17365
17366
|
const G = "Default", de = (k) => {
|
|
17366
17367
|
if (!k) return "Older";
|
|
17367
17368
|
try {
|
|
17368
|
-
const
|
|
17369
|
+
const D = k.endsWith("Z") || k.includes("+") ? k : `${k}Z`, V = new Date(D), oe = /* @__PURE__ */ new Date(), ue = new Date(oe.getFullYear(), oe.getMonth(), oe.getDate()), ve = new Date(V.getFullYear(), V.getMonth(), V.getDate()), we = Math.floor(
|
|
17369
17370
|
(ue.getTime() - ve.getTime()) / (1e3 * 60 * 60 * 24)
|
|
17370
17371
|
);
|
|
17371
17372
|
return we === 0 ? "Today" : we === 1 ? "Yesterday" : we <= 7 ? "Last 7 Days" : "Older";
|
|
@@ -17375,12 +17376,12 @@ function Wi({
|
|
|
17375
17376
|
};
|
|
17376
17377
|
if (R === "project") {
|
|
17377
17378
|
const k = {};
|
|
17378
|
-
return Kt.forEach((
|
|
17379
|
+
return Kt.forEach((D) => {
|
|
17379
17380
|
var ve, we;
|
|
17380
|
-
const V = ((ve =
|
|
17381
|
-
k[V] || (k[V] = {}), k[V][oe] || (k[V][oe] = {}), k[V][oe][ue] || (k[V][oe][ue] = []), k[V][oe][ue].push(
|
|
17382
|
-
}), Object.values(k).forEach((
|
|
17383
|
-
Object.values(
|
|
17381
|
+
const V = ((ve = D.project) == null ? void 0 : ve.name) || ((we = D.project) == null ? void 0 : we.id) || G, oe = D.menuItem || S || "Default", ue = de(D.updatedAt);
|
|
17382
|
+
k[V] || (k[V] = {}), k[V][oe] || (k[V][oe] = {}), k[V][oe][ue] || (k[V][oe][ue] = []), k[V][oe][ue].push(D);
|
|
17383
|
+
}), Object.values(k).forEach((D) => {
|
|
17384
|
+
Object.values(D).forEach((V) => {
|
|
17384
17385
|
Object.values(V).forEach((oe) => {
|
|
17385
17386
|
oe.sort(
|
|
17386
17387
|
(ue, ve) => new Date(ve.updatedAt || ve.createdAt || "").getTime() - new Date(ue.updatedAt || ue.createdAt || "").getTime()
|
|
@@ -17391,11 +17392,11 @@ function Wi({
|
|
|
17391
17392
|
}
|
|
17392
17393
|
const re = {};
|
|
17393
17394
|
return Kt.forEach((k) => {
|
|
17394
|
-
let
|
|
17395
|
-
R in k && (
|
|
17395
|
+
let D = G;
|
|
17396
|
+
R in k && (D = k[R] || G), re[D] || (re[D] = []), re[D].push(k);
|
|
17396
17397
|
}), Object.keys(re).forEach((k) => {
|
|
17397
17398
|
re[k].sort(
|
|
17398
|
-
(
|
|
17399
|
+
(D, V) => new Date(V.updatedAt || V.createdAt || "").getTime() - new Date(D.updatedAt || D.createdAt || "").getTime()
|
|
17399
17400
|
);
|
|
17400
17401
|
}), { kind: "flat", groups: re };
|
|
17401
17402
|
}, [Kt, R, Lt]), $n = Lt ? Y : U, Fe = Lt ? "No shared conversations yet" : "No conversations yet", Je = (G) => {
|
|
@@ -17403,13 +17404,13 @@ function Wi({
|
|
|
17403
17404
|
return `Shared by ${G.sharedByUserId}${de}`;
|
|
17404
17405
|
}, wn = (G) => "sharedByUserId" in G;
|
|
17405
17406
|
Be(() => {
|
|
17406
|
-
const G = Array.isArray(
|
|
17407
|
+
const G = Array.isArray(N) ? N : [];
|
|
17407
17408
|
if (G.length > 0) {
|
|
17408
17409
|
W.current = !0, P(G);
|
|
17409
17410
|
return;
|
|
17410
17411
|
}
|
|
17411
17412
|
U || (W.current = !1, P(G));
|
|
17412
|
-
}, [
|
|
17413
|
+
}, [N, U]), Be(() => {
|
|
17413
17414
|
if (!O.current) return;
|
|
17414
17415
|
const G = O.current.querySelector(
|
|
17415
17416
|
"[data-radix-scroll-area-viewport]"
|
|
@@ -17423,7 +17424,7 @@ function Wi({
|
|
|
17423
17424
|
}), () => {
|
|
17424
17425
|
de !== null && cancelAnimationFrame(de), re !== null && cancelAnimationFrame(re);
|
|
17425
17426
|
};
|
|
17426
|
-
}, [
|
|
17427
|
+
}, [L]);
|
|
17427
17428
|
const qt = async (G) => {
|
|
17428
17429
|
try {
|
|
17429
17430
|
F(G), await A(G), a == null || a(G), c == null || c(G);
|
|
@@ -17459,7 +17460,7 @@ function Wi({
|
|
|
17459
17460
|
const de = typeof G == "string" ? G : G.threadId;
|
|
17460
17461
|
if (se.trim())
|
|
17461
17462
|
try {
|
|
17462
|
-
await
|
|
17463
|
+
await ne(de, se.trim()), J(null), ge("");
|
|
17463
17464
|
} catch (re) {
|
|
17464
17465
|
console.error("Failed to update title:", re);
|
|
17465
17466
|
}
|
|
@@ -17468,7 +17469,7 @@ function Wi({
|
|
|
17468
17469
|
}, rn = (G) => {
|
|
17469
17470
|
if (!G) return "";
|
|
17470
17471
|
try {
|
|
17471
|
-
const de = G.endsWith("Z") || G.includes("+") ? G : `${G}Z`, re = new Date(de),
|
|
17472
|
+
const de = G.endsWith("Z") || G.includes("+") ? G : `${G}Z`, re = new Date(de), D = (/* @__PURE__ */ new Date()).getTime() - re.getTime(), V = Math.floor(D / (1e3 * 60 * 60 * 24));
|
|
17472
17473
|
return V === 0 ? re.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : V === 1 ? "Yesterday" : V < 7 ? `${V} days ago` : re.toLocaleDateString();
|
|
17473
17474
|
} catch {
|
|
17474
17475
|
return "";
|
|
@@ -17548,28 +17549,28 @@ function Wi({
|
|
|
17548
17549
|
/* @__PURE__ */ d.jsxs(_o, { className: "flex items-center w-full px-2 py-1 text-xs font-semibold text-slate-600 hover:text-slate-900 dark:hover:text-slate-200", children: [
|
|
17549
17550
|
/* @__PURE__ */ d.jsx(pr, { className: "w-3 h-3 mr-1 transition-transform group-data-[state=open]/collapsible:rotate-90" }),
|
|
17550
17551
|
G,
|
|
17551
|
-
/* @__PURE__ */ d.jsx("span", { className: "ml-auto text-[10px] text-slate-400", children: Object.values(de).reduce((re, k) => re + Object.values(k).reduce((
|
|
17552
|
+
/* @__PURE__ */ d.jsx("span", { className: "ml-auto text-[10px] text-slate-400", children: Object.values(de).reduce((re, k) => re + Object.values(k).reduce((D, V) => D + V.length, 0), 0) })
|
|
17552
17553
|
] }),
|
|
17553
17554
|
/* @__PURE__ */ d.jsx(Po, { children: /* @__PURE__ */ d.jsx("div", { className: "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", children: Object.entries(de).sort(([re], [k]) => re.localeCompare(k)).map(([re, k]) => /* @__PURE__ */ d.jsxs(jo, { defaultOpen: !0, className: "group/collapsible", children: [
|
|
17554
17555
|
/* @__PURE__ */ d.jsxs(_o, { className: "flex items-center w-full px-2 py-1 text-[11px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-200", children: [
|
|
17555
17556
|
/* @__PURE__ */ d.jsx(pr, { className: "w-3 h-3 mr-1 transition-transform group-data-[state=open]/collapsible:rotate-90" }),
|
|
17556
17557
|
re,
|
|
17557
|
-
/* @__PURE__ */ d.jsx("span", { className: "ml-auto text-[10px] text-slate-400", children: Object.values(k).reduce((
|
|
17558
|
+
/* @__PURE__ */ d.jsx("span", { className: "ml-auto text-[10px] text-slate-400", children: Object.values(k).reduce((D, V) => D + V.length, 0) })
|
|
17558
17559
|
] }),
|
|
17559
|
-
/* @__PURE__ */ d.jsx(Po, { children: /* @__PURE__ */ d.jsx("div", { className: "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", children: Object.entries(k).sort(([
|
|
17560
|
-
const oe = ["Today", "Yesterday", "Last 7 Days", "Older"], ue = oe.indexOf(
|
|
17561
|
-
return ue !== -1 || ve !== -1 ? (ue === -1 ? oe.length : ue) - (ve === -1 ? oe.length : ve) :
|
|
17562
|
-
}).map(([
|
|
17560
|
+
/* @__PURE__ */ d.jsx(Po, { children: /* @__PURE__ */ d.jsx("div", { className: "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", children: Object.entries(k).sort(([D], [V]) => {
|
|
17561
|
+
const oe = ["Today", "Yesterday", "Last 7 Days", "Older"], ue = oe.indexOf(D), ve = oe.indexOf(V);
|
|
17562
|
+
return ue !== -1 || ve !== -1 ? (ue === -1 ? oe.length : ue) - (ve === -1 ? oe.length : ve) : D.localeCompare(V);
|
|
17563
|
+
}).map(([D, V]) => /* @__PURE__ */ d.jsxs(jo, { defaultOpen: !0, className: "group/collapsible", children: [
|
|
17563
17564
|
/* @__PURE__ */ d.jsxs(_o, { className: "flex items-center w-full px-2 py-1 text-[10px] font-medium text-slate-400 hover:text-slate-600 dark:hover:text-slate-300", children: [
|
|
17564
17565
|
/* @__PURE__ */ d.jsx(pr, { className: "w-3 h-3 mr-1 transition-transform group-data-[state=open]/collapsible:rotate-90" }),
|
|
17565
|
-
|
|
17566
|
+
D,
|
|
17566
17567
|
/* @__PURE__ */ d.jsx("span", { className: "ml-auto text-[10px] text-slate-400", children: V.length })
|
|
17567
17568
|
] }),
|
|
17568
17569
|
/* @__PURE__ */ d.jsx(Po, { children: /* @__PURE__ */ d.jsx("div", { className: "pl-2 border-l border-slate-100 dark:border-slate-800 ml-1.5 my-1 space-y-1", children: V.map((oe) => /* @__PURE__ */ d.jsx(
|
|
17569
17570
|
gi,
|
|
17570
17571
|
{
|
|
17571
17572
|
thread: oe,
|
|
17572
|
-
isActive:
|
|
17573
|
+
isActive: E === oe.threadId,
|
|
17573
17574
|
editingThreadId: K,
|
|
17574
17575
|
editingTitle: se,
|
|
17575
17576
|
onSelect: qt,
|
|
@@ -17588,7 +17589,7 @@ function Wi({
|
|
|
17588
17589
|
},
|
|
17589
17590
|
oe.threadId
|
|
17590
17591
|
)) }) })
|
|
17591
|
-
] }, `${G}-${re}-${
|
|
17592
|
+
] }, `${G}-${re}-${D}`)) }) })
|
|
17592
17593
|
] }, `${G}-${re}`)) }) })
|
|
17593
17594
|
] }, G)) : Object.entries(Et.groups).sort(([G], [de]) => {
|
|
17594
17595
|
const re = "Default";
|
|
@@ -17603,7 +17604,7 @@ function Wi({
|
|
|
17603
17604
|
gi,
|
|
17604
17605
|
{
|
|
17605
17606
|
thread: re,
|
|
17606
|
-
isActive:
|
|
17607
|
+
isActive: E === re.threadId,
|
|
17607
17608
|
editingThreadId: K,
|
|
17608
17609
|
editingTitle: se,
|
|
17609
17610
|
onSelect: qt,
|
|
@@ -17626,7 +17627,7 @@ function Wi({
|
|
|
17626
17627
|
gi,
|
|
17627
17628
|
{
|
|
17628
17629
|
thread: G,
|
|
17629
|
-
isActive:
|
|
17630
|
+
isActive: E === G.threadId,
|
|
17630
17631
|
editingThreadId: K,
|
|
17631
17632
|
editingTitle: se,
|
|
17632
17633
|
onSelect: qt,
|
|
@@ -17710,7 +17711,7 @@ function ck({
|
|
|
17710
17711
|
"--chat-sidebar-width": u === "phone" ? "100%" : u === "tablet" ? "280px" : u === "half-screen" ? "240px" : "320px",
|
|
17711
17712
|
"--chat-message-max-width": u === "phone" ? "95%" : u === "tablet" ? "90%" : u === "half-screen" ? "85%" : "80%",
|
|
17712
17713
|
"--chat-input-height": u === "phone" ? "120px" : "100px"
|
|
17713
|
-
}), l =
|
|
17714
|
+
}), l = ee.useCallback((u) => {
|
|
17714
17715
|
var f;
|
|
17715
17716
|
(f = i.onThreadChange) == null || f.call(i, u);
|
|
17716
17717
|
}, [i]);
|
|
@@ -17881,7 +17882,7 @@ function uk(e) {
|
|
|
17881
17882
|
const w = await r.listFiles(n ?? void 0);
|
|
17882
17883
|
if (!w || !Array.isArray(w))
|
|
17883
17884
|
throw new Error("Invalid file list response");
|
|
17884
|
-
const T = w.find((
|
|
17885
|
+
const T = w.find((N) => !N || typeof N != "object" || !((N.filename ?? "") === (g.name ?? "")) ? !1 : typeof g.size == "number" && typeof N.size == "number" ? N.size === g.size : !0);
|
|
17885
17886
|
if (!(T != null && T.id))
|
|
17886
17887
|
throw new Error(`File "${g.name}" is not yet available on the server`);
|
|
17887
17888
|
if (!T.id || !T.filename)
|