teodor-new-chat-ui 3.0.9 → 3.0.10
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 +486 -485
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -325,8 +325,8 @@ function mr(e, t, n) {
|
|
|
325
325
|
metaTokens: !0,
|
|
326
326
|
dots: !1,
|
|
327
327
|
indexes: !1
|
|
328
|
-
}, !1, function(
|
|
329
|
-
return !S.isUndefined(b[
|
|
328
|
+
}, !1, function(m, b) {
|
|
329
|
+
return !S.isUndefined(b[m]);
|
|
330
330
|
});
|
|
331
331
|
const r = n.metaTokens, o = n.visitor || d, s = n.dots, a = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && S.isSpecCompliantForm(t);
|
|
332
332
|
if (!S.isFunction(o))
|
|
@@ -341,39 +341,39 @@ function mr(e, t, n) {
|
|
|
341
341
|
throw new ne("Blob is not supported. Use a Buffer instead.");
|
|
342
342
|
return S.isArrayBuffer(g) || S.isTypedArray(g) ? l && typeof Blob == "function" ? new Blob([g]) : Buffer.from(g) : g;
|
|
343
343
|
}
|
|
344
|
-
function d(g,
|
|
344
|
+
function d(g, m, b) {
|
|
345
345
|
let w = g;
|
|
346
346
|
if (g && !b && typeof g == "object") {
|
|
347
|
-
if (S.endsWith(
|
|
348
|
-
|
|
349
|
-
else if (S.isArray(g) && gf(g) || (S.isFileList(g) || S.endsWith(
|
|
350
|
-
return
|
|
347
|
+
if (S.endsWith(m, "{}"))
|
|
348
|
+
m = r ? m : m.slice(0, -2), g = JSON.stringify(g);
|
|
349
|
+
else if (S.isArray(g) && gf(g) || (S.isFileList(g) || S.endsWith(m, "[]")) && (w = S.toArray(g)))
|
|
350
|
+
return m = ja(m), w.forEach(function(y, C) {
|
|
351
351
|
!(S.isUndefined(y) || y === null) && t.append(
|
|
352
352
|
// eslint-disable-next-line no-nested-ternary
|
|
353
|
-
a === !0 ? Os([
|
|
353
|
+
a === !0 ? Os([m], C, s) : a === null ? m : m + "[]",
|
|
354
354
|
f(y)
|
|
355
355
|
);
|
|
356
356
|
}), !1;
|
|
357
357
|
}
|
|
358
|
-
return mo(g) ? !0 : (t.append(Os(b,
|
|
358
|
+
return mo(g) ? !0 : (t.append(Os(b, m, s), f(g)), !1);
|
|
359
359
|
}
|
|
360
|
-
const p = [],
|
|
360
|
+
const p = [], h = Object.assign(bf, {
|
|
361
361
|
defaultVisitor: d,
|
|
362
362
|
convertValue: f,
|
|
363
363
|
isVisitable: mo
|
|
364
364
|
});
|
|
365
|
-
function v(g,
|
|
365
|
+
function v(g, m) {
|
|
366
366
|
if (!S.isUndefined(g)) {
|
|
367
367
|
if (p.indexOf(g) !== -1)
|
|
368
|
-
throw Error("Circular reference detected in " +
|
|
368
|
+
throw Error("Circular reference detected in " + m.join("."));
|
|
369
369
|
p.push(g), S.forEach(g, function(w, x) {
|
|
370
370
|
(!(S.isUndefined(w) || w === null) && o.call(
|
|
371
371
|
t,
|
|
372
372
|
w,
|
|
373
373
|
S.isString(x) ? x.trim() : x,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
)) === !0 && v(w,
|
|
374
|
+
m,
|
|
375
|
+
h
|
|
376
|
+
)) === !0 && v(w, m ? m.concat(x) : [x]);
|
|
377
377
|
}), p.pop();
|
|
378
378
|
}
|
|
379
379
|
}
|
|
@@ -858,13 +858,13 @@ function $f(e, t) {
|
|
|
858
858
|
return t = t !== void 0 ? t : 1e3, function(l) {
|
|
859
859
|
const f = Date.now(), d = r[s];
|
|
860
860
|
a || (a = f), n[o] = l, r[o] = f;
|
|
861
|
-
let p = s,
|
|
861
|
+
let p = s, h = 0;
|
|
862
862
|
for (; p !== o; )
|
|
863
|
-
|
|
863
|
+
h += n[p++], p = p % e;
|
|
864
864
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), f - a < t)
|
|
865
865
|
return;
|
|
866
866
|
const v = d && f - d;
|
|
867
|
-
return v ? Math.round(
|
|
867
|
+
return v ? Math.round(h * 1e3 / v) : void 0;
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
870
|
function Bf(e, t) {
|
|
@@ -949,14 +949,14 @@ const $s = (e) => e instanceof Ie ? { ...e } : e;
|
|
|
949
949
|
function wt(e, t) {
|
|
950
950
|
t = t || {};
|
|
951
951
|
const n = {};
|
|
952
|
-
function r(f, d, p,
|
|
953
|
-
return S.isPlainObject(f) && S.isPlainObject(d) ? S.merge.call({ caseless:
|
|
952
|
+
function r(f, d, p, h) {
|
|
953
|
+
return S.isPlainObject(f) && S.isPlainObject(d) ? S.merge.call({ caseless: h }, f, d) : S.isPlainObject(d) ? S.merge({}, d) : S.isArray(d) ? d.slice() : d;
|
|
954
954
|
}
|
|
955
|
-
function o(f, d, p,
|
|
955
|
+
function o(f, d, p, h) {
|
|
956
956
|
if (S.isUndefined(d)) {
|
|
957
957
|
if (!S.isUndefined(f))
|
|
958
|
-
return r(void 0, f, p,
|
|
959
|
-
} else return r(f, d, p,
|
|
958
|
+
return r(void 0, f, p, h);
|
|
959
|
+
} else return r(f, d, p, h);
|
|
960
960
|
}
|
|
961
961
|
function s(f, d) {
|
|
962
962
|
if (!S.isUndefined(d))
|
|
@@ -1006,8 +1006,8 @@ function wt(e, t) {
|
|
|
1006
1006
|
headers: (f, d, p) => o($s(f), $s(d), p, !0)
|
|
1007
1007
|
};
|
|
1008
1008
|
return S.forEach(Object.keys({ ...e, ...t }), function(d) {
|
|
1009
|
-
const p = l[d] || o,
|
|
1010
|
-
S.isUndefined(
|
|
1009
|
+
const p = l[d] || o, h = p(e[d], t[d], d);
|
|
1010
|
+
S.isUndefined(h) && p !== i || (n[d] = h);
|
|
1011
1011
|
}), n;
|
|
1012
1012
|
}
|
|
1013
1013
|
const Za = (e) => {
|
|
@@ -1036,8 +1036,8 @@ const Za = (e) => {
|
|
|
1036
1036
|
const o = Za(e);
|
|
1037
1037
|
let s = o.data;
|
|
1038
1038
|
const a = Ie.from(o.headers).normalize();
|
|
1039
|
-
let { responseType: i, onUploadProgress: l, onDownloadProgress: f } = o, d, p,
|
|
1040
|
-
function
|
|
1039
|
+
let { responseType: i, onUploadProgress: l, onDownloadProgress: f } = o, d, p, h, v, g;
|
|
1040
|
+
function m() {
|
|
1041
1041
|
v && v(), g && g(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
|
|
1042
1042
|
}
|
|
1043
1043
|
let b = new XMLHttpRequest();
|
|
@@ -1056,9 +1056,9 @@ const Za = (e) => {
|
|
|
1056
1056
|
request: b
|
|
1057
1057
|
};
|
|
1058
1058
|
Ya(function(N) {
|
|
1059
|
-
n(N),
|
|
1059
|
+
n(N), m();
|
|
1060
1060
|
}, function(N) {
|
|
1061
|
-
r(N),
|
|
1061
|
+
r(N), m();
|
|
1062
1062
|
}, R), b = null;
|
|
1063
1063
|
}
|
|
1064
1064
|
"onloadend" in b ? b.onloadend = w : b.onreadystatechange = function() {
|
|
@@ -1079,7 +1079,7 @@ const Za = (e) => {
|
|
|
1079
1079
|
)), b = null;
|
|
1080
1080
|
}, s === void 0 && a.setContentType(null), "setRequestHeader" in b && S.forEach(a.toJSON(), function(C, R) {
|
|
1081
1081
|
b.setRequestHeader(R, C);
|
|
1082
|
-
}), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([
|
|
1082
|
+
}), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([h, g] = Zn(f, !0), b.addEventListener("progress", h)), l && b.upload && ([p, v] = Zn(l), b.upload.addEventListener("progress", p), b.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (y) => {
|
|
1083
1083
|
b && (r(!y || y.type ? new jt(null, e, b) : y), b.abort(), b = null);
|
|
1084
1084
|
}, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
|
|
1085
1085
|
const x = Ff(o.url);
|
|
@@ -1155,8 +1155,8 @@ const Za = (e) => {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
let p = d.byteLength;
|
|
1157
1157
|
if (n) {
|
|
1158
|
-
let
|
|
1159
|
-
n(
|
|
1158
|
+
let h = s += p;
|
|
1159
|
+
n(h);
|
|
1160
1160
|
}
|
|
1161
1161
|
l.enqueue(new Uint8Array(d));
|
|
1162
1162
|
} catch (f) {
|
|
@@ -1188,28 +1188,28 @@ const Za = (e) => {
|
|
|
1188
1188
|
const { fetch: t, Request: n, Response: r } = e, o = t ? An(t) : typeof fetch == "function", s = An(n), a = An(r);
|
|
1189
1189
|
if (!o)
|
|
1190
1190
|
return !1;
|
|
1191
|
-
const i = o && An(Hs), l = o && (typeof zs == "function" ? /* @__PURE__ */ ((g) => (
|
|
1191
|
+
const i = o && An(Hs), l = o && (typeof zs == "function" ? /* @__PURE__ */ ((g) => (m) => g.encode(m))(new zs()) : async (g) => new Uint8Array(await new n(g).arrayBuffer())), f = s && i && Ws(() => {
|
|
1192
1192
|
let g = !1;
|
|
1193
|
-
const
|
|
1193
|
+
const m = new n(Se.origin, {
|
|
1194
1194
|
body: new Hs(),
|
|
1195
1195
|
method: "POST",
|
|
1196
1196
|
get duplex() {
|
|
1197
1197
|
return g = !0, "half";
|
|
1198
1198
|
}
|
|
1199
1199
|
}).headers.has("Content-Type");
|
|
1200
|
-
return g && !
|
|
1200
|
+
return g && !m;
|
|
1201
1201
|
}), d = a && i && Ws(() => S.isReadableStream(new r("").body)), p = {
|
|
1202
1202
|
stream: d && ((g) => g.body)
|
|
1203
1203
|
};
|
|
1204
1204
|
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((g) => {
|
|
1205
|
-
!p[g] && (p[g] = (
|
|
1206
|
-
let w =
|
|
1205
|
+
!p[g] && (p[g] = (m, b) => {
|
|
1206
|
+
let w = m && m[g];
|
|
1207
1207
|
if (w)
|
|
1208
|
-
return w.call(
|
|
1208
|
+
return w.call(m);
|
|
1209
1209
|
throw new ne(`Response type '${g}' is not supported`, ne.ERR_NOT_SUPPORT, b);
|
|
1210
1210
|
});
|
|
1211
1211
|
});
|
|
1212
|
-
const
|
|
1212
|
+
const h = async (g) => {
|
|
1213
1213
|
if (g == null)
|
|
1214
1214
|
return 0;
|
|
1215
1215
|
if (S.isBlob(g))
|
|
@@ -1223,13 +1223,13 @@ const Za = (e) => {
|
|
|
1223
1223
|
return g.byteLength;
|
|
1224
1224
|
if (S.isURLSearchParams(g) && (g = g + ""), S.isString(g))
|
|
1225
1225
|
return (await l(g)).byteLength;
|
|
1226
|
-
}, v = async (g,
|
|
1226
|
+
}, v = async (g, m) => {
|
|
1227
1227
|
const b = S.toFiniteNumber(g.getContentLength());
|
|
1228
|
-
return b ?? m
|
|
1228
|
+
return b ?? h(m);
|
|
1229
1229
|
};
|
|
1230
1230
|
return async (g) => {
|
|
1231
1231
|
let {
|
|
1232
|
-
url:
|
|
1232
|
+
url: m,
|
|
1233
1233
|
method: b,
|
|
1234
1234
|
data: w,
|
|
1235
1235
|
signal: x,
|
|
@@ -1250,12 +1250,12 @@ const Za = (e) => {
|
|
|
1250
1250
|
let H;
|
|
1251
1251
|
try {
|
|
1252
1252
|
if (_ && f && b !== "get" && b !== "head" && (H = await v(k, w)) !== 0) {
|
|
1253
|
-
let q = new n(
|
|
1253
|
+
let q = new n(m, {
|
|
1254
1254
|
method: "POST",
|
|
1255
1255
|
body: w,
|
|
1256
1256
|
duplex: "half"
|
|
1257
|
-
}),
|
|
1258
|
-
if (S.isFormData(w) && (
|
|
1257
|
+
}), ae;
|
|
1258
|
+
if (S.isFormData(w) && (ae = q.headers.get("content-type")) && k.setContentType(ae), q.body) {
|
|
1259
1259
|
const [F, j] = Ls(
|
|
1260
1260
|
H,
|
|
1261
1261
|
Zn(Fs(_))
|
|
@@ -1273,16 +1273,16 @@ const Za = (e) => {
|
|
|
1273
1273
|
duplex: "half",
|
|
1274
1274
|
credentials: O ? L : void 0
|
|
1275
1275
|
};
|
|
1276
|
-
B = s && new n(
|
|
1277
|
-
let D = await (s ? $(B, I) : $(
|
|
1276
|
+
B = s && new n(m, G);
|
|
1277
|
+
let D = await (s ? $(B, I) : $(m, G));
|
|
1278
1278
|
const T = d && (N === "stream" || N === "response");
|
|
1279
1279
|
if (d && (R || T && M)) {
|
|
1280
1280
|
const q = {};
|
|
1281
1281
|
["status", "statusText", "headers"].forEach((ce) => {
|
|
1282
1282
|
q[ce] = D[ce];
|
|
1283
1283
|
});
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1284
|
+
const ae = S.toFiniteNumber(D.headers.get("content-length")), [F, j] = R && Ls(
|
|
1285
|
+
ae,
|
|
1286
1286
|
Zn(Fs(R), !0)
|
|
1287
1287
|
) || [];
|
|
1288
1288
|
D = new r(
|
|
@@ -1294,8 +1294,8 @@ const Za = (e) => {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
N = N || "text";
|
|
1296
1296
|
let Q = await p[S.findKey(p, N) || "text"](D, g);
|
|
1297
|
-
return !T && M && M(), await new Promise((q,
|
|
1298
|
-
Ya(q,
|
|
1297
|
+
return !T && M && M(), await new Promise((q, ae) => {
|
|
1298
|
+
Ya(q, ae, {
|
|
1299
1299
|
data: Q,
|
|
1300
1300
|
headers: Ie.from(D.headers),
|
|
1301
1301
|
status: D.status,
|
|
@@ -1504,28 +1504,28 @@ let vt = class {
|
|
|
1504
1504
|
), n.headers = Ie.concat(a, s);
|
|
1505
1505
|
const i = [];
|
|
1506
1506
|
let l = !0;
|
|
1507
|
-
this.interceptors.request.forEach(function(
|
|
1508
|
-
typeof
|
|
1507
|
+
this.interceptors.request.forEach(function(m) {
|
|
1508
|
+
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (l = l && m.synchronous, i.unshift(m.fulfilled, m.rejected));
|
|
1509
1509
|
});
|
|
1510
1510
|
const f = [];
|
|
1511
|
-
this.interceptors.response.forEach(function(
|
|
1512
|
-
f.push(
|
|
1511
|
+
this.interceptors.response.forEach(function(m) {
|
|
1512
|
+
f.push(m.fulfilled, m.rejected);
|
|
1513
1513
|
});
|
|
1514
|
-
let d, p = 0,
|
|
1514
|
+
let d, p = 0, h;
|
|
1515
1515
|
if (!l) {
|
|
1516
1516
|
const g = [Vs.bind(this), void 0];
|
|
1517
|
-
for (g.unshift(...i), g.push(...f),
|
|
1517
|
+
for (g.unshift(...i), g.push(...f), h = g.length, d = Promise.resolve(n); p < h; )
|
|
1518
1518
|
d = d.then(g[p++], g[p++]);
|
|
1519
1519
|
return d;
|
|
1520
1520
|
}
|
|
1521
|
-
|
|
1521
|
+
h = i.length;
|
|
1522
1522
|
let v = n;
|
|
1523
|
-
for (; p <
|
|
1524
|
-
const g = i[p++],
|
|
1523
|
+
for (; p < h; ) {
|
|
1524
|
+
const g = i[p++], m = i[p++];
|
|
1525
1525
|
try {
|
|
1526
1526
|
v = g(v);
|
|
1527
1527
|
} catch (b) {
|
|
1528
|
-
|
|
1528
|
+
m.call(this, b);
|
|
1529
1529
|
break;
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
@@ -1534,7 +1534,7 @@ let vt = class {
|
|
|
1534
1534
|
} catch (g) {
|
|
1535
1535
|
return Promise.reject(g);
|
|
1536
1536
|
}
|
|
1537
|
-
for (p = 0,
|
|
1537
|
+
for (p = 0, h = f.length; p < h; )
|
|
1538
1538
|
d = d.then(f[p++], f[p++]);
|
|
1539
1539
|
return d;
|
|
1540
1540
|
}
|
|
@@ -1931,7 +1931,7 @@ class cp {
|
|
|
1931
1931
|
}
|
|
1932
1932
|
const yt = new cp();
|
|
1933
1933
|
function lp(e = {}) {
|
|
1934
|
-
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = re(e.token ?? null), s = Te(e.headers ?? {}), [a, i] = re(!1), [l, f] = re(null), [d, p] = re(""), [
|
|
1934
|
+
const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = re(e.token ?? null), s = Te(e.headers ?? {}), [a, i] = re(!1), [l, f] = re(null), [d, p] = re(""), [h, v] = re(null), g = Te(null), m = ve((y) => {
|
|
1935
1935
|
o(y);
|
|
1936
1936
|
}, []), b = ve(() => {
|
|
1937
1937
|
var y;
|
|
@@ -1970,13 +1970,13 @@ function lp(e = {}) {
|
|
|
1970
1970
|
M = { Authorization: `Bearer ${r}` };
|
|
1971
1971
|
else if (typeof window < "u") {
|
|
1972
1972
|
const Q = window.__AUTH_TOKEN__, q = ((L = window.localStorage) == null ? void 0 : L.getItem("authToken")) || null;
|
|
1973
|
-
let
|
|
1973
|
+
let ae = null;
|
|
1974
1974
|
try {
|
|
1975
1975
|
const j = (I = window.localStorage) == null ? void 0 : I.getItem("chat-settings");
|
|
1976
|
-
j && (
|
|
1976
|
+
j && (ae = (($ = JSON.parse(j)) == null ? void 0 : $.apiKey) || null);
|
|
1977
1977
|
} catch {
|
|
1978
1978
|
}
|
|
1979
|
-
const F = Q || q ||
|
|
1979
|
+
const F = Q || q || ae || null;
|
|
1980
1980
|
F && (M = { Authorization: `Bearer ${F}` });
|
|
1981
1981
|
}
|
|
1982
1982
|
} catch {
|
|
@@ -1998,9 +1998,9 @@ function lp(e = {}) {
|
|
|
1998
1998
|
throw N && console.debug("[use-chat] non-OK response", H.status, T == null ? void 0 : T.slice(0, 500)), new Error(`stream ${H.status}${T ? ": " + T : ""}`);
|
|
1999
1999
|
}
|
|
2000
2000
|
try {
|
|
2001
|
-
const T = H.headers.get("X-Thread-Id") || H.headers.get("x-thread-id"), Q = H.headers.get("X-Thread-Created") || H.headers.get("x-thread-created"), q = T ?? null,
|
|
2001
|
+
const T = H.headers.get("X-Thread-Id") || H.headers.get("x-thread-id"), Q = H.headers.get("X-Thread-Created") || H.headers.get("x-thread-created"), q = T ?? null, ae = String(Q ?? "").toLowerCase() === "true";
|
|
2002
2002
|
try {
|
|
2003
|
-
(K = R == null ? void 0 : R.onOpen) == null || K.call(R, { threadId: q, created:
|
|
2003
|
+
(K = R == null ? void 0 : R.onOpen) == null || K.call(R, { threadId: q, created: ae });
|
|
2004
2004
|
} catch (F) {
|
|
2005
2005
|
N && console.debug("[use-chat] onOpen handler threw:", F);
|
|
2006
2006
|
}
|
|
@@ -2017,9 +2017,9 @@ function lp(e = {}) {
|
|
|
2017
2017
|
for (; (q = D.indexOf(`
|
|
2018
2018
|
|
|
2019
2019
|
`)) >= 0; ) {
|
|
2020
|
-
const
|
|
2020
|
+
const ae = D.slice(0, q);
|
|
2021
2021
|
D = D.slice(q + 2);
|
|
2022
|
-
const F = dp(
|
|
2022
|
+
const F = dp(ae);
|
|
2023
2023
|
if (!F) continue;
|
|
2024
2024
|
let j;
|
|
2025
2025
|
try {
|
|
@@ -2055,11 +2055,11 @@ function lp(e = {}) {
|
|
|
2055
2055
|
isStreaming: a,
|
|
2056
2056
|
error: l,
|
|
2057
2057
|
assistantText: d,
|
|
2058
|
-
lastCheckpointId:
|
|
2058
|
+
lastCheckpointId: h,
|
|
2059
2059
|
stream: x,
|
|
2060
2060
|
stop: b,
|
|
2061
2061
|
clear: w,
|
|
2062
|
-
setToken:
|
|
2062
|
+
setToken: m
|
|
2063
2063
|
};
|
|
2064
2064
|
}
|
|
2065
2065
|
function up(e) {
|
|
@@ -2258,7 +2258,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2258
2258
|
authToken: t.apiKey
|
|
2259
2259
|
});
|
|
2260
2260
|
}, [l, t]);
|
|
2261
|
-
const { isStreaming: f, error: d, stream: p, stop:
|
|
2261
|
+
const { isStreaming: f, error: d, stream: p, stop: h, setToken: v } = lp({
|
|
2262
2262
|
baseUrl: l.baseUrl,
|
|
2263
2263
|
token: null,
|
|
2264
2264
|
// we update with setStreamToken below when the API tells us the token
|
|
@@ -2266,11 +2266,11 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2266
2266
|
// any extra headers caller wants
|
|
2267
2267
|
// Ensure the path matches the chat endpoint
|
|
2268
2268
|
streamPath: "/chat/runs/stream"
|
|
2269
|
-
}), [g,
|
|
2269
|
+
}), [g, m] = re(() => typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
|
|
2270
2270
|
ge(() => {
|
|
2271
2271
|
v(typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
|
|
2272
2272
|
const Z = l.onTokenChange((Y) => {
|
|
2273
|
-
|
|
2273
|
+
m(Y), v(Y);
|
|
2274
2274
|
});
|
|
2275
2275
|
return () => {
|
|
2276
2276
|
Z();
|
|
@@ -2294,9 +2294,9 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2294
2294
|
}, [q]), ge(() => {
|
|
2295
2295
|
r == null || r(T);
|
|
2296
2296
|
}, [T, r]);
|
|
2297
|
-
const
|
|
2297
|
+
const ae = Te(null);
|
|
2298
2298
|
ge(() => {
|
|
2299
|
-
o &&
|
|
2299
|
+
o && ae.current !== o && (ae.current = o, j(o).catch(() => {
|
|
2300
2300
|
}));
|
|
2301
2301
|
}, [o]);
|
|
2302
2302
|
const F = Te(null), j = ve(
|
|
@@ -2352,7 +2352,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2352
2352
|
})();
|
|
2353
2353
|
}
|
|
2354
2354
|
}, [f, T, w.lastCheckpointId, l, O, q]);
|
|
2355
|
-
const
|
|
2355
|
+
const oe = ve(async (Z) => {
|
|
2356
2356
|
const Y = await l.createThread(Z);
|
|
2357
2357
|
return await q(), await j(Y.threadId), Y.threadId;
|
|
2358
2358
|
}, [l, q, j]), V = ve(async (Z) => {
|
|
@@ -2361,13 +2361,13 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2361
2361
|
await l.updateThread(Z, Y), await q();
|
|
2362
2362
|
}, [l, q]), te = ve(async (Z, Y) => {
|
|
2363
2363
|
var En;
|
|
2364
|
-
async function he(
|
|
2364
|
+
async function he(se) {
|
|
2365
2365
|
return await new Promise((xe, Ne) => {
|
|
2366
2366
|
const Be = new FileReader();
|
|
2367
|
-
Be.onload = () => xe(String(Be.result)), Be.onerror = (tt) => Ne(tt), Be.readAsDataURL(
|
|
2367
|
+
Be.onload = () => xe(String(Be.result)), Be.onerror = (tt) => Ne(tt), Be.readAsDataURL(se);
|
|
2368
2368
|
});
|
|
2369
2369
|
}
|
|
2370
|
-
async function Oe(
|
|
2370
|
+
async function Oe(se) {
|
|
2371
2371
|
return await new Promise((xe, Ne) => {
|
|
2372
2372
|
const Be = new FileReader();
|
|
2373
2373
|
Be.onload = () => {
|
|
@@ -2380,7 +2380,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2380
2380
|
} catch (tt) {
|
|
2381
2381
|
Ne(tt);
|
|
2382
2382
|
}
|
|
2383
|
-
}, Be.onerror = (tt) => Ne(tt), Be.readAsArrayBuffer(
|
|
2383
|
+
}, Be.onerror = (tt) => Ne(tt), Be.readAsArrayBuffer(se);
|
|
2384
2384
|
});
|
|
2385
2385
|
}
|
|
2386
2386
|
const Ce = [];
|
|
@@ -2388,33 +2388,33 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2388
2388
|
const Xt = (Y == null ? void 0 : Y.attachments) || [];
|
|
2389
2389
|
let st = [];
|
|
2390
2390
|
if (Xt.length > 0)
|
|
2391
|
-
for (const
|
|
2392
|
-
if (
|
|
2391
|
+
for (const se of Xt)
|
|
2392
|
+
if (se.type && se.type.startsWith("image/")) {
|
|
2393
2393
|
let xe = null;
|
|
2394
2394
|
try {
|
|
2395
|
-
const Ne = await l.uploadImage(
|
|
2395
|
+
const Ne = await l.uploadImage(se, (t == null ? void 0 : t.uploadPath) || "/upload").catch(() => null);
|
|
2396
2396
|
xe = (Ne == null ? void 0 : Ne.url) || null;
|
|
2397
2397
|
} catch {
|
|
2398
2398
|
}
|
|
2399
2399
|
if (!xe)
|
|
2400
2400
|
try {
|
|
2401
|
-
xe = await he(
|
|
2401
|
+
xe = await he(se);
|
|
2402
2402
|
} catch {
|
|
2403
2403
|
xe = null;
|
|
2404
2404
|
}
|
|
2405
2405
|
if (xe) {
|
|
2406
|
-
const Ne = { type: "image_url", url: xe, mimeType:
|
|
2406
|
+
const Ne = { type: "image_url", url: xe, mimeType: se.type, alt: se.name };
|
|
2407
2407
|
Ce.push(Ne);
|
|
2408
2408
|
}
|
|
2409
2409
|
try {
|
|
2410
|
-
st.push({ filename:
|
|
2410
|
+
st.push({ filename: se.name, data: await Oe(se), mime_type: se.type || "application/octet-stream" });
|
|
2411
2411
|
} catch {
|
|
2412
2412
|
}
|
|
2413
2413
|
} else {
|
|
2414
|
-
const xe = await he(
|
|
2414
|
+
const xe = await he(se).catch(() => null), Ne = { type: "file", url: String(xe), mimeType: se.type || void 0, name: se.name, size: se.size };
|
|
2415
2415
|
Ce.push(Ne);
|
|
2416
2416
|
try {
|
|
2417
|
-
st.push({ filename:
|
|
2417
|
+
st.push({ filename: se.name, data: await Oe(se), mime_type: se.type || "application/octet-stream" });
|
|
2418
2418
|
} catch {
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
@@ -2428,12 +2428,12 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2428
2428
|
C(Tt);
|
|
2429
2429
|
const Hr = {
|
|
2430
2430
|
...Tt,
|
|
2431
|
-
content: Tt.content.filter((
|
|
2431
|
+
content: Tt.content.filter((se) => se.type === "text" || se.type === "image_url")
|
|
2432
2432
|
}, At = { ...(Y == null ? void 0 : Y.payloadExtras) ?? {} }, zr = !!At.edit, Sn = At.originalMessageId, Cn = typeof Sn == "string" ? Sn : void 0, Wr = (Y == null ? void 0 : Y.attachments) && Y.attachments.length > 0, Yt = {
|
|
2433
2433
|
...T ? { threadId: T } : {},
|
|
2434
2434
|
payload: {
|
|
2435
2435
|
messages: [Hr],
|
|
2436
|
-
attachments: Tt.content.filter((
|
|
2436
|
+
attachments: Tt.content.filter((se) => se.type === "file").map((se) => ({ type: "file", url: se.url, mimeType: se.mimeType, name: se.name, size: se.size })),
|
|
2437
2437
|
files_info: st,
|
|
2438
2438
|
...a && Wr && i ? { agent_id: i } : {},
|
|
2439
2439
|
...At
|
|
@@ -2447,11 +2447,11 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2447
2447
|
};
|
|
2448
2448
|
p(
|
|
2449
2449
|
Yt,
|
|
2450
|
-
(
|
|
2450
|
+
(se) => R(se),
|
|
2451
2451
|
{
|
|
2452
|
-
onError: (
|
|
2453
|
-
onOpen: ({ threadId:
|
|
2454
|
-
!T &&
|
|
2452
|
+
onError: (se) => console.warn("stream error", se),
|
|
2453
|
+
onOpen: ({ threadId: se, created: xe }) => {
|
|
2454
|
+
!T && se && (Q(se), xe && q().catch(() => {
|
|
2455
2455
|
}));
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
@@ -2498,12 +2498,12 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2498
2498
|
navigateToCheckpoint: pe,
|
|
2499
2499
|
returnToLatest: z,
|
|
2500
2500
|
refreshThreads: q,
|
|
2501
|
-
createThread:
|
|
2501
|
+
createThread: oe,
|
|
2502
2502
|
deleteThread: V,
|
|
2503
2503
|
renameThread: X,
|
|
2504
2504
|
loadThread: j,
|
|
2505
2505
|
send: te,
|
|
2506
|
-
stop:
|
|
2506
|
+
stop: h
|
|
2507
2507
|
};
|
|
2508
2508
|
return /* @__PURE__ */ c(si.Provider, { value: de, children: e });
|
|
2509
2509
|
}
|
|
@@ -2610,13 +2610,13 @@ function Ve(e, t = []) {
|
|
|
2610
2610
|
n = [...n, a];
|
|
2611
2611
|
const f = (p) => {
|
|
2612
2612
|
var w;
|
|
2613
|
-
const { scope:
|
|
2614
|
-
return /* @__PURE__ */ c(
|
|
2613
|
+
const { scope: h, children: v, ...g } = p, m = ((w = h == null ? void 0 : h[e]) == null ? void 0 : w[l]) || i, b = u.useMemo(() => g, Object.values(g));
|
|
2614
|
+
return /* @__PURE__ */ c(m.Provider, { value: b, children: v });
|
|
2615
2615
|
};
|
|
2616
2616
|
f.displayName = s + "Provider";
|
|
2617
|
-
function d(p,
|
|
2618
|
-
var
|
|
2619
|
-
const v = ((
|
|
2617
|
+
function d(p, h) {
|
|
2618
|
+
var m;
|
|
2619
|
+
const v = ((m = h == null ? void 0 : h[e]) == null ? void 0 : m[l]) || i, g = u.useContext(v);
|
|
2620
2620
|
if (g) return g;
|
|
2621
2621
|
if (a !== void 0) return a;
|
|
2622
2622
|
throw new Error(`\`${p}\` must be used within \`${s}\``);
|
|
@@ -2679,8 +2679,8 @@ function ut({
|
|
|
2679
2679
|
(d) => {
|
|
2680
2680
|
var p;
|
|
2681
2681
|
if (i) {
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2682
|
+
const h = Np(d) ? d(e) : d;
|
|
2683
|
+
h !== e && ((p = a.current) == null || p.call(a, h));
|
|
2684
2684
|
} else
|
|
2685
2685
|
s(d);
|
|
2686
2686
|
},
|
|
@@ -2783,25 +2783,25 @@ function Ap(e) {
|
|
|
2783
2783
|
}, [i]), we(() => {
|
|
2784
2784
|
const f = r.current, d = o.current;
|
|
2785
2785
|
if (d !== e) {
|
|
2786
|
-
const
|
|
2787
|
-
e ? l("MOUNT") : v === "none" || (f == null ? void 0 : f.display) === "none" ? l("UNMOUNT") : l(d &&
|
|
2786
|
+
const h = s.current, v = In(f);
|
|
2787
|
+
e ? l("MOUNT") : v === "none" || (f == null ? void 0 : f.display) === "none" ? l("UNMOUNT") : l(d && h !== v ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
2788
2788
|
}
|
|
2789
2789
|
}, [e, l]), we(() => {
|
|
2790
2790
|
if (t) {
|
|
2791
2791
|
let f;
|
|
2792
2792
|
const d = t.ownerDocument.defaultView ?? window, p = (v) => {
|
|
2793
|
-
const
|
|
2794
|
-
if (v.target === t &&
|
|
2793
|
+
const m = In(r.current).includes(CSS.escape(v.animationName));
|
|
2794
|
+
if (v.target === t && m && (l("ANIMATION_END"), !o.current)) {
|
|
2795
2795
|
const b = t.style.animationFillMode;
|
|
2796
2796
|
t.style.animationFillMode = "forwards", f = d.setTimeout(() => {
|
|
2797
2797
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = b);
|
|
2798
2798
|
});
|
|
2799
2799
|
}
|
|
2800
|
-
},
|
|
2800
|
+
}, h = (v) => {
|
|
2801
2801
|
v.target === t && (s.current = In(r.current));
|
|
2802
2802
|
};
|
|
2803
|
-
return t.addEventListener("animationstart",
|
|
2804
|
-
d.clearTimeout(f), t.removeEventListener("animationstart",
|
|
2803
|
+
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", p), t.addEventListener("animationend", p), () => {
|
|
2804
|
+
d.clearTimeout(f), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", p), t.removeEventListener("animationend", p);
|
|
2805
2805
|
};
|
|
2806
2806
|
} else
|
|
2807
2807
|
l("ANIMATION_END");
|
|
@@ -2893,7 +2893,7 @@ var Vo = "CollapsibleContent", Mp = u.forwardRef(
|
|
|
2893
2893
|
);
|
|
2894
2894
|
Mp.displayName = Vo;
|
|
2895
2895
|
var Dp = u.forwardRef((e, t) => {
|
|
2896
|
-
const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = jo(Vo, n), [i, l] = u.useState(r), f = u.useRef(null), d = ie(t, f), p = u.useRef(0),
|
|
2896
|
+
const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = jo(Vo, n), [i, l] = u.useState(r), f = u.useRef(null), d = ie(t, f), p = u.useRef(0), h = p.current, v = u.useRef(0), g = v.current, m = a.open || i, b = u.useRef(m), w = u.useRef(void 0);
|
|
2897
2897
|
return u.useEffect(() => {
|
|
2898
2898
|
const x = requestAnimationFrame(() => b.current = !1);
|
|
2899
2899
|
return () => cancelAnimationFrame(x);
|
|
@@ -2913,15 +2913,15 @@ var Dp = u.forwardRef((e, t) => {
|
|
|
2913
2913
|
"data-state": Ko(a.open),
|
|
2914
2914
|
"data-disabled": a.disabled ? "" : void 0,
|
|
2915
2915
|
id: a.contentId,
|
|
2916
|
-
hidden: !
|
|
2916
|
+
hidden: !m,
|
|
2917
2917
|
...s,
|
|
2918
2918
|
ref: d,
|
|
2919
2919
|
style: {
|
|
2920
|
-
"--radix-collapsible-content-height":
|
|
2920
|
+
"--radix-collapsible-content-height": h ? `${h}px` : void 0,
|
|
2921
2921
|
"--radix-collapsible-content-width": g ? `${g}px` : void 0,
|
|
2922
2922
|
...e.style
|
|
2923
2923
|
},
|
|
2924
|
-
children:
|
|
2924
|
+
children: m && o
|
|
2925
2925
|
}
|
|
2926
2926
|
);
|
|
2927
2927
|
});
|
|
@@ -2965,9 +2965,9 @@ function _n({ content: e, className: t = "" }) {
|
|
|
2965
2965
|
node: f,
|
|
2966
2966
|
className: d,
|
|
2967
2967
|
children: p,
|
|
2968
|
-
...
|
|
2968
|
+
...h
|
|
2969
2969
|
}) => {
|
|
2970
|
-
const { inline: v, ...g } =
|
|
2970
|
+
const { inline: v, ...g } = h;
|
|
2971
2971
|
return v ? /* @__PURE__ */ c(
|
|
2972
2972
|
"code",
|
|
2973
2973
|
{
|
|
@@ -3024,10 +3024,10 @@ function $p({
|
|
|
3024
3024
|
truncateToolMessages: f = !0,
|
|
3025
3025
|
toolMessagePreviewLength: d = 200,
|
|
3026
3026
|
truncateUserMessages: p = !0,
|
|
3027
|
-
userMessagePreviewLength:
|
|
3027
|
+
userMessagePreviewLength: h = 200,
|
|
3028
3028
|
customStyles: v = {},
|
|
3029
3029
|
onEdit: g,
|
|
3030
|
-
onRegenerate:
|
|
3030
|
+
onRegenerate: m,
|
|
3031
3031
|
onCancelEdit: b,
|
|
3032
3032
|
onCopy: w
|
|
3033
3033
|
}) {
|
|
@@ -3055,17 +3055,17 @@ function $p({
|
|
|
3055
3055
|
if (!g) return;
|
|
3056
3056
|
const W = K ? Pt(e.content) : M;
|
|
3057
3057
|
g(e.id, W);
|
|
3058
|
-
}, q = () =>
|
|
3059
|
-
const
|
|
3058
|
+
}, q = () => m == null ? void 0 : m(t), ae = () => {
|
|
3059
|
+
const oe = A(I ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", B);
|
|
3060
3060
|
switch ($) {
|
|
3061
3061
|
case "user":
|
|
3062
|
-
return /* @__PURE__ */ c(rd, { className:
|
|
3062
|
+
return /* @__PURE__ */ c(rd, { className: oe });
|
|
3063
3063
|
case "assistant":
|
|
3064
|
-
return /* @__PURE__ */ c(As, { className:
|
|
3064
|
+
return /* @__PURE__ */ c(As, { className: oe });
|
|
3065
3065
|
case "tool":
|
|
3066
|
-
return /* @__PURE__ */ c(nd, { className:
|
|
3066
|
+
return /* @__PURE__ */ c(nd, { className: oe });
|
|
3067
3067
|
default:
|
|
3068
|
-
return /* @__PURE__ */ c(As, { className:
|
|
3068
|
+
return /* @__PURE__ */ c(As, { className: oe });
|
|
3069
3069
|
}
|
|
3070
3070
|
}, F = () => {
|
|
3071
3071
|
const W = "group relative mb-4 flex w-full";
|
|
@@ -3152,7 +3152,7 @@ function $p({
|
|
|
3152
3152
|
const X = Pt(e.content);
|
|
3153
3153
|
return /* @__PURE__ */ c("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X }) });
|
|
3154
3154
|
}
|
|
3155
|
-
const W = O.length > 0 && $ !== "tool",
|
|
3155
|
+
const W = O.length > 0 && $ !== "tool", oe = G.length > 0 && $ !== "tool";
|
|
3156
3156
|
return /* @__PURE__ */ E("div", { children: [
|
|
3157
3157
|
n ? /* @__PURE__ */ E("div", { className: "relative", children: [
|
|
3158
3158
|
(() => {
|
|
@@ -3165,10 +3165,10 @@ function $p({
|
|
|
3165
3165
|
if (V !== null) return /* @__PURE__ */ c(Qs, { data: V });
|
|
3166
3166
|
if ($ === "user" && p) {
|
|
3167
3167
|
const X = M.trim();
|
|
3168
|
-
if (X.length >
|
|
3168
|
+
if (X.length > h)
|
|
3169
3169
|
return /* @__PURE__ */ E(Js, { open: k, onOpenChange: L, children: [
|
|
3170
3170
|
/* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", I && "text-xs"), children: k ? /* @__PURE__ */ c(_n, { content: X }) : /* @__PURE__ */ E("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", I && "text-xs"), children: [
|
|
3171
|
-
X.substring(0,
|
|
3171
|
+
X.substring(0, h),
|
|
3172
3172
|
"..."
|
|
3173
3173
|
] }) }),
|
|
3174
3174
|
/* @__PURE__ */ c(Zs, { asChild: !0, children: /* @__PURE__ */ c(
|
|
@@ -3183,7 +3183,7 @@ function $p({
|
|
|
3183
3183
|
] }) : /* @__PURE__ */ E(Ae, { children: [
|
|
3184
3184
|
/* @__PURE__ */ c(Mt, { className: "h-3 w-3 mr-1" }),
|
|
3185
3185
|
" Show more (",
|
|
3186
|
-
X.length -
|
|
3186
|
+
X.length - h,
|
|
3187
3187
|
" chars)"
|
|
3188
3188
|
] })
|
|
3189
3189
|
}
|
|
@@ -3199,7 +3199,7 @@ function $p({
|
|
|
3199
3199
|
/* @__PURE__ */ c("span", { children: "image" })
|
|
3200
3200
|
] })
|
|
3201
3201
|
] }, X)) }),
|
|
3202
|
-
|
|
3202
|
+
oe && /* @__PURE__ */ c("div", { className: "mt-2 flex flex-wrap gap-2", children: G.map((V, X) => {
|
|
3203
3203
|
const te = V, me = te.name || "file";
|
|
3204
3204
|
return /* @__PURE__ */ E(
|
|
3205
3205
|
"a",
|
|
@@ -3237,7 +3237,7 @@ function $p({
|
|
|
3237
3237
|
),
|
|
3238
3238
|
children: [
|
|
3239
3239
|
/* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
|
|
3240
|
-
|
|
3240
|
+
ae(),
|
|
3241
3241
|
i && z && /* @__PURE__ */ c("span", { className: A("font-medium", I ? "text-xs" : "text-sm"), children: z }),
|
|
3242
3242
|
K && H.name && /* @__PURE__ */ E(
|
|
3243
3243
|
ci,
|
|
@@ -3309,7 +3309,7 @@ function $p({
|
|
|
3309
3309
|
children: /* @__PURE__ */ c(Ts, { className: A(B, I ? "h-3 w-3" : "h-4 w-4") })
|
|
3310
3310
|
}
|
|
3311
3311
|
),
|
|
3312
|
-
$ === "assistant" &&
|
|
3312
|
+
$ === "assistant" && m && /* @__PURE__ */ c(
|
|
3313
3313
|
fe,
|
|
3314
3314
|
{
|
|
3315
3315
|
variant: "ghost",
|
|
@@ -3366,7 +3366,7 @@ function $p({
|
|
|
3366
3366
|
children: /* @__PURE__ */ c(Ts, { className: A("text-current", I ? "h-3 w-3" : "h-4 w-4") })
|
|
3367
3367
|
}
|
|
3368
3368
|
),
|
|
3369
|
-
$ === "assistant" &&
|
|
3369
|
+
$ === "assistant" && m && /* @__PURE__ */ c(
|
|
3370
3370
|
fe,
|
|
3371
3371
|
{
|
|
3372
3372
|
variant: "ghost",
|
|
@@ -3564,8 +3564,8 @@ function hi(e) {
|
|
|
3564
3564
|
const f = l[1], d = /Issue\(([\s\S]*?)\)(?:,|$)/g;
|
|
3565
3565
|
let p = null;
|
|
3566
3566
|
for (; (p = d.exec(f)) !== null; ) {
|
|
3567
|
-
const
|
|
3568
|
-
n[a].push({ title:
|
|
3567
|
+
const h = p[1], v = /title\s*=\s*(['"])([\s\S]*?)\1/.exec(h), g = /description\s*=\s*(['"])([\s\S]*?)\1/.exec(h), m = v ? v[2].trim() : "", b = g ? g[2].trim() : "";
|
|
3568
|
+
n[a].push({ title: m, description: b });
|
|
3569
3569
|
}
|
|
3570
3570
|
}
|
|
3571
3571
|
return Object.values(n).some((a) => a.length > 0) ? n : null;
|
|
@@ -3650,27 +3650,27 @@ function Go(e) {
|
|
|
3650
3650
|
const t = e + "CollectionProvider", [n, r] = Ve(t), [o, s] = n(
|
|
3651
3651
|
t,
|
|
3652
3652
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
3653
|
-
), a = (
|
|
3654
|
-
const { scope: b, children: w } =
|
|
3653
|
+
), a = (m) => {
|
|
3654
|
+
const { scope: b, children: w } = m, x = qe.useRef(null), y = qe.useRef(/* @__PURE__ */ new Map()).current;
|
|
3655
3655
|
return /* @__PURE__ */ c(o, { scope: b, itemMap: y, collectionRef: x, children: w });
|
|
3656
3656
|
};
|
|
3657
3657
|
a.displayName = t;
|
|
3658
3658
|
const i = e + "CollectionSlot", l = Ft(i), f = qe.forwardRef(
|
|
3659
|
-
(
|
|
3660
|
-
const { scope: w, children: x } =
|
|
3659
|
+
(m, b) => {
|
|
3660
|
+
const { scope: w, children: x } = m, y = s(i, w), C = ie(b, y.collectionRef);
|
|
3661
3661
|
return /* @__PURE__ */ c(l, { ref: C, children: x });
|
|
3662
3662
|
}
|
|
3663
3663
|
);
|
|
3664
3664
|
f.displayName = i;
|
|
3665
|
-
const d = e + "CollectionItemSlot", p = "data-radix-collection-item",
|
|
3666
|
-
(
|
|
3667
|
-
const { scope: w, children: x, ...y } =
|
|
3668
|
-
return qe.useEffect(() => (_.itemMap.set(C, { ref: C, ...y }), () => void _.itemMap.delete(C))), /* @__PURE__ */ c(
|
|
3665
|
+
const d = e + "CollectionItemSlot", p = "data-radix-collection-item", h = Ft(d), v = qe.forwardRef(
|
|
3666
|
+
(m, b) => {
|
|
3667
|
+
const { scope: w, children: x, ...y } = m, C = qe.useRef(null), R = ie(b, C), _ = s(d, w);
|
|
3668
|
+
return qe.useEffect(() => (_.itemMap.set(C, { ref: C, ...y }), () => void _.itemMap.delete(C))), /* @__PURE__ */ c(h, { [p]: "", ref: R, children: x });
|
|
3669
3669
|
}
|
|
3670
3670
|
);
|
|
3671
3671
|
v.displayName = d;
|
|
3672
|
-
function g(
|
|
3673
|
-
const b = s(e + "CollectionConsumer",
|
|
3672
|
+
function g(m) {
|
|
3673
|
+
const b = s(e + "CollectionConsumer", m);
|
|
3674
3674
|
return qe.useCallback(() => {
|
|
3675
3675
|
const x = b.collectionRef.current;
|
|
3676
3676
|
if (!x) return [];
|
|
@@ -3723,21 +3723,21 @@ var th = "DismissableLayer", yo = "dismissableLayer.update", nh = "dismissableLa
|
|
|
3723
3723
|
onInteractOutside: a,
|
|
3724
3724
|
onDismiss: i,
|
|
3725
3725
|
...l
|
|
3726
|
-
} = e, f = u.useContext(mi), [d, p] = u.useState(null),
|
|
3726
|
+
} = e, f = u.useContext(mi), [d, p] = u.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = u.useState({}), g = ie(t, (N) => p(N)), m = Array.from(f.layers), [b] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = m.indexOf(b), x = d ? m.indexOf(d) : -1, y = f.layersWithOutsidePointerEventsDisabled.size > 0, C = x >= w, R = ah((N) => {
|
|
3727
3727
|
const k = N.target, L = [...f.branches].some((I) => I.contains(k));
|
|
3728
3728
|
!C || L || (o == null || o(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
3729
|
-
},
|
|
3729
|
+
}, h), _ = ih((N) => {
|
|
3730
3730
|
const k = N.target;
|
|
3731
3731
|
[...f.branches].some((I) => I.contains(k)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
3732
|
-
},
|
|
3732
|
+
}, h);
|
|
3733
3733
|
return eh((N) => {
|
|
3734
3734
|
x === f.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
|
|
3735
|
-
},
|
|
3735
|
+
}, h), u.useEffect(() => {
|
|
3736
3736
|
if (d)
|
|
3737
|
-
return n && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (ea =
|
|
3738
|
-
n && f.layersWithOutsidePointerEventsDisabled.size === 1 && (
|
|
3737
|
+
return n && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (ea = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), f.layersWithOutsidePointerEventsDisabled.add(d)), f.layers.add(d), ta(), () => {
|
|
3738
|
+
n && f.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = ea);
|
|
3739
3739
|
};
|
|
3740
|
-
}, [d,
|
|
3740
|
+
}, [d, h, n, f]), u.useEffect(() => () => {
|
|
3741
3741
|
d && (f.layers.delete(d), f.layersWithOutsidePointerEventsDisabled.delete(d), ta());
|
|
3742
3742
|
}, [d, f]), u.useEffect(() => {
|
|
3743
3743
|
const N = () => v({});
|
|
@@ -3845,7 +3845,7 @@ var eo = "focusScope.autoFocusOnMount", to = "focusScope.autoFocusOnUnmount", ra
|
|
|
3845
3845
|
onMountAutoFocus: o,
|
|
3846
3846
|
onUnmountAutoFocus: s,
|
|
3847
3847
|
...a
|
|
3848
|
-
} = e, [i, l] = u.useState(null), f = ye(o), d = ye(s), p = u.useRef(null),
|
|
3848
|
+
} = e, [i, l] = u.useState(null), f = ye(o), d = ye(s), p = u.useRef(null), h = ie(t, (m) => l(m)), v = u.useRef({
|
|
3849
3849
|
paused: !1,
|
|
3850
3850
|
pause() {
|
|
3851
3851
|
this.paused = !0;
|
|
@@ -3856,7 +3856,7 @@ var eo = "focusScope.autoFocusOnMount", to = "focusScope.autoFocusOnUnmount", ra
|
|
|
3856
3856
|
}).current;
|
|
3857
3857
|
u.useEffect(() => {
|
|
3858
3858
|
if (r) {
|
|
3859
|
-
let
|
|
3859
|
+
let m = function(y) {
|
|
3860
3860
|
if (v.paused || !i) return;
|
|
3861
3861
|
const C = y.target;
|
|
3862
3862
|
i.contains(C) ? p.current = C : it(p.current, { select: !0 });
|
|
@@ -3869,40 +3869,40 @@ var eo = "focusScope.autoFocusOnMount", to = "focusScope.autoFocusOnUnmount", ra
|
|
|
3869
3869
|
for (const R of y)
|
|
3870
3870
|
R.removedNodes.length > 0 && it(i);
|
|
3871
3871
|
};
|
|
3872
|
-
document.addEventListener("focusin",
|
|
3872
|
+
document.addEventListener("focusin", m), document.addEventListener("focusout", b);
|
|
3873
3873
|
const x = new MutationObserver(w);
|
|
3874
3874
|
return i && x.observe(i, { childList: !0, subtree: !0 }), () => {
|
|
3875
|
-
document.removeEventListener("focusin",
|
|
3875
|
+
document.removeEventListener("focusin", m), document.removeEventListener("focusout", b), x.disconnect();
|
|
3876
3876
|
};
|
|
3877
3877
|
}
|
|
3878
3878
|
}, [r, i, v.paused]), u.useEffect(() => {
|
|
3879
3879
|
if (i) {
|
|
3880
3880
|
sa.add(v);
|
|
3881
|
-
const
|
|
3882
|
-
if (!i.contains(
|
|
3881
|
+
const m = document.activeElement;
|
|
3882
|
+
if (!i.contains(m)) {
|
|
3883
3883
|
const w = new CustomEvent(eo, ra);
|
|
3884
|
-
i.addEventListener(eo, f), i.dispatchEvent(w), w.defaultPrevented || (lh(hh(bi(i)), { select: !0 }), document.activeElement ===
|
|
3884
|
+
i.addEventListener(eo, f), i.dispatchEvent(w), w.defaultPrevented || (lh(hh(bi(i)), { select: !0 }), document.activeElement === m && it(i));
|
|
3885
3885
|
}
|
|
3886
3886
|
return () => {
|
|
3887
3887
|
i.removeEventListener(eo, f), setTimeout(() => {
|
|
3888
3888
|
const w = new CustomEvent(to, ra);
|
|
3889
|
-
i.addEventListener(to, d), i.dispatchEvent(w), w.defaultPrevented || it(
|
|
3889
|
+
i.addEventListener(to, d), i.dispatchEvent(w), w.defaultPrevented || it(m ?? document.body, { select: !0 }), i.removeEventListener(to, d), sa.remove(v);
|
|
3890
3890
|
}, 0);
|
|
3891
3891
|
};
|
|
3892
3892
|
}
|
|
3893
3893
|
}, [i, f, d, v]);
|
|
3894
3894
|
const g = u.useCallback(
|
|
3895
|
-
(
|
|
3895
|
+
(m) => {
|
|
3896
3896
|
if (!n && !r || v.paused) return;
|
|
3897
|
-
const b =
|
|
3897
|
+
const b = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, w = document.activeElement;
|
|
3898
3898
|
if (b && w) {
|
|
3899
|
-
const x =
|
|
3900
|
-
y && C ? !
|
|
3899
|
+
const x = m.currentTarget, [y, C] = uh(x);
|
|
3900
|
+
y && C ? !m.shiftKey && w === C ? (m.preventDefault(), n && it(y, { select: !0 })) : m.shiftKey && w === y && (m.preventDefault(), n && it(C, { select: !0 })) : w === x && m.preventDefault();
|
|
3901
3901
|
}
|
|
3902
3902
|
},
|
|
3903
3903
|
[n, r, v.paused]
|
|
3904
3904
|
);
|
|
3905
|
-
return /* @__PURE__ */ c(ee.div, { tabIndex: -1, ...a, ref:
|
|
3905
|
+
return /* @__PURE__ */ c(ee.div, { tabIndex: -1, ...a, ref: h, onKeyDown: g });
|
|
3906
3906
|
});
|
|
3907
3907
|
wr.displayName = ch;
|
|
3908
3908
|
function lh(e, { select: t = !1 } = {}) {
|
|
@@ -4078,7 +4078,7 @@ function la(e, t, n) {
|
|
|
4078
4078
|
reference: r,
|
|
4079
4079
|
floating: o
|
|
4080
4080
|
} = e;
|
|
4081
|
-
const s = Ye(t), a = Jo(t), i = Yo(a), l = ot(t), f = s === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2,
|
|
4081
|
+
const s = Ye(t), a = Jo(t), i = Yo(a), l = ot(t), f = s === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, h = r[i] / 2 - o[i] / 2;
|
|
4082
4082
|
let v;
|
|
4083
4083
|
switch (l) {
|
|
4084
4084
|
case "top":
|
|
@@ -4113,10 +4113,10 @@ function la(e, t, n) {
|
|
|
4113
4113
|
}
|
|
4114
4114
|
switch (Vt(t)) {
|
|
4115
4115
|
case "start":
|
|
4116
|
-
v[a] -=
|
|
4116
|
+
v[a] -= h * (n && f ? -1 : 1);
|
|
4117
4117
|
break;
|
|
4118
4118
|
case "end":
|
|
4119
|
-
v[a] +=
|
|
4119
|
+
v[a] += h * (n && f ? -1 : 1);
|
|
4120
4120
|
break;
|
|
4121
4121
|
}
|
|
4122
4122
|
return v;
|
|
@@ -4135,12 +4135,12 @@ const Rh = async (e, t, n) => {
|
|
|
4135
4135
|
}), {
|
|
4136
4136
|
x: d,
|
|
4137
4137
|
y: p
|
|
4138
|
-
} = la(f, r, l),
|
|
4139
|
-
for (let
|
|
4138
|
+
} = la(f, r, l), h = r, v = {}, g = 0;
|
|
4139
|
+
for (let m = 0; m < i.length; m++) {
|
|
4140
4140
|
const {
|
|
4141
4141
|
name: b,
|
|
4142
4142
|
fn: w
|
|
4143
|
-
} = i[
|
|
4143
|
+
} = i[m], {
|
|
4144
4144
|
x,
|
|
4145
4145
|
y,
|
|
4146
4146
|
data: C,
|
|
@@ -4149,7 +4149,7 @@ const Rh = async (e, t, n) => {
|
|
|
4149
4149
|
x: d,
|
|
4150
4150
|
y: p,
|
|
4151
4151
|
initialPlacement: r,
|
|
4152
|
-
placement:
|
|
4152
|
+
placement: h,
|
|
4153
4153
|
strategy: o,
|
|
4154
4154
|
middlewareData: v,
|
|
4155
4155
|
rects: f,
|
|
@@ -4165,19 +4165,19 @@ const Rh = async (e, t, n) => {
|
|
|
4165
4165
|
...v[b],
|
|
4166
4166
|
...C
|
|
4167
4167
|
}
|
|
4168
|
-
}, R && g <= 50 && (g++, typeof R == "object" && (R.placement && (
|
|
4168
|
+
}, R && g <= 50 && (g++, typeof R == "object" && (R.placement && (h = R.placement), R.rects && (f = R.rects === !0 ? await a.getElementRects({
|
|
4169
4169
|
reference: e,
|
|
4170
4170
|
floating: t,
|
|
4171
4171
|
strategy: o
|
|
4172
4172
|
}) : R.rects), {
|
|
4173
4173
|
x: d,
|
|
4174
4174
|
y: p
|
|
4175
|
-
} = la(f,
|
|
4175
|
+
} = la(f, h, l)), m = -1);
|
|
4176
4176
|
}
|
|
4177
4177
|
return {
|
|
4178
4178
|
x: d,
|
|
4179
4179
|
y: p,
|
|
4180
|
-
placement:
|
|
4180
|
+
placement: h,
|
|
4181
4181
|
strategy: o,
|
|
4182
4182
|
middlewareData: v
|
|
4183
4183
|
};
|
|
@@ -4196,9 +4196,9 @@ async function sn(e, t) {
|
|
|
4196
4196
|
boundary: f = "clippingAncestors",
|
|
4197
4197
|
rootBoundary: d = "viewport",
|
|
4198
4198
|
elementContext: p = "floating",
|
|
4199
|
-
altBoundary:
|
|
4199
|
+
altBoundary: h = !1,
|
|
4200
4200
|
padding: v = 0
|
|
4201
|
-
} = rt(t, e), g = vi(v), b = i[
|
|
4201
|
+
} = rt(t, e), g = vi(v), b = i[h ? p === "floating" ? "reference" : "floating" : p], w = rr(await s.getClippingRect({
|
|
4202
4202
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(b))) == null || n ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(i.floating)),
|
|
4203
4203
|
boundary: f,
|
|
4204
4204
|
rootBoundary: d,
|
|
@@ -4245,15 +4245,15 @@ const Th = (e) => ({
|
|
|
4245
4245
|
} = rt(e, t) || {};
|
|
4246
4246
|
if (f == null)
|
|
4247
4247
|
return {};
|
|
4248
|
-
const p = vi(d),
|
|
4248
|
+
const p = vi(d), h = {
|
|
4249
4249
|
x: n,
|
|
4250
4250
|
y: r
|
|
4251
|
-
}, v = Jo(o), g = Yo(v),
|
|
4251
|
+
}, v = Jo(o), g = Yo(v), m = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", x = b ? "bottom" : "right", y = b ? "clientHeight" : "clientWidth", C = s.reference[g] + s.reference[v] - h[v] - s.floating[g], R = h[v] - s.reference[v], _ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
|
|
4252
4252
|
let N = _ ? _[y] : 0;
|
|
4253
4253
|
(!N || !await (a.isElement == null ? void 0 : a.isElement(_))) && (N = i.floating[y] || s.floating[g]);
|
|
4254
|
-
const k = C / 2 - R / 2, L = N / 2 -
|
|
4254
|
+
const k = C / 2 - R / 2, L = N / 2 - m[g] / 2 - 1, I = dt(p[w], L), $ = dt(p[x], L), K = I, B = N - m[g] - $, M = N / 2 - m[g] / 2 + k, H = xo(K, M, B), O = !l.arrow && Vt(o) != null && M !== H && s.reference[g] / 2 - (M < K ? I : $) - m[g] / 2 < 0, G = O ? M < K ? M - K : M - B : 0;
|
|
4255
4255
|
return {
|
|
4256
|
-
[v]:
|
|
4256
|
+
[v]: h[v] + G,
|
|
4257
4257
|
data: {
|
|
4258
4258
|
[v]: H,
|
|
4259
4259
|
centerOffset: M - H - G,
|
|
@@ -4280,16 +4280,16 @@ const Th = (e) => ({
|
|
|
4280
4280
|
} = t, {
|
|
4281
4281
|
mainAxis: d = !0,
|
|
4282
4282
|
crossAxis: p = !0,
|
|
4283
|
-
fallbackPlacements:
|
|
4283
|
+
fallbackPlacements: h,
|
|
4284
4284
|
fallbackStrategy: v = "bestFit",
|
|
4285
4285
|
fallbackAxisSideDirection: g = "none",
|
|
4286
|
-
flipAlignment:
|
|
4286
|
+
flipAlignment: m = !0,
|
|
4287
4287
|
...b
|
|
4288
4288
|
} = rt(e, t);
|
|
4289
4289
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
4290
4290
|
return {};
|
|
4291
|
-
const w = ot(o), x = Ye(i), y = ot(i) === i, C = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), R =
|
|
4292
|
-
!
|
|
4291
|
+
const w = ot(o), x = Ye(i), y = ot(i) === i, C = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), R = h || (y || !m ? [nr(i)] : yh(i)), _ = g !== "none";
|
|
4292
|
+
!h && _ && R.push(...Eh(i, m, g, C));
|
|
4293
4293
|
const N = [i, ...R], k = await sn(t, b), L = [];
|
|
4294
4294
|
let I = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
4295
4295
|
if (d && L.push(k[w]), p) {
|
|
@@ -4406,7 +4406,7 @@ async function Ih(e, t) {
|
|
|
4406
4406
|
elements: o
|
|
4407
4407
|
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = ot(n), i = Vt(n), l = Ye(n) === "y", f = wi.has(a) ? -1 : 1, d = s && l ? -1 : 1, p = rt(t, e);
|
|
4408
4408
|
let {
|
|
4409
|
-
mainAxis:
|
|
4409
|
+
mainAxis: h,
|
|
4410
4410
|
crossAxis: v,
|
|
4411
4411
|
alignmentAxis: g
|
|
4412
4412
|
} = typeof p == "number" ? {
|
|
@@ -4420,9 +4420,9 @@ async function Ih(e, t) {
|
|
|
4420
4420
|
};
|
|
4421
4421
|
return i && typeof g == "number" && (v = i === "end" ? g * -1 : g), l ? {
|
|
4422
4422
|
x: v * d,
|
|
4423
|
-
y:
|
|
4423
|
+
y: h * f
|
|
4424
4424
|
} : {
|
|
4425
|
-
x:
|
|
4425
|
+
x: h * f,
|
|
4426
4426
|
y: v * d
|
|
4427
4427
|
};
|
|
4428
4428
|
}
|
|
@@ -4476,28 +4476,28 @@ const _h = function(e) {
|
|
|
4476
4476
|
} = rt(e, t), f = {
|
|
4477
4477
|
x: n,
|
|
4478
4478
|
y: r
|
|
4479
|
-
}, d = await sn(t, l), p = Ye(ot(o)),
|
|
4480
|
-
let v = f[
|
|
4479
|
+
}, d = await sn(t, l), p = Ye(ot(o)), h = Xo(p);
|
|
4480
|
+
let v = f[h], g = f[p];
|
|
4481
4481
|
if (s) {
|
|
4482
|
-
const b =
|
|
4482
|
+
const b = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", x = v + d[b], y = v - d[w];
|
|
4483
4483
|
v = xo(x, v, y);
|
|
4484
4484
|
}
|
|
4485
4485
|
if (a) {
|
|
4486
4486
|
const b = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", x = g + d[b], y = g - d[w];
|
|
4487
4487
|
g = xo(x, g, y);
|
|
4488
4488
|
}
|
|
4489
|
-
const
|
|
4489
|
+
const m = i.fn({
|
|
4490
4490
|
...t,
|
|
4491
|
-
[
|
|
4491
|
+
[h]: v,
|
|
4492
4492
|
[p]: g
|
|
4493
4493
|
});
|
|
4494
4494
|
return {
|
|
4495
|
-
...
|
|
4495
|
+
...m,
|
|
4496
4496
|
data: {
|
|
4497
|
-
x:
|
|
4498
|
-
y:
|
|
4497
|
+
x: m.x - n,
|
|
4498
|
+
y: m.y - r,
|
|
4499
4499
|
enabled: {
|
|
4500
|
-
[
|
|
4500
|
+
[h]: s,
|
|
4501
4501
|
[p]: a
|
|
4502
4502
|
}
|
|
4503
4503
|
}
|
|
@@ -4521,27 +4521,27 @@ const _h = function(e) {
|
|
|
4521
4521
|
} = rt(e, t), d = {
|
|
4522
4522
|
x: n,
|
|
4523
4523
|
y: r
|
|
4524
|
-
}, p = Ye(o),
|
|
4525
|
-
let v = d[
|
|
4526
|
-
const
|
|
4527
|
-
mainAxis:
|
|
4524
|
+
}, p = Ye(o), h = Xo(p);
|
|
4525
|
+
let v = d[h], g = d[p];
|
|
4526
|
+
const m = rt(i, t), b = typeof m == "number" ? {
|
|
4527
|
+
mainAxis: m,
|
|
4528
4528
|
crossAxis: 0
|
|
4529
4529
|
} : {
|
|
4530
4530
|
mainAxis: 0,
|
|
4531
4531
|
crossAxis: 0,
|
|
4532
|
-
...
|
|
4532
|
+
...m
|
|
4533
4533
|
};
|
|
4534
4534
|
if (l) {
|
|
4535
|
-
const y =
|
|
4535
|
+
const y = h === "y" ? "height" : "width", C = s.reference[h] - s.floating[y] + b.mainAxis, R = s.reference[h] + s.reference[y] - b.mainAxis;
|
|
4536
4536
|
v < C ? v = C : v > R && (v = R);
|
|
4537
4537
|
}
|
|
4538
4538
|
if (f) {
|
|
4539
4539
|
var w, x;
|
|
4540
|
-
const y =
|
|
4540
|
+
const y = h === "y" ? "width" : "height", C = wi.has(ot(o)), R = s.reference[p] - s.floating[y] + (C && ((w = a.offset) == null ? void 0 : w[p]) || 0) + (C ? 0 : b.crossAxis), _ = s.reference[p] + s.reference[y] + (C ? 0 : ((x = a.offset) == null ? void 0 : x[p]) || 0) - (C ? b.crossAxis : 0);
|
|
4541
4541
|
g < R ? g = R : g > _ && (g = _);
|
|
4542
4542
|
}
|
|
4543
4543
|
return {
|
|
4544
|
-
[
|
|
4544
|
+
[h]: v,
|
|
4545
4545
|
[p]: g
|
|
4546
4546
|
};
|
|
4547
4547
|
}
|
|
@@ -4561,17 +4561,17 @@ const _h = function(e) {
|
|
|
4561
4561
|
apply: l = () => {
|
|
4562
4562
|
},
|
|
4563
4563
|
...f
|
|
4564
|
-
} = rt(e, t), d = await sn(t, f), p = ot(o),
|
|
4564
|
+
} = rt(e, t), d = await sn(t, f), p = ot(o), h = Vt(o), v = Ye(o) === "y", {
|
|
4565
4565
|
width: g,
|
|
4566
|
-
height:
|
|
4566
|
+
height: m
|
|
4567
4567
|
} = s.floating;
|
|
4568
4568
|
let b, w;
|
|
4569
|
-
p === "top" || p === "bottom" ? (b = p, w =
|
|
4570
|
-
const x =
|
|
4569
|
+
p === "top" || p === "bottom" ? (b = p, w = h === (await (a.isRTL == null ? void 0 : a.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (w = p, b = h === "end" ? "top" : "bottom");
|
|
4570
|
+
const x = m - d.top - d.bottom, y = g - d.left - d.right, C = dt(m - d[b], x), R = dt(g - d[w], y), _ = !t.middlewareData.shift;
|
|
4571
4571
|
let N = C, k = R;
|
|
4572
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !
|
|
4572
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !h) {
|
|
4573
4573
|
const I = ke(d.left, 0), $ = ke(d.right, 0), K = ke(d.top, 0), B = ke(d.bottom, 0);
|
|
4574
|
-
v ? k = g - 2 * (I !== 0 || $ !== 0 ? I + $ : ke(d.left, d.right)) : N =
|
|
4574
|
+
v ? k = g - 2 * (I !== 0 || $ !== 0 ? I + $ : ke(d.left, d.right)) : N = m - 2 * (K !== 0 || B !== 0 ? K + B : ke(d.top, d.bottom));
|
|
4575
4575
|
}
|
|
4576
4576
|
await l({
|
|
4577
4577
|
...t,
|
|
@@ -4579,7 +4579,7 @@ const _h = function(e) {
|
|
|
4579
4579
|
availableHeight: N
|
|
4580
4580
|
});
|
|
4581
4581
|
const L = await a.getDimensions(i.floating);
|
|
4582
|
-
return g !== L.width ||
|
|
4582
|
+
return g !== L.width || m !== L.height ? {
|
|
4583
4583
|
reset: {
|
|
4584
4584
|
rects: !0
|
|
4585
4585
|
}
|
|
@@ -4748,11 +4748,11 @@ function xt(e, t, n, r) {
|
|
|
4748
4748
|
const i = Vh(s, n, r) ? Ci(s) : Je(0);
|
|
4749
4749
|
let l = (o.left + i.x) / a.x, f = (o.top + i.y) / a.y, d = o.width / a.x, p = o.height / a.y;
|
|
4750
4750
|
if (s) {
|
|
4751
|
-
const
|
|
4752
|
-
let g =
|
|
4753
|
-
for (;
|
|
4754
|
-
const b = Dt(
|
|
4755
|
-
l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = Me(
|
|
4751
|
+
const h = Me(s), v = r && ze(r) ? Me(r) : r;
|
|
4752
|
+
let g = h, m = Co(g);
|
|
4753
|
+
for (; m && r && v !== g; ) {
|
|
4754
|
+
const b = Dt(m), w = m.getBoundingClientRect(), x = We(m), y = w.left + (m.clientLeft + parseFloat(x.paddingLeft)) * b.x, C = w.top + (m.clientTop + parseFloat(x.paddingTop)) * b.y;
|
|
4755
|
+
l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = Me(m), m = Co(g);
|
|
4756
4756
|
}
|
|
4757
4757
|
}
|
|
4758
4758
|
return rr({
|
|
@@ -4792,12 +4792,12 @@ function Kh(e) {
|
|
|
4792
4792
|
const v = xt(r);
|
|
4793
4793
|
f = Dt(r), d.x = v.x + r.clientLeft, d.y = v.y + r.clientTop;
|
|
4794
4794
|
}
|
|
4795
|
-
const
|
|
4795
|
+
const h = a && !p && !s ? Ei(a, l) : Je(0);
|
|
4796
4796
|
return {
|
|
4797
4797
|
width: n.width * f.x,
|
|
4798
4798
|
height: n.height * f.y,
|
|
4799
|
-
x: n.x * f.x - l.scrollLeft * f.x + d.x +
|
|
4800
|
-
y: n.y * f.y - l.scrollTop * f.y + d.y +
|
|
4799
|
+
x: n.x * f.x - l.scrollLeft * f.x + d.x + h.x,
|
|
4800
|
+
y: n.y * f.y - l.scrollTop * f.y + d.y + h.y
|
|
4801
4801
|
};
|
|
4802
4802
|
}
|
|
4803
4803
|
function Gh(e) {
|
|
@@ -4825,7 +4825,7 @@ function Xh(e, t) {
|
|
|
4825
4825
|
}
|
|
4826
4826
|
const f = Cr(r);
|
|
4827
4827
|
if (f <= 0) {
|
|
4828
|
-
const d = r.ownerDocument, p = d.body,
|
|
4828
|
+
const d = r.ownerDocument, p = d.body, h = getComputedStyle(p), v = d.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, g = Math.abs(r.clientWidth - p.clientWidth - v);
|
|
4829
4829
|
g <= pa && (s -= g);
|
|
4830
4830
|
} else f <= pa && (s += f);
|
|
4831
4831
|
return {
|
|
@@ -4925,10 +4925,10 @@ function tm(e, t, n) {
|
|
|
4925
4925
|
l.x = v.x + t.clientLeft, l.y = v.y + t.clientTop;
|
|
4926
4926
|
} else o && f();
|
|
4927
4927
|
s && !r && o && f();
|
|
4928
|
-
const d = o && !r && !s ? Ei(o, i) : Je(0), p = a.left + i.scrollLeft - l.x - d.x,
|
|
4928
|
+
const d = o && !r && !s ? Ei(o, i) : Je(0), p = a.left + i.scrollLeft - l.x - d.x, h = a.top + i.scrollTop - l.y - d.y;
|
|
4929
4929
|
return {
|
|
4930
4930
|
x: p,
|
|
4931
|
-
y:
|
|
4931
|
+
y: h,
|
|
4932
4932
|
width: a.width,
|
|
4933
4933
|
height: a.height
|
|
4934
4934
|
};
|
|
@@ -5004,13 +5004,13 @@ function sm(e, t) {
|
|
|
5004
5004
|
const f = e.getBoundingClientRect(), {
|
|
5005
5005
|
left: d,
|
|
5006
5006
|
top: p,
|
|
5007
|
-
width:
|
|
5007
|
+
width: h,
|
|
5008
5008
|
height: v
|
|
5009
5009
|
} = f;
|
|
5010
|
-
if (i || t(), !
|
|
5010
|
+
if (i || t(), !h || !v)
|
|
5011
5011
|
return;
|
|
5012
|
-
const g = On(p),
|
|
5013
|
-
rootMargin: -g + "px " + -
|
|
5012
|
+
const g = On(p), m = On(o.clientWidth - (d + h)), b = On(o.clientHeight - (p + v)), w = On(d), y = {
|
|
5013
|
+
rootMargin: -g + "px " + -m + "px " + -b + "px " + -w + "px",
|
|
5014
5014
|
threshold: ke(0, dt(1, l)) || 1
|
|
5015
5015
|
};
|
|
5016
5016
|
let C = !0;
|
|
@@ -5053,19 +5053,19 @@ function am(e, t, n, r) {
|
|
|
5053
5053
|
}), s && w.addEventListener("resize", n);
|
|
5054
5054
|
});
|
|
5055
5055
|
const p = f && i ? sm(f, n) : null;
|
|
5056
|
-
let
|
|
5056
|
+
let h = -1, v = null;
|
|
5057
5057
|
a && (v = new ResizeObserver((w) => {
|
|
5058
5058
|
let [x] = w;
|
|
5059
|
-
x && x.target === f && v && (v.unobserve(t), cancelAnimationFrame(
|
|
5059
|
+
x && x.target === f && v && (v.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
5060
5060
|
var y;
|
|
5061
5061
|
(y = v) == null || y.observe(t);
|
|
5062
5062
|
})), n();
|
|
5063
5063
|
}), f && !l && v.observe(f), v.observe(t));
|
|
5064
|
-
let g,
|
|
5064
|
+
let g, m = l ? xt(e) : null;
|
|
5065
5065
|
l && b();
|
|
5066
5066
|
function b() {
|
|
5067
5067
|
const w = xt(e);
|
|
5068
|
-
|
|
5068
|
+
m && !Ti(m, w) && n(), m = w, g = requestAnimationFrame(b);
|
|
5069
5069
|
}
|
|
5070
5070
|
return n(), () => {
|
|
5071
5071
|
var w;
|
|
@@ -5153,10 +5153,10 @@ function gm(e) {
|
|
|
5153
5153
|
placement: t,
|
|
5154
5154
|
middlewareData: {},
|
|
5155
5155
|
isPositioned: !1
|
|
5156
|
-
}), [
|
|
5157
|
-
or(
|
|
5158
|
-
const [g,
|
|
5159
|
-
D !== _.current && (_.current = D,
|
|
5156
|
+
}), [h, v] = u.useState(r);
|
|
5157
|
+
or(h, r) || v(r);
|
|
5158
|
+
const [g, m] = u.useState(null), [b, w] = u.useState(null), x = u.useCallback((D) => {
|
|
5159
|
+
D !== _.current && (_.current = D, m(D));
|
|
5160
5160
|
}, []), y = u.useCallback((D) => {
|
|
5161
5161
|
D !== N.current && (N.current = D, w(D));
|
|
5162
5162
|
}, []), C = s || g, R = a || b, _ = u.useRef(null), N = u.useRef(null), k = u.useRef(d), L = l != null, I = ro(l), $ = ro(o), K = ro(f), B = u.useCallback(() => {
|
|
@@ -5165,7 +5165,7 @@ function gm(e) {
|
|
|
5165
5165
|
const D = {
|
|
5166
5166
|
placement: t,
|
|
5167
5167
|
strategy: n,
|
|
5168
|
-
middleware:
|
|
5168
|
+
middleware: h
|
|
5169
5169
|
};
|
|
5170
5170
|
$.current && (D.platform = $.current), pm(_.current, N.current, D).then((T) => {
|
|
5171
5171
|
const Q = {
|
|
@@ -5180,7 +5180,7 @@ function gm(e) {
|
|
|
5180
5180
|
p(Q);
|
|
5181
5181
|
}));
|
|
5182
5182
|
});
|
|
5183
|
-
}, [
|
|
5183
|
+
}, [h, t, n, $, K]);
|
|
5184
5184
|
zn(() => {
|
|
5185
5185
|
f === !1 && k.current.isPositioned && (k.current.isPositioned = !1, p((D) => ({
|
|
5186
5186
|
...D,
|
|
@@ -5333,7 +5333,7 @@ var Mi = "PopperAnchor", Di = u.forwardRef(
|
|
|
5333
5333
|
Di.displayName = Mi;
|
|
5334
5334
|
var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
5335
5335
|
(e, t) => {
|
|
5336
|
-
var z, W,
|
|
5336
|
+
var z, W, oe, V, X, te;
|
|
5337
5337
|
const {
|
|
5338
5338
|
__scopePopper: n,
|
|
5339
5339
|
side: r = "bottom",
|
|
@@ -5345,10 +5345,10 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5345
5345
|
collisionBoundary: f = [],
|
|
5346
5346
|
collisionPadding: d = 0,
|
|
5347
5347
|
sticky: p = "partial",
|
|
5348
|
-
hideWhenDetached:
|
|
5348
|
+
hideWhenDetached: h = !1,
|
|
5349
5349
|
updatePositionStrategy: v = "optimized",
|
|
5350
5350
|
onPlaced: g,
|
|
5351
|
-
...
|
|
5351
|
+
...m
|
|
5352
5352
|
} = e, b = Oi(ns, n), [w, x] = u.useState(null), y = ie(t, (me) => x(me)), [C, R] = u.useState(null), _ = Ii(C), N = (_ == null ? void 0 : _.width) ?? 0, k = (_ == null ? void 0 : _.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(f) ? f : [f], K = $.length > 0, B = {
|
|
5353
5353
|
padding: I,
|
|
5354
5354
|
boundary: $.filter(_m),
|
|
@@ -5382,13 +5382,13 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5382
5382
|
}),
|
|
5383
5383
|
C && Em({ element: C, padding: i }),
|
|
5384
5384
|
Om({ arrowWidth: N, arrowHeight: k }),
|
|
5385
|
-
|
|
5385
|
+
h && Cm({ strategy: "referenceHidden", ...B })
|
|
5386
5386
|
]
|
|
5387
5387
|
}), [T, Q] = Bi(O), q = ye(g);
|
|
5388
5388
|
we(() => {
|
|
5389
5389
|
G && (q == null || q());
|
|
5390
5390
|
}, [G, q]);
|
|
5391
|
-
const
|
|
5391
|
+
const ae = (z = D.arrow) == null ? void 0 : z.x, F = (W = D.arrow) == null ? void 0 : W.y, j = ((oe = D.arrow) == null ? void 0 : oe.centerOffset) !== 0, [ce, pe] = u.useState();
|
|
5392
5392
|
return we(() => {
|
|
5393
5393
|
w && pe(window.getComputedStyle(w).zIndex);
|
|
5394
5394
|
}, [w]), /* @__PURE__ */ c(
|
|
@@ -5421,7 +5421,7 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5421
5421
|
scope: n,
|
|
5422
5422
|
placedSide: T,
|
|
5423
5423
|
onArrowChange: R,
|
|
5424
|
-
arrowX:
|
|
5424
|
+
arrowX: ae,
|
|
5425
5425
|
arrowY: F,
|
|
5426
5426
|
shouldHideArrow: j,
|
|
5427
5427
|
children: /* @__PURE__ */ c(
|
|
@@ -5429,10 +5429,10 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
|
|
|
5429
5429
|
{
|
|
5430
5430
|
"data-side": T,
|
|
5431
5431
|
"data-align": Q,
|
|
5432
|
-
...
|
|
5432
|
+
...m,
|
|
5433
5433
|
ref: y,
|
|
5434
5434
|
style: {
|
|
5435
|
-
...
|
|
5435
|
+
...m.style,
|
|
5436
5436
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
5437
5437
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
5438
5438
|
animation: G ? void 0 : "none"
|
|
@@ -5505,9 +5505,9 @@ var Om = (e) => ({
|
|
|
5505
5505
|
options: e,
|
|
5506
5506
|
fn(t) {
|
|
5507
5507
|
var b, w, x;
|
|
5508
|
-
const { placement: n, rects: r, middlewareData: o } = t, a = ((b = o.arrow) == null ? void 0 : b.centerOffset) !== 0, i = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [f, d] = Bi(n), p = { start: "0%", center: "50%", end: "100%" }[d],
|
|
5509
|
-
let g = "",
|
|
5510
|
-
return f === "bottom" ? (g = a ? p : `${
|
|
5508
|
+
const { placement: n, rects: r, middlewareData: o } = t, a = ((b = o.arrow) == null ? void 0 : b.centerOffset) !== 0, i = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [f, d] = Bi(n), p = { start: "0%", center: "50%", end: "100%" }[d], h = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + i / 2, v = (((x = o.arrow) == null ? void 0 : x.y) ?? 0) + l / 2;
|
|
5509
|
+
let g = "", m = "";
|
|
5510
|
+
return f === "bottom" ? (g = a ? p : `${h}px`, m = `${-l}px`) : f === "top" ? (g = a ? p : `${h}px`, m = `${r.floating.height + l}px`) : f === "right" ? (g = `${-l}px`, m = a ? p : `${v}px`) : f === "left" && (g = `${r.floating.width + l}px`, m = a ? p : `${v}px`), { data: { x: g, y: m } };
|
|
5511
5511
|
}
|
|
5512
5512
|
});
|
|
5513
5513
|
function Bi(e) {
|
|
@@ -5541,14 +5541,14 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5541
5541
|
onEntryFocus: f,
|
|
5542
5542
|
preventScrollOnEntryFocus: d = !1,
|
|
5543
5543
|
...p
|
|
5544
|
-
} = e,
|
|
5544
|
+
} = e, h = u.useRef(null), v = ie(t, h), g = vr(s), [m, b] = ut({
|
|
5545
5545
|
prop: a,
|
|
5546
5546
|
defaultProp: i ?? null,
|
|
5547
5547
|
onChange: l,
|
|
5548
5548
|
caller: wn
|
|
5549
5549
|
}), [w, x] = u.useState(!1), y = ye(f), C = Ui(n), R = u.useRef(!1), [_, N] = u.useState(0);
|
|
5550
5550
|
return u.useEffect(() => {
|
|
5551
|
-
const k =
|
|
5551
|
+
const k = h.current;
|
|
5552
5552
|
if (k)
|
|
5553
5553
|
return k.addEventListener(oo, y), () => k.removeEventListener(oo, y);
|
|
5554
5554
|
}, [y]), /* @__PURE__ */ c(
|
|
@@ -5558,7 +5558,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5558
5558
|
orientation: r,
|
|
5559
5559
|
dir: g,
|
|
5560
5560
|
loop: o,
|
|
5561
|
-
currentTabStopId:
|
|
5561
|
+
currentTabStopId: m,
|
|
5562
5562
|
onItemFocus: u.useCallback(
|
|
5563
5563
|
(k) => b(k),
|
|
5564
5564
|
[b]
|
|
@@ -5588,7 +5588,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5588
5588
|
if (k.target === k.currentTarget && L && !w) {
|
|
5589
5589
|
const I = new CustomEvent(oo, Mm);
|
|
5590
5590
|
if (k.currentTarget.dispatchEvent(I), !I.defaultPrevented) {
|
|
5591
|
-
const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id ===
|
|
5591
|
+
const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id === m), H = [K, B, ...$].filter(
|
|
5592
5592
|
Boolean
|
|
5593
5593
|
).map((O) => O.ref.current);
|
|
5594
5594
|
Vi(H, d);
|
|
@@ -5610,7 +5610,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5610
5610
|
tabStopId: s,
|
|
5611
5611
|
children: a,
|
|
5612
5612
|
...i
|
|
5613
|
-
} = e, l = He(), f = s || l, d = $m(Wi, n), p = d.currentTabStopId === f,
|
|
5613
|
+
} = e, l = He(), f = s || l, d = $m(Wi, n), p = d.currentTabStopId === f, h = Ui(n), { onFocusableItemAdd: v, onFocusableItemRemove: g, currentTabStopId: m } = d;
|
|
5614
5614
|
return u.useEffect(() => {
|
|
5615
5615
|
if (r)
|
|
5616
5616
|
return v(), () => g();
|
|
@@ -5642,7 +5642,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5642
5642
|
if (w !== void 0) {
|
|
5643
5643
|
if (b.metaKey || b.ctrlKey || b.altKey || b.shiftKey) return;
|
|
5644
5644
|
b.preventDefault();
|
|
5645
|
-
let y =
|
|
5645
|
+
let y = h().filter((C) => C.focusable).map((C) => C.ref.current);
|
|
5646
5646
|
if (w === "last") y.reverse();
|
|
5647
5647
|
else if (w === "prev" || w === "next") {
|
|
5648
5648
|
w === "prev" && y.reverse();
|
|
@@ -5652,7 +5652,7 @@ var Bm = u.forwardRef((e, t) => {
|
|
|
5652
5652
|
setTimeout(() => Vi(y));
|
|
5653
5653
|
}
|
|
5654
5654
|
}),
|
|
5655
|
-
children: typeof a == "function" ? a({ isCurrentTabStop: p, hasTabStop:
|
|
5655
|
+
children: typeof a == "function" ? a({ isCurrentTabStop: p, hasTabStop: m != null }) : a
|
|
5656
5656
|
}
|
|
5657
5657
|
)
|
|
5658
5658
|
}
|
|
@@ -5710,22 +5710,22 @@ var jm = zi, Vm = ji, Km = function(e) {
|
|
|
5710
5710
|
};
|
|
5711
5711
|
o.forEach(f);
|
|
5712
5712
|
var d = function(p) {
|
|
5713
|
-
!p || l.has(p) || Array.prototype.forEach.call(p.children, function(
|
|
5714
|
-
if (i.has(
|
|
5715
|
-
d(
|
|
5713
|
+
!p || l.has(p) || Array.prototype.forEach.call(p.children, function(h) {
|
|
5714
|
+
if (i.has(h))
|
|
5715
|
+
d(h);
|
|
5716
5716
|
else
|
|
5717
5717
|
try {
|
|
5718
|
-
var v =
|
|
5719
|
-
It.set(
|
|
5718
|
+
var v = h.getAttribute(r), g = v !== null && v !== "false", m = (It.get(h) || 0) + 1, b = (s.get(h) || 0) + 1;
|
|
5719
|
+
It.set(h, m), s.set(h, b), a.push(h), m === 1 && g && kn.set(h, !0), b === 1 && h.setAttribute(n, "true"), g || h.setAttribute(r, "true");
|
|
5720
5720
|
} catch (w) {
|
|
5721
|
-
console.error("aria-hidden: cannot operate on ",
|
|
5721
|
+
console.error("aria-hidden: cannot operate on ", h, w);
|
|
5722
5722
|
}
|
|
5723
5723
|
});
|
|
5724
5724
|
};
|
|
5725
5725
|
return d(t), i.clear(), so++, function() {
|
|
5726
5726
|
a.forEach(function(p) {
|
|
5727
|
-
var
|
|
5728
|
-
It.set(p,
|
|
5727
|
+
var h = It.get(p) - 1, v = s.get(p) - 1;
|
|
5728
|
+
It.set(p, h), s.set(p, v), h || (kn.has(p) || p.removeAttribute(r), kn.delete(p)), v || p.removeAttribute(n);
|
|
5729
5729
|
}), so--, so || (It = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), Mn = {});
|
|
5730
5730
|
};
|
|
5731
5731
|
}, is = function(e, t, n) {
|
|
@@ -5883,11 +5883,11 @@ var Xi = rg(), io = function() {
|
|
|
5883
5883
|
onScrollCapture: io,
|
|
5884
5884
|
onWheelCapture: io,
|
|
5885
5885
|
onTouchMoveCapture: io
|
|
5886
|
-
}), o = r[0], s = r[1], a = e.forwardProps, i = e.children, l = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards,
|
|
5886
|
+
}), o = r[0], s = r[1], a = e.forwardProps, i = e.children, l = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards, h = e.sideCar, v = e.noRelative, g = e.noIsolation, m = e.inert, b = e.allowPinchZoom, w = e.as, x = w === void 0 ? "div" : w, y = e.gapMode, C = Gi(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), R = h, _ = eg([n, t]), N = Xe(Xe({}, C), o);
|
|
5887
5887
|
return u.createElement(
|
|
5888
5888
|
u.Fragment,
|
|
5889
5889
|
null,
|
|
5890
|
-
d && u.createElement(R, { sideCar: Xi, removeScrollBar: f, shards: p, noRelative: v, noIsolation: g, inert:
|
|
5890
|
+
d && u.createElement(R, { sideCar: Xi, removeScrollBar: f, shards: p, noRelative: v, noIsolation: g, inert: m, setCallbacks: s, allowPinchZoom: !!b, lockRef: n, gapMode: y }),
|
|
5891
5891
|
a ? u.cloneElement(u.Children.only(i), Xe(Xe({}, N), { ref: _ })) : u.createElement(x, Xe({}, N, { className: l, ref: _ }), i)
|
|
5892
5892
|
);
|
|
5893
5893
|
});
|
|
@@ -6086,12 +6086,12 @@ var _t = No ? { passive: !1 } : !1, vg = function(e) {
|
|
|
6086
6086
|
}, Cg = function(e, t) {
|
|
6087
6087
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
6088
6088
|
}, Eg = function(e, t, n, r, o) {
|
|
6089
|
-
var s = Cg(e, window.getComputedStyle(t).direction), a = s * r, i = n.target, l = t.contains(i), f = !1, d = a > 0, p = 0,
|
|
6089
|
+
var s = Cg(e, window.getComputedStyle(t).direction), a = s * r, i = n.target, l = t.contains(i), f = !1, d = a > 0, p = 0, h = 0;
|
|
6090
6090
|
do {
|
|
6091
6091
|
if (!i)
|
|
6092
6092
|
break;
|
|
6093
|
-
var v = Qi(e, i), g = v[0],
|
|
6094
|
-
(g || w) && Zi(e, i) && (p += w,
|
|
6093
|
+
var v = Qi(e, i), g = v[0], m = v[1], b = v[2], w = m - b - s * g;
|
|
6094
|
+
(g || w) && Zi(e, i) && (p += w, h += g);
|
|
6095
6095
|
var x = i.parentNode;
|
|
6096
6096
|
i = x && x.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? x.host : x;
|
|
6097
6097
|
} while (
|
|
@@ -6099,7 +6099,7 @@ var _t = No ? { passive: !1 } : !1, vg = function(e) {
|
|
|
6099
6099
|
!l && i !== document.body || // self content
|
|
6100
6100
|
l && (t.contains(i) || t === i)
|
|
6101
6101
|
);
|
|
6102
|
-
return (d && Math.abs(p) < 1 || !d && Math.abs(
|
|
6102
|
+
return (d && Math.abs(p) < 1 || !d && Math.abs(h) < 1) && (f = !0), f;
|
|
6103
6103
|
}, Ln = function(e) {
|
|
6104
6104
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
6105
6105
|
}, xa = function(e) {
|
|
@@ -6121,33 +6121,33 @@ function Ag(e) {
|
|
|
6121
6121
|
}, [e]), u.useEffect(function() {
|
|
6122
6122
|
if (e.inert) {
|
|
6123
6123
|
document.body.classList.add("block-interactivity-".concat(o));
|
|
6124
|
-
var
|
|
6125
|
-
return
|
|
6124
|
+
var m = Xm([e.lockRef.current], (e.shards || []).map(Sa), !0).filter(Boolean);
|
|
6125
|
+
return m.forEach(function(b) {
|
|
6126
6126
|
return b.classList.add("allow-interactivity-".concat(o));
|
|
6127
6127
|
}), function() {
|
|
6128
|
-
document.body.classList.remove("block-interactivity-".concat(o)),
|
|
6128
|
+
document.body.classList.remove("block-interactivity-".concat(o)), m.forEach(function(b) {
|
|
6129
6129
|
return b.classList.remove("allow-interactivity-".concat(o));
|
|
6130
6130
|
});
|
|
6131
6131
|
};
|
|
6132
6132
|
}
|
|
6133
6133
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
6134
|
-
var i = u.useCallback(function(
|
|
6135
|
-
if ("touches" in
|
|
6134
|
+
var i = u.useCallback(function(m, b) {
|
|
6135
|
+
if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
|
|
6136
6136
|
return !a.current.allowPinchZoom;
|
|
6137
|
-
var w = Ln(
|
|
6138
|
-
if ("touches" in
|
|
6137
|
+
var w = Ln(m), x = n.current, y = "deltaX" in m ? m.deltaX : x[0] - w[0], C = "deltaY" in m ? m.deltaY : x[1] - w[1], R, _ = m.target, N = Math.abs(y) > Math.abs(C) ? "h" : "v";
|
|
6138
|
+
if ("touches" in m && N === "h" && _.type === "range")
|
|
6139
6139
|
return !1;
|
|
6140
6140
|
var k = ya(N, _);
|
|
6141
6141
|
if (!k)
|
|
6142
6142
|
return !0;
|
|
6143
6143
|
if (k ? R = N : (R = N === "v" ? "h" : "v", k = ya(N, _)), !k)
|
|
6144
6144
|
return !1;
|
|
6145
|
-
if (!r.current && "changedTouches" in
|
|
6145
|
+
if (!r.current && "changedTouches" in m && (y || C) && (r.current = R), !R)
|
|
6146
6146
|
return !0;
|
|
6147
6147
|
var L = r.current || R;
|
|
6148
|
-
return Eg(L, b,
|
|
6149
|
-
}, []), l = u.useCallback(function(
|
|
6150
|
-
var b =
|
|
6148
|
+
return Eg(L, b, m, L === "h" ? y : C);
|
|
6149
|
+
}, []), l = u.useCallback(function(m) {
|
|
6150
|
+
var b = m;
|
|
6151
6151
|
if (!(!Ot.length || Ot[Ot.length - 1] !== s)) {
|
|
6152
6152
|
var w = "deltaY" in b ? xa(b) : Ln(b), x = t.current.filter(function(R) {
|
|
6153
6153
|
return R.name === b.type && (R.target === b.target || b.target === R.shadowParent) && Ng(R.delta, w);
|
|
@@ -6163,28 +6163,28 @@ function Ag(e) {
|
|
|
6163
6163
|
C && b.cancelable && b.preventDefault();
|
|
6164
6164
|
}
|
|
6165
6165
|
}
|
|
6166
|
-
}, []), f = u.useCallback(function(
|
|
6167
|
-
var y = { name:
|
|
6166
|
+
}, []), f = u.useCallback(function(m, b, w, x) {
|
|
6167
|
+
var y = { name: m, delta: b, target: w, should: x, shadowParent: Pg(w) };
|
|
6168
6168
|
t.current.push(y), setTimeout(function() {
|
|
6169
6169
|
t.current = t.current.filter(function(C) {
|
|
6170
6170
|
return C !== y;
|
|
6171
6171
|
});
|
|
6172
6172
|
}, 1);
|
|
6173
|
-
}, []), d = u.useCallback(function(
|
|
6174
|
-
n.current = Ln(
|
|
6175
|
-
}, []), p = u.useCallback(function(
|
|
6176
|
-
f(
|
|
6177
|
-
}, []),
|
|
6178
|
-
f(
|
|
6173
|
+
}, []), d = u.useCallback(function(m) {
|
|
6174
|
+
n.current = Ln(m), r.current = void 0;
|
|
6175
|
+
}, []), p = u.useCallback(function(m) {
|
|
6176
|
+
f(m.type, xa(m), m.target, i(m, e.lockRef.current));
|
|
6177
|
+
}, []), h = u.useCallback(function(m) {
|
|
6178
|
+
f(m.type, Ln(m), m.target, i(m, e.lockRef.current));
|
|
6179
6179
|
}, []);
|
|
6180
6180
|
u.useEffect(function() {
|
|
6181
6181
|
return Ot.push(s), e.setCallbacks({
|
|
6182
6182
|
onScrollCapture: p,
|
|
6183
6183
|
onWheelCapture: p,
|
|
6184
|
-
onTouchMoveCapture:
|
|
6184
|
+
onTouchMoveCapture: h
|
|
6185
6185
|
}), document.addEventListener("wheel", l, _t), document.addEventListener("touchmove", l, _t), document.addEventListener("touchstart", d, _t), function() {
|
|
6186
|
-
Ot = Ot.filter(function(
|
|
6187
|
-
return
|
|
6186
|
+
Ot = Ot.filter(function(m) {
|
|
6187
|
+
return m !== s;
|
|
6188
6188
|
}), document.removeEventListener("wheel", l, _t), document.removeEventListener("touchmove", l, _t), document.removeEventListener("touchstart", d, _t);
|
|
6189
6189
|
};
|
|
6190
6190
|
}, []);
|
|
@@ -6217,7 +6217,7 @@ var Ro = ["Enter", " "], _g = ["ArrowDown", "PageUp", "Home"], ec = ["ArrowUp",
|
|
|
6217
6217
|
Gt,
|
|
6218
6218
|
Hi
|
|
6219
6219
|
]), Tr = Gt(), nc = Hi(), [Fg, Rt] = Nt(yn), [$g, xn] = Nt(yn), rc = (e) => {
|
|
6220
|
-
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = Tr(t), [l, f] = u.useState(null), d = u.useRef(!1), p = ye(s),
|
|
6220
|
+
const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: a = !0 } = e, i = Tr(t), [l, f] = u.useState(null), d = u.useRef(!1), p = ye(s), h = vr(o);
|
|
6221
6221
|
return u.useEffect(() => {
|
|
6222
6222
|
const v = () => {
|
|
6223
6223
|
d.current = !0, document.addEventListener("pointerdown", g, { capture: !0, once: !0 }), document.addEventListener("pointermove", g, { capture: !0, once: !0 });
|
|
@@ -6239,7 +6239,7 @@ var Ro = ["Enter", " "], _g = ["ArrowDown", "PageUp", "Home"], ec = ["ArrowUp",
|
|
|
6239
6239
|
scope: t,
|
|
6240
6240
|
onClose: u.useCallback(() => p(!1), [p]),
|
|
6241
6241
|
isUsingKeyboardRef: d,
|
|
6242
|
-
dir:
|
|
6242
|
+
dir: h,
|
|
6243
6243
|
modal: a,
|
|
6244
6244
|
children: r
|
|
6245
6245
|
}
|
|
@@ -6316,21 +6316,21 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6316
6316
|
onEscapeKeyDown: f,
|
|
6317
6317
|
onPointerDownOutside: d,
|
|
6318
6318
|
onFocusOutside: p,
|
|
6319
|
-
onInteractOutside:
|
|
6319
|
+
onInteractOutside: h,
|
|
6320
6320
|
onDismiss: v,
|
|
6321
6321
|
disableOutsideScroll: g,
|
|
6322
|
-
...
|
|
6322
|
+
...m
|
|
6323
6323
|
} = e, b = Rt(Fe, n), w = xn(Fe, n), x = Tr(n), y = nc(n), C = Dg(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), I = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Rr : u.Fragment, O = g ? { as: jg, allowPinchZoom: !0 } : void 0, G = (T) => {
|
|
6324
6324
|
var z, W;
|
|
6325
|
-
const Q = I.current + T, q = C().filter((
|
|
6326
|
-
(function
|
|
6327
|
-
I.current = V, window.clearTimeout(L.current), V !== "" && (L.current = window.setTimeout(() =>
|
|
6325
|
+
const Q = I.current + T, q = C().filter((oe) => !oe.disabled), ae = document.activeElement, F = (z = q.find((oe) => oe.ref.current === ae)) == null ? void 0 : z.textValue, j = q.map((oe) => oe.textValue), ce = nb(j, Q, F), pe = (W = q.find((oe) => oe.textValue === ce)) == null ? void 0 : W.ref.current;
|
|
6326
|
+
(function oe(V) {
|
|
6327
|
+
I.current = V, window.clearTimeout(L.current), V !== "" && (L.current = window.setTimeout(() => oe(""), 1e3));
|
|
6328
6328
|
})(Q), pe && setTimeout(() => pe.focus());
|
|
6329
6329
|
};
|
|
6330
6330
|
u.useEffect(() => () => window.clearTimeout(L.current), []), qo();
|
|
6331
6331
|
const D = u.useCallback((T) => {
|
|
6332
|
-
var q,
|
|
6333
|
-
return B.current === ((q = K.current) == null ? void 0 : q.side) && ob(T, (
|
|
6332
|
+
var q, ae;
|
|
6333
|
+
return B.current === ((q = K.current) == null ? void 0 : q.side) && ob(T, (ae = K.current) == null ? void 0 : ae.area);
|
|
6334
6334
|
}, []);
|
|
6335
6335
|
return /* @__PURE__ */ c(
|
|
6336
6336
|
Hg,
|
|
@@ -6378,7 +6378,7 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6378
6378
|
onEscapeKeyDown: f,
|
|
6379
6379
|
onPointerDownOutside: d,
|
|
6380
6380
|
onFocusOutside: p,
|
|
6381
|
-
onInteractOutside:
|
|
6381
|
+
onInteractOutside: h,
|
|
6382
6382
|
onDismiss: v,
|
|
6383
6383
|
children: /* @__PURE__ */ c(
|
|
6384
6384
|
jm,
|
|
@@ -6403,12 +6403,12 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6403
6403
|
"data-radix-menu-content": "",
|
|
6404
6404
|
dir: w.dir,
|
|
6405
6405
|
...x,
|
|
6406
|
-
...
|
|
6406
|
+
...m,
|
|
6407
6407
|
ref: k,
|
|
6408
|
-
style: { outline: "none", ...
|
|
6409
|
-
onKeyDown: U(
|
|
6410
|
-
const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget,
|
|
6411
|
-
q && (T.key === "Tab" && T.preventDefault(), !
|
|
6408
|
+
style: { outline: "none", ...m.style },
|
|
6409
|
+
onKeyDown: U(m.onKeyDown, (T) => {
|
|
6410
|
+
const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget, ae = T.ctrlKey || T.altKey || T.metaKey, F = T.key.length === 1;
|
|
6411
|
+
q && (T.key === "Tab" && T.preventDefault(), !ae && F && G(T.key));
|
|
6412
6412
|
const j = N.current;
|
|
6413
6413
|
if (T.target !== j || !Og.includes(T.key)) return;
|
|
6414
6414
|
T.preventDefault();
|
|
@@ -6423,8 +6423,8 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
|
|
|
6423
6423
|
ln((T) => {
|
|
6424
6424
|
const Q = T.target, q = M.current !== T.clientX;
|
|
6425
6425
|
if (T.currentTarget.contains(Q) && q) {
|
|
6426
|
-
const
|
|
6427
|
-
B.current =
|
|
6426
|
+
const ae = T.clientX > M.current ? "right" : "left";
|
|
6427
|
+
B.current = ae, M.current = T.clientX;
|
|
6428
6428
|
}
|
|
6429
6429
|
})
|
|
6430
6430
|
)
|
|
@@ -6460,8 +6460,8 @@ var sr = "MenuItem", Ca = "menu.itemSelect", Ar = u.forwardRef(
|
|
|
6460
6460
|
const { disabled: n = !1, onSelect: r, ...o } = e, s = u.useRef(null), a = xn(sr, e.__scopeMenu), i = us(sr, e.__scopeMenu), l = ie(t, s), f = u.useRef(!1), d = () => {
|
|
6461
6461
|
const p = s.current;
|
|
6462
6462
|
if (!n && p) {
|
|
6463
|
-
const
|
|
6464
|
-
p.addEventListener(Ca, (v) => r == null ? void 0 : r(v), { once: !0 }), li(p,
|
|
6463
|
+
const h = new CustomEvent(Ca, { bubbles: !0, cancelable: !0 });
|
|
6464
|
+
p.addEventListener(Ca, (v) => r == null ? void 0 : r(v), { once: !0 }), li(p, h), h.defaultPrevented ? f.current = !1 : a.onClose();
|
|
6465
6465
|
}
|
|
6466
6466
|
};
|
|
6467
6467
|
return /* @__PURE__ */ c(
|
|
@@ -6472,16 +6472,16 @@ var sr = "MenuItem", Ca = "menu.itemSelect", Ar = u.forwardRef(
|
|
|
6472
6472
|
disabled: n,
|
|
6473
6473
|
onClick: U(e.onClick, d),
|
|
6474
6474
|
onPointerDown: (p) => {
|
|
6475
|
-
var
|
|
6476
|
-
(
|
|
6475
|
+
var h;
|
|
6476
|
+
(h = e.onPointerDown) == null || h.call(e, p), f.current = !0;
|
|
6477
6477
|
},
|
|
6478
6478
|
onPointerUp: U(e.onPointerUp, (p) => {
|
|
6479
|
-
var
|
|
6480
|
-
f.current || (
|
|
6479
|
+
var h;
|
|
6480
|
+
f.current || (h = p.currentTarget) == null || h.click();
|
|
6481
6481
|
}),
|
|
6482
6482
|
onKeyDown: U(e.onKeyDown, (p) => {
|
|
6483
|
-
const
|
|
6484
|
-
n ||
|
|
6483
|
+
const h = i.searchRef.current !== "";
|
|
6484
|
+
n || h && p.key === " " || Ro.includes(p.key) && (p.currentTarget.click(), p.preventDefault());
|
|
6485
6485
|
})
|
|
6486
6486
|
}
|
|
6487
6487
|
);
|
|
@@ -6490,7 +6490,7 @@ var sr = "MenuItem", Ca = "menu.itemSelect", Ar = u.forwardRef(
|
|
|
6490
6490
|
Ar.displayName = sr;
|
|
6491
6491
|
var cc = u.forwardRef(
|
|
6492
6492
|
(e, t) => {
|
|
6493
|
-
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, a = us(sr, n), i = nc(n), l = u.useRef(null), f = ie(t, l), [d, p] = u.useState(!1), [
|
|
6493
|
+
const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, a = us(sr, n), i = nc(n), l = u.useRef(null), f = ie(t, l), [d, p] = u.useState(!1), [h, v] = u.useState("");
|
|
6494
6494
|
return u.useEffect(() => {
|
|
6495
6495
|
const g = l.current;
|
|
6496
6496
|
g && v((g.textContent ?? "").trim());
|
|
@@ -6499,7 +6499,7 @@ var cc = u.forwardRef(
|
|
|
6499
6499
|
{
|
|
6500
6500
|
scope: n,
|
|
6501
6501
|
disabled: r,
|
|
6502
|
-
textValue: o ??
|
|
6502
|
+
textValue: o ?? h,
|
|
6503
6503
|
children: /* @__PURE__ */ c(Vm, { asChild: !0, ...i, focusable: !r, children: /* @__PURE__ */ c(
|
|
6504
6504
|
ee.div,
|
|
6505
6505
|
{
|
|
@@ -6648,8 +6648,8 @@ var Qg = "MenuSub", [zy, vc] = Nt(Qg), Qt = "MenuSubTrigger", wc = u.forwardRef(
|
|
|
6648
6648
|
...e,
|
|
6649
6649
|
ref: Wo(t, o.onTriggerChange),
|
|
6650
6650
|
onClick: (p) => {
|
|
6651
|
-
var
|
|
6652
|
-
(
|
|
6651
|
+
var h;
|
|
6652
|
+
(h = e.onClick) == null || h.call(e, p), !(e.disabled || p.defaultPrevented) && (p.currentTarget.focus(), n.open || n.onOpenChange(!0));
|
|
6653
6653
|
},
|
|
6654
6654
|
onPointerMove: U(
|
|
6655
6655
|
e.onPointerMove,
|
|
@@ -6664,20 +6664,20 @@ var Qg = "MenuSub", [zy, vc] = Nt(Qg), Qt = "MenuSubTrigger", wc = u.forwardRef(
|
|
|
6664
6664
|
ln((p) => {
|
|
6665
6665
|
var v, g;
|
|
6666
6666
|
d();
|
|
6667
|
-
const
|
|
6668
|
-
if (
|
|
6669
|
-
const
|
|
6667
|
+
const h = (v = n.content) == null ? void 0 : v.getBoundingClientRect();
|
|
6668
|
+
if (h) {
|
|
6669
|
+
const m = (g = n.content) == null ? void 0 : g.dataset.side, b = m === "right", w = b ? -5 : 5, x = h[b ? "left" : "right"], y = h[b ? "right" : "left"];
|
|
6670
6670
|
s.onPointerGraceIntentChange({
|
|
6671
6671
|
area: [
|
|
6672
6672
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
6673
6673
|
// consistently within polygon bounds
|
|
6674
6674
|
{ x: p.clientX + w, y: p.clientY },
|
|
6675
|
-
{ x, y:
|
|
6676
|
-
{ x: y, y:
|
|
6677
|
-
{ x: y, y:
|
|
6678
|
-
{ x, y:
|
|
6675
|
+
{ x, y: h.top },
|
|
6676
|
+
{ x: y, y: h.top },
|
|
6677
|
+
{ x: y, y: h.bottom },
|
|
6678
|
+
{ x, y: h.bottom }
|
|
6679
6679
|
],
|
|
6680
|
-
side:
|
|
6680
|
+
side: m
|
|
6681
6681
|
}), window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
6682
6682
|
() => s.onPointerGraceIntentChange(null),
|
|
6683
6683
|
300
|
|
@@ -6690,8 +6690,8 @@ var Qg = "MenuSub", [zy, vc] = Nt(Qg), Qt = "MenuSubTrigger", wc = u.forwardRef(
|
|
|
6690
6690
|
),
|
|
6691
6691
|
onKeyDown: U(e.onKeyDown, (p) => {
|
|
6692
6692
|
var v;
|
|
6693
|
-
const
|
|
6694
|
-
e.disabled ||
|
|
6693
|
+
const h = s.searchRef.current !== "";
|
|
6694
|
+
e.disabled || h && p.key === " " || kg[r.dir].includes(p.key) && (n.onOpenChange(!0), (v = n.content) == null || v.focus(), p.preventDefault());
|
|
6695
6695
|
})
|
|
6696
6696
|
}
|
|
6697
6697
|
) });
|
|
@@ -6726,8 +6726,8 @@ var yc = "MenuSubContent", xc = u.forwardRef(
|
|
|
6726
6726
|
}),
|
|
6727
6727
|
onKeyDown: U(e.onKeyDown, (d) => {
|
|
6728
6728
|
var v;
|
|
6729
|
-
const p = d.currentTarget.contains(d.target),
|
|
6730
|
-
p &&
|
|
6729
|
+
const p = d.currentTarget.contains(d.target), h = Mg[a.dir].includes(d.key);
|
|
6730
|
+
p && h && (s.onOpenChange(!1), (v = i.trigger) == null || v.focus(), d.preventDefault());
|
|
6731
6731
|
})
|
|
6732
6732
|
}
|
|
6733
6733
|
) }) }) });
|
|
@@ -6764,8 +6764,8 @@ function rb(e, t) {
|
|
|
6764
6764
|
const { x: n, y: r } = e;
|
|
6765
6765
|
let o = !1;
|
|
6766
6766
|
for (let s = 0, a = t.length - 1; s < t.length; a = s++) {
|
|
6767
|
-
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x,
|
|
6768
|
-
d > r !=
|
|
6767
|
+
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x, h = l.y;
|
|
6768
|
+
d > r != h > r && n < (p - f) * (r - d) / (h - d) + f && (o = !o);
|
|
6769
6769
|
}
|
|
6770
6770
|
return o;
|
|
6771
6771
|
}
|
|
@@ -6804,7 +6804,7 @@ var sb = rc, ab = cs, ib = sc, cb = ac, lb = fs, ub = ic, db = Ar, fb = lc, pb =
|
|
|
6804
6804
|
contentId: He(),
|
|
6805
6805
|
open: d,
|
|
6806
6806
|
onOpenChange: p,
|
|
6807
|
-
onOpenToggle: u.useCallback(() => p((
|
|
6807
|
+
onOpenToggle: u.useCallback(() => p((h) => !h), [p]),
|
|
6808
6808
|
modal: i,
|
|
6809
6809
|
children: /* @__PURE__ */ c(sb, { ...l, open: d, onOpenChange: p, dir: r, modal: i, children: n })
|
|
6810
6810
|
}
|
|
@@ -7079,10 +7079,10 @@ function Vn({
|
|
|
7079
7079
|
onError: p
|
|
7080
7080
|
}) {
|
|
7081
7081
|
const {
|
|
7082
|
-
currentThreadId:
|
|
7082
|
+
currentThreadId: h,
|
|
7083
7083
|
messages: v,
|
|
7084
7084
|
isStreaming: g,
|
|
7085
|
-
streamingAssistantId:
|
|
7085
|
+
streamingAssistantId: m,
|
|
7086
7086
|
error: b,
|
|
7087
7087
|
send: w,
|
|
7088
7088
|
stop: x,
|
|
@@ -7097,11 +7097,11 @@ function Vn({
|
|
|
7097
7097
|
} = ai();
|
|
7098
7098
|
try {
|
|
7099
7099
|
const P = typeof window < "u" ? localStorage.getItem("currentThreadId") : null;
|
|
7100
|
-
console.log("ChatInterface debug - useChat()", { currentThreadId:
|
|
7100
|
+
console.log("ChatInterface debug - useChat()", { currentThreadId: h, lastCheckpointId: y, lsThread: P });
|
|
7101
7101
|
} catch (P) {
|
|
7102
7102
|
console.log("ChatInterface debug - localStorage not available", P);
|
|
7103
7103
|
}
|
|
7104
|
-
const [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q,
|
|
7104
|
+
const [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, ae] = re(null), [F, j] = re(null), [ce, pe] = re(!1), [z, W] = re(null), [oe, V] = re([]), [X, te] = re(null), me = Te(null), de = Te(null), Z = Te(null), Y = Te(null), he = Te(null), Oe = Te(!1), Ce = Te(!0), Xt = Te(0), st = Te(null), [Tt, Hr] = re("desktop");
|
|
7105
7105
|
ge(() => {
|
|
7106
7106
|
const P = () => {
|
|
7107
7107
|
const J = window.innerWidth;
|
|
@@ -7110,16 +7110,16 @@ function Vn({
|
|
|
7110
7110
|
return P(), window.addEventListener("resize", P), () => window.removeEventListener("resize", P);
|
|
7111
7111
|
}, []), ge(() => {
|
|
7112
7112
|
let P = !1;
|
|
7113
|
-
if (!
|
|
7113
|
+
if (!h) {
|
|
7114
7114
|
V([]), te(null), st.current = null;
|
|
7115
7115
|
return;
|
|
7116
7116
|
}
|
|
7117
7117
|
const J = {
|
|
7118
|
-
threadId:
|
|
7118
|
+
threadId: h,
|
|
7119
7119
|
checkpointId: y ?? null
|
|
7120
7120
|
}, le = st.current;
|
|
7121
7121
|
if (!(le && le.threadId === J.threadId && le.checkpointId === J.checkpointId))
|
|
7122
|
-
return st.current = J, C(
|
|
7122
|
+
return st.current = J, C(h).then((ue) => {
|
|
7123
7123
|
if (console.log("ChatInterface debug - listCheckpoints response:", ue), P) return;
|
|
7124
7124
|
const De = ((ue == null ? void 0 : ue.checkpoints) ?? []).slice().sort((at, Tn) => new Date(Tn.createdAt).getTime() - new Date(at.createdAt).getTime());
|
|
7125
7125
|
console.log("ChatInterface debug - computed checkpoints:", De), V(De), te((at) => {
|
|
@@ -7131,7 +7131,7 @@ function Vn({
|
|
|
7131
7131
|
}), () => {
|
|
7132
7132
|
P = !0;
|
|
7133
7133
|
};
|
|
7134
|
-
}, [
|
|
7134
|
+
}, [h, y, C]), ge(() => {
|
|
7135
7135
|
y && te(y);
|
|
7136
7136
|
}, [y]);
|
|
7137
7137
|
const At = ve(async () => {
|
|
@@ -7228,19 +7228,19 @@ function Vn({
|
|
|
7228
7228
|
M(null), K(""), O(null), de.current && (de.current.style.height = "auto");
|
|
7229
7229
|
}, En = (P) => {
|
|
7230
7230
|
P.key === "Enter" && !P.shiftKey ? (P.preventDefault(), Cn()) : P.key === "Escape" && B && (P.preventDefault(), Yt());
|
|
7231
|
-
},
|
|
7231
|
+
}, se = (P) => {
|
|
7232
7232
|
const J = Array.from(P.target.files || []);
|
|
7233
7233
|
D((le) => [...le, ...J]);
|
|
7234
7234
|
}, xe = (P) => D((J) => J.filter((le, ue) => P !== ue)), Ne = async (P) => {
|
|
7235
7235
|
const J = (P.target.files || [])[0];
|
|
7236
7236
|
if (J) {
|
|
7237
|
-
|
|
7237
|
+
ae(null), j(null), Q(!0);
|
|
7238
7238
|
try {
|
|
7239
7239
|
const le = await I.uploadExcel(J), ue = le.sheets.map((at) => `${at.sheetName} -> ${at.tableName}`).join(", "), De = ue ? `Uploaded ${J.name} (${le.sheets.length} sheet${le.sheets.length === 1 ? "" : "s"}: ${ue})` : `Uploaded ${J.name}`;
|
|
7240
7240
|
j(De), d == null || d({ file: J, response: le });
|
|
7241
7241
|
} catch (le) {
|
|
7242
7242
|
const ue = le instanceof Error ? le.message : "Failed to upload Excel file";
|
|
7243
|
-
console.error("Excel upload failed", le),
|
|
7243
|
+
console.error("Excel upload failed", le), ae(ue), p == null || p(ue);
|
|
7244
7244
|
} finally {
|
|
7245
7245
|
Q(!1), P.target.value = "";
|
|
7246
7246
|
}
|
|
@@ -7250,7 +7250,7 @@ function Vn({
|
|
|
7250
7250
|
const J = Date.parse(P);
|
|
7251
7251
|
return Number.isNaN(J) ? P : new Date(J).toLocaleString();
|
|
7252
7252
|
}, tt = async (P) => {
|
|
7253
|
-
if (
|
|
7253
|
+
if (h) {
|
|
7254
7254
|
if (!P) {
|
|
7255
7255
|
await _(), te(null);
|
|
7256
7256
|
return;
|
|
@@ -7273,7 +7273,8 @@ function Vn({
|
|
|
7273
7273
|
}
|
|
7274
7274
|
)
|
|
7275
7275
|
] }),
|
|
7276
|
-
|
|
7276
|
+
(console.log("Checkpoint toolbar render", { currentThreadId: h, checkpoints: oe, activeCheckpointId: X }), null),
|
|
7277
|
+
h && oe.length > 0 && /* @__PURE__ */ E("div", { className: "flex-shrink-0 flex items-center gap-2 px-4 py-2 border-b border-border bg-muted/60 text-xs dark:bg-muted/50", children: [
|
|
7277
7278
|
/* @__PURE__ */ c("span", { className: "opacity-70", children: "Checkpoint:" }),
|
|
7278
7279
|
/* @__PURE__ */ E(
|
|
7279
7280
|
"select",
|
|
@@ -7286,7 +7287,7 @@ function Vn({
|
|
|
7286
7287
|
},
|
|
7287
7288
|
children: [
|
|
7288
7289
|
/* @__PURE__ */ c("option", { value: "", children: "Latest" }),
|
|
7289
|
-
|
|
7290
|
+
oe.map((P) => /* @__PURE__ */ E("option", { value: P.checkpointId, children: [
|
|
7290
7291
|
Be(P.createdAt),
|
|
7291
7292
|
P.preview ? ` — ${P.preview.slice(0, 40)}` : ""
|
|
7292
7293
|
] }, P.checkpointId))
|
|
@@ -7308,7 +7309,7 @@ function Vn({
|
|
|
7308
7309
|
{
|
|
7309
7310
|
message: P,
|
|
7310
7311
|
messageIndex: J,
|
|
7311
|
-
isStreamingMessage: g &&
|
|
7312
|
+
isStreamingMessage: g && m === P.id,
|
|
7312
7313
|
streamingDebounceMs: o,
|
|
7313
7314
|
isEditing: B === P.id,
|
|
7314
7315
|
showActions: i,
|
|
@@ -7356,7 +7357,7 @@ function Vn({
|
|
|
7356
7357
|
ref: Z,
|
|
7357
7358
|
type: "file",
|
|
7358
7359
|
multiple: !0,
|
|
7359
|
-
onChange: (P) =>
|
|
7360
|
+
onChange: (P) => se(P),
|
|
7360
7361
|
className: "hidden"
|
|
7361
7362
|
}
|
|
7362
7363
|
),
|
|
@@ -7511,7 +7512,7 @@ var ms = "ScrollArea", [qc, jy] = Ve(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
|
|
|
7511
7512
|
dir: o,
|
|
7512
7513
|
scrollHideDelay: s = 600,
|
|
7513
7514
|
...a
|
|
7514
|
-
} = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p,
|
|
7515
|
+
} = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p, h] = u.useState(null), [v, g] = u.useState(null), [m, b] = u.useState(null), [w, x] = u.useState(0), [y, C] = u.useState(0), [R, _] = u.useState(!1), [N, k] = u.useState(!1), L = ie(t, ($) => l($)), I = vr(o);
|
|
7515
7516
|
return /* @__PURE__ */ c(
|
|
7516
7517
|
Xb,
|
|
7517
7518
|
{
|
|
@@ -7523,12 +7524,12 @@ var ms = "ScrollArea", [qc, jy] = Ve(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
|
|
|
7523
7524
|
viewport: f,
|
|
7524
7525
|
onViewportChange: d,
|
|
7525
7526
|
content: p,
|
|
7526
|
-
onContentChange:
|
|
7527
|
+
onContentChange: h,
|
|
7527
7528
|
scrollbarX: v,
|
|
7528
7529
|
onScrollbarXChange: g,
|
|
7529
7530
|
scrollbarXEnabled: R,
|
|
7530
7531
|
onScrollbarXEnabledChange: _,
|
|
7531
|
-
scrollbarY:
|
|
7532
|
+
scrollbarY: m,
|
|
7532
7533
|
onScrollbarYChange: b,
|
|
7533
7534
|
scrollbarYEnabled: N,
|
|
7534
7535
|
onScrollbarYEnabledChange: k,
|
|
@@ -7656,11 +7657,11 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7656
7657
|
const f = o.viewport, d = s ? "scrollLeft" : "scrollTop";
|
|
7657
7658
|
if (f) {
|
|
7658
7659
|
let p = f[d];
|
|
7659
|
-
const
|
|
7660
|
+
const h = () => {
|
|
7660
7661
|
const v = f[d];
|
|
7661
7662
|
p !== v && (l("SCROLL"), a()), p = v;
|
|
7662
7663
|
};
|
|
7663
|
-
return f.addEventListener("scroll",
|
|
7664
|
+
return f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
|
|
7664
7665
|
}
|
|
7665
7666
|
}, [o.viewport, s, l, a]), /* @__PURE__ */ c(_e, { present: n || i !== "hidden", children: /* @__PURE__ */ c(
|
|
7666
7667
|
bs,
|
|
@@ -7697,12 +7698,12 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7697
7698
|
sizes: i,
|
|
7698
7699
|
onSizesChange: l,
|
|
7699
7700
|
hasThumb: f > 0 && f < 1,
|
|
7700
|
-
onThumbChange: (
|
|
7701
|
+
onThumbChange: (h) => s.current = h,
|
|
7701
7702
|
onThumbPointerUp: () => a.current = 0,
|
|
7702
|
-
onThumbPointerDown: (
|
|
7703
|
+
onThumbPointerDown: (h) => a.current = h
|
|
7703
7704
|
};
|
|
7704
|
-
function p(
|
|
7705
|
-
return rv(
|
|
7705
|
+
function p(h, v) {
|
|
7706
|
+
return rv(h, a.current, i, v);
|
|
7706
7707
|
}
|
|
7707
7708
|
return n === "horizontal" ? /* @__PURE__ */ c(
|
|
7708
7709
|
Zb,
|
|
@@ -7711,15 +7712,15 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7711
7712
|
ref: t,
|
|
7712
7713
|
onThumbPositionChange: () => {
|
|
7713
7714
|
if (o.viewport && s.current) {
|
|
7714
|
-
const
|
|
7715
|
+
const h = o.viewport.scrollLeft, v = Ea(h, i, o.dir);
|
|
7715
7716
|
s.current.style.transform = `translate3d(${v}px, 0, 0)`;
|
|
7716
7717
|
}
|
|
7717
7718
|
},
|
|
7718
|
-
onWheelScroll: (
|
|
7719
|
-
o.viewport && (o.viewport.scrollLeft =
|
|
7719
|
+
onWheelScroll: (h) => {
|
|
7720
|
+
o.viewport && (o.viewport.scrollLeft = h);
|
|
7720
7721
|
},
|
|
7721
|
-
onDragScroll: (
|
|
7722
|
-
o.viewport && (o.viewport.scrollLeft = p(
|
|
7722
|
+
onDragScroll: (h) => {
|
|
7723
|
+
o.viewport && (o.viewport.scrollLeft = p(h, o.dir));
|
|
7723
7724
|
}
|
|
7724
7725
|
}
|
|
7725
7726
|
) : n === "vertical" ? /* @__PURE__ */ c(
|
|
@@ -7729,15 +7730,15 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7729
7730
|
ref: t,
|
|
7730
7731
|
onThumbPositionChange: () => {
|
|
7731
7732
|
if (o.viewport && s.current) {
|
|
7732
|
-
const
|
|
7733
|
+
const h = o.viewport.scrollTop, v = Ea(h, i);
|
|
7733
7734
|
s.current.style.transform = `translate3d(0, ${v}px, 0)`;
|
|
7734
7735
|
}
|
|
7735
7736
|
},
|
|
7736
|
-
onWheelScroll: (
|
|
7737
|
-
o.viewport && (o.viewport.scrollTop =
|
|
7737
|
+
onWheelScroll: (h) => {
|
|
7738
|
+
o.viewport && (o.viewport.scrollTop = h);
|
|
7738
7739
|
},
|
|
7739
|
-
onDragScroll: (
|
|
7740
|
-
o.viewport && (o.viewport.scrollTop = p(
|
|
7740
|
+
onDragScroll: (h) => {
|
|
7741
|
+
o.viewport && (o.viewport.scrollTop = p(h));
|
|
7741
7742
|
}
|
|
7742
7743
|
}
|
|
7743
7744
|
) : null;
|
|
@@ -7763,8 +7764,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7763
7764
|
onDragScroll: (d) => e.onDragScroll(d.x),
|
|
7764
7765
|
onWheelScroll: (d, p) => {
|
|
7765
7766
|
if (s.viewport) {
|
|
7766
|
-
const
|
|
7767
|
-
e.onWheelScroll(
|
|
7767
|
+
const h = s.viewport.scrollLeft + d.deltaX;
|
|
7768
|
+
e.onWheelScroll(h), sl(h, p) && d.preventDefault();
|
|
7768
7769
|
}
|
|
7769
7770
|
},
|
|
7770
7771
|
onResize: () => {
|
|
@@ -7803,8 +7804,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7803
7804
|
onDragScroll: (d) => e.onDragScroll(d.y),
|
|
7804
7805
|
onWheelScroll: (d, p) => {
|
|
7805
7806
|
if (s.viewport) {
|
|
7806
|
-
const
|
|
7807
|
-
e.onWheelScroll(
|
|
7807
|
+
const h = s.viewport.scrollTop + d.deltaY;
|
|
7808
|
+
e.onWheelScroll(h), sl(h, p) && d.preventDefault();
|
|
7808
7809
|
}
|
|
7809
7810
|
},
|
|
7810
7811
|
onResize: () => {
|
|
@@ -7832,8 +7833,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7832
7833
|
onDragScroll: f,
|
|
7833
7834
|
onWheelScroll: d,
|
|
7834
7835
|
onResize: p,
|
|
7835
|
-
...
|
|
7836
|
-
} = e, v = $e(et, n), [g,
|
|
7836
|
+
...h
|
|
7837
|
+
} = e, v = $e(et, n), [g, m] = u.useState(null), b = ie(t, (L) => m(L)), w = u.useRef(null), x = u.useRef(""), y = v.viewport, C = r.content - r.viewport, R = ye(d), _ = ye(l), N = _r(p, 10);
|
|
7837
7838
|
function k(L) {
|
|
7838
7839
|
if (w.current) {
|
|
7839
7840
|
const I = L.clientX - w.current.left, $ = L.clientY - w.current.top;
|
|
@@ -7859,9 +7860,9 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7859
7860
|
children: /* @__PURE__ */ c(
|
|
7860
7861
|
ee.div,
|
|
7861
7862
|
{
|
|
7862
|
-
...
|
|
7863
|
+
...h,
|
|
7863
7864
|
ref: b,
|
|
7864
|
-
style: { position: "absolute", ...
|
|
7865
|
+
style: { position: "absolute", ...h.style },
|
|
7865
7866
|
onPointerDown: U(e.onPointerDown, (L) => {
|
|
7866
7867
|
L.button === 0 && (L.target.setPointerCapture(L.pointerId), w.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), k(L));
|
|
7867
7868
|
}),
|
|
@@ -7890,13 +7891,13 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7890
7891
|
return u.useEffect(() => {
|
|
7891
7892
|
const p = s.viewport;
|
|
7892
7893
|
if (p) {
|
|
7893
|
-
const
|
|
7894
|
+
const h = () => {
|
|
7894
7895
|
if (d(), !f.current) {
|
|
7895
7896
|
const v = ov(p, i);
|
|
7896
7897
|
f.current = v, i();
|
|
7897
7898
|
}
|
|
7898
7899
|
};
|
|
7899
|
-
return i(), p.addEventListener("scroll",
|
|
7900
|
+
return i(), p.addEventListener("scroll", h), () => p.removeEventListener("scroll", h);
|
|
7900
7901
|
}
|
|
7901
7902
|
}, [s.viewport, d, i]), /* @__PURE__ */ c(
|
|
7902
7903
|
ee.div,
|
|
@@ -7910,8 +7911,8 @@ var Yb = u.forwardRef((e, t) => {
|
|
|
7910
7911
|
...r
|
|
7911
7912
|
},
|
|
7912
7913
|
onPointerDownCapture: U(e.onPointerDownCapture, (p) => {
|
|
7913
|
-
const v = p.target.getBoundingClientRect(), g = p.clientX - v.left,
|
|
7914
|
-
a.onThumbPointerDown({ x: g, y:
|
|
7914
|
+
const v = p.target.getBoundingClientRect(), g = p.clientX - v.left, m = p.clientY - v.top;
|
|
7915
|
+
a.onThumbPointerDown({ x: g, y: m });
|
|
7915
7916
|
}),
|
|
7916
7917
|
onPointerUp: U(e.onPointerUp, a.onThumbPointerUp)
|
|
7917
7918
|
}
|
|
@@ -8056,16 +8057,16 @@ function Po({
|
|
|
8056
8057
|
}) {
|
|
8057
8058
|
const {
|
|
8058
8059
|
loadThread: p,
|
|
8059
|
-
threads:
|
|
8060
|
+
threads: h,
|
|
8060
8061
|
refreshThreads: v,
|
|
8061
8062
|
currentThreadId: g,
|
|
8062
|
-
createThread:
|
|
8063
|
+
createThread: m,
|
|
8063
8064
|
deleteThread: b,
|
|
8064
8065
|
renameThread: w
|
|
8065
|
-
} = ai(), [x, y] = re(
|
|
8066
|
+
} = ai(), [x, y] = re(h ?? []), [C, R] = re(!1), [_, N] = re(null), [k, L] = re(null), [I, $] = re(""), [K, B] = re(!1);
|
|
8066
8067
|
ge(() => {
|
|
8067
|
-
y(
|
|
8068
|
-
}, [
|
|
8068
|
+
y(h ?? []);
|
|
8069
|
+
}, [h]);
|
|
8069
8070
|
const M = async (F) => {
|
|
8070
8071
|
try {
|
|
8071
8072
|
await p(F), i == null || i(F), l == null || l(F);
|
|
@@ -8075,7 +8076,7 @@ function Po({
|
|
|
8075
8076
|
}, H = async () => {
|
|
8076
8077
|
try {
|
|
8077
8078
|
B(!0);
|
|
8078
|
-
const F = await
|
|
8079
|
+
const F = await m();
|
|
8079
8080
|
f == null || f(F), i == null || i(F);
|
|
8080
8081
|
} catch (F) {
|
|
8081
8082
|
console.error("Failed to create thread:", F);
|
|
@@ -8110,7 +8111,7 @@ function Po({
|
|
|
8110
8111
|
} catch {
|
|
8111
8112
|
return "";
|
|
8112
8113
|
}
|
|
8113
|
-
},
|
|
8114
|
+
}, ae = (F) => F.title || `Thread ${F.threadId.slice(0, 8)}`;
|
|
8114
8115
|
return /* @__PURE__ */ E("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
8115
8116
|
t && /* @__PURE__ */ c("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ c(
|
|
8116
8117
|
fe,
|
|
@@ -8144,7 +8145,7 @@ function Po({
|
|
|
8144
8145
|
/* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => D(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Bo, { size: 12 }) }),
|
|
8145
8146
|
/* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: T, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(tn, { size: 12 }) })
|
|
8146
8147
|
] }) : /* @__PURE__ */ E(Ae, { children: [
|
|
8147
|
-
/* @__PURE__ */ c("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children:
|
|
8148
|
+
/* @__PURE__ */ c("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: ae(F) }),
|
|
8148
8149
|
/* @__PURE__ */ E("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
|
|
8149
8150
|
/* @__PURE__ */ c(pd, { size: 10 }),
|
|
8150
8151
|
/* @__PURE__ */ c("span", { children: q(F.updatedAt || F.createdAt) })
|
|
@@ -8685,7 +8686,7 @@ var dn = "Tooltip", [Fv, Dr] = kr(dn), zl = (e) => {
|
|
|
8685
8686
|
onOpenChange: s,
|
|
8686
8687
|
disableHoverableContent: a,
|
|
8687
8688
|
delayDuration: i
|
|
8688
|
-
} = e, l = Es(dn, e.__scopeTooltip), f = Mr(t), [d, p] = u.useState(null),
|
|
8689
|
+
} = e, l = Es(dn, e.__scopeTooltip), f = Mr(t), [d, p] = u.useState(null), h = He(), v = u.useRef(0), g = a ?? l.disableHoverableContent, m = i ?? l.delayDuration, b = u.useRef(!1), [w, x] = ut({
|
|
8689
8690
|
prop: r,
|
|
8690
8691
|
defaultProp: o ?? !1,
|
|
8691
8692
|
onChange: (N) => {
|
|
@@ -8699,15 +8700,15 @@ var dn = "Tooltip", [Fv, Dr] = kr(dn), zl = (e) => {
|
|
|
8699
8700
|
}, [x]), _ = u.useCallback(() => {
|
|
8700
8701
|
window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
8701
8702
|
b.current = !0, x(!0), v.current = 0;
|
|
8702
|
-
},
|
|
8703
|
-
}, [
|
|
8703
|
+
}, m);
|
|
8704
|
+
}, [m, x]);
|
|
8704
8705
|
return u.useEffect(() => () => {
|
|
8705
8706
|
v.current && (window.clearTimeout(v.current), v.current = 0);
|
|
8706
8707
|
}, []), /* @__PURE__ */ c(rs, { ...f, children: /* @__PURE__ */ c(
|
|
8707
8708
|
Fv,
|
|
8708
8709
|
{
|
|
8709
8710
|
scope: t,
|
|
8710
|
-
contentId:
|
|
8711
|
+
contentId: h,
|
|
8711
8712
|
open: w,
|
|
8712
8713
|
stateAttribute: y,
|
|
8713
8714
|
trigger: d,
|
|
@@ -8736,8 +8737,8 @@ var _o = "TooltipTrigger", Wl = u.forwardRef(
|
|
|
8736
8737
|
"data-state": o.stateAttribute,
|
|
8737
8738
|
...r,
|
|
8738
8739
|
ref: l,
|
|
8739
|
-
onPointerMove: U(e.onPointerMove, (
|
|
8740
|
-
|
|
8740
|
+
onPointerMove: U(e.onPointerMove, (h) => {
|
|
8741
|
+
h.pointerType !== "touch" && !d.current && !s.isPointerInTransitRef.current && (o.onTriggerEnter(), d.current = !0);
|
|
8741
8742
|
}),
|
|
8742
8743
|
onPointerLeave: U(e.onPointerLeave, () => {
|
|
8743
8744
|
o.onTriggerLeave(), d.current = !1;
|
|
@@ -8763,31 +8764,31 @@ var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
|
|
|
8763
8764
|
return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Vl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(Uv, { side: o, ...s, ref: t }) });
|
|
8764
8765
|
}
|
|
8765
8766
|
), Uv = u.forwardRef((e, t) => {
|
|
8766
|
-
const n = Dr(Ht, e.__scopeTooltip), r = Es(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r,
|
|
8767
|
+
const n = Dr(Ht, e.__scopeTooltip), r = Es(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, h = u.useCallback(() => {
|
|
8767
8768
|
i(null), p(!1);
|
|
8768
8769
|
}, [p]), v = u.useCallback(
|
|
8769
|
-
(g,
|
|
8770
|
-
const b = g.currentTarget, w = { x: g.clientX, y: g.clientY }, x = Vv(w, b.getBoundingClientRect()), y = Kv(w, x), C = Gv(
|
|
8770
|
+
(g, m) => {
|
|
8771
|
+
const b = g.currentTarget, w = { x: g.clientX, y: g.clientY }, x = Vv(w, b.getBoundingClientRect()), y = Kv(w, x), C = Gv(m.getBoundingClientRect()), R = Xv([...y, ...C]);
|
|
8771
8772
|
i(R), p(!0);
|
|
8772
8773
|
},
|
|
8773
8774
|
[p]
|
|
8774
8775
|
);
|
|
8775
|
-
return u.useEffect(() => () =>
|
|
8776
|
+
return u.useEffect(() => () => h(), [h]), u.useEffect(() => {
|
|
8776
8777
|
if (l && d) {
|
|
8777
|
-
const g = (b) => v(b, d),
|
|
8778
|
-
return l.addEventListener("pointerleave", g), d.addEventListener("pointerleave",
|
|
8779
|
-
l.removeEventListener("pointerleave", g), d.removeEventListener("pointerleave",
|
|
8778
|
+
const g = (b) => v(b, d), m = (b) => v(b, l);
|
|
8779
|
+
return l.addEventListener("pointerleave", g), d.addEventListener("pointerleave", m), () => {
|
|
8780
|
+
l.removeEventListener("pointerleave", g), d.removeEventListener("pointerleave", m);
|
|
8780
8781
|
};
|
|
8781
8782
|
}
|
|
8782
|
-
}, [l, d, v,
|
|
8783
|
+
}, [l, d, v, h]), u.useEffect(() => {
|
|
8783
8784
|
if (a) {
|
|
8784
|
-
const g = (
|
|
8785
|
-
const b =
|
|
8786
|
-
x ?
|
|
8785
|
+
const g = (m) => {
|
|
8786
|
+
const b = m.target, w = { x: m.clientX, y: m.clientY }, x = (l == null ? void 0 : l.contains(b)) || (d == null ? void 0 : d.contains(b)), y = !qv(w, a);
|
|
8787
|
+
x ? h() : y && (h(), f());
|
|
8787
8788
|
};
|
|
8788
8789
|
return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
|
|
8789
8790
|
}
|
|
8790
|
-
}, [l, d, a, f,
|
|
8791
|
+
}, [l, d, a, f, h]), /* @__PURE__ */ c(Vl, { ...e, ref: s });
|
|
8791
8792
|
}), [Hv, zv] = kr(dn, { isInside: !1 }), Wv = Cd("TooltipContent"), Vl = u.forwardRef(
|
|
8792
8793
|
(e, t) => {
|
|
8793
8794
|
const {
|
|
@@ -8800,8 +8801,8 @@ var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
|
|
|
8800
8801
|
} = e, l = Dr(Ht, n), f = Mr(n), { onClose: d } = l;
|
|
8801
8802
|
return u.useEffect(() => (document.addEventListener(Io, d), () => document.removeEventListener(Io, d)), [d]), u.useEffect(() => {
|
|
8802
8803
|
if (l.trigger) {
|
|
8803
|
-
const p = (
|
|
8804
|
-
const v =
|
|
8804
|
+
const p = (h) => {
|
|
8805
|
+
const v = h.target;
|
|
8805
8806
|
v != null && v.contains(l.trigger) && d();
|
|
8806
8807
|
};
|
|
8807
8808
|
return window.addEventListener("scroll", p, { capture: !0 }), () => window.removeEventListener("scroll", p, { capture: !0 });
|
|
@@ -8909,8 +8910,8 @@ function qv(e, t) {
|
|
|
8909
8910
|
const { x: n, y: r } = e;
|
|
8910
8911
|
let o = !1;
|
|
8911
8912
|
for (let s = 0, a = t.length - 1; s < t.length; a = s++) {
|
|
8912
|
-
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x,
|
|
8913
|
-
d > r !=
|
|
8913
|
+
const i = t[s], l = t[a], f = i.x, d = i.y, p = l.x, h = l.y;
|
|
8914
|
+
d > r != h > r && n < (p - f) * (r - d) / (h - d) + f && (o = !o);
|
|
8914
8915
|
}
|
|
8915
8916
|
return o;
|
|
8916
8917
|
}
|
|
@@ -8974,19 +8975,19 @@ const Yl = u.forwardRef(
|
|
|
8974
8975
|
children: s,
|
|
8975
8976
|
...a
|
|
8976
8977
|
}, i) => {
|
|
8977
|
-
const l = pv(), [f, d] = u.useState(!1), [p,
|
|
8978
|
+
const l = pv(), [f, d] = u.useState(!1), [p, h] = u.useState(e), v = t ?? p, g = u.useCallback(
|
|
8978
8979
|
(x) => {
|
|
8979
8980
|
const y = typeof x == "function" ? x(v) : x;
|
|
8980
|
-
n ? n(y) :
|
|
8981
|
+
n ? n(y) : h(y), document.cookie = `${rw}=${y}; path=/; max-age=${ow}`;
|
|
8981
8982
|
},
|
|
8982
8983
|
[n, v]
|
|
8983
|
-
),
|
|
8984
|
+
), m = u.useCallback(() => l ? d((x) => !x) : g((x) => !x), [l, g, d]);
|
|
8984
8985
|
u.useEffect(() => {
|
|
8985
8986
|
const x = (y) => {
|
|
8986
|
-
y.key === cw && (y.metaKey || y.ctrlKey) && (y.preventDefault(),
|
|
8987
|
+
y.key === cw && (y.metaKey || y.ctrlKey) && (y.preventDefault(), m());
|
|
8987
8988
|
};
|
|
8988
8989
|
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
8989
|
-
}, [
|
|
8990
|
+
}, [m]);
|
|
8990
8991
|
const b = v ? "expanded" : "collapsed", w = u.useMemo(
|
|
8991
8992
|
() => ({
|
|
8992
8993
|
state: b,
|
|
@@ -8995,9 +8996,9 @@ const Yl = u.forwardRef(
|
|
|
8995
8996
|
isMobile: l,
|
|
8996
8997
|
openMobile: f,
|
|
8997
8998
|
setOpenMobile: d,
|
|
8998
|
-
toggleSidebar:
|
|
8999
|
+
toggleSidebar: m
|
|
8999
9000
|
}),
|
|
9000
|
-
[b, v, g, l, f, d,
|
|
9001
|
+
[b, v, g, l, f, d, m]
|
|
9001
9002
|
);
|
|
9002
9003
|
return /* @__PURE__ */ c(Xl.Provider, { value: w, children: /* @__PURE__ */ c(ew, { delayDuration: 0, children: /* @__PURE__ */ c(
|
|
9003
9004
|
"div",
|
|
@@ -9524,7 +9525,7 @@ var Fr = "Switch", [Cw, ex] = Ve(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
|
|
|
9524
9525
|
onCheckedChange: f,
|
|
9525
9526
|
form: d,
|
|
9526
9527
|
...p
|
|
9527
|
-
} = e, [
|
|
9528
|
+
} = e, [h, v] = u.useState(null), g = ie(t, (y) => v(y)), m = u.useRef(!1), b = h ? d || !!h.closest("form") : !0, [w, x] = ut({
|
|
9528
9529
|
prop: o,
|
|
9529
9530
|
defaultProp: s ?? !1,
|
|
9530
9531
|
onChange: f,
|
|
@@ -9545,15 +9546,15 @@ var Fr = "Switch", [Cw, ex] = Ve(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
|
|
|
9545
9546
|
...p,
|
|
9546
9547
|
ref: g,
|
|
9547
9548
|
onClick: U(e.onClick, (y) => {
|
|
9548
|
-
x((C) => !C), b && (
|
|
9549
|
+
x((C) => !C), b && (m.current = y.isPropagationStopped(), m.current || y.stopPropagation());
|
|
9549
9550
|
})
|
|
9550
9551
|
}
|
|
9551
9552
|
),
|
|
9552
9553
|
b && /* @__PURE__ */ c(
|
|
9553
9554
|
hu,
|
|
9554
9555
|
{
|
|
9555
|
-
control:
|
|
9556
|
-
bubbles: !
|
|
9556
|
+
control: h,
|
|
9557
|
+
bubbles: !m.current,
|
|
9557
9558
|
name: r,
|
|
9558
9559
|
value: l,
|
|
9559
9560
|
checked: w,
|
|
@@ -9664,10 +9665,10 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9664
9665
|
dir: f,
|
|
9665
9666
|
name: d,
|
|
9666
9667
|
autoComplete: p,
|
|
9667
|
-
disabled:
|
|
9668
|
+
disabled: h,
|
|
9668
9669
|
required: v,
|
|
9669
9670
|
form: g
|
|
9670
|
-
} = e,
|
|
9671
|
+
} = e, m = Ur(t), [b, w] = u.useState(null), [x, y] = u.useState(null), [C, R] = u.useState(!1), _ = vr(f), [N, k] = ut({
|
|
9671
9672
|
prop: r,
|
|
9672
9673
|
defaultProp: o ?? !1,
|
|
9673
9674
|
onChange: s,
|
|
@@ -9678,7 +9679,7 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9678
9679
|
onChange: l,
|
|
9679
9680
|
caller: Ct
|
|
9680
9681
|
}), $ = u.useRef(null), K = b ? g || !!b.closest("form") : !0, [B, M] = u.useState(/* @__PURE__ */ new Set()), H = Array.from(B).map((O) => O.props.value).join(";");
|
|
9681
|
-
return /* @__PURE__ */ c(rs, { ...
|
|
9682
|
+
return /* @__PURE__ */ c(rs, { ...m, children: /* @__PURE__ */ E(
|
|
9682
9683
|
_w,
|
|
9683
9684
|
{
|
|
9684
9685
|
required: v,
|
|
@@ -9696,7 +9697,7 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9696
9697
|
onOpenChange: k,
|
|
9697
9698
|
dir: _,
|
|
9698
9699
|
triggerPointerDownPosRef: $,
|
|
9699
|
-
disabled:
|
|
9700
|
+
disabled: h,
|
|
9700
9701
|
children: [
|
|
9701
9702
|
/* @__PURE__ */ c($r.Provider, { scope: t, children: /* @__PURE__ */ c(
|
|
9702
9703
|
Ow,
|
|
@@ -9724,7 +9725,7 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9724
9725
|
autoComplete: p,
|
|
9725
9726
|
value: L,
|
|
9726
9727
|
onChange: (O) => I(O.target.value),
|
|
9727
|
-
disabled:
|
|
9728
|
+
disabled: h,
|
|
9728
9729
|
form: g,
|
|
9729
9730
|
children: [
|
|
9730
9731
|
L === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
|
|
@@ -9740,13 +9741,13 @@ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Sele
|
|
|
9740
9741
|
bu.displayName = Ct;
|
|
9741
9742
|
var vu = "SelectTrigger", wu = u.forwardRef(
|
|
9742
9743
|
(e, t) => {
|
|
9743
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ur(n), a = pt(vu, n), i = a.disabled || r, l = ie(t, a.onTriggerChange), f = Br(n), d = u.useRef("touch"), [p,
|
|
9744
|
-
const b = f().filter((y) => !y.disabled), w = b.find((y) => y.value === a.value), x = ju(b,
|
|
9744
|
+
const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ur(n), a = pt(vu, n), i = a.disabled || r, l = ie(t, a.onTriggerChange), f = Br(n), d = u.useRef("touch"), [p, h, v] = Wu((m) => {
|
|
9745
|
+
const b = f().filter((y) => !y.disabled), w = b.find((y) => y.value === a.value), x = ju(b, m, w);
|
|
9745
9746
|
x !== void 0 && a.onValueChange(x.value);
|
|
9746
|
-
}), g = (
|
|
9747
|
-
i || (a.onOpenChange(!0), v()),
|
|
9748
|
-
x: Math.round(
|
|
9749
|
-
y: Math.round(
|
|
9747
|
+
}), g = (m) => {
|
|
9748
|
+
i || (a.onOpenChange(!0), v()), m && (a.triggerPointerDownPosRef.current = {
|
|
9749
|
+
x: Math.round(m.pageX),
|
|
9750
|
+
y: Math.round(m.pageY)
|
|
9750
9751
|
});
|
|
9751
9752
|
};
|
|
9752
9753
|
return /* @__PURE__ */ c(os, { asChild: !0, ...s, children: /* @__PURE__ */ c(
|
|
@@ -9765,17 +9766,17 @@ var vu = "SelectTrigger", wu = u.forwardRef(
|
|
|
9765
9766
|
"data-placeholder": zu(a.value) ? "" : void 0,
|
|
9766
9767
|
...o,
|
|
9767
9768
|
ref: l,
|
|
9768
|
-
onClick: U(o.onClick, (
|
|
9769
|
-
|
|
9769
|
+
onClick: U(o.onClick, (m) => {
|
|
9770
|
+
m.currentTarget.focus(), d.current !== "mouse" && g(m);
|
|
9770
9771
|
}),
|
|
9771
|
-
onPointerDown: U(o.onPointerDown, (
|
|
9772
|
-
d.current =
|
|
9773
|
-
const b =
|
|
9774
|
-
b.hasPointerCapture(
|
|
9772
|
+
onPointerDown: U(o.onPointerDown, (m) => {
|
|
9773
|
+
d.current = m.pointerType;
|
|
9774
|
+
const b = m.target;
|
|
9775
|
+
b.hasPointerCapture(m.pointerId) && b.releasePointerCapture(m.pointerId), m.button === 0 && m.ctrlKey === !1 && m.pointerType === "mouse" && (g(m), m.preventDefault());
|
|
9775
9776
|
}),
|
|
9776
|
-
onKeyDown: U(o.onKeyDown, (
|
|
9777
|
+
onKeyDown: U(o.onKeyDown, (m) => {
|
|
9777
9778
|
const b = p.current !== "";
|
|
9778
|
-
!(
|
|
9779
|
+
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 && h(m.key), !(b && m.key === " ") && Aw.includes(m.key) && (g(), m.preventDefault());
|
|
9779
9780
|
})
|
|
9780
9781
|
}
|
|
9781
9782
|
) });
|
|
@@ -9839,10 +9840,10 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9839
9840
|
align: f,
|
|
9840
9841
|
alignOffset: d,
|
|
9841
9842
|
arrowPadding: p,
|
|
9842
|
-
collisionBoundary:
|
|
9843
|
+
collisionBoundary: h,
|
|
9843
9844
|
collisionPadding: v,
|
|
9844
9845
|
sticky: g,
|
|
9845
|
-
hideWhenDetached:
|
|
9846
|
+
hideWhenDetached: m,
|
|
9846
9847
|
avoidCollisions: b,
|
|
9847
9848
|
//
|
|
9848
9849
|
...w
|
|
@@ -9854,7 +9855,7 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9854
9855
|
}, [y]), qo();
|
|
9855
9856
|
const O = u.useCallback(
|
|
9856
9857
|
(z) => {
|
|
9857
|
-
const [W, ...
|
|
9858
|
+
const [W, ...oe] = K().map((te) => te.ref.current), [V] = oe.slice(-1), X = document.activeElement;
|
|
9858
9859
|
for (const te of z)
|
|
9859
9860
|
if (te === X || (te == null || te.scrollIntoView({ block: "nearest" }), te === W && R && (R.scrollTop = 0), te === V && R && (R.scrollTop = R.scrollHeight), te == null || te.focus(), document.activeElement !== X)) return;
|
|
9860
9861
|
},
|
|
@@ -9876,11 +9877,11 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9876
9877
|
x: Math.abs(Math.round(V.pageX) - (((X = T.current) == null ? void 0 : X.x) ?? 0)),
|
|
9877
9878
|
y: Math.abs(Math.round(V.pageY) - (((te = T.current) == null ? void 0 : te.y) ?? 0))
|
|
9878
9879
|
};
|
|
9879
|
-
},
|
|
9880
|
+
}, oe = (V) => {
|
|
9880
9881
|
z.x <= 10 && z.y <= 10 ? V.preventDefault() : y.contains(V.target) || D(!1), document.removeEventListener("pointermove", W), T.current = null;
|
|
9881
9882
|
};
|
|
9882
|
-
return T.current !== null && (document.addEventListener("pointermove", W), document.addEventListener("pointerup",
|
|
9883
|
-
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup",
|
|
9883
|
+
return T.current !== null && (document.addEventListener("pointermove", W), document.addEventListener("pointerup", oe, { capture: !0, once: !0 })), () => {
|
|
9884
|
+
document.removeEventListener("pointermove", W), document.removeEventListener("pointerup", oe, { capture: !0 });
|
|
9884
9885
|
};
|
|
9885
9886
|
}
|
|
9886
9887
|
}, [y, D, T]), u.useEffect(() => {
|
|
@@ -9890,17 +9891,17 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9890
9891
|
};
|
|
9891
9892
|
}, [D]);
|
|
9892
9893
|
const [Q, q] = Wu((z) => {
|
|
9893
|
-
const W = K().filter((X) => !X.disabled),
|
|
9894
|
+
const W = K().filter((X) => !X.disabled), oe = W.find((X) => X.ref.current === document.activeElement), V = ju(W, z, oe);
|
|
9894
9895
|
V && setTimeout(() => V.ref.current.focus());
|
|
9895
|
-
}),
|
|
9896
|
-
(z, W,
|
|
9897
|
-
const V = !H.current && !
|
|
9896
|
+
}), ae = u.useCallback(
|
|
9897
|
+
(z, W, oe) => {
|
|
9898
|
+
const V = !H.current && !oe;
|
|
9898
9899
|
(x.value !== void 0 && x.value === W || V) && (L(z), V && (H.current = !0));
|
|
9899
9900
|
},
|
|
9900
9901
|
[x.value]
|
|
9901
9902
|
), F = u.useCallback(() => y == null ? void 0 : y.focus(), [y]), j = u.useCallback(
|
|
9902
|
-
(z, W,
|
|
9903
|
-
const V = !H.current && !
|
|
9903
|
+
(z, W, oe) => {
|
|
9904
|
+
const V = !H.current && !oe;
|
|
9904
9905
|
(x.value !== void 0 && x.value === W || V) && $(z);
|
|
9905
9906
|
},
|
|
9906
9907
|
[x.value]
|
|
@@ -9910,10 +9911,10 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9910
9911
|
align: f,
|
|
9911
9912
|
alignOffset: d,
|
|
9912
9913
|
arrowPadding: p,
|
|
9913
|
-
collisionBoundary:
|
|
9914
|
+
collisionBoundary: h,
|
|
9914
9915
|
collisionPadding: v,
|
|
9915
9916
|
sticky: g,
|
|
9916
|
-
hideWhenDetached:
|
|
9917
|
+
hideWhenDetached: m,
|
|
9917
9918
|
avoidCollisions: b
|
|
9918
9919
|
} : {};
|
|
9919
9920
|
return /* @__PURE__ */ c(
|
|
@@ -9923,7 +9924,7 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9923
9924
|
content: y,
|
|
9924
9925
|
viewport: R,
|
|
9925
9926
|
onViewportChange: _,
|
|
9926
|
-
itemRefCallback:
|
|
9927
|
+
itemRefCallback: ae,
|
|
9927
9928
|
selectedItem: k,
|
|
9928
9929
|
onItemLeave: F,
|
|
9929
9930
|
itemTextRefCallback: j,
|
|
@@ -9996,8 +9997,8 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
|
|
|
9996
9997
|
);
|
|
9997
9998
|
Ru.displayName = Lw;
|
|
9998
9999
|
var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
|
|
9999
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = pt(Et, n), a = ht(Et, n), [i, l] = u.useState(null), [f, d] = u.useState(null), p = ie(t, (N) => d(N)),
|
|
10000
|
-
if (s.trigger && s.valueNode && i && f &&
|
|
10000
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = pt(Et, n), a = ht(Et, n), [i, l] = u.useState(null), [f, d] = u.useState(null), p = ie(t, (N) => d(N)), h = Br(n), v = u.useRef(!1), g = u.useRef(!0), { viewport: m, selectedItem: b, selectedItemText: w, focusSelectedItem: x } = a, y = u.useCallback(() => {
|
|
10001
|
+
if (s.trigger && s.valueNode && i && f && m && b && w) {
|
|
10001
10002
|
const N = s.trigger.getBoundingClientRect(), k = f.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), I = w.getBoundingClientRect();
|
|
10002
10003
|
if (s.dir !== "rtl") {
|
|
10003
10004
|
const X = I.left - k.left, te = L.left - X, me = N.left - te, de = N.width + me, Z = Math.max(de, k.width), Y = window.innerWidth - Ue, he = Ao(te, [
|
|
@@ -10017,11 +10018,11 @@ var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
|
|
|
10017
10018
|
]);
|
|
10018
10019
|
i.style.minWidth = de + "px", i.style.right = he + "px";
|
|
10019
10020
|
}
|
|
10020
|
-
const $ =
|
|
10021
|
+
const $ = h(), K = window.innerHeight - Ue * 2, B = m.scrollHeight, M = window.getComputedStyle(f), H = parseInt(M.borderTopWidth, 10), O = parseInt(M.paddingTop, 10), G = parseInt(M.borderBottomWidth, 10), D = parseInt(M.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(m), ae = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), j = N.top + N.height / 2 - Ue, ce = K - j, pe = b.offsetHeight / 2, z = b.offsetTop + pe, W = H + O + z, oe = T - W;
|
|
10021
10022
|
if (W <= j) {
|
|
10022
10023
|
const X = $.length > 0 && b === $[$.length - 1].ref.current;
|
|
10023
10024
|
i.style.bottom = "0px";
|
|
10024
|
-
const te = f.clientHeight -
|
|
10025
|
+
const te = f.clientHeight - m.offsetTop - m.offsetHeight, me = Math.max(
|
|
10025
10026
|
ce,
|
|
10026
10027
|
pe + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
10027
10028
|
(X ? F : 0) + te + G
|
|
@@ -10032,20 +10033,20 @@ var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
|
|
|
10032
10033
|
i.style.top = "0px";
|
|
10033
10034
|
const me = Math.max(
|
|
10034
10035
|
j,
|
|
10035
|
-
H +
|
|
10036
|
-
(X ?
|
|
10037
|
-
) +
|
|
10038
|
-
i.style.height = me + "px",
|
|
10036
|
+
H + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
10037
|
+
(X ? ae : 0) + pe
|
|
10038
|
+
) + oe;
|
|
10039
|
+
i.style.height = me + "px", m.scrollTop = W - j + m.offsetTop;
|
|
10039
10040
|
}
|
|
10040
10041
|
i.style.margin = `${Ue}px 0`, i.style.minHeight = Q + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
|
|
10041
10042
|
}
|
|
10042
10043
|
}, [
|
|
10043
|
-
|
|
10044
|
+
h,
|
|
10044
10045
|
s.trigger,
|
|
10045
10046
|
s.valueNode,
|
|
10046
10047
|
i,
|
|
10047
10048
|
f,
|
|
10048
|
-
|
|
10049
|
+
m,
|
|
10049
10050
|
b,
|
|
10050
10051
|
w,
|
|
10051
10052
|
s.dir,
|
|
@@ -10163,11 +10164,11 @@ var [Uw, Ns] = qt(Et, {}), ko = "SelectViewport", Au = u.forwardRef(
|
|
|
10163
10164
|
...o.style
|
|
10164
10165
|
},
|
|
10165
10166
|
onScroll: U(o.onScroll, (f) => {
|
|
10166
|
-
const d = f.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef:
|
|
10167
|
-
if (
|
|
10167
|
+
const d = f.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef: h } = a;
|
|
10168
|
+
if (h != null && h.current && p) {
|
|
10168
10169
|
const v = Math.abs(l.current - d.scrollTop);
|
|
10169
10170
|
if (v > 0) {
|
|
10170
|
-
const g = window.innerHeight - Ue * 2,
|
|
10171
|
+
const g = window.innerHeight - Ue * 2, m = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(m, b);
|
|
10171
10172
|
if (w < g) {
|
|
10172
10173
|
const x = w + v, y = Math.min(g, x), C = x - y;
|
|
10173
10174
|
p.style.height = y + "px", p.style.bottom === "0px" && (d.scrollTop = C > 0 ? C : 0, p.style.justifyContent = "flex-end");
|
|
@@ -10204,13 +10205,13 @@ var ur = "SelectItem", [jw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10204
10205
|
disabled: o = !1,
|
|
10205
10206
|
textValue: s,
|
|
10206
10207
|
...a
|
|
10207
|
-
} = e, i = pt(ur, n), l = ht(ur, n), f = i.value === r, [d, p] = u.useState(s ?? ""), [
|
|
10208
|
+
} = e, i = pt(ur, n), l = ht(ur, n), f = i.value === r, [d, p] = u.useState(s ?? ""), [h, v] = u.useState(!1), g = ie(
|
|
10208
10209
|
t,
|
|
10209
10210
|
(x) => {
|
|
10210
10211
|
var y;
|
|
10211
10212
|
return (y = l.itemRefCallback) == null ? void 0 : y.call(l, x, r, o);
|
|
10212
10213
|
}
|
|
10213
|
-
),
|
|
10214
|
+
), m = He(), b = u.useRef("touch"), w = () => {
|
|
10214
10215
|
o || (i.onValueChange(r), i.onOpenChange(!1));
|
|
10215
10216
|
};
|
|
10216
10217
|
if (r === "")
|
|
@@ -10223,7 +10224,7 @@ var ur = "SelectItem", [jw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10223
10224
|
scope: n,
|
|
10224
10225
|
value: r,
|
|
10225
10226
|
disabled: o,
|
|
10226
|
-
textId:
|
|
10227
|
+
textId: m,
|
|
10227
10228
|
isSelected: f,
|
|
10228
10229
|
onItemTextChange: u.useCallback((x) => {
|
|
10229
10230
|
p((y) => y || ((x == null ? void 0 : x.textContent) ?? "").trim());
|
|
@@ -10239,9 +10240,9 @@ var ur = "SelectItem", [jw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10239
10240
|
ee.div,
|
|
10240
10241
|
{
|
|
10241
10242
|
role: "option",
|
|
10242
|
-
"aria-labelledby":
|
|
10243
|
-
"data-highlighted":
|
|
10244
|
-
"aria-selected": f &&
|
|
10243
|
+
"aria-labelledby": m,
|
|
10244
|
+
"data-highlighted": h ? "" : void 0,
|
|
10245
|
+
"aria-selected": f && h,
|
|
10245
10246
|
"data-state": f ? "checked" : "unchecked",
|
|
10246
10247
|
"aria-disabled": o || void 0,
|
|
10247
10248
|
"data-disabled": o ? "" : void 0,
|
|
@@ -10282,7 +10283,7 @@ var ur = "SelectItem", [jw, Ou] = qt(ur), ku = u.forwardRef(
|
|
|
10282
10283
|
ku.displayName = ur;
|
|
10283
10284
|
var en = "SelectItemText", Mu = u.forwardRef(
|
|
10284
10285
|
(e, t) => {
|
|
10285
|
-
const { __scopeSelect: n, className: r, style: o, ...s } = e, a = pt(en, n), i = ht(en, n), l = Ou(en, n), f = kw(en, n), [d, p] = u.useState(null),
|
|
10286
|
+
const { __scopeSelect: n, className: r, style: o, ...s } = e, a = pt(en, n), i = ht(en, n), l = Ou(en, n), f = kw(en, n), [d, p] = u.useState(null), h = ie(
|
|
10286
10287
|
t,
|
|
10287
10288
|
(w) => p(w),
|
|
10288
10289
|
l.onItemTextChange,
|
|
@@ -10293,9 +10294,9 @@ var en = "SelectItemText", Mu = u.forwardRef(
|
|
|
10293
10294
|
), v = d == null ? void 0 : d.textContent, g = u.useMemo(
|
|
10294
10295
|
() => /* @__PURE__ */ c("option", { value: l.value, disabled: l.disabled, children: v }, l.value),
|
|
10295
10296
|
[l.disabled, l.value, v]
|
|
10296
|
-
), { onNativeOptionAdd:
|
|
10297
|
-
return we(() => (
|
|
10298
|
-
/* @__PURE__ */ c(ee.span, { id: l.textId, ...s, ref:
|
|
10297
|
+
), { onNativeOptionAdd: m, onNativeOptionRemove: b } = f;
|
|
10298
|
+
return we(() => (m(g), () => b(g)), [m, b, g]), /* @__PURE__ */ E(Ae, { children: [
|
|
10299
|
+
/* @__PURE__ */ c(ee.span, { id: l.textId, ...s, ref: h }),
|
|
10299
10300
|
l.isSelected && a.valueNode && !a.valueNodeHasChildren ? dr.createPortal(s.children, a.valueNode) : null
|
|
10300
10301
|
] });
|
|
10301
10302
|
}
|
|
@@ -10728,7 +10729,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10728
10729
|
}, [i, e]), ge(() => {
|
|
10729
10730
|
l(e);
|
|
10730
10731
|
}, [e]);
|
|
10731
|
-
const
|
|
10732
|
+
const h = () => {
|
|
10732
10733
|
t(i), d(!1), p({
|
|
10733
10734
|
title: "Settings saved",
|
|
10734
10735
|
description: "Your chat configuration has been updated successfully."
|
|
@@ -10740,7 +10741,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10740
10741
|
});
|
|
10741
10742
|
}, g = () => {
|
|
10742
10743
|
l(e), d(!1), o(!1);
|
|
10743
|
-
},
|
|
10744
|
+
}, m = async () => {
|
|
10744
10745
|
try {
|
|
10745
10746
|
const w = await (await fetch(`${i.api.baseUrl}/health`)).json();
|
|
10746
10747
|
p({
|
|
@@ -10788,7 +10789,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10788
10789
|
placeholder: "http://localhost:8000/api"
|
|
10789
10790
|
}
|
|
10790
10791
|
),
|
|
10791
|
-
/* @__PURE__ */ c(fe, { variant: "outline", onClick:
|
|
10792
|
+
/* @__PURE__ */ c(fe, { variant: "outline", onClick: m, children: "Test" })
|
|
10792
10793
|
] })
|
|
10793
10794
|
] }),
|
|
10794
10795
|
/* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
|
|
@@ -10996,7 +10997,7 @@ function nx({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10996
10997
|
] }),
|
|
10997
10998
|
/* @__PURE__ */ E("div", { className: "flex gap-2", children: [
|
|
10998
10999
|
/* @__PURE__ */ c(fe, { variant: "outline", onClick: g, children: "Cancel" }),
|
|
10999
|
-
/* @__PURE__ */ E(fe, { onClick:
|
|
11000
|
+
/* @__PURE__ */ E(fe, { onClick: h, disabled: !f, children: [
|
|
11000
11001
|
/* @__PURE__ */ c(Sd, { className: "h-4 w-4 mr-2" }),
|
|
11001
11002
|
"Save Changes"
|
|
11002
11003
|
] })
|