@alxxsck/ai-assistant 2.25.3 → 2.25.4
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/{Avatar-C3PubeMM.js → Avatar-1SXtYcpL.js} +1 -1
- package/dist/{ChatWidgetContent-Dt6meIg2.js → ChatWidgetContent-Cfqo7BfS.js} +527 -530
- package/dist/api/chat-attachments.api.d.ts +0 -1
- package/dist/bridge-ai-chat-widget.es.js +1 -1
- package/dist/{index-DDvZeFFo.js → index-1DOqo2bD.js} +1 -1
- package/dist/{mount-C7CMxso3.js → mount-CtHQDVwj.js} +3 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as A, jsx as u, Fragment as $e } from "react/jsx-runtime";
|
|
2
2
|
import * as ee from "react";
|
|
3
3
|
import I, { useRef as C, useCallback as R, useEffect as H, useState as U, useMemo as le, useLayoutEffect as mt, useContext as be, createContext as ke, forwardRef as cr, Fragment as rt, isValidElement as rs, cloneElement as os, createElement as un, useId as pt, useSyncExternalStore as ur, useReducer as as, createRef as ss, memo as ho } from "react";
|
|
4
|
-
import { P as Le, u as Te, a as Wt, b as bn, c as dr, d as go, e as wt, C as Ne, N as Rt, f as Ft, V as is, g as ls, h as vo, i as cs, l as bo, S as us, j as fr, m as ds, k as fs, n as mr, M as It, o as ms, p as ps, r as hs, q as gs, s as vs, t as bs, v as ws, w as ys, x as xs, y as Cs, z as Es, A as wo, B as yo, D as Ts, E as Ns, F as ks, G as pr, H as As, I as Ss, J as xt, K as $s, L as Ms, O as Ls, Q as _s, R as Ps, T as Os, U as Rs, W as Fs, X as Is, Y as $t, Z as On } from "./mount-
|
|
5
|
-
import { o as Ds, L as Hs, a as Us } from "./index-
|
|
4
|
+
import { P as Le, u as Te, a as Wt, b as bn, c as dr, d as go, e as wt, C as Ne, N as Rt, f as Ft, V as is, g as ls, h as vo, i as cs, l as bo, S as us, j as fr, m as ds, k as fs, n as mr, M as It, o as ms, p as ps, r as hs, q as gs, s as vs, t as bs, v as ws, w as ys, x as xs, y as Cs, z as Es, A as wo, B as yo, D as Ts, E as Ns, F as ks, G as pr, H as As, I as Ss, J as xt, K as $s, L as Ms, O as Ls, Q as _s, R as Ps, T as Os, U as Rs, W as Fs, X as Is, Y as $t, Z as On } from "./mount-CtHQDVwj.js";
|
|
5
|
+
import { o as Ds, L as Hs, a as Us } from "./index-1DOqo2bD.js";
|
|
6
6
|
import { createPortal as js } from "react-dom";
|
|
7
7
|
const zs = (e) => /* @__PURE__ */ ee.createElement("svg", { width: 15, height: 22, viewBox: "0 0 15 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ ee.createElement("path", { d: "M3 10.5V4.5C3 3.30653 3.47411 2.16193 4.31802 1.31802C5.16193 0.474106 6.30653 0 7.5 0C8.69347 0 9.83807 0.474106 10.682 1.31802C11.5259 2.16193 12 3.30653 12 4.5V10.5C12 11.6935 11.5259 12.8381 10.682 13.682C9.83807 14.5259 8.69347 15 7.5 15C6.30653 15 5.16193 14.5259 4.31802 13.682C3.47411 12.8381 3 11.6935 3 10.5ZM15 10.5C15 10.3011 14.921 10.1103 14.7803 9.96967C14.6397 9.82902 14.4489 9.75 14.25 9.75C14.0511 9.75 13.8603 9.82902 13.7197 9.96967C13.579 10.1103 13.5 10.3011 13.5 10.5C13.5 12.0913 12.8679 13.6174 11.7426 14.7426C10.6174 15.8679 9.0913 16.5 7.5 16.5C5.9087 16.5 4.38258 15.8679 3.25736 14.7426C2.13214 13.6174 1.5 12.0913 1.5 10.5C1.5 10.3011 1.42098 10.1103 1.28033 9.96967C1.13968 9.82902 0.948912 9.75 0.75 9.75C0.551088 9.75 0.360322 9.82902 0.21967 9.96967C0.0790178 10.1103 0 10.3011 0 10.5C0.00228386 12.3586 0.693677 14.1504 1.94048 15.5288C3.18728 16.9072 4.90091 17.7743 6.75 17.9625V21C6.75 21.1989 6.82902 21.3897 6.96967 21.5303C7.11032 21.671 7.30109 21.75 7.5 21.75C7.69891 21.75 7.88968 21.671 8.03033 21.5303C8.17098 21.3897 8.25 21.1989 8.25 21V17.9625C10.0991 17.7743 11.8127 16.9072 13.0595 15.5288C14.3063 14.1504 14.9977 12.3586 15 10.5Z", fill: "white" })), Vs = (e) => /* @__PURE__ */ ee.createElement("svg", { width: 17, height: 22, viewBox: "0 0 17 22", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ ee.createElement("path", { d: "M16.2483 20.05C16.1011 20.1838 15.9068 20.2536 15.7082 20.2441C15.5095 20.2346 15.3227 20.1466 15.189 19.9994L12.2902 16.8119C11.2986 17.4511 10.1683 17.8436 8.99395 17.9566V20.995C8.99395 21.1939 8.91494 21.3847 8.77428 21.5253C8.63363 21.666 8.44287 21.745 8.24395 21.745C8.04504 21.745 7.85428 21.666 7.71362 21.5253C7.57297 21.3847 7.49395 21.1939 7.49395 20.995V17.9575C5.64487 17.7694 3.93123 16.9022 2.68443 15.5238C1.43763 14.1454 0.746237 12.3536 0.743953 10.495C0.743953 10.2961 0.822971 10.1053 0.963623 9.96468C1.10428 9.82403 1.29504 9.74501 1.49395 9.74501C1.69287 9.74501 1.88363 9.82403 2.02428 9.96468C2.16494 10.1053 2.24395 10.2961 2.24395 10.495C2.24569 12.0858 2.87839 13.6109 4.00323 14.7357C5.12807 15.8606 6.65319 16.4933 8.24395 16.495C9.3051 16.4981 10.3477 16.2172 11.2636 15.6813L10.223 14.5375C9.53688 14.8735 8.77649 15.0293 8.01351 14.9902C7.25052 14.951 6.51006 14.7183 5.86189 14.3139C5.21372 13.9095 4.67918 13.3467 4.30864 12.6786C3.93811 12.0105 3.74377 11.259 3.74395 10.495V7.4097L0.188953 3.49939C0.0579834 3.35175 -0.00951799 3.15845 0.00108397 2.96138C0.0116859 2.76431 0.0995364 2.57936 0.245589 2.44663C0.391643 2.3139 0.584126 2.24408 0.781309 2.25232C0.978492 2.26056 1.16448 2.34619 1.29895 2.49064L16.299 18.9906C16.4327 19.1378 16.5025 19.3321 16.493 19.5308C16.4835 19.7295 16.3955 19.9162 16.2483 20.05ZM13.9805 14.1316C14.0828 14.1823 14.1954 14.2086 14.3096 14.2085C14.4501 14.2085 14.5878 14.169 14.7069 14.0946C14.8261 14.0202 14.922 13.9138 14.9836 13.7875C15.4869 12.7631 15.7471 11.6364 15.744 10.495C15.744 10.2961 15.6649 10.1053 15.5243 9.96468C15.3836 9.82403 15.1929 9.74501 14.994 9.74501C14.795 9.74501 14.6043 9.82403 14.4636 9.96468C14.323 10.1053 14.244 10.2961 14.244 10.495C14.2466 11.4079 14.0387 12.309 13.6365 13.1285C13.5491 13.3071 13.5363 13.5131 13.6008 13.7013C13.6653 13.8894 13.8019 14.0442 13.9805 14.1316ZM11.4183 11.3922C11.5158 11.4995 11.6422 11.5762 11.7824 11.6131C11.9225 11.65 12.0703 11.6456 12.208 11.6002C12.3456 11.5549 12.4672 11.4707 12.558 11.3577C12.6488 11.2448 12.7049 11.1079 12.7196 10.9638C12.7356 10.808 12.7437 10.6516 12.744 10.495V4.49501C12.7428 3.46146 12.3859 2.45981 11.7333 1.6584C11.0806 0.85698 10.172 0.304654 9.16007 0.0942441C8.14816 -0.116166 7.09467 0.0281652 6.17664 0.502981C5.25861 0.977798 4.53201 1.75415 4.11895 2.70158C4.06128 2.834 4.04308 2.98027 4.06652 3.1228C4.08997 3.26532 4.15408 3.39804 4.25114 3.50501L11.4183 11.3922Z" })), Bs = (e) => /* @__PURE__ */ ee.createElement("svg", { width: 19, height: 17, viewBox: "0 0 19 17", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ ee.createElement("path", { d: "M12.5227 3.81607C11.8966 2.45748 10.8252 1.35355 9.48597 0.687157C8.14671 0.0207681 6.61998 -0.168078 5.15872 0.151907C3.69745 0.471891 2.38936 1.2815 1.45116 2.4466C0.512966 3.6117 0.000969112 5.06237 0 6.55826V11.5583C0 11.9727 0.16462 12.3701 0.457646 12.6631C0.750671 12.9561 1.1481 13.1208 1.5625 13.1208H5.63281C6.16643 14.2418 7.00649 15.1889 8.05583 15.8525C9.10517 16.5161 10.3209 16.8692 11.5625 16.8708H16.5625C16.9769 16.8708 17.3743 16.7061 17.6674 16.4131C17.9604 16.1201 18.125 15.7227 18.125 15.3083V10.3083C18.1251 8.73409 17.5593 7.21234 16.5309 6.02056C15.5024 4.82878 14.0799 4.04638 12.5227 3.81607ZM1.875 6.55826C1.875 5.63116 2.14992 4.72488 2.66499 3.95402C3.18006 3.18317 3.91214 2.58236 4.76867 2.22757C5.6252 1.87278 6.5677 1.77996 7.47699 1.96082C8.38627 2.14169 9.2215 2.58813 9.87706 3.24369C10.5326 3.89925 10.9791 4.73448 11.1599 5.64377C11.3408 6.55306 11.248 7.49556 10.8932 8.35209C10.5384 9.20861 9.93759 9.9407 9.16674 10.4558C8.39588 10.9708 7.4896 11.2458 6.5625 11.2458H1.875V6.55826ZM16.25 14.9958H11.5625C10.8125 14.9949 10.0737 14.8145 9.40771 14.4697C8.74173 14.1249 8.16796 13.6256 7.73438 13.0137C9.36318 12.7195 10.8205 11.8202 11.8138 10.4962C12.8071 9.17219 13.2629 7.52154 13.0898 5.87544C14.0125 6.19342 14.8129 6.79144 15.3794 7.58608C15.9459 8.38072 16.2502 9.33236 16.25 10.3083V14.9958Z" }));
|
|
8
8
|
function xo(e) {
|
|
@@ -65,9 +65,9 @@ const Ws = (e, t) => {
|
|
|
65
65
|
return;
|
|
66
66
|
const l = t === 0 ? e.join(dn) : e.slice(t).join(dn), s = i.length;
|
|
67
67
|
for (let c = 0; c < s; c++) {
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
68
|
+
const h = i[c];
|
|
69
|
+
if (h.validator(l))
|
|
70
|
+
return h.classGroupId;
|
|
71
71
|
}
|
|
72
72
|
}, Zs = (e) => e.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
73
73
|
const t = e.slice(1, -1), n = t.indexOf(":"), r = t.slice(0, n);
|
|
@@ -163,32 +163,32 @@ const Ws = (e, t) => {
|
|
|
163
163
|
let r = (o) => {
|
|
164
164
|
const a = [];
|
|
165
165
|
let i = 0, l = 0, s = 0, c;
|
|
166
|
-
const
|
|
167
|
-
for (let g = 0; g <
|
|
168
|
-
const
|
|
166
|
+
const h = o.length;
|
|
167
|
+
for (let g = 0; g < h; g++) {
|
|
168
|
+
const b = o[g];
|
|
169
169
|
if (i === 0 && l === 0) {
|
|
170
|
-
if (
|
|
170
|
+
if (b === Dr) {
|
|
171
171
|
a.push(o.slice(s, g)), s = g + 1;
|
|
172
172
|
continue;
|
|
173
173
|
}
|
|
174
|
-
if (
|
|
174
|
+
if (b === "/") {
|
|
175
175
|
c = g;
|
|
176
176
|
continue;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
b === "[" ? i++ : b === "]" ? i-- : b === "(" ? l++ : b === ")" && l--;
|
|
180
180
|
}
|
|
181
181
|
const m = a.length === 0 ? o : o.slice(s);
|
|
182
|
-
let f = m,
|
|
183
|
-
m.endsWith(Gn) ? (f = m.slice(0, -1),
|
|
182
|
+
let f = m, d = !1;
|
|
183
|
+
m.endsWith(Gn) ? (f = m.slice(0, -1), d = !0) : (
|
|
184
184
|
/**
|
|
185
185
|
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
186
186
|
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
187
187
|
*/
|
|
188
|
-
m.startsWith(Gn) && (f = m.slice(1),
|
|
188
|
+
m.startsWith(Gn) && (f = m.slice(1), d = !0)
|
|
189
189
|
);
|
|
190
|
-
const
|
|
191
|
-
return Hr(a,
|
|
190
|
+
const p = c && c > s ? c - s : void 0;
|
|
191
|
+
return Hr(a, d, f, p);
|
|
192
192
|
};
|
|
193
193
|
if (t) {
|
|
194
194
|
const o = t + Dr, a = r;
|
|
@@ -229,39 +229,39 @@ const Ws = (e, t) => {
|
|
|
229
229
|
} = t, i = [], l = e.trim().split(ci);
|
|
230
230
|
let s = "";
|
|
231
231
|
for (let c = l.length - 1; c >= 0; c -= 1) {
|
|
232
|
-
const
|
|
232
|
+
const h = l[c], {
|
|
233
233
|
isExternal: m,
|
|
234
234
|
modifiers: f,
|
|
235
|
-
hasImportantModifier:
|
|
236
|
-
baseClassName:
|
|
235
|
+
hasImportantModifier: d,
|
|
236
|
+
baseClassName: p,
|
|
237
237
|
maybePostfixModifierPosition: g
|
|
238
|
-
} = n(
|
|
238
|
+
} = n(h);
|
|
239
239
|
if (m) {
|
|
240
|
-
s =
|
|
240
|
+
s = h + (s.length > 0 ? " " + s : s);
|
|
241
241
|
continue;
|
|
242
242
|
}
|
|
243
|
-
let
|
|
243
|
+
let b = !!g, y = r(b ? p.substring(0, g) : p);
|
|
244
244
|
if (!y) {
|
|
245
|
-
if (!
|
|
246
|
-
s =
|
|
245
|
+
if (!b) {
|
|
246
|
+
s = h + (s.length > 0 ? " " + s : s);
|
|
247
247
|
continue;
|
|
248
248
|
}
|
|
249
|
-
if (y = r(
|
|
250
|
-
s =
|
|
249
|
+
if (y = r(p), !y) {
|
|
250
|
+
s = h + (s.length > 0 ? " " + s : s);
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
b = !1;
|
|
254
254
|
}
|
|
255
|
-
const w = f.length === 0 ? "" : f.length === 1 ? f[0] : a(f).join(":"), x =
|
|
255
|
+
const w = f.length === 0 ? "" : f.length === 1 ? f[0] : a(f).join(":"), x = d ? w + Gn : w, T = x + y;
|
|
256
256
|
if (i.indexOf(T) > -1)
|
|
257
257
|
continue;
|
|
258
258
|
i.push(T);
|
|
259
|
-
const N = o(y,
|
|
259
|
+
const N = o(y, b);
|
|
260
260
|
for (let S = 0; S < N.length; ++S) {
|
|
261
261
|
const L = N[S];
|
|
262
262
|
i.push(x + L);
|
|
263
263
|
}
|
|
264
|
-
s =
|
|
264
|
+
s = h + (s.length > 0 ? " " + s : s);
|
|
265
265
|
}
|
|
266
266
|
return s;
|
|
267
267
|
}, di = (...e) => {
|
|
@@ -279,14 +279,14 @@ const Ws = (e, t) => {
|
|
|
279
279
|
}, fi = (e, ...t) => {
|
|
280
280
|
let n, r, o, a;
|
|
281
281
|
const i = (s) => {
|
|
282
|
-
const c = t.reduce((
|
|
282
|
+
const c = t.reduce((h, m) => m(h), e());
|
|
283
283
|
return n = li(c), r = n.cache.get, o = n.cache.set, a = l, l(s);
|
|
284
284
|
}, l = (s) => {
|
|
285
285
|
const c = r(s);
|
|
286
286
|
if (c)
|
|
287
287
|
return c;
|
|
288
|
-
const
|
|
289
|
-
return o(s,
|
|
288
|
+
const h = ui(s, n);
|
|
289
|
+
return o(s, h), h;
|
|
290
290
|
};
|
|
291
291
|
return a = i, (...s) => a(di(...s));
|
|
292
292
|
}, mi = [], pe = (e) => {
|
|
@@ -304,7 +304,7 @@ const Ws = (e, t) => {
|
|
|
304
304
|
const r = Ao.exec(e);
|
|
305
305
|
return r ? r[1] ? t(r[1]) : n : !1;
|
|
306
306
|
}, $o = (e) => e === "position" || e === "percentage", Mo = (e) => e === "image" || e === "url", Lo = (e) => e === "length" || e === "size" || e === "bg-size", _o = (e) => e === "length", Mi = (e) => e === "number", Li = (e) => e === "family-name", Po = (e) => e === "shadow", _i = () => {
|
|
307
|
-
const e = pe("color"), t = pe("font"), n = pe("text"), r = pe("font-weight"), o = pe("tracking"), a = pe("leading"), i = pe("breakpoint"), l = pe("container"), s = pe("spacing"), c = pe("radius"),
|
|
307
|
+
const e = pe("color"), t = pe("font"), n = pe("text"), r = pe("font-weight"), o = pe("tracking"), a = pe("leading"), i = pe("breakpoint"), l = pe("container"), s = pe("spacing"), c = pe("radius"), h = pe("shadow"), m = pe("inset-shadow"), f = pe("text-shadow"), d = pe("drop-shadow"), p = pe("blur"), g = pe("perspective"), b = pe("aspect"), y = pe("ease"), w = pe("animate"), x = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], T = () => [
|
|
308
308
|
"center",
|
|
309
309
|
"top",
|
|
310
310
|
"bottom",
|
|
@@ -342,7 +342,7 @@ const Ws = (e, t) => {
|
|
|
342
342
|
// Deprecated since Tailwind CSS v4.0.0
|
|
343
343
|
"",
|
|
344
344
|
"none",
|
|
345
|
-
|
|
345
|
+
p,
|
|
346
346
|
M,
|
|
347
347
|
$
|
|
348
348
|
], ye = () => ["none", V, M, $], Re = () => ["none", V, M, $], ge = () => [V, M, $], Ze = () => [yt, "full", ...k()];
|
|
@@ -378,7 +378,7 @@ const Ws = (e, t) => {
|
|
|
378
378
|
* @see https://tailwindcss.com/docs/aspect-ratio
|
|
379
379
|
*/
|
|
380
380
|
aspect: [{
|
|
381
|
-
aspect: ["auto", "square", yt, $, M,
|
|
381
|
+
aspect: ["auto", "square", yt, $, M, b]
|
|
382
382
|
}],
|
|
383
383
|
/**
|
|
384
384
|
* Container
|
|
@@ -1694,7 +1694,7 @@ const Ws = (e, t) => {
|
|
|
1694
1694
|
// Deprecated since Tailwind CSS v4.0.0
|
|
1695
1695
|
"",
|
|
1696
1696
|
"none",
|
|
1697
|
-
|
|
1697
|
+
h,
|
|
1698
1698
|
en,
|
|
1699
1699
|
Qt
|
|
1700
1700
|
]
|
|
@@ -2050,7 +2050,7 @@ const Ws = (e, t) => {
|
|
|
2050
2050
|
// Deprecated since Tailwind CSS v4.0.0
|
|
2051
2051
|
"",
|
|
2052
2052
|
"none",
|
|
2053
|
-
|
|
2053
|
+
d,
|
|
2054
2054
|
en,
|
|
2055
2055
|
Qt
|
|
2056
2056
|
]
|
|
@@ -3093,8 +3093,8 @@ function rl(e) {
|
|
|
3093
3093
|
r,
|
|
3094
3094
|
o
|
|
3095
3095
|
]), i = Ho(a), l = R((s) => {
|
|
3096
|
-
const c = at(s.target),
|
|
3097
|
-
s.target === s.currentTarget &&
|
|
3096
|
+
const c = at(s.target), h = c ? Wn(c) : Wn();
|
|
3097
|
+
s.target === s.currentTarget && h === Ro(s.nativeEvent) && (n && n(s), o && o(!0), i(s));
|
|
3098
3098
|
}, [
|
|
3099
3099
|
o,
|
|
3100
3100
|
n,
|
|
@@ -3117,19 +3117,19 @@ function ol(e) {
|
|
|
3117
3117
|
o,
|
|
3118
3118
|
a,
|
|
3119
3119
|
l
|
|
3120
|
-
]), c = Ho(s),
|
|
3120
|
+
]), c = Ho(s), h = R((m) => {
|
|
3121
3121
|
if (!m.currentTarget.contains(m.target)) return;
|
|
3122
|
-
const f = at(m.target),
|
|
3123
|
-
if (!a.current.isFocusWithin &&
|
|
3122
|
+
const f = at(m.target), d = Wn(f);
|
|
3123
|
+
if (!a.current.isFocusWithin && d === Ro(m.nativeEvent)) {
|
|
3124
3124
|
r && r(m), o && o(!0), a.current.isFocusWithin = !0, c(m);
|
|
3125
|
-
let
|
|
3125
|
+
let p = m.currentTarget;
|
|
3126
3126
|
i(f, "focus", (g) => {
|
|
3127
|
-
if (a.current.isFocusWithin && !Oo(
|
|
3128
|
-
let
|
|
3127
|
+
if (a.current.isFocusWithin && !Oo(p, g.target)) {
|
|
3128
|
+
let b = new f.defaultView.FocusEvent("blur", {
|
|
3129
3129
|
relatedTarget: g.target
|
|
3130
3130
|
});
|
|
3131
|
-
Yi(
|
|
3132
|
-
let y = Do(
|
|
3131
|
+
Yi(b, p);
|
|
3132
|
+
let y = Do(b);
|
|
3133
3133
|
s(y);
|
|
3134
3134
|
}
|
|
3135
3135
|
}, {
|
|
@@ -3151,7 +3151,7 @@ function ol(e) {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
} : {
|
|
3153
3153
|
focusWithinProps: {
|
|
3154
|
-
onFocus:
|
|
3154
|
+
onFocus: h,
|
|
3155
3155
|
onBlur: s
|
|
3156
3156
|
}
|
|
3157
3157
|
};
|
|
@@ -3179,41 +3179,41 @@ function Go(e) {
|
|
|
3179
3179
|
target: null
|
|
3180
3180
|
}).current;
|
|
3181
3181
|
H(al, []);
|
|
3182
|
-
let { addGlobalListener: s, removeAllGlobalListeners: c } = Io(), { hoverProps:
|
|
3183
|
-
let f = (g,
|
|
3184
|
-
if (l.pointerType =
|
|
3182
|
+
let { addGlobalListener: s, removeAllGlobalListeners: c } = Io(), { hoverProps: h, triggerHoverEnd: m } = le(() => {
|
|
3183
|
+
let f = (g, b) => {
|
|
3184
|
+
if (l.pointerType = b, o || b === "touch" || l.isHovered || !g.currentTarget.contains(g.target)) return;
|
|
3185
3185
|
l.isHovered = !0;
|
|
3186
3186
|
let y = g.currentTarget;
|
|
3187
3187
|
l.target = y, s(at(g.target), "pointerover", (w) => {
|
|
3188
|
-
l.isHovered && l.target && !Oo(l.target, w.target) &&
|
|
3188
|
+
l.isHovered && l.target && !Oo(l.target, w.target) && d(w, w.pointerType);
|
|
3189
3189
|
}, {
|
|
3190
3190
|
capture: !0
|
|
3191
3191
|
}), t && t({
|
|
3192
3192
|
type: "hoverstart",
|
|
3193
3193
|
target: y,
|
|
3194
|
-
pointerType:
|
|
3194
|
+
pointerType: b
|
|
3195
3195
|
}), n && n(!0), i(!0);
|
|
3196
|
-
},
|
|
3196
|
+
}, d = (g, b) => {
|
|
3197
3197
|
let y = l.target;
|
|
3198
|
-
l.pointerType = "", l.target = null, !(
|
|
3198
|
+
l.pointerType = "", l.target = null, !(b === "touch" || !l.isHovered || !y) && (l.isHovered = !1, c(), r && r({
|
|
3199
3199
|
type: "hoverend",
|
|
3200
3200
|
target: y,
|
|
3201
|
-
pointerType:
|
|
3201
|
+
pointerType: b
|
|
3202
3202
|
}), n && n(!1), i(!1));
|
|
3203
|
-
},
|
|
3204
|
-
return typeof PointerEvent < "u" ? (
|
|
3203
|
+
}, p = {};
|
|
3204
|
+
return typeof PointerEvent < "u" ? (p.onPointerEnter = (g) => {
|
|
3205
3205
|
mn && g.pointerType === "mouse" || f(g, g.pointerType);
|
|
3206
|
-
},
|
|
3207
|
-
!o && g.currentTarget.contains(g.target) &&
|
|
3208
|
-
}) : process.env.NODE_ENV === "test" && (
|
|
3206
|
+
}, p.onPointerLeave = (g) => {
|
|
3207
|
+
!o && g.currentTarget.contains(g.target) && d(g, g.pointerType);
|
|
3208
|
+
}) : process.env.NODE_ENV === "test" && (p.onTouchStart = () => {
|
|
3209
3209
|
l.ignoreEmulatedMouseEvents = !0;
|
|
3210
|
-
},
|
|
3210
|
+
}, p.onMouseEnter = (g) => {
|
|
3211
3211
|
!l.ignoreEmulatedMouseEvents && !mn && f(g, "mouse"), l.ignoreEmulatedMouseEvents = !1;
|
|
3212
|
-
},
|
|
3213
|
-
!o && g.currentTarget.contains(g.target) &&
|
|
3212
|
+
}, p.onMouseLeave = (g) => {
|
|
3213
|
+
!o && g.currentTarget.contains(g.target) && d(g, "mouse");
|
|
3214
3214
|
}), {
|
|
3215
|
-
hoverProps:
|
|
3216
|
-
triggerHoverEnd:
|
|
3215
|
+
hoverProps: p,
|
|
3216
|
+
triggerHoverEnd: d
|
|
3217
3217
|
};
|
|
3218
3218
|
}, [
|
|
3219
3219
|
t,
|
|
@@ -3231,7 +3231,7 @@ function Go(e) {
|
|
|
3231
3231
|
}, [
|
|
3232
3232
|
o
|
|
3233
3233
|
]), {
|
|
3234
|
-
hoverProps:
|
|
3234
|
+
hoverProps: h,
|
|
3235
3235
|
isHovered: a
|
|
3236
3236
|
};
|
|
3237
3237
|
}
|
|
@@ -3239,22 +3239,22 @@ function Wo(e = {}) {
|
|
|
3239
3239
|
let { autoFocus: t = !1, isTextInput: n, within: r } = e, o = C({
|
|
3240
3240
|
isFocused: !1,
|
|
3241
3241
|
isFocusVisible: t || Bo()
|
|
3242
|
-
}), [a, i] = U(!1), [l, s] = U(() => o.current.isFocused && o.current.isFocusVisible), c = R(() => s(o.current.isFocused && o.current.isFocusVisible), []),
|
|
3243
|
-
o.current.isFocused =
|
|
3242
|
+
}), [a, i] = U(!1), [l, s] = U(() => o.current.isFocused && o.current.isFocusVisible), c = R(() => s(o.current.isFocused && o.current.isFocusVisible), []), h = R((d) => {
|
|
3243
|
+
o.current.isFocused = d, i(d), c();
|
|
3244
3244
|
}, [
|
|
3245
3245
|
c
|
|
3246
3246
|
]);
|
|
3247
|
-
nl((
|
|
3248
|
-
o.current.isFocusVisible =
|
|
3247
|
+
nl((d) => {
|
|
3248
|
+
o.current.isFocusVisible = d, c();
|
|
3249
3249
|
}, [], {
|
|
3250
3250
|
isTextInput: n
|
|
3251
3251
|
});
|
|
3252
3252
|
let { focusProps: m } = rl({
|
|
3253
3253
|
isDisabled: r,
|
|
3254
|
-
onFocusChange:
|
|
3254
|
+
onFocusChange: h
|
|
3255
3255
|
}), { focusWithinProps: f } = ol({
|
|
3256
3256
|
isDisabled: !r,
|
|
3257
|
-
onFocusWithinChange:
|
|
3257
|
+
onFocusWithinChange: h
|
|
3258
3258
|
});
|
|
3259
3259
|
return {
|
|
3260
3260
|
isFocused: a,
|
|
@@ -3382,8 +3382,8 @@ function fl({ disabled: e = !1 } = {}) {
|
|
|
3382
3382
|
let s = Tt(l.currentTarget);
|
|
3383
3383
|
o.addEventListener(s, "pointerup", a, !1), o.addEventListener(s, "pointermove", (c) => {
|
|
3384
3384
|
if (t.current) {
|
|
3385
|
-
let
|
|
3386
|
-
r(dl(
|
|
3385
|
+
let h = ul(c);
|
|
3386
|
+
r(dl(h, t.current.getBoundingClientRect()));
|
|
3387
3387
|
}
|
|
3388
3388
|
}, !1), o.addEventListener(s, "pointercancel", a, !1);
|
|
3389
3389
|
}
|
|
@@ -3420,12 +3420,12 @@ function pl({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, v
|
|
|
3420
3420
|
if (a) return rn(s, n, r, i, l);
|
|
3421
3421
|
let c = o ?? 0;
|
|
3422
3422
|
if (c & 2) {
|
|
3423
|
-
let { static:
|
|
3424
|
-
if (
|
|
3423
|
+
let { static: h = !1, ...m } = s;
|
|
3424
|
+
if (h) return rn(m, n, r, i, l);
|
|
3425
3425
|
}
|
|
3426
3426
|
if (c & 1) {
|
|
3427
|
-
let { unmount:
|
|
3428
|
-
return Ke(
|
|
3427
|
+
let { unmount: h = !0, ...m } = s;
|
|
3428
|
+
return Ke(h ? 0 : 1, { 0() {
|
|
3429
3429
|
return null;
|
|
3430
3430
|
}, 1() {
|
|
3431
3431
|
return rn({ ...m, hidden: !0, style: { display: "none" } }, n, r, i, l);
|
|
@@ -3434,28 +3434,28 @@ function pl({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: o, v
|
|
|
3434
3434
|
return rn(s, n, r, i, l);
|
|
3435
3435
|
}
|
|
3436
3436
|
function rn(e, t = {}, n, r, o) {
|
|
3437
|
-
let { as: a = n, children: i, refName: l = "ref", ...s } = Dn(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [l]: e.ref } : {},
|
|
3437
|
+
let { as: a = n, children: i, refName: l = "ref", ...s } = Dn(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [l]: e.ref } : {}, h = typeof i == "function" ? i(t) : i;
|
|
3438
3438
|
"className" in s && s.className && typeof s.className == "function" && (s.className = s.className(t)), s["aria-labelledby"] && s["aria-labelledby"] === s.id && (s["aria-labelledby"] = void 0);
|
|
3439
3439
|
let m = {};
|
|
3440
3440
|
if (t) {
|
|
3441
|
-
let f = !1,
|
|
3442
|
-
for (let [
|
|
3441
|
+
let f = !1, d = [];
|
|
3442
|
+
for (let [p, g] of Object.entries(t)) typeof g == "boolean" && (f = !0), g === !0 && d.push(p.replace(/([A-Z])/g, (b) => `-${b.toLowerCase()}`));
|
|
3443
3443
|
if (f) {
|
|
3444
|
-
m["data-headlessui-state"] =
|
|
3445
|
-
for (let
|
|
3444
|
+
m["data-headlessui-state"] = d.join(" ");
|
|
3445
|
+
for (let p of d) m[`data-${p}`] = "";
|
|
3446
3446
|
}
|
|
3447
3447
|
}
|
|
3448
|
-
if (Ht(a) && (Object.keys(lt(s)).length > 0 || Object.keys(lt(m)).length > 0)) if (!rs(
|
|
3448
|
+
if (Ht(a) && (Object.keys(lt(s)).length > 0 || Object.keys(lt(m)).length > 0)) if (!rs(h) || Array.isArray(h) && h.length > 1 || bl(h)) {
|
|
3449
3449
|
if (Object.keys(lt(s)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(lt(s)).concat(Object.keys(lt(m))).map((f) => ` - ${f}`).join(`
|
|
3450
3450
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((f) => ` - ${f}`).join(`
|
|
3451
3451
|
`)].join(`
|
|
3452
3452
|
`));
|
|
3453
3453
|
} else {
|
|
3454
|
-
let f =
|
|
3455
|
-
for (let y in m) y in
|
|
3456
|
-
return os(
|
|
3454
|
+
let f = h.props, d = f?.className, p = typeof d == "function" ? (...y) => Jn(d(...y), s.className) : Jn(d, s.className), g = p ? { className: p } : {}, b = qo(h.props, lt(Dn(s, ["ref"])));
|
|
3455
|
+
for (let y in m) y in b && delete m[y];
|
|
3456
|
+
return os(h, Object.assign({}, b, m, c, { ref: o(vl(h), c.ref) }, g));
|
|
3457
3457
|
}
|
|
3458
|
-
return un(a, Object.assign({}, Dn(s, ["ref"]), !Ht(a) && c, !Ht(a) && m),
|
|
3458
|
+
return un(a, Object.assign({}, Dn(s, ["ref"]), !Ht(a) && c, !Ht(a) && m), h);
|
|
3459
3459
|
}
|
|
3460
3460
|
function hl() {
|
|
3461
3461
|
let e = C([]), t = R((n) => {
|
|
@@ -3525,8 +3525,8 @@ function bl(e) {
|
|
|
3525
3525
|
let wl = "button";
|
|
3526
3526
|
function yl(e, t) {
|
|
3527
3527
|
var n;
|
|
3528
|
-
let r = xn(), { disabled: o = r || !1, autoFocus: a = !1, ...i } = e, { isFocusVisible: l, focusProps: s } = Wo({ autoFocus: a }), { isHovered: c, hoverProps:
|
|
3529
|
-
return Ce()({ ourProps:
|
|
3528
|
+
let r = xn(), { disabled: o = r || !1, autoFocus: a = !1, ...i } = e, { isFocusVisible: l, focusProps: s } = Wo({ autoFocus: a }), { isHovered: c, hoverProps: h } = Go({ isDisabled: o }), { pressed: m, pressProps: f } = fl({ disabled: o }), d = Yo({ ref: t, type: (n = i.type) != null ? n : "button", disabled: o || void 0, autoFocus: a }, s, h, f), p = st({ disabled: o, hover: c, focus: l, active: m, autofocus: a });
|
|
3529
|
+
return Ce()({ ourProps: d, theirProps: i, slot: p, defaultTag: wl, name: "Button" });
|
|
3530
3530
|
}
|
|
3531
3531
|
let ne = we(yl), xl = "span";
|
|
3532
3532
|
var hn = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(hn || {});
|
|
@@ -3631,12 +3631,12 @@ function Rl(e) {
|
|
|
3631
3631
|
let Fl = "label";
|
|
3632
3632
|
function Il(e, t) {
|
|
3633
3633
|
var n;
|
|
3634
|
-
let r = pt(), o = ta(), a = Zo(), i = xn(), { id: l = `headlessui-label-${r}`, htmlFor: s = a ?? ((n = o.props) == null ? void 0 : n.htmlFor), passive: c = !1, ...
|
|
3634
|
+
let r = pt(), o = ta(), a = Zo(), i = xn(), { id: l = `headlessui-label-${r}`, htmlFor: s = a ?? ((n = o.props) == null ? void 0 : n.htmlFor), passive: c = !1, ...h } = e, m = Pe(t);
|
|
3635
3635
|
xe(() => o.register(l), [l, o.register]);
|
|
3636
3636
|
let f = Y((g) => {
|
|
3637
|
-
let
|
|
3638
|
-
if (!(g.target !== g.currentTarget && Al(g.target)) && (Vr(
|
|
3639
|
-
let y = document.getElementById(
|
|
3637
|
+
let b = g.currentTarget;
|
|
3638
|
+
if (!(g.target !== g.currentTarget && Al(g.target)) && (Vr(b) && g.preventDefault(), o.props && "onClick" in o.props && typeof o.props.onClick == "function" && o.props.onClick(g), Vr(b))) {
|
|
3639
|
+
let y = document.getElementById(b.htmlFor);
|
|
3640
3640
|
if (y) {
|
|
3641
3641
|
let w = y.getAttribute("disabled");
|
|
3642
3642
|
if (w === "true" || w === "") return;
|
|
@@ -3645,8 +3645,8 @@ function Il(e, t) {
|
|
|
3645
3645
|
(Xo(y) && (y.type === "file" || y.type === "radio" || y.type === "checkbox") || y.role === "radio" || y.role === "checkbox" || y.role === "switch") && y.click(), y.focus({ preventScroll: !0 });
|
|
3646
3646
|
}
|
|
3647
3647
|
}
|
|
3648
|
-
}),
|
|
3649
|
-
return c && ("onClick" in
|
|
3648
|
+
}), d = st({ ...o.slot, disabled: i || !1 }), p = { ref: m, ...o.props, id: l, htmlFor: s, onClick: f };
|
|
3649
|
+
return c && ("onClick" in p && (delete p.htmlFor, delete p.onClick), "onClick" in h && delete h.onClick), Ce()({ ourProps: p, theirProps: h, slot: d, defaultTag: s ? Fl : "div", name: o.name || "Label" });
|
|
3650
3650
|
}
|
|
3651
3651
|
let Dl = we(Il);
|
|
3652
3652
|
Object.assign(Dl, {});
|
|
@@ -3759,18 +3759,18 @@ function Zl() {
|
|
|
3759
3759
|
return s === c && (s !== 0 || 1 / s === 1 / c) || s !== s && c !== c;
|
|
3760
3760
|
}
|
|
3761
3761
|
var n = typeof Object.is == "function" ? Object.is : t, r = e.useSyncExternalStore, o = e.useRef, a = e.useEffect, i = e.useMemo, l = e.useDebugValue;
|
|
3762
|
-
return jn.useSyncExternalStoreWithSelector = function(s, c,
|
|
3763
|
-
var
|
|
3764
|
-
if (
|
|
3765
|
-
var
|
|
3766
|
-
|
|
3767
|
-
} else
|
|
3768
|
-
|
|
3762
|
+
return jn.useSyncExternalStoreWithSelector = function(s, c, h, m, f) {
|
|
3763
|
+
var d = o(null);
|
|
3764
|
+
if (d.current === null) {
|
|
3765
|
+
var p = { hasValue: !1, value: null };
|
|
3766
|
+
d.current = p;
|
|
3767
|
+
} else p = d.current;
|
|
3768
|
+
d = i(
|
|
3769
3769
|
function() {
|
|
3770
|
-
function
|
|
3770
|
+
function b(N) {
|
|
3771
3771
|
if (!y) {
|
|
3772
|
-
if (y = !0, w = N, N = m(N), f !== void 0 &&
|
|
3773
|
-
var S =
|
|
3772
|
+
if (y = !0, w = N, N = m(N), f !== void 0 && p.hasValue) {
|
|
3773
|
+
var S = p.value;
|
|
3774
3774
|
if (f(S, N))
|
|
3775
3775
|
return x = S;
|
|
3776
3776
|
}
|
|
@@ -3780,22 +3780,22 @@ function Zl() {
|
|
|
3780
3780
|
var L = m(N);
|
|
3781
3781
|
return f !== void 0 && f(S, L) ? (w = N, S) : (w = N, x = L);
|
|
3782
3782
|
}
|
|
3783
|
-
var y = !1, w, x, T =
|
|
3783
|
+
var y = !1, w, x, T = h === void 0 ? null : h;
|
|
3784
3784
|
return [
|
|
3785
3785
|
function() {
|
|
3786
|
-
return
|
|
3786
|
+
return b(c());
|
|
3787
3787
|
},
|
|
3788
3788
|
T === null ? void 0 : function() {
|
|
3789
|
-
return
|
|
3789
|
+
return b(T());
|
|
3790
3790
|
}
|
|
3791
3791
|
];
|
|
3792
3792
|
},
|
|
3793
|
-
[c,
|
|
3793
|
+
[c, h, m, f]
|
|
3794
3794
|
);
|
|
3795
|
-
var g = r(s,
|
|
3795
|
+
var g = r(s, d[0], d[1]);
|
|
3796
3796
|
return a(
|
|
3797
3797
|
function() {
|
|
3798
|
-
|
|
3798
|
+
p.hasValue = !0, p.value = g;
|
|
3799
3799
|
},
|
|
3800
3800
|
[g]
|
|
3801
3801
|
), l(g), g;
|
|
@@ -3810,18 +3810,18 @@ function Xl() {
|
|
|
3810
3810
|
}
|
|
3811
3811
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
3812
3812
|
var t = I, n = typeof Object.is == "function" ? Object.is : e, r = t.useSyncExternalStore, o = t.useRef, a = t.useEffect, i = t.useMemo, l = t.useDebugValue;
|
|
3813
|
-
zn.useSyncExternalStoreWithSelector = function(s, c,
|
|
3814
|
-
var
|
|
3815
|
-
if (
|
|
3816
|
-
var
|
|
3817
|
-
|
|
3818
|
-
} else
|
|
3819
|
-
|
|
3813
|
+
zn.useSyncExternalStoreWithSelector = function(s, c, h, m, f) {
|
|
3814
|
+
var d = o(null);
|
|
3815
|
+
if (d.current === null) {
|
|
3816
|
+
var p = { hasValue: !1, value: null };
|
|
3817
|
+
d.current = p;
|
|
3818
|
+
} else p = d.current;
|
|
3819
|
+
d = i(
|
|
3820
3820
|
function() {
|
|
3821
|
-
function
|
|
3821
|
+
function b(N) {
|
|
3822
3822
|
if (!y) {
|
|
3823
|
-
if (y = !0, w = N, N = m(N), f !== void 0 &&
|
|
3824
|
-
var S =
|
|
3823
|
+
if (y = !0, w = N, N = m(N), f !== void 0 && p.hasValue) {
|
|
3824
|
+
var S = p.value;
|
|
3825
3825
|
if (f(S, N))
|
|
3826
3826
|
return x = S;
|
|
3827
3827
|
}
|
|
@@ -3832,22 +3832,22 @@ function Xl() {
|
|
|
3832
3832
|
var L = m(N);
|
|
3833
3833
|
return f !== void 0 && f(S, L) ? (w = N, S) : (w = N, x = L);
|
|
3834
3834
|
}
|
|
3835
|
-
var y = !1, w, x, T =
|
|
3835
|
+
var y = !1, w, x, T = h === void 0 ? null : h;
|
|
3836
3836
|
return [
|
|
3837
3837
|
function() {
|
|
3838
|
-
return
|
|
3838
|
+
return b(c());
|
|
3839
3839
|
},
|
|
3840
3840
|
T === null ? void 0 : function() {
|
|
3841
|
-
return
|
|
3841
|
+
return b(T());
|
|
3842
3842
|
}
|
|
3843
3843
|
];
|
|
3844
3844
|
},
|
|
3845
|
-
[c,
|
|
3845
|
+
[c, h, m, f]
|
|
3846
3846
|
);
|
|
3847
|
-
var g = r(s,
|
|
3847
|
+
var g = r(s, d[0], d[1]);
|
|
3848
3848
|
return a(
|
|
3849
3849
|
function() {
|
|
3850
|
-
|
|
3850
|
+
p.hasValue = !0, p.value = g;
|
|
3851
3851
|
},
|
|
3852
3852
|
[g]
|
|
3853
3853
|
), l(g), g;
|
|
@@ -3896,10 +3896,10 @@ function tc(e, { allowed: t, disallowed: n } = {}) {
|
|
|
3896
3896
|
if (!s) continue;
|
|
3897
3897
|
let c = Tt(s);
|
|
3898
3898
|
if (!c) continue;
|
|
3899
|
-
let
|
|
3900
|
-
for (;
|
|
3901
|
-
for (let m of
|
|
3902
|
-
|
|
3899
|
+
let h = s.parentElement;
|
|
3900
|
+
for (; h && h !== c.body; ) {
|
|
3901
|
+
for (let m of h.children) l.some((f) => m.contains(f)) || i.add(Zr(m));
|
|
3902
|
+
h = h.parentElement;
|
|
3903
3903
|
}
|
|
3904
3904
|
}
|
|
3905
3905
|
return i.dispose;
|
|
@@ -3972,7 +3972,7 @@ function dc(e, t = (n) => n) {
|
|
|
3972
3972
|
}
|
|
3973
3973
|
function jt(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: o = [] } = {}) {
|
|
3974
3974
|
let a = Array.isArray(e) ? e.length > 0 ? Xn(e[0]) : document : Xn(e), i = Array.isArray(e) ? n ? dc(e) : e : t & 64 ? sc(e) : ac(e);
|
|
3975
|
-
o.length > 0 && i.length > 1 && (i = i.filter((
|
|
3975
|
+
o.length > 0 && i.length > 1 && (i = i.filter((d) => !o.some((p) => p != null && "current" in p ? p?.current === d : p === d))), r = r ?? a?.activeElement;
|
|
3976
3976
|
let l = (() => {
|
|
3977
3977
|
if (t & 5) return 1;
|
|
3978
3978
|
if (t & 10) return -1;
|
|
@@ -3983,16 +3983,16 @@ function jt(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: o = [] }
|
|
|
3983
3983
|
if (t & 4) return Math.max(0, i.indexOf(r)) + 1;
|
|
3984
3984
|
if (t & 8) return i.length - 1;
|
|
3985
3985
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
3986
|
-
})(), c = t & 32 ? { preventScroll: !0 } : {},
|
|
3986
|
+
})(), c = t & 32 ? { preventScroll: !0 } : {}, h = 0, m = i.length, f;
|
|
3987
3987
|
do {
|
|
3988
|
-
if (
|
|
3989
|
-
let
|
|
3990
|
-
if (t & 16)
|
|
3988
|
+
if (h >= m || h + m <= 0) return 0;
|
|
3989
|
+
let d = s + h;
|
|
3990
|
+
if (t & 16) d = (d + m) % m;
|
|
3991
3991
|
else {
|
|
3992
|
-
if (
|
|
3993
|
-
if (
|
|
3992
|
+
if (d < 0) return 3;
|
|
3993
|
+
if (d >= m) return 1;
|
|
3994
3994
|
}
|
|
3995
|
-
f = i[
|
|
3995
|
+
f = i[d], f?.focus(c), h += l;
|
|
3996
3996
|
} while (f !== Ko(f));
|
|
3997
3997
|
return t & 6 && uc(f) && f.select(), 2;
|
|
3998
3998
|
}
|
|
@@ -4031,10 +4031,10 @@ function mc(e, t, n) {
|
|
|
4031
4031
|
if (l.defaultPrevented) return;
|
|
4032
4032
|
let c = s(l);
|
|
4033
4033
|
if (c === null || !c.getRootNode().contains(c) || !c.isConnected) return;
|
|
4034
|
-
let
|
|
4034
|
+
let h = (function m(f) {
|
|
4035
4035
|
return typeof f == "function" ? m(f()) : Array.isArray(f) || f instanceof Set ? f : [f];
|
|
4036
4036
|
})(t);
|
|
4037
|
-
for (let m of
|
|
4037
|
+
for (let m of h) if (m !== null && (m.contains(c) || l.composed && l.composedPath().includes(m))) return;
|
|
4038
4038
|
return !ic(c, la.Loose) && c.tabIndex !== -1 && l.preventDefault(), r.current(l, c);
|
|
4039
4039
|
}, [r, t]), a = C(null);
|
|
4040
4040
|
an(e, "pointerdown", (l) => {
|
|
@@ -4108,8 +4108,8 @@ function vc() {
|
|
|
4108
4108
|
if (nt(l.target)) try {
|
|
4109
4109
|
let s = l.target.closest("a");
|
|
4110
4110
|
if (!s) return;
|
|
4111
|
-
let { hash: c } = new URL(s.href),
|
|
4112
|
-
nt(
|
|
4111
|
+
let { hash: c } = new URL(s.href), h = e.querySelector(c);
|
|
4112
|
+
nt(h) && !r(h) && (i = h);
|
|
4113
4113
|
} catch {
|
|
4114
4114
|
}
|
|
4115
4115
|
}, !0), t.group((l) => {
|
|
@@ -4201,7 +4201,7 @@ function Ec(e) {
|
|
|
4201
4201
|
return t;
|
|
4202
4202
|
}
|
|
4203
4203
|
function Tc(e, t, n, r) {
|
|
4204
|
-
let [o, a] = U(n), { hasFlag: i, addFlag: l, removeFlag: s } = xc(e && o ? 3 : 0), c = C(!1),
|
|
4204
|
+
let [o, a] = U(n), { hasFlag: i, addFlag: l, removeFlag: s } = xc(e && o ? 3 : 0), c = C(!1), h = C(!1), m = qt();
|
|
4205
4205
|
return xe(() => {
|
|
4206
4206
|
var f;
|
|
4207
4207
|
if (e) {
|
|
@@ -4210,12 +4210,12 @@ function Tc(e, t, n, r) {
|
|
|
4210
4210
|
return;
|
|
4211
4211
|
}
|
|
4212
4212
|
return (f = r?.start) == null || f.call(r, n), Nc(t, { inFlight: c, prepare() {
|
|
4213
|
-
|
|
4213
|
+
h.current ? h.current = !1 : h.current = c.current, c.current = !0, !h.current && (n ? (l(3), s(4)) : (l(4), s(2)));
|
|
4214
4214
|
}, run() {
|
|
4215
|
-
|
|
4215
|
+
h.current ? n ? (s(3), l(4)) : (s(4), l(3)) : n ? s(1) : l(1);
|
|
4216
4216
|
}, done() {
|
|
4217
|
-
var
|
|
4218
|
-
|
|
4217
|
+
var d;
|
|
4218
|
+
h.current && Sc(t) || (c.current = !1, s(7), n || a(!1), (d = r?.end) == null || d.call(r, n));
|
|
4219
4219
|
} });
|
|
4220
4220
|
}
|
|
4221
4221
|
}, [e, n, t, m]), e ? [o, { closed: i(1), enter: i(2), leave: i(4), transition: i(2) || i(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
@@ -4325,12 +4325,12 @@ function Pc(e) {
|
|
|
4325
4325
|
let pa = rt, Oc = we(function(e, t) {
|
|
4326
4326
|
let { ownerDocument: n = null, ...r } = e, o = C(null), a = Pe(Sl((f) => {
|
|
4327
4327
|
o.current = f;
|
|
4328
|
-
}), t), i = yr(o.current), l = n ?? i, s = Pc(l), c = be(nr),
|
|
4328
|
+
}), t), i = yr(o.current), l = n ?? i, s = Pc(l), c = be(nr), h = qt(), m = Ce();
|
|
4329
4329
|
return fa(() => {
|
|
4330
4330
|
var f;
|
|
4331
4331
|
s && s.childNodes.length <= 0 && ((f = s.parentElement) == null || f.removeChild(s));
|
|
4332
4332
|
}), s ? js(I.createElement("div", { "data-headlessui-portal": "", ref: (f) => {
|
|
4333
|
-
|
|
4333
|
+
h.dispose(), c && f && h.add(c.register(f));
|
|
4334
4334
|
} }, m({ ourProps: { ref: a }, theirProps: r, slot: {}, defaultTag: pa, name: "Portal" })), s) : null;
|
|
4335
4335
|
});
|
|
4336
4336
|
function Rc(e, t) {
|
|
@@ -4436,8 +4436,8 @@ function Kc(e, t) {
|
|
|
4436
4436
|
Nn() || (l = 0);
|
|
4437
4437
|
let c = yr(n.current);
|
|
4438
4438
|
Xc(l, { ownerDocument: c });
|
|
4439
|
-
let
|
|
4440
|
-
Qc(l, { ownerDocument: c, container: n, containers: i, previousActiveElement:
|
|
4439
|
+
let h = Jc(l, { ownerDocument: c, container: n, initialFocus: o, initialFocusFallback: a });
|
|
4440
|
+
Qc(l, { ownerDocument: c, container: n, containers: i, previousActiveElement: h });
|
|
4441
4441
|
let m = Gc(), f = Y((w) => {
|
|
4442
4442
|
if (!ot(n.current)) return;
|
|
4443
4443
|
let x = n.current;
|
|
@@ -4448,8 +4448,8 @@ function Kc(e, t) {
|
|
|
4448
4448
|
jt(x, Be.Last, { skipElements: [w.relatedTarget, a] });
|
|
4449
4449
|
} });
|
|
4450
4450
|
});
|
|
4451
|
-
}),
|
|
4452
|
-
w.key == "Tab" && (g.current = !0,
|
|
4451
|
+
}), d = Yt(!!(l & 2), "focus-trap#tab-lock"), p = qt(), g = C(!1), b = { ref: r, onKeyDown(w) {
|
|
4452
|
+
w.key == "Tab" && (g.current = !0, p.requestAnimationFrame(() => {
|
|
4453
4453
|
g.current = !1;
|
|
4454
4454
|
}));
|
|
4455
4455
|
}, onBlur(w) {
|
|
@@ -4459,7 +4459,7 @@ function Kc(e, t) {
|
|
|
4459
4459
|
let T = w.relatedTarget;
|
|
4460
4460
|
nt(T) && T.dataset.headlessuiFocusGuard !== "true" && (ya(x, T) || (g.current ? jt(n.current, Ke(m.current, { [Ot.Forwards]: () => Be.Next, [Ot.Backwards]: () => Be.Previous }) | Be.WrapAround, { relativeTo: w.target }) : nt(w.target) && We(w.target)));
|
|
4461
4461
|
} }, y = Ce();
|
|
4462
|
-
return I.createElement(I.Fragment, null,
|
|
4462
|
+
return I.createElement(I.Fragment, null, d && I.createElement(Qn, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: f, features: hn.Focusable }), y({ ourProps: b, theirProps: s, defaultTag: Wc, name: "FocusTrap" }), d && I.createElement(Qn, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: f, features: hn.Focusable }));
|
|
4463
4463
|
}
|
|
4464
4464
|
let qc = we(Kc), Yc = Object.assign(qc, { features: ct });
|
|
4465
4465
|
function Zc(e = !0) {
|
|
@@ -4522,8 +4522,8 @@ function Qc(e, { ownerDocument: t, container: n, containers: r, previousActiveEl
|
|
|
4522
4522
|
ot(n.current) && s.add(n.current);
|
|
4523
4523
|
let c = o.current;
|
|
4524
4524
|
if (!c) return;
|
|
4525
|
-
let
|
|
4526
|
-
ot(
|
|
4525
|
+
let h = l.target;
|
|
4526
|
+
ot(h) ? ya(s, h) ? (o.current = h, We(h)) : (l.preventDefault(), l.stopPropagation(), We(c)) : We(o.current);
|
|
4527
4527
|
}, !0);
|
|
4528
4528
|
}
|
|
4529
4529
|
function ya(e, t) {
|
|
@@ -4553,37 +4553,37 @@ function Sn(e) {
|
|
|
4553
4553
|
return "children" in e ? Sn(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
4554
4554
|
}
|
|
4555
4555
|
function Ca(e, t) {
|
|
4556
|
-
let n = ht(e), r = C([]), o = Cr(), a = qt(), i = Y((
|
|
4557
|
-
let g = r.current.findIndex(({ el:
|
|
4558
|
-
g !== -1 && (Ke(
|
|
4556
|
+
let n = ht(e), r = C([]), o = Cr(), a = qt(), i = Y((d, p = tt.Hidden) => {
|
|
4557
|
+
let g = r.current.findIndex(({ el: b }) => b === d);
|
|
4558
|
+
g !== -1 && (Ke(p, { [tt.Unmount]() {
|
|
4559
4559
|
r.current.splice(g, 1);
|
|
4560
4560
|
}, [tt.Hidden]() {
|
|
4561
4561
|
r.current[g].state = "hidden";
|
|
4562
4562
|
} }), a.microTask(() => {
|
|
4563
|
-
var
|
|
4564
|
-
!Sn(r) && o.current && ((
|
|
4563
|
+
var b;
|
|
4564
|
+
!Sn(r) && o.current && ((b = n.current) == null || b.call(n));
|
|
4565
4565
|
}));
|
|
4566
|
-
}), l = Y((
|
|
4567
|
-
let
|
|
4568
|
-
return
|
|
4569
|
-
}), s = C([]), c = C(Promise.resolve()),
|
|
4570
|
-
s.current.splice(0), t && (t.chains.current[
|
|
4571
|
-
s.current.push(
|
|
4572
|
-
})]), t?.chains.current[
|
|
4573
|
-
Promise.all(
|
|
4574
|
-
})]),
|
|
4575
|
-
}), f = Y((
|
|
4576
|
-
Promise.all(
|
|
4577
|
-
var
|
|
4578
|
-
(
|
|
4579
|
-
}).then(() => g(
|
|
4566
|
+
}), l = Y((d) => {
|
|
4567
|
+
let p = r.current.find(({ el: g }) => g === d);
|
|
4568
|
+
return p ? p.state !== "visible" && (p.state = "visible") : r.current.push({ el: d, state: "visible" }), () => i(d, tt.Unmount);
|
|
4569
|
+
}), s = C([]), c = C(Promise.resolve()), h = C({ enter: [], leave: [] }), m = Y((d, p, g) => {
|
|
4570
|
+
s.current.splice(0), t && (t.chains.current[p] = t.chains.current[p].filter(([b]) => b !== d)), t?.chains.current[p].push([d, new Promise((b) => {
|
|
4571
|
+
s.current.push(b);
|
|
4572
|
+
})]), t?.chains.current[p].push([d, new Promise((b) => {
|
|
4573
|
+
Promise.all(h.current[p].map(([y, w]) => w)).then(() => b());
|
|
4574
|
+
})]), p === "enter" ? c.current = c.current.then(() => t?.wait.current).then(() => g(p)) : g(p);
|
|
4575
|
+
}), f = Y((d, p, g) => {
|
|
4576
|
+
Promise.all(h.current[p].splice(0).map(([b, y]) => y)).then(() => {
|
|
4577
|
+
var b;
|
|
4578
|
+
(b = s.current.shift()) == null || b();
|
|
4579
|
+
}).then(() => g(p));
|
|
4580
4580
|
});
|
|
4581
|
-
return le(() => ({ children: r, register: l, unregister: i, onStart: m, onStop: f, wait: c, chains:
|
|
4581
|
+
return le(() => ({ children: r, register: l, unregister: i, onStart: m, onStop: f, wait: c, chains: h }), [l, i, r, m, f, h, c]);
|
|
4582
4582
|
}
|
|
4583
4583
|
let Ea = rt, Ta = pn.RenderStrategy;
|
|
4584
4584
|
function ru(e, t) {
|
|
4585
4585
|
var n, r;
|
|
4586
|
-
let { transition: o = !0, beforeEnter: a, afterEnter: i, beforeLeave: l, afterLeave: s, enter: c, enterFrom:
|
|
4586
|
+
let { transition: o = !0, beforeEnter: a, afterEnter: i, beforeLeave: l, afterLeave: s, enter: c, enterFrom: h, enterTo: m, entered: f, leave: d, leaveFrom: p, leaveTo: g, ...b } = e, [y, w] = U(null), x = C(null), T = xa(e), N = Pe(...T ? [x, t, w] : t === null ? [] : [t]), S = (n = b.unmount) == null || n ? tt.Unmount : tt.Hidden, { show: L, appear: k, initial: F } = tu(), [j, P] = U(L ? "visible" : "hidden"), fe = nu(), { register: oe, unregister: B } = fe;
|
|
4587
4587
|
xe(() => oe(x), [oe, x]), xe(() => {
|
|
4588
4588
|
if (S === tt.Hidden && x.current) {
|
|
4589
4589
|
if (L && j !== "visible") {
|
|
@@ -4614,34 +4614,34 @@ function ru(e, t) {
|
|
|
4614
4614
|
H(() => {
|
|
4615
4615
|
T && o || (se(L), ae(L));
|
|
4616
4616
|
}, [L, T, o]);
|
|
4617
|
-
let he = !(!o || !T || !re || te), [, O] = Tc(he, y, L, { start: se, end: ae }), K = lt({ ref: N, className: ((r = Jn(
|
|
4617
|
+
let he = !(!o || !T || !re || te), [, O] = Tc(he, y, L, { start: se, end: ae }), K = lt({ ref: N, className: ((r = Jn(b.className, ce && c, ce && h, O.enter && c, O.enter && O.closed && h, O.enter && !O.closed && m, O.leave && d, O.leave && !O.closed && p, O.leave && O.closed && g, !O.transition && L && f)) == null ? void 0 : r.trim()) || void 0, ...Ec(O) }), ue = 0;
|
|
4618
4618
|
j === "visible" && (ue |= _e.Open), j === "hidden" && (ue |= _e.Closed), L && j === "hidden" && (ue |= _e.Opening), !L && j === "visible" && (ue |= _e.Closing);
|
|
4619
4619
|
let Oe = Ce();
|
|
4620
|
-
return I.createElement(An.Provider, { value: ve }, I.createElement($c, { value: ue }, Oe({ ourProps: K, theirProps:
|
|
4620
|
+
return I.createElement(An.Provider, { value: ve }, I.createElement($c, { value: ue }, Oe({ ourProps: K, theirProps: b, defaultTag: Ea, features: Ta, visible: j === "visible", name: "Transition.Child" })));
|
|
4621
4621
|
}
|
|
4622
4622
|
function ou(e, t) {
|
|
4623
4623
|
let { show: n, appear: r = !1, unmount: o = !0, ...a } = e, i = C(null), l = xa(e), s = Pe(...l ? [i, t] : t === null ? [] : [t]);
|
|
4624
4624
|
Nn();
|
|
4625
4625
|
let c = Tn();
|
|
4626
4626
|
if (n === void 0 && c !== null && (n = (c & _e.Open) === _e.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
4627
|
-
let [
|
|
4627
|
+
let [h, m] = U(n ? "visible" : "hidden"), f = Ca(() => {
|
|
4628
4628
|
n || m("hidden");
|
|
4629
|
-
}), [
|
|
4629
|
+
}), [d, p] = U(!0), g = C([n]);
|
|
4630
4630
|
xe(() => {
|
|
4631
|
-
|
|
4631
|
+
d !== !1 && g.current[g.current.length - 1] !== n && (g.current.push(n), p(!1));
|
|
4632
4632
|
}, [g, n]);
|
|
4633
|
-
let
|
|
4633
|
+
let b = le(() => ({ show: n, appear: r, initial: d }), [n, r, d]);
|
|
4634
4634
|
xe(() => {
|
|
4635
4635
|
n ? m("visible") : !Sn(f) && i.current !== null && m("hidden");
|
|
4636
4636
|
}, [n, f]);
|
|
4637
4637
|
let y = { unmount: o }, w = Y(() => {
|
|
4638
4638
|
var N;
|
|
4639
|
-
|
|
4639
|
+
d && p(!1), (N = e.beforeEnter) == null || N.call(e);
|
|
4640
4640
|
}), x = Y(() => {
|
|
4641
4641
|
var N;
|
|
4642
|
-
|
|
4642
|
+
d && p(!1), (N = e.beforeLeave) == null || N.call(e);
|
|
4643
4643
|
}), T = Ce();
|
|
4644
|
-
return I.createElement(An.Provider, { value: f }, I.createElement(kn.Provider, { value:
|
|
4644
|
+
return I.createElement(An.Provider, { value: f }, I.createElement(kn.Provider, { value: b }, T({ ourProps: { ...y, as: rt, children: I.createElement(Na, { ref: s, ...y, ...a, beforeEnter: w, beforeLeave: x }) }, theirProps: {}, defaultTag: rt, features: Ta, visible: h === "visible", name: "Transition" })));
|
|
4645
4645
|
}
|
|
4646
4646
|
function au(e, t) {
|
|
4647
4647
|
let n = be(kn) !== null, r = Tn() !== null;
|
|
@@ -4665,19 +4665,19 @@ function cu(e, t) {
|
|
|
4665
4665
|
return Ke(t.type, lu, e, t);
|
|
4666
4666
|
}
|
|
4667
4667
|
let ao = we(function(e, t) {
|
|
4668
|
-
let n = pt(), { id: r = `headlessui-dialog-${n}`, open: o, onClose: a, initialFocus: i, role: l = "dialog", autoFocus: s = !0, __demoMode: c = !1, unmount:
|
|
4668
|
+
let n = pt(), { id: r = `headlessui-dialog-${n}`, open: o, onClose: a, initialFocus: i, role: l = "dialog", autoFocus: s = !0, __demoMode: c = !1, unmount: h = !1, ...m } = e, f = C(!1);
|
|
4669
4669
|
l = (function() {
|
|
4670
4670
|
return l === "dialog" || l === "alertdialog" ? l : (f.current || (f.current = !0, console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
4671
4671
|
})();
|
|
4672
|
-
let
|
|
4673
|
-
o === void 0 &&
|
|
4674
|
-
let
|
|
4672
|
+
let d = Tn();
|
|
4673
|
+
o === void 0 && d !== null && (o = (d & _e.Open) === _e.Open);
|
|
4674
|
+
let p = C(null), g = Pe(p, t), b = yr(p.current), y = o ? 0 : 1, [w, x] = as(cu, { titleId: null, descriptionId: null, panelRef: ss() }), T = Y(() => a(!1)), N = Y((O) => x({ type: 0, id: O })), S = Nn() ? y === 0 : !1, [L, k] = Dc(), F = { get current() {
|
|
4675
4675
|
var O;
|
|
4676
|
-
return (O = w.panelRef.current) != null ? O :
|
|
4677
|
-
} }, j = ba(), { resolveContainers: P } = Vc({ mainTreeNode: j, portals: L, defaultContainers: [F] }), fe =
|
|
4676
|
+
return (O = w.panelRef.current) != null ? O : p.current;
|
|
4677
|
+
} }, j = ba(), { resolveContainers: P } = Vc({ mainTreeNode: j, portals: L, defaultContainers: [F] }), fe = d !== null ? (d & _e.Closing) === _e.Closing : !1;
|
|
4678
4678
|
tc(c || fe ? !1 : S, { allowed: Y(() => {
|
|
4679
4679
|
var O, K;
|
|
4680
|
-
return [(K = (O =
|
|
4680
|
+
return [(K = (O = p.current) == null ? void 0 : O.closest("[data-headlessui-portal]")) != null ? K : null];
|
|
4681
4681
|
}), disallowed: Y(() => {
|
|
4682
4682
|
var O;
|
|
4683
4683
|
return [(O = j?.closest("body > *:not(#headlessui-portal-root)")) != null ? O : null];
|
|
@@ -4689,13 +4689,13 @@ let ao = we(function(e, t) {
|
|
|
4689
4689
|
let B = ia(oe, R((O) => oe.selectors.isTop(O, r), [oe, r]));
|
|
4690
4690
|
mc(B, P, (O) => {
|
|
4691
4691
|
O.preventDefault(), T();
|
|
4692
|
-
}), jc(B,
|
|
4692
|
+
}), jc(B, b?.defaultView, (O) => {
|
|
4693
4693
|
O.preventDefault(), O.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), T();
|
|
4694
|
-
}), yc(c || fe ? !1 : S,
|
|
4695
|
-
let [re, te] = Ml(), ce = le(() => [{ dialogState: y, close: T, setTitleId: N, unmount:
|
|
4694
|
+
}), yc(c || fe ? !1 : S, b, P), nc(S, p, T);
|
|
4695
|
+
let [re, te] = Ml(), ce = le(() => [{ dialogState: y, close: T, setTitleId: N, unmount: h }, w], [y, T, N, h, w]), _ = st({ open: y === 0 }), ve = { ref: g, id: r, role: l, tabIndex: -1, "aria-modal": c ? void 0 : y === 0 ? !0 : void 0, "aria-labelledby": w.titleId, "aria-describedby": re, unmount: h }, se = !zc(), ae = ct.None;
|
|
4696
4696
|
S && !c && (ae |= ct.RestoreFocus, ae |= ct.TabLock, s && (ae |= ct.AutoFocus), se && (ae |= ct.InitialFocus));
|
|
4697
4697
|
let he = Ce();
|
|
4698
|
-
return I.createElement(Mc, null, I.createElement(ro, { force: !0 }, I.createElement(Uc, null, I.createElement(Er.Provider, { value: ce }, I.createElement(ga, { target:
|
|
4698
|
+
return I.createElement(Mc, null, I.createElement(ro, { force: !0 }, I.createElement(Uc, null, I.createElement(Er.Provider, { value: ce }, I.createElement(ga, { target: p }, I.createElement(ro, { force: !1 }, I.createElement(te, { slot: _ }, I.createElement(k, null, I.createElement(Yc, { initialFocus: i, initialFocusFallback: p, containers: P, features: ae }, I.createElement(Ul, { value: T }, he({ ourProps: ve, theirProps: m, slot: _, defaultTag: uu, features: du, visible: y === 0, name: "Dialog" })))))))))));
|
|
4699
4699
|
}), uu = "div", du = pn.RenderStrategy | pn.Static;
|
|
4700
4700
|
function fu(e, t) {
|
|
4701
4701
|
let { transition: n = !1, open: r, ...o } = e, a = Tn(), i = e.hasOwnProperty("open") || a !== null, l = e.hasOwnProperty("onClose");
|
|
@@ -4708,15 +4708,15 @@ function fu(e, t) {
|
|
|
4708
4708
|
}
|
|
4709
4709
|
let mu = "div";
|
|
4710
4710
|
function pu(e, t) {
|
|
4711
|
-
let n = pt(), { id: r = `headlessui-dialog-panel-${n}`, transition: o = !1, ...a } = e, [{ dialogState: i, unmount: l }, s] = $n("Dialog.Panel"), c = Pe(t, s.panelRef),
|
|
4712
|
-
|
|
4713
|
-
}), f = { ref: c, id: r, onClick: m },
|
|
4714
|
-
return I.createElement(
|
|
4711
|
+
let n = pt(), { id: r = `headlessui-dialog-panel-${n}`, transition: o = !1, ...a } = e, [{ dialogState: i, unmount: l }, s] = $n("Dialog.Panel"), c = Pe(t, s.panelRef), h = st({ open: i === 0 }), m = Y((b) => {
|
|
4712
|
+
b.stopPropagation();
|
|
4713
|
+
}), f = { ref: c, id: r, onClick: m }, d = o ? Gt : rt, p = o ? { unmount: l } : {}, g = Ce();
|
|
4714
|
+
return I.createElement(d, { ...p }, g({ ourProps: f, theirProps: a, slot: h, defaultTag: mu, name: "Dialog.Panel" }));
|
|
4715
4715
|
}
|
|
4716
4716
|
let hu = "div";
|
|
4717
4717
|
function gu(e, t) {
|
|
4718
|
-
let { transition: n = !1, ...r } = e, [{ dialogState: o, unmount: a }] = $n("Dialog.Backdrop"), i = st({ open: o === 0 }), l = { ref: t, "aria-hidden": !0 }, s = n ? Gt : rt, c = n ? { unmount: a } : {},
|
|
4719
|
-
return I.createElement(s, { ...c },
|
|
4718
|
+
let { transition: n = !1, ...r } = e, [{ dialogState: o, unmount: a }] = $n("Dialog.Backdrop"), i = st({ open: o === 0 }), l = { ref: t, "aria-hidden": !0 }, s = n ? Gt : rt, c = n ? { unmount: a } : {}, h = Ce();
|
|
4719
|
+
return I.createElement(s, { ...c }, h({ ourProps: l, theirProps: r, slot: i, defaultTag: hu, name: "Dialog.Backdrop" }));
|
|
4720
4720
|
}
|
|
4721
4721
|
let vu = "h2";
|
|
4722
4722
|
function bu(e, t) {
|
|
@@ -4727,8 +4727,8 @@ function bu(e, t) {
|
|
|
4727
4727
|
}
|
|
4728
4728
|
let wu = we(fu), ka = we(pu), yu = we(gu), Aa = we(bu), xu = Object.assign(wu, { Panel: ka, Title: Aa, Description: Ol }), Cu = "textarea";
|
|
4729
4729
|
function Eu(e, t) {
|
|
4730
|
-
let n = pt(), r = Zo(), o = xn(), { id: a = r || `headlessui-textarea-${n}`, disabled: i = o || !1, autoFocus: l = !1, invalid: s = !1, ...c } = e,
|
|
4731
|
-
return Ce()({ ourProps:
|
|
4730
|
+
let n = pt(), r = Zo(), o = xn(), { id: a = r || `headlessui-textarea-${n}`, disabled: i = o || !1, autoFocus: l = !1, invalid: s = !1, ...c } = e, h = Rl(), m = $l(), { isFocused: f, focusProps: d } = Wo({ autoFocus: l }), { isHovered: p, hoverProps: g } = Go({ isDisabled: i }), b = Yo({ ref: t, id: a, "aria-labelledby": h, "aria-describedby": m, "aria-invalid": s ? "true" : void 0, disabled: i || void 0, autoFocus: l }, d, g), y = st({ disabled: i, invalid: s, hover: p, focus: f, autofocus: l });
|
|
4731
|
+
return Ce()({ ourProps: b, theirProps: c, slot: y, defaultTag: Cu, name: "Textarea" });
|
|
4732
4732
|
}
|
|
4733
4733
|
let Tu = we(Eu);
|
|
4734
4734
|
const Nu = (e) => /* @__PURE__ */ ee.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ ee.createElement("path", { d: "M8 1.25C6.66498 1.25 5.35994 1.64588 4.2499 2.38758C3.13987 3.12928 2.27471 4.18349 1.76382 5.41689C1.25292 6.65029 1.11925 8.00749 1.3797 9.31686C1.64015 10.6262 2.28303 11.829 3.22703 12.773C4.17104 13.717 5.37377 14.3598 6.68314 14.6203C7.99252 14.8808 9.34971 14.7471 10.5831 14.2362C11.8165 13.7253 12.8707 12.8601 13.6124 11.7501C14.3541 10.6401 14.75 9.33502 14.75 8C14.748 6.2104 14.0362 4.49466 12.7708 3.22922C11.5053 1.96378 9.78961 1.25199 8 1.25ZM8 13.25C6.96165 13.25 5.94662 12.9421 5.08326 12.3652C4.2199 11.7883 3.547 10.9684 3.14964 10.0091C2.75228 9.04978 2.64831 7.99418 2.85088 6.97578C3.05345 5.95738 3.55347 5.02191 4.28769 4.28769C5.02192 3.55346 5.95738 3.05345 6.97578 2.85088C7.99418 2.6483 9.04978 2.75227 10.0091 3.14963C10.9684 3.54699 11.7883 4.2199 12.3652 5.08326C12.9421 5.94661 13.25 6.96165 13.25 8C13.2485 9.39193 12.6949 10.7264 11.7107 11.7107C10.7264 12.6949 9.39193 13.2485 8 13.25ZM7.25 8.25V5C7.25 4.80109 7.32902 4.61032 7.46967 4.46967C7.61032 4.32902 7.80109 4.25 8 4.25C8.19892 4.25 8.38968 4.32902 8.53033 4.46967C8.67098 4.61032 8.75 4.80109 8.75 5V8.25C8.75 8.44891 8.67098 8.63968 8.53033 8.78033C8.38968 8.92098 8.19892 9 8 9C7.80109 9 7.61032 8.92098 7.46967 8.78033C7.32902 8.63968 7.25 8.44891 7.25 8.25ZM9 10.75C9 10.9478 8.94135 11.1411 8.83147 11.3056C8.72159 11.47 8.56541 11.5982 8.38269 11.6739C8.19996 11.7496 7.99889 11.7694 7.80491 11.7308C7.61093 11.6922 7.43275 11.597 7.2929 11.4571C7.15304 11.3173 7.0578 11.1391 7.01922 10.9451C6.98063 10.7511 7.00044 10.55 7.07612 10.3673C7.15181 10.1846 7.27998 10.0284 7.44443 9.91853C7.60888 9.80865 7.80222 9.75 8 9.75C8.26522 9.75 8.51957 9.85536 8.70711 10.0429C8.89465 10.2304 9 10.4848 9 10.75Z", fill: "currentColor" }));
|
|
@@ -4799,12 +4799,12 @@ function Ma({ className: e }) {
|
|
|
4799
4799
|
ctaTelegramDeepLink: l,
|
|
4800
4800
|
ctaManualCommand: s,
|
|
4801
4801
|
executeCta: c,
|
|
4802
|
-
dismissCta:
|
|
4802
|
+
dismissCta: h,
|
|
4803
4803
|
open: m,
|
|
4804
4804
|
surfaceEpisodeId: f,
|
|
4805
|
-
api:
|
|
4806
|
-
} = Wt(),
|
|
4807
|
-
y &&
|
|
4805
|
+
api: d
|
|
4806
|
+
} = Wt(), p = C(null), [g, b] = U(() => /* @__PURE__ */ new Set()), y = n?.commandId, w = R(() => {
|
|
4807
|
+
y && b((N) => {
|
|
4808
4808
|
if (N.has(y)) return N;
|
|
4809
4809
|
const S = new Set(N);
|
|
4810
4810
|
if (S.add(y), S.size > 64) {
|
|
@@ -4822,8 +4822,8 @@ function Ma({ className: e }) {
|
|
|
4822
4822
|
[n]
|
|
4823
4823
|
);
|
|
4824
4824
|
if (or(
|
|
4825
|
-
|
|
4826
|
-
|
|
4825
|
+
d?.scenarioInteractionRuntime,
|
|
4826
|
+
p,
|
|
4827
4827
|
m,
|
|
4828
4828
|
f,
|
|
4829
4829
|
x
|
|
@@ -4832,7 +4832,7 @@ function Ma({ className: e }) {
|
|
|
4832
4832
|
return /* @__PURE__ */ A(
|
|
4833
4833
|
"div",
|
|
4834
4834
|
{
|
|
4835
|
-
ref:
|
|
4835
|
+
ref: p,
|
|
4836
4836
|
className: J("flex max-w-full flex-col gap-1.5", e),
|
|
4837
4837
|
children: [
|
|
4838
4838
|
n.text && /* @__PURE__ */ u("p", { className: "max-w-72 text-sm leading-5 break-words whitespace-pre-wrap text-white/90", children: n.text }),
|
|
@@ -4859,7 +4859,7 @@ function Ma({ className: e }) {
|
|
|
4859
4859
|
disabled: r,
|
|
4860
4860
|
"aria-label": t("cta.dismiss"),
|
|
4861
4861
|
onClick: () => {
|
|
4862
|
-
w(),
|
|
4862
|
+
w(), h();
|
|
4863
4863
|
},
|
|
4864
4864
|
className: "chat-cta-secondary data-disabled:opacity-50",
|
|
4865
4865
|
children: "×"
|
|
@@ -4891,27 +4891,27 @@ function Au({ className: e }) {
|
|
|
4891
4891
|
startListening: l,
|
|
4892
4892
|
stopListening: s,
|
|
4893
4893
|
endVoiceChat: c,
|
|
4894
|
-
acceptConversation:
|
|
4894
|
+
acceptConversation: h,
|
|
4895
4895
|
declineConversation: m
|
|
4896
|
-
} = go(), f = wt((P) => P.pendingInvitation),
|
|
4896
|
+
} = go(), f = wt((P) => P.pendingInvitation), d = wt((P) => P.status), p = wt((P) => P.errorMessage), g = wt((P) => P.errorCode), b = wt((P) => P.microphoneEnabled), y = wt(
|
|
4897
4897
|
(P) => P.assistantResponseInProgress
|
|
4898
4898
|
), [w, x] = U(!1), T = R(async () => {
|
|
4899
4899
|
x(!0);
|
|
4900
4900
|
try {
|
|
4901
|
-
await
|
|
4901
|
+
await h(n, r);
|
|
4902
4902
|
} catch (P) {
|
|
4903
4903
|
console.error("voice invitation failed", P);
|
|
4904
4904
|
} finally {
|
|
4905
4905
|
x(!1);
|
|
4906
4906
|
}
|
|
4907
|
-
}, [
|
|
4907
|
+
}, [h, r, n]), N = R(async () => {
|
|
4908
4908
|
await m(n, r), a(Ne.text);
|
|
4909
4909
|
}, [r, n, m, a]), S = R(async () => {
|
|
4910
4910
|
if (f) {
|
|
4911
4911
|
await T();
|
|
4912
4912
|
return;
|
|
4913
4913
|
}
|
|
4914
|
-
if (
|
|
4914
|
+
if (b) {
|
|
4915
4915
|
s();
|
|
4916
4916
|
return;
|
|
4917
4917
|
}
|
|
@@ -4924,7 +4924,7 @@ function Au({ className: e }) {
|
|
|
4924
4924
|
T,
|
|
4925
4925
|
r,
|
|
4926
4926
|
n,
|
|
4927
|
-
|
|
4927
|
+
b,
|
|
4928
4928
|
f,
|
|
4929
4929
|
l,
|
|
4930
4930
|
s
|
|
@@ -4934,12 +4934,12 @@ function Au({ className: e }) {
|
|
|
4934
4934
|
H(() => () => {
|
|
4935
4935
|
c();
|
|
4936
4936
|
}, [c]);
|
|
4937
|
-
const k = le(() => i === Rt.Unavailable ? t(Ft.connectionFailed) : i === Rt.Offline ? t(Ft.offline) : g ? t(is[g]) :
|
|
4937
|
+
const k = le(() => i === Rt.Unavailable ? t(Ft.connectionFailed) : i === Rt.Offline ? t(Ft.offline) : g ? t(is[g]) : p || null, [i, t, g, p]), F = le(() => t(d === "connecting" ? "voice.connecting" : d === "speaking" || y ? "voice.speaking" : f ? "voice.incoming" : b ? "voice.startTalking" : "voice.muted"), [
|
|
4938
4938
|
y,
|
|
4939
|
-
|
|
4939
|
+
b,
|
|
4940
4940
|
f,
|
|
4941
4941
|
t,
|
|
4942
|
-
|
|
4942
|
+
d
|
|
4943
4943
|
]), j = !o && k;
|
|
4944
4944
|
return /* @__PURE__ */ A(
|
|
4945
4945
|
"div",
|
|
@@ -5003,14 +5003,14 @@ function Au({ className: e }) {
|
|
|
5003
5003
|
/* @__PURE__ */ u(
|
|
5004
5004
|
ne,
|
|
5005
5005
|
{
|
|
5006
|
-
"aria-label": t(
|
|
5006
|
+
"aria-label": t(b ? "voice.muteMicrophone" : "voice.unmuteMicrophone"),
|
|
5007
5007
|
className: J(
|
|
5008
5008
|
"chat-microphone-button",
|
|
5009
|
-
|
|
5009
|
+
b && "chat-microphone-button_active"
|
|
5010
5010
|
),
|
|
5011
5011
|
onClick: S,
|
|
5012
|
-
disabled: w ||
|
|
5013
|
-
children:
|
|
5012
|
+
disabled: w || d === "connecting",
|
|
5013
|
+
children: b ? /* @__PURE__ */ u(zs, {}) : /* @__PURE__ */ u(Vs, {})
|
|
5014
5014
|
}
|
|
5015
5015
|
)
|
|
5016
5016
|
] }),
|
|
@@ -5075,7 +5075,7 @@ const Ru = cr(
|
|
|
5075
5075
|
...l
|
|
5076
5076
|
},
|
|
5077
5077
|
[
|
|
5078
|
-
...i.map(([c,
|
|
5078
|
+
...i.map(([c, h]) => un(c, h)),
|
|
5079
5079
|
...Array.isArray(a) ? a : [a]
|
|
5080
5080
|
]
|
|
5081
5081
|
)
|
|
@@ -5249,27 +5249,27 @@ const ad = () => document.visibilityState === "hidden", sd = (e, t) => {
|
|
|
5249
5249
|
let l = null, s = !1;
|
|
5250
5250
|
const c = () => {
|
|
5251
5251
|
l !== null && (window.cancelAnimationFrame(l), l = null);
|
|
5252
|
-
},
|
|
5252
|
+
}, h = () => {
|
|
5253
5253
|
c();
|
|
5254
5254
|
const g = n.flush();
|
|
5255
5255
|
g && !s && a(g);
|
|
5256
5256
|
}, m = () => i?.matches || ad() || typeof Intl.Segmenter != "function", f = (g) => {
|
|
5257
5257
|
if (l = null, s) return;
|
|
5258
5258
|
if (m()) {
|
|
5259
|
-
|
|
5259
|
+
h();
|
|
5260
5260
|
return;
|
|
5261
5261
|
}
|
|
5262
|
-
const
|
|
5263
|
-
|
|
5264
|
-
},
|
|
5265
|
-
n.isSettled() || (m() ?
|
|
5262
|
+
const b = n.advance(g);
|
|
5263
|
+
b && a(b), n.isSettled() || (l = window.requestAnimationFrame(f));
|
|
5264
|
+
}, d = () => {
|
|
5265
|
+
n.isSettled() || (m() ? h() : l === null && (l = window.requestAnimationFrame(f)));
|
|
5266
5266
|
};
|
|
5267
|
-
r.current = { start:
|
|
5268
|
-
const
|
|
5269
|
-
return i?.addEventListener("change",
|
|
5270
|
-
s = !0, r.current = null, c(), i?.removeEventListener("change",
|
|
5267
|
+
r.current = { start: d };
|
|
5268
|
+
const p = () => d();
|
|
5269
|
+
return i?.addEventListener("change", p), document.addEventListener("visibilitychange", p), () => {
|
|
5270
|
+
s = !0, r.current = null, c(), i?.removeEventListener("change", p), document.removeEventListener(
|
|
5271
5271
|
"visibilitychange",
|
|
5272
|
-
|
|
5272
|
+
p
|
|
5273
5273
|
);
|
|
5274
5274
|
};
|
|
5275
5275
|
}, [n]), H(() => {
|
|
@@ -5293,20 +5293,20 @@ function ld({
|
|
|
5293
5293
|
}, [a]), H(() => {
|
|
5294
5294
|
l.current = void 0, s.current = void 0;
|
|
5295
5295
|
}, [r]);
|
|
5296
|
-
const
|
|
5296
|
+
const h = () => {
|
|
5297
5297
|
s.current !== r && (s.current = r, c.current?.());
|
|
5298
5298
|
};
|
|
5299
5299
|
H(() => {
|
|
5300
5300
|
if (!o || !i.isSettled) return;
|
|
5301
5301
|
if (!i.animatedText || l.current === i.revision) {
|
|
5302
|
-
|
|
5302
|
+
h();
|
|
5303
5303
|
return;
|
|
5304
5304
|
}
|
|
5305
|
-
const f = window.setTimeout(
|
|
5305
|
+
const f = window.setTimeout(h, id);
|
|
5306
5306
|
return () => window.clearTimeout(f);
|
|
5307
5307
|
});
|
|
5308
|
-
const m = (f,
|
|
5309
|
-
f.target === f.currentTarget &&
|
|
5308
|
+
const m = (f, d) => {
|
|
5309
|
+
f.target === f.currentTarget && d === i.revision && (l.current = d, o && i.isSettled && h());
|
|
5310
5310
|
};
|
|
5311
5311
|
return /* @__PURE__ */ A("span", { children: [
|
|
5312
5312
|
i.stableText,
|
|
@@ -5314,7 +5314,7 @@ function ld({
|
|
|
5314
5314
|
"span",
|
|
5315
5315
|
{
|
|
5316
5316
|
className: "chat-stream-fragment",
|
|
5317
|
-
onAnimationEnd: (
|
|
5317
|
+
onAnimationEnd: (d) => m(d, f.revision),
|
|
5318
5318
|
children: f.text
|
|
5319
5319
|
},
|
|
5320
5320
|
f.revision
|
|
@@ -5499,7 +5499,7 @@ function pd({
|
|
|
5499
5499
|
size: a,
|
|
5500
5500
|
className: i
|
|
5501
5501
|
}) {
|
|
5502
|
-
const l = vo(), s = C(null), [c,
|
|
5502
|
+
const l = vo(), s = C(null), [c, h] = U(!1), [m, f] = U(null), [d, p] = U(!1), [g, b] = U(0), [y, w] = U(0), [x, T] = U(
|
|
5503
5503
|
() => typeof IntersectionObserver != "function"
|
|
5504
5504
|
), N = o?.avatarAsset ?? null, S = o?.contractState === "LEGACY" ? o.legacyAvatarUrl : null, L = !!(S && !c);
|
|
5505
5505
|
return H(() => {
|
|
@@ -5521,7 +5521,7 @@ function pd({
|
|
|
5521
5521
|
return l.resolve(j).then((P) => {
|
|
5522
5522
|
if (!k) return;
|
|
5523
5523
|
if (!P) {
|
|
5524
|
-
f(null),
|
|
5524
|
+
f(null), p(!1);
|
|
5525
5525
|
return;
|
|
5526
5526
|
}
|
|
5527
5527
|
f(P.url);
|
|
@@ -5574,7 +5574,7 @@ function pd({
|
|
|
5574
5574
|
loading: "lazy",
|
|
5575
5575
|
decoding: "async",
|
|
5576
5576
|
referrerPolicy: "no-referrer",
|
|
5577
|
-
onError: () =>
|
|
5577
|
+
onError: () => h(!0),
|
|
5578
5578
|
className: "absolute inset-0 h-full w-full object-cover shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)]"
|
|
5579
5579
|
}
|
|
5580
5580
|
),
|
|
@@ -5587,13 +5587,13 @@ function pd({
|
|
|
5587
5587
|
loading: "lazy",
|
|
5588
5588
|
decoding: "async",
|
|
5589
5589
|
referrerPolicy: "no-referrer",
|
|
5590
|
-
onLoad: () =>
|
|
5590
|
+
onLoad: () => p(!0),
|
|
5591
5591
|
onError: () => {
|
|
5592
|
-
!N || !l || (l.invalidate({ conversationId: e, asset: N }), f(null),
|
|
5592
|
+
!N || !l || (l.invalidate({ conversationId: e, asset: N }), f(null), p(!1), b((k) => k + 1));
|
|
5593
5593
|
},
|
|
5594
5594
|
className: J(
|
|
5595
5595
|
"absolute inset-0 h-full w-full object-cover opacity-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] transition-opacity duration-150 motion-reduce:transition-none",
|
|
5596
|
-
|
|
5596
|
+
d && "opacity-100"
|
|
5597
5597
|
)
|
|
5598
5598
|
}
|
|
5599
5599
|
)
|
|
@@ -5609,9 +5609,9 @@ const hd = ho(function({
|
|
|
5609
5609
|
ref: a,
|
|
5610
5610
|
...i
|
|
5611
5611
|
}) {
|
|
5612
|
-
const { t: l } = Te(), s = be(us), { scenarioChoiceSubmissionController: c } = dr(), { settleMessageStream:
|
|
5613
|
-
active: !!(f &&
|
|
5614
|
-
text: f &&
|
|
5612
|
+
const { t: l } = Te(), s = be(us), { scenarioChoiceSubmissionController: c } = dr(), { settleMessageStream: h } = fr(), m = ds(t), f = t.author.type === Le.Agent, d = fs(t.id), [p, g] = U(() => Date.now()), [b, y] = U(), [w, x] = U(() => ({
|
|
5613
|
+
active: !!(f && d),
|
|
5614
|
+
text: f && d ? "" : m
|
|
5615
5615
|
})), T = C(null), N = C(null), [S, L] = U(() => /* @__PURE__ */ new Set()), k = mr(), F = !!s?.open && t.conversationId === k, j = s ? F : !0, { author: P } = t, fe = t.status === It.Failed, oe = t.status === It.Completed || fe, B = le(() => ms(t), [t]), re = le(
|
|
5616
5616
|
() => ({
|
|
5617
5617
|
principalId: s?.runtime.getPrincipalSessionId() ?? "anonymous",
|
|
@@ -5631,7 +5631,7 @@ const hd = ho(function({
|
|
|
5631
5631
|
te,
|
|
5632
5632
|
ce,
|
|
5633
5633
|
ce
|
|
5634
|
-
), ve = _.status, se = _.selectedOptionId ?? void 0, ae = !!(B && ps(B,
|
|
5634
|
+
), ve = _.status, se = _.selectedOptionId ?? void 0, ae = !!(B && ps(B, p)), he = B?.inputRequestId ?? null, O = R(() => {
|
|
5635
5635
|
he && L((G) => {
|
|
5636
5636
|
if (G.has(he)) return G;
|
|
5637
5637
|
const me = new Set(G);
|
|
@@ -5681,9 +5681,9 @@ const hd = ho(function({
|
|
|
5681
5681
|
T.current = G, typeof a == "function" ? a(G) : a && (a.current = G);
|
|
5682
5682
|
},
|
|
5683
5683
|
[a]
|
|
5684
|
-
), ge = f ?
|
|
5684
|
+
), ge = f ? d : void 0;
|
|
5685
5685
|
!ge && (w.active || w.text !== m) ? x({ active: !1, text: m }) : ge && !w.active && x({ active: !0, text: w.text });
|
|
5686
|
-
const Nt = (oe ? m : "") || ge?.text || "", je = !!(ge && (ge.done || oe)), kt = !!(ge && Nt && (!je ||
|
|
5686
|
+
const Nt = (oe ? m : "") || ge?.text || "", je = !!(ge && (ge.done || oe)), kt = !!(ge && Nt && (!je || b !== ge.sequence)), At = kt ? "" : hs(t);
|
|
5687
5687
|
H(() => {
|
|
5688
5688
|
if (!B || B.lifecycle?.status !== "PENDING") return;
|
|
5689
5689
|
const G = gs(B, Date.now());
|
|
@@ -5693,7 +5693,7 @@ const hd = ho(function({
|
|
|
5693
5693
|
Math.min(G + 1, 2147483647)
|
|
5694
5694
|
);
|
|
5695
5695
|
return () => window.clearTimeout(me);
|
|
5696
|
-
}, [B,
|
|
5696
|
+
}, [B, p]), H(() => {
|
|
5697
5697
|
B?.lifecycle && c.handleLifecycle(
|
|
5698
5698
|
re,
|
|
5699
5699
|
B.lifecycle
|
|
@@ -5771,7 +5771,7 @@ const hd = ho(function({
|
|
|
5771
5771
|
targetText: Nt,
|
|
5772
5772
|
finished: je,
|
|
5773
5773
|
onSettled: () => {
|
|
5774
|
-
y(ge.sequence),
|
|
5774
|
+
y(ge.sequence), h(t.id);
|
|
5775
5775
|
}
|
|
5776
5776
|
}
|
|
5777
5777
|
) }) : At || oe ? /* @__PURE__ */ u(
|
|
@@ -5841,23 +5841,23 @@ function bd({
|
|
|
5841
5841
|
threadId: o,
|
|
5842
5842
|
threshold: a = 80
|
|
5843
5843
|
}) {
|
|
5844
|
-
const i = C(!0), l = C(!1), s = C(null), c = C(null),
|
|
5844
|
+
const i = C(!0), l = C(!1), s = C(null), c = C(null), h = C(r), m = C(n), f = C(o), d = R(() => {
|
|
5845
5845
|
s.current !== null && (window.cancelAnimationFrame(s.current), s.current = null);
|
|
5846
|
-
}, []),
|
|
5846
|
+
}, []), p = R(() => {
|
|
5847
5847
|
c.current !== null && (window.clearTimeout(c.current), c.current = null);
|
|
5848
5848
|
}, []), g = R(() => {
|
|
5849
5849
|
if (!l.current) return;
|
|
5850
|
-
l.current = !1,
|
|
5850
|
+
l.current = !1, p();
|
|
5851
5851
|
const w = e.current;
|
|
5852
|
-
!w || !i.current || (
|
|
5853
|
-
}, [
|
|
5852
|
+
!w || !i.current || (d(), w.scrollTo({ top: w.scrollHeight, behavior: "auto" }));
|
|
5853
|
+
}, [d, p, e]), b = R(() => {
|
|
5854
5854
|
if (!l.current) return;
|
|
5855
|
-
l.current = !1,
|
|
5855
|
+
l.current = !1, p();
|
|
5856
5856
|
const w = e.current;
|
|
5857
5857
|
if (!w) return;
|
|
5858
5858
|
const x = w.scrollHeight - w.scrollTop - w.clientHeight;
|
|
5859
5859
|
i.current = x <= a;
|
|
5860
|
-
}, [
|
|
5860
|
+
}, [p, e, a]), y = R(
|
|
5861
5861
|
(w) => {
|
|
5862
5862
|
if (l.current) return;
|
|
5863
5863
|
const x = w.currentTarget, T = x.scrollHeight - x.scrollTop - x.clientHeight;
|
|
@@ -5868,11 +5868,11 @@ function bd({
|
|
|
5868
5868
|
return mt(() => {
|
|
5869
5869
|
const w = e.current;
|
|
5870
5870
|
if (!w) return;
|
|
5871
|
-
const x =
|
|
5871
|
+
const x = h.current, T = f.current !== o, N = r > x, S = N && !T && m.current !== void 0 && m.current !== n;
|
|
5872
5872
|
if (T && (i.current = !0), S)
|
|
5873
|
-
|
|
5873
|
+
d(), p(), l.current = !1;
|
|
5874
5874
|
else if (i.current) {
|
|
5875
|
-
|
|
5875
|
+
d(), p();
|
|
5876
5876
|
const L = N && x > 0 && !vd();
|
|
5877
5877
|
l.current = L, L && (c.current = window.setTimeout(
|
|
5878
5878
|
g,
|
|
@@ -5882,10 +5882,10 @@ function bd({
|
|
|
5882
5882
|
behavior: L ? "smooth" : "auto"
|
|
5883
5883
|
});
|
|
5884
5884
|
}
|
|
5885
|
-
|
|
5885
|
+
h.current = r, m.current = n, f.current = o;
|
|
5886
5886
|
}, [
|
|
5887
|
-
h,
|
|
5888
5887
|
d,
|
|
5888
|
+
p,
|
|
5889
5889
|
e,
|
|
5890
5890
|
g,
|
|
5891
5891
|
n,
|
|
@@ -5899,22 +5899,22 @@ function bd({
|
|
|
5899
5899
|
l.current || !i.current || s.current !== null || (s.current = window.requestAnimationFrame(() => {
|
|
5900
5900
|
s.current = null, i.current && w.scrollTo({ top: w.scrollHeight, behavior: "auto" });
|
|
5901
5901
|
}));
|
|
5902
|
-
}), T.observe(x)), w.addEventListener("scrollend", g), w.addEventListener("wheel",
|
|
5902
|
+
}), T.observe(x)), w.addEventListener("scrollend", g), w.addEventListener("wheel", b, {
|
|
5903
5903
|
passive: !0
|
|
5904
|
-
}), w.addEventListener("touchstart",
|
|
5904
|
+
}), w.addEventListener("touchstart", b, {
|
|
5905
5905
|
passive: !0
|
|
5906
|
-
}), w.addEventListener("pointerdown",
|
|
5906
|
+
}), w.addEventListener("pointerdown", b, {
|
|
5907
5907
|
passive: !0
|
|
5908
5908
|
}), () => {
|
|
5909
|
-
T?.disconnect(), w.removeEventListener("scrollend", g), w.removeEventListener("wheel",
|
|
5909
|
+
T?.disconnect(), w.removeEventListener("scrollend", g), w.removeEventListener("wheel", b), w.removeEventListener("touchstart", b), w.removeEventListener("pointerdown", b), d(), p(), l.current = !1;
|
|
5910
5910
|
};
|
|
5911
5911
|
}, [
|
|
5912
|
-
h,
|
|
5913
5912
|
d,
|
|
5913
|
+
p,
|
|
5914
5914
|
e,
|
|
5915
5915
|
t,
|
|
5916
5916
|
g,
|
|
5917
|
-
|
|
5917
|
+
b
|
|
5918
5918
|
]), y;
|
|
5919
5919
|
}
|
|
5920
5920
|
function wd({
|
|
@@ -6111,18 +6111,18 @@ function Va({
|
|
|
6111
6111
|
resetKey: o,
|
|
6112
6112
|
rootMargin: a = "160px 0px"
|
|
6113
6113
|
}) {
|
|
6114
|
-
const i = C(null), l = C(!1), s = C(0), c = C(!0), [
|
|
6114
|
+
const i = C(null), l = C(!1), s = C(0), c = C(!0), [h, m] = U(null), f = R(async () => {
|
|
6115
6115
|
if (!t || n || l.current) return;
|
|
6116
|
-
const
|
|
6116
|
+
const d = s.current;
|
|
6117
6117
|
l.current = !0, m(null);
|
|
6118
6118
|
try {
|
|
6119
6119
|
await r();
|
|
6120
|
-
} catch (
|
|
6121
|
-
c.current && s.current ===
|
|
6122
|
-
|
|
6120
|
+
} catch (p) {
|
|
6121
|
+
c.current && s.current === d && m(
|
|
6122
|
+
p instanceof Error ? p : new Error("Failed to load more items")
|
|
6123
6123
|
);
|
|
6124
6124
|
} finally {
|
|
6125
|
-
s.current ===
|
|
6125
|
+
s.current === d && (l.current = !1);
|
|
6126
6126
|
}
|
|
6127
6127
|
}, [t, n, r]);
|
|
6128
6128
|
return H(() => {
|
|
@@ -6130,17 +6130,17 @@ function Va({
|
|
|
6130
6130
|
}, [o]), H(() => (c.current = !0, () => {
|
|
6131
6131
|
c.current = !1;
|
|
6132
6132
|
}), []), H(() => {
|
|
6133
|
-
const
|
|
6134
|
-
if (!t || !
|
|
6133
|
+
const d = e.current, p = i.current;
|
|
6134
|
+
if (!t || !d || !p || typeof IntersectionObserver > "u")
|
|
6135
6135
|
return;
|
|
6136
6136
|
const g = new IntersectionObserver(
|
|
6137
|
-
(
|
|
6138
|
-
|
|
6137
|
+
(b) => {
|
|
6138
|
+
b.some(({ isIntersecting: y }) => y) && f();
|
|
6139
6139
|
},
|
|
6140
|
-
{ root:
|
|
6140
|
+
{ root: d, rootMargin: a }
|
|
6141
6141
|
);
|
|
6142
|
-
return g.observe(
|
|
6143
|
-
}, [t, f, a, e]), { error:
|
|
6142
|
+
return g.observe(p), () => g.disconnect();
|
|
6143
|
+
}, [t, f, a, e]), { error: h, loadMore: f, sentinelRef: i };
|
|
6144
6144
|
}
|
|
6145
6145
|
const sn = (e) => [
|
|
6146
6146
|
...e.querySelectorAll("[data-chat-message-id]")
|
|
@@ -6154,20 +6154,20 @@ function Nd({
|
|
|
6154
6154
|
}) {
|
|
6155
6155
|
const a = C(null), i = C(null), [l, s] = U(0), c = R(() => {
|
|
6156
6156
|
a.current = null, i.current?.(), i.current = null;
|
|
6157
|
-
}, []),
|
|
6157
|
+
}, []), h = R(() => {
|
|
6158
6158
|
const m = e.current;
|
|
6159
6159
|
if (!m || !t) return;
|
|
6160
|
-
const f = m.getBoundingClientRect(),
|
|
6161
|
-
const g =
|
|
6160
|
+
const f = m.getBoundingClientRect(), d = sn(m).find((p) => {
|
|
6161
|
+
const g = p.getBoundingClientRect();
|
|
6162
6162
|
return g.bottom > f.top && g.top < f.bottom;
|
|
6163
6163
|
});
|
|
6164
|
-
|
|
6164
|
+
d?.dataset.chatMessageId && (i.current?.(), i.current = null, a.current = {
|
|
6165
6165
|
contextId: t,
|
|
6166
6166
|
firstItemId: n,
|
|
6167
|
-
itemId:
|
|
6167
|
+
itemId: d.dataset.chatMessageId,
|
|
6168
6168
|
itemCount: o,
|
|
6169
|
-
top:
|
|
6170
|
-
}, s((
|
|
6169
|
+
top: d.getBoundingClientRect().top
|
|
6170
|
+
}, s((p) => p + 1));
|
|
6171
6171
|
}, [e, t, n, o]);
|
|
6172
6172
|
return mt(() => {
|
|
6173
6173
|
const m = a.current;
|
|
@@ -6180,17 +6180,17 @@ function Nd({
|
|
|
6180
6180
|
c();
|
|
6181
6181
|
return;
|
|
6182
6182
|
}
|
|
6183
|
-
const f = e.current,
|
|
6184
|
-
(
|
|
6183
|
+
const f = e.current, d = f ? sn(f).find(
|
|
6184
|
+
(p) => p.dataset.chatMessageId === m.itemId
|
|
6185
6185
|
) : void 0;
|
|
6186
|
-
f &&
|
|
6186
|
+
f && d ? (f.scrollTop += d.getBoundingClientRect().top - m.top, m.firstItemId = n, m.itemCount = o) : c();
|
|
6187
6187
|
}, [c, e, t, n, r, o]), H(() => {
|
|
6188
6188
|
const m = a.current, f = e.current;
|
|
6189
6189
|
if (!m || !f || r || m.contextId !== t)
|
|
6190
6190
|
return;
|
|
6191
|
-
let
|
|
6191
|
+
let d = null, p = f.scrollTop;
|
|
6192
6192
|
const g = () => {
|
|
6193
|
-
|
|
6193
|
+
d = null;
|
|
6194
6194
|
const S = a.current;
|
|
6195
6195
|
if (!S) return;
|
|
6196
6196
|
const L = sn(f).find(
|
|
@@ -6200,16 +6200,16 @@ function Nd({
|
|
|
6200
6200
|
c();
|
|
6201
6201
|
return;
|
|
6202
6202
|
}
|
|
6203
|
-
|
|
6204
|
-
},
|
|
6205
|
-
|
|
6203
|
+
p = f.scrollTop + L.getBoundingClientRect().top - S.top, f.scrollTop = p;
|
|
6204
|
+
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
|
|
6205
|
+
d === null && (d = window.requestAnimationFrame(g));
|
|
6206
6206
|
}), y = sn(f), w = y.findIndex(
|
|
6207
6207
|
(S) => S.dataset.chatMessageId === m.itemId
|
|
6208
6208
|
);
|
|
6209
6209
|
for (const S of y.slice(0, w + 1))
|
|
6210
|
-
|
|
6210
|
+
b?.observe(S);
|
|
6211
6211
|
const x = () => c(), T = () => {
|
|
6212
|
-
Math.abs(f.scrollTop -
|
|
6212
|
+
Math.abs(f.scrollTop - p) > 1 && c();
|
|
6213
6213
|
};
|
|
6214
6214
|
f.addEventListener("scroll", T, {
|
|
6215
6215
|
passive: !0
|
|
@@ -6219,7 +6219,7 @@ function Nd({
|
|
|
6219
6219
|
passive: !0
|
|
6220
6220
|
});
|
|
6221
6221
|
const N = () => {
|
|
6222
|
-
|
|
6222
|
+
b?.disconnect(), d !== null && window.cancelAnimationFrame(d), f.removeEventListener("scroll", T), f.removeEventListener("wheel", x), f.removeEventListener("touchstart", x), f.removeEventListener("pointerdown", x);
|
|
6223
6223
|
};
|
|
6224
6224
|
return i.current = N, () => {
|
|
6225
6225
|
i.current === N && (i.current = null), N();
|
|
@@ -6231,7 +6231,7 @@ function Nd({
|
|
|
6231
6231
|
t,
|
|
6232
6232
|
r,
|
|
6233
6233
|
o
|
|
6234
|
-
]), { captureAnchor:
|
|
6234
|
+
]), { captureAnchor: h, clearAnchor: c };
|
|
6235
6235
|
}
|
|
6236
6236
|
function kd(e, t) {
|
|
6237
6237
|
const n = Math.max(80, Math.ceil(t.scrollWidth) + 46);
|
|
@@ -6328,8 +6328,8 @@ const Sd = {
|
|
|
6328
6328
|
const l = new XMLHttpRequest();
|
|
6329
6329
|
let s = !1;
|
|
6330
6330
|
const c = (m) => {
|
|
6331
|
-
s || (s = !0, n?.removeEventListener("abort",
|
|
6332
|
-
},
|
|
6331
|
+
s || (s = !0, n?.removeEventListener("abort", h), m());
|
|
6332
|
+
}, h = () => l.abort();
|
|
6333
6333
|
l.open("PUT", r), Object.entries(t).forEach(
|
|
6334
6334
|
([m, f]) => l.setRequestHeader(m, f)
|
|
6335
6335
|
), l.upload.addEventListener("progress", (m) => {
|
|
@@ -6351,47 +6351,46 @@ const Sd = {
|
|
|
6351
6351
|
), l.addEventListener(
|
|
6352
6352
|
"abort",
|
|
6353
6353
|
() => c(() => i(new DOMException("Upload aborted", "AbortError")))
|
|
6354
|
-
), n?.addEventListener("abort",
|
|
6354
|
+
), n?.addEventListener("abort", h, { once: !0 }), o?.(0), l.send(e);
|
|
6355
6355
|
}), Rd = (e, t, n = {}) => {
|
|
6356
|
-
const r = n.fetchImpl ?? fetch, o = n.uploadFile ?? Od, a = n.digest ?? Pd, i = n.wait ?? _d, l = n.pollIntervalMs ?? 750, s = n.maxPolls ?? 160, c =
|
|
6357
|
-
const
|
|
6358
|
-
...
|
|
6356
|
+
const r = n.fetchImpl ?? fetch, o = n.uploadFile ?? Od, a = n.digest ?? Pd, i = n.wait ?? _d, l = n.pollIntervalMs ?? 750, s = n.maxPolls ?? 160, c = async (d, p) => {
|
|
6357
|
+
const g = await r(`${Hs}${d}`, {
|
|
6358
|
+
...p,
|
|
6359
6359
|
headers: {
|
|
6360
6360
|
Authorization: `Bearer ${e.customerInteractionSession.accessToken}`,
|
|
6361
|
-
...
|
|
6362
|
-
...
|
|
6361
|
+
...p?.body ? { "Content-Type": "application/json" } : {},
|
|
6362
|
+
...p?.headers
|
|
6363
6363
|
}
|
|
6364
6364
|
});
|
|
6365
|
-
if (!
|
|
6366
|
-
throw
|
|
6367
|
-
await Ld(
|
|
6368
|
-
|
|
6365
|
+
if (!g.ok)
|
|
6366
|
+
throw g.status === 401 && t.onSessionExpired(), new He(
|
|
6367
|
+
await Ld(g),
|
|
6368
|
+
g.status
|
|
6369
6369
|
);
|
|
6370
|
-
return await
|
|
6371
|
-
},
|
|
6370
|
+
return await g.json();
|
|
6371
|
+
}, h = async ({
|
|
6372
6372
|
attachmentId: d,
|
|
6373
|
-
conversationId:
|
|
6373
|
+
conversationId: p
|
|
6374
6374
|
}) => {
|
|
6375
|
-
await
|
|
6375
|
+
await c(
|
|
6376
6376
|
`/chat/attachments/${encodeURIComponent(d)}/revoke${ln(
|
|
6377
|
-
|
|
6377
|
+
p
|
|
6378
6378
|
)}`,
|
|
6379
6379
|
{
|
|
6380
|
-
method: "POST"
|
|
6381
|
-
headers: { "Idempotency-Key": c() }
|
|
6380
|
+
method: "POST"
|
|
6382
6381
|
}
|
|
6383
6382
|
);
|
|
6384
|
-
},
|
|
6383
|
+
}, m = (d, p, g) => c(
|
|
6385
6384
|
`/chat/attachments/${encodeURIComponent(d)}${ln(
|
|
6386
|
-
|
|
6385
|
+
p
|
|
6387
6386
|
)}`,
|
|
6388
|
-
{ signal:
|
|
6389
|
-
),
|
|
6387
|
+
{ signal: g }
|
|
6388
|
+
), f = (d, p) => {
|
|
6390
6389
|
if (d.state !== "READY" || !d.canAttach)
|
|
6391
6390
|
throw new He(
|
|
6392
6391
|
d.failureCode || `CHAT_ATTACHMENT_${d.state}`
|
|
6393
6392
|
);
|
|
6394
|
-
if (d.id !==
|
|
6393
|
+
if (d.id !== p.id || d.contentType !== p.contentType || d.sizeBytes !== p.sizeBytes)
|
|
6395
6394
|
throw new He("CHAT_ATTACHMENT_CONTRACT_MISMATCH");
|
|
6396
6395
|
return {
|
|
6397
6396
|
id: d.id,
|
|
@@ -6404,81 +6403,79 @@ const Sd = {
|
|
|
6404
6403
|
return {
|
|
6405
6404
|
async upload({
|
|
6406
6405
|
file: d,
|
|
6407
|
-
conversationId:
|
|
6408
|
-
signal:
|
|
6409
|
-
onProgress:
|
|
6410
|
-
onStage:
|
|
6406
|
+
conversationId: p,
|
|
6407
|
+
signal: g,
|
|
6408
|
+
onProgress: b,
|
|
6409
|
+
onStage: y
|
|
6411
6410
|
}) {
|
|
6412
|
-
const
|
|
6413
|
-
if (!Ga(
|
|
6411
|
+
const w = d.name.normalize("NFC").trim();
|
|
6412
|
+
if (!Ga(w))
|
|
6414
6413
|
throw new He("CHAT_ATTACHMENT_FILENAME_INVALID");
|
|
6415
6414
|
if (d.size < 1 || d.size > ir)
|
|
6416
6415
|
throw new He("CHAT_ATTACHMENT_SIZE_INVALID");
|
|
6417
|
-
const
|
|
6418
|
-
if (!
|
|
6416
|
+
const x = lr(d);
|
|
6417
|
+
if (!x)
|
|
6419
6418
|
throw new He(
|
|
6420
6419
|
"CHAT_ATTACHMENT_CONTENT_TYPE_UNSUPPORTED"
|
|
6421
6420
|
);
|
|
6422
|
-
let
|
|
6421
|
+
let T;
|
|
6423
6422
|
try {
|
|
6424
|
-
zt(
|
|
6425
|
-
const
|
|
6426
|
-
zt(
|
|
6427
|
-
const
|
|
6423
|
+
zt(g), y?.("preparing");
|
|
6424
|
+
const N = await a(d);
|
|
6425
|
+
zt(g);
|
|
6426
|
+
const S = await c(
|
|
6428
6427
|
"/chat/attachments/uploads",
|
|
6429
6428
|
{
|
|
6430
6429
|
method: "POST",
|
|
6431
|
-
headers: { "Idempotency-Key": c() },
|
|
6432
6430
|
body: JSON.stringify({
|
|
6433
|
-
displayFilename:
|
|
6434
|
-
contentType:
|
|
6431
|
+
displayFilename: w,
|
|
6432
|
+
contentType: x,
|
|
6435
6433
|
sizeBytes: d.size,
|
|
6436
|
-
checksumSha256:
|
|
6437
|
-
...
|
|
6434
|
+
checksumSha256: N,
|
|
6435
|
+
...p ? { conversationId: p } : {}
|
|
6438
6436
|
}),
|
|
6439
|
-
signal:
|
|
6437
|
+
signal: g
|
|
6440
6438
|
}
|
|
6441
6439
|
);
|
|
6442
|
-
|
|
6440
|
+
T = S.id, y?.("uploading"), await o({
|
|
6443
6441
|
file: d,
|
|
6444
|
-
uploadUrl: Md(
|
|
6445
|
-
requiredHeaders:
|
|
6446
|
-
signal:
|
|
6447
|
-
onProgress:
|
|
6448
|
-
}), zt(
|
|
6449
|
-
let
|
|
6450
|
-
`/chat/attachments/${encodeURIComponent(
|
|
6451
|
-
|
|
6442
|
+
uploadUrl: Md(S.uploadUrl),
|
|
6443
|
+
requiredHeaders: S.requiredHeaders,
|
|
6444
|
+
signal: g,
|
|
6445
|
+
onProgress: b
|
|
6446
|
+
}), zt(g), b?.(1), y?.("scanning");
|
|
6447
|
+
let L = await c(
|
|
6448
|
+
`/chat/attachments/${encodeURIComponent(S.id)}/complete${ln(
|
|
6449
|
+
p
|
|
6452
6450
|
)}`,
|
|
6453
6451
|
{
|
|
6454
6452
|
method: "POST",
|
|
6455
|
-
|
|
6456
|
-
signal: v
|
|
6453
|
+
signal: g
|
|
6457
6454
|
}
|
|
6458
6455
|
);
|
|
6459
|
-
for (let
|
|
6460
|
-
if (
|
|
6456
|
+
for (let k = 0; L.state === "SCANNING"; k += 1) {
|
|
6457
|
+
if (k >= s)
|
|
6461
6458
|
throw new He("CHAT_ATTACHMENT_SCAN_TIMEOUT");
|
|
6462
|
-
await i(l,
|
|
6459
|
+
await i(l, g), L = await m(S.id, p, g);
|
|
6463
6460
|
}
|
|
6464
|
-
return
|
|
6465
|
-
id:
|
|
6466
|
-
contentType:
|
|
6461
|
+
return f(L, {
|
|
6462
|
+
id: S.id,
|
|
6463
|
+
contentType: x,
|
|
6467
6464
|
sizeBytes: d.size
|
|
6468
6465
|
});
|
|
6469
|
-
} catch (
|
|
6470
|
-
throw
|
|
6471
|
-
}),
|
|
6466
|
+
} catch (N) {
|
|
6467
|
+
throw T && h({ attachmentId: T, conversationId: p }).catch(() => {
|
|
6468
|
+
}), N;
|
|
6472
6469
|
}
|
|
6473
6470
|
},
|
|
6474
|
-
async grant({ attachmentId: d, conversationId:
|
|
6475
|
-
return
|
|
6471
|
+
async grant({ attachmentId: d, conversationId: p }) {
|
|
6472
|
+
return c(
|
|
6476
6473
|
`/chat/attachments/${encodeURIComponent(d)}/grant${ln(
|
|
6477
|
-
|
|
6474
|
+
p
|
|
6478
6475
|
)}`
|
|
6479
6476
|
);
|
|
6480
6477
|
},
|
|
6481
|
-
revoke:
|
|
6478
|
+
revoke: h
|
|
6482
6479
|
};
|
|
6483
6480
|
};
|
|
6484
6481
|
function Fd({
|
|
@@ -6487,14 +6484,14 @@ function Fd({
|
|
|
6487
6484
|
transport: n,
|
|
6488
6485
|
onClose: r
|
|
6489
6486
|
}) {
|
|
6490
|
-
const { t: o } = Te(), a = e ? Fa(e) : null, [i, l] = U(void 0), [s, c] = U(!1), [
|
|
6487
|
+
const { t: o } = Te(), a = e ? Fa(e) : null, [i, l] = U(void 0), [s, c] = U(!1), [h, m] = U(!1), [f, d] = U(!1), p = C(0), g = C(void 0), b = C(void 0), y = R(() => {
|
|
6491
6488
|
g.current && URL.revokeObjectURL(g.current), g.current = void 0, l(void 0);
|
|
6492
6489
|
}, []), w = R(async () => {
|
|
6493
6490
|
if (!e || !a) return;
|
|
6494
|
-
const T = ++
|
|
6495
|
-
|
|
6491
|
+
const T = ++p.current;
|
|
6492
|
+
b.current?.abort();
|
|
6496
6493
|
const N = new AbortController();
|
|
6497
|
-
|
|
6494
|
+
b.current = N, y(), c(!1), m(!1), d(!0);
|
|
6498
6495
|
try {
|
|
6499
6496
|
const S = await Da(
|
|
6500
6497
|
e,
|
|
@@ -6505,28 +6502,28 @@ function Fd({
|
|
|
6505
6502
|
e,
|
|
6506
6503
|
N.signal
|
|
6507
6504
|
);
|
|
6508
|
-
if (T !==
|
|
6505
|
+
if (T !== p.current) {
|
|
6509
6506
|
URL.revokeObjectURL(L);
|
|
6510
6507
|
return;
|
|
6511
6508
|
}
|
|
6512
6509
|
g.current = L, l(L);
|
|
6513
6510
|
} catch {
|
|
6514
|
-
T ===
|
|
6511
|
+
T === p.current && c(!0);
|
|
6515
6512
|
} finally {
|
|
6516
|
-
T ===
|
|
6513
|
+
T === p.current && (d(!1), b.current === N && (b.current = void 0));
|
|
6517
6514
|
}
|
|
6518
6515
|
}, [e, t, a, y, n]);
|
|
6519
6516
|
H(() => {
|
|
6520
6517
|
if (!e || !a) {
|
|
6521
|
-
|
|
6518
|
+
b.current?.abort(), b.current = void 0, y();
|
|
6522
6519
|
return;
|
|
6523
6520
|
}
|
|
6524
6521
|
return w(), () => {
|
|
6525
|
-
|
|
6522
|
+
p.current += 1, b.current?.abort(), b.current = void 0;
|
|
6526
6523
|
};
|
|
6527
6524
|
}, [e, w, a, y]), H(
|
|
6528
6525
|
() => () => {
|
|
6529
|
-
|
|
6526
|
+
p.current += 1, b.current?.abort(), g.current && URL.revokeObjectURL(g.current);
|
|
6530
6527
|
},
|
|
6531
6528
|
[]
|
|
6532
6529
|
);
|
|
@@ -6600,7 +6597,7 @@ function Fd({
|
|
|
6600
6597
|
}
|
|
6601
6598
|
)
|
|
6602
6599
|
] }),
|
|
6603
|
-
|
|
6600
|
+
h && /* @__PURE__ */ u(
|
|
6604
6601
|
"p",
|
|
6605
6602
|
{
|
|
6606
6603
|
role: "alert",
|
|
@@ -6679,8 +6676,8 @@ function Id({
|
|
|
6679
6676
|
if (!s || !a.current || i.current)
|
|
6680
6677
|
return;
|
|
6681
6678
|
s.classList.add("chat-support-message-enter");
|
|
6682
|
-
const c = (
|
|
6683
|
-
|
|
6679
|
+
const c = (h) => {
|
|
6680
|
+
h.target !== s || h.animationName !== "chat-support-message-in" || (s.classList.remove("chat-support-message-enter"), s.removeEventListener("animationend", c));
|
|
6684
6681
|
};
|
|
6685
6682
|
s.addEventListener("animationend", c);
|
|
6686
6683
|
},
|
|
@@ -6709,24 +6706,24 @@ function Id({
|
|
|
6709
6706
|
) });
|
|
6710
6707
|
}
|
|
6711
6708
|
function Dd() {
|
|
6712
|
-
const { direction: e, t } = Te(), n = t("chat.talk"), { open: r, cta: o, ctaAfterMessageId: a, config: i, api: l } = Wt(), s = bn(), c = mr(), [
|
|
6713
|
-
(
|
|
6709
|
+
const { direction: e, t } = Te(), n = t("chat.talk"), { open: r, cta: o, ctaAfterMessageId: a, config: i, api: l } = Wt(), s = bn(), c = mr(), [h, m] = U(() => /* @__PURE__ */ new Map()), f = h.get(c) ?? "", d = R(
|
|
6710
|
+
(v) => {
|
|
6714
6711
|
m((E) => {
|
|
6715
6712
|
const W = new Map(E);
|
|
6716
|
-
return W.set(c,
|
|
6713
|
+
return W.set(c, v), W;
|
|
6717
6714
|
});
|
|
6718
6715
|
},
|
|
6719
6716
|
[c]
|
|
6720
|
-
), [
|
|
6721
|
-
(
|
|
6717
|
+
), [p, g] = U(!1), [b, y] = U(!1), [w, x] = U(), [T, N] = U(null), [S, L] = U(() => /* @__PURE__ */ new Map()), k = C(S), F = S.get(c) ?? mo, j = R(
|
|
6718
|
+
(v, E) => {
|
|
6722
6719
|
L((W) => {
|
|
6723
|
-
const D = W.get(
|
|
6724
|
-
return z.set(
|
|
6720
|
+
const D = W.get(v) ?? mo, q = typeof E == "function" ? E(D) : E, z = new Map(W);
|
|
6721
|
+
return z.set(v, q), k.current = z, z;
|
|
6725
6722
|
});
|
|
6726
6723
|
},
|
|
6727
6724
|
[]
|
|
6728
6725
|
), P = R(
|
|
6729
|
-
(
|
|
6726
|
+
(v) => j(c, v),
|
|
6730
6727
|
[c, j]
|
|
6731
6728
|
), fe = C(null), oe = C(null), B = C(null), re = C(null), te = C(null), ce = C(null), _ = C(null), ve = C(/* @__PURE__ */ new Set()), se = C(/* @__PURE__ */ new Map()), ae = C(/* @__PURE__ */ new Map()), he = C(/* @__PURE__ */ new Set()), O = C(/* @__PURE__ */ new Set()), K = C(/* @__PURE__ */ new Set()), ue = C(0), {
|
|
6732
6729
|
cancelThreadMessagesRequest: Oe,
|
|
@@ -6746,7 +6743,7 @@ function Dd() {
|
|
|
6746
6743
|
fo,
|
|
6747
6744
|
fo
|
|
6748
6745
|
), Nr = F.reduce(
|
|
6749
|
-
(
|
|
6746
|
+
(v, E) => v + E.file.size,
|
|
6750
6747
|
0
|
|
6751
6748
|
), Xt = Ie && F.length < gt && Nr < St, ze = le(
|
|
6752
6749
|
() => i.attachments?.transport ?? Rd(i, l),
|
|
@@ -6755,11 +6752,11 @@ function Dd() {
|
|
|
6755
6752
|
kr.current = ze;
|
|
6756
6753
|
const vt = C(!0), Ar = !Zt && (!!At?.active || ge);
|
|
6757
6754
|
mt(() => {
|
|
6758
|
-
const
|
|
6759
|
-
if (!
|
|
6755
|
+
const v = B.current, E = re.current;
|
|
6756
|
+
if (!v || !E) return;
|
|
6760
6757
|
let W = !0;
|
|
6761
6758
|
const D = () => {
|
|
6762
|
-
W && kd(
|
|
6759
|
+
W && kd(v, E);
|
|
6763
6760
|
};
|
|
6764
6761
|
D();
|
|
6765
6762
|
const q = typeof ResizeObserver == "function" ? new ResizeObserver(D) : null;
|
|
@@ -6768,29 +6765,29 @@ function Dd() {
|
|
|
6768
6765
|
};
|
|
6769
6766
|
}, [n]);
|
|
6770
6767
|
const Sr = le(() => {
|
|
6771
|
-
const
|
|
6768
|
+
const v = de.map((E) => ({
|
|
6772
6769
|
type: "canonical",
|
|
6773
6770
|
message: E
|
|
6774
6771
|
}));
|
|
6775
6772
|
if (me) {
|
|
6776
6773
|
const E = me.afterMessageId ? de.findIndex(
|
|
6777
6774
|
({ id: D }) => D === me.afterMessageId
|
|
6778
|
-
) : -1, W = me.afterMessageId ? E >= 0 ? E + 1 :
|
|
6779
|
-
|
|
6775
|
+
) : -1, W = me.afterMessageId ? E >= 0 ? E + 1 : v.length : 0;
|
|
6776
|
+
v.splice(W, 0, {
|
|
6780
6777
|
type: "optimistic",
|
|
6781
6778
|
message: me
|
|
6782
6779
|
});
|
|
6783
6780
|
}
|
|
6784
6781
|
if (o) {
|
|
6785
|
-
const E = a ?
|
|
6782
|
+
const E = a ? v.findIndex(
|
|
6786
6783
|
(W) => W.type !== "cta" && W.message.id === a
|
|
6787
6784
|
) : -1;
|
|
6788
|
-
|
|
6785
|
+
v.splice(E + 1, 0, {
|
|
6789
6786
|
type: "cta",
|
|
6790
6787
|
commandId: o.commandId
|
|
6791
6788
|
});
|
|
6792
6789
|
}
|
|
6793
|
-
return
|
|
6790
|
+
return v;
|
|
6794
6791
|
}, [o, a, me, de]), _n = Ze && Sr.length === 0, Wa = bd({
|
|
6795
6792
|
containerRef: ce,
|
|
6796
6793
|
contentRef: _,
|
|
@@ -6808,8 +6805,8 @@ function Dd() {
|
|
|
6808
6805
|
$r();
|
|
6809
6806
|
try {
|
|
6810
6807
|
await Q(c);
|
|
6811
|
-
} catch (
|
|
6812
|
-
throw Mr(),
|
|
6808
|
+
} catch (v) {
|
|
6809
|
+
throw Mr(), v;
|
|
6813
6810
|
}
|
|
6814
6811
|
}
|
|
6815
6812
|
}, [$r, Mr, c, Q]), {
|
|
@@ -6825,7 +6822,7 @@ function Dd() {
|
|
|
6825
6822
|
});
|
|
6826
6823
|
H(() => {
|
|
6827
6824
|
vt.current = !0;
|
|
6828
|
-
const
|
|
6825
|
+
const v = se.current, E = ae.current, W = he.current, D = O.current, q = K.current;
|
|
6829
6826
|
return () => {
|
|
6830
6827
|
vt.current = !1, te.current !== null && window.clearTimeout(te.current);
|
|
6831
6828
|
const z = kr.current;
|
|
@@ -6837,16 +6834,16 @@ function Dd() {
|
|
|
6837
6834
|
conversationId: Z
|
|
6838
6835
|
}).catch(() => {
|
|
6839
6836
|
}).finally(() => q.delete(X.id)));
|
|
6840
|
-
|
|
6837
|
+
v.forEach((Z) => Z.abort()), E.forEach((Z) => URL.revokeObjectURL(Z)), v.clear(), E.clear(), W.clear();
|
|
6841
6838
|
};
|
|
6842
6839
|
}, []), H(
|
|
6843
6840
|
() => () => Fe?.stop(),
|
|
6844
6841
|
[c, Fe]
|
|
6845
6842
|
), H(() => {
|
|
6846
|
-
const
|
|
6843
|
+
const v = () => {
|
|
6847
6844
|
document.visibilityState === "hidden" && Fe?.stop();
|
|
6848
6845
|
};
|
|
6849
|
-
return document.addEventListener("visibilitychange",
|
|
6846
|
+
return document.addEventListener("visibilitychange", v), () => document.removeEventListener("visibilitychange", v);
|
|
6850
6847
|
}, [Fe]), H(() => {
|
|
6851
6848
|
Xe !== Rt.Available && Fe?.stop();
|
|
6852
6849
|
}, [Fe, Xe]), H(
|
|
@@ -6856,53 +6853,53 @@ function Dd() {
|
|
|
6856
6853
|
[Oe, c]
|
|
6857
6854
|
), H(() => {
|
|
6858
6855
|
if (r && de.length > 0) {
|
|
6859
|
-
const
|
|
6856
|
+
const v = de.findLast(
|
|
6860
6857
|
(E) => E.author.type === Le.Customer || E.status === It.Completed || E.status === It.Failed
|
|
6861
6858
|
);
|
|
6862
|
-
|
|
6859
|
+
v && ye(v.updatedAt);
|
|
6863
6860
|
}
|
|
6864
6861
|
}, [de, r, ye]), H(() => {
|
|
6865
6862
|
if (!(!r || !Mn))
|
|
6866
|
-
for (const
|
|
6867
|
-
!
|
|
6863
|
+
for (const v of de)
|
|
6864
|
+
!v.delivery || v.delivery.status === "READ" || ve.current.has(v.id) || (ve.current.add(v.id), Mn.acknowledgeMessageDelivery({ messageId: v.id, status: "read" }).catch(() => ve.current.delete(v.id)));
|
|
6868
6865
|
}, [Mn, r, de]);
|
|
6869
6866
|
const _r = le(() => Re ? ks(Re, t) : de.some((E) => E.author.type === Le.Agent && E.status === It.Failed) ? t(Ft.agentResponseFailed) : Xe === Rt.Unavailable ? t(Ft.connectionFailed) : Xe === Rt.Offline ? t(Ft.offline) : null, [Xe, Re, t, de]), Pr = R(
|
|
6870
|
-
(
|
|
6867
|
+
(v, E, W) => {
|
|
6871
6868
|
se.current.get(E)?.abort();
|
|
6872
6869
|
const D = new AbortController();
|
|
6873
6870
|
se.current.set(E, D), j(
|
|
6874
|
-
|
|
6871
|
+
v,
|
|
6875
6872
|
(q) => q.map(
|
|
6876
6873
|
(z) => z.id === E ? { ...z, progress: 0, state: "preparing" } : z
|
|
6877
6874
|
)
|
|
6878
6875
|
), ze.upload({
|
|
6879
6876
|
file: W,
|
|
6880
|
-
conversationId:
|
|
6877
|
+
conversationId: v,
|
|
6881
6878
|
signal: D.signal,
|
|
6882
6879
|
onStage: (q) => {
|
|
6883
6880
|
se.current.get(E) === D && j(
|
|
6884
|
-
|
|
6881
|
+
v,
|
|
6885
6882
|
(z) => z.map(
|
|
6886
6883
|
(Z) => Z.id === E ? { ...Z, state: q } : Z
|
|
6887
6884
|
)
|
|
6888
6885
|
);
|
|
6889
6886
|
},
|
|
6890
6887
|
onProgress: (q) => se.current.get(E) === D ? j(
|
|
6891
|
-
|
|
6888
|
+
v,
|
|
6892
6889
|
(z) => z.map(
|
|
6893
6890
|
(Z) => Z.id === E ? { ...Z, progress: q, state: "uploading" } : Z
|
|
6894
6891
|
)
|
|
6895
6892
|
) : void 0
|
|
6896
6893
|
}).then((q) => {
|
|
6897
6894
|
se.current.get(E) === D && j(
|
|
6898
|
-
|
|
6895
|
+
v,
|
|
6899
6896
|
(z) => z.map(
|
|
6900
6897
|
(Z) => Z.id === E ? { ...Z, progress: 1, state: "ready", attachment: q } : Z
|
|
6901
6898
|
)
|
|
6902
6899
|
);
|
|
6903
6900
|
}).catch((q) => {
|
|
6904
6901
|
se.current.get(E) !== D || q instanceof DOMException && q.name === "AbortError" || j(
|
|
6905
|
-
|
|
6902
|
+
v,
|
|
6906
6903
|
(z) => z.map(
|
|
6907
6904
|
(Z) => Z.id === E ? { ...Z, state: "failed" } : Z
|
|
6908
6905
|
)
|
|
@@ -6912,11 +6909,11 @@ function Dd() {
|
|
|
6912
6909
|
});
|
|
6913
6910
|
},
|
|
6914
6911
|
[ze, j]
|
|
6915
|
-
), Or = (
|
|
6916
|
-
if (!Ie || !
|
|
6912
|
+
), Or = (v) => {
|
|
6913
|
+
if (!Ie || !v) return;
|
|
6917
6914
|
const E = [];
|
|
6918
6915
|
let W = Nr, D;
|
|
6919
|
-
for (const z of Array.from(
|
|
6916
|
+
for (const z of Array.from(v)) {
|
|
6920
6917
|
if (F.length + E.length >= gt) {
|
|
6921
6918
|
D ??= t("attachment.tooMany", { count: gt });
|
|
6922
6919
|
continue;
|
|
@@ -6974,75 +6971,75 @@ function Dd() {
|
|
|
6974
6971
|
({ id: z, file: Z }) => Pr(c, z, Z)
|
|
6975
6972
|
));
|
|
6976
6973
|
}, Rr = R(
|
|
6977
|
-
(
|
|
6974
|
+
(v, E) => {
|
|
6978
6975
|
se.current.get(E)?.abort(), se.current.delete(E), he.current.delete(E);
|
|
6979
6976
|
const W = ae.current.get(E);
|
|
6980
6977
|
W && URL.revokeObjectURL(W), ae.current.delete(E), j(
|
|
6981
|
-
|
|
6978
|
+
v,
|
|
6982
6979
|
(D) => D.filter((q) => q.id !== E)
|
|
6983
6980
|
);
|
|
6984
6981
|
},
|
|
6985
6982
|
[j]
|
|
6986
|
-
), Za = (
|
|
6987
|
-
if (!(
|
|
6988
|
-
if (
|
|
6989
|
-
if (K.current.has(
|
|
6990
|
-
K.current.add(
|
|
6983
|
+
), Za = (v, E) => {
|
|
6984
|
+
if (!(v.state === "removing" || v.state === "sending")) {
|
|
6985
|
+
if (v.state === "ready" && v.attachment && ze.revoke) {
|
|
6986
|
+
if (K.current.has(v.id)) return;
|
|
6987
|
+
K.current.add(v.id), x(void 0), j(
|
|
6991
6988
|
E,
|
|
6992
6989
|
(W) => W.map(
|
|
6993
|
-
(D) => D.id ===
|
|
6990
|
+
(D) => D.id === v.id ? { ...D, state: "removing" } : D
|
|
6994
6991
|
)
|
|
6995
6992
|
), (async () => {
|
|
6996
6993
|
try {
|
|
6997
6994
|
await ze.revoke?.({
|
|
6998
|
-
attachmentId:
|
|
6995
|
+
attachmentId: v.attachment.id,
|
|
6999
6996
|
conversationId: E
|
|
7000
|
-
}), vt.current && Rr(E,
|
|
6997
|
+
}), vt.current && Rr(E, v.id);
|
|
7001
6998
|
} catch {
|
|
7002
6999
|
vt.current && (j(
|
|
7003
7000
|
E,
|
|
7004
7001
|
(W) => W.map(
|
|
7005
|
-
(D) => D.id ===
|
|
7002
|
+
(D) => D.id === v.id && D.state === "removing" ? { ...D, state: "ready" } : D
|
|
7006
7003
|
)
|
|
7007
7004
|
), x(t("attachment.revokeFailed")));
|
|
7008
7005
|
} finally {
|
|
7009
|
-
K.current.delete(
|
|
7006
|
+
K.current.delete(v.id);
|
|
7010
7007
|
}
|
|
7011
7008
|
})();
|
|
7012
7009
|
return;
|
|
7013
7010
|
}
|
|
7014
|
-
Rr(E,
|
|
7011
|
+
Rr(E, v.id);
|
|
7015
7012
|
}
|
|
7016
|
-
}, Jt = (
|
|
7017
|
-
if (Jt(
|
|
7018
|
-
if (
|
|
7019
|
-
|
|
7013
|
+
}, Jt = (v) => Array.from(v.dataTransfer.types).includes("Files"), Xa = (v) => {
|
|
7014
|
+
if (Jt(v)) {
|
|
7015
|
+
if (v.preventDefault(), !Xt) {
|
|
7016
|
+
v.dataTransfer.dropEffect = "none";
|
|
7020
7017
|
return;
|
|
7021
7018
|
}
|
|
7022
7019
|
ue.current += 1, y(!0);
|
|
7023
7020
|
}
|
|
7024
|
-
}, Ja = (
|
|
7025
|
-
!Jt(
|
|
7026
|
-
}, Qa = (
|
|
7027
|
-
!Jt(
|
|
7028
|
-
}, es = (
|
|
7029
|
-
!Jt(
|
|
7021
|
+
}, Ja = (v) => {
|
|
7022
|
+
!Jt(v) && !b || (v.preventDefault(), v.dataTransfer.dropEffect = Xt ? "copy" : "none");
|
|
7023
|
+
}, Qa = (v) => {
|
|
7024
|
+
!Jt(v) && !b || (v.preventDefault(), ue.current = Math.max(0, ue.current - 1), ue.current === 0 && y(!1));
|
|
7025
|
+
}, es = (v) => {
|
|
7026
|
+
!Jt(v) && !b || (v.preventDefault(), ue.current = 0, y(!1), Ie && (Xt ? Or(v.dataTransfer.files) : F.length >= gt ? x(t("attachment.tooMany", { count: gt })) : x(
|
|
7030
7027
|
t("attachment.totalTooLarge", {
|
|
7031
7028
|
size: Math.round(St / (1024 * 1024))
|
|
7032
7029
|
})
|
|
7033
7030
|
)));
|
|
7034
7031
|
}, Fr = () => {
|
|
7035
|
-
const
|
|
7032
|
+
const v = c, E = f.trim(), W = F.flatMap(
|
|
7036
7033
|
({ attachment: ie, state: X }) => X === "ready" && ie ? [ie] : []
|
|
7037
7034
|
);
|
|
7038
7035
|
if (!E || kt || !Ie && F.length > 0 || F.some(({ state: ie }) => ie !== "ready"))
|
|
7039
7036
|
return;
|
|
7040
|
-
Fe?.stop(), te.current !== null && (window.clearTimeout(te.current), te.current = null),
|
|
7037
|
+
Fe?.stop(), te.current !== null && (window.clearTimeout(te.current), te.current = null), d(""), fe.current && (fe.current.style.height = "auto");
|
|
7041
7038
|
const D = F.map(({ id: ie }) => ie), q = new Set(D);
|
|
7042
7039
|
D.forEach(
|
|
7043
7040
|
(ie) => O.current.add(ie)
|
|
7044
7041
|
), D.length > 0 && j(
|
|
7045
|
-
|
|
7042
|
+
v,
|
|
7046
7043
|
(ie) => ie.map(
|
|
7047
7044
|
(X) => q.has(X.id) ? { ...X, state: "sending" } : X
|
|
7048
7045
|
)
|
|
@@ -7051,7 +7048,7 @@ function Dd() {
|
|
|
7051
7048
|
D.forEach(
|
|
7052
7049
|
(ie) => O.current.delete(ie)
|
|
7053
7050
|
), vt.current && j(
|
|
7054
|
-
|
|
7051
|
+
v,
|
|
7055
7052
|
(ie) => ie.map(
|
|
7056
7053
|
(X) => q.has(X.id) && X.state === "sending" ? { ...X, state: "ready" } : X
|
|
7057
7054
|
)
|
|
@@ -7061,7 +7058,7 @@ function Dd() {
|
|
|
7061
7058
|
try {
|
|
7062
7059
|
Z = W.length ? Ae(E, W) : Ae(E);
|
|
7063
7060
|
} catch {
|
|
7064
|
-
|
|
7061
|
+
d(E), z();
|
|
7065
7062
|
return;
|
|
7066
7063
|
}
|
|
7067
7064
|
Z.then((ie) => {
|
|
@@ -7074,17 +7071,17 @@ function Dd() {
|
|
|
7074
7071
|
const bt = ae.current.get(X);
|
|
7075
7072
|
bt && URL.revokeObjectURL(bt), ae.current.delete(X);
|
|
7076
7073
|
}), vt.current && j(
|
|
7077
|
-
|
|
7074
|
+
v,
|
|
7078
7075
|
(X) => X.filter((bt) => !q.has(bt.id))
|
|
7079
7076
|
);
|
|
7080
7077
|
}).catch(z);
|
|
7081
7078
|
}, ts = R(
|
|
7082
|
-
(
|
|
7079
|
+
(v, E) => N({ attachment: v, conversationId: E }),
|
|
7083
7080
|
[]
|
|
7084
7081
|
), ns = R(
|
|
7085
|
-
(
|
|
7082
|
+
(v, E) => {
|
|
7086
7083
|
Ha(
|
|
7087
|
-
|
|
7084
|
+
v,
|
|
7088
7085
|
E,
|
|
7089
7086
|
ze
|
|
7090
7087
|
).catch(() => x(t("attachment.downloadFailed")));
|
|
@@ -7100,7 +7097,7 @@ function Dd() {
|
|
|
7100
7097
|
onDrop: es,
|
|
7101
7098
|
className: "relative z-1 flex min-h-0 flex-1 flex-col overflow-hidden px-3 pb-2",
|
|
7102
7099
|
children: [
|
|
7103
|
-
Ie &&
|
|
7100
|
+
Ie && b && /* @__PURE__ */ u("div", { className: "chat-attachment-dropzone", "aria-hidden": "true", children: /* @__PURE__ */ A("div", { className: "chat-attachment-dropzone__content", children: [
|
|
7104
7101
|
/* @__PURE__ */ u(io, { className: "h-5 w-5" }),
|
|
7105
7102
|
/* @__PURE__ */ u("span", { children: t("attachment.dropFiles") }),
|
|
7106
7103
|
/* @__PURE__ */ u("small", { children: t("attachment.limits", {
|
|
@@ -7201,53 +7198,53 @@ function Dd() {
|
|
|
7201
7198
|
className: "chat-composer-attachments",
|
|
7202
7199
|
"aria-label": t("attachment.filesToSend"),
|
|
7203
7200
|
"aria-live": "polite",
|
|
7204
|
-
children: F.map((
|
|
7205
|
-
/* @__PURE__ */ u("div", { className: "chat-composer-attachment__preview", children:
|
|
7201
|
+
children: F.map((v) => /* @__PURE__ */ A("div", { className: "chat-composer-attachment", children: [
|
|
7202
|
+
/* @__PURE__ */ u("div", { className: "chat-composer-attachment__preview", children: v.localPreviewUrl ? /* @__PURE__ */ u("img", { src: v.localPreviewUrl, alt: "" }) : /* @__PURE__ */ u(Tr, { "aria-hidden": "true", className: "h-4 w-4" }) }),
|
|
7206
7203
|
/* @__PURE__ */ A("div", { className: "min-w-0 flex-1", children: [
|
|
7207
|
-
/* @__PURE__ */ u("p", { className: "truncate text-[11px] font-semibold text-white/88", children:
|
|
7208
|
-
/* @__PURE__ */ u("div", { className: "mt-0.5 flex items-center gap-1.5 text-[10px]", children:
|
|
7204
|
+
/* @__PURE__ */ u("p", { className: "truncate text-[11px] font-semibold text-white/88", children: v.file.name }),
|
|
7205
|
+
/* @__PURE__ */ u("div", { className: "mt-0.5 flex items-center gap-1.5 text-[10px]", children: v.state === "preparing" ? /* @__PURE__ */ A($e, { children: [
|
|
7209
7206
|
/* @__PURE__ */ u(cn, { className: "h-3 w-3 animate-spin text-[#68d8ff]" }),
|
|
7210
7207
|
/* @__PURE__ */ u("span", { className: "text-white/52", children: t("attachment.preparing") })
|
|
7211
|
-
] }) :
|
|
7208
|
+
] }) : v.state === "uploading" ? /* @__PURE__ */ A($e, { children: [
|
|
7212
7209
|
/* @__PURE__ */ u("span", { className: "text-[#a9eaff]", children: t("attachment.uploading") }),
|
|
7213
7210
|
/* @__PURE__ */ A("span", { className: "text-white/44 tabular-nums", children: [
|
|
7214
|
-
Math.round(
|
|
7211
|
+
Math.round(v.progress * 100),
|
|
7215
7212
|
"%"
|
|
7216
7213
|
] })
|
|
7217
|
-
] }) :
|
|
7214
|
+
] }) : v.state === "scanning" ? /* @__PURE__ */ A($e, { children: [
|
|
7218
7215
|
/* @__PURE__ */ u(lo, { className: "h-3 w-3 animate-pulse text-amber-200" }),
|
|
7219
7216
|
/* @__PURE__ */ u("span", { className: "text-amber-100/74", children: t("attachment.scanning") })
|
|
7220
|
-
] }) :
|
|
7217
|
+
] }) : v.state === "ready" ? /* @__PURE__ */ A($e, { children: [
|
|
7221
7218
|
/* @__PURE__ */ u(Iu, { className: "h-3 w-3 text-[#8df0c8]" }),
|
|
7222
7219
|
/* @__PURE__ */ u("span", { className: "text-[#a6ebce]", children: t("attachment.ready") }),
|
|
7223
|
-
/* @__PURE__ */ u("span", { className: "text-white/38", children: Ra(
|
|
7224
|
-
] }) :
|
|
7220
|
+
/* @__PURE__ */ u("span", { className: "text-white/38", children: Ra(v.file.size) })
|
|
7221
|
+
] }) : v.state === "removing" ? /* @__PURE__ */ A($e, { children: [
|
|
7225
7222
|
/* @__PURE__ */ u(cn, { className: "h-3 w-3 animate-spin text-[#68d8ff]" }),
|
|
7226
7223
|
/* @__PURE__ */ u("span", { className: "text-[#a9eaff]", children: t("attachment.removing") })
|
|
7227
|
-
] }) :
|
|
7224
|
+
] }) : v.state === "sending" ? /* @__PURE__ */ A($e, { children: [
|
|
7228
7225
|
/* @__PURE__ */ u(lo, { className: "h-3 w-3 animate-pulse text-[#8df0c8]" }),
|
|
7229
7226
|
/* @__PURE__ */ u("span", { className: "text-[#a6ebce]", children: t("attachment.sending") })
|
|
7230
7227
|
] }) : /* @__PURE__ */ A($e, { children: [
|
|
7231
7228
|
/* @__PURE__ */ u(zu, { className: "h-3 w-3 text-red-200" }),
|
|
7232
7229
|
/* @__PURE__ */ u("span", { className: "text-red-100/80", children: t("attachment.uploadFailed") })
|
|
7233
7230
|
] }) }),
|
|
7234
|
-
(
|
|
7231
|
+
(v.state === "uploading" || v.state === "scanning") && /* @__PURE__ */ u("div", { className: "chat-composer-attachment__progress", children: /* @__PURE__ */ u(
|
|
7235
7232
|
"span",
|
|
7236
7233
|
{
|
|
7237
|
-
className:
|
|
7238
|
-
style:
|
|
7234
|
+
className: v.state === "scanning" ? "is-scanning" : "",
|
|
7235
|
+
style: v.state === "uploading" ? { width: `${Math.max(4, v.progress * 100)}%` } : void 0
|
|
7239
7236
|
}
|
|
7240
7237
|
) })
|
|
7241
7238
|
] }),
|
|
7242
|
-
|
|
7239
|
+
v.state === "failed" && Ie && /* @__PURE__ */ u(
|
|
7243
7240
|
ne,
|
|
7244
7241
|
{
|
|
7245
7242
|
type: "button",
|
|
7246
|
-
"aria-label": `${t("attachment.retry")} ${
|
|
7243
|
+
"aria-label": `${t("attachment.retry")} ${v.file.name}`,
|
|
7247
7244
|
onClick: () => Pr(
|
|
7248
7245
|
c,
|
|
7249
|
-
|
|
7250
|
-
|
|
7246
|
+
v.id,
|
|
7247
|
+
v.file
|
|
7251
7248
|
),
|
|
7252
7249
|
className: "chat-composer-attachment__action text-[#68d8ff]",
|
|
7253
7250
|
children: /* @__PURE__ */ u(ed, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
@@ -7257,12 +7254,12 @@ function Dd() {
|
|
|
7257
7254
|
ne,
|
|
7258
7255
|
{
|
|
7259
7256
|
type: "button",
|
|
7260
|
-
"aria-label": `${t("attachment.remove")} ${
|
|
7261
|
-
"aria-busy":
|
|
7262
|
-
disabled:
|
|
7263
|
-
onClick: () => Za(
|
|
7257
|
+
"aria-label": `${t("attachment.remove")} ${v.file.name}`,
|
|
7258
|
+
"aria-busy": v.state === "removing",
|
|
7259
|
+
disabled: v.state === "removing" || v.state === "sending",
|
|
7260
|
+
onClick: () => Za(v, c),
|
|
7264
7261
|
className: "chat-composer-attachment__action text-white/58",
|
|
7265
|
-
children:
|
|
7262
|
+
children: v.state === "removing" ? /* @__PURE__ */ u(
|
|
7266
7263
|
cn,
|
|
7267
7264
|
{
|
|
7268
7265
|
"aria-hidden": "true",
|
|
@@ -7271,7 +7268,7 @@ function Dd() {
|
|
|
7271
7268
|
) : /* @__PURE__ */ u(Pa, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
|
|
7272
7269
|
}
|
|
7273
7270
|
)
|
|
7274
|
-
] },
|
|
7271
|
+
] }, v.id))
|
|
7275
7272
|
}
|
|
7276
7273
|
),
|
|
7277
7274
|
w && /* @__PURE__ */ u(
|
|
@@ -7282,7 +7279,7 @@ function Dd() {
|
|
|
7282
7279
|
children: w
|
|
7283
7280
|
}
|
|
7284
7281
|
),
|
|
7285
|
-
Ie && F.some(({ state:
|
|
7282
|
+
Ie && F.some(({ state: v }) => v === "ready") && !f.trim() && /* @__PURE__ */ u("p", { className: "px-2 pb-1 text-[10px] leading-4 text-white/48", children: t("attachment.messageRequired") }),
|
|
7286
7283
|
!Ie && F.length > 0 && /* @__PURE__ */ u(
|
|
7287
7284
|
"p",
|
|
7288
7285
|
{
|
|
@@ -7307,8 +7304,8 @@ function Dd() {
|
|
|
7307
7304
|
multiple: !0,
|
|
7308
7305
|
accept: Ad,
|
|
7309
7306
|
className: "sr-only",
|
|
7310
|
-
onChange: (
|
|
7311
|
-
Or(
|
|
7307
|
+
onChange: (v) => {
|
|
7308
|
+
Or(v.currentTarget.files), v.currentTarget.value = "";
|
|
7312
7309
|
}
|
|
7313
7310
|
}
|
|
7314
7311
|
),
|
|
@@ -7328,7 +7325,7 @@ function Dd() {
|
|
|
7328
7325
|
ne,
|
|
7329
7326
|
{
|
|
7330
7327
|
"aria-label": t("chat.switchToVoice"),
|
|
7331
|
-
"data-compact":
|
|
7328
|
+
"data-compact": p,
|
|
7332
7329
|
className: "chat-composer-button chat-talk-button relative h-8 shrink-0 overflow-hidden text-[12px] leading-4 font-medium text-white",
|
|
7333
7330
|
onClick: () => s(Ne.voice),
|
|
7334
7331
|
children: /* @__PURE__ */ A("span", { className: "chat-talk-button__content", children: [
|
|
@@ -7356,12 +7353,12 @@ function Dd() {
|
|
|
7356
7353
|
onBlur: () => {
|
|
7357
7354
|
g(!1), Fe?.stop();
|
|
7358
7355
|
},
|
|
7359
|
-
onChange: (
|
|
7360
|
-
const E =
|
|
7361
|
-
|
|
7356
|
+
onChange: (v) => {
|
|
7357
|
+
const E = v.target.value;
|
|
7358
|
+
d(E), c && E.trim() ? Fe?.markActivity(c) : Fe?.stop();
|
|
7362
7359
|
},
|
|
7363
|
-
onInput: (
|
|
7364
|
-
const E =
|
|
7360
|
+
onInput: (v) => {
|
|
7361
|
+
const E = v.currentTarget;
|
|
7365
7362
|
te.current !== null && window.clearTimeout(te.current), te.current = null;
|
|
7366
7363
|
const W = E.clientHeight + "px";
|
|
7367
7364
|
E.style.height = "auto";
|
|
@@ -7370,8 +7367,8 @@ function Dd() {
|
|
|
7370
7367
|
E.style.height = D, te.current = null;
|
|
7371
7368
|
}));
|
|
7372
7369
|
},
|
|
7373
|
-
onKeyDown: (
|
|
7374
|
-
|
|
7370
|
+
onKeyDown: (v) => {
|
|
7371
|
+
v.key === "Enter" && !v.nativeEvent.isComposing && (v.preventDefault(), Fr());
|
|
7375
7372
|
},
|
|
7376
7373
|
className: "no-scrollbar block h-8 min-h-8 w-full resize-none overflow-y-auto border-none bg-transparent px-2 py-1.5 text-[16px] leading-[18px] font-normal text-white transition-[height] duration-200 outline-none placeholder:text-white/38"
|
|
7377
7374
|
}
|
|
@@ -7380,7 +7377,7 @@ function Dd() {
|
|
|
7380
7377
|
/* @__PURE__ */ A(
|
|
7381
7378
|
ne,
|
|
7382
7379
|
{
|
|
7383
|
-
disabled: !f.trim() || kt || !Ie && F.length > 0 || F.some(({ state:
|
|
7380
|
+
disabled: !f.trim() || kt || !Ie && F.length > 0 || F.some(({ state: v }) => v !== "ready"),
|
|
7384
7381
|
"aria-label": t("chat.send"),
|
|
7385
7382
|
className: `${f && "group"} chat-send-button`,
|
|
7386
7383
|
onClick: Fr,
|
|
@@ -7445,7 +7442,7 @@ function zd({
|
|
|
7445
7442
|
conversationId: e,
|
|
7446
7443
|
presentation: t
|
|
7447
7444
|
}) {
|
|
7448
|
-
const { t: n } = Te(), r = t.contractState === "CURRENT" && t.humanSupport === "ROUTING", o = t.identity === "SUPPORT" && t.displayName === "Support" && t.avatarAsset === null && t.presentationVersion === null, a = (r || o ? null : t.displayName) ?? (t.identity === "LOLA" ? "Lola" : n("identity.support")), i = t.humanSupport === "UNKNOWN" || t.ai === "UNKNOWN" ? n("identity.unavailable") : t.humanSupport === "ROUTING" ? n("identity.waiting") : t.humanSupport === "ASSIGNED" ? n("identity.operator") : t.ai === "SUSPENDED" ? n("identity.paused") : n("identity.aiAssistant"), l = t.ai === "UNKNOWN" ? n("identity.unavailable") : t.ai === "SUSPENDED" ? n("identity.paused") : n("identity.aiAssistant"), s = t.ai === "SUSPENDED" && (t.humanSupport === "ROUTING" || t.humanSupport === "ASSIGNED"), c = s ? `${i}. ${l}` : i,
|
|
7445
|
+
const { t: n } = Te(), r = t.contractState === "CURRENT" && t.humanSupport === "ROUTING", o = t.identity === "SUPPORT" && t.displayName === "Support" && t.avatarAsset === null && t.presentationVersion === null, a = (r || o ? null : t.displayName) ?? (t.identity === "LOLA" ? "Lola" : n("identity.support")), i = t.humanSupport === "UNKNOWN" || t.ai === "UNKNOWN" ? n("identity.unavailable") : t.humanSupport === "ROUTING" ? n("identity.waiting") : t.humanSupport === "ASSIGNED" ? n("identity.operator") : t.ai === "SUSPENDED" ? n("identity.paused") : n("identity.aiAssistant"), l = t.ai === "UNKNOWN" ? n("identity.unavailable") : t.ai === "SUSPENDED" ? n("identity.paused") : n("identity.aiAssistant"), s = t.ai === "SUSPENDED" && (t.humanSupport === "ROUTING" || t.humanSupport === "ASSIGNED"), c = s ? `${i}. ${l}` : i, h = r ? "SUPPORT" : t.identity === "LOLA" ? "LOLA" : t.humanSupport === "ASSIGNED" && (t.presentationVersion || t.avatarAsset) ? "HUMAN" : "SUPPORT", m = t.contractState === "CURRENT" && !r ? t : null;
|
|
7449
7446
|
return /* @__PURE__ */ A(
|
|
7450
7447
|
"div",
|
|
7451
7448
|
{
|
|
@@ -7462,7 +7459,7 @@ function zd({
|
|
|
7462
7459
|
{
|
|
7463
7460
|
conversationId: e,
|
|
7464
7461
|
displayName: a,
|
|
7465
|
-
fallbackKind:
|
|
7462
|
+
fallbackKind: h,
|
|
7466
7463
|
presentation: m,
|
|
7467
7464
|
size: "header"
|
|
7468
7465
|
}
|
|
@@ -7547,23 +7544,23 @@ function Wd(e, t) {
|
|
|
7547
7544
|
return mt(() => {
|
|
7548
7545
|
const c = Bn(t);
|
|
7549
7546
|
r.current = { conversationId: e, presentation: c };
|
|
7550
|
-
const
|
|
7551
|
-
if (
|
|
7547
|
+
const h = o.current, m = r.current;
|
|
7548
|
+
if (h.conversationId !== m.conversationId) {
|
|
7552
7549
|
s(), o.current = m, i(m);
|
|
7553
7550
|
return;
|
|
7554
7551
|
}
|
|
7555
|
-
if (Bd(
|
|
7552
|
+
if (Bd(h.presentation, m.presentation)) {
|
|
7556
7553
|
const f = {
|
|
7557
7554
|
...m,
|
|
7558
7555
|
presentation: Gd(
|
|
7559
|
-
|
|
7556
|
+
h.presentation,
|
|
7560
7557
|
m.presentation
|
|
7561
7558
|
)
|
|
7562
7559
|
};
|
|
7563
7560
|
o.current = f, i(f), l.current === null && (l.current = window.setTimeout(() => {
|
|
7564
7561
|
l.current = null;
|
|
7565
|
-
const
|
|
7566
|
-
|
|
7562
|
+
const d = r.current;
|
|
7563
|
+
d.conversationId !== h.conversationId || d.presentation.contractState !== "CURRENT" || d.presentation.humanSupport !== "ROUTING" || (o.current = d, i(d));
|
|
7567
7564
|
}, Vd));
|
|
7568
7565
|
return;
|
|
7569
7566
|
}
|
|
@@ -7618,9 +7615,9 @@ function qd({
|
|
|
7618
7615
|
className: e,
|
|
7619
7616
|
...t
|
|
7620
7617
|
}) {
|
|
7621
|
-
const { isFullscreen: n, isMobile: r, setFullscreen: o, transitionSurface: a } = Wt(), { t: i } = Te(), l = bn(), s = pr(), c = As(s.pathname), { endVoiceChat:
|
|
7618
|
+
const { isFullscreen: n, isMobile: r, setFullscreen: o, transitionSurface: a } = Wt(), { t: i } = Te(), l = bn(), s = pr(), c = As(s.pathname), { endVoiceChat: h } = go(), m = Ss(s.pathname), f = mr(), d = yo(), p = Wd(
|
|
7622
7619
|
f,
|
|
7623
|
-
|
|
7620
|
+
d
|
|
7624
7621
|
), g = async () => {
|
|
7625
7622
|
if (!m) {
|
|
7626
7623
|
a(!1, {
|
|
@@ -7632,7 +7629,7 @@ function qd({
|
|
|
7632
7629
|
a(!0, {
|
|
7633
7630
|
actor: "USER",
|
|
7634
7631
|
reason: "VOICE_SWITCH_TO_TEXT"
|
|
7635
|
-
}), await
|
|
7632
|
+
}), await h(), l(Ne.text);
|
|
7636
7633
|
};
|
|
7637
7634
|
return /* @__PURE__ */ A(
|
|
7638
7635
|
"div",
|
|
@@ -7671,7 +7668,7 @@ function qd({
|
|
|
7671
7668
|
"aria-label": i("controls.move"),
|
|
7672
7669
|
"data-lola-drag-handle": !0,
|
|
7673
7670
|
className: "chat-icon-button cursor-grab touch-none active:cursor-grabbing",
|
|
7674
|
-
children: /* @__PURE__ */ u("span", { className: "grid grid-cols-2 gap-[3px]", "aria-hidden": !0, children: Array.from({ length: 6 }, (
|
|
7671
|
+
children: /* @__PURE__ */ u("span", { className: "grid grid-cols-2 gap-[3px]", "aria-hidden": !0, children: Array.from({ length: 6 }, (b, y) => /* @__PURE__ */ u(
|
|
7675
7672
|
"span",
|
|
7676
7673
|
{
|
|
7677
7674
|
className: "h-1 w-1 rounded-full bg-current"
|
|
@@ -7685,7 +7682,7 @@ function qd({
|
|
|
7685
7682
|
zd,
|
|
7686
7683
|
{
|
|
7687
7684
|
conversationId: f,
|
|
7688
|
-
presentation:
|
|
7685
|
+
presentation: p
|
|
7689
7686
|
}
|
|
7690
7687
|
),
|
|
7691
7688
|
right: /* @__PURE__ */ A($e, { children: [
|
|
@@ -7774,12 +7771,12 @@ function Qd(e, t) {
|
|
|
7774
7771
|
n.getFullYear(),
|
|
7775
7772
|
n.getMonth(),
|
|
7776
7773
|
n.getDate()
|
|
7777
|
-
),
|
|
7774
|
+
), h = new Date(
|
|
7778
7775
|
r.getFullYear(),
|
|
7779
7776
|
r.getMonth(),
|
|
7780
7777
|
r.getDate()
|
|
7781
7778
|
), m = Math.round(
|
|
7782
|
-
(
|
|
7779
|
+
(h.getTime() - c.getTime()) / 864e5
|
|
7783
7780
|
);
|
|
7784
7781
|
return !l && m === 0 ? i ? new i(t, {
|
|
7785
7782
|
hour: "2-digit",
|
|
@@ -7844,15 +7841,15 @@ function tf({
|
|
|
7844
7841
|
const { direction: n, t: r } = Te(), o = bn(), a = pr(), i = C(null), l = Ms(), {
|
|
7845
7842
|
cancelConversationPagination: s,
|
|
7846
7843
|
createNewConversation: c,
|
|
7847
|
-
fetchMoreConversations:
|
|
7844
|
+
fetchMoreConversations: h,
|
|
7848
7845
|
setCurrentThread: m
|
|
7849
|
-
} = fr(), f = Ls(),
|
|
7846
|
+
} = fr(), f = Ls(), d = _s(), p = Ps(), b = Os(a.state) !== xt.Text ? Ne.voice : Ne.text;
|
|
7850
7847
|
function y() {
|
|
7851
7848
|
o(-1);
|
|
7852
7849
|
}
|
|
7853
7850
|
async function w() {
|
|
7854
7851
|
try {
|
|
7855
|
-
await c(), o(
|
|
7852
|
+
await c(), o(b);
|
|
7856
7853
|
} catch (L) {
|
|
7857
7854
|
console.error("Failed to create conversation", L);
|
|
7858
7855
|
}
|
|
@@ -7860,20 +7857,20 @@ function tf({
|
|
|
7860
7857
|
const x = R(
|
|
7861
7858
|
(L) => {
|
|
7862
7859
|
const k = m(L);
|
|
7863
|
-
o(
|
|
7860
|
+
o(b), k.catch((F) => {
|
|
7864
7861
|
console.error("Failed to select conversation", F);
|
|
7865
7862
|
});
|
|
7866
7863
|
},
|
|
7867
|
-
[
|
|
7864
|
+
[b, o, m]
|
|
7868
7865
|
), {
|
|
7869
7866
|
error: T,
|
|
7870
7867
|
loadMore: N,
|
|
7871
7868
|
sentinelRef: S
|
|
7872
7869
|
} = Va({
|
|
7873
7870
|
rootRef: i,
|
|
7874
|
-
enabled:
|
|
7875
|
-
isLoading:
|
|
7876
|
-
onLoad:
|
|
7871
|
+
enabled: d,
|
|
7872
|
+
isLoading: p,
|
|
7873
|
+
onLoad: h
|
|
7877
7874
|
});
|
|
7878
7875
|
return H(
|
|
7879
7876
|
() => () => {
|
|
@@ -7921,7 +7918,7 @@ function tf({
|
|
|
7921
7918
|
"div",
|
|
7922
7919
|
{
|
|
7923
7920
|
ref: i,
|
|
7924
|
-
"aria-busy":
|
|
7921
|
+
"aria-busy": p,
|
|
7925
7922
|
className: "chat-scrollbar flex flex-1 flex-col overflow-y-auto p-2",
|
|
7926
7923
|
children: [
|
|
7927
7924
|
f.map((L) => /* @__PURE__ */ u("div", { className: "chat-list-entry", children: /* @__PURE__ */ u(
|
|
@@ -7933,9 +7930,9 @@ function tf({
|
|
|
7933
7930
|
onSelect: x
|
|
7934
7931
|
}
|
|
7935
7932
|
) }, L.threadId)),
|
|
7936
|
-
|
|
7933
|
+
p && /* @__PURE__ */ u(Ed, {}),
|
|
7937
7934
|
/* @__PURE__ */ u("div", { ref: S, "aria-hidden": "true", className: "h-px shrink-0" }),
|
|
7938
|
-
|
|
7935
|
+
d && !p && /* @__PURE__ */ u(
|
|
7939
7936
|
ne,
|
|
7940
7937
|
{
|
|
7941
7938
|
type: "button",
|
|
@@ -8023,20 +8020,20 @@ function ff() {
|
|
|
8023
8020
|
const l = (s) => {
|
|
8024
8021
|
if (s.target !== s.currentTarget || !a) return;
|
|
8025
8022
|
const c = a.id;
|
|
8026
|
-
r((
|
|
8027
|
-
...
|
|
8028
|
-
transition:
|
|
8023
|
+
r((h) => ({
|
|
8024
|
+
...h,
|
|
8025
|
+
transition: h.transition?.id === c ? null : h.transition
|
|
8029
8026
|
}));
|
|
8030
8027
|
};
|
|
8031
8028
|
return /* @__PURE__ */ u("div", { className: "chat-route-stage relative z-5 h-full rounded-[inherit]", children: i.map((s) => {
|
|
8032
|
-
const c = s.key === a?.to.key,
|
|
8029
|
+
const c = s.key === a?.to.key, h = a ? a.direction === "forward" ? c : !c : !1, m = h && a ? `chat-route-pane chat-route-pane_${a.direction === "forward" ? "enter" : "exit"} chat-route-pane_${a.direction}` : "chat-route-page_background";
|
|
8033
8030
|
return /* @__PURE__ */ u(
|
|
8034
8031
|
"div",
|
|
8035
8032
|
{
|
|
8036
8033
|
className: `chat-route-page rounded-[inherit] ${m}`,
|
|
8037
8034
|
"aria-hidden": a ? !c : void 0,
|
|
8038
8035
|
inert: a && !c ? !0 : void 0,
|
|
8039
|
-
onAnimationEnd:
|
|
8036
|
+
onAnimationEnd: h ? l : void 0,
|
|
8040
8037
|
children: /* @__PURE__ */ u(nf, { location: s })
|
|
8041
8038
|
},
|
|
8042
8039
|
s.key
|