@livelayer/react 0.5.0 → 0.5.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.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs as k, jsx as n, Fragment as Ht } from "react/jsx-runtime";
3
- import { Component as nn, useState as C, useRef as M, useEffect as P, useCallback as x, useMemo as Ve, forwardRef as ot, createElement as rn } from "react";
3
+ import { Component as nn, useState as C, useRef as M, useEffect as P, useCallback as x, useMemo as Ke, forwardRef as at, createElement as rn } from "react";
4
4
  import { LiveKitSession as on } from "@livelayer/sdk";
5
5
  import { createLocalAudioTrack as ln, Track as Ot, createLocalVideoTrack as an } from "livekit-client";
6
6
  class cn extends nn {
@@ -34,9 +34,9 @@ class cn extends nn {
34
34
  }
35
35
  }
36
36
  function sn(e) {
37
- const [t, r] = C("idle"), [i, o] = C("idle"), [l, s] = C([]), [d, u] = C(null), [g, p] = C(null), [a, c] = C(null), [S, L] = C(!1), [N, H] = C(null), R = M(null), $ = M(e.onDataMessage);
37
+ const [t, r] = C("idle"), [i, o] = C("idle"), [l, s] = C([]), [d, u] = C(null), [y, p] = C(null), [a, c] = C(null), [S, L] = C(!1), [N, H] = C(null), R = M(null), $ = M(e.onDataMessage);
38
38
  $.current = e.onDataMessage, P(() => {
39
- const y = {
39
+ const v = {
40
40
  onConnectionStateChange: (w) => {
41
41
  r(w), w === "connected" && H(null);
42
42
  },
@@ -60,7 +60,7 @@ function sn(e) {
60
60
  sessionEndpoint: e.sessionEndpoint,
61
61
  sessionBody: e.sessionBody
62
62
  },
63
- y
63
+ v
64
64
  );
65
65
  return R.current = E, r("idle"), o("idle"), s([]), u(null), p(null), c(null), L(!1), H(null), () => {
66
66
  var w;
@@ -74,32 +74,32 @@ function sn(e) {
74
74
  JSON.stringify(e.sessionBody ?? {})
75
75
  ]);
76
76
  const I = x(async () => {
77
- const y = R.current;
78
- if (y)
77
+ const v = R.current;
78
+ if (v)
79
79
  try {
80
- await y.connect();
80
+ await v.connect();
81
81
  } catch (E) {
82
82
  throw H(E instanceof Error ? E.message : String(E)), E;
83
83
  }
84
84
  }, []), D = x(() => {
85
- const y = R.current;
86
- y && y.disconnect();
87
- }, []), m = x(() => {
88
- var y;
89
- return ((y = R.current) == null ? void 0 : y.getRoom()) ?? null;
85
+ const v = R.current;
86
+ v && v.disconnect();
87
+ }, []), g = x(() => {
88
+ var v;
89
+ return ((v = R.current) == null ? void 0 : v.getRoom()) ?? null;
90
90
  }, []);
91
91
  return {
92
92
  connectionState: t,
93
93
  agentState: i,
94
94
  transcript: l,
95
95
  agentConfig: d,
96
- videoElement: g,
96
+ videoElement: y,
97
97
  audioElement: a,
98
98
  canResume: S,
99
99
  error: N,
100
100
  connect: I,
101
101
  disconnect: D,
102
- getRoom: m,
102
+ getRoom: g,
103
103
  session: R.current
104
104
  };
105
105
  }
@@ -150,7 +150,7 @@ function dn() {
150
150
  }
151
151
  },
152
152
  [d, s]
153
- ), g = x(() => {
153
+ ), y = x(() => {
154
154
  if (i.current !== null && (cancelAnimationFrame(i.current), i.current = null), r.current) {
155
155
  try {
156
156
  r.current.disconnect();
@@ -162,7 +162,7 @@ function dn() {
162
162
  o.current.delete(a);
163
163
  }), []);
164
164
  return P(() => () => {
165
- if (g(), t.current) {
165
+ if (y(), t.current) {
166
166
  try {
167
167
  t.current.disconnect();
168
168
  } catch {
@@ -177,7 +177,7 @@ function dn() {
177
177
  e.current = null;
178
178
  }
179
179
  o.current.clear(), l.current = null;
180
- }, [g]), { attach: u, detach: g, subscribe: p };
180
+ }, [y]), { attach: u, detach: y, subscribe: p };
181
181
  }
182
182
  function un() {
183
183
  const [e, t] = C(!1), [r, i] = C(null), o = M(null), l = M(null), s = x(async (p) => {
@@ -212,22 +212,22 @@ function un() {
212
212
  p.stop();
213
213
  }
214
214
  o.current = null, l.current = null, t(!1);
215
- }, []), g = x(() => i(null), []);
215
+ }, []), y = x(() => i(null), []);
216
216
  return {
217
217
  isMuted: e,
218
218
  micError: r,
219
219
  toggleMute: d,
220
220
  setupMic: s,
221
221
  teardownMic: u,
222
- clearError: g
222
+ clearError: y
223
223
  };
224
224
  }
225
225
  const fn = { resolution: { width: 640, height: 480, frameRate: 24 } };
226
226
  function pn() {
227
- const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), [s, d] = C(""), u = M(null), g = M(null), p = x((R) => {
227
+ const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), [s, d] = C(""), u = M(null), y = M(null), p = x((R) => {
228
228
  u.current = R;
229
229
  }, []), a = x(() => {
230
- const R = u.current, $ = g.current;
230
+ const R = u.current, $ = y.current;
231
231
  if ($ && R) {
232
232
  const I = R.localParticipant.getTrackPublication(Ot.Source.Camera);
233
233
  if (I != null && I.track) {
@@ -239,7 +239,7 @@ function pn() {
239
239
  } else
240
240
  $.stop();
241
241
  }
242
- g.current = null, l(null), t(!1);
242
+ y.current = null, l(null), t(!1);
243
243
  }, []), c = x(async (R) => {
244
244
  const $ = u.current;
245
245
  if ($) {
@@ -248,9 +248,9 @@ function pn() {
248
248
  const I = { ...fn };
249
249
  R && (I.deviceId = R);
250
250
  const D = await an(I);
251
- await $.localParticipant.publishTrack(D), g.current = D;
252
- const m = D.attach();
253
- l(m), t(!0), R && d(R);
251
+ await $.localParticipant.publishTrack(D), y.current = D;
252
+ const g = D.attach();
253
+ l(g), t(!0), R && d(R);
254
254
  try {
255
255
  $.localParticipant.publishData(
256
256
  new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
@@ -271,7 +271,7 @@ function pn() {
271
271
  a(), u.current = null, i(null), d("");
272
272
  }, [a]), H = x(() => i(null), []);
273
273
  return P(() => () => {
274
- g.current && g.current.stop();
274
+ y.current && y.current.stop();
275
275
  }, []), {
276
276
  isEnabled: e,
277
277
  error: r,
@@ -287,7 +287,7 @@ function pn() {
287
287
  function hn() {
288
288
  const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), s = M(null), d = x((c) => {
289
289
  s.current = c;
290
- }, []), u = x(() => l(null), []), g = x(async () => {
290
+ }, []), u = x(() => l(null), []), y = x(async () => {
291
291
  const c = s.current;
292
292
  if (c) {
293
293
  if (e) {
@@ -333,7 +333,7 @@ function hn() {
333
333
  }
334
334
  u(), t(!1), i(null), s.current = null;
335
335
  }, [e, u]), a = x(() => i(null), []);
336
- return { isEnabled: e, error: r, previewEl: o, toggle: g, attachRoom: d, teardown: p, clearError: a };
336
+ return { isEnabled: e, error: r, previewEl: o, toggle: y, attachRoom: d, teardown: p, clearError: a };
337
337
  }
338
338
  function mn() {
339
339
  const [e, t] = C([]), [r, i] = C([]), o = x(async () => {
@@ -357,9 +357,9 @@ function gn(e, t, r = !1) {
357
357
  u(!1);
358
358
  return;
359
359
  }
360
- const g = new AbortController(), p = t || "https://app.livelayer.studio";
360
+ const y = new AbortController(), p = t || "https://app.livelayer.studio";
361
361
  return u(!0), s(null), fetch(`${p}/api/widget/agent/${encodeURIComponent(e)}`, {
362
- signal: g.signal
362
+ signal: y.signal
363
363
  }).then(async (a) => {
364
364
  if (!a.ok) {
365
365
  const c = await a.json().catch(() => ({}));
@@ -367,10 +367,10 @@ function gn(e, t, r = !1) {
367
367
  }
368
368
  return a.json();
369
369
  }).then((a) => {
370
- g.signal.aborted || (o(a), u(!1));
370
+ y.signal.aborted || (o(a), u(!1));
371
371
  }).catch((a) => {
372
- g.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), u(!1));
373
- }), () => g.abort();
372
+ y.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), u(!1));
373
+ }), () => y.abort();
374
374
  }, [e, t, r]), { info: i, error: l, loading: d };
375
375
  }
376
376
  function yn(e) {
@@ -415,14 +415,14 @@ function xn({
415
415
  const l = `${i}:display-mode`, s = M(!1), [d, u] = bn({
416
416
  value: e,
417
417
  defaultValue: t,
418
- onChange: (g) => {
419
- e === void 0 && !o && vn(l, g), r == null || r(g);
418
+ onChange: (y) => {
419
+ e === void 0 && !o && vn(l, y), r == null || r(y);
420
420
  }
421
421
  });
422
422
  return P(() => {
423
423
  if (s.current || (s.current = !0, o || e !== void 0)) return;
424
- const g = _n(yn(l));
425
- g && g !== d && u(g);
424
+ const y = _n(yn(l));
425
+ y && y !== d && u(y);
426
426
  }, []), [d, u];
427
427
  }
428
428
  const kn = 640;
@@ -441,16 +441,16 @@ function Ln(e = kn) {
441
441
  });
442
442
  }, [e]), t;
443
443
  }
444
- const Lt = "__llHistoryPatched", Ye = "ll:pathname";
444
+ const Lt = "__llHistoryPatched", Xe = "ll:pathname";
445
445
  function En() {
446
446
  if (typeof window > "u" || window.history[Lt]) return;
447
447
  const e = window.history.pushState, t = window.history.replaceState;
448
448
  window.history.pushState = function(...r) {
449
449
  const i = e.apply(this, r);
450
- return window.dispatchEvent(new Event(Ye)), i;
450
+ return window.dispatchEvent(new Event(Xe)), i;
451
451
  }, window.history.replaceState = function(...r) {
452
452
  const i = t.apply(this, r);
453
- return window.dispatchEvent(new Event(Ye)), i;
453
+ return window.dispatchEvent(new Event(Xe)), i;
454
454
  }, window.history[Lt] = !0;
455
455
  }
456
456
  function Et() {
@@ -464,8 +464,8 @@ function Cn(e) {
464
464
  if (e !== void 0) return;
465
465
  En();
466
466
  const i = () => r(Et());
467
- return i(), window.addEventListener("popstate", i), window.addEventListener(Ye, i), () => {
468
- window.removeEventListener("popstate", i), window.removeEventListener(Ye, i);
467
+ return i(), window.addEventListener("popstate", i), window.addEventListener(Xe, i), () => {
468
+ window.removeEventListener("popstate", i), window.removeEventListener(Xe, i);
469
469
  };
470
470
  }, [e]), e ?? t;
471
471
  }
@@ -496,7 +496,7 @@ function Rn(e, t, r) {
496
496
  return e === void 0 ? !0 : St(r, e) ? !1 : t && t.length > 0 ? St(t, e) : !0;
497
497
  }
498
498
  function Tn(e, t, r) {
499
- return Ve(
499
+ return Ke(
500
500
  () => Rn(e, t, r),
501
501
  [e, t, r]
502
502
  );
@@ -623,31 +623,31 @@ const qn = ({
623
623
  onExpand: i,
624
624
  label: o = "Open widget"
625
625
  }) => {
626
- const l = zn(e), s = l === "right" ? "left" : "right", d = t ? 80 : 72, [u, g] = C(null), [p, a] = C(!1), c = M(null), S = M(!1), L = x(
627
- (y) => {
628
- if (typeof window > "u") return y;
626
+ const l = zn(e), s = l === "right" ? "left" : "right", d = t ? 80 : 72, [u, y] = C(null), [p, a] = C(!1), c = M(null), S = M(!1), L = x(
627
+ (v) => {
628
+ if (typeof window > "u") return v;
629
629
  const E = d / 2, w = It + E, O = window.innerHeight - It - E;
630
- return O < w ? Math.max(w, y) : Math.max(w, Math.min(O, y));
630
+ return O < w ? Math.max(w, v) : Math.max(w, Math.min(O, v));
631
631
  },
632
632
  [d]
633
633
  );
634
634
  P(() => {
635
- const y = On();
636
- g(L(y ?? window.innerHeight / 2));
635
+ const v = On();
636
+ y(L(v ?? window.innerHeight / 2));
637
637
  const E = () => {
638
- g((w) => w === null ? null : L(w));
638
+ y((w) => w === null ? null : L(w));
639
639
  };
640
640
  return window.addEventListener("resize", E), () => window.removeEventListener("resize", E);
641
641
  }, [L]);
642
642
  const N = x(
643
- (y) => {
644
- if (!(y.pointerType === "mouse" && y.button !== 0) && u !== null) {
643
+ (v) => {
644
+ if (!(v.pointerType === "mouse" && v.button !== 0) && u !== null) {
645
645
  try {
646
- y.currentTarget.setPointerCapture(y.pointerId);
646
+ v.currentTarget.setPointerCapture(v.pointerId);
647
647
  } catch {
648
648
  }
649
649
  c.current = {
650
- startClientY: y.clientY,
650
+ startClientY: v.clientY,
651
651
  startCenterY: u,
652
652
  moved: !1
653
653
  };
@@ -655,22 +655,22 @@ const qn = ({
655
655
  },
656
656
  [u]
657
657
  ), H = x(
658
- (y) => {
658
+ (v) => {
659
659
  const E = c.current;
660
660
  if (!E) return;
661
- const w = y.clientY - E.startClientY;
662
- !E.moved && Math.abs(w) > Hn && (E.moved = !0, a(!0)), E.moved && g(L(E.startCenterY + w));
661
+ const w = v.clientY - E.startClientY;
662
+ !E.moved && Math.abs(w) > Hn && (E.moved = !0, a(!0)), E.moved && y(L(E.startCenterY + w));
663
663
  },
664
664
  [L]
665
665
  ), R = x(
666
- (y) => {
666
+ (v) => {
667
667
  const E = c.current;
668
668
  if (E) {
669
669
  try {
670
- y.currentTarget.releasePointerCapture(y.pointerId);
670
+ v.currentTarget.releasePointerCapture(v.pointerId);
671
671
  } catch {
672
672
  }
673
- c.current = null, E.moved && (a(!1), S.current = !0, g((w) => (w !== null && Mt(w), w)));
673
+ c.current = null, E.moved && (a(!1), S.current = !0, y((w) => (w !== null && Mt(w), w)));
674
674
  }
675
675
  },
676
676
  []
@@ -681,11 +681,11 @@ const qn = ({
681
681
  }
682
682
  i();
683
683
  }, [i]), I = x(
684
- (y) => {
685
- if (y.key === "ArrowUp" || y.key === "ArrowDown") {
686
- y.preventDefault();
687
- const E = y.key === "ArrowUp" ? -8 : 8;
688
- g((w) => {
684
+ (v) => {
685
+ if (v.key === "ArrowUp" || v.key === "ArrowDown") {
686
+ v.preventDefault();
687
+ const E = v.key === "ArrowUp" ? -8 : 8;
688
+ y((w) => {
689
689
  if (w === null) return w;
690
690
  const O = L(w + E);
691
691
  return Mt(O), O;
@@ -699,7 +699,7 @@ const qn = ({
699
699
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
700
700
  r ? "ll-hidden--speaking" : null,
701
701
  p ? "is-dragging" : null
702
- ].filter(Boolean).join(" "), m = u === null ? void 0 : { top: `${u - d / 2}px`, transform: "none" };
702
+ ].filter(Boolean).join(" "), g = u === null ? void 0 : { top: `${u - d / 2}px`, transform: "none" };
703
703
  return /* @__PURE__ */ n(
704
704
  "button",
705
705
  {
@@ -713,7 +713,7 @@ const qn = ({
713
713
  onKeyDown: I,
714
714
  "aria-label": o,
715
715
  "data-position": e,
716
- style: m,
716
+ style: g,
717
717
  children: /* @__PURE__ */ n($n, { direction: s, className: "ll-hidden__chevron" })
718
718
  }
719
719
  );
@@ -725,7 +725,7 @@ const qn = ({
725
725
  className: o,
726
726
  barClassName: l
727
727
  }) => {
728
- const s = M(null), d = M([]), u = Ve(() => {
728
+ const s = M(null), d = M([]), u = Ke(() => {
729
729
  const p = (Math.sqrt(5) - 1) / 2;
730
730
  return Array.from({ length: t }, (a, c) => 0.5 + c * p % 1 * 0.5);
731
731
  }, [t]);
@@ -737,8 +737,8 @@ const qn = ({
737
737
  S.style.height = `${L}px`;
738
738
  }
739
739
  }), [e, t, r, i, u]);
740
- const g = ["ll-waveform", o].filter(Boolean).join(" ");
741
- return /* @__PURE__ */ n("div", { ref: s, className: g, "aria-hidden": "true", children: Array.from({ length: t }, (p, a) => /* @__PURE__ */ n(
740
+ const y = ["ll-waveform", o].filter(Boolean).join(" ");
741
+ return /* @__PURE__ */ n("div", { ref: s, className: y, "aria-hidden": "true", children: Array.from({ length: t }, (p, a) => /* @__PURE__ */ n(
742
742
  "div",
743
743
  {
744
744
  ref: (c) => {
@@ -759,7 +759,7 @@ const qn = ({
759
759
  audioLevel: s,
760
760
  onExpand: d,
761
761
  onToggleMute: u,
762
- onClose: g
762
+ onClose: y
763
763
  }) => t ? /* @__PURE__ */ n(
764
764
  "div",
765
765
  {
@@ -867,7 +867,7 @@ const qn = ({
867
867
  {
868
868
  type: "button",
869
869
  className: "ll-minimized__btn ll-minimized__btn--close",
870
- onClick: g,
870
+ onClick: y,
871
871
  "aria-label": "Close widget",
872
872
  children: /* @__PURE__ */ n(Pn, { className: "ll-minimized__icon" })
873
873
  }
@@ -913,7 +913,7 @@ const qn = ({
913
913
  }
914
914
  )
915
915
  );
916
- }, jn = ({
916
+ }, Wn = ({
917
917
  position: e,
918
918
  isMobile: t,
919
919
  agentName: r,
@@ -923,7 +923,7 @@ const qn = ({
923
923
  branding: s,
924
924
  teamMembers: d,
925
925
  currentTeamMemberId: u,
926
- isSwitchingTeamMember: g,
926
+ isSwitchingTeamMember: y,
927
927
  teamSwitcherOpen: p,
928
928
  onToggleTeamSwitcher: a,
929
929
  onSelectTeamMember: c,
@@ -935,19 +935,19 @@ const qn = ({
935
935
  canResume: $,
936
936
  needsUserGesture: I,
937
937
  error: D,
938
- isMuted: m,
939
- micError: y,
938
+ isMuted: g,
939
+ micError: v,
940
940
  micDevices: E,
941
941
  isCameraEnabled: w,
942
942
  cameraPreviewEl: O,
943
- cameraDevices: X,
943
+ cameraDevices: J,
944
944
  activeCameraId: de,
945
- isScreenShareEnabled: J,
946
- screenPreviewEl: Q,
945
+ isScreenShareEnabled: Q,
946
+ screenPreviewEl: Z,
947
947
  isSpeakerMuted: ue,
948
- allowCamera: Oe,
949
- allowScreenShare: qe,
950
- allowTyping: Be,
948
+ allowCamera: qe,
949
+ allowScreenShare: Be,
950
+ allowTyping: Ue,
951
951
  avatarVideoContainerRef: Ne,
952
952
  onConnect: fe,
953
953
  onDisconnect: ge,
@@ -957,44 +957,44 @@ const qn = ({
957
957
  onToggleCamera: we,
958
958
  onSwitchCameraDevice: _e,
959
959
  onToggleScreenShare: q,
960
- onToggleSpeaker: Ke,
961
- onSendMessage: Ue,
962
- onMinimize: Fe,
960
+ onToggleSpeaker: Qe,
961
+ onSendMessage: Fe,
962
+ onMinimize: We,
963
963
  onClose: Ae,
964
964
  onClearMicError: Ie
965
965
  }) => {
966
966
  var Pe;
967
- const ie = R.length > 0 ? R[R.length - 1] : null, pe = ((d == null ? void 0 : d.length) ?? 0) > 1, xe = N === "connecting" || N === "connected", Z = N === "connected", V = N === "idle" || N === "disconnected" || N === "error", Me = M(null), oe = M(null);
967
+ const ie = R.length > 0 ? R[R.length - 1] : null, pe = ((d == null ? void 0 : d.length) ?? 0) > 1, xe = N === "connecting" || N === "connected", ee = N === "connected", V = N === "idle" || N === "disconnected" || N === "error", Me = M(null), oe = M(null);
968
968
  P(() => {
969
969
  const h = Me.current;
970
970
  h && (h.innerHTML = "", O && (O.style.width = "100%", O.style.height = "100%", O.style.objectFit = "cover", O.style.transform = "scaleX(-1)", h.appendChild(O)));
971
971
  }, [O]), P(() => {
972
972
  const h = oe.current;
973
- h && (h.innerHTML = "", Q && (Q.style.width = "100%", Q.style.height = "100%", Q.style.objectFit = "contain", h.appendChild(Q)));
974
- }, [Q]);
975
- const [G, ne] = C(!1), [le, Y] = C(!1);
973
+ h && (h.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", h.appendChild(Z)));
974
+ }, [Z]);
975
+ const [K, ne] = C(!1), [le, Y] = C(!1);
976
976
  P(() => {
977
- if (!G && !le && !S && !p) return;
977
+ if (!K && !le && !S && !p) return;
978
978
  const h = () => {
979
979
  ne(!1), Y(!1), S && L(), p && a();
980
980
  };
981
981
  return document.addEventListener("click", h), () => document.removeEventListener("click", h);
982
982
  }, [
983
- G,
983
+ K,
984
984
  le,
985
985
  S,
986
986
  p,
987
987
  L,
988
988
  a
989
989
  ]);
990
- const [K, ae] = C(""), Re = x(
990
+ const [X, ae] = C(""), Re = x(
991
991
  (h) => {
992
992
  h.preventDefault();
993
- const j = K.trim();
994
- j && (Ue(j), ae(""));
993
+ const W = X.trim();
994
+ W && (Fe(W), ae(""));
995
995
  },
996
- [K, Ue]
997
- ), Xe = s.productName || "Live Layer", ke = Z && (ie != null && ie.text) ? ie.text : l || "", Te = [
996
+ [X, Fe]
997
+ ), Ze = s.productName || "Live Layer", ke = ee && (ie != null && ie.text) ? ie.text : l || "", Te = [
998
998
  "ll-expanded",
999
999
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1000
1000
  ].join(" ");
@@ -1003,7 +1003,7 @@ const qn = ({
1003
1003
  {
1004
1004
  className: Te,
1005
1005
  "data-position": e,
1006
- "data-state": Z ? "connected" : xe ? "connecting" : "idle",
1006
+ "data-state": ee ? "connected" : xe ? "connecting" : "idle",
1007
1007
  role: "dialog",
1008
1008
  "aria-label": `${r} widget`,
1009
1009
  children: [
@@ -1016,7 +1016,7 @@ const qn = ({
1016
1016
  className: "ll-expanded__bg-img"
1017
1017
  }
1018
1018
  ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Pe = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Pe.toUpperCase()) || "A" }) }),
1019
- o && !Z && /* @__PURE__ */ n(
1019
+ o && !ee && /* @__PURE__ */ n(
1020
1020
  "video",
1021
1021
  {
1022
1022
  className: "ll-expanded__bg-idle",
@@ -1031,9 +1031,9 @@ const qn = ({
1031
1031
  /* @__PURE__ */ n("div", { ref: Ne, className: "ll-expanded__video" }),
1032
1032
  N === "connecting" && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1033
1033
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1034
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: g ? "Switching..." : "Connecting..." })
1034
+ /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: y ? "Switching..." : "Connecting..." })
1035
1035
  ] }),
1036
- I && Z && /* @__PURE__ */ k(
1036
+ I && ee && /* @__PURE__ */ k(
1037
1037
  "button",
1038
1038
  {
1039
1039
  type: "button",
@@ -1060,7 +1060,7 @@ const qn = ({
1060
1060
  "aria-expanded": pe ? p : void 0,
1061
1061
  children: [
1062
1062
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1063
- pe && /* @__PURE__ */ n(je, {})
1063
+ pe && /* @__PURE__ */ n(Ye, {})
1064
1064
  ]
1065
1065
  }
1066
1066
  ),
@@ -1111,7 +1111,7 @@ const qn = ({
1111
1111
  title: "Language: English",
1112
1112
  children: [
1113
1113
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
1114
- /* @__PURE__ */ n(je, {})
1114
+ /* @__PURE__ */ n(Ye, {})
1115
1115
  ]
1116
1116
  }
1117
1117
  ),
@@ -1148,7 +1148,7 @@ const qn = ({
1148
1148
  {
1149
1149
  type: "button",
1150
1150
  className: "ll-hbtn",
1151
- onClick: Fe,
1151
+ onClick: We,
1152
1152
  "aria-label": "Minimize widget",
1153
1153
  title: "Minimize",
1154
1154
  children: /* @__PURE__ */ n(Tt, {})
@@ -1169,14 +1169,14 @@ const qn = ({
1169
1169
  ] }) : (
1170
1170
  // Idle-state header with Live Layer product name + minimize/close
1171
1171
  /* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1172
- /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Xe }),
1172
+ /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ze }),
1173
1173
  /* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
1174
1174
  /* @__PURE__ */ n(
1175
1175
  "button",
1176
1176
  {
1177
1177
  type: "button",
1178
1178
  className: "ll-hbtn ll-hbtn--ghost",
1179
- onClick: Fe,
1179
+ onClick: We,
1180
1180
  "aria-label": "Minimize widget",
1181
1181
  children: /* @__PURE__ */ n(Tt, {})
1182
1182
  }
@@ -1195,7 +1195,7 @@ const qn = ({
1195
1195
  ] })
1196
1196
  ),
1197
1197
  V && /* @__PURE__ */ (() => {
1198
- const h = $ ? "Restart paused session" : N === "disconnected" ? "Reconnect to agent" : "Start video call", j = $ ? "Pick up where you left off" : null;
1198
+ const h = $ ? "Restart paused session" : N === "disconnected" ? "Reconnect to agent" : "Start video call", W = $ ? "Pick up where you left off" : null;
1199
1199
  return /* @__PURE__ */ k(Ht, { children: [
1200
1200
  N === "idle" && !$ && !D && /* @__PURE__ */ k(
1201
1201
  "button",
@@ -1212,7 +1212,7 @@ const qn = ({
1212
1212
  ),
1213
1213
  /* @__PURE__ */ k("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1214
1214
  l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
1215
- j && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: j }),
1215
+ W && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: W }),
1216
1216
  /* @__PURE__ */ n(
1217
1217
  "button",
1218
1218
  {
@@ -1229,20 +1229,20 @@ const qn = ({
1229
1229
  /* @__PURE__ */ k(
1230
1230
  "div",
1231
1231
  {
1232
- className: `ll-expanded__pip ${xe && (w || J) ? "is-visible" : ""}`,
1232
+ className: `ll-expanded__pip ${xe && (w || Q) ? "is-visible" : ""}`,
1233
1233
  children: [
1234
1234
  /* @__PURE__ */ n(
1235
1235
  "div",
1236
1236
  {
1237
1237
  ref: oe,
1238
- className: J ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1238
+ className: Q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1239
1239
  }
1240
1240
  ),
1241
1241
  /* @__PURE__ */ n(
1242
1242
  "div",
1243
1243
  {
1244
1244
  ref: Me,
1245
- className: !J && w ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1245
+ className: !Q && w ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1246
1246
  }
1247
1247
  )
1248
1248
  ]
@@ -1251,18 +1251,18 @@ const qn = ({
1251
1251
  xe ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
1252
1252
  ke && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: ke }) }),
1253
1253
  /* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
1254
- qe && /* @__PURE__ */ n(
1254
+ Be && /* @__PURE__ */ n(
1255
1255
  "button",
1256
1256
  {
1257
1257
  type: "button",
1258
- className: `ll-tool ${J ? "is-on" : ""}`,
1258
+ className: `ll-tool ${Q ? "is-on" : ""}`,
1259
1259
  onClick: q,
1260
- "aria-label": J ? "Stop sharing screen" : "Share screen",
1261
- title: J ? "Stop sharing" : "Share screen",
1262
- children: /* @__PURE__ */ n(Wn, {})
1260
+ "aria-label": Q ? "Stop sharing screen" : "Share screen",
1261
+ title: Q ? "Stop sharing" : "Share screen",
1262
+ children: /* @__PURE__ */ n(jn, {})
1263
1263
  }
1264
1264
  ),
1265
- Oe && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
1265
+ qe && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
1266
1266
  /* @__PURE__ */ n(
1267
1267
  "button",
1268
1268
  {
@@ -1280,19 +1280,19 @@ const qn = ({
1280
1280
  type: "button",
1281
1281
  className: `ll-tool ll-tool--right ${w ? "is-on" : ""}`,
1282
1282
  onClick: (h) => {
1283
- h.stopPropagation(), Y((j) => !j), ne(!1);
1283
+ h.stopPropagation(), Y((W) => !W), ne(!1);
1284
1284
  },
1285
1285
  "aria-label": "Camera devices",
1286
1286
  "aria-haspopup": "listbox",
1287
1287
  "aria-expanded": le,
1288
- children: /* @__PURE__ */ n(je, {})
1288
+ children: /* @__PURE__ */ n(Ye, {})
1289
1289
  }
1290
1290
  ),
1291
- le && X.length > 0 && /* @__PURE__ */ n(
1291
+ le && J.length > 0 && /* @__PURE__ */ n(
1292
1292
  Pt,
1293
1293
  {
1294
1294
  label: "Camera",
1295
- devices: X,
1295
+ devices: J,
1296
1296
  activeId: de,
1297
1297
  onPick: (h) => {
1298
1298
  Y(!1), _e(h);
@@ -1305,28 +1305,28 @@ const qn = ({
1305
1305
  "button",
1306
1306
  {
1307
1307
  type: "button",
1308
- className: `ll-tool ll-tool--left ${m ? "is-muted" : ""}`,
1308
+ className: `ll-tool ll-tool--left ${g ? "is-muted" : ""}`,
1309
1309
  onClick: be,
1310
- "aria-label": m ? "Unmute microphone" : "Mute microphone",
1311
- title: m ? "Unmute" : "Mute",
1312
- children: /* @__PURE__ */ n(Yn, { muted: m })
1310
+ "aria-label": g ? "Unmute microphone" : "Mute microphone",
1311
+ title: g ? "Unmute" : "Mute",
1312
+ children: /* @__PURE__ */ n(Yn, { muted: g })
1313
1313
  }
1314
1314
  ),
1315
1315
  /* @__PURE__ */ n(
1316
1316
  "button",
1317
1317
  {
1318
1318
  type: "button",
1319
- className: `ll-tool ll-tool--right ${m ? "is-muted" : ""}`,
1319
+ className: `ll-tool ll-tool--right ${g ? "is-muted" : ""}`,
1320
1320
  onClick: (h) => {
1321
- h.stopPropagation(), ne((j) => !j), Y(!1);
1321
+ h.stopPropagation(), ne((W) => !W), Y(!1);
1322
1322
  },
1323
1323
  "aria-label": "Microphone devices",
1324
1324
  "aria-haspopup": "listbox",
1325
- "aria-expanded": G,
1326
- children: /* @__PURE__ */ n(je, {})
1325
+ "aria-expanded": K,
1326
+ children: /* @__PURE__ */ n(Ye, {})
1327
1327
  }
1328
1328
  ),
1329
- G && E.length > 0 && /* @__PURE__ */ n(
1329
+ K && E.length > 0 && /* @__PURE__ */ n(
1330
1330
  Pt,
1331
1331
  {
1332
1332
  label: "Microphone",
@@ -1341,26 +1341,26 @@ const qn = ({
1341
1341
  {
1342
1342
  type: "button",
1343
1343
  className: `ll-tool ${ue ? "is-muted" : ""}`,
1344
- onClick: Ke,
1344
+ onClick: Qe,
1345
1345
  "aria-label": ue ? "Unmute speaker" : "Mute speaker",
1346
1346
  title: ue ? "Unmute speaker" : "Mute speaker",
1347
1347
  children: /* @__PURE__ */ n(Gn, { muted: ue })
1348
1348
  }
1349
1349
  )
1350
1350
  ] }),
1351
- Be && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Re, children: [
1351
+ Ue && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Re, children: [
1352
1352
  /* @__PURE__ */ n(
1353
1353
  "input",
1354
1354
  {
1355
1355
  type: "text",
1356
1356
  className: "ll-message-input__field",
1357
1357
  placeholder: "Message...",
1358
- value: K,
1358
+ value: X,
1359
1359
  onChange: (h) => ae(h.target.value),
1360
1360
  "aria-label": "Message the agent"
1361
1361
  }
1362
1362
  ),
1363
- K.trim() && /* @__PURE__ */ n(
1363
+ X.trim() && /* @__PURE__ */ n(
1364
1364
  "button",
1365
1365
  {
1366
1366
  type: "submit",
@@ -1381,9 +1381,9 @@ const qn = ({
1381
1381
  )
1382
1382
  ] }) : null,
1383
1383
  (() => {
1384
- if (y && N !== "error")
1384
+ if (v && N !== "error")
1385
1385
  return /* @__PURE__ */ k("div", { className: "ll-expanded__banner", role: "alert", children: [
1386
- /* @__PURE__ */ n("span", { children: y }),
1386
+ /* @__PURE__ */ n("span", { children: v }),
1387
1387
  /* @__PURE__ */ n(
1388
1388
  "button",
1389
1389
  {
@@ -1396,7 +1396,7 @@ const qn = ({
1396
1396
  )
1397
1397
  ] });
1398
1398
  if (!D || N !== "error") return null;
1399
- let h = "Failed to connect", j = "Try again";
1399
+ let h = "Failed to connect", W = "Try again";
1400
1400
  return D === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : D === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : D === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : D === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : D === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : D.length < 80 && (h = D), /* @__PURE__ */ k("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1401
1401
  /* @__PURE__ */ n("span", { children: h }),
1402
1402
  /* @__PURE__ */ n(
@@ -1405,7 +1405,7 @@ const qn = ({
1405
1405
  type: "button",
1406
1406
  className: "ll-expanded__banner-retry",
1407
1407
  onClick: ye,
1408
- children: j
1408
+ children: W
1409
1409
  }
1410
1410
  )
1411
1411
  ] });
@@ -1414,7 +1414,7 @@ const qn = ({
1414
1414
  }
1415
1415
  );
1416
1416
  };
1417
- function je() {
1417
+ function Ye() {
1418
1418
  return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
1419
1419
  }
1420
1420
  function Rt() {
@@ -1426,7 +1426,7 @@ function Rt() {
1426
1426
  function Tt() {
1427
1427
  return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
1428
1428
  }
1429
- function Wn() {
1429
+ function jn() {
1430
1430
  return /* @__PURE__ */ k("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1431
1431
  /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
1432
1432
  /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
@@ -1494,7 +1494,7 @@ const Pt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
1494
1494
  '[data-ll-private="true"]',
1495
1495
  ".ll-widget"
1496
1496
  ];
1497
- function lt(e) {
1497
+ function ct(e) {
1498
1498
  let t = e;
1499
1499
  for (; t; ) {
1500
1500
  for (const r of Xn)
@@ -1503,8 +1503,8 @@ function lt(e) {
1503
1503
  }
1504
1504
  return !1;
1505
1505
  }
1506
- function Ge(e) {
1507
- if (lt(e)) return !1;
1506
+ function Je(e) {
1507
+ if (ct(e)) return !1;
1508
1508
  if (e instanceof HTMLInputElement) {
1509
1509
  if (e.type === "password") return !1;
1510
1510
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -1512,7 +1512,7 @@ function Ge(e) {
1512
1512
  }
1513
1513
  return !0;
1514
1514
  }
1515
- const We = 4096, Jn = 20, Qn = 20, Zn = 10, er = 10, tr = 30, Dt = 500, nr = [
1515
+ const Ge = 4096, Jn = 20, Qn = 20, Zn = 10, er = 10, tr = 30, Dt = 500, nr = [
1516
1516
  '[data-ll-private="true"]',
1517
1517
  ".ll-widget",
1518
1518
  "script",
@@ -1520,7 +1520,7 @@ const We = 4096, Jn = 20, Qn = 20, Zn = 10, er = 10, tr = 30, Dt = 500, nr = [
1520
1520
  "noscript",
1521
1521
  "iframe"
1522
1522
  ];
1523
- function ze(e) {
1523
+ function He(e) {
1524
1524
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
1525
1525
  let t = e;
1526
1526
  for (; t; ) {
@@ -1530,7 +1530,7 @@ function ze(e) {
1530
1530
  }
1531
1531
  return !1;
1532
1532
  }
1533
- function He(e) {
1533
+ function Oe(e) {
1534
1534
  if (typeof window > "u") return !0;
1535
1535
  const t = e.getBoundingClientRect();
1536
1536
  if (t.width <= 0 || t.height <= 0) return !1;
@@ -1573,70 +1573,70 @@ function rr(e, t = {}) {
1573
1573
  const i = typeof window < "u" && window.location.href || "", o = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
1574
1574
  r.querySelectorAll("[data-ll-region]")
1575
1575
  ), d = [];
1576
- for (const m of s) {
1576
+ for (const g of s) {
1577
1577
  if (d.length >= Zn) break;
1578
- if (ze(m) || !He(m)) continue;
1579
- const y = m.getAttribute("data-ll-region") ?? "", E = m.getAttribute("data-ll-intent") ?? void 0, w = me(
1580
- (m.innerText || m.textContent || "").trim(),
1578
+ if (He(g) || !Oe(g)) continue;
1579
+ const v = g.getAttribute("data-ll-region") ?? "", E = g.getAttribute("data-ll-intent") ?? void 0, w = me(
1580
+ (g.innerText || g.textContent || "").trim(),
1581
1581
  Dt * 2
1582
1582
  );
1583
- !y || !w || d.push({ id: y, intent: E, text: w });
1583
+ !v || !w || d.push({ id: v, intent: E, text: w });
1584
1584
  }
1585
- const u = [], g = ["H1", "H2", "H3", "H4", "H5", "H6"], p = Array.from(
1585
+ const u = [], y = ["H1", "H2", "H3", "H4", "H5", "H6"], p = Array.from(
1586
1586
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
1587
1587
  );
1588
- for (const m of p) {
1589
- if (ze(m) || !He(m)) continue;
1590
- const y = (m.textContent || "").trim();
1591
- y && u.push(`${m.tagName}: ${me(y, 200)}`);
1588
+ for (const g of p) {
1589
+ if (He(g) || !Oe(g)) continue;
1590
+ const v = (g.textContent || "").trim();
1591
+ v && u.push(`${g.tagName}: ${me(v, 200)}`);
1592
1592
  }
1593
1593
  const a = Array.from(r.querySelectorAll("p, li"));
1594
- for (const m of a) {
1595
- if (ze(m) || !He(m) || g.includes(m.tagName)) continue;
1596
- const y = (m.textContent || "").trim();
1597
- y.length > 10 && u.push(me(y, Dt));
1594
+ for (const g of a) {
1595
+ if (He(g) || !Oe(g) || y.includes(g.tagName)) continue;
1596
+ const v = (g.textContent || "").trim();
1597
+ v.length > 10 && u.push(me(v, Dt));
1598
1598
  }
1599
1599
  const c = u.join(`
1600
1600
  `), S = [], L = Array.from(r.querySelectorAll("a[href]"));
1601
- for (const m of L) {
1601
+ for (const g of L) {
1602
1602
  if (S.length >= Jn) break;
1603
- if (ze(m) || !He(m)) continue;
1604
- const y = m.getAttribute("href") || "", E = (m.textContent || "").trim();
1605
- !y || !E || S.push({ href: y, text: me(E, 100) });
1603
+ if (He(g) || !Oe(g)) continue;
1604
+ const v = g.getAttribute("href") || "", E = (g.textContent || "").trim();
1605
+ !v || !E || S.push({ href: v, text: me(E, 100) });
1606
1606
  }
1607
1607
  const N = [], H = Array.from(
1608
1608
  r.querySelectorAll(
1609
1609
  "input, textarea, select"
1610
1610
  )
1611
1611
  );
1612
- for (const m of H) {
1612
+ for (const g of H) {
1613
1613
  if (N.length >= Qn) break;
1614
- if (ze(m) || !Ge(m) || !He(m)) continue;
1615
- const y = $t(m), E = m instanceof HTMLInputElement ? m.type : m.tagName.toLowerCase();
1616
- y && N.push({ label: me(y, 100), type: E });
1614
+ if (He(g) || !Je(g) || !Oe(g)) continue;
1615
+ const v = $t(g), E = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
1616
+ v && N.push({ label: me(v, 100), type: E });
1617
1617
  }
1618
1618
  const R = Array.from(
1619
1619
  r.querySelectorAll("[data-ll-form]")
1620
1620
  ), $ = [];
1621
- for (const m of R) {
1621
+ for (const g of R) {
1622
1622
  if ($.length >= er) break;
1623
- if (lt(m)) continue;
1624
- const y = m.getAttribute("data-ll-form") || "";
1625
- if (!y) continue;
1626
- const E = m.getAttribute("data-ll-intent") || void 0, w = Array.from(
1627
- m.querySelectorAll(
1623
+ if (ct(g)) continue;
1624
+ const v = g.getAttribute("data-ll-form") || "";
1625
+ if (!v) continue;
1626
+ const E = g.getAttribute("data-ll-intent") || void 0, w = Array.from(
1627
+ g.querySelectorAll(
1628
1628
  "[data-ll-field]"
1629
1629
  )
1630
1630
  ), O = [];
1631
- for (const X of w) {
1631
+ for (const J of w) {
1632
1632
  if (O.length >= tr) break;
1633
- if (!Ge(X)) continue;
1634
- const de = X.getAttribute("data-ll-field") || "";
1633
+ if (!Je(J)) continue;
1634
+ const de = J.getAttribute("data-ll-field") || "";
1635
1635
  if (!de) continue;
1636
- const J = $t(X) || de, Q = X instanceof HTMLInputElement ? X.type : X.tagName.toLowerCase();
1637
- O.push({ name: de, label: me(J, 100), type: Q });
1636
+ const Q = $t(J) || de, Z = J instanceof HTMLInputElement ? J.type : J.tagName.toLowerCase();
1637
+ O.push({ name: de, label: me(Q, 100), type: Z });
1638
1638
  }
1639
- $.push({ id: y, intent: E, fields: O });
1639
+ $.push({ id: v, intent: E, fields: O });
1640
1640
  }
1641
1641
  const I = {
1642
1642
  url: i,
@@ -1650,11 +1650,11 @@ function rr(e, t = {}) {
1650
1650
  extras: e
1651
1651
  };
1652
1652
  let D = Ee(JSON.stringify(I.regions)) + Ee(I.visibleText) + Ee(JSON.stringify(I.visibleLinks)) + Ee(JSON.stringify(I.visibleFields));
1653
- for (; D > We && I.visibleFields.length > 0; )
1653
+ for (; D > Ge && I.visibleFields.length > 0; )
1654
1654
  I.visibleFields.pop(), D = Ee(JSON.stringify(I.visibleFields));
1655
- for (; D > We && I.visibleLinks.length > 0; )
1655
+ for (; D > Ge && I.visibleLinks.length > 0; )
1656
1656
  I.visibleLinks.pop(), D -= 80;
1657
- return Ee(I.visibleText) > We && (I.visibleText = me(I.visibleText, We - 100)), I;
1657
+ return Ee(I.visibleText) > Ge && (I.visibleText = me(I.visibleText, Ge - 100)), I;
1658
1658
  }
1659
1659
  let Ce = null;
1660
1660
  function zt(e, t = {}) {
@@ -1677,14 +1677,14 @@ function ar(e) {
1677
1677
  const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
1678
1678
  for (const s of l) {
1679
1679
  if (o.length >= or) break;
1680
- if (lt(s)) continue;
1680
+ if (ct(s)) continue;
1681
1681
  const d = s.getAttribute("href") || "";
1682
1682
  if (!lr(d)) continue;
1683
- let u = d, g = !0;
1683
+ let u = d, y = !0;
1684
1684
  try {
1685
1685
  if (typeof window < "u") {
1686
1686
  const a = new URL(d, r);
1687
- g = a.origin === r, g && d.startsWith("http") && (u = a.pathname + a.search + a.hash);
1687
+ y = a.origin === r, y && d.startsWith("http") && (u = a.pathname + a.search + a.hash);
1688
1688
  }
1689
1689
  } catch {
1690
1690
  continue;
@@ -1692,7 +1692,7 @@ function ar(e) {
1692
1692
  if (i.has(u)) continue;
1693
1693
  i.add(u);
1694
1694
  const p = (s.textContent || "").trim().slice(0, 120);
1695
- o.push({ href: u, text: p, internal: g });
1695
+ o.push({ href: u, text: p, internal: y });
1696
1696
  }
1697
1697
  return o;
1698
1698
  }
@@ -1748,7 +1748,7 @@ const pr = /* @__PURE__ */ new Set([
1748
1748
  "request_routes"
1749
1749
  ]);
1750
1750
  function hr(e) {
1751
- var ht, mt, gt, yt, vt, bt, wt;
1751
+ var gt, yt, vt, bt, wt, _t, xt;
1752
1752
  const {
1753
1753
  agentId: t,
1754
1754
  apiKey: r,
@@ -1758,7 +1758,7 @@ function hr(e) {
1758
1758
  autoConnect: s = !1,
1759
1759
  displayMode: d,
1760
1760
  defaultDisplayMode: u = "expanded",
1761
- onDisplayModeChange: g,
1761
+ onDisplayModeChange: y,
1762
1762
  position: p = "bottom-right",
1763
1763
  mobileBreakpoint: a = 640,
1764
1764
  persistKey: c = "ll-widget",
@@ -1770,19 +1770,19 @@ function hr(e) {
1770
1770
  greeting: $,
1771
1771
  avatarImageUrl: I,
1772
1772
  agentName: D,
1773
- branding: m = {},
1774
- allowCamera: y = !0,
1773
+ branding: g = {},
1774
+ allowCamera: v = !0,
1775
1775
  allowScreenShare: E = !0,
1776
1776
  allowTyping: w = !0,
1777
1777
  showOn: O,
1778
- hideOn: X,
1778
+ hideOn: J,
1779
1779
  pathname: de,
1780
- onNavigate: J,
1781
- onScrollToSelector: Q,
1780
+ onNavigate: Q,
1781
+ onScrollToSelector: Z,
1782
1782
  getPageContext: ue,
1783
- pageContextExtras: Oe,
1784
- onScrollPage: qe,
1785
- onClick: Be,
1783
+ pageContextExtras: qe,
1784
+ onScrollPage: Be,
1785
+ onClick: Ue,
1786
1786
  capabilities: Ne,
1787
1787
  onConnect: fe,
1788
1788
  onDisconnect: ge,
@@ -1792,42 +1792,42 @@ function hr(e) {
1792
1792
  onAgentEvent: we,
1793
1793
  onAgentCommand: _e,
1794
1794
  controlledSession: q,
1795
- className: Ke,
1796
- style: Ue,
1797
- zIndex: Fe = 2147483647
1798
- } = e, Ae = Cn(de), Ie = Tn(Ae, O, X);
1795
+ className: Qe,
1796
+ style: Fe,
1797
+ zIndex: We = 2147483647
1798
+ } = e, Ae = Cn(de), Ie = Tn(Ae, O, J);
1799
1799
  P(() => {
1800
1800
  ir(), dr();
1801
1801
  }, [Ae]);
1802
1802
  const ie = N !== void 0, [pe, xe] = C(() => {
1803
- var v;
1804
- return N ?? ((v = L == null ? void 0 : L[0]) == null ? void 0 : v.id);
1805
- }), Z = ie ? N : pe, V = Ve(
1806
- () => (L == null ? void 0 : L.find((v) => v.id === Z)) ?? null,
1807
- [L, Z]
1808
- ), Me = (V == null ? void 0 : V.agentId) ?? t, [oe, G] = xn({
1803
+ var m;
1804
+ return N ?? ((m = L == null ? void 0 : L[0]) == null ? void 0 : m.id);
1805
+ }), ee = ie ? N : pe, V = Ke(
1806
+ () => (L == null ? void 0 : L.find((m) => m.id === ee)) ?? null,
1807
+ [L, ee]
1808
+ ), Me = (V == null ? void 0 : V.agentId) ?? t, [oe, K] = xn({
1809
1809
  value: d,
1810
1810
  defaultValue: u,
1811
- onChange: g,
1811
+ onChange: y,
1812
1812
  persistKey: c,
1813
1813
  disablePersistence: S
1814
- }), ne = Ln(a), le = dn(), Y = un(), K = pn(), ae = hn(), Re = mn(), [Xe, ke] = C(!1), [Te, Pe] = C(!1), [h, j] = C(!1), [at, Bt] = C(!1), [Je, Ut] = C(!1), Qe = M(J), Ze = M(Q), et = M(qe), tt = M(Be), ct = M(ue), st = M(Oe), nt = M(Ne), ee = M(null);
1815
- Qe.current = J, Ze.current = Q, et.current = qe, tt.current = Be, ct.current = ue, st.current = Oe, nt.current = Ne;
1816
- function ce(v) {
1817
- const f = nt.current;
1818
- return f ? f.includes(v) : !0;
1814
+ }), ne = Ln(a), le = dn(), Y = un(), X = pn(), ae = hn(), Re = mn(), [Ze, ke] = C(!1), [Te, Pe] = C(!1), [h, W] = C(!1), [st, Bt] = C(!1), [et, Ut] = C(!1), tt = M(Q), nt = M(Z), rt = M(Be), it = M(Ue), dt = M(ue), ut = M(qe), ot = M(Ne), te = M(null);
1815
+ tt.current = Q, nt.current = Z, rt.current = Be, it.current = Ue, dt.current = ue, ut.current = qe, ot.current = Ne;
1816
+ function ce(m) {
1817
+ const f = ot.current;
1818
+ return f ? f.includes(m) : !0;
1819
1819
  }
1820
- function se(v, f) {
1820
+ function se(m, f) {
1821
1821
  console.warn(
1822
- `[LiveLayer] Agent command "${v}" blocked — capability "${f}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
1822
+ `[LiveLayer] Agent command "${m}" blocked — capability "${f}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
1823
1823
  );
1824
1824
  }
1825
- const rt = x(
1826
- (v) => {
1827
- var te, _t, xt, kt;
1828
- const f = v;
1825
+ const De = x(
1826
+ (m) => {
1827
+ var G, je, Ve, kt;
1828
+ const f = m;
1829
1829
  if (!(!f.type || typeof f.type != "string")) {
1830
- if (we == null || we({ eventName: f.type, data: v }), f.type === "navigate") {
1830
+ if (we == null || we({ eventName: f.type, data: m }), f.type === "navigate") {
1831
1831
  if (!ce("navigate")) {
1832
1832
  se("navigate", "navigate");
1833
1833
  return;
@@ -1839,9 +1839,9 @@ function hr(e) {
1839
1839
  );
1840
1840
  return;
1841
1841
  }
1842
- if (Qe.current) {
1842
+ if (tt.current) {
1843
1843
  try {
1844
- Qe.current(_);
1844
+ tt.current(_);
1845
1845
  } catch (A) {
1846
1846
  console.warn(
1847
1847
  `[LiveLayer] onNavigate threw for "${_}". Falling back. Error:`,
@@ -1878,9 +1878,9 @@ function hr(e) {
1878
1878
  const _ = typeof f.selector == "string" ? f.selector : null;
1879
1879
  if (!_) return;
1880
1880
  const A = f.behavior === "instant" ? "instant" : "smooth";
1881
- if (Ze.current) {
1881
+ if (nt.current) {
1882
1882
  try {
1883
- Ze.current(
1883
+ nt.current(
1884
1884
  _,
1885
1885
  A
1886
1886
  );
@@ -1917,8 +1917,8 @@ function hr(e) {
1917
1917
  se("request_page_context", "read_page");
1918
1918
  return;
1919
1919
  }
1920
- const _ = typeof f.requestId == "string" ? f.requestId : void 0, A = (te = ee.current) == null ? void 0 : te.call(ee), T = (U) => {
1921
- const W = A, re = W == null ? void 0 : W.localParticipant;
1920
+ const _ = typeof f.requestId == "string" ? f.requestId : void 0, A = (G = te.current) == null ? void 0 : G.call(te), T = (U) => {
1921
+ const j = A, re = j == null ? void 0 : j.localParticipant;
1922
1922
  if (re != null && re.publishData)
1923
1923
  try {
1924
1924
  const he = _ ? { ...U, requestId: _ } : U, Le = new TextEncoder().encode(JSON.stringify(he));
@@ -1926,15 +1926,15 @@ function hr(e) {
1926
1926
  } catch (he) {
1927
1927
  console.warn("[LiveLayer] publishData failed.", he);
1928
1928
  }
1929
- }, z = st.current, B = ct.current;
1929
+ }, z = ut.current, B = dt.current;
1930
1930
  try {
1931
1931
  if (B) {
1932
1932
  const U = B(z);
1933
1933
  if (U instanceof Promise) {
1934
- T({ type: "page_context_pending" }), U.then((W) => T({ type: "page_context", context: W })).catch((W) => {
1934
+ T({ type: "page_context_pending" }), U.then((j) => T({ type: "page_context", context: j })).catch((j) => {
1935
1935
  console.warn(
1936
1936
  "[LiveLayer] getPageContext rejected; falling back to default walker.",
1937
- W
1937
+ j
1938
1938
  ), T({
1939
1939
  type: "page_context",
1940
1940
  context: zt(z)
@@ -1973,9 +1973,9 @@ function hr(e) {
1973
1973
  return;
1974
1974
  }
1975
1975
  const A = f.behavior === "instant" ? "instant" : "smooth";
1976
- if (et.current) {
1976
+ if (rt.current) {
1977
1977
  try {
1978
- et.current(
1978
+ rt.current(
1979
1979
  _,
1980
1980
  A
1981
1981
  );
@@ -1999,9 +1999,9 @@ function hr(e) {
1999
1999
  console.warn("[LiveLayer] click: missing selector.");
2000
2000
  return;
2001
2001
  }
2002
- if (tt.current) {
2002
+ if (it.current) {
2003
2003
  try {
2004
- tt.current(_);
2004
+ it.current(_);
2005
2005
  } catch (T) {
2006
2006
  console.warn("[LiveLayer] onClick threw.", T);
2007
2007
  }
@@ -2029,7 +2029,7 @@ function hr(e) {
2029
2029
  );
2030
2030
  return;
2031
2031
  }
2032
- (_t = A.click) == null || _t.call(A);
2032
+ (je = A.click) == null || je.call(A);
2033
2033
  return;
2034
2034
  }
2035
2035
  if (f.type === "fill_form" || f.type === "focus_field") {
@@ -2071,7 +2071,7 @@ function hr(e) {
2071
2071
  );
2072
2072
  return;
2073
2073
  }
2074
- if (!Ge(B)) {
2074
+ if (!Je(B)) {
2075
2075
  console.warn(
2076
2076
  `[LiveLayer] focus_field: field "${z}" is privacy-protected and not focusable.`
2077
2077
  );
@@ -2094,7 +2094,7 @@ function hr(e) {
2094
2094
  );
2095
2095
  continue;
2096
2096
  }
2097
- if (!Ge(U)) {
2097
+ if (!Je(U)) {
2098
2098
  console.warn(
2099
2099
  `[LiveLayer] fill_form: field "${z}" is privacy-protected (password / cc-* / private). Skipping.`
2100
2100
  );
@@ -2102,10 +2102,10 @@ function hr(e) {
2102
2102
  }
2103
2103
  try {
2104
2104
  fr(U, B);
2105
- } catch (W) {
2105
+ } catch (j) {
2106
2106
  console.warn(
2107
2107
  `[LiveLayer] fill_form: failed to set "${z}".`,
2108
- W
2108
+ j
2109
2109
  );
2110
2110
  }
2111
2111
  }
@@ -2137,7 +2137,7 @@ function hr(e) {
2137
2137
  );
2138
2138
  return;
2139
2139
  }
2140
- const T = typeof f.requestId == "string" ? f.requestId : void 0, z = (xt = ee.current) == null ? void 0 : xt.call(ee), B = (re) => {
2140
+ const T = typeof f.requestId == "string" ? f.requestId : void 0, z = (Ve = te.current) == null ? void 0 : Ve.call(te), B = (re) => {
2141
2141
  const he = z, Le = he == null ? void 0 : he.localParticipant;
2142
2142
  if (Le != null && Le.publishData)
2143
2143
  try {
@@ -2147,14 +2147,14 @@ function hr(e) {
2147
2147
  }
2148
2148
  };
2149
2149
  let U = !1;
2150
- const W = () => {
2150
+ const j = () => {
2151
2151
  U = !0, B({ type: "form_submitted", formId: _ });
2152
2152
  };
2153
- A.addEventListener("submit", W, { once: !0 });
2153
+ A.addEventListener("submit", j, { once: !0 });
2154
2154
  try {
2155
2155
  typeof A.requestSubmit == "function" ? A.requestSubmit() : A.submit();
2156
2156
  } catch (re) {
2157
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", re), A.removeEventListener("submit", W), B({
2157
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", re), A.removeEventListener("submit", j), B({
2158
2158
  type: "form_submit_blocked",
2159
2159
  formId: _,
2160
2160
  reason: "exception"
@@ -2162,7 +2162,7 @@ function hr(e) {
2162
2162
  return;
2163
2163
  }
2164
2164
  setTimeout(() => {
2165
- U || (A.removeEventListener("submit", W), B({
2165
+ U || (A.removeEventListener("submit", j), B({
2166
2166
  type: "form_submit_blocked",
2167
2167
  formId: _,
2168
2168
  reason: "validation"
@@ -2175,11 +2175,11 @@ function hr(e) {
2175
2175
  se("request_routes", "read_page");
2176
2176
  return;
2177
2177
  }
2178
- const _ = typeof f.requestId == "string" ? f.requestId : void 0, T = (kt = ee.current) == null ? void 0 : kt.call(ee), z = T == null ? void 0 : T.localParticipant;
2178
+ const _ = typeof f.requestId == "string" ? f.requestId : void 0, T = (kt = te.current) == null ? void 0 : kt.call(te), z = T == null ? void 0 : T.localParticipant;
2179
2179
  if (!(z != null && z.publishData)) return;
2180
2180
  try {
2181
- const B = sr(), U = _ ? { type: "routes", routes: B, requestId: _ } : { type: "routes", routes: B }, W = new TextEncoder().encode(JSON.stringify(U));
2182
- z.publishData(W, { reliable: !0 });
2181
+ const B = sr(), U = _ ? { type: "routes", routes: B, requestId: _ } : { type: "routes", routes: B }, j = new TextEncoder().encode(JSON.stringify(U));
2182
+ z.publishData(j, { reliable: !0 });
2183
2183
  } catch (B) {
2184
2184
  console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
2185
2185
  }
@@ -2195,16 +2195,30 @@ function hr(e) {
2195
2195
  apiKey: r,
2196
2196
  sessionEndpoint: o,
2197
2197
  sessionBody: l,
2198
- onDataMessage: q ? void 0 : rt
2198
+ onDataMessage: q ? void 0 : De
2199
2199
  });
2200
2200
  P(() => {
2201
2201
  if (q != null && q.subscribeToDataMessages)
2202
- return q.subscribeToDataMessages(rt);
2203
- }, [q, rt]), ee.current = () => {
2204
- var v;
2205
- return (v = F.getRoom) == null ? void 0 : v.call(F);
2206
- };
2207
- const b = Ve(() => q ? {
2202
+ return q.subscribeToDataMessages(De);
2203
+ }, [q, De]), te.current = () => {
2204
+ var m;
2205
+ return (m = F.getRoom) == null ? void 0 : m.call(F);
2206
+ }, P(() => {
2207
+ var G;
2208
+ if (typeof window > "u") return;
2209
+ const m = ((G = window.location) == null ? void 0 : G.hostname) || "";
2210
+ if (m === "localhost" || m === "127.0.0.1" || m === "0.0.0.0" || m.endsWith(".local") || m.endsWith(".test"))
2211
+ return window.__livelayerSimulateCommand = (je) => {
2212
+ try {
2213
+ De(je);
2214
+ } catch (Ve) {
2215
+ console.warn("[LiveLayer] simulate-command threw:", Ve);
2216
+ }
2217
+ }, () => {
2218
+ delete window.__livelayerSimulateCommand;
2219
+ };
2220
+ }, [De]);
2221
+ const b = Ke(() => q ? {
2208
2222
  connectionState: q.connectionState,
2209
2223
  agentState: q.agentState,
2210
2224
  transcript: q.transcript,
@@ -2235,47 +2249,47 @@ function hr(e) {
2235
2249
  disconnect: F.disconnect,
2236
2250
  getRoom: F.getRoom,
2237
2251
  isControlled: !1
2238
- }, [q, F]), dt = M(null);
2252
+ }, [q, F]), ft = M(null);
2239
2253
  P(() => {
2240
- const v = b.videoElement, f = dt.current;
2241
- if (!(!v || !f))
2242
- return f.appendChild(v), () => {
2243
- v.parentNode === f && f.removeChild(v);
2254
+ const m = b.videoElement, f = ft.current;
2255
+ if (!(!m || !f))
2256
+ return f.appendChild(m), () => {
2257
+ m.parentNode === f && f.removeChild(m);
2244
2258
  };
2245
2259
  }, [b.videoElement]), P(() => {
2246
- const v = b.audioElement;
2247
- if (!v) return;
2248
- le.attach(v);
2249
- const f = v.play();
2250
- return f && typeof f.catch == "function" && f.catch((te) => {
2251
- (te == null ? void 0 : te.name) === "NotAllowedError" && ke(!0);
2260
+ const m = b.audioElement;
2261
+ if (!m) return;
2262
+ le.attach(m);
2263
+ const f = m.play();
2264
+ return f && typeof f.catch == "function" && f.catch((G) => {
2265
+ (G == null ? void 0 : G.name) === "NotAllowedError" && ke(!0);
2252
2266
  }), () => {
2253
2267
  le.detach();
2254
2268
  };
2255
2269
  }, [b.audioElement]), P(() => {
2256
2270
  if (b.isControlled || b.connectionState !== "connected") return;
2257
- const v = b.getRoom();
2258
- if (v)
2259
- return Y.setupMic(v).catch(() => {
2260
- }), K.attachRoom(v), ae.attachRoom(v), Re.refresh(), () => {
2261
- Y.teardownMic(), K.teardown(), ae.teardown();
2271
+ const m = b.getRoom();
2272
+ if (m)
2273
+ return Y.setupMic(m).catch(() => {
2274
+ }), X.attachRoom(m), ae.attachRoom(m), Re.refresh(), () => {
2275
+ Y.teardownMic(), X.teardown(), ae.teardown();
2262
2276
  };
2263
2277
  }, [b.isControlled, b.connectionState]), P(() => {
2264
- const v = b.audioElement;
2265
- v && (v.muted = Je);
2266
- }, [b.audioElement, Je]);
2267
- const Ft = x((v) => {
2278
+ const m = b.audioElement;
2279
+ m && (m.muted = et);
2280
+ }, [b.audioElement, et]);
2281
+ const Ft = x((m) => {
2268
2282
  const f = b.getRoom();
2269
2283
  if (f)
2270
2284
  try {
2271
- const te = new TextEncoder().encode(
2272
- JSON.stringify({ type: "user_message", text: v })
2285
+ const G = new TextEncoder().encode(
2286
+ JSON.stringify({ type: "user_message", text: m })
2273
2287
  );
2274
- f.localParticipant.publishData(te, { reliable: !0 });
2288
+ f.localParticipant.publishData(G, { reliable: !0 });
2275
2289
  } catch {
2276
2290
  }
2277
- }, [b]), jt = x(() => {
2278
- Ut((v) => !v);
2291
+ }, [b]), Wt = x(() => {
2292
+ Ut((m) => !m);
2279
2293
  }, []);
2280
2294
  P(() => {
2281
2295
  be == null || be(b.connectionState), b.connectionState === "connected" ? fe == null || fe() : b.connectionState === "disconnected" && (ge == null || ge());
@@ -2284,18 +2298,18 @@ function hr(e) {
2284
2298
  }, [b.transcript, ye]), P(() => {
2285
2299
  ve == null || ve(b.agentState);
2286
2300
  }, [b.agentState, ve]);
2287
- const ut = M(!1);
2301
+ const pt = M(!1);
2288
2302
  P(() => {
2289
- b.isControlled || !s || ut.current || Ie && b.connectionState === "idle" && (ut.current = !0, b.connect());
2303
+ b.isControlled || !s || pt.current || Ie && b.connectionState === "idle" && (pt.current = !0, b.connect());
2290
2304
  }, [s, b.connectionState, b, Ie]);
2291
- const Wt = x(
2292
- (v) => {
2293
- const f = L == null ? void 0 : L.find((te) => te.id === v);
2294
- f && (j(!1), v !== Z && (Pe(!0), b.disconnect(), ie || xe(v), H == null || H(f)));
2305
+ const jt = x(
2306
+ (m) => {
2307
+ const f = L == null ? void 0 : L.find((G) => G.id === m);
2308
+ f && (W(!1), m !== ee && (Pe(!0), b.disconnect(), ie || xe(m), H == null || H(f)));
2295
2309
  },
2296
2310
  [
2297
2311
  L,
2298
- Z,
2312
+ ee,
2299
2313
  b,
2300
2314
  ie,
2301
2315
  H
@@ -2305,40 +2319,40 @@ function hr(e) {
2305
2319
  Te && b.connectionState === "connected" && Pe(!1);
2306
2320
  }, [b.connectionState, Te]), P(() => {
2307
2321
  if (!h) return;
2308
- const v = (f) => {
2309
- f.key === "Escape" && j(!1);
2322
+ const m = (f) => {
2323
+ f.key === "Escape" && W(!1);
2310
2324
  };
2311
- return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
2325
+ return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
2312
2326
  }, [h]);
2313
- const Vt = !!I || !!(V != null && V.avatarImageUrl) || b.isControlled, De = gn(Me, i, Vt);
2314
- Ne === void 0 && ((ht = De.info) != null && ht.capabilities) && (nt.current = De.info.capabilities);
2315
- const it = (V == null ? void 0 : V.name) ?? D ?? ((mt = b.agentConfig) == null ? void 0 : mt.name) ?? ((gt = De.info) == null ? void 0 : gt.name) ?? "Live Layer", ft = (V == null ? void 0 : V.avatarImageUrl) ?? I ?? ((yt = b.agentConfig) == null ? void 0 : yt.avatarImageUrl) ?? ((vt = De.info) == null ? void 0 : vt.avatarImageUrl) ?? null, Yt = R ?? ((bt = b.agentConfig) == null ? void 0 : bt.idleLoopUrl) ?? ((wt = De.info) == null ? void 0 : wt.idleLoopUrl) ?? null, Gt = $ ?? null, Kt = x(() => G("expanded"), [G]), Xt = x(
2316
- () => G("minimized"),
2317
- [G]
2318
- ), pt = x(() => {
2319
- b.disconnect(), G("hidden");
2320
- }, [b, G]), Jt = x(() => {
2321
- const v = b.audioElement;
2322
- v && v.play().then(() => ke(!1)).catch(() => {
2327
+ const Vt = !!I || !!(V != null && V.avatarImageUrl) || b.isControlled, $e = gn(Me, i, Vt);
2328
+ Ne === void 0 && ((gt = $e.info) != null && gt.capabilities) && (ot.current = $e.info.capabilities);
2329
+ const lt = (V == null ? void 0 : V.name) ?? D ?? ((yt = b.agentConfig) == null ? void 0 : yt.name) ?? ((vt = $e.info) == null ? void 0 : vt.name) ?? "Live Layer", ht = (V == null ? void 0 : V.avatarImageUrl) ?? I ?? ((bt = b.agentConfig) == null ? void 0 : bt.avatarImageUrl) ?? ((wt = $e.info) == null ? void 0 : wt.avatarImageUrl) ?? null, Yt = R ?? ((_t = b.agentConfig) == null ? void 0 : _t.idleLoopUrl) ?? ((xt = $e.info) == null ? void 0 : xt.idleLoopUrl) ?? null, Gt = $ ?? null, Kt = x(() => K("expanded"), [K]), Xt = x(
2330
+ () => K("minimized"),
2331
+ [K]
2332
+ ), mt = x(() => {
2333
+ b.disconnect(), K("hidden");
2334
+ }, [b, K]), Jt = x(() => {
2335
+ const m = b.audioElement;
2336
+ m && m.play().then(() => ke(!1)).catch(() => {
2323
2337
  });
2324
2338
  }, [b.audioElement]), Qt = x(() => {
2325
2339
  ke(!1), b.connect();
2326
- }, [b]), $e = {
2327
- ...Ue,
2328
- zIndex: Fe
2340
+ }, [b]), ze = {
2341
+ ...Fe,
2342
+ zIndex: We
2329
2343
  };
2330
- m.primaryColor && ($e["--ll-color-primary"] = m.primaryColor), m.accentColor && ($e["--ll-color-accent"] = m.accentColor), m.backgroundColor && ($e["--ll-color-bg"] = m.backgroundColor), m.textColor && ($e["--ll-color-fg"] = m.textColor);
2344
+ g.primaryColor && (ze["--ll-color-primary"] = g.primaryColor), g.accentColor && (ze["--ll-color-accent"] = g.accentColor), g.backgroundColor && (ze["--ll-color-bg"] = g.backgroundColor), g.textColor && (ze["--ll-color-fg"] = g.textColor);
2331
2345
  const Zt = [
2332
2346
  "ll-widget",
2333
2347
  `ll-widget--${oe}`,
2334
2348
  `ll-widget--${ne ? "mobile" : "desktop"}`,
2335
- Ke
2349
+ Qe
2336
2350
  ].filter(Boolean).join(" ");
2337
2351
  return Ie ? /* @__PURE__ */ k(
2338
2352
  "div",
2339
2353
  {
2340
2354
  className: Zt,
2341
- style: $e,
2355
+ style: ze,
2342
2356
  "data-display-mode": oe,
2343
2357
  "data-position": p,
2344
2358
  children: [
@@ -2348,8 +2362,8 @@ function hr(e) {
2348
2362
  position: p,
2349
2363
  isMobile: ne,
2350
2364
  isSpeaking: b.agentState === "speaking",
2351
- onExpand: () => G("expanded"),
2352
- label: `Open ${it} widget`
2365
+ onExpand: () => K("expanded"),
2366
+ label: `Open ${lt} widget`
2353
2367
  }
2354
2368
  ),
2355
2369
  oe === "minimized" && /* @__PURE__ */ n(
@@ -2357,66 +2371,66 @@ function hr(e) {
2357
2371
  {
2358
2372
  position: p,
2359
2373
  isMobile: ne,
2360
- agentName: it,
2361
- avatarImageUrl: ft,
2374
+ agentName: lt,
2375
+ avatarImageUrl: ht,
2362
2376
  agentState: b.agentState,
2363
2377
  isMuted: Y.isMuted,
2364
2378
  audioLevel: le,
2365
2379
  onExpand: Kt,
2366
2380
  onToggleMute: Y.toggleMute,
2367
- onClose: pt
2381
+ onClose: mt
2368
2382
  }
2369
2383
  ),
2370
2384
  oe === "expanded" && /* @__PURE__ */ n(
2371
- jn,
2385
+ Wn,
2372
2386
  {
2373
2387
  position: p,
2374
2388
  isMobile: ne,
2375
- agentName: it,
2376
- avatarImageUrl: ft,
2389
+ agentName: lt,
2390
+ avatarImageUrl: ht,
2377
2391
  idleLoopUrl: Yt,
2378
2392
  greeting: Gt,
2379
- branding: m,
2393
+ branding: g,
2380
2394
  teamMembers: L,
2381
- currentTeamMemberId: Z,
2395
+ currentTeamMemberId: ee,
2382
2396
  isSwitchingTeamMember: Te,
2383
2397
  teamSwitcherOpen: h,
2384
- onToggleTeamSwitcher: () => j((v) => !v),
2385
- onSelectTeamMember: Wt,
2398
+ onToggleTeamSwitcher: () => W((m) => !m),
2399
+ onSelectTeamMember: jt,
2386
2400
  connectionState: b.connectionState,
2387
2401
  agentState: b.agentState,
2388
2402
  transcript: b.transcript,
2389
2403
  isMuted: Y.isMuted,
2390
2404
  micDevices: Re.mics,
2391
- isCameraEnabled: K.isEnabled,
2392
- cameraPreviewEl: K.previewEl,
2405
+ isCameraEnabled: X.isEnabled,
2406
+ cameraPreviewEl: X.previewEl,
2393
2407
  cameraDevices: Re.cameras,
2394
- activeCameraId: K.activeDeviceId,
2408
+ activeCameraId: X.activeDeviceId,
2395
2409
  isScreenShareEnabled: ae.isEnabled,
2396
2410
  screenPreviewEl: ae.previewEl,
2397
- isSpeakerMuted: Je,
2398
- allowCamera: y,
2411
+ isSpeakerMuted: et,
2412
+ allowCamera: v,
2399
2413
  allowScreenShare: E,
2400
2414
  allowTyping: w,
2401
- languageMenuOpen: at,
2402
- onToggleLanguageMenu: () => Bt((v) => !v),
2403
- needsUserGesture: Xe,
2415
+ languageMenuOpen: st,
2416
+ onToggleLanguageMenu: () => Bt((m) => !m),
2417
+ needsUserGesture: Ze,
2404
2418
  canResume: b.canResume,
2405
2419
  micError: Y.micError,
2406
2420
  error: b.error,
2407
- avatarVideoContainerRef: dt,
2421
+ avatarVideoContainerRef: ft,
2408
2422
  onConnect: () => void b.connect(),
2409
2423
  onDisconnect: () => b.disconnect(),
2410
2424
  onRetry: Qt,
2411
2425
  onResumeAudio: Jt,
2412
2426
  onToggleMute: Y.toggleMute,
2413
- onToggleCamera: () => void K.toggle(),
2414
- onSwitchCameraDevice: (v) => void K.switchDevice(v),
2427
+ onToggleCamera: () => void X.toggle(),
2428
+ onSwitchCameraDevice: (m) => void X.switchDevice(m),
2415
2429
  onToggleScreenShare: () => void ae.toggle(),
2416
- onToggleSpeaker: jt,
2430
+ onToggleSpeaker: Wt,
2417
2431
  onSendMessage: Ft,
2418
2432
  onMinimize: Xt,
2419
- onClose: pt,
2433
+ onClose: mt,
2420
2434
  onClearMicError: Y.clearError
2421
2435
  }
2422
2436
  )
@@ -2436,12 +2450,12 @@ const _r = ({
2436
2450
  className: l,
2437
2451
  style: s
2438
2452
  }) => {
2439
- const d = M(null), u = M(null), g = M(o);
2440
- g.current = o;
2453
+ const d = M(null), u = M(null), y = M(o);
2454
+ y.current = o;
2441
2455
  const p = x((a) => {
2442
2456
  var S;
2443
2457
  const c = a.detail;
2444
- (S = g.current) == null || S.call(g, c);
2458
+ (S = y.current) == null || S.call(y, c);
2445
2459
  }, []);
2446
2460
  return P(() => {
2447
2461
  const a = d.current;
@@ -2453,7 +2467,7 @@ const _r = ({
2453
2467
  }, [e]), P(() => {
2454
2468
  u.current && (i ? u.current.setAttribute("mode", i) : u.current.removeAttribute("mode"));
2455
2469
  }, [i]), /* @__PURE__ */ n("div", { ref: d, className: l, style: s });
2456
- }, xr = ot(
2470
+ }, xr = at(
2457
2471
  function({ id: t, intent: r, as: i = "div", className: o, style: l, children: s }, d) {
2458
2472
  return rn(
2459
2473
  i,
@@ -2467,7 +2481,7 @@ const _r = ({
2467
2481
  s
2468
2482
  );
2469
2483
  }
2470
- ), kr = ot(
2484
+ ), kr = at(
2471
2485
  function({ id: t, intent: r, children: i, ...o }, l) {
2472
2486
  return /* @__PURE__ */ n(
2473
2487
  "form",
@@ -2480,12 +2494,12 @@ const _r = ({
2480
2494
  }
2481
2495
  );
2482
2496
  }
2483
- ), Lr = ot(
2497
+ ), Lr = at(
2484
2498
  function(t, r) {
2485
2499
  const { name: i, label: o, labelClassName: l } = t, s = { name: i, "data-ll-field": i };
2486
2500
  let d;
2487
2501
  if ("as" in t && t.as === "textarea") {
2488
- const { name: u, label: g, labelClassName: p, as: a, ...c } = t;
2502
+ const { name: u, label: y, labelClassName: p, as: a, ...c } = t;
2489
2503
  d = /* @__PURE__ */ n(
2490
2504
  "textarea",
2491
2505
  {
@@ -2495,7 +2509,7 @@ const _r = ({
2495
2509
  }
2496
2510
  );
2497
2511
  } else if ("as" in t && t.as === "select") {
2498
- const { name: u, label: g, labelClassName: p, as: a, children: c, ...S } = t;
2512
+ const { name: u, label: y, labelClassName: p, as: a, children: c, ...S } = t;
2499
2513
  d = /* @__PURE__ */ n(
2500
2514
  "select",
2501
2515
  {
@@ -2506,7 +2520,7 @@ const _r = ({
2506
2520
  }
2507
2521
  );
2508
2522
  } else {
2509
- const { name: u, label: g, labelClassName: p, as: a, ...c } = t;
2523
+ const { name: u, label: y, labelClassName: p, as: a, ...c } = t;
2510
2524
  d = /* @__PURE__ */ n(
2511
2525
  "input",
2512
2526
  {