@alxxsck/ai-assistant 2.21.0 → 2.22.1

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 { a0 as $s } from "./index-o7DbTuwa.js";
1
+ import { a0 as $s } from "./index-BfKJbXZ9.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,7 +1,7 @@
1
1
  import { jsxs as N, jsx as c, Fragment as Ge } from "react/jsx-runtime";
2
2
  import * as q from "react";
3
3
  import ue, { useRef as S, useCallback as R, useEffect as D, useState as j, useMemo as he, useLayoutEffect as De, useContext as ye, createContext as He, forwardRef as Zt, Fragment as wt, isValidElement as Fr, cloneElement as Pr, createElement as yt, useId as Xt, useSyncExternalStore as _r, memo as Ln } from "react";
4
- import { P as we, o as Or, u as be, a as dt, b as Tt, c as Qt, d as Rn, e as Ve, C as pe, N as nt, f as rt, V as Dr, g as In, h as Hr, l as Fn, S as jr, i as Jt, m as zr, j as Vr, k as en, n as Br, M as ot, p as Ur, q as Gr, r as Wr, s as Kr, t as qr, v as Yr, w as Zr, x as Xr, y as Qr, z as Jr, A as eo, B as Pn, D as to, E as no, F as ro, G as oo, H as tn, I as ao, J as so, K as io, L as We, O as lo, Q as co, R as uo, T as fo, U as mo, W as po, X as ho, Y as go, Z as vo, _ as et, $ as Pt } from "./index-o7DbTuwa.js";
4
+ import { P as we, o as Or, u as be, a as dt, b as Tt, c as Qt, d as Rn, e as Ve, C as pe, N as nt, f as rt, V as Dr, g as In, h as Hr, l as Fn, S as jr, i as Jt, m as zr, j as Vr, k as en, n as Br, M as ot, p as Ur, q as Gr, r as Wr, s as Kr, t as qr, v as Yr, w as Zr, x as Xr, y as Qr, z as Jr, A as eo, B as Pn, D as to, E as no, F as ro, G as oo, H as tn, I as ao, J as so, K as io, L as We, O as lo, Q as co, R as uo, T as fo, U as mo, W as po, X as ho, Y as go, Z as vo, _ as et, $ as Pt } from "./index-BfKJbXZ9.js";
5
5
  const bo = (e) => /* @__PURE__ */ q.createElement("svg", { width: 15, height: 22, viewBox: "0 0 15 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ q.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" })), wo = (e) => /* @__PURE__ */ q.createElement("svg", { width: 17, height: 22, viewBox: "0 0 17 22", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ q.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" })), yo = (e) => /* @__PURE__ */ q.createElement("svg", { width: 19, height: 17, viewBox: "0 0 19 17", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ q.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" }));
6
6
  function _n(e) {
7
7
  var t, n, r = "";
@@ -1,4 +1,4 @@
1
- import { a1 as A, a2 as e, a4 as s, F as n, a3 as r } from "./index-o7DbTuwa.js";
1
+ import { a1 as A, a2 as e, a4 as s, F as n, a3 as r } from "./index-BfKJbXZ9.js";
2
2
  export {
3
3
  A as ChatWidgetInstance,
4
4
  e as EXTERNALLY_AVAILABLE_ACTIONS,
@@ -38,6 +38,7 @@ export declare class ScenarioInteractionCollector {
38
38
  private capabilityRetryAttempt;
39
39
  private batchRetriesSuspended;
40
40
  private capabilityRetriesSuspended;
41
+ private nextUserRecoveryProbeAt;
41
42
  private awaitingRenewalToken;
42
43
  private sessionGeneration;
43
44
  private quotaBlockedUntil;
@@ -47,6 +48,7 @@ export declare class ScenarioInteractionCollector {
47
48
  private destroyed;
48
49
  private principalSessionId;
49
50
  private principalAccessToken;
51
+ private principalExpiresAt;
50
52
  constructor(getSession: () => CustomerInteractionSession, onSessionExpired: () => void, options?: CollectorOptions);
51
53
  start(): void;
52
54
  destroy(): void;
@@ -59,6 +61,8 @@ export declare class ScenarioInteractionCollector {
59
61
  keepalive?: boolean;
60
62
  }): Promise<void>;
61
63
  private readonly onOnlineOrFocus;
64
+ private resumeAfterStrongSignal;
65
+ private probeAfterUserObservation;
62
66
  private readonly onVisibilityChange;
63
67
  private readonly onPageHide;
64
68
  private buildObservation;
@@ -81,6 +85,9 @@ export declare class ScenarioInteractionCollector {
81
85
  private scheduleCapabilityRetry;
82
86
  private clearFlushTimer;
83
87
  private clearTimers;
88
+ private resetRecoveryState;
89
+ private resetBatchRecoveryState;
90
+ private resetCapabilityRecoveryState;
84
91
  private clearRetryTimer;
85
92
  private clearCapabilityRetryTimer;
86
93
  private retryDelay;
@@ -951,7 +951,7 @@ function Xc({
951
951
  }
952
952
  );
953
953
  }
954
- function K1({
954
+ function J1({
955
955
  to: t,
956
956
  replace: e,
957
957
  state: n,
@@ -1043,7 +1043,7 @@ function Zc({
1043
1043
  `<Router basename="${a}"> is not able to match the URL "${c}${l}${d}" because it does not start with the basename, so the <Router> won't render anything.`
1044
1044
  ), g == null ? null : /* @__PURE__ */ E.createElement(Pe.Provider, { value: u }, /* @__PURE__ */ E.createElement(Ln.Provider, { children: e, value: g }));
1045
1045
  }
1046
- function Y1({
1046
+ function Q1({
1047
1047
  children: t,
1048
1048
  location: e
1049
1049
  }) {
@@ -3285,7 +3285,7 @@ const lt = {
3285
3285
  agentResponseFailed: "error.agentResponseFailed",
3286
3286
  sendMessageFallback: "error.sendMessageFailed",
3287
3287
  conversationClosed: "error.conversationClosed"
3288
- }, ud = new Set(Object.values(lt)), $1 = (t, e) => ud.has(t) ? e(t) : t, ey = {
3288
+ }, ud = new Set(Object.values(lt)), ty = (t, e) => ud.has(t) ? e(t) : t, ny = {
3289
3289
  audio_playback_failed: "voice.audioPlaybackFailed",
3290
3290
  session_failed: "voice.sessionFailed",
3291
3291
  connection_closed: "voice.connectionClosed",
@@ -3293,9 +3293,9 @@ const lt = {
3293
3293
  microphone_blocked: "voice.microphoneBlocked",
3294
3294
  microphone_unsupported: "voice.microphoneUnsupported"
3295
3295
  }, fa = (t) => t.replace(/\/$/, ""), Ne = fa(
3296
- "https://api.retenive.com/api/v1"
3297
- ), cd = "wss://api.retenive.com/cable", ld = fa(
3298
- "https://metamediastatic.com"
3296
+ "http://localhost:3000/api/v1"
3297
+ ), cd = "wss://example.test/cable", ld = fa(
3298
+ "https://assets.example.test"
3299
3299
  ), dd = (t) => {
3300
3300
  const e = new URL(cd);
3301
3301
  return e.searchParams.set("access_token", t), e.toString();
@@ -7136,7 +7136,7 @@ function $a(t) {
7136
7136
  return e && t.type && zf.has(t.type) ? `${e}
7137
7137
  ` : e;
7138
7138
  }
7139
- function ty(t, e = 60) {
7139
+ function ry(t, e = 60) {
7140
7140
  const n = ns(t);
7141
7141
  if (!n) return "";
7142
7142
  const i = ("text" in n && typeof n.text == "string" ? n.text : Qa(n)).replace(/\s+/g, " ").trim();
@@ -7158,7 +7158,7 @@ function Vf(t) {
7158
7158
  const e = ns(t);
7159
7159
  return e ? "text" in e && typeof e.text == "string" ? e.text : $a(e).trimEnd() : "";
7160
7160
  }
7161
- function ny(t) {
7161
+ function iy(t) {
7162
7162
  const e = ns(t);
7163
7163
  return e ? "text" in e && typeof e.text == "string" ? Nf(e.text) : Pf(e) : "";
7164
7164
  }
@@ -9785,17 +9785,17 @@ const re = /* @__PURE__ */ new Map(), Ie = /* @__PURE__ */ new Map(), le = /* @_
9785
9785
  G.subscribe((t, e) => {
9786
9786
  t.conversations !== e.conversations && Ai(t.conversations);
9787
9787
  });
9788
- const ry = () => G((t) => t.currentThreadId), np = () => G((t) => t.currentThreadMessages), iy = () => G((t) => t.threadsPreviews), sy = () => G((t) => !!t.conversationsNextCursor), oy = () => G((t) => t.isLoadingMoreConversations), rp = () => G((t) => t.currentThreadId), ay = () => G((t) => t.currentThreadId ? t.conversations.find(({ id: e }) => e === t.currentThreadId)?.responderPresentation ?? pr : pr), uy = () => G(
9788
+ const sy = () => G((t) => t.currentThreadId), np = () => G((t) => t.currentThreadMessages), oy = () => G((t) => t.threadsPreviews), ay = () => G((t) => !!t.conversationsNextCursor), uy = () => G((t) => t.isLoadingMoreConversations), rp = () => G((t) => t.currentThreadId), cy = () => G((t) => t.currentThreadId ? t.conversations.find(({ id: e }) => e === t.currentThreadId)?.responderPresentation ?? pr : pr), ly = () => G(
9789
9789
  (t) => t.currentThreadId ? !t.refreshingThreadIds.has(t.currentThreadId) && !!t.threadMessagesNextCursor.get(t.currentThreadId) : !1
9790
- ), cy = () => G(
9790
+ ), dy = () => G(
9791
9791
  (t) => t.currentThreadId ? t.loadingOlderThreadIds.has(t.currentThreadId) : !1
9792
- ), ip = () => G((t) => t.latestReadMessageDate), sp = () => G((t) => t.latestMessageDate), op = () => G((t) => t.conversationNavigationRequest), ly = (t) => G(
9792
+ ), ip = () => G((t) => t.latestReadMessageDate), sp = () => G((t) => t.latestMessageDate), op = () => G((t) => t.conversationNavigationRequest), hy = (t) => G(
9793
9793
  (e) => t ? e.scenarioChoiceSubmissionResults.get(t) : void 0
9794
- ), dy = () => G((t) => t.sendError), ap = (t) => !!(t.currentThreadId && !t.loadedThreadIds.has(t.currentThreadId)), hy = () => G(ap), fy = () => G((t) => t.responsePhase === "awaiting-first-token"), py = () => G(
9794
+ ), fy = () => G((t) => t.sendError), ap = (t) => !!(t.currentThreadId && !t.loadedThreadIds.has(t.currentThreadId)), py = () => G(ap), gy = () => G((t) => t.responsePhase === "awaiting-first-token"), my = () => G(
9795
9795
  (t) => t.sendInFlight || t.responsePhase !== "idle" || !!(t.pendingCustomerMessage && (t.pendingCustomerMessage.acceptanceConfirmed !== !0 || !t.pendingCustomerMessage.conversationId))
9796
- ), up = (t) => t.pendingCustomerMessage?.conversationId === t.currentThreadId ? t.pendingCustomerMessage : null, gy = () => G(up), my = (t) => G((e) => e.messageStreams.get(t)), cp = (t, e) => t.currentThreadId ? t.typingByConversation.get(
9796
+ ), up = (t) => t.pendingCustomerMessage?.conversationId === t.currentThreadId ? t.pendingCustomerMessage : null, by = () => G(up), yy = (t) => G((e) => e.messageStreams.get(t)), cp = (t, e) => t.currentThreadId ? t.typingByConversation.get(
9797
9797
  eu(t.currentThreadId, e)
9798
- ) ?? null : null, by = (t) => G((e) => cp(e, t)), lp = (t) => {
9798
+ ) ?? null : null, wy = (t) => G((e) => cp(e, t)), lp = (t) => {
9799
9799
  if (!t.currentThreadId) return !1;
9800
9800
  if (t.assistantSuspendedConversationIds.has(t.currentThreadId))
9801
9801
  return !0;
@@ -10039,7 +10039,7 @@ const Ti = (t) => !!t && typeof t == "object" && !Array.isArray(t), Dp = (t) =>
10039
10039
  } catch {
10040
10040
  return `mock://attachment/${encodeURIComponent(t.name)}`;
10041
10041
  }
10042
- }, yy = () => ({
10042
+ }, Cy = () => ({
10043
10043
  async upload({ file: t, signal: e, onProgress: n }) {
10044
10044
  if (e?.aborted) throw new DOMException("Upload aborted", "AbortError");
10045
10045
  if (n?.(0), await Promise.resolve(), e?.aborted) throw new DOMException("Upload aborted", "AbortError");
@@ -12564,13 +12564,13 @@ const qe = {
12564
12564
  voice: "/chat/voice",
12565
12565
  text: "/chat/text"
12566
12566
  };
12567
- function Cy(t) {
12567
+ function Iy(t) {
12568
12568
  if (!t || typeof t != "object" || !("chatMode" in t))
12569
12569
  return null;
12570
12570
  const { chatMode: e } = t;
12571
12571
  return e === "text" || e === "voice" ? e : null;
12572
12572
  }
12573
- function vy(t) {
12573
+ function xy(t) {
12574
12574
  return ls(t) ? "text" : "voice";
12575
12575
  }
12576
12576
  function Ni(t) {
@@ -12582,10 +12582,10 @@ function ls(t) {
12582
12582
  function mo(t) {
12583
12583
  return t === qe.voice || t.endsWith(qe.voice) || ls(t);
12584
12584
  }
12585
- function Iy(t, e) {
12585
+ function Ay(t, e) {
12586
12586
  return mo(t) && Ni(e) ? "forward" : Ni(t) && mo(e) ? "backward" : null;
12587
12587
  }
12588
- function xy(t) {
12588
+ function ky(t) {
12589
12589
  return t === qe.voice || t.endsWith(qe.voice);
12590
12590
  }
12591
12591
  function Xg(t) {
@@ -14107,7 +14107,7 @@ const Lm = (t) => {
14107
14107
  }
14108
14108
  }
14109
14109
  };
14110
- }), Ay = () => dr((t) => t.actions);
14110
+ }), Sy = () => dr((t) => t.actions);
14111
14111
  class Ru extends Error {
14112
14112
  constructor(e, n) {
14113
14113
  super(n), this.status = e;
@@ -16189,7 +16189,7 @@ function mb() {
16189
16189
  });
16190
16190
  let k = null;
16191
16191
  const N = r.onAvatarLoadStarted();
16192
- return import("./Avatar-CI9_caGl.js").then(({ Avatar: F }) => {
16192
+ return import("./Avatar-DnSBkCvm.js").then(({ Avatar: F }) => {
16193
16193
  if (C) return;
16194
16194
  const M = {
16195
16195
  ...r,
@@ -16458,7 +16458,7 @@ class vb {
16458
16458
  ].join(":");
16459
16459
  }
16460
16460
  }
16461
- const bs = en(null), ky = () => Nn(bs)?.resolver ?? null, Sy = (t) => {
16461
+ const bs = en(null), Ey = () => Nn(bs)?.resolver ?? null, Ty = (t) => {
16462
16462
  const e = Nn(
16463
16463
  bs
16464
16464
  )?.authorizedConversationIds;
@@ -16497,7 +16497,7 @@ function Ib({
16497
16497
  a.current = c;
16498
16498
  }, [r, s]), $(() => () => s.destroy(), [s]), /* @__PURE__ */ j(bs.Provider, { value: u, children: t });
16499
16499
  }
16500
- const xb = Ku(() => import("./ChatWidgetContent-CBWyqiVF.js")), bn = (t) => {
16500
+ const xb = Ku(() => import("./ChatWidgetContent-IP-jCwoB.js")), bn = (t) => {
16501
16501
  t.catch(
16502
16502
  (e) => console.warn("[ChatWidget] Message history recovery failed", e)
16503
16503
  );
@@ -17765,12 +17765,20 @@ const qu = 1, g1 = [
17765
17765
  "HOST_SET_OPEN",
17766
17766
  "SCENARIO_COMMAND",
17767
17767
  "UNKNOWN"
17768
- ], v1 = "/scenario-interactions/capabilities", I1 = "/scenario-interactions/batch", x1 = 160, A1 = 16, k1 = 1500, S1 = 1e4, E1 = 60 * 1024, T1 = 2147483647, Po = 60 * 6e4, R1 = 100, rr = [1e3, 2e3, 5e3, 1e4, 3e4], M1 = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, Uu = new Set(g1), Hu = new Set(m1), Wu = new Set(b1), _1 = new Set(y1), D1 = new Set(w1), F1 = new Set(C1), N1 = /* @__PURE__ */ new Set([
17768
+ ], v1 = "/scenario-interactions/capabilities", I1 = "/scenario-interactions/batch", x1 = 160, A1 = 16, k1 = 1500, S1 = 1e4, E1 = 60 * 1024, T1 = 2147483647, Po = 60 * 6e4, R1 = 100, rr = [1e3, 2e3, 5e3, 1e4, 3e4], M1 = 3e4, _1 = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, Uu = new Set(g1), Hu = new Set(m1), Wu = new Set(b1), D1 = new Set(y1), F1 = new Set(w1), N1 = new Set(C1), L1 = /* @__PURE__ */ new Set([
17769
17769
  "ACCEPTED",
17770
17770
  "DUPLICATE",
17771
17771
  "IGNORED_NO_INTEREST",
17772
17772
  "REJECTED"
17773
- ]), L1 = (t) => new TextEncoder().encode(t).length, Oo = (t) => t === 408 || t === 425 || t === 429 || t >= 500, P1 = (t) => {
17773
+ ]), P1 = (t) => {
17774
+ if (t) return t;
17775
+ const e = globalThis.fetch;
17776
+ if (typeof e != "function")
17777
+ throw new Error(
17778
+ "Scenario interaction collection requires a global or injected fetch"
17779
+ );
17780
+ return e.bind(globalThis);
17781
+ }, O1 = (t) => new TextEncoder().encode(t).length, Oo = (t) => t === 408 || t === 425 || t === 429 || t >= 500, z1 = (t) => {
17774
17782
  if (!t || typeof t != "object" || Array.isArray(t)) return null;
17775
17783
  const e = t;
17776
17784
  return e.version !== qu || !Number.isSafeInteger(e.maxBatchItems) || e.maxBatchItems < 1 || !Number.isSafeInteger(e.maxRequestBytes) || e.maxRequestBytes < 1 || !Number.isSafeInteger(e.sessionHourlyLimit) || e.sessionHourlyLimit < 1 || !Number.isSafeInteger(e.retentionDays) || e.retentionDays < 1 || !Array.isArray(e.kinds) || !e.kinds.every((n) => typeof n == "string") || !Array.isArray(e.types) || !e.types.every((n) => typeof n == "string") || !Array.isArray(e.actors) || !e.actors.every((n) => typeof n == "string") || typeof e.attributionHandleSupported != "boolean" ? null : {
@@ -17784,23 +17792,23 @@ const qu = 1, g1 = [
17784
17792
  actors: e.actors.filter((n) => Wu.has(n)),
17785
17793
  attributionHandleSupported: e.attributionHandleSupported
17786
17794
  };
17787
- }, O1 = (t) => {
17795
+ }, V1 = (t) => {
17788
17796
  if (!t || typeof t != "object" || Array.isArray(t)) return null;
17789
17797
  const e = t.receipts;
17790
17798
  if (!Array.isArray(e)) return null;
17791
17799
  for (const n of e)
17792
- if (!n || typeof n != "object" || typeof n.clientObservationId != "string" || !n.clientObservationId.length || n.clientObservationId.length > 128 || !N1.has(n.status))
17800
+ if (!n || typeof n != "object" || typeof n.clientObservationId != "string" || !n.clientObservationId.length || n.clientObservationId.length > 128 || !L1.has(n.status))
17793
17801
  return null;
17794
17802
  return e;
17795
17803
  };
17796
- class z1 {
17804
+ class B1 {
17797
17805
  constructor(e, n, r = {}) {
17798
17806
  this.getSession = e, this.onSessionExpired = n, this.baseUrl = r.baseUrl ?? Ne, this.queueLimit = r.queueLimit ?? x1, this.batchLimit = r.batchLimit ?? A1, this.flushIntervalMs = r.flushIntervalMs ?? k1, this.requestTimeoutMs = Math.max(
17799
17807
  1,
17800
17808
  r.requestTimeoutMs ?? S1
17801
- ), this.fetchImpl = r.fetch ?? fetch, this.createId = r.createId ?? (() => crypto.randomUUID()), this.now = r.now ?? Date.now, this.random = r.random ?? Math.random;
17809
+ ), this.fetchImpl = P1(r.fetch), this.createId = r.createId ?? (() => crypto.randomUUID()), this.now = r.now ?? Date.now, this.random = r.random ?? Math.random;
17802
17810
  const i = e();
17803
- this.principalSessionId = i.interactionSessionId, this.principalAccessToken = i.accessToken, this.admissionWindowStartedAt = this.now();
17811
+ this.principalSessionId = i.interactionSessionId, this.principalAccessToken = i.accessToken, this.principalExpiresAt = i.expiresAt, this.admissionWindowStartedAt = this.now();
17804
17812
  }
17805
17813
  queue = [];
17806
17814
  baseUrl;
@@ -17826,6 +17834,7 @@ class z1 {
17826
17834
  capabilityRetryAttempt = 0;
17827
17835
  batchRetriesSuspended = !1;
17828
17836
  capabilityRetriesSuspended = !1;
17837
+ nextUserRecoveryProbeAt = 0;
17829
17838
  awaitingRenewalToken = null;
17830
17839
  sessionGeneration = 0;
17831
17840
  quotaBlockedUntil = 0;
@@ -17835,6 +17844,7 @@ class z1 {
17835
17844
  destroyed = !1;
17836
17845
  principalSessionId;
17837
17846
  principalAccessToken;
17847
+ principalExpiresAt;
17838
17848
  start() {
17839
17849
  this.started || this.destroyed || (this.started = !0, window.addEventListener("online", this.onOnlineOrFocus), window.addEventListener("focus", this.onOnlineOrFocus), window.addEventListener("pagehide", this.onPageHide), document.addEventListener("visibilitychange", this.onVisibilityChange), this.ensureCapabilities());
17840
17850
  }
@@ -17843,12 +17853,13 @@ class z1 {
17843
17853
  }
17844
17854
  updateSession(e) {
17845
17855
  if (e.interactionSessionId !== this.principalSessionId)
17846
- return this.principalSessionId = e.interactionSessionId, this.principalAccessToken = e.accessToken, this.queue.length = 0, this.sequence = 0, this.capabilities = void 0, this.sessionGeneration += 1, this.abortPendingRequests(), this.awaitingRenewalToken = null, this.retryAttempt = 0, this.capabilityRetryAttempt = 0, this.batchRetriesSuspended = !1, this.capabilityRetriesSuspended = !1, this.quotaBlockedUntil = 0, this.admissionWindowStartedAt = this.now(), this.admissionCount = 0, this.clearTimers(), this.started && this.ensureCapabilities(), !0;
17856
+ return this.principalSessionId = e.interactionSessionId, this.principalAccessToken = e.accessToken, this.principalExpiresAt = e.expiresAt, this.queue.length = 0, this.sequence = 0, this.capabilities = void 0, this.sessionGeneration += 1, this.abortPendingRequests(), this.awaitingRenewalToken = null, this.resetRecoveryState(), this.quotaBlockedUntil = 0, this.admissionWindowStartedAt = this.now(), this.admissionCount = 0, this.clearFlushTimer(), this.started && this.ensureCapabilities(), !0;
17847
17857
  if (e.accessToken !== this.principalAccessToken) {
17848
- const r = this.capabilities;
17849
- return this.principalAccessToken = e.accessToken, this.sessionGeneration += 1, this.abortPendingRequests(), this.awaitingRenewalToken = null, this.retryAttempt = 0, this.capabilityRetryAttempt = 0, this.batchRetriesSuspended = !1, this.capabilityRetriesSuspended = !1, this.clearTimers(), r ? (this.capabilities = r, this.started && this.scheduleFlush(0)) : (this.capabilities = void 0, this.started && this.ensureCapabilities()), !1;
17858
+ const o = this.capabilities;
17859
+ return this.principalAccessToken = e.accessToken, this.principalExpiresAt = e.expiresAt, this.sessionGeneration += 1, this.abortPendingRequests(), this.awaitingRenewalToken = null, this.resetRecoveryState(), this.clearFlushTimer(), o ? (this.capabilities = o, this.started && this.scheduleFlush(0)) : (this.capabilities = void 0, this.started && this.ensureCapabilities()), !1;
17850
17860
  }
17851
- return this.awaitingRenewalToken && (e.accessToken !== this.awaitingRenewalToken || Date.parse(e.expiresAt) > this.now()) && (this.awaitingRenewalToken = null, this.retryAttempt = 0, this.capabilities ? this.scheduleFlush(0) : this.ensureCapabilities()), !1;
17861
+ const r = Date.parse(this.principalExpiresAt), i = Date.parse(e.expiresAt), s = i > r;
17862
+ return this.principalExpiresAt = e.expiresAt, this.awaitingRenewalToken && (e.accessToken !== this.awaitingRenewalToken || i > this.now()) && (this.awaitingRenewalToken = null, this.retryAttempt = 0, this.capabilities ? this.scheduleFlush(0) : this.ensureCapabilities()), this.started && s && i > this.now() && (this.capabilityRetryTimer !== void 0 || this.retryTimer !== void 0 || this.capabilityRetriesSuspended || this.batchRetriesSuspended) && this.resumeAfterStrongSignal(), !1;
17852
17863
  }
17853
17864
  enqueue(e) {
17854
17865
  if (this.destroyed || this.capabilities === null || typeof e.kind != "string" || !Uu.has(e.kind) || typeof e.type != "string" || !Hu.has(e.type) || typeof e.actor != "string" || !Wu.has(e.actor))
@@ -17871,7 +17882,7 @@ class z1 {
17871
17882
  ), s < 0)
17872
17883
  return V.warn("Scenario interaction queue is full; observation dropped"), null;
17873
17884
  }
17874
- return this.capabilities && !this.admitWithinSessionQuota(this.capabilities) ? null : (s >= 0 && this.queue.splice(s, 1), this.queue.push({ observation: r, protectedFromRoutineEviction: i }), this.capabilities ? this.scheduleFlush() : this.started && !this.capabilityRetriesSuspended && this.ensureCapabilities(), r.clientObservationId);
17885
+ return this.capabilities && !this.admitWithinSessionQuota(this.capabilities) ? null : (s >= 0 && this.queue.splice(s, 1), this.queue.push({ observation: r, protectedFromRoutineEviction: i }), this.probeAfterUserObservation(r), this.capabilities ? this.scheduleFlush() : this.started && !this.capabilityRetriesSuspended && this.ensureCapabilities(), r.clientObservationId);
17875
17886
  }
17876
17887
  getQueueSnapshot() {
17877
17888
  return this.queue.map(({ observation: e }) => e);
@@ -17901,16 +17912,31 @@ class z1 {
17901
17912
  return this.flushRequest = s, s;
17902
17913
  }
17903
17914
  onOnlineOrFocus = () => {
17904
- this.clearRetryTimer(), this.clearCapabilityRetryTimer(), this.retryAttempt = 0, this.capabilityRetryAttempt = 0, this.batchRetriesSuspended = !1, this.capabilityRetriesSuspended = !1, this.capabilities === void 0 ? this.ensureCapabilities() : this.capabilities && this.scheduleFlush(0);
17915
+ this.resumeAfterStrongSignal();
17905
17916
  };
17917
+ resumeAfterStrongSignal() {
17918
+ this.destroyed || (this.resetRecoveryState(), this.capabilities === void 0 ? this.ensureCapabilities() : this.capabilities && this.scheduleFlush(0));
17919
+ }
17920
+ probeAfterUserObservation(e) {
17921
+ if (!this.started || e.actor !== "USER" || !this.capabilityRetriesSuspended && !this.batchRetriesSuspended)
17922
+ return;
17923
+ const n = this.now();
17924
+ if (!(n < this.nextUserRecoveryProbeAt)) {
17925
+ if (this.nextUserRecoveryProbeAt = n + M1, this.capabilityRetriesSuspended && this.capabilities === void 0) {
17926
+ this.capabilityRetriesSuspended = !1, this.ensureCapabilities();
17927
+ return;
17928
+ }
17929
+ this.batchRetriesSuspended && this.capabilities && (this.batchRetriesSuspended = !1, this.scheduleFlush(0));
17930
+ }
17931
+ }
17906
17932
  onVisibilityChange = () => {
17907
- document.visibilityState === "hidden" && this.flush({ keepalive: !0 });
17933
+ document.visibilityState === "hidden" ? this.flush({ keepalive: !0 }) : document.visibilityState === "visible" && this.resumeAfterStrongSignal();
17908
17934
  };
17909
17935
  onPageHide = () => {
17910
17936
  this.flush({ keepalive: !0 });
17911
17937
  };
17912
17938
  buildObservation(e, n) {
17913
- const r = e.attributionHandle && M1.test(e.attributionHandle) ? e.attributionHandle : void 0;
17939
+ const r = e.attributionHandle && _1.test(e.attributionHandle) ? e.attributionHandle : void 0;
17914
17940
  return {
17915
17941
  clientObservationId: this.createId().slice(0, 128),
17916
17942
  version: qu,
@@ -17920,12 +17946,12 @@ class z1 {
17920
17946
  occurredAt: new Date(this.now()).toISOString(),
17921
17947
  sequence: n,
17922
17948
  ...typeof e.surfaceEpisodeId == "string" && e.surfaceEpisodeId ? { surfaceEpisodeId: e.surfaceEpisodeId.slice(0, 128) } : {},
17923
- ...typeof e.subjectKind == "string" && _1.has(e.subjectKind) && typeof e.subjectId == "string" && e.subjectId ? {
17949
+ ...typeof e.subjectKind == "string" && D1.has(e.subjectKind) && typeof e.subjectId == "string" && e.subjectId ? {
17924
17950
  subjectKind: e.subjectKind,
17925
17951
  subjectId: e.subjectId.slice(0, 255)
17926
17952
  } : {},
17927
- ...typeof e.result == "string" && D1.has(e.result) ? { result: e.result } : {},
17928
- ...typeof e.reason == "string" && F1.has(e.reason) ? { reason: e.reason } : {},
17953
+ ...typeof e.result == "string" && F1.has(e.result) ? { result: e.result } : {},
17954
+ ...typeof e.reason == "string" && N1.has(e.reason) ? { reason: e.reason } : {},
17929
17955
  ...r ? { attributionHandle: r } : {},
17930
17956
  ...this.buildDetails(e)
17931
17957
  };
@@ -17953,6 +17979,9 @@ class z1 {
17953
17979
  const s = await this.fetchImpl(
17954
17980
  `${this.baseUrl}${v1}`,
17955
17981
  {
17982
+ // A conditional 304 has no JSON body and cannot negotiate the
17983
+ // collector contract. Always request a complete representation.
17984
+ cache: "no-store",
17956
17985
  headers: { Authorization: `Bearer ${i.accessToken}` },
17957
17986
  signal: r
17958
17987
  }
@@ -17963,18 +17992,18 @@ class z1 {
17963
17992
  return;
17964
17993
  }
17965
17994
  if (!s.ok) {
17966
- Oo(s.status) ? (this.capabilities = void 0, this.scheduleCapabilityRetry()) : this.disableSending(
17995
+ s.status === 304 || Oo(s.status) ? (this.capabilities = void 0, this.scheduleCapabilityRetry()) : this.disableSending(
17967
17996
  `Scenario interaction capability request was rejected with ${s.status}`
17968
17997
  );
17969
17998
  return;
17970
17999
  }
17971
- const o = P1(await s.json());
18000
+ const o = z1(await s.json());
17972
18001
  if (!this.isCurrentGeneration(e) || r.aborted) return;
17973
18002
  if (!o) {
17974
18003
  this.disableSending("Scenario interaction capabilities are invalid");
17975
18004
  return;
17976
18005
  }
17977
- this.capabilities = o, this.capabilityRetryAttempt = 0, this.capabilityRetriesSuspended = !1, this.clearCapabilityRetryTimer(), this.dropUnsupportedObservations(o), this.admissionCount = Math.max(this.admissionCount, this.queue.length), this.queue.length && this.scheduleFlush(0);
18006
+ this.capabilities = o, this.resetCapabilityRecoveryState(), this.nextUserRecoveryProbeAt = 0, this.dropUnsupportedObservations(o), this.admissionCount = Math.max(this.admissionCount, this.queue.length), this.queue.length && this.scheduleFlush(0);
17978
18007
  } catch (s) {
17979
18008
  if (!this.isCurrentGeneration(e) || r.aborted && !n.timedOut)
17980
18009
  return;
@@ -18024,7 +18053,7 @@ class z1 {
18024
18053
  );
18025
18054
  return;
18026
18055
  }
18027
- const l = O1(await c.json());
18056
+ const l = V1(await c.json());
18028
18057
  if (!this.isCurrentGeneration(n) || i.aborted) return;
18029
18058
  if (!l) {
18030
18059
  this.scheduleRetry();
@@ -18042,7 +18071,7 @@ class z1 {
18042
18071
  f.has(
18043
18072
  this.queue[g].observation.clientObservationId
18044
18073
  ) && this.queue.splice(g, 1);
18045
- this.retryAttempt = 0, this.batchRetriesSuspended = !1, this.clearRetryTimer(), h && (this.quotaBlockedUntil = this.now() + Po), a.some(
18074
+ this.resetBatchRecoveryState(), this.nextUserRecoveryProbeAt = 0, h && (this.quotaBlockedUntil = this.now() + Po), a.some(
18046
18075
  ({ observation: g }) => !f.has(g.clientObservationId)
18047
18076
  ) ? this.scheduleRetry() : this.queue.length && this.scheduleFlush(R1);
18048
18077
  } catch (c) {
@@ -18061,7 +18090,7 @@ class z1 {
18061
18090
  );
18062
18091
  for (; this.queue.length; ) {
18063
18092
  const s = this.queue.slice(0, r);
18064
- for (; s.length && L1(
18093
+ for (; s.length && O1(
18065
18094
  JSON.stringify({
18066
18095
  items: s.map(({ observation: o }) => o)
18067
18096
  })
@@ -18156,6 +18185,15 @@ class z1 {
18156
18185
  clearTimers() {
18157
18186
  this.clearFlushTimer(), this.clearRetryTimer(), this.clearCapabilityRetryTimer();
18158
18187
  }
18188
+ resetRecoveryState() {
18189
+ this.resetBatchRecoveryState(), this.resetCapabilityRecoveryState(), this.nextUserRecoveryProbeAt = 0;
18190
+ }
18191
+ resetBatchRecoveryState() {
18192
+ this.clearRetryTimer(), this.retryAttempt = 0, this.batchRetriesSuspended = !1;
18193
+ }
18194
+ resetCapabilityRecoveryState() {
18195
+ this.clearCapabilityRetryTimer(), this.capabilityRetryAttempt = 0, this.capabilityRetriesSuspended = !1;
18196
+ }
18159
18197
  clearRetryTimer() {
18160
18198
  this.retryTimer !== void 0 && window.clearTimeout(this.retryTimer), this.retryTimer = void 0;
18161
18199
  }
@@ -18167,7 +18205,7 @@ class z1 {
18167
18205
  return Math.max(1, Math.round(n * r));
18168
18206
  }
18169
18207
  disableSending(e) {
18170
- this.capabilities = null, this.queue.length = 0, this.clearTimers(), V.debug(e);
18208
+ this.capabilities = null, this.queue.length = 0, this.nextUserRecoveryProbeAt = 0, this.clearTimers(), V.debug(e);
18171
18209
  }
18172
18210
  admitWithinSessionQuota(e) {
18173
18211
  if (this.isQuotaBlocked()) return !1;
@@ -18178,7 +18216,7 @@ class z1 {
18178
18216
  return this.quotaBlockedUntil <= this.now() ? (this.quotaBlockedUntil = 0, !1) : !0;
18179
18217
  }
18180
18218
  }
18181
- const V1 = (t) => {
18219
+ const G1 = (t) => {
18182
18220
  switch (t.reason) {
18183
18221
  case "USER_LAUNCHER":
18184
18222
  case "USER_CLOSE_BUTTON":
@@ -18189,7 +18227,7 @@ const V1 = (t) => {
18189
18227
  return "UNKNOWN";
18190
18228
  }
18191
18229
  };
18192
- class B1 {
18230
+ class q1 {
18193
18231
  constructor(e, n = () => crypto.randomUUID()) {
18194
18232
  this.observe = e, this.createId = n;
18195
18233
  }
@@ -18213,7 +18251,7 @@ class B1 {
18213
18251
  kind: "SURFACE_STATE_CHANGED",
18214
18252
  type: e === "OPEN" ? "CHAT_OPENED" : "CHAT_CLOSED",
18215
18253
  actor: n.actor,
18216
- reason: V1(n),
18254
+ reason: G1(n),
18217
18255
  ...i ? { surfaceEpisodeId: i.id } : {},
18218
18256
  ...s ? { attributionHandle: s } : {},
18219
18257
  subjectKind: "SURFACE",
@@ -18248,13 +18286,13 @@ class B1 {
18248
18286
  this.episode = null;
18249
18287
  }
18250
18288
  }
18251
- const G1 = 0.5, q1 = 500, U1 = ({
18289
+ const U1 = 0.5, H1 = 500, W1 = ({
18252
18290
  element: t,
18253
18291
  isActive: e,
18254
18292
  isPresentable: n = () => !0,
18255
18293
  onPresented: r,
18256
- intersectionRatio: i = G1,
18257
- dwellMs: s = q1
18294
+ intersectionRatio: i = U1,
18295
+ dwellMs: s = H1
18258
18296
  }) => {
18259
18297
  if (typeof IntersectionObserver != "function") return () => {
18260
18298
  };
@@ -18286,17 +18324,17 @@ const G1 = 0.5, q1 = 500, U1 = ({
18286
18324
  a = !0, c(), f.disconnect(), h.disconnect(), document.removeEventListener("visibilitychange", d);
18287
18325
  };
18288
18326
  };
18289
- class H1 {
18327
+ class X1 {
18290
18328
  collector;
18291
18329
  surfaceController;
18292
18330
  presented = /* @__PURE__ */ new Set();
18293
18331
  engaged = /* @__PURE__ */ new Set();
18294
18332
  constructor(e, n, r) {
18295
- this.collector = new z1(
18333
+ this.collector = new B1(
18296
18334
  e,
18297
18335
  n,
18298
18336
  r
18299
- ), this.surfaceController = new B1((i) => {
18337
+ ), this.surfaceController = new q1((i) => {
18300
18338
  this.collector.enqueue(i);
18301
18339
  });
18302
18340
  }
@@ -18388,7 +18426,7 @@ class H1 {
18388
18426
  observeHighlightedTarget(e) {
18389
18427
  const n = this.getSurfaceEpisodeId(), r = this.getPrincipalSessionId();
18390
18428
  let i = !0;
18391
- const s = U1({
18429
+ const s = W1({
18392
18430
  element: e.element,
18393
18431
  isActive: () => i && this.getPrincipalSessionId() === r,
18394
18432
  onPresented: () => this.recordTargetPresented(e.commandId, n)
@@ -18401,10 +18439,10 @@ class H1 {
18401
18439
  n && this.getSurfaceState() === "OPEN" && this.getSurfaceEpisodeId() === n && this.surfaceController.markScenarioContext(e);
18402
18440
  }
18403
18441
  }
18404
- const zo = ld, Vo = 3e4, W1 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/, Bo = (t) => {
18442
+ const zo = ld, Vo = 3e4, j1 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/, Bo = (t) => {
18405
18443
  V.error("Session renewal callback failed", t);
18406
18444
  };
18407
- class Ey extends EventTarget {
18445
+ class Ry extends EventTarget {
18408
18446
  root = null;
18409
18447
  hostElement;
18410
18448
  shadowRoot;
@@ -18446,7 +18484,7 @@ class Ey extends EventTarget {
18446
18484
  if (super(), this.validateCustomerInteractionSession(e.customerInteractionSession), this.config = e, this.eventTracker = new p1(
18447
18485
  () => this.config.customerInteractionSession,
18448
18486
  this.onSessionExpired
18449
- ), this.scenarioInteractionRuntime = new H1(
18487
+ ), this.scenarioInteractionRuntime = new X1(
18450
18488
  () => this.config.customerInteractionSession,
18451
18489
  this.onSessionExpired
18452
18490
  ), this.commandRuntime = new f1(
@@ -18580,7 +18618,7 @@ class Ey extends EventTarget {
18580
18618
  throw new Error(
18581
18619
  "ChatWidget: customerInteractionSession.interactionSessionId is invalid"
18582
18620
  );
18583
- if (!W1.test(e.expiresAt) || !Number.isFinite(Date.parse(e.expiresAt)))
18621
+ if (!j1.test(e.expiresAt) || !Number.isFinite(Date.parse(e.expiresAt)))
18584
18622
  throw new Error(
18585
18623
  "ChatWidget: customerInteractionSession.expiresAt is invalid"
18586
18624
  );
@@ -18607,63 +18645,63 @@ class Ey extends EventTarget {
18607
18645
  }
18608
18646
  }
18609
18647
  export {
18610
- K1 as $,
18611
- by as A,
18648
+ J1 as $,
18649
+ wy as A,
18612
18650
  dp as B,
18613
18651
  qe as C,
18614
- gy as D,
18652
+ by as D,
18615
18653
  np as E,
18616
- yy as F,
18617
- $1 as G,
18654
+ Cy as F,
18655
+ ty as G,
18618
18656
  je as H,
18619
- vy as I,
18620
- xy as J,
18621
- ay as K,
18657
+ xy as I,
18658
+ ky as J,
18659
+ cy as K,
18622
18660
  Wg as L,
18623
18661
  Q as M,
18624
18662
  mt as N,
18625
- ty as O,
18663
+ ry as O,
18626
18664
  ae as P,
18627
- ry as Q,
18628
- iy as R,
18665
+ sy as Q,
18666
+ oy as R,
18629
18667
  rb as S,
18630
- sy as T,
18631
- oy as U,
18632
- ey as V,
18633
- Cy as W,
18634
- Iy as X,
18668
+ ay as T,
18669
+ uy as U,
18670
+ ny as V,
18671
+ Iy as W,
18672
+ Ay as X,
18635
18673
  Ni as Y,
18636
- Y1 as Z,
18674
+ Q1 as Z,
18637
18675
  jc as _,
18638
18676
  ms as a,
18639
18677
  V as a0,
18640
- Ey as a1,
18678
+ Ry as a1,
18641
18679
  Yg as a2,
18642
18680
  Jg as a3,
18643
18681
  Mu as a4,
18644
18682
  Mr as b,
18645
18683
  Hg as c,
18646
- Ay as d,
18684
+ Sy as d,
18647
18685
  dr as e,
18648
18686
  lt as f,
18649
- ky as g,
18650
- Sy as h,
18687
+ Ey as g,
18688
+ Ty as h,
18651
18689
  hp as i,
18652
- my as j,
18690
+ yy as j,
18653
18691
  rp as k,
18654
18692
  Vu as l,
18655
18693
  Vf as m,
18656
- ly as n,
18657
- U1 as o,
18694
+ hy as n,
18695
+ W1 as o,
18658
18696
  mr as p,
18659
18697
  Vd as q,
18660
- ny as r,
18698
+ iy as r,
18661
18699
  Bd as s,
18662
- dy as t,
18700
+ fy as t,
18663
18701
  qn as u,
18664
- fy as v,
18665
- hy as w,
18666
- uy as x,
18667
- cy as y,
18668
- py as z
18702
+ gy as v,
18703
+ py as w,
18704
+ ly as x,
18705
+ dy as y,
18706
+ my as z
18669
18707
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alxxsck/ai-assistant",
3
3
  "private": false,
4
- "version": "2.21.0",
4
+ "version": "2.22.1",
5
5
  "description": "Embeddable Lola AI assistant library",
6
6
  "type": "module",
7
7
  "main": "dist/bridge-ai-chat-widget.es.js",