@livelayer/react 0.5.24-debug.3 → 0.5.24-debug.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs as x, jsx as n, Fragment as Nt } from "react/jsx-runtime";
3
- import { Component as wn, useState as C, useRef as N, useEffect as I, useCallback as S, useMemo as yt, forwardRef as At, createElement as _n } from "react";
3
+ import { Component as wn, useState as A, useRef as R, useEffect as I, useCallback as S, useMemo as yt, forwardRef as At, createElement as _n } from "react";
4
4
  import { LiveKitSession as xn } from "@livelayer/sdk";
5
5
  import { createLocalAudioTrack as kn, Track as on, createLocalVideoTrack as Ln } from "livekit-client";
6
6
  class Sn extends wn {
@@ -34,7 +34,7 @@ class Sn extends wn {
34
34
  }
35
35
  }
36
36
  function En(e) {
37
- const [t, r] = C("idle"), [o, i] = C("idle"), [l, u] = C([]), [d, p] = C(null), [y, w] = C(null), [s, a] = C(null), [L, R] = C(!1), [A, v] = C(null), _ = N(null), H = N(e.onDataMessage);
37
+ const [t, r] = A("idle"), [o, i] = A("idle"), [l, u] = A([]), [d, p] = A(null), [y, w] = A(null), [s, a] = A(null), [k, E] = A(!1), [C, v] = A(null), _ = R(null), H = R(e.onDataMessage);
38
38
  H.current = e.onDataMessage, I(() => {
39
39
  const T = {
40
40
  onConnectionStateChange: (z) => {
@@ -51,25 +51,18 @@ function En(e) {
51
51
  var P;
52
52
  (P = H.current) == null || P.call(H, z);
53
53
  },
54
- onResumabilityChange: R
54
+ onResumabilityChange: E
55
55
  }, V = new xn(
56
56
  {
57
57
  agentId: e.agentId,
58
58
  baseUrl: e.baseUrl,
59
59
  apiKey: e.apiKey,
60
60
  sessionEndpoint: e.sessionEndpoint,
61
- sessionBody: e.sessionBody,
62
- // useMicrophoneState owns the mic track. If we let the SDK
63
- // also publish, livekit-client logs "publishing a second track
64
- // with the same source: microphone" and renegotiates the
65
- // publisher PC, which closes the data channel — every later
66
- // publishData throws "PC manager is closed". That breaks the
67
- // pathname / page_context / routes pushes the agent depends on.
68
- manageMic: !1
61
+ sessionBody: e.sessionBody
69
62
  },
70
63
  T
71
64
  );
72
- return _.current = V, r("idle"), i("idle"), u([]), p(null), w(null), a(null), R(!1), v(null), () => {
65
+ return _.current = V, r("idle"), i("idle"), u([]), p(null), w(null), a(null), E(!1), v(null), () => {
73
66
  var z;
74
67
  (z = V.destroy) == null || z.call(V), _.current = null;
75
68
  };
@@ -102,8 +95,8 @@ function En(e) {
102
95
  agentConfig: d,
103
96
  videoElement: y,
104
97
  audioElement: s,
105
- canResume: L,
106
- error: A,
98
+ canResume: k,
99
+ error: C,
107
100
  connect: $,
108
101
  disconnect: q,
109
102
  getRoom: m,
@@ -111,7 +104,7 @@ function En(e) {
111
104
  };
112
105
  }
113
106
  function Cn() {
114
- const e = N(null), t = N(null), r = N(null), o = N(null), i = N(/* @__PURE__ */ new Set()), l = N(null), u = S(() => {
107
+ const e = R(null), t = R(null), r = R(null), o = R(null), i = R(/* @__PURE__ */ new Set()), l = R(null), u = S(() => {
115
108
  const s = t.current;
116
109
  if (!s) {
117
110
  o.current = null;
@@ -122,12 +115,12 @@ function Cn() {
122
115
  ));
123
116
  const a = l.current;
124
117
  s.getByteFrequencyData(a);
125
- let L = 0;
126
- for (let A = 0; A < a.length; A++) L += a[A];
127
- const R = L / a.length / 255;
128
- for (const A of i.current)
118
+ let k = 0;
119
+ for (let C = 0; C < a.length; C++) k += a[C];
120
+ const E = k / a.length / 255;
121
+ for (const C of i.current)
129
122
  try {
130
- A(R);
123
+ C(E);
131
124
  } catch (v) {
132
125
  console.error("[useAudioLevel] subscriber threw:", v);
133
126
  }
@@ -187,7 +180,7 @@ function Cn() {
187
180
  }, [y]), { attach: p, detach: y, subscribe: w };
188
181
  }
189
182
  function Nn() {
190
- const [e, t] = C(!1), [r, o] = C(null), i = N(null), l = N(null), u = S(
183
+ const [e, t] = A(!1), [r, o] = A(null), i = R(null), l = R(null), u = S(
191
184
  async (s, a) => {
192
185
  if (i.current && l.current) {
193
186
  try {
@@ -198,14 +191,23 @@ function Nn() {
198
191
  }
199
192
  l.current = s, o(null);
200
193
  try {
201
- const L = await kn({
194
+ const k = Array.from(s.localParticipant.trackPublications.values()).find(
195
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
196
+ (C) => C.kind === "audio" && C.source === "microphone"
197
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
198
+ );
199
+ if (k != null && k.track) {
200
+ i.current = k.track, t(k.track.isMuted);
201
+ return;
202
+ }
203
+ const E = await kn({
202
204
  echoCancellation: !0,
203
205
  noiseSuppression: !0
204
206
  });
205
- await s.localParticipant.publishTrack(L), i.current = L, a != null && a.startMuted && await L.mute(), t(L.isMuted);
206
- } catch (L) {
207
- const R = L instanceof Error && L.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
208
- throw o(R), L;
207
+ await s.localParticipant.publishTrack(E), i.current = E, t(E.isMuted);
208
+ } catch (k) {
209
+ const E = k instanceof Error && k.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
210
+ throw o(E), k;
209
211
  }
210
212
  },
211
213
  []
@@ -238,7 +240,7 @@ function Nn() {
238
240
  }
239
241
  const An = { resolution: { width: 640, height: 480, frameRate: 24 } };
240
242
  function Rn() {
241
- const [e, t] = C(!1), [r, o] = C(null), [i, l] = C(null), [u, d] = C(""), p = N(null), y = N(null), w = S((_) => {
243
+ const [e, t] = A(!1), [r, o] = A(null), [i, l] = A(null), [u, d] = A(""), p = R(null), y = R(null), w = S((_) => {
242
244
  p.current = _;
243
245
  }, []), s = S(() => {
244
246
  const _ = p.current, H = y.current;
@@ -277,11 +279,11 @@ function Rn() {
277
279
  o(q);
278
280
  }
279
281
  }
280
- }, []), L = S(async () => {
282
+ }, []), k = S(async () => {
281
283
  e ? s() : await a(u || void 0);
282
- }, [e, u, s, a]), R = S(async (_) => {
284
+ }, [e, u, s, a]), E = S(async (_) => {
283
285
  s(), await a(_);
284
- }, [s, a]), A = S(() => {
286
+ }, [s, a]), C = S(() => {
285
287
  s(), p.current = null, o(null), d("");
286
288
  }, [s]), v = S(() => o(null), []);
287
289
  return I(() => () => {
@@ -291,15 +293,15 @@ function Rn() {
291
293
  error: r,
292
294
  previewEl: i,
293
295
  activeDeviceId: u,
294
- toggle: L,
295
- switchDevice: R,
296
+ toggle: k,
297
+ switchDevice: E,
296
298
  attachRoom: w,
297
- teardown: A,
299
+ teardown: C,
298
300
  clearError: v
299
301
  };
300
302
  }
301
303
  function Dn() {
302
- const [e, t] = C(!1), [r, o] = C(null), [i, l] = C(null), u = N(null), d = S((a) => {
304
+ const [e, t] = A(!1), [r, o] = A(null), [i, l] = A(null), u = R(null), d = S((a) => {
303
305
  u.current = a;
304
306
  }, []), p = S(() => l(null), []), y = S(async () => {
305
307
  const a = u.current;
@@ -315,11 +317,11 @@ function Dn() {
315
317
  o(null);
316
318
  try {
317
319
  await a.localParticipant.setScreenShareEnabled(!0);
318
- let L = 0;
319
- const R = () => {
320
- const A = a.localParticipant.getTrackPublication(on.Source.ScreenShare);
321
- if (A != null && A.track) {
322
- const v = A.track.attach();
320
+ let k = 0;
321
+ const E = () => {
322
+ const C = a.localParticipant.getTrackPublication(on.Source.ScreenShare);
323
+ if (C != null && C.track) {
324
+ const v = C.track.attach();
323
325
  l(v), t(!0);
324
326
  try {
325
327
  a.localParticipant.publishData(
@@ -330,12 +332,12 @@ function Dn() {
330
332
  }
331
333
  return;
332
334
  }
333
- L++ < 10 ? setTimeout(R, 100) : t(!0);
335
+ k++ < 10 ? setTimeout(E, 100) : t(!0);
334
336
  };
335
- R();
336
- } catch (L) {
337
- const R = L instanceof Error ? L.name : "";
338
- R !== "NotAllowedError" && R !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
337
+ E();
338
+ } catch (k) {
339
+ const E = k instanceof Error ? k.name : "";
340
+ E !== "NotAllowedError" && E !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
339
341
  }
340
342
  }
341
343
  }, [e, p]), w = S(() => {
@@ -350,7 +352,7 @@ function Dn() {
350
352
  return { isEnabled: e, error: r, previewEl: i, toggle: y, attachRoom: d, teardown: w, clearError: s };
351
353
  }
352
354
  function Mn() {
353
- const [e, t] = C([]), [r, o] = C([]), i = S(async () => {
355
+ const [e, t] = A([]), [r, o] = A([]), i = S(async () => {
354
356
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
355
357
  try {
356
358
  const l = await navigator.mediaDevices.enumerateDevices();
@@ -365,7 +367,7 @@ function Mn() {
365
367
  }, [i]), { mics: e, cameras: r, refresh: i };
366
368
  }
367
369
  function In(e, t, r = !1) {
368
- const [o, i] = C(null), [l, u] = C(null), [d, p] = C(!r && !!e);
370
+ const [o, i] = A(null), [l, u] = A(null), [d, p] = A(!r && !!e);
369
371
  return I(() => {
370
372
  if (r || !e) {
371
373
  p(!1);
@@ -407,7 +409,7 @@ function $n({
407
409
  defaultValue: t = "expanded",
408
410
  onChange: r
409
411
  } = {}) {
410
- const o = e !== void 0, [i, l] = C(t), u = o ? e : i, d = S(
412
+ const o = e !== void 0, [i, l] = A(t), u = o ? e : i, d = S(
411
413
  (p) => {
412
414
  p !== u && (o || l(p), r == null || r(p));
413
415
  },
@@ -426,7 +428,7 @@ function Hn({
426
428
  persistKey: o = "ll-widget",
427
429
  disablePersistence: i = !1
428
430
  } = {}) {
429
- const l = `${o}:display-mode`, u = N(!1), [d, p] = $n({
431
+ const l = `${o}:display-mode`, u = R(!1), [d, p] = $n({
430
432
  value: e,
431
433
  defaultValue: t,
432
434
  onChange: (y) => {
@@ -441,7 +443,7 @@ function Hn({
441
443
  }
442
444
  const qn = 640;
443
445
  function On(e = qn) {
444
- const [t, r] = C(!1);
446
+ const [t, r] = A(!1);
445
447
  return I(() => {
446
448
  if (e === !1) {
447
449
  r(!1);
@@ -471,7 +473,7 @@ function Vt() {
471
473
  return typeof window > "u" ? "/" : window.location.pathname || "/";
472
474
  }
473
475
  function Vn(e) {
474
- const [t, r] = C(
476
+ const [t, r] = A(
475
477
  () => e ?? Vt()
476
478
  );
477
479
  return I(() => {
@@ -639,7 +641,7 @@ const nr = ({
639
641
  avatarImageUrl: l,
640
642
  agentName: u
641
643
  }) => {
642
- const d = Zn(e), p = d === "right" ? "left" : "right", y = t ? 80 : 72, w = !!l, [s, a] = C(null), [L, R] = C(!1), A = N(null), v = N(!1), _ = S(
644
+ const d = Zn(e), p = d === "right" ? "left" : "right", y = t ? 80 : 72, w = !!l, [s, a] = A(null), [k, E] = A(!1), C = R(null), v = R(!1), _ = S(
643
645
  (P) => {
644
646
  if (typeof window > "u") return P;
645
647
  const O = y / 2, G = Jt + O, ee = window.innerHeight - Jt - O;
@@ -662,7 +664,7 @@ const nr = ({
662
664
  P.currentTarget.setPointerCapture(P.pointerId);
663
665
  } catch {
664
666
  }
665
- A.current = {
667
+ C.current = {
666
668
  startClientY: P.clientY,
667
669
  startCenterY: s,
668
670
  moved: !1
@@ -672,21 +674,21 @@ const nr = ({
672
674
  [s]
673
675
  ), $ = S(
674
676
  (P) => {
675
- const O = A.current;
677
+ const O = C.current;
676
678
  if (!O) return;
677
679
  const G = P.clientY - O.startClientY;
678
- !O.moved && Math.abs(G) > er && (O.moved = !0, R(!0)), O.moved && a(_(O.startCenterY + G));
680
+ !O.moved && Math.abs(G) > er && (O.moved = !0, E(!0)), O.moved && a(_(O.startCenterY + G));
679
681
  },
680
682
  [_]
681
683
  ), q = S(
682
684
  (P) => {
683
- const O = A.current;
685
+ const O = C.current;
684
686
  if (O) {
685
687
  try {
686
688
  P.currentTarget.releasePointerCapture(P.pointerId);
687
689
  } catch {
688
690
  }
689
- A.current = null, O.moved && (R(!1), v.current = !0, a((G) => (G !== null && Kt(G), G)));
691
+ C.current = null, O.moved && (E(!1), v.current = !0, a((G) => (G !== null && Kt(G), G)));
690
692
  }
691
693
  },
692
694
  []
@@ -714,7 +716,7 @@ const nr = ({
714
716
  `ll-hidden--${d}`,
715
717
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
716
718
  r ? "ll-hidden--speaking" : null,
717
- L ? "is-dragging" : null,
719
+ k ? "is-dragging" : null,
718
720
  w ? "ll-hidden--with-avatar" : null
719
721
  ].filter(Boolean).join(" "), z = s === null ? void 0 : { top: `${s - y / 2}px`, transform: "none" };
720
722
  return /* @__PURE__ */ n(
@@ -771,16 +773,16 @@ const nr = ({
771
773
  className: i,
772
774
  barClassName: l
773
775
  }) => {
774
- const u = N(null), d = N([]), p = yt(() => {
776
+ const u = R(null), d = R([]), p = yt(() => {
775
777
  const w = (Math.sqrt(5) - 1) / 2;
776
778
  return Array.from({ length: t }, (s, a) => 0.5 + a * w % 1 * 0.5);
777
779
  }, [t]);
778
780
  I(() => e.subscribe((s) => {
779
781
  for (let a = 0; a < t; a++) {
780
- const L = d.current[a];
781
- if (!L) continue;
782
- const R = Math.max(o, s * r * p[a]);
783
- L.style.height = `${R}px`;
782
+ const k = d.current[a];
783
+ if (!k) continue;
784
+ const E = Math.max(o, s * r * p[a]);
785
+ k.style.height = `${E}px`;
784
786
  }
785
787
  }), [e, t, r, o, p]);
786
788
  const y = ["ll-waveform", i].filter(Boolean).join(" ");
@@ -928,7 +930,7 @@ const nr = ({
928
930
  className: o,
929
931
  style: i
930
932
  }) => {
931
- const [l, u] = C(!1), d = N(e);
933
+ const [l, u] = A(!1), d = R(e);
932
934
  if (I(() => {
933
935
  d.current !== e && (d.current = e, u(!1));
934
936
  }, [e]), !e) return null;
@@ -973,9 +975,9 @@ const nr = ({
973
975
  teamSwitcherOpen: w,
974
976
  onToggleTeamSwitcher: s,
975
977
  onSelectTeamMember: a,
976
- languageMenuOpen: L,
977
- onToggleLanguageMenu: R,
978
- connectionState: A,
978
+ languageMenuOpen: k,
979
+ onToggleLanguageMenu: E,
980
+ connectionState: C,
979
981
  agentState: v,
980
982
  transcript: _,
981
983
  canResume: H,
@@ -1012,7 +1014,7 @@ const nr = ({
1012
1014
  onClearMicError: Fe
1013
1015
  }) => {
1014
1016
  var qe;
1015
- const Ee = ((d == null ? void 0 : d.length) ?? 0) > 1, $e = A === "connecting" || A === "connected", X = A === "connected", te = A === "idle" || A === "disconnected" || A === "error", [Be, se] = C(!1);
1017
+ const Ee = ((d == null ? void 0 : d.length) ?? 0) > 1, $e = C === "connecting" || C === "connected", X = C === "connected", te = C === "idle" || C === "disconnected" || C === "error", [Be, se] = A(!1);
1016
1018
  I(() => {
1017
1019
  if (!ie) {
1018
1020
  se(!1);
@@ -1028,7 +1030,7 @@ const nr = ({
1028
1030
  ie.removeEventListener("playing", h), ie.removeEventListener("loadeddata", h);
1029
1031
  };
1030
1032
  }, [ie]);
1031
- const [me, Ce] = C(!1);
1033
+ const [me, Ce] = A(!1);
1032
1034
  I(() => {
1033
1035
  if (!X) {
1034
1036
  Ce(!1);
@@ -1038,7 +1040,7 @@ const nr = ({
1038
1040
  const h = setTimeout(() => Ce(!0), 8e3);
1039
1041
  return () => clearTimeout(h);
1040
1042
  }, [X, Be]);
1041
- const je = A === "connecting" || X && !!o && !Be && !me, re = N(null), ce = N(null);
1043
+ const je = C === "connecting" || X && !!o && !Be && !me, re = R(null), ce = R(null);
1042
1044
  I(() => {
1043
1045
  const h = re.current;
1044
1046
  h && (h.innerHTML = "", P && (P.style.width = "100%", P.style.height = "100%", P.style.objectFit = "cover", P.style.transform = "scaleX(-1)", h.appendChild(P)));
@@ -1046,22 +1048,22 @@ const nr = ({
1046
1048
  const h = ce.current;
1047
1049
  h && (h.innerHTML = "", le && (le.style.width = "100%", le.style.height = "100%", le.style.objectFit = "contain", h.appendChild(le)));
1048
1050
  }, [le]);
1049
- const [ue, ge] = C(!1), [ze, ye] = C(!1);
1051
+ const [ue, ge] = A(!1), [ze, ye] = A(!1);
1050
1052
  I(() => {
1051
- if (!ue && !ze && !L && !w) return;
1053
+ if (!ue && !ze && !k && !w) return;
1052
1054
  const h = () => {
1053
- ge(!1), ye(!1), L && R(), w && s();
1055
+ ge(!1), ye(!1), k && E(), w && s();
1054
1056
  };
1055
1057
  return document.addEventListener("click", h), () => document.removeEventListener("click", h);
1056
1058
  }, [
1057
1059
  ue,
1058
1060
  ze,
1059
- L,
1061
+ k,
1060
1062
  w,
1061
- R,
1063
+ E,
1062
1064
  s
1063
1065
  ]);
1064
- const [ve, Ge] = C(""), Ye = S(
1066
+ const [ve, Ge] = A(""), Ye = S(
1065
1067
  (h) => {
1066
1068
  h.preventDefault();
1067
1069
  const K = ve.trim();
@@ -1183,10 +1185,10 @@ const nr = ({
1183
1185
  type: "button",
1184
1186
  className: "ll-hpill ll-hpill--compact",
1185
1187
  onClick: (h) => {
1186
- h.stopPropagation(), R();
1188
+ h.stopPropagation(), E();
1187
1189
  },
1188
1190
  "aria-haspopup": "listbox",
1189
- "aria-expanded": L,
1191
+ "aria-expanded": k,
1190
1192
  "aria-label": "Language: English",
1191
1193
  title: "Language: English",
1192
1194
  children: [
@@ -1195,7 +1197,7 @@ const nr = ({
1195
1197
  ]
1196
1198
  }
1197
1199
  ),
1198
- L && /* @__PURE__ */ n(
1200
+ k && /* @__PURE__ */ n(
1199
1201
  "div",
1200
1202
  {
1201
1203
  className: "ll-hmenu",
@@ -1275,9 +1277,9 @@ const nr = ({
1275
1277
  ] })
1276
1278
  ),
1277
1279
  te && /* @__PURE__ */ (() => {
1278
- const h = H ? "Restart paused session" : A === "disconnected" ? "Reconnect to agent" : "Start video call", K = H ? "Pick up where you left off" : null;
1280
+ const h = H ? "Restart paused session" : C === "disconnected" ? "Reconnect to agent" : "Start video call", K = H ? "Pick up where you left off" : null;
1279
1281
  return /* @__PURE__ */ x(Nt, { children: [
1280
- A === "idle" && !H && !q && /* @__PURE__ */ x(
1282
+ C === "idle" && !H && !q && /* @__PURE__ */ x(
1281
1283
  "button",
1282
1284
  {
1283
1285
  type: "button",
@@ -1485,7 +1487,7 @@ const nr = ({
1485
1487
  ] })
1486
1488
  ] }) : null,
1487
1489
  (() => {
1488
- if (T && A !== "error")
1490
+ if (T && C !== "error")
1489
1491
  return /* @__PURE__ */ x("div", { className: "ll-expanded__banner", role: "alert", children: [
1490
1492
  /* @__PURE__ */ n("span", { children: T }),
1491
1493
  /* @__PURE__ */ n(
@@ -1499,7 +1501,7 @@ const nr = ({
1499
1501
  }
1500
1502
  )
1501
1503
  ] });
1502
- if (!q || A !== "error") return null;
1504
+ if (!q || C !== "error") return null;
1503
1505
  let h = "Failed to connect", K = "Try again";
1504
1506
  return q === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : q === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : q === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : q === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : q === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : q.length < 80 && (h = q), /* @__PURE__ */ x("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1505
1507
  /* @__PURE__ */ n("span", { children: h }),
@@ -1710,23 +1712,23 @@ function wr(e, t = {}) {
1710
1712
  T.length > 10 && p.push(Ae(T, en));
1711
1713
  }
1712
1714
  const a = p.join(`
1713
- `), L = [], R = Array.from(r.querySelectorAll("a[href]"));
1714
- for (const m of R) {
1715
- if (L.length >= hr) break;
1715
+ `), k = [], E = Array.from(r.querySelectorAll("a[href]"));
1716
+ for (const m of E) {
1717
+ if (k.length >= hr) break;
1716
1718
  if (tt(m) || !nt(m)) continue;
1717
1719
  const T = m.getAttribute("href") || "", V = (m.textContent || "").trim();
1718
- !T || !V || L.push({ href: T, text: Ae(V, 100) });
1720
+ !T || !V || k.push({ href: T, text: Ae(V, 100) });
1719
1721
  }
1720
- const A = [], v = Array.from(
1722
+ const C = [], v = Array.from(
1721
1723
  r.querySelectorAll(
1722
1724
  "input, textarea, select"
1723
1725
  )
1724
1726
  );
1725
1727
  for (const m of v) {
1726
- if (A.length >= mr) break;
1728
+ if (C.length >= mr) break;
1727
1729
  if (tt(m) || !bt(m) || !nt(m)) continue;
1728
1730
  const T = tn(m), V = m instanceof HTMLInputElement ? m.type : m.tagName.toLowerCase();
1729
- T && A.push({ label: Ae(T, 100), type: V });
1731
+ T && C.push({ label: Ae(T, 100), type: V });
1730
1732
  }
1731
1733
  const _ = Array.from(
1732
1734
  r.querySelectorAll("[data-ll-form]")
@@ -1757,8 +1759,8 @@ function wr(e, t = {}) {
1757
1759
  pathname: i,
1758
1760
  regions: d,
1759
1761
  visibleText: a,
1760
- visibleLinks: L,
1761
- visibleFields: A,
1762
+ visibleLinks: k,
1763
+ visibleFields: C,
1762
1764
  forms: H,
1763
1765
  extras: e
1764
1766
  };
@@ -1934,9 +1936,9 @@ function $r(e) {
1934
1936
  position: w = "bottom-right",
1935
1937
  mobileBreakpoint: s = 640,
1936
1938
  persistKey: a = "ll-widget",
1937
- disablePersistence: L = !1,
1938
- teamMembers: R,
1939
- currentTeamMemberId: A,
1939
+ disablePersistence: k = !1,
1940
+ teamMembers: E,
1941
+ currentTeamMemberId: C,
1940
1942
  onTeamMemberChange: v,
1941
1943
  idleLoopUrl: _,
1942
1944
  greeting: H,
@@ -1972,19 +1974,19 @@ function $r(e) {
1972
1974
  I(() => {
1973
1975
  _r(), Cr();
1974
1976
  }, [ae]);
1975
- const Fe = A !== void 0, [Ee, $e] = C(() => {
1977
+ const Fe = C !== void 0, [Ee, $e] = A(() => {
1976
1978
  var f;
1977
- return A ?? ((f = R == null ? void 0 : R[0]) == null ? void 0 : f.id);
1978
- }), X = Fe ? A : Ee, te = yt(
1979
- () => (R == null ? void 0 : R.find((f) => f.id === X)) ?? null,
1980
- [R, X]
1979
+ return C ?? ((f = E == null ? void 0 : E[0]) == null ? void 0 : f.id);
1980
+ }), X = Fe ? C : Ee, te = yt(
1981
+ () => (E == null ? void 0 : E.find((f) => f.id === X)) ?? null,
1982
+ [E, X]
1981
1983
  ), Be = (te == null ? void 0 : te.agentId) ?? t, [se, me] = Hn({
1982
1984
  value: d,
1983
1985
  defaultValue: p,
1984
1986
  onChange: y,
1985
1987
  persistKey: a,
1986
- disablePersistence: L
1987
- }), Ce = On(s), je = Cn(), re = Nn(), ce = Rn(), ue = Dn(), ge = Mn(), [ze, ye] = C(!1), [ve, Ge] = C(!1), [Ye, Je] = C(!1), [be, we] = C(!1), [He, ct] = C(!1), Ke = N(ee), qe = N(le), h = N(lt), K = N(at), xt = N(Le), ut = N(ot), dt = N(it), kt = N(ie), oe = N(null), ft = N(null), Oe = N(null), Dt = N(void 0);
1988
+ disablePersistence: k
1989
+ }), Ce = On(s), je = Cn(), re = Nn(), ce = Rn(), ue = Dn(), ge = Mn(), [ze, ye] = A(!1), [ve, Ge] = A(!1), [Ye, Je] = A(!1), [be, we] = A(!1), [He, ct] = A(!1), Ke = R(ee), qe = R(le), h = R(lt), K = R(at), xt = R(Le), ut = R(ot), dt = R(it), kt = R(ie), oe = R(null), ft = R(null), Oe = R(null), Dt = R(void 0);
1988
1990
  Dt.current = ae, Ke.current = ee, qe.current = le, h.current = lt, K.current = at, xt.current = Le, ut.current = ot, dt.current = it, kt.current = ie;
1989
1991
  function _e(f) {
1990
1992
  const c = kt.current;
@@ -2025,30 +2027,30 @@ function $r(e) {
2025
2027
  if (Ke.current) {
2026
2028
  try {
2027
2029
  Ke.current(b);
2028
- } catch (E) {
2030
+ } catch (N) {
2029
2031
  console.warn(
2030
2032
  `[LiveLayer] onNavigate threw for "${b}". Falling back. Error:`,
2031
- E
2033
+ N
2032
2034
  );
2033
2035
  }
2034
2036
  return;
2035
2037
  }
2036
2038
  if (typeof document < "u") {
2037
- const E = document.querySelector(
2039
+ const N = document.querySelector(
2038
2040
  `a[href="${b.replace(/"/g, '\\"')}"]`
2039
2041
  );
2040
- if (E) {
2041
- E.click();
2042
+ if (N) {
2043
+ N.click();
2042
2044
  return;
2043
2045
  }
2044
2046
  }
2045
2047
  if (typeof window < "u" && typeof history < "u")
2046
2048
  try {
2047
2049
  history.pushState({}, "", b), window.dispatchEvent(new PopStateEvent("popstate"));
2048
- } catch (E) {
2050
+ } catch (N) {
2049
2051
  console.warn(
2050
2052
  `[LiveLayer] history.pushState fallback failed for "${b}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
2051
- E
2053
+ N
2052
2054
  );
2053
2055
  }
2054
2056
  return;
@@ -2060,36 +2062,36 @@ function $r(e) {
2060
2062
  }
2061
2063
  const b = typeof c.selector == "string" ? c.selector : null;
2062
2064
  if (!b) return;
2063
- const E = c.behavior === "instant" ? "instant" : "smooth";
2065
+ const N = c.behavior === "instant" ? "instant" : "smooth";
2064
2066
  if (qe.current) {
2065
2067
  try {
2066
2068
  qe.current(
2067
2069
  b,
2068
- E
2070
+ N
2069
2071
  );
2070
- } catch (k) {
2071
- console.warn("[LiveLayer] onScrollToSelector threw.", k);
2072
+ } catch (L) {
2073
+ console.warn("[LiveLayer] onScrollToSelector threw.", L);
2072
2074
  }
2073
2075
  return;
2074
2076
  }
2075
2077
  if (typeof document < "u") {
2076
- let k = null;
2078
+ let L = null;
2077
2079
  try {
2078
- k = document.querySelector(b);
2080
+ L = document.querySelector(b);
2079
2081
  } catch {
2080
2082
  console.warn(
2081
2083
  `[LiveLayer] scroll_to: invalid selector "${b}".`
2082
2084
  );
2083
2085
  return;
2084
2086
  }
2085
- if (!k) {
2087
+ if (!L) {
2086
2088
  console.warn(
2087
2089
  `[LiveLayer] scroll_to: no element matched "${b}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
2088
2090
  );
2089
2091
  return;
2090
2092
  }
2091
- k.scrollIntoView({
2092
- behavior: E,
2093
+ L.scrollIntoView({
2094
+ behavior: N,
2093
2095
  block: "start"
2094
2096
  });
2095
2097
  }
@@ -2100,8 +2102,8 @@ function $r(e) {
2100
2102
  xe("request_page_context", "read_page");
2101
2103
  return;
2102
2104
  }
2103
- const b = typeof c.requestId == "string" ? c.requestId : void 0, E = (ne = oe.current) == null ? void 0 : ne.call(oe), k = (j) => {
2104
- const M = E, Y = M == null ? void 0 : M.localParticipant;
2105
+ const b = typeof c.requestId == "string" ? c.requestId : void 0, N = (ne = oe.current) == null ? void 0 : ne.call(oe), L = (j) => {
2106
+ const M = N, Y = M == null ? void 0 : M.localParticipant;
2105
2107
  if (!(Y != null && Y.publishData)) {
2106
2108
  console.warn(
2107
2109
  "[NAV-DEBUG][widget] request_page_context response: no publishData"
@@ -2115,21 +2117,21 @@ function $r(e) {
2115
2117
  if (F) {
2116
2118
  const j = F(D);
2117
2119
  if (j instanceof Promise) {
2118
- k({ type: "page_context_pending" }), j.then((M) => k({ type: "page_context", context: M })).catch((M) => {
2120
+ L({ type: "page_context_pending" }), j.then((M) => L({ type: "page_context", context: M })).catch((M) => {
2119
2121
  console.warn(
2120
2122
  "[LiveLayer] getPageContext rejected; falling back to default walker.",
2121
2123
  M
2122
- ), k({
2124
+ ), L({
2123
2125
  type: "page_context",
2124
2126
  context: gt(D)
2125
2127
  });
2126
2128
  });
2127
2129
  return;
2128
2130
  }
2129
- k({ type: "page_context", context: j });
2131
+ L({ type: "page_context", context: j });
2130
2132
  return;
2131
2133
  }
2132
- k({
2134
+ L({
2133
2135
  type: "page_context",
2134
2136
  context: gt(D)
2135
2137
  });
@@ -2137,7 +2139,7 @@ function $r(e) {
2137
2139
  console.warn(
2138
2140
  "[LiveLayer] page-context extraction threw. Sending empty context.",
2139
2141
  j
2140
- ), k({
2142
+ ), L({
2141
2143
  type: "page_context",
2142
2144
  context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: D }
2143
2145
  });
@@ -2156,12 +2158,12 @@ function $r(e) {
2156
2158
  );
2157
2159
  return;
2158
2160
  }
2159
- const E = c.behavior === "instant" ? "instant" : "smooth";
2161
+ const N = c.behavior === "instant" ? "instant" : "smooth";
2160
2162
  if (h.current) {
2161
2163
  try {
2162
2164
  h.current(
2163
2165
  b,
2164
- E
2166
+ N
2165
2167
  );
2166
2168
  } catch (M) {
2167
2169
  console.warn("[LiveLayer] onScrollPage threw.", M);
@@ -2169,10 +2171,10 @@ function $r(e) {
2169
2171
  return;
2170
2172
  }
2171
2173
  if (typeof window > "u") return;
2172
- const k = { behavior: E }, D = Ir(), F = (M) => {
2173
- D instanceof Window ? D.scrollBy({ top: M, ...k }) : D.scrollBy({ top: M, ...k });
2174
+ const L = { behavior: N }, D = Ir(), F = (M) => {
2175
+ D instanceof Window ? D.scrollBy({ top: M, ...L }) : D.scrollBy({ top: M, ...L });
2174
2176
  }, j = (M) => {
2175
- D instanceof Window ? D.scrollTo({ top: M, ...k }) : D.scrollTo({ top: M, ...k });
2177
+ D instanceof Window ? D.scrollTo({ top: M, ...L }) : D.scrollTo({ top: M, ...L });
2176
2178
  };
2177
2179
  b === "up" ? F(-nn(D)) : b === "down" ? F(nn(D)) : j(b === "top" ? 0 : Tr(D));
2178
2180
  return;
@@ -2190,34 +2192,34 @@ function $r(e) {
2190
2192
  if (K.current) {
2191
2193
  try {
2192
2194
  K.current(b);
2193
- } catch (k) {
2194
- console.warn("[LiveLayer] onClick threw.", k);
2195
+ } catch (L) {
2196
+ console.warn("[LiveLayer] onClick threw.", L);
2195
2197
  }
2196
2198
  return;
2197
2199
  }
2198
2200
  if (typeof document > "u") return;
2199
- let E = null;
2201
+ let N = null;
2200
2202
  try {
2201
- E = document.querySelector(b);
2203
+ N = document.querySelector(b);
2202
2204
  } catch {
2203
2205
  console.warn(
2204
2206
  `[LiveLayer] click: invalid selector "${b}".`
2205
2207
  );
2206
2208
  return;
2207
2209
  }
2208
- if (!E) {
2210
+ if (!N) {
2209
2211
  console.warn(
2210
2212
  `[LiveLayer] click: no element matched "${b}". See https://livelayer.studio/docs/errors/click-no-match`
2211
2213
  );
2212
2214
  return;
2213
2215
  }
2214
- if (E.closest('[data-ll-private="true"], .ll-widget')) {
2216
+ if (N.closest('[data-ll-private="true"], .ll-widget')) {
2215
2217
  console.warn(
2216
2218
  "[LiveLayer] click: refusing to click element inside a private subtree."
2217
2219
  );
2218
2220
  return;
2219
2221
  }
2220
- (Q = E.click) == null || Q.call(E);
2222
+ (Q = N.click) == null || Q.call(N);
2221
2223
  return;
2222
2224
  }
2223
2225
  if (c.type === "fill_form" || c.type === "focus_field") {
@@ -2226,9 +2228,9 @@ function $r(e) {
2226
2228
  return;
2227
2229
  }
2228
2230
  if (typeof document > "u") return;
2229
- const b = typeof c.requestId == "string" ? c.requestId : void 0, E = (de = oe.current) == null ? void 0 : de.call(oe), k = (B) => {
2231
+ const b = typeof c.requestId == "string" ? c.requestId : void 0, N = (de = oe.current) == null ? void 0 : de.call(oe), L = (B) => {
2230
2232
  if (c.type !== "fill_form") return;
2231
- const Z = E, pe = Z == null ? void 0 : Z.localParticipant;
2233
+ const Z = N, pe = Z == null ? void 0 : Z.localParticipant;
2232
2234
  if (pe != null && pe.publishData)
2233
2235
  try {
2234
2236
  const Ne = b ? { ...B, requestId: b } : B, bn = new TextEncoder().encode(JSON.stringify(Ne));
@@ -2238,7 +2240,7 @@ function $r(e) {
2238
2240
  }
2239
2241
  }, D = typeof c.formId == "string" ? c.formId : null;
2240
2242
  if (!D) {
2241
- console.warn(`[LiveLayer] ${c.type}: missing formId.`), k({ type: "fill_form_result", ok: !1, reason: "missing formId" });
2243
+ console.warn(`[LiveLayer] ${c.type}: missing formId.`), L({ type: "fill_form_result", ok: !1, reason: "missing formId" });
2242
2244
  return;
2243
2245
  }
2244
2246
  const F = document.querySelector(
@@ -2247,7 +2249,7 @@ function $r(e) {
2247
2249
  if (!F) {
2248
2250
  console.warn(
2249
2251
  `[LiveLayer] ${c.type}: no form with data-ll-form="${D}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
2250
- ), k({
2252
+ ), L({
2251
2253
  type: "fill_form_result",
2252
2254
  ok: !1,
2253
2255
  reason: `no form with data-ll-form="${D}" on this page`,
@@ -2258,7 +2260,7 @@ function $r(e) {
2258
2260
  if (F.closest('[data-ll-private="true"], .ll-widget')) {
2259
2261
  console.warn(
2260
2262
  `[LiveLayer] ${c.type}: refusing to touch a form in a private subtree.`
2261
- ), k({
2263
+ ), L({
2262
2264
  type: "fill_form_result",
2263
2265
  ok: !1,
2264
2266
  reason: "form is in a private subtree (data-ll-private)",
@@ -2290,7 +2292,7 @@ function $r(e) {
2290
2292
  }
2291
2293
  const j = c.values && typeof c.values == "object" ? c.values : null;
2292
2294
  if (!j) {
2293
- console.warn("[LiveLayer] fill_form: missing or invalid values."), k({
2295
+ console.warn("[LiveLayer] fill_form: missing or invalid values."), L({
2294
2296
  type: "fill_form_result",
2295
2297
  ok: !1,
2296
2298
  reason: "missing or invalid values",
@@ -2323,7 +2325,7 @@ function $r(e) {
2323
2325
  ), Y.push(B);
2324
2326
  }
2325
2327
  }
2326
- k({
2328
+ L({
2327
2329
  type: "fill_form_result",
2328
2330
  ok: M.length > 0,
2329
2331
  formId: D,
@@ -2344,26 +2346,26 @@ function $r(e) {
2344
2346
  console.warn("[LiveLayer] submit_form: missing formId.");
2345
2347
  return;
2346
2348
  }
2347
- const E = document.querySelector(
2349
+ const N = document.querySelector(
2348
2350
  `[data-ll-form="${b.replace(/"/g, '\\"')}"]`
2349
2351
  );
2350
- if (!E) {
2352
+ if (!N) {
2351
2353
  console.warn(
2352
2354
  `[LiveLayer] submit_form: no form with data-ll-form="${b}".`
2353
2355
  );
2354
2356
  return;
2355
2357
  }
2356
- if (E.closest('[data-ll-private="true"], .ll-widget')) {
2358
+ if (N.closest('[data-ll-private="true"], .ll-widget')) {
2357
2359
  console.warn(
2358
2360
  "[LiveLayer] submit_form: refusing to submit a form in a private subtree."
2359
2361
  );
2360
2362
  return;
2361
2363
  }
2362
- const k = typeof c.requestId == "string" ? c.requestId : void 0, D = (fe = oe.current) == null ? void 0 : fe.call(oe), F = (Y) => {
2364
+ const L = typeof c.requestId == "string" ? c.requestId : void 0, D = (fe = oe.current) == null ? void 0 : fe.call(oe), F = (Y) => {
2363
2365
  const B = D, Z = B == null ? void 0 : B.localParticipant;
2364
2366
  if (Z != null && Z.publishData)
2365
2367
  try {
2366
- const pe = k ? { ...Y, requestId: k } : Y, Ne = new TextEncoder().encode(JSON.stringify(pe));
2368
+ const pe = L ? { ...Y, requestId: L } : Y, Ne = new TextEncoder().encode(JSON.stringify(pe));
2367
2369
  Z.publishData(Ne, { reliable: !0 });
2368
2370
  } catch {
2369
2371
  }
@@ -2372,11 +2374,11 @@ function $r(e) {
2372
2374
  const M = () => {
2373
2375
  j = !0, F({ type: "form_submitted", formId: b });
2374
2376
  };
2375
- E.addEventListener("submit", M, { once: !0 });
2377
+ N.addEventListener("submit", M, { once: !0 });
2376
2378
  try {
2377
- typeof E.requestSubmit == "function" ? E.requestSubmit() : E.submit();
2379
+ typeof N.requestSubmit == "function" ? N.requestSubmit() : N.submit();
2378
2380
  } catch (Y) {
2379
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", Y), E.removeEventListener("submit", M), F({
2381
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", Y), N.removeEventListener("submit", M), F({
2380
2382
  type: "form_submit_blocked",
2381
2383
  formId: b,
2382
2384
  reason: "exception"
@@ -2384,7 +2386,7 @@ function $r(e) {
2384
2386
  return;
2385
2387
  }
2386
2388
  setTimeout(() => {
2387
- j || (E.removeEventListener("submit", M), F({
2389
+ j || (N.removeEventListener("submit", M), F({
2388
2390
  type: "form_submit_blocked",
2389
2391
  formId: b,
2390
2392
  reason: "validation"
@@ -2397,7 +2399,7 @@ function $r(e) {
2397
2399
  xe("request_routes", "read_page");
2398
2400
  return;
2399
2401
  }
2400
- const b = typeof c.requestId == "string" ? c.requestId : void 0, k = (ke = oe.current) == null ? void 0 : ke.call(oe), D = k == null ? void 0 : k.localParticipant;
2402
+ const b = typeof c.requestId == "string" ? c.requestId : void 0, L = (ke = oe.current) == null ? void 0 : ke.call(oe), D = L == null ? void 0 : L.localParticipant;
2401
2403
  if (!(D != null && D.publishData)) return;
2402
2404
  const F = (M) => {
2403
2405
  const Y = b ? { type: "routes", routes: M, requestId: b } : { type: "routes", routes: M }, B = Oe.current;
@@ -2488,20 +2490,20 @@ function $r(e) {
2488
2490
  `pushSnapshot/page_context_push(regions=${((fe = Q.regions) == null ? void 0 : fe.length) ?? 0} forms=${((ke = Q.forms) == null ? void 0 : ke.length) ?? 0} links=${((b = Q.visibleLinks) == null ? void 0 : b.length) ?? 0})`
2489
2491
  ), (async () => {
2490
2492
  try {
2491
- const E = dt.current;
2492
- let k = [];
2493
- if (E) {
2494
- const D = E(), F = D instanceof Promise ? await D : D;
2495
- k = Array.isArray(F) ? F.slice(0, 200) : [];
2493
+ const N = dt.current;
2494
+ let L = [];
2495
+ if (N) {
2496
+ const D = N(), F = D instanceof Promise ? await D : D;
2497
+ L = Array.isArray(F) ? F.slice(0, 200) : [];
2496
2498
  } else
2497
- k = rt();
2499
+ L = rt();
2498
2500
  await ne(
2499
2501
  W,
2500
- { type: "routes_push", routes: k },
2501
- `pushSnapshot/routes_push(${k.length})`
2502
+ { type: "routes_push", routes: L },
2503
+ `pushSnapshot/routes_push(${L.length})`
2502
2504
  );
2503
- } catch (E) {
2504
- console.warn("[NAV-DEBUG][widget] pushSnapshot routes outer threw:", E);
2505
+ } catch (N) {
2506
+ console.warn("[NAV-DEBUG][widget] pushSnapshot routes outer threw:", N);
2505
2507
  }
2506
2508
  })();
2507
2509
  }, I(() => {
@@ -2525,17 +2527,17 @@ function $r(e) {
2525
2527
  var de, fe, ke, b;
2526
2528
  console.log("[NAV-DEBUG][widget] settle timer fired (250ms after pathname-effect)");
2527
2529
  try {
2528
- const E = (de = U.getRoom) == null ? void 0 : de.call(U), k = E == null ? void 0 : E.localParticipant;
2530
+ const N = (de = U.getRoom) == null ? void 0 : de.call(U), L = N == null ? void 0 : N.localParticipant;
2529
2531
  if (console.log(
2530
- `[NAV-DEBUG][widget] settle-time state: room=${!!E} lp=${!!k} publishData=${!!(k != null && k.publishData)}`
2531
- ), !(k != null && k.publishData)) {
2532
+ `[NAV-DEBUG][widget] settle-time state: room=${!!N} lp=${!!L} publishData=${!!(L != null && L.publishData)}`
2533
+ ), !(L != null && L.publishData)) {
2532
2534
  console.log("[NAV-DEBUG][widget] settle bailed: no publishData");
2533
2535
  return;
2534
2536
  }
2535
2537
  const D = gt(ut.current), F = Oe.current;
2536
2538
  if (!F) return;
2537
2539
  await F(
2538
- k,
2540
+ L,
2539
2541
  { type: "page_context_push", pathname: ae, context: D },
2540
2542
  `settle/page_context_push(regions=${((fe = D.regions) == null ? void 0 : fe.length) ?? 0} forms=${((ke = D.forms) == null ? void 0 : ke.length) ?? 0} links=${((b = D.visibleLinks) == null ? void 0 : b.length) ?? 0})`
2541
2543
  );
@@ -2548,15 +2550,15 @@ function $r(e) {
2548
2550
  } else
2549
2551
  M = rt();
2550
2552
  await F(
2551
- k,
2553
+ L,
2552
2554
  { type: "routes_push", routes: M },
2553
2555
  `settle/routes_push(${M.length})`
2554
2556
  );
2555
2557
  } catch (j) {
2556
2558
  console.warn("[NAV-DEBUG][widget] routes_push outer threw:", j);
2557
2559
  }
2558
- } catch (E) {
2559
- console.warn("[NAV-DEBUG][widget] settle outer threw:", E);
2560
+ } catch (N) {
2561
+ console.warn("[NAV-DEBUG][widget] settle outer threw:", N);
2560
2562
  }
2561
2563
  }, 250);
2562
2564
  return () => {
@@ -2608,7 +2610,7 @@ function $r(e) {
2608
2610
  disconnect: U.disconnect,
2609
2611
  getRoom: U.getRoom,
2610
2612
  isControlled: !1
2611
- }, [J, U]), Mt = N(null);
2613
+ }, [J, U]), Mt = R(null);
2612
2614
  I(() => {
2613
2615
  const f = g.videoElement, c = Mt.current;
2614
2616
  if (!(!f || !c))
@@ -2634,7 +2636,7 @@ function $r(e) {
2634
2636
  re.teardownMic(), ce.teardown(), ue.teardown();
2635
2637
  };
2636
2638
  }, [g.isControlled, g.connectionState]);
2637
- const [Qe, Lt] = C(!1), St = N("idle");
2639
+ const [Qe, Lt] = A(!1), St = R("idle");
2638
2640
  I(() => {
2639
2641
  if (g.connectionState === "idle" || g.connectionState === "disconnected") {
2640
2642
  Lt(!1), St.current = "idle";
@@ -2671,17 +2673,17 @@ function $r(e) {
2671
2673
  }, [g.transcript, Re]), I(() => {
2672
2674
  De == null || De(g.agentState);
2673
2675
  }, [g.agentState, De]);
2674
- const It = N(!1);
2676
+ const It = R(!1);
2675
2677
  I(() => {
2676
2678
  g.isControlled || !u || It.current || Pe && g.connectionState === "idle" && (It.current = !0, g.connect());
2677
2679
  }, [u, g.connectionState, g, Pe]);
2678
2680
  const un = S(
2679
2681
  (f) => {
2680
- const c = R == null ? void 0 : R.find((W) => W.id === f);
2682
+ const c = E == null ? void 0 : E.find((W) => W.id === f);
2681
2683
  c && (Je(!1), f !== X && (Ge(!0), g.disconnect(), Fe || $e(f), v == null || v(c)));
2682
2684
  },
2683
2685
  [
2684
- R,
2686
+ E,
2685
2687
  X,
2686
2688
  g,
2687
2689
  Fe,
@@ -2766,7 +2768,7 @@ function $r(e) {
2766
2768
  idleLoopUrl: fn,
2767
2769
  greeting: pn,
2768
2770
  branding: m,
2769
- teamMembers: R,
2771
+ teamMembers: E,
2770
2772
  currentTeamMemberId: X,
2771
2773
  isSwitchingTeamMember: ve,
2772
2774
  teamSwitcherOpen: Ye,
@@ -2827,12 +2829,12 @@ const Fr = ({
2827
2829
  className: l,
2828
2830
  style: u
2829
2831
  }) => {
2830
- const d = N(null), p = N(null), y = N(i);
2832
+ const d = R(null), p = R(null), y = R(i);
2831
2833
  y.current = i;
2832
2834
  const w = S((s) => {
2833
- var L;
2835
+ var k;
2834
2836
  const a = s.detail;
2835
- (L = y.current) == null || L.call(y, a);
2837
+ (k = y.current) == null || k.call(y, a);
2836
2838
  }, []);
2837
2839
  return I(() => {
2838
2840
  const s = d.current;
@@ -2886,13 +2888,13 @@ const Fr = ({
2886
2888
  }
2887
2889
  );
2888
2890
  } else if ("as" in t && t.as === "select") {
2889
- const { name: p, label: y, labelClassName: w, as: s, children: a, ...L } = t;
2891
+ const { name: p, label: y, labelClassName: w, as: s, children: a, ...k } = t;
2890
2892
  d = /* @__PURE__ */ n(
2891
2893
  "select",
2892
2894
  {
2893
2895
  ref: r,
2894
2896
  ...u,
2895
- ...L,
2897
+ ...k,
2896
2898
  children: a
2897
2899
  }
2898
2900
  );
@@ -2919,8 +2921,8 @@ function Jr({
2919
2921
  defaultOpen: t = !1,
2920
2922
  storageKey: r = "ll-debug-open"
2921
2923
  }) {
2922
- const [o, i] = C(t), [l, u] = C([]), [d, p] = C(""), [y, w] = C(!1), s = N(/* @__PURE__ */ new Set()), a = N([]), L = N(y);
2923
- L.current = y, I(() => {
2924
+ const [o, i] = A(t), [l, u] = A([]), [d, p] = A(""), [y, w] = A(!1), s = R(/* @__PURE__ */ new Set()), a = R([]), k = R(y);
2925
+ k.current = y, I(() => {
2924
2926
  try {
2925
2927
  const v = localStorage.getItem(r);
2926
2928
  v === "1" && i(!0), v === "0" && i(!1);
@@ -2938,7 +2940,7 @@ function Jr({
2938
2940
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
2939
2941
  }, []), I(() => {
2940
2942
  const v = setInterval(() => {
2941
- if (a.current.length === 0 || L.current) return;
2943
+ if (a.current.length === 0 || k.current) return;
2942
2944
  const _ = a.current.splice(0, a.current.length);
2943
2945
  u(
2944
2946
  (H) => [..._.reverse(), ...H].slice(0, 200)
@@ -2946,9 +2948,9 @@ function Jr({
2946
2948
  }, 100);
2947
2949
  return () => clearInterval(v);
2948
2950
  }, []);
2949
- const R = N(!1);
2951
+ const E = R(!1);
2950
2952
  if (I(() => {
2951
- !e || R.current || (R.current = !0, e((v) => {
2953
+ !e || E.current || (E.current = !0, e((v) => {
2952
2954
  a.current.push({
2953
2955
  id: rn++,
2954
2956
  ts: Date.now(),
@@ -3002,7 +3004,7 @@ function Jr({
3002
3004
  children: "🛰 LL debug"
3003
3005
  }
3004
3006
  );
3005
- const A = l.filter((v) => {
3007
+ const C = l.filter((v) => {
3006
3008
  if (!d) return !0;
3007
3009
  const _ = d.toLowerCase();
3008
3010
  return v.type.toLowerCase().includes(_) || JSON.stringify(v.data || {}).toLowerCase().includes(_);
@@ -3111,7 +3113,7 @@ function Jr({
3111
3113
  overflowY: "auto",
3112
3114
  padding: "0 8px 8px"
3113
3115
  },
3114
- children: A.length === 0 ? /* @__PURE__ */ x(
3116
+ children: C.length === 0 ? /* @__PURE__ */ x(
3115
3117
  "div",
3116
3118
  {
3117
3119
  style: {
@@ -3141,7 +3143,7 @@ function Jr({
3141
3143
  )
3142
3144
  ]
3143
3145
  }
3144
- ) : A.map((v) => /* @__PURE__ */ n(
3146
+ ) : C.map((v) => /* @__PURE__ */ n(
3145
3147
  Br,
3146
3148
  {
3147
3149
  entry: v,
@@ -3247,7 +3249,7 @@ function zr(e) {
3247
3249
  }
3248
3250
  }
3249
3251
  function Kr() {
3250
- const [e, t] = C([]), r = S((i) => {
3252
+ const [e, t] = A([]), r = S((i) => {
3251
3253
  t((l) => {
3252
3254
  const u = l.findIndex((d) => d.id === i.id);
3253
3255
  if (u >= 0) {