@alxxsck/ai-assistant 2.25.1 → 2.25.3

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.
@@ -1,4 +1,4 @@
1
- import { l as $s } from "./index-CmFVo5By.js";
1
+ import { l as $s } from "./index-DDvZeFFo.js";
2
2
  var Fr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3
3
  const Ul = "182", Hf = 0, bc = 1, Wf = 2, js = 1, Ku = 2, Gr = 3, di = 0, jt = 1, Zn = 2, $n = 0, ur = 1, Ac = 2, Ec = 3, wc = 4, Xf = 5, Ci = 100, qf = 101, Yf = 102, Kf = 103, Zf = 104, $f = 200, jf = 201, Jf = 202, Qf = 203, wo = 204, Ro = 205, ed = 206, td = 207, nd = 208, id = 209, rd = 210, sd = 211, ad = 212, od = 213, ld = 214, Co = 0, Po = 1, Io = 2, dr = 3, Do = 4, Lo = 5, Fo = 6, Uo = 7, xa = 0, cd = 1, ud = 2, Un = 0, Zu = 1, $u = 2, ju = 3, Ju = 4, Qu = 5, eh = 6, th = 7, Rc = "attached", hd = "detached", nh = 300, Oi = 301, pr = 302, aa = 303, No = 304, ya = 306, wt = 1e3, En = 1001, Oo = 1002, Lt = 1003, fd = 1004, Ss = 1005, kt = 1006, La = 1007, Ii = 1008, sn = 1009, ih = 1010, rh = 1011, ts = 1012, Nl = 1013, Bn = 1014, wn = 1015, Jn = 1016, Ol = 1017, Bl = 1018, ns = 1020, sh = 35902, ah = 35899, oh = 1021, lh = 1022, mn = 1023, Qn = 1026, Di = 1027, ch = 1028, kl = 1029, mr = 1030, Vl = 1031, zl = 1033, Js = 33776, Qs = 33777, ea = 33778, ta = 33779, Bo = 35840, ko = 35841, Vo = 35842, zo = 35843, Go = 36196, Ho = 37492, Wo = 37496, Xo = 37488, qo = 37489, Yo = 37490, Ko = 37491, Zo = 37808, $o = 37809, jo = 37810, Jo = 37811, Qo = 37812, el = 37813, tl = 37814, nl = 37815, il = 37816, rl = 37817, sl = 37818, al = 37819, ol = 37820, ll = 37821, cl = 36492, ul = 36494, hl = 36495, fl = 36283, dl = 36284, pl = 36285, ml = 36286, uh = 2200, dd = 2201, pd = 2202, oa = 2300, _l = 2301, Fa = 2302, sr = 2400, ar = 2401, la = 2402, Gl = 2500, md = 2501, _d = 3200, Sa = 0, gd = 1, ci = "", Ue = "srgb", _r = "srgb-linear", ca = "linear", nt = "srgb", Gi = 7680, Cc = 519, vd = 512, xd = 513, yd = 514, Hl = 515, Sd = 516, Md = 517, Wl = 518, Td = 519, Pc = 35044, Ic = "300 es", Fn = 2e3, ua = 2001;
4
4
  function hh(s) {
@@ -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-D5y3aEYe.js";
5
- import { o as Ds, L as Hs, a as Us } from "./index-CmFVo5By.js";
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-C7CMxso3.js";
5
+ import { o as Ds, L as Hs, a as Us } from "./index-DDvZeFFo.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) {
@@ -324,7 +324,7 @@ const Ws = (e, t) => {
324
324
  "left-bottom"
325
325
  ], N = () => [...T(), M, $], S = () => ["auto", "hidden", "clip", "visible", "scroll"], L = () => ["auto", "contain", "none"], k = () => [M, $, s], F = () => [yt, "full", "auto", ...k()], j = () => [Je, "none", "subgrid", M, $], P = () => ["auto", {
326
326
  span: ["full", Je, M, $]
327
- }, Je, M, $], me = () => [Je, "auto", M, $], oe = () => ["auto", "min", "max", "fr", M, $], B = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], re = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], te = () => ["auto", ...k()], ce = () => [yt, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...k()], _ = () => [e, M, $], ve = () => [...T(), jr, Ur, {
327
+ }, Je, M, $], fe = () => [Je, "auto", M, $], oe = () => ["auto", "min", "max", "fr", M, $], B = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], re = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], te = () => ["auto", ...k()], ce = () => [yt, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...k()], _ = () => [e, M, $], ve = () => [...T(), jr, Ur, {
328
328
  position: [M, $]
329
329
  }], se = () => ["no-repeat", {
330
330
  repeat: ["", "x", "y", "space", "round"]
@@ -664,14 +664,14 @@ const Ws = (e, t) => {
664
664
  * @see https://tailwindcss.com/docs/grid-column
665
665
  */
666
666
  "col-start": [{
667
- "col-start": me()
667
+ "col-start": fe()
668
668
  }],
669
669
  /**
670
670
  * Grid Column End
671
671
  * @see https://tailwindcss.com/docs/grid-column
672
672
  */
673
673
  "col-end": [{
674
- "col-end": me()
674
+ "col-end": fe()
675
675
  }],
676
676
  /**
677
677
  * Grid Template Rows
@@ -692,14 +692,14 @@ const Ws = (e, t) => {
692
692
  * @see https://tailwindcss.com/docs/grid-row
693
693
  */
694
694
  "row-start": [{
695
- "row-start": me()
695
+ "row-start": fe()
696
696
  }],
697
697
  /**
698
698
  * Grid Row End
699
699
  * @see https://tailwindcss.com/docs/grid-row
700
700
  */
701
701
  "row-end": [{
702
- "row-end": me()
702
+ "row-end": fe()
703
703
  }],
704
704
  /**
705
705
  * Grid Auto Flow
@@ -4583,7 +4583,7 @@ function Ca(e, t) {
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: p, enterTo: m, entered: f, leave: h, leaveFrom: d, leaveTo: g, ...v } = e, [y, w] = U(null), x = C(null), T = xa(e), N = Pe(...T ? [x, t, w] : t === null ? [] : [t]), S = (n = v.unmount) == null || n ? tt.Unmount : tt.Hidden, { show: L, appear: k, initial: F } = tu(), [j, P] = U(L ? "visible" : "hidden"), me = nu(), { register: oe, unregister: B } = me;
4586
+ let { transition: o = !0, beforeEnter: a, afterEnter: i, beforeLeave: l, afterLeave: s, enter: c, enterFrom: p, enterTo: m, entered: f, leave: h, leaveFrom: d, leaveTo: g, ...v } = e, [y, w] = U(null), x = C(null), T = xa(e), N = Pe(...T ? [x, t, w] : t === null ? [] : [t]), S = (n = v.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") {
@@ -4599,7 +4599,7 @@ function ru(e, t) {
4599
4599
  }, [x, j, re, T]);
4600
4600
  let te = F && !k, ce = k && L && F, _ = C(!1), ve = Ca(() => {
4601
4601
  _.current || (P("hidden"), B(x));
4602
- }, me), se = Y((Q) => {
4602
+ }, fe), se = Y((Q) => {
4603
4603
  _.current = !0;
4604
4604
  let Ae = Q ? "enter" : "leave";
4605
4605
  ve.onStart(x, Ae, (ye) => {
@@ -4674,8 +4674,8 @@ let ao = we(function(e, t) {
4674
4674
  let d = C(null), g = Pe(d, t), v = yr(d.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
4676
  return (O = w.panelRef.current) != null ? O : d.current;
4677
- } }, j = ba(), { resolveContainers: P } = Vc({ mainTreeNode: j, portals: L, defaultContainers: [F] }), me = h !== null ? (h & _e.Closing) === _e.Closing : !1;
4678
- tc(c || me ? !1 : S, { allowed: Y(() => {
4677
+ } }, j = ba(), { resolveContainers: P } = Vc({ mainTreeNode: j, portals: L, defaultContainers: [F] }), fe = h !== null ? (h & _e.Closing) === _e.Closing : !1;
4678
+ tc(c || fe ? !1 : S, { allowed: Y(() => {
4679
4679
  var O, K;
4680
4680
  return [(K = (O = d.current) == null ? void 0 : O.closest("[data-headlessui-portal]")) != null ? K : null];
4681
4681
  }), disallowed: Y(() => {
@@ -4691,7 +4691,7 @@ let ao = we(function(e, t) {
4691
4691
  O.preventDefault(), T();
4692
4692
  }), jc(B, v?.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 || me ? !1 : S, v, P), nc(S, d, T);
4694
+ }), yc(c || fe ? !1 : S, v, P), nc(S, d, T);
4695
4695
  let [re, te] = Ml(), ce = le(() => [{ dialogState: y, close: T, setTitleId: N, unmount: p }, w], [y, T, N, p, 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: p }, 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();
@@ -5525,12 +5525,12 @@ function pd({
5525
5525
  return;
5526
5526
  }
5527
5527
  f(P.url);
5528
- const me = Date.parse(P.expiresAt) - Date.now() - 5e3;
5528
+ const fe = Date.parse(P.expiresAt) - Date.now() - 5e3;
5529
5529
  F = window.setTimeout(
5530
5530
  () => {
5531
5531
  w((oe) => oe + 1);
5532
5532
  },
5533
- Math.max(0, Math.min(me, 2147e6))
5533
+ Math.max(0, Math.min(fe, 2147e6))
5534
5534
  );
5535
5535
  }), () => {
5536
5536
  k = !1, F !== void 0 && window.clearTimeout(F);
@@ -5612,7 +5612,7 @@ const hd = ho(function({
5612
5612
  const { t: l } = Te(), s = be(us), { scenarioChoiceSubmissionController: c } = dr(), { settleMessageStream: p } = fr(), m = ds(t), f = t.author.type === Le.Agent, h = fs(t.id), [d, g] = U(() => Date.now()), [v, y] = U(), [w, x] = U(() => ({
5613
5613
  active: !!(f && h),
5614
5614
  text: f && h ? "" : m
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, me = t.status === It.Failed, oe = t.status === It.Completed || me, B = le(() => ms(t), [t]), re = le(
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",
5618
5618
  inputRequestId: B?.inputRequestId ?? `none:${t.id}`
@@ -5634,12 +5634,12 @@ const hd = ho(function({
5634
5634
  ), ve = _.status, se = _.selectedOptionId ?? void 0, ae = !!(B && ps(B, d)), he = B?.inputRequestId ?? null, O = R(() => {
5635
5635
  he && L((G) => {
5636
5636
  if (G.has(he)) return G;
5637
- const de = new Set(G);
5638
- if (de.add(he), de.size > 64) {
5639
- const fe = de.values().next().value;
5640
- fe !== void 0 && de.delete(fe);
5637
+ const me = new Set(G);
5638
+ if (me.add(he), me.size > 64) {
5639
+ const de = me.values().next().value;
5640
+ de !== void 0 && me.delete(de);
5641
5641
  }
5642
- return de;
5642
+ return me;
5643
5643
  });
5644
5644
  }, [he]), K = P.role === "ADMIN" || P.role === "ASSISTANT" || P.role === "SCENARIO" || P.role === "SYSTEM" ? P.presentation ?? null : null, ue = P.role === "ASSISTANT" || P.role === "SCENARIO" ? "LOLA" : P.role === "SYSTEM" ? "SYSTEM" : P.role === "ADMIN" && (K?.presentationVersion || K?.legacyAvatarUrl) ? "HUMAN" : "SUPPORT", Oe = (K?.displayName === "Support" && K.avatarAsset === null && K.presentationVersion === null ? l("identity.support") : K?.displayName) ?? (P.role === "ADMIN" ? P.displayName : void 0) ?? (ue === "LOLA" ? "Lola" : l(ue === "SYSTEM" ? "identity.system" : "identity.support")), Q = le(
5645
5645
  () => P.role === "SCENARIO" ? {
@@ -5688,11 +5688,11 @@ const hd = ho(function({
5688
5688
  if (!B || B.lifecycle?.status !== "PENDING") return;
5689
5689
  const G = gs(B, Date.now());
5690
5690
  if (G === null || G <= 0) return;
5691
- const de = window.setTimeout(
5691
+ const me = window.setTimeout(
5692
5692
  () => g(Date.now()),
5693
5693
  Math.min(G + 1, 2147483647)
5694
5694
  );
5695
- return () => window.clearTimeout(de);
5695
+ return () => window.clearTimeout(me);
5696
5696
  }, [B, d]), H(() => {
5697
5697
  B?.lifecycle && c.handleLifecycle(
5698
5698
  re,
@@ -5723,7 +5723,7 @@ const hd = ho(function({
5723
5723
  c
5724
5724
  ]
5725
5725
  );
5726
- return me ? null : /* @__PURE__ */ A(
5726
+ return fe ? null : /* @__PURE__ */ A(
5727
5727
  "div",
5728
5728
  {
5729
5729
  ref: Re,
@@ -5798,18 +5798,18 @@ const hd = ho(function({
5798
5798
  "div",
5799
5799
  {
5800
5800
  ref: N,
5801
- className: "flex flex-wrap gap-2 self-start",
5801
+ className: "flex flex-wrap gap-[10px] self-start",
5802
5802
  role: "group",
5803
5803
  "aria-label": l("chat.chooseAnswer"),
5804
5804
  children: [
5805
5805
  B.options.map((G) => {
5806
- const de = se === G.id, fe = ve === "submitting" || !!(se && !de), Xe = j && G.attention === "NUDGE_ONCE" && !fe && !S.has(B.inputRequestId);
5806
+ const me = se === G.id, de = ve === "submitting", Xe = j && G.attention === "NUDGE_ONCE" && !de && !S.has(B.inputRequestId);
5807
5807
  return /* @__PURE__ */ u(
5808
5808
  ne,
5809
5809
  {
5810
5810
  type: "button",
5811
- disabled: fe,
5812
- "aria-pressed": de,
5811
+ disabled: de,
5812
+ "aria-pressed": me,
5813
5813
  "data-presentation": G.presentation,
5814
5814
  "data-attention": Xe ? "NUDGE_ONCE" : "NONE",
5815
5815
  onClick: () => {
@@ -5818,7 +5818,7 @@ const hd = ho(function({
5818
5818
  className: J(
5819
5819
  "chat-choice-option",
5820
5820
  Xe && "chat-attention-nudge-once",
5821
- de && "chat-choice-option--selected"
5821
+ me && "chat-choice-option--selected"
5822
5822
  ),
5823
5823
  children: G.label
5824
5824
  },
@@ -6728,12 +6728,12 @@ function Dd() {
6728
6728
  ), P = R(
6729
6729
  (b) => j(c, b),
6730
6730
  [c, j]
6731
- ), me = 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), {
6731
+ ), 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
6732
  cancelThreadMessagesRequest: Oe,
6733
6733
  fetchOlderThreadMessages: Q,
6734
6734
  sendMessage: Ae,
6735
6735
  setLatestReadMessageDate: ye
6736
- } = fr(), Re = vs(), ge = bs(), Ze = ws(), Nt = ys(), je = xs(), kt = Cs(), At = Es("ASSISTANT"), Zt = wo(), G = yo(), de = Ts(), fe = Ns(), { networkStatus: Xe, anycableService: Mn, endUserTypingClient: Fe } = dr(), Ie = i.attachments?.enabled !== !1 && G.contractState === "CURRENT" && G.humanSupport === "ASSIGNED", gt = Vn(
6736
+ } = fr(), Re = vs(), ge = bs(), Ze = ws(), Nt = ys(), je = xs(), kt = Cs(), At = Es("ASSISTANT"), Zt = wo(), G = yo(), me = Ts(), de = Ns(), { networkStatus: Xe, anycableService: Mn, endUserTypingClient: Fe } = dr(), Ie = i.attachments?.enabled !== !1 && G.contractState === "CURRENT" && G.humanSupport === "ASSIGNED", gt = Vn(
6737
6737
  i.attachments?.maxFiles,
6738
6738
  uo,
6739
6739
  uo
@@ -6768,17 +6768,17 @@ function Dd() {
6768
6768
  };
6769
6769
  }, [n]);
6770
6770
  const Sr = le(() => {
6771
- const b = fe.map((E) => ({
6771
+ const b = de.map((E) => ({
6772
6772
  type: "canonical",
6773
6773
  message: E
6774
6774
  }));
6775
- if (de) {
6776
- const E = de.afterMessageId ? fe.findIndex(
6777
- ({ id: D }) => D === de.afterMessageId
6778
- ) : -1, W = de.afterMessageId ? E >= 0 ? E + 1 : b.length : 0;
6775
+ if (me) {
6776
+ const E = me.afterMessageId ? de.findIndex(
6777
+ ({ id: D }) => D === me.afterMessageId
6778
+ ) : -1, W = me.afterMessageId ? E >= 0 ? E + 1 : b.length : 0;
6779
6779
  b.splice(W, 0, {
6780
6780
  type: "optimistic",
6781
- message: de
6781
+ message: me
6782
6782
  });
6783
6783
  }
6784
6784
  if (o) {
@@ -6791,18 +6791,18 @@ function Dd() {
6791
6791
  });
6792
6792
  }
6793
6793
  return b;
6794
- }, [o, a, de, fe]), _n = Ze && Sr.length === 0, Wa = bd({
6794
+ }, [o, a, me, de]), _n = Ze && Sr.length === 0, Wa = bd({
6795
6795
  containerRef: ce,
6796
6796
  contentRef: _,
6797
- firstMessageId: fe[0]?.id,
6798
- messageCount: fe.length + +!!de + Number(Ar) + +!!o,
6797
+ firstMessageId: de[0]?.id,
6798
+ messageCount: de.length + +!!me + Number(Ar) + +!!o,
6799
6799
  threadId: c
6800
6800
  }), { captureAnchor: $r, clearAnchor: Mr } = Nd({
6801
6801
  containerRef: ce,
6802
6802
  contextId: c,
6803
- firstItemId: fe[0]?.id,
6803
+ firstItemId: de[0]?.id,
6804
6804
  isLoading: je,
6805
- itemCount: fe.length
6805
+ itemCount: de.length
6806
6806
  }), Ka = R(async () => {
6807
6807
  if (c) {
6808
6808
  $r();
@@ -6855,18 +6855,18 @@ function Dd() {
6855
6855
  },
6856
6856
  [Oe, c]
6857
6857
  ), H(() => {
6858
- if (r && fe.length > 0) {
6859
- const b = fe.findLast(
6858
+ if (r && de.length > 0) {
6859
+ const b = de.findLast(
6860
6860
  (E) => E.author.type === Le.Customer || E.status === It.Completed || E.status === It.Failed
6861
6861
  );
6862
6862
  b && ye(b.updatedAt);
6863
6863
  }
6864
- }, [fe, r, ye]), H(() => {
6864
+ }, [de, r, ye]), H(() => {
6865
6865
  if (!(!r || !Mn))
6866
- for (const b of fe)
6866
+ for (const b of de)
6867
6867
  !b.delivery || b.delivery.status === "READ" || ve.current.has(b.id) || (ve.current.add(b.id), Mn.acknowledgeMessageDelivery({ messageId: b.id, status: "read" }).catch(() => ve.current.delete(b.id)));
6868
- }, [Mn, r, fe]);
6869
- const _r = le(() => Re ? ks(Re, t) : fe.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, fe]), Pr = R(
6868
+ }, [Mn, r, de]);
6869
+ 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
6870
  (b, E, W) => {
6871
6871
  se.current.get(E)?.abort();
6872
6872
  const D = new AbortController();
@@ -7037,7 +7037,7 @@ function Dd() {
7037
7037
  );
7038
7038
  if (!E || kt || !Ie && F.length > 0 || F.some(({ state: ie }) => ie !== "ready"))
7039
7039
  return;
7040
- Fe?.stop(), te.current !== null && (window.clearTimeout(te.current), te.current = null), h(""), me.current && (me.current.style.height = "auto");
7040
+ Fe?.stop(), te.current !== null && (window.clearTimeout(te.current), te.current = null), h(""), fe.current && (fe.current.style.height = "auto");
7041
7041
  const D = F.map(({ id: ie }) => ie), q = new Set(D);
7042
7042
  D.forEach(
7043
7043
  (ie) => O.current.add(ie)
@@ -7347,7 +7347,7 @@ function Dd() {
7347
7347
  /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center", children: /* @__PURE__ */ u(
7348
7348
  Tu,
7349
7349
  {
7350
- ref: me,
7350
+ ref: fe,
7351
7351
  value: f,
7352
7352
  rows: 1,
7353
7353
  "aria-label": t("chat.messageLabel"),
@@ -1,4 +1,4 @@
1
- import { C as A, E as e, S as s, d as E, c } from "./index-CmFVo5By.js";
1
+ import { C as A, E as e, S as s, d as E, c } from "./index-DDvZeFFo.js";
2
2
  export {
3
3
  A as ChatWidgetInstance,
4
4
  e as EXTERNALLY_AVAILABLE_ACTIONS,
@@ -35,6 +35,7 @@ export declare class ScenarioChoiceSubmissionController {
35
35
  setTransport(submitChoice: ScenarioChoiceTransport): void;
36
36
  subscribe(key: ScenarioChoiceSubmissionKey, listener: () => void): () => void;
37
37
  submit(request: ScenarioChoiceSubmissionRequest): Promise<void>;
38
+ private startSubmissionWithNewIdentity;
38
39
  handleLifecycle(key: ScenarioChoiceSubmissionKey, lifecycle: ScenarioChoiceLifecycle): void;
39
40
  handleResult(principalId: string, result: ScenarioChoiceSubmissionResult): void;
40
41
  reset(): void;