@livelayer/react 0.17.1 → 0.18.0

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,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsxs as x, jsx as n, Fragment as ze } from "react/jsx-runtime";
3
- import { Component as Vn, useState as N, useRef as M, useEffect as T, useCallback as E, useMemo as Qe, useLayoutEffect as Ln, forwardRef as Pt, useImperativeHandle as Yn, createElement as Gn } from "react";
4
- import { createPortal as $t } from "react-dom";
5
- import { LiveKitSession as Kn, registerFields as Jn } from "@livelayer/sdk";
6
- import { clearFieldRegistry as Fo, getRegisteredFields as Wo, registerFields as qo, setFieldValue as Uo } from "@livelayer/sdk";
7
- import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Zn } from "livekit-client";
8
- class Qn extends Vn {
3
+ import { Component as Gn, useState as N, useRef as M, useEffect as T, useCallback as E, useMemo as Qe, useLayoutEffect as kn, forwardRef as $t, useImperativeHandle as Kn, createElement as Jn } from "react";
4
+ import { createPortal as zt } from "react-dom";
5
+ import { LiveKitSession as Xn, registerFields as Zn } from "@livelayer/sdk";
6
+ import { clearFieldRegistry as qo, getRegisteredFields as Uo, registerFields as jo, setFieldValue as Vo } from "@livelayer/sdk";
7
+ import { createLocalAudioTrack as Qn, Track as Cn, createLocalVideoTrack as er } from "livekit-client";
8
+ class tr extends Gn {
9
9
  constructor() {
10
10
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
11
11
  this.setState({ hasError: !1, error: null });
@@ -35,26 +35,26 @@ class Qn extends Vn {
35
35
  ] }) : this.props.children;
36
36
  }
37
37
  }
38
- function er(e) {
39
- const [t, r] = N("idle"), [o, a] = N("idle"), [i, s] = N([]), [l, c] = N(null), [p, w] = N(null), [m, f] = N(null), [R, _] = N(!1), [y, u] = N(null), h = M(null), L = M(e.onDataMessage);
38
+ function nr(e) {
39
+ const [t, r] = N("idle"), [o, a] = N("idle"), [i, s] = N([]), [l, c] = N(null), [p, w] = N(null), [m, f] = N(null), [R, _] = N(!1), [g, u] = N(null), h = M(null), L = M(e.onDataMessage);
40
40
  L.current = e.onDataMessage, T(() => {
41
41
  const b = {
42
- onConnectionStateChange: (O) => {
43
- r(O), O === "connected" && u(null);
42
+ onConnectionStateChange: (B) => {
43
+ r(B), B === "connected" && u(null);
44
44
  },
45
45
  onAgentStateChange: a,
46
- onTranscript: (O) => s([...O]),
46
+ onTranscript: (B) => s([...B]),
47
47
  onAgentConfig: c,
48
- onAudioTrack: (O) => f(O),
49
- onVideoTrack: (O) => w(O),
48
+ onAudioTrack: (B) => f(B),
49
+ onVideoTrack: (B) => w(B),
50
50
  onVideoTrackRemoved: () => w(null),
51
- onError: (O) => u(O),
52
- onDataMessage: (O) => {
51
+ onError: (B) => u(B),
52
+ onDataMessage: (B) => {
53
53
  var q;
54
- (q = L.current) == null || q.call(L, O);
54
+ (q = L.current) == null || q.call(L, B);
55
55
  },
56
56
  onResumabilityChange: _
57
- }, P = new Kn(
57
+ }, P = new Xn(
58
58
  {
59
59
  agentId: e.agentId,
60
60
  baseUrl: e.baseUrl,
@@ -65,8 +65,8 @@ function er(e) {
65
65
  b
66
66
  );
67
67
  return h.current = P, r("idle"), a("idle"), s([]), c(null), w(null), f(null), _(!1), u(null), () => {
68
- var O;
69
- (O = P.destroy) == null || O.call(P), h.current = null;
68
+ var B;
69
+ (B = P.destroy) == null || B.call(P), h.current = null;
70
70
  };
71
71
  }, [
72
72
  e.agentId,
@@ -98,31 +98,31 @@ function er(e) {
98
98
  videoElement: p,
99
99
  audioElement: m,
100
100
  canResume: R,
101
- error: y,
101
+ error: g,
102
102
  connect: A,
103
103
  disconnect: I,
104
104
  getRoom: U,
105
105
  session: h.current
106
106
  };
107
107
  }
108
- function tr() {
108
+ function rr() {
109
109
  const e = M(null), t = M(/* @__PURE__ */ new Map()), r = M(null), o = M(/* @__PURE__ */ new Set()), a = E(() => {
110
110
  const _ = t.current;
111
111
  if (_.size === 0) {
112
112
  r.current = null;
113
113
  return;
114
114
  }
115
- let y = 0;
115
+ let g = 0;
116
116
  for (const { analyser: u, buffer: h } of _.values()) {
117
117
  u.getByteFrequencyData(h);
118
118
  let L = 0;
119
119
  for (let I = 0; I < h.length; I++) L += h[I];
120
120
  const A = L / h.length / 255;
121
- A > y && (y = A);
121
+ A > g && (g = A);
122
122
  }
123
123
  for (const u of o.current)
124
124
  try {
125
- u(y);
125
+ u(g);
126
126
  } catch (h) {
127
127
  console.error("[useAudioLevel] subscriber threw:", h);
128
128
  }
@@ -130,24 +130,24 @@ function tr() {
130
130
  }, []), i = E(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = E(() => {
131
131
  r.current === null && t.current.size > 0 && (r.current = requestAnimationFrame(a));
132
132
  }, [a]), l = E((_) => {
133
- const y = t.current.get(_);
134
- if (y) {
133
+ const g = t.current.get(_);
134
+ if (g) {
135
135
  try {
136
- y.node.disconnect();
136
+ g.node.disconnect();
137
137
  } catch {
138
138
  }
139
139
  try {
140
- y.analyser.disconnect();
140
+ g.analyser.disconnect();
141
141
  } catch {
142
142
  }
143
143
  t.current.delete(_);
144
144
  }
145
145
  }, []), c = E(
146
- (_, y) => {
146
+ (_, g) => {
147
147
  const u = i();
148
148
  if (!u) return;
149
149
  l(_);
150
- const h = y(u);
150
+ const h = g(u);
151
151
  if (!h) return;
152
152
  const L = u.createAnalyser();
153
153
  L.fftSize = 64;
@@ -165,14 +165,14 @@ function tr() {
165
165
  },
166
166
  [l, i, s]
167
167
  ), p = E(
168
- (_, y = "agent") => {
169
- c(y, (u) => {
168
+ (_, g = "agent") => {
169
+ c(g, (u) => {
170
170
  try {
171
171
  return u.createMediaElementSource(_);
172
172
  } catch (h) {
173
173
  return console.warn(
174
174
  "[useAudioLevel] createMediaElementSource failed for slot",
175
- y,
175
+ g,
176
176
  h
177
177
  ), null;
178
178
  }
@@ -180,14 +180,14 @@ function tr() {
180
180
  },
181
181
  [c]
182
182
  ), w = E(
183
- (_, y = "mic") => {
184
- c(y, (u) => {
183
+ (_, g = "mic") => {
184
+ c(g, (u) => {
185
185
  try {
186
186
  return u.createMediaStreamSource(_);
187
187
  } catch (h) {
188
188
  return console.warn(
189
189
  "[useAudioLevel] createMediaStreamSource failed for slot",
190
- y,
190
+ g,
191
191
  h
192
192
  ), null;
193
193
  }
@@ -217,12 +217,12 @@ function tr() {
217
217
  o.current.clear();
218
218
  }, [f]), { attach: p, attachStream: w, detach: f, detachSlot: m, subscribe: R };
219
219
  }
220
- function nr(e) {
220
+ function or(e) {
221
221
  const t = e == null ? void 0 : e.mediaStreamTrack;
222
222
  return t ? new MediaStream([t]) : null;
223
223
  }
224
- function rr() {
225
- const [e, t] = N(!1), [r, o] = N(""), [a, i] = N(null), s = M(null), l = M(null), c = E(async (y) => {
224
+ function ir() {
225
+ const [e, t] = N(!1), [r, o] = N(""), [a, i] = N(null), s = M(null), l = M(null), c = E(async (g) => {
226
226
  var u, h;
227
227
  if (s.current && l.current) {
228
228
  try {
@@ -231,48 +231,48 @@ function rr() {
231
231
  }
232
232
  s.current.stop(), s.current = null;
233
233
  }
234
- l.current = y, i(null);
234
+ l.current = g, i(null);
235
235
  try {
236
- const L = await Xn({
236
+ const L = await Qn({
237
237
  echoCancellation: !0,
238
238
  noiseSuppression: !0
239
239
  });
240
- await y.localParticipant.publishTrack(L), s.current = L, t(L.isMuted);
240
+ await g.localParticipant.publishTrack(L), s.current = L, t(L.isMuted);
241
241
  const A = (h = (u = L.mediaStreamTrack) == null ? void 0 : u.getSettings) == null ? void 0 : h.call(u);
242
242
  A != null && A.deviceId && o(A.deviceId);
243
243
  } catch (L) {
244
244
  const A = L instanceof Error && L.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
245
245
  throw i(A), L;
246
246
  }
247
- }, []), p = E((y) => {
248
- l.current = y;
249
- }, []), w = E(async (y) => {
247
+ }, []), p = E((g) => {
248
+ l.current = g;
249
+ }, []), w = E(async (g) => {
250
250
  const u = l.current;
251
251
  if (u)
252
252
  try {
253
- await u.switchActiveDevice("audioinput", y), o(y);
253
+ await u.switchActiveDevice("audioinput", g), o(g);
254
254
  } catch (h) {
255
255
  console.warn("[useMicrophoneState] switchDevice failed:", h);
256
256
  }
257
257
  }, []), m = E(async () => {
258
- const y = l.current, u = !e;
259
- if (t(u), !!y)
258
+ const g = l.current, u = !e;
259
+ if (t(u), !!g)
260
260
  try {
261
- await y.localParticipant.setMicrophoneEnabled(!u);
261
+ await g.localParticipant.setMicrophoneEnabled(!u);
262
262
  } catch (h) {
263
263
  console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", h), t(!u);
264
264
  }
265
265
  }, [e]), f = E(() => {
266
- const y = s.current, u = l.current;
267
- if (y && u) {
266
+ const g = s.current, u = l.current;
267
+ if (g && u) {
268
268
  try {
269
- u.localParticipant.unpublishTrack(y);
269
+ u.localParticipant.unpublishTrack(g);
270
270
  } catch {
271
271
  }
272
- y.stop();
272
+ g.stop();
273
273
  }
274
274
  s.current = null, l.current = null, t(!1), o("");
275
- }, []), R = E(() => i(null), []), _ = E(() => nr(s.current), []);
275
+ }, []), R = E(() => i(null), []), _ = E(() => or(s.current), []);
276
276
  return {
277
277
  isMuted: e,
278
278
  activeDeviceId: r,
@@ -286,15 +286,15 @@ function rr() {
286
286
  getMicStream: _
287
287
  };
288
288
  }
289
- const or = { resolution: { width: 640, height: 480, frameRate: 24 } };
290
- function ir() {
289
+ const lr = { resolution: { width: 640, height: 480, frameRate: 24 } };
290
+ function ar() {
291
291
  const [e, t] = N(!1), [r, o] = N(null), [a, i] = N(null), [s, l] = N(""), c = M(null), p = M(null), w = E((h) => {
292
292
  c.current = h;
293
293
  }, []), m = E(() => {
294
294
  var A;
295
295
  const h = c.current, L = p.current;
296
296
  if (L && h) {
297
- const I = h.localParticipant.getTrackPublication(kn.Source.Camera), b = (I == null ? void 0 : I.track) ?? L;
297
+ const I = h.localParticipant.getTrackPublication(Cn.Source.Camera), b = (I == null ? void 0 : I.track) ?? L;
298
298
  try {
299
299
  h.localParticipant.unpublishTrack(b);
300
300
  } catch {
@@ -310,9 +310,9 @@ function ir() {
310
310
  if (L) {
311
311
  o(null);
312
312
  try {
313
- const A = { ...or };
313
+ const A = { ...lr };
314
314
  h && (A.deviceId = h);
315
- const I = await Zn(A);
315
+ const I = await er(A);
316
316
  await L.localParticipant.publishTrack(I), p.current = I;
317
317
  const U = I.attach();
318
318
  i(U), t(!0), h && l(h);
@@ -332,7 +332,7 @@ function ir() {
332
332
  e ? m() : await f(s || void 0);
333
333
  }, [e, s, m, f]), _ = E(async (h) => {
334
334
  m(), await f(h);
335
- }, [m, f]), y = E(() => {
335
+ }, [m, f]), g = E(() => {
336
336
  m(), c.current = null, o(null), l("");
337
337
  }, [m]), u = E(() => o(null), []);
338
338
  return T(() => () => {
@@ -345,11 +345,11 @@ function ir() {
345
345
  toggle: R,
346
346
  switchDevice: _,
347
347
  attachRoom: w,
348
- teardown: y,
348
+ teardown: g,
349
349
  clearError: u
350
350
  };
351
351
  }
352
- function lr() {
352
+ function sr() {
353
353
  const [e, t] = N(!1), [r, o] = N(null), [a, i] = N(null), s = M(null), l = E((f) => {
354
354
  s.current = f;
355
355
  }, []), c = E(() => i(null), []), p = E(async () => {
@@ -368,9 +368,9 @@ function lr() {
368
368
  await f.localParticipant.setScreenShareEnabled(!0);
369
369
  let R = 0;
370
370
  const _ = () => {
371
- const y = f.localParticipant.getTrackPublication(kn.Source.ScreenShare);
372
- if (y != null && y.track) {
373
- const u = y.track.attach();
371
+ const g = f.localParticipant.getTrackPublication(Cn.Source.ScreenShare);
372
+ if (g != null && g.track) {
373
+ const u = g.track.attach();
374
374
  i(u), t(!0);
375
375
  try {
376
376
  f.localParticipant.publishData(
@@ -400,7 +400,7 @@ function lr() {
400
400
  }, [e, c]), m = E(() => o(null), []);
401
401
  return { isEnabled: e, error: r, previewEl: a, toggle: p, attachRoom: l, teardown: w, clearError: m };
402
402
  }
403
- function ar() {
403
+ function cr() {
404
404
  const [e, t] = N([]), [r, o] = N([]), a = E(async () => {
405
405
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
406
406
  try {
@@ -415,7 +415,7 @@ function ar() {
415
415
  return navigator.mediaDevices.addEventListener("devicechange", i), () => navigator.mediaDevices.removeEventListener("devicechange", i);
416
416
  }, [a]), { mics: e, cameras: r, refresh: a };
417
417
  }
418
- function sr(e, t, r = !1) {
418
+ function dr(e, t, r = !1) {
419
419
  const [o, a] = N(null), [i, s] = N(null), [l, c] = N(!r && !!e);
420
420
  return T(() => {
421
421
  if (r || !e) {
@@ -438,7 +438,7 @@ function sr(e, t, r = !1) {
438
438
  }), () => p.abort();
439
439
  }, [e, t, r]), { info: o, error: i, loading: l };
440
440
  }
441
- function cr(e) {
441
+ function ur(e) {
442
442
  if (typeof window > "u") return null;
443
443
  try {
444
444
  return window.localStorage.getItem(e);
@@ -446,14 +446,14 @@ function cr(e) {
446
446
  return null;
447
447
  }
448
448
  }
449
- function dr(e, t) {
449
+ function fr(e, t) {
450
450
  if (!(typeof window > "u"))
451
451
  try {
452
452
  window.localStorage.setItem(e, t);
453
453
  } catch {
454
454
  }
455
455
  }
456
- function ur({
456
+ function pr({
457
457
  value: e,
458
458
  defaultValue: t = "expanded",
459
459
  onChange: r
@@ -466,32 +466,32 @@ function ur({
466
466
  );
467
467
  return [s, l];
468
468
  }
469
- const fr = ["hidden", "minimized", "expanded"];
470
- function pr(e) {
471
- return e && fr.includes(e) ? e : null;
469
+ const hr = ["hidden", "minimized", "expanded"];
470
+ function mr(e) {
471
+ return e && hr.includes(e) ? e : null;
472
472
  }
473
- function hr({
473
+ function gr({
474
474
  value: e,
475
475
  defaultValue: t = "expanded",
476
476
  onChange: r,
477
477
  persistKey: o = "ll-widget",
478
478
  disablePersistence: a = !1
479
479
  } = {}) {
480
- const i = `${o}:display-mode`, s = M(!1), [l, c] = ur({
480
+ const i = `${o}:display-mode`, s = M(!1), [l, c] = pr({
481
481
  value: e,
482
482
  defaultValue: t,
483
483
  onChange: (p) => {
484
- e === void 0 && !a && dr(i, p), r == null || r(p);
484
+ e === void 0 && !a && fr(i, p), r == null || r(p);
485
485
  }
486
486
  });
487
487
  return T(() => {
488
488
  if (s.current || (s.current = !0, a || e !== void 0)) return;
489
- const p = pr(cr(i));
489
+ const p = mr(ur(i));
490
490
  p && p !== l && c(p);
491
491
  }, []), [l, c];
492
492
  }
493
- const mr = 640;
494
- function gr(e = mr) {
493
+ const yr = 640;
494
+ function vr(e = yr) {
495
495
  const [t, r] = N(!1);
496
496
  return T(() => {
497
497
  if (e === !1) {
@@ -506,75 +506,75 @@ function gr(e = mr) {
506
506
  });
507
507
  }, [e]), t;
508
508
  }
509
- const tn = "__llHistoryPatched", xt = "ll:pathname";
510
- function yr() {
511
- if (typeof window > "u" || window.history[tn]) return;
509
+ const nn = "__llHistoryPatched", _t = "ll:pathname";
510
+ function br() {
511
+ if (typeof window > "u" || window.history[nn]) return;
512
512
  const e = window.history.pushState, t = window.history.replaceState;
513
513
  window.history.pushState = function(...r) {
514
514
  const o = e.apply(this, r);
515
- return window.dispatchEvent(new Event(xt)), o;
515
+ return window.dispatchEvent(new Event(_t)), o;
516
516
  }, window.history.replaceState = function(...r) {
517
517
  const o = t.apply(this, r);
518
- return window.dispatchEvent(new Event(xt)), o;
519
- }, window.history[tn] = !0;
518
+ return window.dispatchEvent(new Event(_t)), o;
519
+ }, window.history[nn] = !0;
520
520
  }
521
- function nn() {
521
+ function rn() {
522
522
  return typeof window > "u" ? "/" : window.location.pathname || "/";
523
523
  }
524
- function vr(e) {
524
+ function wr(e) {
525
525
  const [t, r] = N(
526
- () => e ?? nn()
526
+ () => e ?? rn()
527
527
  );
528
528
  return T(() => {
529
529
  if (e !== void 0) return;
530
- yr();
531
- const o = () => r(nn());
532
- return o(), window.addEventListener("popstate", o), window.addEventListener(xt, o), () => {
533
- window.removeEventListener("popstate", o), window.removeEventListener(xt, o);
530
+ br();
531
+ const o = () => r(rn());
532
+ return o(), window.addEventListener("popstate", o), window.addEventListener(_t, o), () => {
533
+ window.removeEventListener("popstate", o), window.removeEventListener(_t, o);
534
534
  };
535
535
  }, [e]), e ?? t;
536
536
  }
537
- const rn = /* @__PURE__ */ new Map(), br = /[\\^$+?.()|{}[\]]/g;
538
- function wr(e) {
539
- return e.replace(br, "\\$&");
537
+ const on = /* @__PURE__ */ new Map(), _r = /[\\^$+?.()|{}[\]]/g;
538
+ function xr(e) {
539
+ return e.replace(_r, "\\$&");
540
540
  }
541
- function _r(e) {
542
- const t = rn.get(e);
541
+ function Lr(e) {
542
+ const t = on.get(e);
543
543
  if (t) return t;
544
- const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", a = "", i = r.replace(/\*\*/g, o).replace(/\*/g, a), l = wr(i).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
545
- return rn.set(e, c), c;
544
+ const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", a = "", i = r.replace(/\*\*/g, o).replace(/\*/g, a), l = xr(i).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
545
+ return on.set(e, c), c;
546
546
  }
547
- function xr(e, t) {
547
+ function kr(e, t) {
548
548
  const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
549
- return _r(e).test(r);
549
+ return Lr(e).test(r);
550
550
  }
551
- function Lr(e, t) {
552
- return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : xr(e, t);
551
+ function Cr(e, t) {
552
+ return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : kr(e, t);
553
553
  }
554
- function on(e, t) {
554
+ function ln(e, t) {
555
555
  if (!e || e.length === 0) return !1;
556
556
  for (const r of e)
557
- if (Lr(r, t)) return !0;
557
+ if (Cr(r, t)) return !0;
558
558
  return !1;
559
559
  }
560
- function kr(e, t, r) {
561
- return e === void 0 ? !0 : on(r, e) ? !1 : t && t.length > 0 ? on(t, e) : !0;
560
+ function Er(e, t, r) {
561
+ return e === void 0 ? !0 : ln(r, e) ? !1 : t && t.length > 0 ? ln(t, e) : !0;
562
562
  }
563
- function Cr(e, t, r) {
563
+ function Sr(e, t, r) {
564
564
  return Qe(
565
- () => kr(e, t, r),
565
+ () => Er(e, t, r),
566
566
  [e, t, r]
567
567
  );
568
568
  }
569
- function Er(e) {
569
+ function Nr(e) {
570
570
  return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
571
571
  navigate: e.navigate !== !1,
572
572
  thinking: e.thinking !== !1,
573
573
  action: e.action !== !1
574
574
  };
575
575
  }
576
- function Sr(e) {
577
- const t = Qe(() => Er(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = M(null), a = E(
576
+ function Ar(e) {
577
+ const t = Qe(() => Nr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = M(null), a = E(
578
578
  (c) => {
579
579
  try {
580
580
  new Audio(`${r}${c}`).play().catch(() => {
@@ -631,7 +631,7 @@ function Sr(e) {
631
631
  [i, s, l]
632
632
  );
633
633
  }
634
- const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
634
+ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
635
635
  "svg",
636
636
  {
637
637
  className: t,
@@ -677,7 +677,7 @@ const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
677
677
  }
678
678
  )
679
679
  }
680
- ), an = ({ className: e }) => /* @__PURE__ */ n(
680
+ ), sn = ({ className: e }) => /* @__PURE__ */ n(
681
681
  "svg",
682
682
  {
683
683
  className: e,
@@ -695,7 +695,7 @@ const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
695
695
  }
696
696
  )
697
697
  }
698
- ), Nr = ({ className: e }) => /* @__PURE__ */ n(
698
+ ), Ir = ({ className: e }) => /* @__PURE__ */ n(
699
699
  "svg",
700
700
  {
701
701
  className: e,
@@ -706,12 +706,12 @@ const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
706
706
  "aria-hidden": "true",
707
707
  children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
708
708
  }
709
- ), Ar = {
709
+ ), Mr = {
710
710
  left: 180,
711
711
  right: 0,
712
712
  up: -90,
713
713
  down: 90
714
- }, sn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
714
+ }, cn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
715
715
  "svg",
716
716
  {
717
717
  className: t,
@@ -719,19 +719,19 @@ const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
719
719
  viewBox: "0 0 24 24",
720
720
  stroke: "currentColor",
721
721
  strokeWidth: 2,
722
- style: { transform: `rotate(${Ar[e]}deg)` },
722
+ style: { transform: `rotate(${Mr[e]}deg)` },
723
723
  "aria-hidden": "true",
724
724
  children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
725
725
  }
726
726
  );
727
- function Ir(e) {
727
+ function Rr(e) {
728
728
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
729
729
  }
730
- const Cn = "ll-hidden-tab-center-y", Mr = 5, cn = 16;
731
- function Rr() {
730
+ const En = "ll-hidden-tab-center-y", Tr = 5, dn = 16;
731
+ function Dr() {
732
732
  if (typeof window > "u") return null;
733
733
  try {
734
- const e = window.localStorage.getItem(Cn);
734
+ const e = window.localStorage.getItem(En);
735
735
  if (!e) return null;
736
736
  const t = Number.parseFloat(e);
737
737
  return Number.isFinite(t) ? t : null;
@@ -739,14 +739,14 @@ function Rr() {
739
739
  return null;
740
740
  }
741
741
  }
742
- function dn(e) {
742
+ function un(e) {
743
743
  if (!(typeof window > "u"))
744
744
  try {
745
- window.localStorage.setItem(Cn, String(e));
745
+ window.localStorage.setItem(En, String(e));
746
746
  } catch {
747
747
  }
748
748
  }
749
- const Tr = ({
749
+ const Pr = ({
750
750
  position: e,
751
751
  isMobile: t,
752
752
  isSpeaking: r,
@@ -756,11 +756,11 @@ const Tr = ({
756
756
  agentName: s,
757
757
  containerEl: l
758
758
  }) => {
759
- const c = Ir(e), p = c === "right" ? "left" : "right", w = t ? 80 : 72, m = !!i, f = !!l, [R, _] = N(null), [y, u] = N(!1), h = M(null), L = M(!1), A = E(
760
- (B) => {
761
- if (typeof window > "u") return B;
762
- const j = w / 2, S = cn + j, Z = window.innerHeight - cn - j;
763
- return Z < S ? Math.max(S, B) : Math.max(S, Math.min(Z, B));
759
+ const c = Rr(e), p = c === "right" ? "left" : "right", w = t ? 80 : 72, m = !!i, f = !!l, [R, _] = N(null), [g, u] = N(!1), h = M(null), L = M(!1), A = E(
760
+ (F) => {
761
+ if (typeof window > "u") return F;
762
+ const j = w / 2, S = dn + j, Z = window.innerHeight - dn - j;
763
+ return Z < S ? Math.max(S, F) : Math.max(S, Math.min(Z, F));
764
764
  },
765
765
  [w]
766
766
  );
@@ -769,22 +769,22 @@ const Tr = ({
769
769
  _(null);
770
770
  return;
771
771
  }
772
- const B = Rr();
773
- _(A(B ?? window.innerHeight / 2));
772
+ const F = Dr();
773
+ _(A(F ?? window.innerHeight / 2));
774
774
  const j = () => {
775
775
  _((S) => S === null ? null : A(S));
776
776
  };
777
777
  return window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
778
778
  }, [A, f]);
779
779
  const I = E(
780
- (B) => {
781
- if (!f && !(B.pointerType === "mouse" && B.button !== 0) && R !== null) {
780
+ (F) => {
781
+ if (!f && !(F.pointerType === "mouse" && F.button !== 0) && R !== null) {
782
782
  try {
783
- B.currentTarget.setPointerCapture(B.pointerId);
783
+ F.currentTarget.setPointerCapture(F.pointerId);
784
784
  } catch {
785
785
  }
786
786
  h.current = {
787
- startClientY: B.clientY,
787
+ startClientY: F.clientY,
788
788
  startCenterY: R,
789
789
  moved: !1
790
790
  };
@@ -792,22 +792,22 @@ const Tr = ({
792
792
  },
793
793
  [R, f]
794
794
  ), U = E(
795
- (B) => {
795
+ (F) => {
796
796
  const j = h.current;
797
797
  if (!j) return;
798
- const S = B.clientY - j.startClientY;
799
- !j.moved && Math.abs(S) > Mr && (j.moved = !0, u(!0)), j.moved && _(A(j.startCenterY + S));
798
+ const S = F.clientY - j.startClientY;
799
+ !j.moved && Math.abs(S) > Tr && (j.moved = !0, u(!0)), j.moved && _(A(j.startCenterY + S));
800
800
  },
801
801
  [A]
802
802
  ), b = E(
803
- (B) => {
803
+ (F) => {
804
804
  const j = h.current;
805
805
  if (j) {
806
806
  try {
807
- B.currentTarget.releasePointerCapture(B.pointerId);
807
+ F.currentTarget.releasePointerCapture(F.pointerId);
808
808
  } catch {
809
809
  }
810
- h.current = null, j.moved && (u(!1), L.current = !0, _((S) => (S !== null && dn(S), S)));
810
+ h.current = null, j.moved && (u(!1), L.current = !0, _((S) => (S !== null && un(S), S)));
811
811
  }
812
812
  },
813
813
  []
@@ -817,15 +817,15 @@ const Tr = ({
817
817
  return;
818
818
  }
819
819
  o();
820
- }, [o]), O = E(
821
- (B) => {
822
- if (B.key === "ArrowUp" || B.key === "ArrowDown") {
823
- B.preventDefault();
824
- const j = B.key === "ArrowUp" ? -8 : 8;
820
+ }, [o]), B = E(
821
+ (F) => {
822
+ if (F.key === "ArrowUp" || F.key === "ArrowDown") {
823
+ F.preventDefault();
824
+ const j = F.key === "ArrowUp" ? -8 : 8;
825
825
  _((S) => {
826
826
  if (S === null) return S;
827
827
  const Z = A(S + j);
828
- return dn(Z), Z;
828
+ return un(Z), Z;
829
829
  });
830
830
  }
831
831
  },
@@ -835,7 +835,7 @@ const Tr = ({
835
835
  `ll-hidden--${c}`,
836
836
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
837
837
  r ? "ll-hidden--speaking" : null,
838
- y ? "is-dragging" : null,
838
+ g ? "is-dragging" : null,
839
839
  m ? "ll-hidden--with-avatar" : null,
840
840
  f ? "ll-hidden--scoped" : null
841
841
  ].filter(Boolean).join(" "), ne = R === null ? void 0 : { top: `${R - w / 2}px`, transform: "none" };
@@ -849,7 +849,7 @@ const Tr = ({
849
849
  onPointerUp: b,
850
850
  onPointerCancel: b,
851
851
  onClick: P,
852
- onKeyDown: O,
852
+ onKeyDown: B,
853
853
  "aria-label": a,
854
854
  "data-position": e,
855
855
  style: ne,
@@ -860,7 +860,7 @@ const Tr = ({
860
860
  // avatar-based experience" even when collapsed.
861
861
  /* @__PURE__ */ x(ze, { children: [
862
862
  /* @__PURE__ */ n(
863
- sn,
863
+ cn,
864
864
  {
865
865
  direction: p,
866
866
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
@@ -877,7 +877,7 @@ const Tr = ({
877
877
  )
878
878
  ] })
879
879
  ) : /* @__PURE__ */ n(
880
- sn,
880
+ cn,
881
881
  {
882
882
  direction: p,
883
883
  className: "ll-hidden__chevron"
@@ -885,7 +885,7 @@ const Tr = ({
885
885
  )
886
886
  }
887
887
  );
888
- }, Dr = ({
888
+ }, $r = ({
889
889
  audioLevel: e,
890
890
  bars: t = 20,
891
891
  maxHeight: r = 20,
@@ -917,7 +917,7 @@ const Tr = ({
917
917
  },
918
918
  m
919
919
  )) });
920
- }, Pr = ({
920
+ }, zr = ({
921
921
  position: e,
922
922
  isMobile: t,
923
923
  agentName: r,
@@ -954,7 +954,7 @@ const Tr = ({
954
954
  )
955
955
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
956
956
  /* @__PURE__ */ n(
957
- Dr,
957
+ $r,
958
958
  {
959
959
  audioLevel: s,
960
960
  bars: 16,
@@ -977,10 +977,10 @@ const Tr = ({
977
977
  (w.key === "Enter" || w.key === " ") && (w.stopPropagation(), w.preventDefault(), c());
978
978
  },
979
979
  "aria-label": i ? "Unmute microphone" : "Mute microphone",
980
- children: /* @__PURE__ */ n(ln, { muted: i, className: "ll-minimized__icon" })
980
+ children: /* @__PURE__ */ n(an, { muted: i, className: "ll-minimized__icon" })
981
981
  }
982
982
  ),
983
- /* @__PURE__ */ n(an, { className: "ll-minimized__icon ll-minimized__icon--expand" })
983
+ /* @__PURE__ */ n(sn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
984
984
  ] })
985
985
  ]
986
986
  }
@@ -1017,7 +1017,7 @@ const Tr = ({
1017
1017
  className: "ll-minimized__btn",
1018
1018
  onClick: c,
1019
1019
  "aria-label": i ? "Unmute microphone" : "Mute microphone",
1020
- children: /* @__PURE__ */ n(ln, { muted: i, className: "ll-minimized__icon" })
1020
+ children: /* @__PURE__ */ n(an, { muted: i, className: "ll-minimized__icon" })
1021
1021
  }
1022
1022
  ),
1023
1023
  /* @__PURE__ */ n(
@@ -1027,7 +1027,7 @@ const Tr = ({
1027
1027
  className: "ll-minimized__btn",
1028
1028
  onClick: l,
1029
1029
  "aria-label": `Expand ${r} widget`,
1030
- children: /* @__PURE__ */ n(an, { className: "ll-minimized__icon" })
1030
+ children: /* @__PURE__ */ n(sn, { className: "ll-minimized__icon" })
1031
1031
  }
1032
1032
  ),
1033
1033
  /* @__PURE__ */ n(
@@ -1037,13 +1037,13 @@ const Tr = ({
1037
1037
  className: "ll-minimized__btn ll-minimized__btn--close",
1038
1038
  onClick: p,
1039
1039
  "aria-label": "Close widget",
1040
- children: /* @__PURE__ */ n(Nr, { className: "ll-minimized__icon" })
1040
+ children: /* @__PURE__ */ n(Ir, { className: "ll-minimized__icon" })
1041
1041
  }
1042
1042
  )
1043
1043
  ] })
1044
1044
  ] })
1045
1045
  }
1046
- ), $r = ({
1046
+ ), Hr = ({
1047
1047
  src: e,
1048
1048
  alt: t,
1049
1049
  preCannedPlaying: r = !1,
@@ -1081,11 +1081,11 @@ const Tr = ({
1081
1081
  }
1082
1082
  )
1083
1083
  );
1084
- }, zr = "#E06540";
1085
- function Hr({
1084
+ }, Or = "#E06540";
1085
+ function Br({
1086
1086
  size: e = 14,
1087
1087
  className: t,
1088
- fill: r = zr
1088
+ fill: r = Or
1089
1089
  }) {
1090
1090
  return /* @__PURE__ */ x(
1091
1091
  "svg",
@@ -1123,14 +1123,14 @@ function Hr({
1123
1123
  }
1124
1124
  );
1125
1125
  }
1126
- const Or = 8, un = 8, Br = ({
1126
+ const Fr = 8, fn = 8, Wr = ({
1127
1127
  open: e,
1128
1128
  onClose: t,
1129
1129
  anchorRef: r,
1130
1130
  children: o
1131
1131
  }) => {
1132
1132
  const a = M(null), [i, s] = N(null);
1133
- return Ln(() => {
1133
+ return kn(() => {
1134
1134
  if (!e) {
1135
1135
  s(null);
1136
1136
  return;
@@ -1139,9 +1139,9 @@ const Or = 8, un = 8, Br = ({
1139
1139
  if (!l) return;
1140
1140
  const c = () => {
1141
1141
  const p = l.getBoundingClientRect(), w = {
1142
- top: p.top - Or,
1142
+ top: p.top - Fr,
1143
1143
  left: p.left + p.width / 2
1144
- }, m = un + 90, f = window.innerWidth - un - 90;
1144
+ }, m = fn + 90, f = window.innerWidth - fn - 90;
1145
1145
  w.left < m && (w.left = m), w.left > f && (w.left = f), s(w);
1146
1146
  };
1147
1147
  return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
@@ -1158,7 +1158,7 @@ const Or = 8, un = 8, Br = ({
1158
1158
  return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
1159
1159
  document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
1160
1160
  };
1161
- }, [e, t, r]), !e || i === null || typeof document > "u" ? null : $t(
1161
+ }, [e, t, r]), !e || i === null || typeof document > "u" ? null : zt(
1162
1162
  /* @__PURE__ */ n(
1163
1163
  "div",
1164
1164
  {
@@ -1178,7 +1178,7 @@ const Or = 8, un = 8, Br = ({
1178
1178
  ),
1179
1179
  document.body
1180
1180
  );
1181
- }, Fr = ({
1181
+ }, qr = ({
1182
1182
  isMuted: e,
1183
1183
  onToggleMute: t,
1184
1184
  isCameraEnabled: r,
@@ -1194,7 +1194,7 @@ const Or = 8, un = 8, Br = ({
1194
1194
  onToggleTyping: f,
1195
1195
  onDisconnect: R
1196
1196
  }) => {
1197
- const [_, y] = N(!1), u = M(null);
1197
+ const [_, g] = N(!1), u = M(null);
1198
1198
  return /* @__PURE__ */ x(ze, { children: [
1199
1199
  /* @__PURE__ */ x(
1200
1200
  "div",
@@ -1210,7 +1210,7 @@ const Or = 8, un = 8, Br = ({
1210
1210
  className: `ll-tool ${e ? "is-muted" : ""}`,
1211
1211
  onClick: t,
1212
1212
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1213
- children: /* @__PURE__ */ n(Nn, { muted: e })
1213
+ children: /* @__PURE__ */ n(An, { muted: e })
1214
1214
  }
1215
1215
  ),
1216
1216
  /* @__PURE__ */ n(
@@ -1219,11 +1219,11 @@ const Or = 8, un = 8, Br = ({
1219
1219
  ref: u,
1220
1220
  type: "button",
1221
1221
  className: `ll-tool ${_ ? "is-on" : ""}`,
1222
- onClick: () => y((h) => !h),
1222
+ onClick: () => g((h) => !h),
1223
1223
  "aria-label": "More controls",
1224
1224
  "aria-haspopup": "menu",
1225
1225
  "aria-expanded": _,
1226
- children: /* @__PURE__ */ n(Wr, {})
1226
+ children: /* @__PURE__ */ n(Ur, {})
1227
1227
  }
1228
1228
  ),
1229
1229
  /* @__PURE__ */ n(
@@ -1233,17 +1233,17 @@ const Or = 8, un = 8, Br = ({
1233
1233
  className: "ll-tool ll-tool--danger",
1234
1234
  onClick: R,
1235
1235
  "aria-label": "End conversation",
1236
- children: /* @__PURE__ */ n(In, {})
1236
+ children: /* @__PURE__ */ n(Mn, {})
1237
1237
  }
1238
1238
  )
1239
1239
  ]
1240
1240
  }
1241
1241
  ),
1242
1242
  /* @__PURE__ */ x(
1243
- Br,
1243
+ Wr,
1244
1244
  {
1245
1245
  open: _,
1246
- onClose: () => y(!1),
1246
+ onClose: () => g(!1),
1247
1247
  anchorRef: u,
1248
1248
  children: [
1249
1249
  a && /* @__PURE__ */ x(
@@ -1252,10 +1252,10 @@ const Or = 8, un = 8, Br = ({
1252
1252
  type: "button",
1253
1253
  className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
1254
1254
  onClick: () => {
1255
- o(), y(!1);
1255
+ o(), g(!1);
1256
1256
  },
1257
1257
  children: [
1258
- /* @__PURE__ */ n(Sn, {}),
1258
+ /* @__PURE__ */ n(Nn, {}),
1259
1259
  /* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
1260
1260
  ]
1261
1261
  }
@@ -1266,10 +1266,10 @@ const Or = 8, un = 8, Br = ({
1266
1266
  type: "button",
1267
1267
  className: `ll-overflow-popover__item ${i ? "is-on" : ""}`,
1268
1268
  onClick: () => {
1269
- s(), y(!1);
1269
+ s(), g(!1);
1270
1270
  },
1271
1271
  children: [
1272
- /* @__PURE__ */ n(En, {}),
1272
+ /* @__PURE__ */ n(Sn, {}),
1273
1273
  /* @__PURE__ */ n("span", { children: i ? "Stop sharing" : "Share screen" })
1274
1274
  ]
1275
1275
  }
@@ -1280,10 +1280,10 @@ const Or = 8, un = 8, Br = ({
1280
1280
  type: "button",
1281
1281
  className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
1282
1282
  onClick: () => {
1283
- p(), y(!1);
1283
+ p(), g(!1);
1284
1284
  },
1285
1285
  children: [
1286
- /* @__PURE__ */ n(An, { muted: c }),
1286
+ /* @__PURE__ */ n(In, { muted: c }),
1287
1287
  /* @__PURE__ */ n("span", { children: c ? "Unmute speaker" : "Mute speaker" })
1288
1288
  ]
1289
1289
  }
@@ -1294,10 +1294,10 @@ const Or = 8, un = 8, Br = ({
1294
1294
  type: "button",
1295
1295
  className: `ll-overflow-popover__item ${m ? "is-on" : ""}`,
1296
1296
  onClick: () => {
1297
- f(), y(!1);
1297
+ f(), g(!1);
1298
1298
  },
1299
1299
  children: [
1300
- /* @__PURE__ */ n(qr, {}),
1300
+ /* @__PURE__ */ n(jr, {}),
1301
1301
  /* @__PURE__ */ n("span", { children: m ? "Hide typing" : "Type a message" })
1302
1302
  ]
1303
1303
  }
@@ -1320,7 +1320,7 @@ const Or = 8, un = 8, Br = ({
1320
1320
  )
1321
1321
  ] });
1322
1322
  };
1323
- function Wr() {
1323
+ function Ur() {
1324
1324
  return /* @__PURE__ */ x(
1325
1325
  "svg",
1326
1326
  {
@@ -1337,7 +1337,7 @@ function Wr() {
1337
1337
  }
1338
1338
  );
1339
1339
  }
1340
- function qr() {
1340
+ function jr() {
1341
1341
  return /* @__PURE__ */ n(
1342
1342
  "svg",
1343
1343
  {
@@ -1354,7 +1354,7 @@ function qr() {
1354
1354
  }
1355
1355
  );
1356
1356
  }
1357
- const Ur = ({
1357
+ const Vr = ({
1358
1358
  position: e,
1359
1359
  isMobile: t,
1360
1360
  agentName: r,
@@ -1370,7 +1370,7 @@ const Ur = ({
1370
1370
  onSelectTeamMember: f,
1371
1371
  languageMenuOpen: R,
1372
1372
  onToggleLanguageMenu: _,
1373
- connectionState: y,
1373
+ connectionState: g,
1374
1374
  agentState: u,
1375
1375
  transcript: h,
1376
1376
  canResume: L,
@@ -1379,42 +1379,42 @@ const Ur = ({
1379
1379
  isMuted: U,
1380
1380
  micError: b,
1381
1381
  micDevices: P,
1382
- activeMicId: O,
1382
+ activeMicId: B,
1383
1383
  isCameraEnabled: q,
1384
1384
  cameraPreviewEl: ne,
1385
- cameraDevices: B,
1385
+ cameraDevices: F,
1386
1386
  activeCameraId: j,
1387
1387
  isScreenShareEnabled: S,
1388
1388
  screenPreviewEl: Z,
1389
1389
  isSpeakerMuted: _e,
1390
- allowCamera: de,
1390
+ allowCamera: fe,
1391
1391
  allowScreenShare: He,
1392
1392
  allowTyping: Oe,
1393
1393
  showMinimize: X = !0,
1394
- showClose: Se = !0,
1394
+ showClose: Ne = !0,
1395
1395
  chromeless: xe = !1,
1396
- compactControls: F = !1,
1397
- transforming: ie,
1396
+ compactControls: H = !1,
1397
+ transforming: le,
1398
1398
  transformingLabel: Y,
1399
- avatarVideoContainerRef: fe,
1399
+ avatarVideoContainerRef: pe,
1400
1400
  agentVideoEl: K,
1401
1401
  onConnect: et,
1402
1402
  onDisconnect: tt,
1403
- onRetry: ft,
1403
+ onRetry: pt,
1404
1404
  onResumeAudio: nt,
1405
- onToggleMute: Ne,
1405
+ onToggleMute: Ae,
1406
1406
  onSwitchMicDevice: Be,
1407
- onToggleCamera: Ae,
1407
+ onToggleCamera: Ie,
1408
1408
  onSwitchCameraDevice: Fe,
1409
- onToggleScreenShare: Ie,
1410
- onToggleSpeaker: Me,
1411
- onSendMessage: Re,
1412
- onMinimize: Te,
1409
+ onToggleScreenShare: Me,
1410
+ onToggleSpeaker: Re,
1411
+ onSendMessage: Te,
1412
+ onMinimize: De,
1413
1413
  onClose: $,
1414
- onClearMicError: Lt
1414
+ onClearMicError: xt
1415
1415
  }) => {
1416
- var gt;
1417
- const De = ((l == null ? void 0 : l.length) ?? 0) > 1, We = y === "connecting" || y === "connected", pe = y === "connected", rt = y === "idle" || y === "disconnected" || y === "error", [Pe, qe] = N(!1);
1416
+ var Ye;
1417
+ const Pe = ((l == null ? void 0 : l.length) ?? 0) > 1, We = g === "connecting" || g === "connected", he = g === "connected", rt = g === "idle" || g === "disconnected" || g === "error", [$e, qe] = N(!1);
1418
1418
  T(() => {
1419
1419
  if (!K) {
1420
1420
  qe(!1);
@@ -1425,80 +1425,80 @@ const Ur = ({
1425
1425
  return;
1426
1426
  }
1427
1427
  qe(!1);
1428
- const g = () => qe(!0);
1429
- return K.addEventListener("playing", g), K.addEventListener("loadeddata", g), () => {
1430
- K.removeEventListener("playing", g), K.removeEventListener("loadeddata", g);
1428
+ const y = () => qe(!0);
1429
+ return K.addEventListener("playing", y), K.addEventListener("loadeddata", y), () => {
1430
+ K.removeEventListener("playing", y), K.removeEventListener("loadeddata", y);
1431
1431
  };
1432
1432
  }, [K]);
1433
- const [kt, Ce] = N(!1);
1433
+ const [Lt, Ce] = N(!1);
1434
1434
  T(() => {
1435
- if (!pe) {
1435
+ if (!he) {
1436
1436
  Ce(!1);
1437
1437
  return;
1438
1438
  }
1439
- if (Pe) return;
1440
- const g = setTimeout(() => Ce(!0), 8e3);
1441
- return () => clearTimeout(g);
1442
- }, [pe, Pe]);
1443
- const le = y === "connecting" || pe && !!o && !Pe && !kt, ot = M(null), he = M(null);
1439
+ if ($e) return;
1440
+ const y = setTimeout(() => Ce(!0), 8e3);
1441
+ return () => clearTimeout(y);
1442
+ }, [he, $e]);
1443
+ const ae = g === "connecting" || he && !!o && !$e && !Lt, ot = M(null), de = M(null);
1444
1444
  T(() => {
1445
- const g = ot.current;
1446
- g && (g.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "cover", ne.style.transform = "scaleX(-1)", g.appendChild(ne)));
1445
+ const y = ot.current;
1446
+ y && (y.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "cover", ne.style.transform = "scaleX(-1)", y.appendChild(ne)));
1447
1447
  }, [ne]), T(() => {
1448
- const g = he.current;
1449
- g && (g.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", g.appendChild(Z)));
1448
+ const y = de.current;
1449
+ y && (y.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", y.appendChild(Z)));
1450
1450
  }, [Z]);
1451
- const [me, Ue] = N(!1), [je, ae] = N(!1), ge = M(null), pt = M(null);
1451
+ const [ue, Ue] = N(!1), [je, se] = N(!1), me = M(null), ht = M(null);
1452
1452
  T(() => {
1453
- if (!me && !je && !R && !w) return;
1454
- const g = () => {
1455
- Ue(!1), ae(!1), R && _(), w && m();
1453
+ if (!ue && !je && !R && !w) return;
1454
+ const y = () => {
1455
+ Ue(!1), se(!1), R && _(), w && m();
1456
1456
  };
1457
- return document.addEventListener("click", g), () => document.removeEventListener("click", g);
1457
+ return document.addEventListener("click", y), () => document.removeEventListener("click", y);
1458
1458
  }, [
1459
- me,
1459
+ ue,
1460
1460
  je,
1461
1461
  R,
1462
1462
  w,
1463
1463
  _,
1464
1464
  m
1465
1465
  ]);
1466
- const [ht, $e] = N(!1), se = E(() => $e((g) => !g), []), [ue, Ee] = N(""), it = E(
1467
- (g) => {
1468
- g.preventDefault();
1469
- const Q = ue.trim();
1470
- Q && (Re(Q), Ee(""));
1466
+ const [mt, kt] = N(!1), Ct = E(() => kt((y) => !y), []), [ge, re] = N(""), Le = E(
1467
+ (y) => {
1468
+ y.preventDefault();
1469
+ const Q = ge.trim();
1470
+ Q && (Te(Q), re(""));
1471
1471
  },
1472
- [ue, Re]
1473
- ), mt = s.productName || "Live Layer", lt = !s.productName;
1474
- let ye = null, Le = null;
1475
- for (let g = h.length - 1; g >= 0; g--) {
1476
- const Q = h[g];
1477
- if (!ye && Q.role === "agent" ? ye = Q : !Le && Q.role === "user" && (Le = Q), ye && Le) break;
1472
+ [ge, Te]
1473
+ ), Ee = s.productName || "Live Layer", it = !s.productName;
1474
+ let Se = null, ye = null;
1475
+ for (let y = h.length - 1; y >= 0; y--) {
1476
+ const Q = h[y];
1477
+ if (!Se && Q.role === "agent" ? Se = Q : !ye && Q.role === "user" && (ye = Q), Se && ye) break;
1478
1478
  }
1479
- const Ve = pe ? (ye == null ? void 0 : ye.text) || null : i || null, Ye = pe && (Le == null ? void 0 : Le.text) || null, Ct = [
1479
+ const Ve = he ? (Se == null ? void 0 : Se.text) || null : i || null, lt = he && (ye == null ? void 0 : ye.text) || null, at = [
1480
1480
  "ll-expanded",
1481
1481
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1482
1482
  ].join(" ");
1483
1483
  return /* @__PURE__ */ x(
1484
1484
  "div",
1485
1485
  {
1486
- className: Ct,
1486
+ className: at,
1487
1487
  "data-position": e,
1488
- "data-state": pe ? "connected" : We ? "connecting" : "idle",
1488
+ "data-state": he ? "connected" : We ? "connecting" : "idle",
1489
1489
  role: "dialog",
1490
1490
  "aria-label": `${r} widget`,
1491
1491
  children: [
1492
1492
  /* @__PURE__ */ x("div", { className: "ll-expanded__bg", children: [
1493
1493
  o ? /* @__PURE__ */ n(
1494
- $r,
1494
+ Hr,
1495
1495
  {
1496
1496
  src: o,
1497
1497
  alt: r,
1498
1498
  className: "ll-expanded__bg-img"
1499
1499
  }
1500
- ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((gt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : gt.toUpperCase()) || "A" }) }),
1501
- a && !pe && /* @__PURE__ */ n(
1500
+ ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Ye = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Ye.toUpperCase()) || "A" }) }),
1501
+ a && !he && /* @__PURE__ */ n(
1502
1502
  "video",
1503
1503
  {
1504
1504
  className: "ll-expanded__bg-idle",
@@ -1510,12 +1510,12 @@ const Ur = ({
1510
1510
  }
1511
1511
  )
1512
1512
  ] }),
1513
- /* @__PURE__ */ n("div", { ref: fe, className: "ll-expanded__video" }),
1514
- le && /* @__PURE__ */ x("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1513
+ /* @__PURE__ */ n("div", { ref: pe, className: "ll-expanded__video" }),
1514
+ ae && /* @__PURE__ */ x("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1515
1515
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1516
1516
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
1517
1517
  ] }),
1518
- A && pe && /* @__PURE__ */ x(
1518
+ A && he && /* @__PURE__ */ x(
1519
1519
  "button",
1520
1520
  {
1521
1521
  type: "button",
@@ -1527,7 +1527,7 @@ const Ur = ({
1527
1527
  ]
1528
1528
  }
1529
1529
  ),
1530
- ie && /* @__PURE__ */ x(
1530
+ le && /* @__PURE__ */ x(
1531
1531
  "div",
1532
1532
  {
1533
1533
  className: "ll-expanded__overlay ll-expanded__overlay--transforming",
@@ -1541,7 +1541,7 @@ const Ur = ({
1541
1541
  }
1542
1542
  ),
1543
1543
  We ? /* @__PURE__ */ x(ze, { children: [
1544
- !F && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar", children: [
1544
+ !H && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar", children: [
1545
1545
  !xe && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar-left", children: [
1546
1546
  /* @__PURE__ */ x("div", { className: "ll-expanded__pill-wrap", children: [
1547
1547
  /* @__PURE__ */ x(
@@ -1549,45 +1549,45 @@ const Ur = ({
1549
1549
  {
1550
1550
  type: "button",
1551
1551
  className: "ll-hpill",
1552
- onClick: (g) => {
1553
- De && (g.stopPropagation(), m());
1552
+ onClick: (y) => {
1553
+ Pe && (y.stopPropagation(), m());
1554
1554
  },
1555
- "aria-haspopup": De ? "listbox" : void 0,
1556
- "aria-expanded": De ? w : void 0,
1555
+ "aria-haspopup": Pe ? "listbox" : void 0,
1556
+ "aria-expanded": Pe ? w : void 0,
1557
1557
  children: [
1558
1558
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1559
- De && /* @__PURE__ */ n(wt, {})
1559
+ Pe && /* @__PURE__ */ n(bt, {})
1560
1560
  ]
1561
1561
  }
1562
1562
  ),
1563
- De && w && /* @__PURE__ */ n(
1563
+ Pe && w && /* @__PURE__ */ n(
1564
1564
  "div",
1565
1565
  {
1566
1566
  className: "ll-hmenu",
1567
- onClick: (g) => g.stopPropagation(),
1567
+ onClick: (y) => y.stopPropagation(),
1568
1568
  role: "listbox",
1569
- children: l == null ? void 0 : l.map((g) => /* @__PURE__ */ x(
1569
+ children: l == null ? void 0 : l.map((y) => /* @__PURE__ */ x(
1570
1570
  "button",
1571
1571
  {
1572
1572
  type: "button",
1573
- className: `ll-hmenu__item ${g.id === c ? "is-active" : ""}`,
1574
- onClick: () => f(g.id),
1573
+ className: `ll-hmenu__item ${y.id === c ? "is-active" : ""}`,
1574
+ onClick: () => f(y.id),
1575
1575
  role: "option",
1576
- "aria-selected": g.id === c,
1576
+ "aria-selected": y.id === c,
1577
1577
  children: [
1578
- g.avatarImageUrl && /* @__PURE__ */ n(
1578
+ y.avatarImageUrl && /* @__PURE__ */ n(
1579
1579
  "img",
1580
1580
  {
1581
- src: g.avatarImageUrl,
1581
+ src: y.avatarImageUrl,
1582
1582
  alt: "",
1583
1583
  className: "ll-hmenu__avatar"
1584
1584
  }
1585
1585
  ),
1586
- /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: g.name }),
1587
- g.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: g.role })
1586
+ /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: y.name }),
1587
+ y.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: y.role })
1588
1588
  ]
1589
1589
  },
1590
- g.id
1590
+ y.id
1591
1591
  ))
1592
1592
  }
1593
1593
  )
@@ -1598,8 +1598,8 @@ const Ur = ({
1598
1598
  {
1599
1599
  type: "button",
1600
1600
  className: "ll-hpill ll-hpill--compact",
1601
- onClick: (g) => {
1602
- g.stopPropagation(), _();
1601
+ onClick: (y) => {
1602
+ y.stopPropagation(), _();
1603
1603
  },
1604
1604
  "aria-haspopup": "listbox",
1605
1605
  "aria-expanded": R,
@@ -1607,7 +1607,7 @@ const Ur = ({
1607
1607
  title: "Language: English",
1608
1608
  children: [
1609
1609
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
1610
- /* @__PURE__ */ n(wt, {})
1610
+ /* @__PURE__ */ n(bt, {})
1611
1611
  ]
1612
1612
  }
1613
1613
  ),
@@ -1615,7 +1615,7 @@ const Ur = ({
1615
1615
  "div",
1616
1616
  {
1617
1617
  className: "ll-hmenu",
1618
- onClick: (g) => g.stopPropagation(),
1618
+ onClick: (y) => y.stopPropagation(),
1619
1619
  role: "listbox",
1620
1620
  children: /* @__PURE__ */ n(
1621
1621
  "button",
@@ -1644,13 +1644,13 @@ const Ur = ({
1644
1644
  {
1645
1645
  type: "button",
1646
1646
  className: "ll-hbtn",
1647
- onClick: Te,
1647
+ onClick: De,
1648
1648
  "aria-label": "Minimize widget",
1649
1649
  title: "Minimize",
1650
- children: /* @__PURE__ */ n(pn, {})
1650
+ children: /* @__PURE__ */ n(hn, {})
1651
1651
  }
1652
1652
  ),
1653
- Se !== !1 && /* @__PURE__ */ n(
1653
+ Ne !== !1 && /* @__PURE__ */ n(
1654
1654
  "button",
1655
1655
  {
1656
1656
  type: "button",
@@ -1658,22 +1658,26 @@ const Ur = ({
1658
1658
  onClick: $,
1659
1659
  "aria-label": "End call",
1660
1660
  title: "End call",
1661
- children: /* @__PURE__ */ n(fn, {})
1661
+ children: /* @__PURE__ */ n(pn, {})
1662
1662
  }
1663
1663
  )
1664
1664
  ] })
1665
1665
  ] }),
1666
- F && /* @__PURE__ */ x("div", { className: "ll-compact-status", "data-state": u, children: [
1666
+ H && /* @__PURE__ */ x("div", { className: "ll-compact-status", "data-state": u, children: [
1667
1667
  /* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1668
1668
  /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: u })
1669
1669
  ] })
1670
1670
  ] }) : (
1671
- // Idle-state header with Live Layer product name + minimize/close.
1672
- // Hidden in compact mode on a 140×210 docked slot the brand pill
1673
- // and 40px buttons crowded out the central "Start video call"
1674
- // affordance. The user can dismiss by scrolling past the slot.
1675
- !F && /* @__PURE__ */ x("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1676
- lt ? /* @__PURE__ */ x(
1671
+ // Idle-state header. In compactControls mode (mobile WIDGET +
1672
+ // every EMBEDDED card) we keep the header mounted but strip the
1673
+ // brand pill and the minimize button the surface is too small
1674
+ // for either, AND there's nothing meaningful to minimize FROM
1675
+ // before a session starts. The X close button stays so visitors
1676
+ // can always dismiss; making the whole header disappear (the
1677
+ // pre-0.18.0 behavior) left users no way out short of scrolling
1678
+ // the page itself.
1679
+ /* @__PURE__ */ x("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1680
+ !H && (it ? /* @__PURE__ */ x(
1677
1681
  "a",
1678
1682
  {
1679
1683
  className: "ll-expanded__brand ll-expanded__brand--link",
@@ -1683,37 +1687,37 @@ const Ur = ({
1683
1687
  "aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
1684
1688
  title: "Powered by LiveLayer — visit livelayer.studio",
1685
1689
  children: [
1686
- /* @__PURE__ */ n(Hr, { size: 14, className: "ll-expanded__brand-mark" }),
1687
- /* @__PURE__ */ n("span", { children: mt })
1690
+ /* @__PURE__ */ n(Br, { size: 14, className: "ll-expanded__brand-mark" }),
1691
+ /* @__PURE__ */ n("span", { children: Ee })
1688
1692
  ]
1689
1693
  }
1690
- ) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: mt }),
1694
+ ) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ee })),
1691
1695
  /* @__PURE__ */ x("div", { className: "ll-expanded__header-actions", children: [
1692
- X !== !1 && /* @__PURE__ */ n(
1696
+ !H && X !== !1 && /* @__PURE__ */ n(
1693
1697
  "button",
1694
1698
  {
1695
1699
  type: "button",
1696
1700
  className: "ll-hbtn ll-hbtn--ghost",
1697
- onClick: Te,
1701
+ onClick: De,
1698
1702
  "aria-label": "Minimize widget",
1699
- children: /* @__PURE__ */ n(pn, {})
1703
+ children: /* @__PURE__ */ n(hn, {})
1700
1704
  }
1701
1705
  ),
1702
- Se !== !1 && /* @__PURE__ */ n(
1706
+ Ne !== !1 && /* @__PURE__ */ n(
1703
1707
  "button",
1704
1708
  {
1705
1709
  type: "button",
1706
1710
  className: "ll-hbtn ll-hbtn--danger",
1707
1711
  onClick: $,
1708
1712
  "aria-label": "Close widget",
1709
- children: /* @__PURE__ */ n(fn, {})
1713
+ children: /* @__PURE__ */ n(pn, {})
1710
1714
  }
1711
1715
  )
1712
1716
  ] })
1713
1717
  ] })
1714
1718
  ),
1715
1719
  rt && /* @__PURE__ */ (() => {
1716
- const g = L ? "Resume session" : y === "disconnected" ? "Reconnect to agent" : "Start video call";
1720
+ const y = L ? "Resume session" : g === "disconnected" ? "Reconnect to agent" : "Start video call";
1717
1721
  return /* @__PURE__ */ x(ze, { children: [
1718
1722
  !I && /* @__PURE__ */ x(
1719
1723
  "button",
@@ -1721,14 +1725,14 @@ const Ur = ({
1721
1725
  type: "button",
1722
1726
  className: "ll-expanded__play",
1723
1727
  onClick: et,
1724
- "aria-label": g,
1728
+ "aria-label": y,
1725
1729
  children: [
1726
1730
  /* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
1727
- F && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: g })
1731
+ H && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: y })
1728
1732
  ]
1729
1733
  }
1730
1734
  ),
1731
- !F && /* @__PURE__ */ x("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1735
+ !H && /* @__PURE__ */ x("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1732
1736
  i && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: i }) }),
1733
1737
  /* @__PURE__ */ n(
1734
1738
  "button",
@@ -1736,8 +1740,8 @@ const Ur = ({
1736
1740
  type: "button",
1737
1741
  className: "ll-expanded__cta",
1738
1742
  onClick: et,
1739
- "aria-label": g,
1740
- children: g
1743
+ "aria-label": y,
1744
+ children: y
1741
1745
  }
1742
1746
  )
1743
1747
  ] })
@@ -1751,7 +1755,7 @@ const Ur = ({
1751
1755
  /* @__PURE__ */ n(
1752
1756
  "div",
1753
1757
  {
1754
- ref: he,
1758
+ ref: de,
1755
1759
  className: S ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1756
1760
  }
1757
1761
  ),
@@ -1766,7 +1770,7 @@ const Ur = ({
1766
1770
  }
1767
1771
  ),
1768
1772
  We ? /* @__PURE__ */ x("div", { className: "ll-expanded__bottom", children: [
1769
- !F && Ve && /* @__PURE__ */ n(
1773
+ !H && Ve && /* @__PURE__ */ n(
1770
1774
  "div",
1771
1775
  {
1772
1776
  className: "ll-expanded__transcript ll-expanded__transcript--agent",
@@ -1774,62 +1778,62 @@ const Ur = ({
1774
1778
  children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ve })
1775
1779
  }
1776
1780
  ),
1777
- !F && Ye && /* @__PURE__ */ n(
1781
+ !H && lt && /* @__PURE__ */ n(
1778
1782
  "div",
1779
1783
  {
1780
1784
  className: "ll-expanded__transcript ll-expanded__transcript--user",
1781
1785
  "data-role": "user",
1782
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ye })
1786
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: lt })
1783
1787
  }
1784
1788
  ),
1785
- !xe && !F && /* @__PURE__ */ x("div", { className: "ll-toolbar", onClick: (g) => g.stopPropagation(), children: [
1789
+ !xe && !H && /* @__PURE__ */ x("div", { className: "ll-toolbar", onClick: (y) => y.stopPropagation(), children: [
1786
1790
  He && /* @__PURE__ */ n(
1787
1791
  "button",
1788
1792
  {
1789
1793
  type: "button",
1790
1794
  className: `ll-tool ${S ? "is-on" : ""}`,
1791
- onClick: Ie,
1795
+ onClick: Me,
1792
1796
  "aria-label": S ? "Stop sharing screen" : "Share screen",
1793
1797
  title: S ? "Stop sharing" : "Share screen",
1794
- children: /* @__PURE__ */ n(En, {})
1798
+ children: /* @__PURE__ */ n(Sn, {})
1795
1799
  }
1796
1800
  ),
1797
- de && /* @__PURE__ */ x("div", { className: "ll-tool-split", children: [
1801
+ fe && /* @__PURE__ */ x("div", { className: "ll-tool-split", children: [
1798
1802
  /* @__PURE__ */ n(
1799
1803
  "button",
1800
1804
  {
1801
1805
  type: "button",
1802
1806
  className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
1803
- onClick: Ae,
1807
+ onClick: Ie,
1804
1808
  "aria-label": q ? "Turn off camera" : "Turn on camera",
1805
1809
  title: q ? "Stop camera" : "Start camera",
1806
- children: /* @__PURE__ */ n(Sn, {})
1810
+ children: /* @__PURE__ */ n(Nn, {})
1807
1811
  }
1808
1812
  ),
1809
1813
  /* @__PURE__ */ n(
1810
1814
  "button",
1811
1815
  {
1812
- ref: pt,
1816
+ ref: ht,
1813
1817
  type: "button",
1814
1818
  className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
1815
- onClick: (g) => {
1816
- g.stopPropagation(), ae((Q) => !Q), Ue(!1);
1819
+ onClick: (y) => {
1820
+ y.stopPropagation(), se((Q) => !Q), Ue(!1);
1817
1821
  },
1818
1822
  "aria-label": "Camera devices",
1819
1823
  "aria-haspopup": "listbox",
1820
1824
  "aria-expanded": je,
1821
- children: /* @__PURE__ */ n(wt, {})
1825
+ children: /* @__PURE__ */ n(bt, {})
1822
1826
  }
1823
1827
  ),
1824
- je && B.length > 0 && /* @__PURE__ */ n(
1825
- hn,
1828
+ je && F.length > 0 && /* @__PURE__ */ n(
1829
+ mn,
1826
1830
  {
1827
1831
  label: "Camera",
1828
- devices: B,
1832
+ devices: F,
1829
1833
  activeId: j,
1830
- anchorRef: pt,
1831
- onPick: (g) => {
1832
- ae(!1), Fe(g);
1834
+ anchorRef: ht,
1835
+ onPick: (y) => {
1836
+ se(!1), Fe(y);
1833
1837
  }
1834
1838
  }
1835
1839
  )
@@ -1840,36 +1844,36 @@ const Ur = ({
1840
1844
  {
1841
1845
  type: "button",
1842
1846
  className: `ll-tool ll-tool--left ${U ? "is-muted" : ""}`,
1843
- onClick: Ne,
1847
+ onClick: Ae,
1844
1848
  "aria-label": U ? "Unmute microphone" : "Mute microphone",
1845
1849
  title: U ? "Unmute" : "Mute",
1846
- children: /* @__PURE__ */ n(Nn, { muted: U })
1850
+ children: /* @__PURE__ */ n(An, { muted: U })
1847
1851
  }
1848
1852
  ),
1849
1853
  /* @__PURE__ */ n(
1850
1854
  "button",
1851
1855
  {
1852
- ref: ge,
1856
+ ref: me,
1853
1857
  type: "button",
1854
1858
  className: `ll-tool ll-tool--right ${U ? "is-muted" : ""}`,
1855
- onClick: (g) => {
1856
- g.stopPropagation(), Ue((Q) => !Q), ae(!1);
1859
+ onClick: (y) => {
1860
+ y.stopPropagation(), Ue((Q) => !Q), se(!1);
1857
1861
  },
1858
1862
  "aria-label": "Microphone devices",
1859
1863
  "aria-haspopup": "listbox",
1860
- "aria-expanded": me,
1861
- children: /* @__PURE__ */ n(wt, {})
1864
+ "aria-expanded": ue,
1865
+ children: /* @__PURE__ */ n(bt, {})
1862
1866
  }
1863
1867
  ),
1864
- me && P.length > 0 && /* @__PURE__ */ n(
1865
- hn,
1868
+ ue && P.length > 0 && /* @__PURE__ */ n(
1869
+ mn,
1866
1870
  {
1867
1871
  label: "Microphone",
1868
1872
  devices: P,
1869
- activeId: O,
1870
- anchorRef: ge,
1871
- onPick: (g) => {
1872
- Ue(!1), Be(g);
1873
+ activeId: B,
1874
+ anchorRef: me,
1875
+ onPick: (y) => {
1876
+ Ue(!1), Be(y);
1873
1877
  }
1874
1878
  }
1875
1879
  )
@@ -1879,10 +1883,10 @@ const Ur = ({
1879
1883
  {
1880
1884
  type: "button",
1881
1885
  className: `ll-tool ${_e ? "is-muted" : ""}`,
1882
- onClick: Me,
1886
+ onClick: Re,
1883
1887
  "aria-label": _e ? "Unmute speaker" : "Mute speaker",
1884
1888
  title: _e ? "Unmute speaker" : "Mute speaker",
1885
- children: /* @__PURE__ */ n(An, { muted: _e })
1889
+ children: /* @__PURE__ */ n(In, { muted: _e })
1886
1890
  }
1887
1891
  ),
1888
1892
  /* @__PURE__ */ n(
@@ -1893,54 +1897,54 @@ const Ur = ({
1893
1897
  onClick: tt,
1894
1898
  "aria-label": "End conversation",
1895
1899
  title: "End conversation",
1896
- children: /* @__PURE__ */ n(In, {})
1900
+ children: /* @__PURE__ */ n(Mn, {})
1897
1901
  }
1898
1902
  )
1899
1903
  ] }),
1900
- !xe && F && /* @__PURE__ */ n(
1901
- Fr,
1904
+ !xe && H && /* @__PURE__ */ n(
1905
+ qr,
1902
1906
  {
1903
1907
  isMuted: U,
1904
- onToggleMute: Ne,
1908
+ onToggleMute: Ae,
1905
1909
  isCameraEnabled: q,
1906
- onToggleCamera: Ae,
1907
- allowCamera: de,
1910
+ onToggleCamera: Ie,
1911
+ allowCamera: fe,
1908
1912
  isScreenShareEnabled: S,
1909
- onToggleScreenShare: Ie,
1913
+ onToggleScreenShare: Me,
1910
1914
  allowScreenShare: He,
1911
1915
  isSpeakerMuted: _e,
1912
- onToggleSpeaker: Me,
1916
+ onToggleSpeaker: Re,
1913
1917
  allowTyping: Oe,
1914
- isTypingOpen: ht,
1915
- onToggleTyping: se,
1918
+ isTypingOpen: mt,
1919
+ onToggleTyping: Ct,
1916
1920
  onDisconnect: tt
1917
1921
  }
1918
1922
  ),
1919
- !xe && Oe && (F ? ht : !0) && /* @__PURE__ */ x("form", { className: "ll-message-input", onSubmit: it, children: [
1923
+ !xe && Oe && (H ? mt : !0) && /* @__PURE__ */ x("form", { className: "ll-message-input", onSubmit: Le, children: [
1920
1924
  /* @__PURE__ */ n(
1921
1925
  "input",
1922
1926
  {
1923
1927
  type: "text",
1924
1928
  className: "ll-message-input__field",
1925
1929
  placeholder: "Message...",
1926
- value: ue,
1927
- onChange: (g) => Ee(g.target.value),
1930
+ value: ge,
1931
+ onChange: (y) => re(y.target.value),
1928
1932
  "aria-label": "Message the agent"
1929
1933
  }
1930
1934
  ),
1931
- ue.trim() && /* @__PURE__ */ n(
1935
+ ge.trim() && /* @__PURE__ */ n(
1932
1936
  "button",
1933
1937
  {
1934
1938
  type: "submit",
1935
1939
  className: "ll-message-input__send",
1936
1940
  "aria-label": "Send message",
1937
- children: /* @__PURE__ */ n(jr, {})
1941
+ children: /* @__PURE__ */ n(Yr, {})
1938
1942
  }
1939
1943
  )
1940
1944
  ] })
1941
1945
  ] }) : null,
1942
1946
  (() => {
1943
- if (b && y !== "error")
1947
+ if (b && g !== "error")
1944
1948
  return /* @__PURE__ */ x("div", { className: "ll-expanded__banner", role: "alert", children: [
1945
1949
  /* @__PURE__ */ n("span", { children: b }),
1946
1950
  /* @__PURE__ */ n(
@@ -1948,22 +1952,22 @@ const Ur = ({
1948
1952
  {
1949
1953
  type: "button",
1950
1954
  className: "ll-expanded__banner-x",
1951
- onClick: Lt,
1955
+ onClick: xt,
1952
1956
  "aria-label": "Dismiss",
1953
1957
  children: "×"
1954
1958
  }
1955
1959
  )
1956
1960
  ] });
1957
- if (!I || y !== "error") return null;
1958
- let g = "Failed to connect", Q = "Try again";
1959
- return I === "MIC_PERMISSION_DENIED" ? g = "Microphone blocked. Allow access to talk." : I === "MIC_NOT_FOUND" ? g = "No microphone found. Plug one in + retry." : I === "MIC_UNAVAILABLE" ? g = "Mic unavailable. Check other apps using it." : I === "AGENT_TIMEOUT" ? g = "Agent didn't pick up. Try again." : I === "CONNECT_FAILED" ? g = "Connection failed. Check your network." : I.length < 80 && (g = I), /* @__PURE__ */ x("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1960
- /* @__PURE__ */ n("span", { children: g }),
1961
+ if (!I || g !== "error") return null;
1962
+ let y = "Failed to connect", Q = "Try again";
1963
+ return I === "MIC_PERMISSION_DENIED" ? y = "Microphone blocked. Allow access to talk." : I === "MIC_NOT_FOUND" ? y = "No microphone found. Plug one in + retry." : I === "MIC_UNAVAILABLE" ? y = "Mic unavailable. Check other apps using it." : I === "AGENT_TIMEOUT" ? y = "Agent didn't pick up. Try again." : I === "CONNECT_FAILED" ? y = "Connection failed. Check your network." : I.length < 80 && (y = I), /* @__PURE__ */ x("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1964
+ /* @__PURE__ */ n("span", { children: y }),
1961
1965
  /* @__PURE__ */ n(
1962
1966
  "button",
1963
1967
  {
1964
1968
  type: "button",
1965
1969
  className: "ll-expanded__banner-retry",
1966
- onClick: ft,
1970
+ onClick: pt,
1967
1971
  children: Q
1968
1972
  }
1969
1973
  )
@@ -1973,32 +1977,32 @@ const Ur = ({
1973
1977
  }
1974
1978
  );
1975
1979
  };
1976
- function wt() {
1980
+ function bt() {
1977
1981
  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" }) });
1978
1982
  }
1979
- function fn() {
1983
+ function pn() {
1980
1984
  return /* @__PURE__ */ x("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1981
1985
  /* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1982
1986
  /* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1983
1987
  ] });
1984
1988
  }
1985
- function pn() {
1989
+ function hn() {
1986
1990
  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" }) });
1987
1991
  }
1988
- function En() {
1992
+ function Sn() {
1989
1993
  return /* @__PURE__ */ x("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: [
1990
1994
  /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
1991
1995
  /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
1992
1996
  /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
1993
1997
  ] });
1994
1998
  }
1995
- function Sn() {
1999
+ function Nn() {
1996
2000
  return /* @__PURE__ */ x("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: [
1997
2001
  /* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
1998
2002
  /* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
1999
2003
  ] });
2000
2004
  }
2001
- function Nn({ muted: e }) {
2005
+ function An({ muted: e }) {
2002
2006
  return /* @__PURE__ */ x("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: [
2003
2007
  /* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
2004
2008
  /* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
@@ -2006,7 +2010,7 @@ function Nn({ muted: e }) {
2006
2010
  e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2007
2011
  ] });
2008
2012
  }
2009
- function An({ muted: e }) {
2013
+ function In({ muted: e }) {
2010
2014
  return /* @__PURE__ */ x("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: [
2011
2015
  /* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
2012
2016
  e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ x(ze, { children: [
@@ -2015,13 +2019,13 @@ function An({ muted: e }) {
2015
2019
  ] })
2016
2020
  ] });
2017
2021
  }
2018
- function jr() {
2022
+ function Yr() {
2019
2023
  return /* @__PURE__ */ x("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2020
2024
  /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
2021
2025
  /* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
2022
2026
  ] });
2023
2027
  }
2024
- function In() {
2028
+ function Mn() {
2025
2029
  return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
2026
2030
  "path",
2027
2031
  {
@@ -2030,7 +2034,7 @@ function In() {
2030
2034
  }
2031
2035
  ) });
2032
2036
  }
2033
- const hn = ({
2037
+ const mn = ({
2034
2038
  label: e,
2035
2039
  devices: t,
2036
2040
  activeId: r,
@@ -2038,7 +2042,7 @@ const hn = ({
2038
2042
  anchorRef: a
2039
2043
  }) => {
2040
2044
  const [i, s] = N(null);
2041
- return Ln(() => {
2045
+ return kn(() => {
2042
2046
  const l = () => {
2043
2047
  const c = a.current;
2044
2048
  if (!c) return;
@@ -2051,7 +2055,7 @@ const hn = ({
2051
2055
  return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
2052
2056
  window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
2053
2057
  };
2054
- }, [a]), i === null || typeof document > "u" ? null : $t(
2058
+ }, [a]), i === null || typeof document > "u" ? null : zt(
2055
2059
  /* @__PURE__ */ x(
2056
2060
  "div",
2057
2061
  {
@@ -2090,7 +2094,7 @@ const hn = ({
2090
2094
  ),
2091
2095
  document.body
2092
2096
  );
2093
- }, Vr = [
2097
+ }, Gr = [
2094
2098
  // Accept any value (or empty) — `<input data-ll-private />` and
2095
2099
  // `<input data-ll-private="true" />` both opt out. The bare attribute
2096
2100
  // is the recommended spelling; "true" is preserved for back-compat.
@@ -2098,17 +2102,17 @@ const hn = ({
2098
2102
  "[data-ll-skip]",
2099
2103
  ".ll-widget"
2100
2104
  ];
2101
- function zt(e) {
2105
+ function Ht(e) {
2102
2106
  let t = e;
2103
2107
  for (; t; ) {
2104
- for (const r of Vr)
2108
+ for (const r of Gr)
2105
2109
  if (t.matches(r)) return !0;
2106
2110
  t = t.parentElement;
2107
2111
  }
2108
2112
  return !1;
2109
2113
  }
2110
- function Dt(e) {
2111
- if (zt(e)) return !1;
2114
+ function Pt(e) {
2115
+ if (Ht(e)) return !1;
2112
2116
  if (e instanceof HTMLInputElement) {
2113
2117
  if (e.type === "password") return !1;
2114
2118
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -2116,7 +2120,7 @@ function Dt(e) {
2116
2120
  }
2117
2121
  return !0;
2118
2122
  }
2119
- const _t = 4096, Yr = 20, Gr = 20, Kr = 10, Jr = 10, Xr = 30, Zr = 20, mn = 500, Qr = [
2123
+ const wt = 4096, Kr = 20, Jr = 20, Xr = 10, Zr = 10, Qr = 30, eo = 20, gn = 500, to = [
2120
2124
  '[data-ll-private="true"]',
2121
2125
  ".ll-widget",
2122
2126
  "script",
@@ -2124,24 +2128,24 @@ const _t = 4096, Yr = 20, Gr = 20, Kr = 10, Jr = 10, Xr = 30, Zr = 20, mn = 500,
2124
2128
  "noscript",
2125
2129
  "iframe"
2126
2130
  ];
2127
- function dt(e) {
2131
+ function ut(e) {
2128
2132
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
2129
2133
  let t = e;
2130
2134
  for (; t; ) {
2131
- for (const r of Qr)
2135
+ for (const r of to)
2132
2136
  if (t.matches(r)) return !0;
2133
2137
  t = t.parentElement;
2134
2138
  }
2135
2139
  return !1;
2136
2140
  }
2137
- function ut(e) {
2141
+ function ft(e) {
2138
2142
  if (typeof window > "u") return !0;
2139
2143
  const t = e.getBoundingClientRect();
2140
2144
  if (t.width <= 0 || t.height <= 0) return !1;
2141
2145
  const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
2142
2146
  return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
2143
2147
  }
2144
- function gn(e) {
2148
+ function yn(e) {
2145
2149
  const t = e.getAttribute("id");
2146
2150
  if (t) {
2147
2151
  const i = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${i}"]`);
@@ -2168,13 +2172,13 @@ function gn(e) {
2168
2172
  const a = e.getAttribute("placeholder");
2169
2173
  return a ? a.trim() : "";
2170
2174
  }
2171
- function oe(e, t) {
2175
+ function ie(e, t) {
2172
2176
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2173
2177
  }
2174
- function eo(e) {
2178
+ function no(e) {
2175
2179
  return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2176
2180
  }
2177
- function to(e) {
2181
+ function ro(e) {
2178
2182
  const t = e.getAttribute("aria-label");
2179
2183
  if (t) return t.trim().slice(0, 80);
2180
2184
  const r = e.getAttribute("aria-labelledby");
@@ -2203,7 +2207,7 @@ function to(e) {
2203
2207
  function Je(e) {
2204
2208
  return e.length;
2205
2209
  }
2206
- function no(e, t = {}) {
2210
+ function oo(e, t = {}) {
2207
2211
  const r = t.doc ?? (typeof document < "u" ? document : null);
2208
2212
  if (!r)
2209
2213
  return {
@@ -2221,114 +2225,114 @@ function no(e, t = {}) {
2221
2225
  r.querySelectorAll("[data-ll-region]")
2222
2226
  ), l = [];
2223
2227
  for (const b of s) {
2224
- if (l.length >= Kr) break;
2225
- if (dt(b) || !ut(b)) continue;
2226
- const P = b.getAttribute("data-ll-region") ?? "", O = b.getAttribute("data-ll-intent") ?? void 0, q = oe(
2228
+ if (l.length >= Xr) break;
2229
+ if (ut(b) || !ft(b)) continue;
2230
+ const P = b.getAttribute("data-ll-region") ?? "", B = b.getAttribute("data-ll-intent") ?? void 0, q = ie(
2227
2231
  (b.innerText || b.textContent || "").trim(),
2228
- mn * 2
2232
+ gn * 2
2229
2233
  );
2230
- !P || !q || l.push({ id: P, intent: O, text: q });
2234
+ !P || !q || l.push({ id: P, intent: B, text: q });
2231
2235
  }
2232
2236
  const c = [], p = ["H1", "H2", "H3", "H4", "H5", "H6"], w = Array.from(
2233
2237
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
2234
2238
  );
2235
2239
  for (const b of w) {
2236
- if (dt(b) || !ut(b)) continue;
2240
+ if (ut(b) || !ft(b)) continue;
2237
2241
  const P = (b.textContent || "").trim();
2238
- P && c.push(`${b.tagName}: ${oe(P, 200)}`);
2242
+ P && c.push(`${b.tagName}: ${ie(P, 200)}`);
2239
2243
  }
2240
2244
  const m = Array.from(r.querySelectorAll("p, li"));
2241
2245
  for (const b of m) {
2242
- if (dt(b) || !ut(b) || p.includes(b.tagName)) continue;
2246
+ if (ut(b) || !ft(b) || p.includes(b.tagName)) continue;
2243
2247
  const P = (b.textContent || "").trim();
2244
- P.length > 10 && c.push(oe(P, mn));
2248
+ P.length > 10 && c.push(ie(P, gn));
2245
2249
  }
2246
2250
  const f = c.join(`
2247
2251
  `), R = [], _ = Array.from(r.querySelectorAll("a[href]"));
2248
2252
  for (const b of _) {
2249
- if (R.length >= Yr) break;
2250
- if (dt(b) || !ut(b)) continue;
2251
- const P = b.getAttribute("href") || "", O = (b.textContent || "").trim();
2252
- !P || !O || R.push({ href: P, text: oe(O, 100) });
2253
+ if (R.length >= Kr) break;
2254
+ if (ut(b) || !ft(b)) continue;
2255
+ const P = b.getAttribute("href") || "", B = (b.textContent || "").trim();
2256
+ !P || !B || R.push({ href: P, text: ie(B, 100) });
2253
2257
  }
2254
- const y = [], u = Array.from(
2258
+ const g = [], u = Array.from(
2255
2259
  r.querySelectorAll(
2256
2260
  "input, textarea, select"
2257
2261
  )
2258
2262
  );
2259
2263
  for (const b of u) {
2260
- if (y.length >= Gr) break;
2261
- if (dt(b) || !Dt(b) || !ut(b)) continue;
2262
- const P = gn(b), O = b instanceof HTMLInputElement ? b.type : b.tagName.toLowerCase();
2263
- P && y.push({ label: oe(P, 100), type: O });
2264
+ if (g.length >= Jr) break;
2265
+ if (ut(b) || !Pt(b) || !ft(b)) continue;
2266
+ const P = yn(b), B = b instanceof HTMLInputElement ? b.type : b.tagName.toLowerCase();
2267
+ P && g.push({ label: ie(P, 100), type: B });
2264
2268
  }
2265
2269
  const h = Array.from(r.querySelectorAll("form")), L = [];
2266
2270
  let A = 0;
2267
2271
  for (const b of h) {
2268
- if (L.length >= Jr) break;
2269
- if (zt(b) || b.matches(".ll-widget *, .ll-widget")) continue;
2270
- const P = b.getAttribute("id") || b.getAttribute("name") || eo(b.getAttribute("data-ll-intent")) || `form_${A++}`, O = b.getAttribute("data-ll-intent") || to(b) || void 0, q = Array.from(
2272
+ if (L.length >= Zr) break;
2273
+ if (Ht(b) || b.matches(".ll-widget *, .ll-widget")) continue;
2274
+ const P = b.getAttribute("id") || b.getAttribute("name") || no(b.getAttribute("data-ll-intent")) || `form_${A++}`, B = b.getAttribute("data-ll-intent") || ro(b) || void 0, q = Array.from(
2271
2275
  b.querySelectorAll(
2272
2276
  "input, textarea, select"
2273
2277
  )
2274
2278
  ), ne = [];
2275
- let B = 0;
2279
+ let F = 0;
2276
2280
  const j = /* @__PURE__ */ new Set();
2277
2281
  for (const S of q) {
2278
- if (ne.length >= Xr) break;
2279
- if (!Dt(S)) continue;
2282
+ if (ne.length >= Qr) break;
2283
+ if (!Pt(S)) continue;
2280
2284
  if (S instanceof HTMLInputElement) {
2281
- const F = S.type;
2282
- if (F === "submit" || F === "button" || F === "reset" || F === "hidden" || F === "image" || F === "file") continue;
2285
+ const H = S.type;
2286
+ if (H === "submit" || H === "button" || H === "reset" || H === "hidden" || H === "image" || H === "file") continue;
2283
2287
  }
2284
2288
  const Z = S.getAttribute("name") || "", _e = S.getAttribute("id") || "";
2285
- let de = Z || _e || `field_${B}`;
2286
- j.has(de) && (de = `${de}__${B}`), j.add(de), B++;
2287
- const He = gn(S) || de, Oe = S instanceof HTMLInputElement ? S.type : S.tagName.toLowerCase(), X = {
2288
- name: de,
2289
- label: oe(He, 100),
2289
+ let fe = Z || _e || `field_${F}`;
2290
+ j.has(fe) && (fe = `${fe}__${F}`), j.add(fe), F++;
2291
+ const He = yn(S) || fe, Oe = S instanceof HTMLInputElement ? S.type : S.tagName.toLowerCase(), X = {
2292
+ name: fe,
2293
+ label: ie(He, 100),
2290
2294
  type: Oe
2291
2295
  };
2292
2296
  S.required === !0 && (X.required = !0);
2293
- const Se = S.getAttribute("placeholder");
2294
- if (Se && (X.placeholder = oe(Se.trim(), 100)), S instanceof HTMLInputElement || S instanceof HTMLTextAreaElement) {
2295
- const F = S.getAttribute("minlength");
2296
- if (F !== null) {
2297
- const Y = parseInt(F, 10);
2297
+ const Ne = S.getAttribute("placeholder");
2298
+ if (Ne && (X.placeholder = ie(Ne.trim(), 100)), S instanceof HTMLInputElement || S instanceof HTMLTextAreaElement) {
2299
+ const H = S.getAttribute("minlength");
2300
+ if (H !== null) {
2301
+ const Y = parseInt(H, 10);
2298
2302
  !Number.isNaN(Y) && Y >= 0 && (X.minLength = Y);
2299
2303
  }
2300
- const ie = S.getAttribute("maxlength");
2301
- if (ie !== null) {
2302
- const Y = parseInt(ie, 10);
2304
+ const le = S.getAttribute("maxlength");
2305
+ if (le !== null) {
2306
+ const Y = parseInt(le, 10);
2303
2307
  !Number.isNaN(Y) && Y >= 0 && (X.maxLength = Y);
2304
2308
  }
2305
2309
  }
2306
2310
  if (S instanceof HTMLInputElement) {
2307
- const F = S.getAttribute("min");
2308
- F !== null && (X.min = oe(F, 50));
2309
- const ie = S.getAttribute("max");
2310
- ie !== null && (X.max = oe(ie, 50));
2311
+ const H = S.getAttribute("min");
2312
+ H !== null && (X.min = ie(H, 50));
2313
+ const le = S.getAttribute("max");
2314
+ le !== null && (X.max = ie(le, 50));
2311
2315
  const Y = S.getAttribute("step");
2312
- Y !== null && (X.step = oe(Y, 20));
2313
- const fe = S.getAttribute("pattern");
2314
- fe !== null && (X.pattern = oe(fe, 200));
2316
+ Y !== null && (X.step = ie(Y, 20));
2317
+ const pe = S.getAttribute("pattern");
2318
+ pe !== null && (X.pattern = ie(pe, 200));
2315
2319
  const K = (S.getAttribute("autocomplete") || "").toLowerCase();
2316
- K && K !== "off" && !K.startsWith("cc-") && (X.autocomplete = oe(K, 50));
2320
+ K && K !== "off" && !K.startsWith("cc-") && (X.autocomplete = ie(K, 50));
2317
2321
  }
2318
2322
  if (S instanceof HTMLSelectElement) {
2319
- const F = [];
2320
- for (let ie = 0; ie < S.options.length && !(F.length >= Zr); ie++) {
2321
- const Y = S.options[ie];
2323
+ const H = [];
2324
+ for (let le = 0; le < S.options.length && !(H.length >= eo); le++) {
2325
+ const Y = S.options[le];
2322
2326
  if (!Y || Y.disabled) continue;
2323
- const fe = Y.value || "", K = (Y.textContent || "").trim() || fe;
2324
- !fe && !K || F.push({ value: fe, label: oe(K, 60) });
2327
+ const pe = Y.value || "", K = (Y.textContent || "").trim() || pe;
2328
+ !pe && !K || H.push({ value: pe, label: ie(K, 60) });
2325
2329
  }
2326
- F.length > 0 && (X.options = F);
2330
+ H.length > 0 && (X.options = H);
2327
2331
  }
2328
2332
  const xe = typeof S.validationMessage == "string" ? S.validationMessage : "";
2329
- xe && (X.validationMessage = oe(xe, 200)), ne.push(X);
2333
+ xe && (X.validationMessage = ie(xe, 200)), ne.push(X);
2330
2334
  }
2331
- L.push({ id: P, intent: O, fields: ne });
2335
+ L.push({ id: P, intent: B, fields: ne });
2332
2336
  }
2333
2337
  const I = {
2334
2338
  url: o,
@@ -2337,30 +2341,30 @@ function no(e, t = {}) {
2337
2341
  regions: l,
2338
2342
  visibleText: f,
2339
2343
  visibleLinks: R,
2340
- visibleFields: y,
2344
+ visibleFields: g,
2341
2345
  forms: L,
2342
2346
  extras: e
2343
2347
  };
2344
2348
  let U = Je(JSON.stringify(I.regions)) + Je(I.visibleText) + Je(JSON.stringify(I.visibleLinks)) + Je(JSON.stringify(I.visibleFields));
2345
- for (; U > _t && I.visibleFields.length > 0; )
2349
+ for (; U > wt && I.visibleFields.length > 0; )
2346
2350
  I.visibleFields.pop(), U = Je(JSON.stringify(I.visibleFields));
2347
- for (; U > _t && I.visibleLinks.length > 0; )
2351
+ for (; U > wt && I.visibleLinks.length > 0; )
2348
2352
  I.visibleLinks.pop(), U -= 80;
2349
- return Je(I.visibleText) > _t && (I.visibleText = oe(I.visibleText, _t - 100)), I;
2353
+ return Je(I.visibleText) > wt && (I.visibleText = ie(I.visibleText, wt - 100)), I;
2350
2354
  }
2351
2355
  let Xe = null;
2352
- function yn(e, t = {}) {
2356
+ function vn(e, t = {}) {
2353
2357
  const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2354
2358
  if (Xe && Xe.key === a && r - Xe.at < 1e3)
2355
2359
  return Xe.ctx;
2356
- const i = no(e, t);
2360
+ const i = oo(e, t);
2357
2361
  return Xe = { key: a, at: r, ctx: i }, i;
2358
2362
  }
2359
- function ro() {
2363
+ function io() {
2360
2364
  Xe = null;
2361
2365
  }
2362
- const oo = 200;
2363
- function io(e) {
2366
+ const lo = 200;
2367
+ function ao(e) {
2364
2368
  const t = String(e.href || "");
2365
2369
  return {
2366
2370
  href: t,
@@ -2370,18 +2374,18 @@ function io(e) {
2370
2374
  description: e.description
2371
2375
  };
2372
2376
  }
2373
- function lo(e) {
2377
+ function so(e) {
2374
2378
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2375
2379
  }
2376
- function ao(e) {
2380
+ function co(e) {
2377
2381
  const t = e ?? (typeof document < "u" ? document : null);
2378
2382
  if (!t) return [];
2379
2383
  const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), a = [], i = Array.from(t.querySelectorAll("a[href]"));
2380
2384
  for (const s of i) {
2381
- if (a.length >= oo) break;
2382
- if (zt(s)) continue;
2385
+ if (a.length >= lo) break;
2386
+ if (Ht(s)) continue;
2383
2387
  const l = s.getAttribute("href") || "";
2384
- if (!lo(l)) continue;
2388
+ if (!so(l)) continue;
2385
2389
  let c = l, p = !0;
2386
2390
  try {
2387
2391
  if (typeof window < "u") {
@@ -2399,18 +2403,18 @@ function ao(e) {
2399
2403
  return a;
2400
2404
  }
2401
2405
  let Ze = null;
2402
- const so = 5e3;
2403
- function Rt() {
2406
+ const uo = 5e3;
2407
+ function Tt() {
2404
2408
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2405
- if (Ze && Ze.pathname === t && e - Ze.at < so)
2409
+ if (Ze && Ze.pathname === t && e - Ze.at < uo)
2406
2410
  return Ze.routes;
2407
- const r = ao();
2411
+ const r = co();
2408
2412
  return Ze = { at: e, pathname: t, routes: r }, r;
2409
2413
  }
2410
- function co() {
2414
+ function fo() {
2411
2415
  Ze = null;
2412
2416
  }
2413
- function vn(e) {
2417
+ function bn(e) {
2414
2418
  if (e instanceof HTMLInputElement) {
2415
2419
  const t = e.type;
2416
2420
  if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
@@ -2418,16 +2422,16 @@ function vn(e) {
2418
2422
  }
2419
2423
  return !0;
2420
2424
  }
2421
- function uo(e, t) {
2425
+ function po(e, t) {
2422
2426
  return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
2423
2427
  }
2424
- function fo(e, t) {
2428
+ function ho(e, t) {
2425
2429
  if (!t) return null;
2426
2430
  try {
2427
2431
  const i = e.querySelector(
2428
2432
  `[name="${t.replace(/"/g, '\\"')}"]`
2429
2433
  );
2430
- if (i && vn(i)) return i;
2434
+ if (i && bn(i)) return i;
2431
2435
  } catch {
2432
2436
  }
2433
2437
  const r = Array.from(
@@ -2436,23 +2440,23 @@ function fo(e, t) {
2436
2440
  let o = 0;
2437
2441
  const a = /* @__PURE__ */ new Map();
2438
2442
  for (const i of r) {
2439
- if (!vn(i)) continue;
2440
- const s = uo(i, o);
2443
+ if (!bn(i)) continue;
2444
+ const s = po(i, o);
2441
2445
  let l = s;
2442
2446
  if (a.has(s) && (l = `${s}__${o}`), l === t) return i;
2443
2447
  a.set(s, i), o++;
2444
2448
  }
2445
2449
  return null;
2446
2450
  }
2447
- function bn(e, t) {
2448
- const r = fo(e, t);
2449
- return r ? Dt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2451
+ function wn(e, t) {
2452
+ const r = ho(e, t);
2453
+ return r ? Pt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2450
2454
  }
2451
- function po(e, t) {
2455
+ function mo(e, t) {
2452
2456
  const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), a = o == null ? void 0 : o.set;
2453
2457
  a ? a.call(e, t) : e.value = t;
2454
2458
  }
2455
- function ho(e, t, r = {}) {
2459
+ function go(e, t, r = {}) {
2456
2460
  const o = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
2457
2461
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2458
2462
  const i = Object.getOwnPropertyDescriptor(
@@ -2462,9 +2466,9 @@ function ho(e, t, r = {}) {
2462
2466
  s ? s.call(e, l) : e.checked = l, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2463
2467
  return;
2464
2468
  }
2465
- po(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2469
+ mo(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2466
2470
  }
2467
- function wn(e, t) {
2471
+ function _n(e, t) {
2468
2472
  if (!t) return null;
2469
2473
  const r = t.replace(/"/g, '\\"');
2470
2474
  try {
@@ -2485,7 +2489,7 @@ function wn(e, t) {
2485
2489
  const i = Array.from(e.querySelectorAll("form"));
2486
2490
  for (const s of i) {
2487
2491
  const l = s.getAttribute("data-ll-intent");
2488
- if (l && mo(l) === t) return s;
2492
+ if (l && yo(l) === t) return s;
2489
2493
  }
2490
2494
  if (/^form_\d+$/.test(t)) {
2491
2495
  const s = parseInt(t.slice(5), 10);
@@ -2498,10 +2502,10 @@ function wn(e, t) {
2498
2502
  }
2499
2503
  return null;
2500
2504
  }
2501
- function mo(e) {
2505
+ function yo(e) {
2502
2506
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2503
2507
  }
2504
- function go() {
2508
+ function vo() {
2505
2509
  if (typeof window > "u" || typeof document > "u")
2506
2510
  return !1;
2507
2511
  const e = document.scrollingElement || document.documentElement;
@@ -2509,19 +2513,19 @@ function go() {
2509
2513
  const t = window.getComputedStyle(e);
2510
2514
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2511
2515
  }
2512
- function yo(e) {
2516
+ function bo(e) {
2513
2517
  if (!(e instanceof HTMLElement)) return !1;
2514
2518
  const r = window.getComputedStyle(e).overflowY;
2515
2519
  return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2516
2520
  }
2517
- function vo() {
2521
+ function wo() {
2518
2522
  if (typeof document > "u") return null;
2519
2523
  const e = Array.from(
2520
2524
  document.querySelectorAll("body, body *")
2521
2525
  );
2522
2526
  let t = null, r = 0;
2523
2527
  for (const o of e) {
2524
- if (!yo(o)) continue;
2528
+ if (!bo(o)) continue;
2525
2529
  const a = o.getBoundingClientRect();
2526
2530
  if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || o.closest(".ll-widget")) continue;
2527
2531
  const i = a.width * a.height;
@@ -2529,24 +2533,24 @@ function vo() {
2529
2533
  }
2530
2534
  return t;
2531
2535
  }
2532
- function bo() {
2536
+ function _o() {
2533
2537
  if (typeof window > "u")
2534
2538
  return null;
2535
- if (go()) return window;
2536
- const e = vo();
2539
+ if (vo()) return window;
2540
+ const e = wo();
2537
2541
  return e || window;
2538
2542
  }
2539
- function _n(e) {
2543
+ function xn(e) {
2540
2544
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2541
2545
  }
2542
- function wo(e) {
2546
+ function xo(e) {
2543
2547
  var t, r;
2544
2548
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2545
2549
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2546
2550
  ((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
2547
2551
  ) : e.scrollHeight - e.clientHeight;
2548
2552
  }
2549
- const _o = /* @__PURE__ */ new Set([
2553
+ const Lo = /* @__PURE__ */ new Set([
2550
2554
  "agent_state",
2551
2555
  "avatar_stream_ready",
2552
2556
  "avatar_active",
@@ -2576,9 +2580,9 @@ const _o = /* @__PURE__ */ new Set([
2576
2580
  // to onAgentCommand.
2577
2581
  "task_field_updated",
2578
2582
  "task_completed"
2579
- ]), Mn = Pt(
2583
+ ]), Rn = $t(
2580
2584
  function(t, r) {
2581
- var Gt, Kt, Jt, Xt, Zt, Qt, en;
2585
+ var Kt, Jt, Xt, Zt, Qt, en, tn;
2582
2586
  const {
2583
2587
  agentId: o,
2584
2588
  apiKey: a,
@@ -2599,7 +2603,7 @@ const _o = /* @__PURE__ */ new Set([
2599
2603
  defaultDisplayMode: f = "expanded",
2600
2604
  onDisplayModeChange: R,
2601
2605
  position: _ = "bottom-right",
2602
- mobileBreakpoint: y = 640,
2606
+ mobileBreakpoint: g = 640,
2603
2607
  persistKey: u = "ll-widget",
2604
2608
  disablePersistence: h = !1,
2605
2609
  teamMembers: L,
@@ -2608,64 +2612,64 @@ const _o = /* @__PURE__ */ new Set([
2608
2612
  idleLoopUrl: U,
2609
2613
  greeting: b,
2610
2614
  avatarImageUrl: P,
2611
- agentName: O,
2615
+ agentName: B,
2612
2616
  branding: q = {},
2613
2617
  allowCamera: ne = !0,
2614
- allowScreenShare: B = !0,
2618
+ allowScreenShare: F = !0,
2615
2619
  allowTyping: j = !0,
2616
2620
  showMinimize: S,
2617
2621
  showClose: Z,
2618
2622
  chromeless: _e = !1,
2619
- floatingChromeContainer: de = null,
2623
+ floatingChromeContainer: fe = null,
2620
2624
  compactControls: He = !1,
2621
2625
  transforming: Oe = !1,
2622
2626
  transformingLabel: X = "Transforming…",
2623
- showOn: Se,
2627
+ showOn: Ne,
2624
2628
  hideOn: xe,
2625
- pathname: F,
2626
- onNavigate: ie,
2629
+ pathname: H,
2630
+ onNavigate: le,
2627
2631
  onScrollToSelector: Y,
2628
- getPageContext: fe,
2632
+ getPageContext: pe,
2629
2633
  pageContextExtras: K,
2630
2634
  getRoutes: et,
2631
2635
  onScrollPage: tt,
2632
- onClick: ft,
2636
+ onClick: pt,
2633
2637
  capabilities: nt,
2634
- onConnect: Ne,
2638
+ onConnect: Ae,
2635
2639
  onDisconnect: Be,
2636
- onTranscript: Ae,
2640
+ onTranscript: Ie,
2637
2641
  onAgentState: Fe,
2638
- onConnectionStateChange: Ie,
2639
- onAgentEvent: Me,
2640
- onAgentCommand: Re,
2641
- onCollect: Te,
2642
+ onConnectionStateChange: Me,
2643
+ onAgentEvent: Re,
2644
+ onAgentCommand: Te,
2645
+ onCollect: De,
2642
2646
  controlledSession: $,
2643
- className: Lt,
2644
- style: De,
2647
+ className: xt,
2648
+ style: Pe,
2645
2649
  zIndex: We = 2147483647
2646
- } = t, pe = vr(F), rt = Cr(pe, Se, xe);
2650
+ } = t, he = wr(H), rt = Sr(he, Ne, xe);
2647
2651
  T(() => {
2648
- ro(), co();
2649
- }, [pe]);
2650
- const Pe = A !== void 0, [qe, kt] = N(() => {
2652
+ io(), fo();
2653
+ }, [he]);
2654
+ const $e = A !== void 0, [qe, Lt] = N(() => {
2651
2655
  var v;
2652
2656
  return A ?? ((v = L == null ? void 0 : L[0]) == null ? void 0 : v.id);
2653
- }), Ce = Pe ? A : qe, le = Qe(
2657
+ }), Ce = $e ? A : qe, ae = Qe(
2654
2658
  () => (L == null ? void 0 : L.find((v) => v.id === Ce)) ?? null,
2655
2659
  [L, Ce]
2656
- ), ot = (le == null ? void 0 : le.agentId) ?? o, he = p === "EMBEDDED", me = gr(y), [Ue, je] = hr({
2660
+ ), ot = (ae == null ? void 0 : ae.agentId) ?? o, de = p === "EMBEDDED", ue = vr(g), [Ue, je] = gr({
2657
2661
  value: m,
2658
2662
  defaultValue: f,
2659
2663
  onChange: R,
2660
2664
  persistKey: u,
2661
- disablePersistence: he || h
2662
- }), ae = he ? "expanded" : Ue, ge = he ? () => {
2663
- } : je, pt = S ?? !he, ht = Z ?? !he, $e = tr(), se = rr(), ue = ir(), Ee = lr(), it = ar(), [mt, lt] = N(!1), [ye, Le] = N(!1), [Ve, Ye] = N(!1), [Ct, gt] = N(!1), [g, Q] = N(!1), yt = Sr({ baseUrl: i, config: c }), vt = M(yt);
2664
- vt.current = yt;
2665
- const Et = M(ie), St = M(Y), Nt = M(tt), At = M(ft), Ht = M(fe), Ot = M(K), Bt = M(et), It = M(nt), ve = M(null);
2666
- Et.current = ie, St.current = Y, Nt.current = tt, At.current = ft, Ht.current = fe, Ot.current = K, Bt.current = et, It.current = nt;
2665
+ disablePersistence: de || h
2666
+ }), se = de ? "expanded" : Ue, me = de ? () => {
2667
+ } : je, ht = S ?? !de, mt = Z ?? !de, kt = _e || !de && ue, Ct = He || !de && ue, ge = rr(), re = ir(), Le = ar(), Ee = sr(), it = cr(), [Se, ye] = N(!1), [Ve, lt] = N(!1), [at, Ye] = N(!1), [y, Q] = N(!1), [Et, Tn] = N(!1), gt = Ar({ baseUrl: i, config: c }), yt = M(gt);
2668
+ yt.current = gt;
2669
+ const St = M(le), Nt = M(Y), At = M(tt), It = M(pt), Ot = M(pe), Bt = M(K), Ft = M(et), Mt = M(nt), ve = M(null);
2670
+ St.current = le, Nt.current = Y, At.current = tt, It.current = pt, Ot.current = pe, Bt.current = K, Ft.current = et, Mt.current = nt;
2667
2671
  function be(v) {
2668
- const d = It.current;
2672
+ const d = Mt.current;
2669
2673
  return d ? d.includes(v) : !0;
2670
2674
  }
2671
2675
  function we(v, d) {
@@ -2673,12 +2677,12 @@ const _o = /* @__PURE__ */ new Set([
2673
2677
  `[LiveLayer] Agent command "${v}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
2674
2678
  );
2675
2679
  }
2676
- const at = E(
2680
+ const st = E(
2677
2681
  (v) => {
2678
- var J, re, ke, ct;
2682
+ var J, oe, ke, dt;
2679
2683
  const d = v;
2680
2684
  if (!(!d.type || typeof d.type != "string")) {
2681
- if (Me == null || Me({ eventName: d.type, data: v }), d.type === "navigate") {
2685
+ if (Re == null || Re({ eventName: d.type, data: v }), d.type === "navigate") {
2682
2686
  if (!be("navigate")) {
2683
2687
  we("navigate", "navigate");
2684
2688
  return;
@@ -2690,9 +2694,9 @@ const _o = /* @__PURE__ */ new Set([
2690
2694
  );
2691
2695
  return;
2692
2696
  }
2693
- if (vt.current.playPageChange(), Et.current) {
2697
+ if (yt.current.playPageChange(), St.current) {
2694
2698
  try {
2695
- Et.current(k);
2699
+ St.current(k);
2696
2700
  } catch (D) {
2697
2701
  console.warn(
2698
2702
  `[LiveLayer] onNavigate threw for "${k}". Falling back. Error:`,
@@ -2729,9 +2733,9 @@ const _o = /* @__PURE__ */ new Set([
2729
2733
  const k = typeof d.selector == "string" ? d.selector : null;
2730
2734
  if (!k) return;
2731
2735
  const D = d.behavior === "instant" ? "instant" : "smooth";
2732
- if (St.current) {
2736
+ if (Nt.current) {
2733
2737
  try {
2734
- St.current(
2738
+ Nt.current(
2735
2739
  k,
2736
2740
  D
2737
2741
  );
@@ -2777,10 +2781,10 @@ const _o = /* @__PURE__ */ new Set([
2777
2781
  } catch (ce) {
2778
2782
  console.warn("[LiveLayer] publishData failed.", ce);
2779
2783
  }
2780
- }, H = Ot.current, V = Ht.current;
2784
+ }, O = Bt.current, V = Ot.current;
2781
2785
  try {
2782
2786
  if (V) {
2783
- const G = V(H);
2787
+ const G = V(O);
2784
2788
  if (G instanceof Promise) {
2785
2789
  W({ type: "page_context_pending" }), G.then((z) => W({ type: "page_context", context: z })).catch((z) => {
2786
2790
  console.warn(
@@ -2788,7 +2792,7 @@ const _o = /* @__PURE__ */ new Set([
2788
2792
  z
2789
2793
  ), W({
2790
2794
  type: "page_context",
2791
- context: yn(H)
2795
+ context: vn(O)
2792
2796
  });
2793
2797
  });
2794
2798
  return;
@@ -2798,7 +2802,7 @@ const _o = /* @__PURE__ */ new Set([
2798
2802
  }
2799
2803
  W({
2800
2804
  type: "page_context",
2801
- context: yn(H)
2805
+ context: vn(O)
2802
2806
  });
2803
2807
  } catch (G) {
2804
2808
  console.warn(
@@ -2806,7 +2810,7 @@ const _o = /* @__PURE__ */ new Set([
2806
2810
  G
2807
2811
  ), W({
2808
2812
  type: "page_context",
2809
- context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: H }
2813
+ context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: O }
2810
2814
  });
2811
2815
  }
2812
2816
  return;
@@ -2824,9 +2828,9 @@ const _o = /* @__PURE__ */ new Set([
2824
2828
  return;
2825
2829
  }
2826
2830
  const D = d.behavior === "instant" ? "instant" : "smooth";
2827
- if (Nt.current) {
2831
+ if (At.current) {
2828
2832
  try {
2829
- Nt.current(
2833
+ At.current(
2830
2834
  k,
2831
2835
  D
2832
2836
  );
@@ -2836,12 +2840,12 @@ const _o = /* @__PURE__ */ new Set([
2836
2840
  return;
2837
2841
  }
2838
2842
  if (typeof window > "u") return;
2839
- const W = { behavior: D }, H = bo(), V = (z) => {
2840
- H instanceof Window ? H.scrollBy({ top: z, ...W }) : H.scrollBy({ top: z, ...W });
2843
+ const W = { behavior: D }, O = _o(), V = (z) => {
2844
+ O instanceof Window ? O.scrollBy({ top: z, ...W }) : O.scrollBy({ top: z, ...W });
2841
2845
  }, G = (z) => {
2842
- H instanceof Window ? H.scrollTo({ top: z, ...W }) : H.scrollTo({ top: z, ...W });
2846
+ O instanceof Window ? O.scrollTo({ top: z, ...W }) : O.scrollTo({ top: z, ...W });
2843
2847
  };
2844
- k === "up" ? V(-_n(H)) : k === "down" ? V(_n(H)) : G(k === "top" ? 0 : wo(H));
2848
+ k === "up" ? V(-xn(O)) : k === "down" ? V(xn(O)) : G(k === "top" ? 0 : xo(O));
2845
2849
  return;
2846
2850
  }
2847
2851
  if (d.type === "click") {
@@ -2854,9 +2858,9 @@ const _o = /* @__PURE__ */ new Set([
2854
2858
  console.warn("[LiveLayer] click: missing selector.");
2855
2859
  return;
2856
2860
  }
2857
- if (At.current) {
2861
+ if (It.current) {
2858
2862
  try {
2859
- At.current(k);
2863
+ It.current(k);
2860
2864
  } catch (W) {
2861
2865
  console.warn("[LiveLayer] onClick threw.", W);
2862
2866
  }
@@ -2884,7 +2888,7 @@ const _o = /* @__PURE__ */ new Set([
2884
2888
  );
2885
2889
  return;
2886
2890
  }
2887
- (re = D.click) == null || re.call(D);
2891
+ (oe = D.click) == null || oe.call(D);
2888
2892
  return;
2889
2893
  }
2890
2894
  if (d.type === "fill_form" || d.type === "focus_field") {
@@ -2893,13 +2897,13 @@ const _o = /* @__PURE__ */ new Set([
2893
2897
  return;
2894
2898
  }
2895
2899
  if (typeof document > "u") return;
2896
- d.type === "fill_form" && vt.current.playConfirmation();
2900
+ d.type === "fill_form" && yt.current.playConfirmation();
2897
2901
  const k = typeof d.formId == "string" ? d.formId : null;
2898
2902
  if (!k) {
2899
2903
  console.warn(`[LiveLayer] ${d.type}: missing formId.`);
2900
2904
  return;
2901
2905
  }
2902
- const D = wn(document, k);
2906
+ const D = _n(document, k);
2903
2907
  if (!D) {
2904
2908
  console.warn(
2905
2909
  `[LiveLayer] ${d.type}: no <form> matched id="${k}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
@@ -2913,17 +2917,17 @@ const _o = /* @__PURE__ */ new Set([
2913
2917
  return;
2914
2918
  }
2915
2919
  if (d.type === "focus_field") {
2916
- const H = typeof d.fieldName == "string" ? d.fieldName : null;
2917
- if (!H) {
2920
+ const O = typeof d.fieldName == "string" ? d.fieldName : null;
2921
+ if (!O) {
2918
2922
  console.warn("[LiveLayer] focus_field: missing fieldName.");
2919
2923
  return;
2920
2924
  }
2921
- const V = bn(D, H);
2925
+ const V = wn(D, O);
2922
2926
  if (V.el === null) {
2923
2927
  V.reason === "private" ? console.warn(
2924
- `[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
2928
+ `[LiveLayer] focus_field: field "${O}" is privacy-protected and not focusable.`
2925
2929
  ) : console.warn(
2926
- `[LiveLayer] focus_field: no input matching key="${H}" in form "${k}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
2930
+ `[LiveLayer] focus_field: no input matching key="${O}" in form "${k}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
2927
2931
  );
2928
2932
  return;
2929
2933
  }
@@ -2935,22 +2939,22 @@ const _o = /* @__PURE__ */ new Set([
2935
2939
  console.warn("[LiveLayer] fill_form: missing or invalid values.");
2936
2940
  return;
2937
2941
  }
2938
- for (const [H, V] of Object.entries(W)) {
2942
+ for (const [O, V] of Object.entries(W)) {
2939
2943
  if (typeof V != "string") continue;
2940
- const G = bn(D, H);
2944
+ const G = wn(D, O);
2941
2945
  if (G.el === null) {
2942
2946
  G.reason === "private" ? console.warn(
2943
- `[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
2947
+ `[LiveLayer] fill_form: field "${O}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
2944
2948
  ) : console.warn(
2945
- `[LiveLayer] fill_form: no input matching key="${H}" in form "${k}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
2949
+ `[LiveLayer] fill_form: no input matching key="${O}" in form "${k}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
2946
2950
  );
2947
2951
  continue;
2948
2952
  }
2949
2953
  try {
2950
- ho(G.el, V);
2954
+ go(G.el, V);
2951
2955
  } catch (z) {
2952
2956
  console.warn(
2953
- `[LiveLayer] fill_form: failed to set "${H}".`,
2957
+ `[LiveLayer] fill_form: failed to set "${O}".`,
2954
2958
  z
2955
2959
  );
2956
2960
  }
@@ -2968,8 +2972,8 @@ const _o = /* @__PURE__ */ new Set([
2968
2972
  console.warn("[LiveLayer] submit_form: missing formId.");
2969
2973
  return;
2970
2974
  }
2971
- vt.current.playConfirmation();
2972
- const D = wn(document, k);
2975
+ yt.current.playConfirmation();
2976
+ const D = _n(document, k);
2973
2977
  if (!D) {
2974
2978
  console.warn(
2975
2979
  `[LiveLayer] submit_form: no <form> matched id="${k}" (or matching name / data-ll-intent slug).`
@@ -2982,12 +2986,12 @@ const _o = /* @__PURE__ */ new Set([
2982
2986
  );
2983
2987
  return;
2984
2988
  }
2985
- const W = typeof d.requestId == "string" ? d.requestId : void 0, H = (ke = ve.current) == null ? void 0 : ke.call(ve), V = (te) => {
2986
- const ce = H, Ke = ce == null ? void 0 : ce.localParticipant;
2989
+ const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (ke = ve.current) == null ? void 0 : ke.call(ve), V = (te) => {
2990
+ const ce = O, Ke = ce == null ? void 0 : ce.localParticipant;
2987
2991
  if (Ke != null && Ke.publishData)
2988
2992
  try {
2989
- const Un = W ? { ...te, requestId: W } : te, jn = new TextEncoder().encode(JSON.stringify(Un));
2990
- Ke.publishData(jn, { reliable: !0 });
2993
+ const Vn = W ? { ...te, requestId: W } : te, Yn = new TextEncoder().encode(JSON.stringify(Vn));
2994
+ Ke.publishData(Yn, { reliable: !0 });
2991
2995
  } catch {
2992
2996
  }
2993
2997
  };
@@ -3020,16 +3024,16 @@ const _o = /* @__PURE__ */ new Set([
3020
3024
  we("request_routes", "read_page");
3021
3025
  return;
3022
3026
  }
3023
- const k = typeof d.requestId == "string" ? d.requestId : void 0, W = (ct = ve.current) == null ? void 0 : ct.call(ve), H = W == null ? void 0 : W.localParticipant;
3024
- if (!(H != null && H.publishData)) return;
3027
+ const k = typeof d.requestId == "string" ? d.requestId : void 0, W = (dt = ve.current) == null ? void 0 : dt.call(ve), O = W == null ? void 0 : W.localParticipant;
3028
+ if (!(O != null && O.publishData)) return;
3025
3029
  const V = (z) => {
3026
3030
  try {
3027
3031
  const te = k ? { type: "routes", routes: z, requestId: k } : { type: "routes", routes: z }, ce = new TextEncoder().encode(JSON.stringify(te));
3028
- H.publishData(ce, { reliable: !0 });
3032
+ O.publishData(ce, { reliable: !0 });
3029
3033
  } catch (te) {
3030
3034
  console.warn("[LiveLayer] request_routes: publishData failed.", te);
3031
3035
  }
3032
- }, G = Bt.current;
3036
+ }, G = Ft.current;
3033
3037
  if (G) {
3034
3038
  try {
3035
3039
  const z = G(), te = (ce) => {
@@ -3037,24 +3041,24 @@ const _o = /* @__PURE__ */ new Set([
3037
3041
  V([]);
3038
3042
  return;
3039
3043
  }
3040
- V(ce.map(io).slice(0, 200));
3044
+ V(ce.map(ao).slice(0, 200));
3041
3045
  };
3042
3046
  z instanceof Promise ? z.then(te).catch((ce) => {
3043
3047
  console.warn(
3044
3048
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
3045
3049
  ce
3046
- ), V(Rt());
3050
+ ), V(Tt());
3047
3051
  }) : te(z);
3048
3052
  } catch (z) {
3049
3053
  console.warn(
3050
3054
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
3051
3055
  z
3052
- ), V(Rt());
3056
+ ), V(Tt());
3053
3057
  }
3054
3058
  return;
3055
3059
  }
3056
3060
  try {
3057
- V(Rt());
3061
+ V(Tt());
3058
3062
  } catch (z) {
3059
3063
  console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
3060
3064
  }
@@ -3106,7 +3110,7 @@ const _o = /* @__PURE__ */ new Set([
3106
3110
  } catch {
3107
3111
  }
3108
3112
  try {
3109
- Te == null || Te(
3113
+ De == null || De(
3110
3114
  k
3111
3115
  );
3112
3116
  } catch (D) {
@@ -3114,22 +3118,22 @@ const _o = /* @__PURE__ */ new Set([
3114
3118
  }
3115
3119
  return;
3116
3120
  }
3117
- _o.has(d.type) || Re == null || Re(d);
3121
+ Lo.has(d.type) || Te == null || Te(d);
3118
3122
  }
3119
3123
  },
3120
- [Re, Me, Te]
3121
- ), ee = er({
3124
+ [Te, Re, De]
3125
+ ), ee = nr({
3122
3126
  agentId: $ ? "__controlled__" : ot,
3123
3127
  baseUrl: i,
3124
3128
  apiKey: a,
3125
3129
  sessionEndpoint: s,
3126
3130
  sessionBody: l,
3127
- onDataMessage: $ ? void 0 : at
3131
+ onDataMessage: $ ? void 0 : st
3128
3132
  });
3129
3133
  T(() => {
3130
3134
  if ($ != null && $.subscribeToDataMessages)
3131
- return $.subscribeToDataMessages(at);
3132
- }, [$, at]), ve.current = () => {
3135
+ return $.subscribeToDataMessages(st);
3136
+ }, [$, st]), ve.current = () => {
3133
3137
  var v;
3134
3138
  return (v = ee.getRoom) == null ? void 0 : v.call(ee);
3135
3139
  }, T(() => {
@@ -3137,16 +3141,16 @@ const _o = /* @__PURE__ */ new Set([
3137
3141
  if (typeof window > "u") return;
3138
3142
  const v = ((J = window.location) == null ? void 0 : J.hostname) || "";
3139
3143
  if (v === "localhost" || v === "127.0.0.1" || v === "0.0.0.0" || v.endsWith(".local") || v.endsWith(".test"))
3140
- return window.__livelayerSimulateCommand = (re) => {
3144
+ return window.__livelayerSimulateCommand = (oe) => {
3141
3145
  try {
3142
- at(re);
3146
+ st(oe);
3143
3147
  } catch (ke) {
3144
3148
  console.warn("[LiveLayer] simulate-command threw:", ke);
3145
3149
  }
3146
3150
  }, () => {
3147
3151
  delete window.__livelayerSimulateCommand;
3148
3152
  };
3149
- }, [at]);
3153
+ }, [st]);
3150
3154
  const C = Qe(() => $ ? {
3151
3155
  connectionState: $.connectionState,
3152
3156
  agentState: $.agentState,
@@ -3178,15 +3182,15 @@ const _o = /* @__PURE__ */ new Set([
3178
3182
  disconnect: ee.disconnect,
3179
3183
  getRoom: ee.getRoom,
3180
3184
  isControlled: !1
3181
- }, [$, ee]), Ft = M(C);
3182
- Ft.current = C;
3183
- const Wt = M($);
3184
- Wt.current = $, Yn(
3185
+ }, [$, ee]), Wt = M(C);
3186
+ Wt.current = C;
3187
+ const qt = M($);
3188
+ qt.current = $, Kn(
3185
3189
  r,
3186
3190
  () => ({
3187
3191
  sendData: async (v) => {
3188
- var ke, ct;
3189
- const d = Wt.current;
3192
+ var ke, dt;
3193
+ const d = qt.current;
3190
3194
  if (d != null && d.publishData) {
3191
3195
  try {
3192
3196
  await d.publishData(v);
@@ -3195,11 +3199,11 @@ const _o = /* @__PURE__ */ new Set([
3195
3199
  }
3196
3200
  return;
3197
3201
  }
3198
- const J = (ct = (ke = Ft.current) == null ? void 0 : ke.getRoom) == null ? void 0 : ct.call(ke), re = J == null ? void 0 : J.localParticipant;
3199
- if (re != null && re.publishData)
3202
+ const J = (dt = (ke = Wt.current) == null ? void 0 : ke.getRoom) == null ? void 0 : dt.call(ke), oe = J == null ? void 0 : J.localParticipant;
3203
+ if (oe != null && oe.publishData)
3200
3204
  try {
3201
3205
  const k = new TextEncoder().encode(JSON.stringify(v));
3202
- await re.publishData(k, { reliable: !0 });
3206
+ await oe.publishData(k, { reliable: !0 });
3203
3207
  } catch (k) {
3204
3208
  console.warn("[AvatarWidget] sendData failed:", k);
3205
3209
  }
@@ -3207,9 +3211,9 @@ const _o = /* @__PURE__ */ new Set([
3207
3211
  }),
3208
3212
  []
3209
3213
  );
3210
- const qt = M(null);
3214
+ const Ut = M(null);
3211
3215
  T(() => {
3212
- const v = C.videoElement, d = qt.current;
3216
+ const v = C.videoElement, d = Ut.current;
3213
3217
  if (!(!v || !d))
3214
3218
  return d.appendChild(v), () => {
3215
3219
  v.parentNode === d && d.removeChild(v);
@@ -3218,37 +3222,37 @@ const _o = /* @__PURE__ */ new Set([
3218
3222
  const v = C.audioElement;
3219
3223
  if (!v) return;
3220
3224
  const d = document.createElement("div");
3221
- d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d), $e.attach(v);
3225
+ d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d), ge.attach(v);
3222
3226
  const J = v.play();
3223
- return J && typeof J.catch == "function" && J.catch((re) => {
3224
- (re == null ? void 0 : re.name) === "NotAllowedError" && lt(!0);
3227
+ return J && typeof J.catch == "function" && J.catch((oe) => {
3228
+ (oe == null ? void 0 : oe.name) === "NotAllowedError" && ye(!0);
3225
3229
  }), () => {
3226
- $e.detach(), v.parentNode === d && d.removeChild(v), d.parentNode === document.body && document.body.removeChild(d);
3230
+ ge.detach(), v.parentNode === d && d.removeChild(v), d.parentNode === document.body && document.body.removeChild(d);
3227
3231
  };
3228
3232
  }, [C.audioElement]), T(() => {
3229
3233
  if (C.isControlled || C.connectionState !== "connected") return;
3230
3234
  const v = C.getRoom();
3231
3235
  if (v)
3232
- return se.setupMic(v).then(() => {
3233
- const d = se.getMicStream();
3234
- d && $e.attachStream(d, "mic");
3236
+ return re.setupMic(v).then(() => {
3237
+ const d = re.getMicStream();
3238
+ d && ge.attachStream(d, "mic");
3235
3239
  }).catch(() => {
3236
3240
  }), () => {
3237
- $e.detachSlot("mic"), se.teardownMic();
3241
+ ge.detachSlot("mic"), re.teardownMic();
3238
3242
  };
3239
3243
  }, [C.isControlled, C.connectionState]), T(() => {
3240
3244
  var d;
3241
3245
  if (C.connectionState !== "connected") return;
3242
3246
  const v = C.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : C.getRoom();
3243
3247
  if (v)
3244
- return ue.attachRoom(v), Ee.attachRoom(v), C.isControlled && se.attachRoom(v), it.refresh(), () => {
3245
- ue.teardown(), Ee.teardown();
3248
+ return Le.attachRoom(v), Ee.attachRoom(v), C.isControlled && re.attachRoom(v), it.refresh(), () => {
3249
+ Le.teardown(), Ee.teardown();
3246
3250
  };
3247
3251
  }, [C.isControlled, C.connectionState, $]), T(() => {
3248
3252
  const v = C.audioElement;
3249
- v && (v.muted = g);
3250
- }, [C.audioElement, g]);
3251
- const Rn = E((v) => {
3253
+ v && (v.muted = Et);
3254
+ }, [C.audioElement, Et]);
3255
+ const Dn = E((v) => {
3252
3256
  const d = { type: "user_message", text: v };
3253
3257
  if ($ != null && $.publishData) {
3254
3258
  try {
@@ -3260,202 +3264,202 @@ const _o = /* @__PURE__ */ new Set([
3260
3264
  const J = C.getRoom();
3261
3265
  if (J)
3262
3266
  try {
3263
- const re = new TextEncoder().encode(JSON.stringify(d));
3264
- J.localParticipant.publishData(re, { reliable: !0 });
3267
+ const oe = new TextEncoder().encode(JSON.stringify(d));
3268
+ J.localParticipant.publishData(oe, { reliable: !0 });
3265
3269
  } catch {
3266
3270
  }
3267
- }, [C, $]), Tn = E(() => {
3268
- Q((v) => !v);
3271
+ }, [C, $]), Pn = E(() => {
3272
+ Tn((v) => !v);
3269
3273
  }, []);
3270
3274
  T(() => {
3271
- Ie == null || Ie(C.connectionState), C.connectionState === "connected" ? Ne == null || Ne() : C.connectionState === "disconnected" && (Be == null || Be());
3272
- }, [C.connectionState, Ne, Be, Ie]), T(() => {
3273
- Ae == null || Ae(C.transcript);
3274
- }, [C.transcript, Ae]), T(() => {
3275
+ Me == null || Me(C.connectionState), C.connectionState === "connected" ? Ae == null || Ae() : C.connectionState === "disconnected" && (Be == null || Be());
3276
+ }, [C.connectionState, Ae, Be, Me]), T(() => {
3277
+ Ie == null || Ie(C.transcript);
3278
+ }, [C.transcript, Ie]), T(() => {
3275
3279
  Fe == null || Fe(C.agentState);
3276
3280
  }, [C.agentState, Fe]), T(() => {
3277
- yt.setThinking(C.agentState === "thinking");
3278
- }, [C.agentState, yt]);
3279
- const Ut = M(!1);
3281
+ gt.setThinking(C.agentState === "thinking");
3282
+ }, [C.agentState, gt]);
3283
+ const jt = M(!1);
3280
3284
  T(() => {
3281
- !w || Ut.current || rt && C.connectionState === "idle" && (Ut.current = !0, C.connect());
3285
+ !w || jt.current || rt && C.connectionState === "idle" && (jt.current = !0, C.connect());
3282
3286
  }, [w, C.connectionState, C, rt]);
3283
- const Dn = E(
3287
+ const $n = E(
3284
3288
  (v) => {
3285
3289
  const d = L == null ? void 0 : L.find((J) => J.id === v);
3286
- d && (Ye(!1), v !== Ce && (Le(!0), C.disconnect(), Pe || kt(v), I == null || I(d)));
3290
+ d && (Ye(!1), v !== Ce && (lt(!0), C.disconnect(), $e || Lt(v), I == null || I(d)));
3287
3291
  },
3288
3292
  [
3289
3293
  L,
3290
3294
  Ce,
3291
3295
  C,
3292
- Pe,
3296
+ $e,
3293
3297
  I
3294
3298
  ]
3295
3299
  );
3296
3300
  T(() => {
3297
- ye && C.connectionState === "connected" && Le(!1);
3298
- }, [C.connectionState, ye]), T(() => {
3299
- if (!Ve) return;
3301
+ Ve && C.connectionState === "connected" && lt(!1);
3302
+ }, [C.connectionState, Ve]), T(() => {
3303
+ if (!at) return;
3300
3304
  const v = (d) => {
3301
3305
  d.key === "Escape" && Ye(!1);
3302
3306
  };
3303
3307
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
3304
- }, [Ve]);
3305
- const Pn = !!P || !!(le != null && le.avatarImageUrl) || C.isControlled, st = sr(ot, i, Pn);
3306
- nt === void 0 && ((Gt = st.info) != null && Gt.capabilities) && (It.current = st.info.capabilities);
3307
- const bt = (le == null ? void 0 : le.name) ?? O ?? ((Kt = C.agentConfig) == null ? void 0 : Kt.name) ?? ((Jt = st.info) == null ? void 0 : Jt.name) ?? "Live Layer", Mt = (le == null ? void 0 : le.avatarImageUrl) ?? P ?? ((Xt = C.agentConfig) == null ? void 0 : Xt.avatarImageUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.avatarImageUrl) ?? null, $n = U ?? ((Qt = C.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((en = st.info) == null ? void 0 : en.idleLoopUrl) ?? null, zn = b ?? null, Hn = E(() => ge("expanded"), [ge]), On = E(
3308
- () => ge("minimized"),
3309
- [ge]
3310
- ), jt = E(() => {
3311
- C.disconnect(), ge("hidden");
3312
- }, [C, ge]), Bn = E(() => {
3308
+ }, [at]);
3309
+ const zn = !!P || !!(ae != null && ae.avatarImageUrl) || C.isControlled, ct = dr(ot, i, zn);
3310
+ nt === void 0 && ((Kt = ct.info) != null && Kt.capabilities) && (Mt.current = ct.info.capabilities);
3311
+ const vt = (ae == null ? void 0 : ae.name) ?? B ?? ((Jt = C.agentConfig) == null ? void 0 : Jt.name) ?? ((Xt = ct.info) == null ? void 0 : Xt.name) ?? "Live Layer", Rt = (ae == null ? void 0 : ae.avatarImageUrl) ?? P ?? ((Zt = C.agentConfig) == null ? void 0 : Zt.avatarImageUrl) ?? ((Qt = ct.info) == null ? void 0 : Qt.avatarImageUrl) ?? null, Hn = U ?? ((en = C.agentConfig) == null ? void 0 : en.idleLoopUrl) ?? ((tn = ct.info) == null ? void 0 : tn.idleLoopUrl) ?? null, On = b ?? null, Bn = E(() => me("expanded"), [me]), Fn = E(
3312
+ () => me("minimized"),
3313
+ [me]
3314
+ ), Vt = E(() => {
3315
+ C.disconnect(), me("hidden");
3316
+ }, [C, me]), Wn = E(() => {
3313
3317
  const v = C.audioElement;
3314
- v && v.play().then(() => lt(!1)).catch(() => {
3318
+ v && v.play().then(() => ye(!1)).catch(() => {
3315
3319
  });
3316
- }, [C.audioElement]), Fn = E(() => {
3317
- lt(!1), C.connect();
3320
+ }, [C.audioElement]), qn = E(() => {
3321
+ ye(!1), C.connect();
3318
3322
  }, [C]), Ge = {
3319
- ...De,
3320
- ...he ? {} : { zIndex: We }
3323
+ ...Pe,
3324
+ ...de ? {} : { zIndex: We }
3321
3325
  };
3322
3326
  q.primaryColor && (Ge["--ll-color-primary"] = q.primaryColor), q.accentColor && (Ge["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Ge["--ll-color-bg"] = q.backgroundColor), q.textColor && (Ge["--ll-color-fg"] = q.textColor);
3323
- const Wn = [
3327
+ const Un = [
3324
3328
  "ll-widget",
3325
- `ll-widget--${ae}`,
3326
- `ll-widget--${me ? "mobile" : "desktop"}`,
3327
- Lt
3329
+ `ll-widget--${se}`,
3330
+ `ll-widget--${ue ? "mobile" : "desktop"}`,
3331
+ xt
3328
3332
  ].filter(Boolean).join(" ");
3329
3333
  if (!rt) return null;
3330
- const qn = /* @__PURE__ */ n(
3334
+ const jn = /* @__PURE__ */ n(
3331
3335
  "div",
3332
3336
  {
3333
- className: Wn,
3337
+ className: Un,
3334
3338
  style: Ge,
3335
- "data-display-mode": ae,
3339
+ "data-display-mode": se,
3336
3340
  "data-position": _,
3337
3341
  "data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
3338
- children: ae === "expanded" && /* @__PURE__ */ n(
3339
- Ur,
3342
+ children: se === "expanded" && /* @__PURE__ */ n(
3343
+ Vr,
3340
3344
  {
3341
3345
  position: _,
3342
- isMobile: me,
3343
- agentName: bt,
3344
- avatarImageUrl: Mt,
3345
- idleLoopUrl: $n,
3346
- greeting: zn,
3346
+ isMobile: ue,
3347
+ agentName: vt,
3348
+ avatarImageUrl: Rt,
3349
+ idleLoopUrl: Hn,
3350
+ greeting: On,
3347
3351
  branding: q,
3348
3352
  teamMembers: L,
3349
3353
  currentTeamMemberId: Ce,
3350
- isSwitchingTeamMember: ye,
3351
- teamSwitcherOpen: Ve,
3354
+ isSwitchingTeamMember: Ve,
3355
+ teamSwitcherOpen: at,
3352
3356
  onToggleTeamSwitcher: () => Ye((v) => !v),
3353
- onSelectTeamMember: Dn,
3357
+ onSelectTeamMember: $n,
3354
3358
  connectionState: C.connectionState,
3355
3359
  agentState: C.agentState,
3356
3360
  transcript: C.transcript,
3357
- isMuted: se.isMuted,
3361
+ isMuted: re.isMuted,
3358
3362
  micDevices: it.mics,
3359
- activeMicId: se.activeDeviceId,
3360
- isCameraEnabled: ue.isEnabled,
3361
- cameraPreviewEl: ue.previewEl,
3363
+ activeMicId: re.activeDeviceId,
3364
+ isCameraEnabled: Le.isEnabled,
3365
+ cameraPreviewEl: Le.previewEl,
3362
3366
  cameraDevices: it.cameras,
3363
- activeCameraId: ue.activeDeviceId,
3367
+ activeCameraId: Le.activeDeviceId,
3364
3368
  isScreenShareEnabled: Ee.isEnabled,
3365
3369
  screenPreviewEl: Ee.previewEl,
3366
- isSpeakerMuted: g,
3370
+ isSpeakerMuted: Et,
3367
3371
  allowCamera: ne,
3368
- allowScreenShare: B,
3372
+ allowScreenShare: F,
3369
3373
  allowTyping: j,
3370
- showMinimize: pt,
3371
- showClose: ht,
3372
- chromeless: _e,
3373
- compactControls: He,
3374
+ showMinimize: ue && !de ? !1 : ht,
3375
+ showClose: mt,
3376
+ chromeless: kt,
3377
+ compactControls: Ct,
3374
3378
  transforming: Oe,
3375
3379
  transformingLabel: X,
3376
- languageMenuOpen: Ct,
3377
- onToggleLanguageMenu: () => gt((v) => !v),
3378
- needsUserGesture: mt,
3380
+ languageMenuOpen: y,
3381
+ onToggleLanguageMenu: () => Q((v) => !v),
3382
+ needsUserGesture: Se,
3379
3383
  canResume: C.canResume,
3380
- micError: se.micError,
3384
+ micError: re.micError,
3381
3385
  error: C.error,
3382
- avatarVideoContainerRef: qt,
3386
+ avatarVideoContainerRef: Ut,
3383
3387
  agentVideoEl: C.videoElement,
3384
3388
  onConnect: () => void C.connect(),
3385
3389
  onDisconnect: () => C.disconnect(),
3386
- onRetry: Fn,
3387
- onResumeAudio: Bn,
3388
- onToggleMute: se.toggleMute,
3389
- onSwitchMicDevice: (v) => void se.switchDevice(v),
3390
- onToggleCamera: () => void ue.toggle(),
3391
- onSwitchCameraDevice: (v) => void ue.switchDevice(v),
3390
+ onRetry: qn,
3391
+ onResumeAudio: Wn,
3392
+ onToggleMute: re.toggleMute,
3393
+ onSwitchMicDevice: (v) => void re.switchDevice(v),
3394
+ onToggleCamera: () => void Le.toggle(),
3395
+ onSwitchCameraDevice: (v) => void Le.switchDevice(v),
3392
3396
  onToggleScreenShare: () => void Ee.toggle(),
3393
- onToggleSpeaker: Tn,
3394
- onSendMessage: Rn,
3395
- onMinimize: On,
3396
- onClose: jt,
3397
- onClearMicError: se.clearError
3397
+ onToggleSpeaker: Pn,
3398
+ onSendMessage: Dn,
3399
+ onMinimize: Fn,
3400
+ onClose: Vt,
3401
+ onClearMicError: re.clearError
3398
3402
  }
3399
3403
  )
3400
3404
  }
3401
- ), Vt = !he && (ae === "hidden" || ae === "minimized") ? /* @__PURE__ */ x(
3405
+ ), Yt = !de && (se === "hidden" || se === "minimized") ? /* @__PURE__ */ x(
3402
3406
  "div",
3403
3407
  {
3404
3408
  className: [
3405
3409
  "ll-widget",
3406
3410
  "ll-widget--floating",
3407
- `ll-widget--${ae}`,
3408
- `ll-widget--${me ? "mobile" : "desktop"}`
3411
+ `ll-widget--${se}`,
3412
+ `ll-widget--${ue ? "mobile" : "desktop"}`
3409
3413
  ].join(" "),
3410
3414
  style: Ge,
3411
- "data-display-mode": ae,
3415
+ "data-display-mode": se,
3412
3416
  "data-position": _,
3413
3417
  children: [
3414
- ae === "hidden" && /* @__PURE__ */ n(
3415
- Tr,
3418
+ se === "hidden" && /* @__PURE__ */ n(
3419
+ Pr,
3416
3420
  {
3417
3421
  position: _,
3418
- isMobile: me,
3422
+ isMobile: ue,
3419
3423
  isSpeaking: C.agentState === "speaking",
3420
- onExpand: () => ge("expanded"),
3421
- label: `Open ${bt} widget`,
3422
- avatarImageUrl: Mt,
3423
- agentName: bt,
3424
- containerEl: de
3424
+ onExpand: () => me("expanded"),
3425
+ label: `Open ${vt} widget`,
3426
+ avatarImageUrl: Rt,
3427
+ agentName: vt,
3428
+ containerEl: fe
3425
3429
  }
3426
3430
  ),
3427
- ae === "minimized" && /* @__PURE__ */ n(
3428
- Pr,
3431
+ se === "minimized" && /* @__PURE__ */ n(
3432
+ zr,
3429
3433
  {
3430
3434
  position: _,
3431
- isMobile: me,
3432
- agentName: bt,
3433
- avatarImageUrl: Mt,
3435
+ isMobile: ue,
3436
+ agentName: vt,
3437
+ avatarImageUrl: Rt,
3434
3438
  agentState: C.agentState,
3435
- isMuted: se.isMuted,
3436
- audioLevel: $e,
3437
- onExpand: Hn,
3438
- onToggleMute: se.toggleMute,
3439
- onClose: jt
3439
+ isMuted: re.isMuted,
3440
+ audioLevel: ge,
3441
+ onExpand: Bn,
3442
+ onToggleMute: re.toggleMute,
3443
+ onClose: Vt
3440
3444
  }
3441
3445
  )
3442
3446
  ]
3443
3447
  }
3444
- ) : null, Yt = de ?? (typeof document < "u" ? document.body : null);
3448
+ ) : null, Gt = fe ?? (typeof document < "u" ? document.body : null);
3445
3449
  return /* @__PURE__ */ x(ze, { children: [
3446
- qn,
3447
- Vt && Yt && $t(Vt, Yt)
3450
+ jn,
3451
+ Yt && Gt && zt(Yt, Gt)
3448
3452
  ] });
3449
3453
  }
3450
3454
  );
3451
- Mn.displayName = "AvatarWidgetInner";
3452
- const xo = Pt(
3455
+ Rn.displayName = "AvatarWidgetInner";
3456
+ const ko = $t(
3453
3457
  function(t, r) {
3454
- return /* @__PURE__ */ n(Qn, { children: /* @__PURE__ */ n(Mn, { ...t, ref: r }) });
3458
+ return /* @__PURE__ */ n(tr, { children: /* @__PURE__ */ n(Rn, { ...t, ref: r }) });
3455
3459
  }
3456
3460
  );
3457
- xo.displayName = "AvatarWidget";
3458
- const To = ({
3461
+ ko.displayName = "AvatarWidget";
3462
+ const Po = ({
3459
3463
  agentId: e,
3460
3464
  baseUrl: t,
3461
3465
  apiKey: r,
@@ -3481,9 +3485,9 @@ const To = ({
3481
3485
  }, [e]), T(() => {
3482
3486
  c.current && (o ? c.current.setAttribute("mode", o) : c.current.removeAttribute("mode"));
3483
3487
  }, [o]), /* @__PURE__ */ n("div", { ref: l, className: i, style: s });
3484
- }, Do = Pt(
3488
+ }, $o = $t(
3485
3489
  function({ id: t, intent: r, as: o = "div", className: a, style: i, children: s }, l) {
3486
- return Gn(
3490
+ return Jn(
3487
3491
  o,
3488
3492
  {
3489
3493
  ref: l,
@@ -3496,7 +3500,7 @@ const To = ({
3496
3500
  );
3497
3501
  }
3498
3502
  );
3499
- function Po(e = {}) {
3503
+ function zo(e = {}) {
3500
3504
  const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [a, i] = N({}), [s, l] = N(!1), [c, p] = N(null), w = M(t), m = M(r), f = M(o);
3501
3505
  T(() => {
3502
3506
  w.current = t, m.current = r, f.current = o;
@@ -3506,9 +3510,9 @@ function Po(e = {}) {
3506
3510
  }, []);
3507
3511
  return T(() => {
3508
3512
  if (typeof window > "u") return;
3509
- const _ = (y) => {
3513
+ const _ = (g) => {
3510
3514
  var h, L;
3511
- const u = y.detail;
3515
+ const u = g.detail;
3512
3516
  if (u) {
3513
3517
  if (u.phase === "field") {
3514
3518
  if (f.current !== "all" && u.source !== f.current)
@@ -3539,8 +3543,8 @@ function Po(e = {}) {
3539
3543
  return document.addEventListener("ll-collected", _), () => document.removeEventListener("ll-collected", _);
3540
3544
  }, []), { fields: a, isCollecting: s, lastResult: c, reset: R };
3541
3545
  }
3542
- let xn = 1;
3543
- function $o({
3546
+ let Ln = 1;
3547
+ function Ho({
3544
3548
  onMount: e,
3545
3549
  defaultOpen: t = !1,
3546
3550
  storageKey: r = "ll-debug-open"
@@ -3576,7 +3580,7 @@ function $o({
3576
3580
  if (T(() => {
3577
3581
  !e || _.current || (_.current = !0, e((u) => {
3578
3582
  f.current.push({
3579
- id: xn++,
3583
+ id: Ln++,
3580
3584
  ts: Date.now(),
3581
3585
  kind: "event",
3582
3586
  type: u.eventName,
@@ -3588,11 +3592,11 @@ function $o({
3588
3592
  try {
3589
3593
  const b = typeof U[0] == "string" ? U[0] : "";
3590
3594
  b.startsWith("[LiveLayer]") && f.current.push({
3591
- id: xn++,
3595
+ id: Ln++,
3592
3596
  ts: Date.now(),
3593
3597
  kind: A,
3594
3598
  type: b.slice(0, 120),
3595
- data: { args: U.slice(1).map((P) => ko(P)) }
3599
+ data: { args: U.slice(1).map((P) => Eo(P)) }
3596
3600
  });
3597
3601
  } catch {
3598
3602
  }
@@ -3628,7 +3632,7 @@ function $o({
3628
3632
  children: "🛰 LL debug"
3629
3633
  }
3630
3634
  );
3631
- const y = i.filter((u) => {
3635
+ const g = i.filter((u) => {
3632
3636
  if (!l) return !0;
3633
3637
  const h = l.toLowerCase();
3634
3638
  return u.type.toLowerCase().includes(h) || JSON.stringify(u.data || {}).toLowerCase().includes(h);
@@ -3679,7 +3683,7 @@ function $o({
3679
3683
  {
3680
3684
  type: "button",
3681
3685
  onClick: () => w((u) => !u),
3682
- style: Tt(p ? "#f59e0b" : "transparent"),
3686
+ style: Dt(p ? "#f59e0b" : "transparent"),
3683
3687
  title: "Pause / resume capture",
3684
3688
  children: p ? "▶ resume" : "⏸ pause"
3685
3689
  }
@@ -3691,7 +3695,7 @@ function $o({
3691
3695
  onClick: () => {
3692
3696
  s([]), f.current = [];
3693
3697
  },
3694
- style: Tt("transparent"),
3698
+ style: Dt("transparent"),
3695
3699
  title: "Clear buffer",
3696
3700
  children: "clear"
3697
3701
  }
@@ -3701,7 +3705,7 @@ function $o({
3701
3705
  {
3702
3706
  type: "button",
3703
3707
  onClick: () => a(!1),
3704
- style: Tt("transparent"),
3708
+ style: Dt("transparent"),
3705
3709
  "aria-label": "Close",
3706
3710
  title: "Close (Cmd/Ctrl + Shift + L)",
3707
3711
  children: "✕"
@@ -3737,7 +3741,7 @@ function $o({
3737
3741
  overflowY: "auto",
3738
3742
  padding: "0 8px 8px"
3739
3743
  },
3740
- children: y.length === 0 ? /* @__PURE__ */ x(
3744
+ children: g.length === 0 ? /* @__PURE__ */ x(
3741
3745
  "div",
3742
3746
  {
3743
3747
  style: {
@@ -3767,8 +3771,8 @@ function $o({
3767
3771
  )
3768
3772
  ]
3769
3773
  }
3770
- ) : y.map((u) => /* @__PURE__ */ n(
3771
- Lo,
3774
+ ) : g.map((u) => /* @__PURE__ */ n(
3775
+ Co,
3772
3776
  {
3773
3777
  entry: u,
3774
3778
  expanded: m.current.has(u.id),
@@ -3784,7 +3788,7 @@ function $o({
3784
3788
  }
3785
3789
  );
3786
3790
  }
3787
- function Lo({
3791
+ function Co({
3788
3792
  entry: e,
3789
3793
  expanded: t,
3790
3794
  onToggle: r
@@ -3854,7 +3858,7 @@ function Lo({
3854
3858
  }
3855
3859
  );
3856
3860
  }
3857
- function Tt(e) {
3861
+ function Dt(e) {
3858
3862
  return {
3859
3863
  background: e,
3860
3864
  color: "#fff",
@@ -3865,21 +3869,21 @@ function Tt(e) {
3865
3869
  cursor: "pointer"
3866
3870
  };
3867
3871
  }
3868
- function ko(e) {
3872
+ function Eo(e) {
3869
3873
  try {
3870
3874
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
3871
3875
  } catch {
3872
3876
  return String(e);
3873
3877
  }
3874
3878
  }
3875
- function Co(e) {
3879
+ function So(e) {
3876
3880
  const t = JSON.stringify(e);
3877
- T(() => Jn(e), [t]);
3881
+ T(() => Zn(e), [t]);
3878
3882
  }
3879
- function zo({ fields: e, children: t }) {
3880
- return Co(e), /* @__PURE__ */ n(ze, { children: t });
3883
+ function Oo({ fields: e, children: t }) {
3884
+ return So(e), /* @__PURE__ */ n(ze, { children: t });
3881
3885
  }
3882
- function Ho() {
3886
+ function Bo() {
3883
3887
  const [e, t] = N([]), r = E((a) => {
3884
3888
  t((i) => {
3885
3889
  const s = i.findIndex((l) => l.id === a.id);
@@ -3898,38 +3902,38 @@ function Ho() {
3898
3902
  };
3899
3903
  }
3900
3904
  export {
3901
- xo as AvatarWidget,
3902
- Qn as ErrorBoundary,
3903
- zo as FieldProvider,
3904
- $o as LiveLayerDebugPanel,
3905
- Do as LiveLayerRegion,
3906
- To as LiveLayerWidget,
3907
- Fo as clearFieldRegistry,
3908
- ro as clearPageContextCache,
3909
- co as clearRoutesCache,
3910
- no as extractPageContext,
3911
- ao as extractRoutes,
3912
- yn as getCachedPageContext,
3913
- Rt as getCachedRoutes,
3914
- Wo as getRegisteredFields,
3915
- Lr as matchesPattern,
3916
- io as normalizeRouteInput,
3917
- qo as registerFields,
3918
- Uo as setFieldValue,
3919
- kr as shouldRenderAtPath,
3920
- sr as useAgentInfo,
3921
- tr as useAudioLevel,
3922
- ir as useCameraState,
3923
- Po as useCollect,
3924
- ur as useDisplayMode,
3925
- hr as useDisplayModePersistence,
3926
- gr as useIsMobile,
3927
- er as useLiveKitSession,
3928
- ar as useMediaDevices,
3929
- rr as useMicrophoneState,
3930
- vr as usePathname,
3931
- Co as useRegisterFields,
3932
- Cr as useRouteMatch,
3933
- lr as useScreenShareState,
3934
- Ho as useTranscript
3905
+ ko as AvatarWidget,
3906
+ tr as ErrorBoundary,
3907
+ Oo as FieldProvider,
3908
+ Ho as LiveLayerDebugPanel,
3909
+ $o as LiveLayerRegion,
3910
+ Po as LiveLayerWidget,
3911
+ qo as clearFieldRegistry,
3912
+ io as clearPageContextCache,
3913
+ fo as clearRoutesCache,
3914
+ oo as extractPageContext,
3915
+ co as extractRoutes,
3916
+ vn as getCachedPageContext,
3917
+ Tt as getCachedRoutes,
3918
+ Uo as getRegisteredFields,
3919
+ Cr as matchesPattern,
3920
+ ao as normalizeRouteInput,
3921
+ jo as registerFields,
3922
+ Vo as setFieldValue,
3923
+ Er as shouldRenderAtPath,
3924
+ dr as useAgentInfo,
3925
+ rr as useAudioLevel,
3926
+ ar as useCameraState,
3927
+ zo as useCollect,
3928
+ pr as useDisplayMode,
3929
+ gr as useDisplayModePersistence,
3930
+ vr as useIsMobile,
3931
+ nr as useLiveKitSession,
3932
+ cr as useMediaDevices,
3933
+ ir as useMicrophoneState,
3934
+ wr as usePathname,
3935
+ So as useRegisterFields,
3936
+ Sr as useRouteMatch,
3937
+ sr as useScreenShareState,
3938
+ Bo as useTranscript
3935
3939
  };