@livelayer/react 0.9.6 → 0.10.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,10 +1,10 @@
1
1
  "use client";
2
- import { jsxs as v, jsx as n, Fragment as ot } from "react/jsx-runtime";
3
- import { Component as In, useState as C, useRef as A, useEffect as I, useCallback as E, useMemo as Ue, useLayoutEffect as Mn, forwardRef as lt, useImperativeHandle as Tn, createElement as Dn } from "react";
4
- import { LiveKitSession as Pn } from "@livelayer/sdk";
5
- import { createLocalAudioTrack as $n, Track as dn, createLocalVideoTrack as zn } from "livekit-client";
6
- import { createPortal as On } from "react-dom";
7
- class Hn extends In {
2
+ import { jsxs as y, jsx as n, Fragment as Ue } from "react/jsx-runtime";
3
+ import { Component as Dn, useState as C, useRef as A, useEffect as T, useCallback as E, useMemo as je, useLayoutEffect as Pn, forwardRef as ot, useImperativeHandle as $n, createElement as zn } from "react";
4
+ import { createPortal as un } from "react-dom";
5
+ import { LiveKitSession as On } from "@livelayer/sdk";
6
+ import { createLocalAudioTrack as Hn, Track as fn, createLocalVideoTrack as Wn } from "livekit-client";
7
+ class Bn extends Dn {
8
8
  constructor() {
9
9
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
10
10
  this.setState({ hasError: !1, error: null });
@@ -19,7 +19,7 @@ class Hn extends In {
19
19
  }
20
20
  render() {
21
21
  var t;
22
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ v("div", { className: "ll-error-boundary", role: "alert", children: [
22
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ y("div", { className: "ll-error-boundary", role: "alert", children: [
23
23
  /* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
24
24
  /* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
25
25
  /* @__PURE__ */ n(
@@ -34,12 +34,12 @@ class Hn extends In {
34
34
  ] }) : this.props.children;
35
35
  }
36
36
  }
37
- function Wn(e) {
38
- const [t, r] = C("idle"), [i, o] = C("idle"), [l, s] = C([]), [a, d] = C(null), [f, _] = C(null), [u, c] = C(null), [R, L] = C(!1), [b, y] = C(null), m = A(null), S = A(e.onDataMessage);
39
- S.current = e.onDataMessage, I(() => {
40
- const T = {
37
+ function qn(e) {
38
+ const [t, r] = C("idle"), [i, o] = C("idle"), [l, s] = C([]), [a, d] = C(null), [f, _] = C(null), [u, c] = C(null), [I, k] = C(!1), [b, v] = C(null), m = A(null), S = A(e.onDataMessage);
39
+ S.current = e.onDataMessage, T(() => {
40
+ const R = {
41
41
  onConnectionStateChange: (q) => {
42
- r(q), q === "connected" && y(null);
42
+ r(q), q === "connected" && v(null);
43
43
  },
44
44
  onAgentStateChange: o,
45
45
  onTranscript: (q) => s([...q]),
@@ -47,13 +47,13 @@ function Wn(e) {
47
47
  onAudioTrack: (q) => c(q),
48
48
  onVideoTrack: (q) => _(q),
49
49
  onVideoTrackRemoved: () => _(null),
50
- onError: (q) => y(q),
50
+ onError: (q) => v(q),
51
51
  onDataMessage: (q) => {
52
52
  var N;
53
53
  (N = S.current) == null || N.call(S, q);
54
54
  },
55
- onResumabilityChange: L
56
- }, B = new Pn(
55
+ onResumabilityChange: k
56
+ }, B = new On(
57
57
  {
58
58
  agentId: e.agentId,
59
59
  baseUrl: e.baseUrl,
@@ -61,9 +61,9 @@ function Wn(e) {
61
61
  sessionEndpoint: e.sessionEndpoint,
62
62
  sessionBody: e.sessionBody
63
63
  },
64
- T
64
+ R
65
65
  );
66
- return m.current = B, r("idle"), o("idle"), s([]), d(null), _(null), c(null), L(!1), y(null), () => {
66
+ return m.current = B, r("idle"), o("idle"), s([]), d(null), _(null), c(null), k(!1), v(null), () => {
67
67
  var q;
68
68
  (q = B.destroy) == null || q.call(B), m.current = null;
69
69
  };
@@ -74,20 +74,20 @@ function Wn(e) {
74
74
  e.sessionEndpoint,
75
75
  JSON.stringify(e.sessionBody ?? {})
76
76
  ]);
77
- const D = E(async () => {
78
- const T = m.current;
79
- if (T)
77
+ const $ = E(async () => {
78
+ const R = m.current;
79
+ if (R)
80
80
  try {
81
- await T.connect();
81
+ await R.connect();
82
82
  } catch (B) {
83
- throw y(B instanceof Error ? B.message : String(B)), B;
83
+ throw v(B instanceof Error ? B.message : String(B)), B;
84
84
  }
85
- }, []), z = E(() => {
86
- const T = m.current;
87
- T && T.disconnect();
85
+ }, []), D = E(() => {
86
+ const R = m.current;
87
+ R && R.disconnect();
88
88
  }, []), x = E(() => {
89
- var T;
90
- return ((T = m.current) == null ? void 0 : T.getRoom()) ?? null;
89
+ var R;
90
+ return ((R = m.current) == null ? void 0 : R.getRoom()) ?? null;
91
91
  }, []);
92
92
  return {
93
93
  connectionState: t,
@@ -96,15 +96,15 @@ function Wn(e) {
96
96
  agentConfig: a,
97
97
  videoElement: f,
98
98
  audioElement: u,
99
- canResume: R,
99
+ canResume: I,
100
100
  error: b,
101
- connect: D,
102
- disconnect: z,
101
+ connect: $,
102
+ disconnect: D,
103
103
  getRoom: x,
104
104
  session: m.current
105
105
  };
106
106
  }
107
- function Bn() {
107
+ function Fn() {
108
108
  const e = A(null), t = A(null), r = A(null), i = A(null), o = A(/* @__PURE__ */ new Set()), l = A(null), s = E(() => {
109
109
  const u = t.current;
110
110
  if (!u) {
@@ -116,14 +116,14 @@ function Bn() {
116
116
  ));
117
117
  const c = l.current;
118
118
  u.getByteFrequencyData(c);
119
- let R = 0;
120
- for (let b = 0; b < c.length; b++) R += c[b];
121
- const L = R / c.length / 255;
119
+ let I = 0;
120
+ for (let b = 0; b < c.length; b++) I += c[b];
121
+ const k = I / c.length / 255;
122
122
  for (const b of o.current)
123
123
  try {
124
- b(L);
125
- } catch (y) {
126
- console.error("[useAudioLevel] subscriber threw:", y);
124
+ b(k);
125
+ } catch (v) {
126
+ console.error("[useAudioLevel] subscriber threw:", v);
127
127
  }
128
128
  i.current = requestAnimationFrame(s);
129
129
  }, []), a = E(() => {
@@ -162,7 +162,7 @@ function Bn() {
162
162
  }, []), _ = E((u) => (o.current.add(u), () => {
163
163
  o.current.delete(u);
164
164
  }), []);
165
- return I(() => () => {
165
+ return T(() => () => {
166
166
  if (f(), t.current) {
167
167
  try {
168
168
  t.current.disconnect();
@@ -180,9 +180,9 @@ function Bn() {
180
180
  o.current.clear(), l.current = null;
181
181
  }, [f]), { attach: d, detach: f, subscribe: _ };
182
182
  }
183
- function qn() {
184
- const [e, t] = C(!1), [r, i] = C(""), [o, l] = C(null), s = A(null), a = A(null), d = E(async (L) => {
185
- var b, y;
183
+ function Un() {
184
+ const [e, t] = C(!1), [r, i] = C(""), [o, l] = C(null), s = A(null), a = A(null), d = E(async (k) => {
185
+ var b, v;
186
186
  if (s.current && a.current) {
187
187
  try {
188
188
  await a.current.localParticipant.unpublishTrack(s.current);
@@ -190,55 +190,55 @@ function qn() {
190
190
  }
191
191
  s.current.stop(), s.current = null;
192
192
  }
193
- a.current = L, l(null);
193
+ a.current = k, l(null);
194
194
  try {
195
- const m = await $n({
195
+ const m = await Hn({
196
196
  echoCancellation: !0,
197
197
  noiseSuppression: !0
198
198
  });
199
- await L.localParticipant.publishTrack(m), s.current = m, t(m.isMuted);
200
- const S = (y = (b = m.mediaStreamTrack) == null ? void 0 : b.getSettings) == null ? void 0 : y.call(b);
199
+ await k.localParticipant.publishTrack(m), s.current = m, t(m.isMuted);
200
+ const S = (v = (b = m.mediaStreamTrack) == null ? void 0 : b.getSettings) == null ? void 0 : v.call(b);
201
201
  S != null && S.deviceId && i(S.deviceId);
202
202
  } catch (m) {
203
203
  const S = m instanceof Error && m.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
204
204
  throw l(S), m;
205
205
  }
206
- }, []), f = E((L) => {
207
- a.current = L;
208
- }, []), _ = E(async (L) => {
206
+ }, []), f = E((k) => {
207
+ a.current = k;
208
+ }, []), _ = E(async (k) => {
209
209
  const b = a.current;
210
210
  if (b)
211
211
  try {
212
- await b.switchActiveDevice("audioinput", L), i(L);
213
- } catch (y) {
214
- console.warn("[useMicrophoneState] switchDevice failed:", y);
212
+ await b.switchActiveDevice("audioinput", k), i(k);
213
+ } catch (v) {
214
+ console.warn("[useMicrophoneState] switchDevice failed:", v);
215
215
  }
216
216
  }, []), u = E(() => {
217
- const L = s.current, b = a.current;
218
- if (L) {
219
- L.isMuted ? (L.unmute(), t(!1)) : (L.mute(), t(!0));
217
+ const k = s.current, b = a.current;
218
+ if (k) {
219
+ k.isMuted ? (k.unmute(), t(!1)) : (k.mute(), t(!0));
220
220
  return;
221
221
  }
222
222
  if (b) {
223
- const y = !e;
224
- t(y);
223
+ const v = !e;
224
+ t(v);
225
225
  try {
226
- b.localParticipant.setMicrophoneEnabled(!y);
226
+ b.localParticipant.setMicrophoneEnabled(!v);
227
227
  } catch (m) {
228
228
  console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", m);
229
229
  }
230
230
  }
231
231
  }, [e]), c = E(() => {
232
- const L = s.current, b = a.current;
233
- if (L && b) {
232
+ const k = s.current, b = a.current;
233
+ if (k && b) {
234
234
  try {
235
- b.localParticipant.unpublishTrack(L);
235
+ b.localParticipant.unpublishTrack(k);
236
236
  } catch {
237
237
  }
238
- L.stop();
238
+ k.stop();
239
239
  }
240
240
  s.current = null, a.current = null, t(!1), i("");
241
- }, []), R = E(() => l(null), []);
241
+ }, []), I = E(() => l(null), []);
242
242
  return {
243
243
  isMuted: e,
244
244
  activeDeviceId: r,
@@ -248,25 +248,26 @@ function qn() {
248
248
  attachRoom: f,
249
249
  switchDevice: _,
250
250
  teardownMic: c,
251
- clearError: R
251
+ clearError: I
252
252
  };
253
253
  }
254
- const Fn = { resolution: { width: 640, height: 480, frameRate: 24 } };
255
- function Un() {
254
+ const jn = { resolution: { width: 640, height: 480, frameRate: 24 } };
255
+ function Vn() {
256
256
  const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), [s, a] = C(""), d = A(null), f = A(null), _ = E((m) => {
257
257
  d.current = m;
258
258
  }, []), u = E(() => {
259
+ var $;
259
260
  const m = d.current, S = f.current;
260
261
  if (S && m) {
261
- const D = m.localParticipant.getTrackPublication(dn.Source.Camera);
262
- if (D != null && D.track) {
263
- try {
264
- m.localParticipant.unpublishTrack(D.track);
265
- } catch {
266
- }
267
- D.track.stop();
268
- } else
269
- S.stop();
262
+ const D = m.localParticipant.getTrackPublication(fn.Source.Camera), R = (D == null ? void 0 : D.track) ?? S;
263
+ try {
264
+ m.localParticipant.unpublishTrack(R);
265
+ } catch {
266
+ }
267
+ try {
268
+ ($ = R.stop) == null || $.call(R);
269
+ } catch {
270
+ }
270
271
  }
271
272
  f.current = null, l(null), t(!1);
272
273
  }, []), c = E(async (m) => {
@@ -274,11 +275,11 @@ function Un() {
274
275
  if (S) {
275
276
  i(null);
276
277
  try {
277
- const D = { ...Fn };
278
- m && (D.deviceId = m);
279
- const z = await zn(D);
280
- await S.localParticipant.publishTrack(z), f.current = z;
281
- const x = z.attach();
278
+ const $ = { ...jn };
279
+ m && ($.deviceId = m);
280
+ const D = await Wn($);
281
+ await S.localParticipant.publishTrack(D), f.current = D;
282
+ const x = D.attach();
282
283
  l(x), t(!0), m && a(m);
283
284
  try {
284
285
  S.localParticipant.publishData(
@@ -287,33 +288,33 @@ function Un() {
287
288
  );
288
289
  } catch {
289
290
  }
290
- } catch (D) {
291
- const z = D instanceof Error && D.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
292
- i(z);
291
+ } catch ($) {
292
+ const D = $ instanceof Error && $.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
293
+ i(D);
293
294
  }
294
295
  }
295
- }, []), R = E(async () => {
296
+ }, []), I = E(async () => {
296
297
  e ? u() : await c(s || void 0);
297
- }, [e, s, u, c]), L = E(async (m) => {
298
+ }, [e, s, u, c]), k = E(async (m) => {
298
299
  u(), await c(m);
299
300
  }, [u, c]), b = E(() => {
300
301
  u(), d.current = null, i(null), a("");
301
- }, [u]), y = E(() => i(null), []);
302
- return I(() => () => {
302
+ }, [u]), v = E(() => i(null), []);
303
+ return T(() => () => {
303
304
  f.current && f.current.stop();
304
305
  }, []), {
305
306
  isEnabled: e,
306
307
  error: r,
307
308
  previewEl: o,
308
309
  activeDeviceId: s,
309
- toggle: R,
310
- switchDevice: L,
310
+ toggle: I,
311
+ switchDevice: k,
311
312
  attachRoom: _,
312
313
  teardown: b,
313
- clearError: y
314
+ clearError: v
314
315
  };
315
316
  }
316
- function jn() {
317
+ function Yn() {
317
318
  const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), s = A(null), a = E((c) => {
318
319
  s.current = c;
319
320
  }, []), d = E(() => l(null), []), f = E(async () => {
@@ -330,12 +331,12 @@ function jn() {
330
331
  i(null);
331
332
  try {
332
333
  await c.localParticipant.setScreenShareEnabled(!0);
333
- let R = 0;
334
- const L = () => {
335
- const b = c.localParticipant.getTrackPublication(dn.Source.ScreenShare);
334
+ let I = 0;
335
+ const k = () => {
336
+ const b = c.localParticipant.getTrackPublication(fn.Source.ScreenShare);
336
337
  if (b != null && b.track) {
337
- const y = b.track.attach();
338
- l(y), t(!0);
338
+ const v = b.track.attach();
339
+ l(v), t(!0);
339
340
  try {
340
341
  c.localParticipant.publishData(
341
342
  new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
@@ -345,12 +346,12 @@ function jn() {
345
346
  }
346
347
  return;
347
348
  }
348
- R++ < 10 ? setTimeout(L, 100) : t(!0);
349
+ I++ < 10 ? setTimeout(k, 100) : t(!0);
349
350
  };
350
- L();
351
- } catch (R) {
352
- const L = R instanceof Error ? R.name : "";
353
- L !== "NotAllowedError" && L !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
351
+ k();
352
+ } catch (I) {
353
+ const k = I instanceof Error ? I.name : "";
354
+ k !== "NotAllowedError" && k !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
354
355
  }
355
356
  }
356
357
  }, [e, d]), _ = E(() => {
@@ -364,7 +365,7 @@ function jn() {
364
365
  }, [e, d]), u = E(() => i(null), []);
365
366
  return { isEnabled: e, error: r, previewEl: o, toggle: f, attachRoom: a, teardown: _, clearError: u };
366
367
  }
367
- function Vn() {
368
+ function Gn() {
368
369
  const [e, t] = C([]), [r, i] = C([]), o = E(async () => {
369
370
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
370
371
  try {
@@ -373,15 +374,15 @@ function Vn() {
373
374
  } catch {
374
375
  }
375
376
  }, []);
376
- return I(() => {
377
+ return T(() => {
377
378
  if (o(), typeof navigator > "u" || !navigator.mediaDevices) return;
378
379
  const l = () => void o();
379
380
  return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
380
381
  }, [o]), { mics: e, cameras: r, refresh: o };
381
382
  }
382
- function Yn(e, t, r = !1) {
383
+ function Jn(e, t, r = !1) {
383
384
  const [i, o] = C(null), [l, s] = C(null), [a, d] = C(!r && !!e);
384
- return I(() => {
385
+ return T(() => {
385
386
  if (r || !e) {
386
387
  d(!1);
387
388
  return;
@@ -402,7 +403,7 @@ function Yn(e, t, r = !1) {
402
403
  }), () => f.abort();
403
404
  }, [e, t, r]), { info: i, error: l, loading: a };
404
405
  }
405
- function Gn(e) {
406
+ function Kn(e) {
406
407
  if (typeof window > "u") return null;
407
408
  try {
408
409
  return window.localStorage.getItem(e);
@@ -410,14 +411,14 @@ function Gn(e) {
410
411
  return null;
411
412
  }
412
413
  }
413
- function Jn(e, t) {
414
+ function Xn(e, t) {
414
415
  if (!(typeof window > "u"))
415
416
  try {
416
417
  window.localStorage.setItem(e, t);
417
418
  } catch {
418
419
  }
419
420
  }
420
- function Kn({
421
+ function Qn({
421
422
  value: e,
422
423
  defaultValue: t = "expanded",
423
424
  onChange: r
@@ -430,34 +431,34 @@ function Kn({
430
431
  );
431
432
  return [s, a];
432
433
  }
433
- const Xn = ["hidden", "minimized", "expanded"];
434
- function Qn(e) {
435
- return e && Xn.includes(e) ? e : null;
434
+ const Zn = ["hidden", "minimized", "expanded"];
435
+ function er(e) {
436
+ return e && Zn.includes(e) ? e : null;
436
437
  }
437
- function Zn({
438
+ function tr({
438
439
  value: e,
439
440
  defaultValue: t = "expanded",
440
441
  onChange: r,
441
442
  persistKey: i = "ll-widget",
442
443
  disablePersistence: o = !1
443
444
  } = {}) {
444
- const l = `${i}:display-mode`, s = A(!1), [a, d] = Kn({
445
+ const l = `${i}:display-mode`, s = A(!1), [a, d] = Qn({
445
446
  value: e,
446
447
  defaultValue: t,
447
448
  onChange: (f) => {
448
- e === void 0 && !o && Jn(l, f), r == null || r(f);
449
+ e === void 0 && !o && Xn(l, f), r == null || r(f);
449
450
  }
450
451
  });
451
- return I(() => {
452
+ return T(() => {
452
453
  if (s.current || (s.current = !0, o || e !== void 0)) return;
453
- const f = Qn(Gn(l));
454
+ const f = er(Kn(l));
454
455
  f && f !== a && d(f);
455
456
  }, []), [a, d];
456
457
  }
457
- const er = 640;
458
- function tr(e = er) {
458
+ const nr = 640;
459
+ function rr(e = nr) {
459
460
  const [t, r] = C(!1);
460
- return I(() => {
461
+ return T(() => {
461
462
  if (e === !1) {
462
463
  r(!1);
463
464
  return;
@@ -470,9 +471,9 @@ function tr(e = er) {
470
471
  });
471
472
  }, [e]), t;
472
473
  }
473
- const jt = "__llHistoryPatched", gt = "ll:pathname";
474
- function nr() {
475
- if (typeof window > "u" || window.history[jt]) return;
474
+ const Vt = "__llHistoryPatched", gt = "ll:pathname";
475
+ function ir() {
476
+ if (typeof window > "u" || window.history[Vt]) return;
476
477
  const e = window.history.pushState, t = window.history.replaceState;
477
478
  window.history.pushState = function(...r) {
478
479
  const i = e.apply(this, r);
@@ -480,65 +481,65 @@ function nr() {
480
481
  }, window.history.replaceState = function(...r) {
481
482
  const i = t.apply(this, r);
482
483
  return window.dispatchEvent(new Event(gt)), i;
483
- }, window.history[jt] = !0;
484
+ }, window.history[Vt] = !0;
484
485
  }
485
- function Vt() {
486
+ function Yt() {
486
487
  return typeof window > "u" ? "/" : window.location.pathname || "/";
487
488
  }
488
- function rr(e) {
489
+ function or(e) {
489
490
  const [t, r] = C(
490
- () => e ?? Vt()
491
+ () => e ?? Yt()
491
492
  );
492
- return I(() => {
493
+ return T(() => {
493
494
  if (e !== void 0) return;
494
- nr();
495
- const i = () => r(Vt());
495
+ ir();
496
+ const i = () => r(Yt());
496
497
  return i(), window.addEventListener("popstate", i), window.addEventListener(gt, i), () => {
497
498
  window.removeEventListener("popstate", i), window.removeEventListener(gt, i);
498
499
  };
499
500
  }, [e]), e ?? t;
500
501
  }
501
- const Yt = /* @__PURE__ */ new Map(), ir = /[\\^$+?.()|{}[\]]/g;
502
- function or(e) {
503
- return e.replace(ir, "\\$&");
502
+ const Gt = /* @__PURE__ */ new Map(), lr = /[\\^$+?.()|{}[\]]/g;
503
+ function ar(e) {
504
+ return e.replace(lr, "\\$&");
504
505
  }
505
- function lr(e) {
506
- const t = Yt.get(e);
506
+ function cr(e) {
507
+ const t = Gt.get(e);
507
508
  if (t) return t;
508
- const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), a = or(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), d = new RegExp(`^${a}\\/?$`);
509
- return Yt.set(e, d), d;
509
+ const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), a = ar(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), d = new RegExp(`^${a}\\/?$`);
510
+ return Gt.set(e, d), d;
510
511
  }
511
- function ar(e, t) {
512
+ function sr(e, t) {
512
513
  const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
513
- return lr(e).test(r);
514
+ return cr(e).test(r);
514
515
  }
515
- function cr(e, t) {
516
- return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : ar(e, t);
516
+ function dr(e, t) {
517
+ return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : sr(e, t);
517
518
  }
518
- function Gt(e, t) {
519
+ function Jt(e, t) {
519
520
  if (!e || e.length === 0) return !1;
520
521
  for (const r of e)
521
- if (cr(r, t)) return !0;
522
+ if (dr(r, t)) return !0;
522
523
  return !1;
523
524
  }
524
- function sr(e, t, r) {
525
- return e === void 0 ? !0 : Gt(r, e) ? !1 : t && t.length > 0 ? Gt(t, e) : !0;
525
+ function ur(e, t, r) {
526
+ return e === void 0 ? !0 : Jt(r, e) ? !1 : t && t.length > 0 ? Jt(t, e) : !0;
526
527
  }
527
- function dr(e, t, r) {
528
- return Ue(
529
- () => sr(e, t, r),
528
+ function fr(e, t, r) {
529
+ return je(
530
+ () => ur(e, t, r),
530
531
  [e, t, r]
531
532
  );
532
533
  }
533
- function ur(e) {
534
+ function pr(e) {
534
535
  return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
535
536
  navigate: e.navigate !== !1,
536
537
  thinking: e.thinking !== !1,
537
538
  action: e.action !== !1
538
539
  };
539
540
  }
540
- function fr(e) {
541
- const t = Ue(() => ur(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = A(null), o = E(
541
+ function hr(e) {
542
+ const t = je(() => pr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = A(null), o = E(
542
543
  (d) => {
543
544
  try {
544
545
  new Audio(`${r}${d}`).play().catch(() => {
@@ -582,7 +583,7 @@ function fr(e) {
582
583
  },
583
584
  [r, t.thinking]
584
585
  );
585
- return I(() => () => {
586
+ return T(() => () => {
586
587
  if (i.current) {
587
588
  try {
588
589
  i.current.pause();
@@ -590,12 +591,12 @@ function fr(e) {
590
591
  }
591
592
  i.current = null;
592
593
  }
593
- }, []), Ue(
594
+ }, []), je(
594
595
  () => ({ playPageChange: l, playConfirmation: s, setThinking: a }),
595
596
  [l, s, a]
596
597
  );
597
598
  }
598
- const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ v(
599
+ const Kt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ y(
599
600
  "svg",
600
601
  {
601
602
  className: t,
@@ -641,7 +642,7 @@ const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ v(
641
642
  }
642
643
  )
643
644
  }
644
- ), Kt = ({ className: e }) => /* @__PURE__ */ n(
645
+ ), Xt = ({ className: e }) => /* @__PURE__ */ n(
645
646
  "svg",
646
647
  {
647
648
  className: e,
@@ -659,7 +660,7 @@ const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ v(
659
660
  }
660
661
  )
661
662
  }
662
- ), pr = ({ className: e }) => /* @__PURE__ */ n(
663
+ ), mr = ({ className: e }) => /* @__PURE__ */ n(
663
664
  "svg",
664
665
  {
665
666
  className: e,
@@ -670,12 +671,12 @@ const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ v(
670
671
  "aria-hidden": "true",
671
672
  children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
672
673
  }
673
- ), hr = {
674
+ ), gr = {
674
675
  left: 180,
675
676
  right: 0,
676
677
  up: -90,
677
678
  down: 90
678
- }, Xt = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
679
+ }, Qt = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
679
680
  "svg",
680
681
  {
681
682
  className: t,
@@ -683,19 +684,19 @@ const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ v(
683
684
  viewBox: "0 0 24 24",
684
685
  stroke: "currentColor",
685
686
  strokeWidth: 2,
686
- style: { transform: `rotate(${hr[e]}deg)` },
687
+ style: { transform: `rotate(${gr[e]}deg)` },
687
688
  "aria-hidden": "true",
688
689
  children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
689
690
  }
690
691
  );
691
- function mr(e) {
692
+ function yr(e) {
692
693
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
693
694
  }
694
- const un = "ll-hidden-tab-center-y", gr = 5, Qt = 16;
695
- function yr() {
695
+ const pn = "ll-hidden-tab-center-y", vr = 5, Zt = 16;
696
+ function br() {
696
697
  if (typeof window > "u") return null;
697
698
  try {
698
- const e = window.localStorage.getItem(un);
699
+ const e = window.localStorage.getItem(pn);
699
700
  if (!e) return null;
700
701
  const t = Number.parseFloat(e);
701
702
  return Number.isFinite(t) ? t : null;
@@ -703,14 +704,14 @@ function yr() {
703
704
  return null;
704
705
  }
705
706
  }
706
- function Zt(e) {
707
+ function en(e) {
707
708
  if (!(typeof window > "u"))
708
709
  try {
709
- window.localStorage.setItem(un, String(e));
710
+ window.localStorage.setItem(pn, String(e));
710
711
  } catch {
711
712
  }
712
713
  }
713
- const vr = ({
714
+ const wr = ({
714
715
  position: e,
715
716
  isMobile: t,
716
717
  isSpeaking: r,
@@ -719,16 +720,16 @@ const vr = ({
719
720
  avatarImageUrl: l,
720
721
  agentName: s
721
722
  }) => {
722
- const a = mr(e), d = a === "right" ? "left" : "right", f = t ? 80 : 72, _ = !!l, [u, c] = C(null), [R, L] = C(!1), b = A(null), y = A(!1), m = E(
723
+ const a = yr(e), d = a === "right" ? "left" : "right", f = t ? 80 : 72, _ = !!l, [u, c] = C(null), [I, k] = C(!1), b = A(null), v = A(!1), m = E(
723
724
  (N) => {
724
725
  if (typeof window > "u") return N;
725
- const M = f / 2, F = Qt + M, re = window.innerHeight - Qt - M;
726
- return re < F ? Math.max(F, N) : Math.max(F, Math.min(re, N));
726
+ const M = f / 2, F = Zt + M, ie = window.innerHeight - Zt - M;
727
+ return ie < F ? Math.max(F, N) : Math.max(F, Math.min(ie, N));
727
728
  },
728
729
  [f]
729
730
  );
730
- I(() => {
731
- const N = yr();
731
+ T(() => {
732
+ const N = br();
732
733
  c(m(N ?? window.innerHeight / 2));
733
734
  const M = () => {
734
735
  c((F) => F === null ? null : m(F));
@@ -750,15 +751,15 @@ const vr = ({
750
751
  }
751
752
  },
752
753
  [u]
753
- ), D = E(
754
+ ), $ = E(
754
755
  (N) => {
755
756
  const M = b.current;
756
757
  if (!M) return;
757
758
  const F = N.clientY - M.startClientY;
758
- !M.moved && Math.abs(F) > gr && (M.moved = !0, L(!0)), M.moved && c(m(M.startCenterY + F));
759
+ !M.moved && Math.abs(F) > vr && (M.moved = !0, k(!0)), M.moved && c(m(M.startCenterY + F));
759
760
  },
760
761
  [m]
761
- ), z = E(
762
+ ), D = E(
762
763
  (N) => {
763
764
  const M = b.current;
764
765
  if (M) {
@@ -766,25 +767,25 @@ const vr = ({
766
767
  N.currentTarget.releasePointerCapture(N.pointerId);
767
768
  } catch {
768
769
  }
769
- b.current = null, M.moved && (L(!1), y.current = !0, c((F) => (F !== null && Zt(F), F)));
770
+ b.current = null, M.moved && (k(!1), v.current = !0, c((F) => (F !== null && en(F), F)));
770
771
  }
771
772
  },
772
773
  []
773
774
  ), x = E(() => {
774
- if (y.current) {
775
- y.current = !1;
775
+ if (v.current) {
776
+ v.current = !1;
776
777
  return;
777
778
  }
778
779
  i();
779
- }, [i]), T = E(
780
+ }, [i]), R = E(
780
781
  (N) => {
781
782
  if (N.key === "ArrowUp" || N.key === "ArrowDown") {
782
783
  N.preventDefault();
783
784
  const M = N.key === "ArrowUp" ? -8 : 8;
784
785
  c((F) => {
785
786
  if (F === null) return F;
786
- const re = m(F + M);
787
- return Zt(re), re;
787
+ const ie = m(F + M);
788
+ return en(ie), ie;
788
789
  });
789
790
  }
790
791
  },
@@ -794,7 +795,7 @@ const vr = ({
794
795
  `ll-hidden--${a}`,
795
796
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
796
797
  r ? "ll-hidden--speaking" : null,
797
- R ? "is-dragging" : null,
798
+ I ? "is-dragging" : null,
798
799
  _ ? "ll-hidden--with-avatar" : null
799
800
  ].filter(Boolean).join(" "), q = u === null ? void 0 : { top: `${u - f / 2}px`, transform: "none" };
800
801
  return /* @__PURE__ */ n(
@@ -803,11 +804,11 @@ const vr = ({
803
804
  type: "button",
804
805
  className: B,
805
806
  onPointerDown: S,
806
- onPointerMove: D,
807
- onPointerUp: z,
808
- onPointerCancel: z,
807
+ onPointerMove: $,
808
+ onPointerUp: D,
809
+ onPointerCancel: D,
809
810
  onClick: x,
810
- onKeyDown: T,
811
+ onKeyDown: R,
811
812
  "aria-label": o,
812
813
  "data-position": e,
813
814
  style: q,
@@ -816,9 +817,9 @@ const vr = ({
816
817
  // as the click affordance), then the circular avatar photo
817
818
  // taking the rest of the tab. Reinforces "this is an
818
819
  // avatar-based experience" even when collapsed.
819
- /* @__PURE__ */ v(ot, { children: [
820
+ /* @__PURE__ */ y(Ue, { children: [
820
821
  /* @__PURE__ */ n(
821
- Xt,
822
+ Qt,
822
823
  {
823
824
  direction: d,
824
825
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
@@ -835,7 +836,7 @@ const vr = ({
835
836
  )
836
837
  ] })
837
838
  ) : /* @__PURE__ */ n(
838
- Xt,
839
+ Qt,
839
840
  {
840
841
  direction: d,
841
842
  className: "ll-hidden__chevron"
@@ -843,7 +844,7 @@ const vr = ({
843
844
  )
844
845
  }
845
846
  );
846
- }, br = ({
847
+ }, _r = ({
847
848
  audioLevel: e,
848
849
  bars: t = 20,
849
850
  maxHeight: r = 20,
@@ -851,16 +852,16 @@ const vr = ({
851
852
  className: o,
852
853
  barClassName: l
853
854
  }) => {
854
- const s = A(null), a = A([]), d = Ue(() => {
855
+ const s = A(null), a = A([]), d = je(() => {
855
856
  const _ = (Math.sqrt(5) - 1) / 2;
856
857
  return Array.from({ length: t }, (u, c) => 0.5 + c * _ % 1 * 0.5);
857
858
  }, [t]);
858
- I(() => e.subscribe((u) => {
859
+ T(() => e.subscribe((u) => {
859
860
  for (let c = 0; c < t; c++) {
860
- const R = a.current[c];
861
- if (!R) continue;
862
- const L = Math.max(i, u * r * d[c]);
863
- R.style.height = `${L}px`;
861
+ const I = a.current[c];
862
+ if (!I) continue;
863
+ const k = Math.max(i, u * r * d[c]);
864
+ I.style.height = `${k}px`;
864
865
  }
865
866
  }), [e, t, r, i, d]);
866
867
  const f = ["ll-waveform", o].filter(Boolean).join(" ");
@@ -875,7 +876,7 @@ const vr = ({
875
876
  },
876
877
  u
877
878
  )) });
878
- }, wr = ({
879
+ }, xr = ({
879
880
  position: e,
880
881
  isMobile: t,
881
882
  agentName: r,
@@ -892,7 +893,7 @@ const vr = ({
892
893
  className: "ll-minimized ll-minimized--mobile",
893
894
  role: "region",
894
895
  "aria-label": `${r} widget`,
895
- children: /* @__PURE__ */ v(
896
+ children: /* @__PURE__ */ y(
896
897
  "button",
897
898
  {
898
899
  type: "button",
@@ -912,7 +913,7 @@ const vr = ({
912
913
  )
913
914
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
914
915
  /* @__PURE__ */ n(
915
- br,
916
+ _r,
916
917
  {
917
918
  audioLevel: s,
918
919
  bars: 16,
@@ -921,7 +922,7 @@ const vr = ({
921
922
  }
922
923
  ),
923
924
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
924
- /* @__PURE__ */ v("div", { className: "ll-minimized__controls", children: [
925
+ /* @__PURE__ */ y("div", { className: "ll-minimized__controls", children: [
925
926
  /* @__PURE__ */ n(
926
927
  "span",
927
928
  {
@@ -935,10 +936,10 @@ const vr = ({
935
936
  (_.key === "Enter" || _.key === " ") && (_.stopPropagation(), _.preventDefault(), d());
936
937
  },
937
938
  "aria-label": l ? "Unmute microphone" : "Mute microphone",
938
- children: /* @__PURE__ */ n(Jt, { muted: l, className: "ll-minimized__icon" })
939
+ children: /* @__PURE__ */ n(Kt, { muted: l, className: "ll-minimized__icon" })
939
940
  }
940
941
  ),
941
- /* @__PURE__ */ n(Kt, { className: "ll-minimized__icon ll-minimized__icon--expand" })
942
+ /* @__PURE__ */ n(Xt, { className: "ll-minimized__icon ll-minimized__icon--expand" })
942
943
  ] })
943
944
  ]
944
945
  }
@@ -951,7 +952,7 @@ const vr = ({
951
952
  "data-position": e,
952
953
  role: "region",
953
954
  "aria-label": `${r} widget`,
954
- children: /* @__PURE__ */ v("div", { className: "ll-minimized__surface", children: [
955
+ children: /* @__PURE__ */ y("div", { className: "ll-minimized__surface", children: [
955
956
  i ? (
956
957
  // eslint-disable-next-line @next/next/no-img-element
957
958
  /* @__PURE__ */ n(
@@ -963,11 +964,11 @@ const vr = ({
963
964
  }
964
965
  )
965
966
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
966
- /* @__PURE__ */ v("div", { className: "ll-minimized__meta", children: [
967
+ /* @__PURE__ */ y("div", { className: "ll-minimized__meta", children: [
967
968
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
968
969
  /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: o === "speaking" ? "Speaking" : o === "thinking" ? "Thinking" : "Listening" })
969
970
  ] }),
970
- /* @__PURE__ */ v("div", { className: "ll-minimized__controls", children: [
971
+ /* @__PURE__ */ y("div", { className: "ll-minimized__controls", children: [
971
972
  /* @__PURE__ */ n(
972
973
  "button",
973
974
  {
@@ -975,7 +976,7 @@ const vr = ({
975
976
  className: "ll-minimized__btn",
976
977
  onClick: d,
977
978
  "aria-label": l ? "Unmute microphone" : "Mute microphone",
978
- children: /* @__PURE__ */ n(Jt, { muted: l, className: "ll-minimized__icon" })
979
+ children: /* @__PURE__ */ n(Kt, { muted: l, className: "ll-minimized__icon" })
979
980
  }
980
981
  ),
981
982
  /* @__PURE__ */ n(
@@ -985,7 +986,7 @@ const vr = ({
985
986
  className: "ll-minimized__btn",
986
987
  onClick: a,
987
988
  "aria-label": `Expand ${r} widget`,
988
- children: /* @__PURE__ */ n(Kt, { className: "ll-minimized__icon" })
989
+ children: /* @__PURE__ */ n(Xt, { className: "ll-minimized__icon" })
989
990
  }
990
991
  ),
991
992
  /* @__PURE__ */ n(
@@ -995,13 +996,13 @@ const vr = ({
995
996
  className: "ll-minimized__btn ll-minimized__btn--close",
996
997
  onClick: f,
997
998
  "aria-label": "Close widget",
998
- children: /* @__PURE__ */ n(pr, { className: "ll-minimized__icon" })
999
+ children: /* @__PURE__ */ n(mr, { className: "ll-minimized__icon" })
999
1000
  }
1000
1001
  )
1001
1002
  ] })
1002
1003
  ] })
1003
1004
  }
1004
- ), _r = ({
1005
+ ), kr = ({
1005
1006
  src: e,
1006
1007
  alt: t,
1007
1008
  preCannedPlaying: r = !1,
@@ -1009,7 +1010,7 @@ const vr = ({
1009
1010
  style: o
1010
1011
  }) => {
1011
1012
  const [l, s] = C(!1), a = A(e);
1012
- if (I(() => {
1013
+ if (T(() => {
1013
1014
  a.current !== e && (a.current = e, s(!1));
1014
1015
  }, [e]), !e) return null;
1015
1016
  const d = {
@@ -1039,14 +1040,14 @@ const vr = ({
1039
1040
  }
1040
1041
  )
1041
1042
  );
1042
- }, xr = 8, en = 8, kr = ({
1043
+ }, Lr = 8, tn = 8, Er = ({
1043
1044
  open: e,
1044
1045
  onClose: t,
1045
1046
  anchorRef: r,
1046
1047
  children: i
1047
1048
  }) => {
1048
1049
  const o = A(null), [l, s] = C(null);
1049
- return Mn(() => {
1050
+ return Pn(() => {
1050
1051
  if (!e) {
1051
1052
  s(null);
1052
1053
  return;
@@ -1055,15 +1056,15 @@ const vr = ({
1055
1056
  if (!a) return;
1056
1057
  const d = () => {
1057
1058
  const f = a.getBoundingClientRect(), _ = {
1058
- top: f.top - xr,
1059
+ top: f.top - Lr,
1059
1060
  left: f.left + f.width / 2
1060
- }, u = en + 90, c = window.innerWidth - en - 90;
1061
+ }, u = tn + 90, c = window.innerWidth - tn - 90;
1061
1062
  _.left < u && (_.left = u), _.left > c && (_.left = c), s(_);
1062
1063
  };
1063
1064
  return d(), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
1064
1065
  window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
1065
1066
  };
1066
- }, [e, r]), I(() => {
1067
+ }, [e, r]), T(() => {
1067
1068
  if (!e) return;
1068
1069
  const a = (f) => {
1069
1070
  const _ = f.target, u = o.current, c = r.current;
@@ -1074,7 +1075,7 @@ const vr = ({
1074
1075
  return document.addEventListener("mousedown", a), document.addEventListener("keydown", d), () => {
1075
1076
  document.removeEventListener("mousedown", a), document.removeEventListener("keydown", d);
1076
1077
  };
1077
- }, [e, t, r]), !e || l === null || typeof document > "u" ? null : On(
1078
+ }, [e, t, r]), !e || l === null || typeof document > "u" ? null : un(
1078
1079
  /* @__PURE__ */ n(
1079
1080
  "div",
1080
1081
  {
@@ -1094,7 +1095,7 @@ const vr = ({
1094
1095
  ),
1095
1096
  document.body
1096
1097
  );
1097
- }, Lr = ({
1098
+ }, Cr = ({
1098
1099
  isMuted: e,
1099
1100
  onToggleMute: t,
1100
1101
  isCameraEnabled: r,
@@ -1108,11 +1109,11 @@ const vr = ({
1108
1109
  allowTyping: _,
1109
1110
  isTypingOpen: u,
1110
1111
  onToggleTyping: c,
1111
- onDisconnect: R
1112
+ onDisconnect: I
1112
1113
  }) => {
1113
- const [L, b] = C(!1), y = A(null);
1114
- return /* @__PURE__ */ v(ot, { children: [
1115
- /* @__PURE__ */ v(
1114
+ const [k, b] = C(!1), v = A(null);
1115
+ return /* @__PURE__ */ y(Ue, { children: [
1116
+ /* @__PURE__ */ y(
1116
1117
  "div",
1117
1118
  {
1118
1119
  className: "ll-toolbar ll-toolbar--compact",
@@ -1126,20 +1127,20 @@ const vr = ({
1126
1127
  className: `ll-tool ${e ? "is-muted" : ""}`,
1127
1128
  onClick: t,
1128
1129
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1129
- children: /* @__PURE__ */ n(hn, { muted: e })
1130
+ children: /* @__PURE__ */ n(gn, { muted: e })
1130
1131
  }
1131
1132
  ),
1132
1133
  /* @__PURE__ */ n(
1133
1134
  "button",
1134
1135
  {
1135
- ref: y,
1136
+ ref: v,
1136
1137
  type: "button",
1137
- className: `ll-tool ${L ? "is-on" : ""}`,
1138
+ className: `ll-tool ${k ? "is-on" : ""}`,
1138
1139
  onClick: () => b((m) => !m),
1139
1140
  "aria-label": "More controls",
1140
1141
  "aria-haspopup": "menu",
1141
- "aria-expanded": L,
1142
- children: /* @__PURE__ */ n(Er, {})
1142
+ "aria-expanded": k,
1143
+ children: /* @__PURE__ */ n(Sr, {})
1143
1144
  }
1144
1145
  ),
1145
1146
  /* @__PURE__ */ n(
@@ -1147,22 +1148,22 @@ const vr = ({
1147
1148
  {
1148
1149
  type: "button",
1149
1150
  className: "ll-tool ll-tool--danger",
1150
- onClick: R,
1151
+ onClick: I,
1151
1152
  "aria-label": "End conversation",
1152
- children: /* @__PURE__ */ n(gn, {})
1153
+ children: /* @__PURE__ */ n(vn, {})
1153
1154
  }
1154
1155
  )
1155
1156
  ]
1156
1157
  }
1157
1158
  ),
1158
- /* @__PURE__ */ v(
1159
- kr,
1159
+ /* @__PURE__ */ y(
1160
+ Er,
1160
1161
  {
1161
- open: L,
1162
+ open: k,
1162
1163
  onClose: () => b(!1),
1163
- anchorRef: y,
1164
+ anchorRef: v,
1164
1165
  children: [
1165
- o && /* @__PURE__ */ v(
1166
+ o && /* @__PURE__ */ y(
1166
1167
  "button",
1167
1168
  {
1168
1169
  type: "button",
@@ -1171,12 +1172,12 @@ const vr = ({
1171
1172
  i(), b(!1);
1172
1173
  },
1173
1174
  children: [
1174
- /* @__PURE__ */ n(pn, {}),
1175
+ /* @__PURE__ */ n(mn, {}),
1175
1176
  /* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
1176
1177
  ]
1177
1178
  }
1178
1179
  ),
1179
- a && /* @__PURE__ */ v(
1180
+ a && /* @__PURE__ */ y(
1180
1181
  "button",
1181
1182
  {
1182
1183
  type: "button",
@@ -1185,12 +1186,12 @@ const vr = ({
1185
1186
  s(), b(!1);
1186
1187
  },
1187
1188
  children: [
1188
- /* @__PURE__ */ n(fn, {}),
1189
+ /* @__PURE__ */ n(hn, {}),
1189
1190
  /* @__PURE__ */ n("span", { children: l ? "Stop sharing" : "Share screen" })
1190
1191
  ]
1191
1192
  }
1192
1193
  ),
1193
- /* @__PURE__ */ v(
1194
+ /* @__PURE__ */ y(
1194
1195
  "button",
1195
1196
  {
1196
1197
  type: "button",
@@ -1199,12 +1200,12 @@ const vr = ({
1199
1200
  f(), b(!1);
1200
1201
  },
1201
1202
  children: [
1202
- /* @__PURE__ */ n(mn, { muted: d }),
1203
+ /* @__PURE__ */ n(yn, { muted: d }),
1203
1204
  /* @__PURE__ */ n("span", { children: d ? "Unmute speaker" : "Mute speaker" })
1204
1205
  ]
1205
1206
  }
1206
1207
  ),
1207
- _ && /* @__PURE__ */ v(
1208
+ _ && /* @__PURE__ */ y(
1208
1209
  "button",
1209
1210
  {
1210
1211
  type: "button",
@@ -1213,12 +1214,12 @@ const vr = ({
1213
1214
  c(), b(!1);
1214
1215
  },
1215
1216
  children: [
1216
- /* @__PURE__ */ n(Cr, {}),
1217
+ /* @__PURE__ */ n(Nr, {}),
1217
1218
  /* @__PURE__ */ n("span", { children: u ? "Hide typing" : "Type a message" })
1218
1219
  ]
1219
1220
  }
1220
1221
  ),
1221
- /* @__PURE__ */ v(
1222
+ /* @__PURE__ */ y(
1222
1223
  "button",
1223
1224
  {
1224
1225
  type: "button",
@@ -1236,8 +1237,8 @@ const vr = ({
1236
1237
  )
1237
1238
  ] });
1238
1239
  };
1239
- function Er() {
1240
- return /* @__PURE__ */ v(
1240
+ function Sr() {
1241
+ return /* @__PURE__ */ y(
1241
1242
  "svg",
1242
1243
  {
1243
1244
  width: "16",
@@ -1253,7 +1254,7 @@ function Er() {
1253
1254
  }
1254
1255
  );
1255
1256
  }
1256
- function Cr() {
1257
+ function Nr() {
1257
1258
  return /* @__PURE__ */ n(
1258
1259
  "svg",
1259
1260
  {
@@ -1270,7 +1271,7 @@ function Cr() {
1270
1271
  }
1271
1272
  );
1272
1273
  }
1273
- const Sr = ({
1274
+ const Ar = ({
1274
1275
  position: e,
1275
1276
  isMobile: t,
1276
1277
  agentName: r,
@@ -1284,135 +1285,135 @@ const Sr = ({
1284
1285
  teamSwitcherOpen: _,
1285
1286
  onToggleTeamSwitcher: u,
1286
1287
  onSelectTeamMember: c,
1287
- languageMenuOpen: R,
1288
- onToggleLanguageMenu: L,
1288
+ languageMenuOpen: I,
1289
+ onToggleLanguageMenu: k,
1289
1290
  connectionState: b,
1290
- agentState: y,
1291
+ agentState: v,
1291
1292
  transcript: m,
1292
1293
  canResume: S,
1293
- needsUserGesture: D,
1294
- error: z,
1294
+ needsUserGesture: $,
1295
+ error: D,
1295
1296
  isMuted: x,
1296
- micError: T,
1297
+ micError: R,
1297
1298
  micDevices: B,
1298
1299
  activeMicId: q,
1299
1300
  isCameraEnabled: N,
1300
1301
  cameraPreviewEl: M,
1301
1302
  cameraDevices: F,
1302
- activeCameraId: re,
1303
- isScreenShareEnabled: ie,
1303
+ activeCameraId: ie,
1304
+ isScreenShareEnabled: oe,
1304
1305
  screenPreviewEl: Z,
1305
- isSpeakerMuted: ae,
1306
- allowCamera: fe,
1307
- allowScreenShare: ve,
1308
- allowTyping: pe,
1309
- showMinimize: be = !0,
1310
- chromeless: he = !1,
1306
+ isSpeakerMuted: ce,
1307
+ allowCamera: he,
1308
+ allowScreenShare: be,
1309
+ allowTyping: me,
1310
+ showMinimize: we = !0,
1311
+ chromeless: ge = !1,
1311
1312
  compactControls: ee = !1,
1312
- transforming: at,
1313
- transformingLabel: je,
1314
- avatarVideoContainerRef: ct,
1315
- agentVideoEl: oe,
1316
- onConnect: Ve,
1317
- onDisconnect: Ye,
1318
- onRetry: Ge,
1313
+ transforming: lt,
1314
+ transformingLabel: Ve,
1315
+ avatarVideoContainerRef: at,
1316
+ agentVideoEl: le,
1317
+ onConnect: Ye,
1318
+ onDisconnect: Ge,
1319
+ onRetry: Je,
1319
1320
  onResumeAudio: De,
1320
1321
  onToggleMute: Ae,
1321
1322
  onSwitchMicDevice: Pe,
1322
1323
  onToggleCamera: Re,
1323
1324
  onSwitchCameraDevice: $e,
1324
1325
  onToggleScreenShare: Ie,
1325
- onToggleSpeaker: Me,
1326
- onSendMessage: $,
1327
- onMinimize: st,
1328
- onClose: dt,
1326
+ onToggleSpeaker: Te,
1327
+ onSendMessage: z,
1328
+ onMinimize: ct,
1329
+ onClose: st,
1329
1330
  onClearMicError: vt
1330
1331
  }) => {
1331
- var Te;
1332
- const we = ((a == null ? void 0 : a.length) ?? 0) > 1, _e = b === "connecting" || b === "connected", te = b === "connected", bt = b === "idle" || b === "disconnected" || b === "error", [Je, ce] = C(!1);
1333
- I(() => {
1334
- if (!oe) {
1335
- ce(!1);
1332
+ var Me;
1333
+ const _e = ((a == null ? void 0 : a.length) ?? 0) > 1, xe = b === "connecting" || b === "connected", te = b === "connected", bt = b === "idle" || b === "disconnected" || b === "error", [Ke, se] = C(!1);
1334
+ T(() => {
1335
+ if (!le) {
1336
+ se(!1);
1336
1337
  return;
1337
1338
  }
1338
- if (!oe.paused && oe.readyState >= 2) {
1339
- ce(!0);
1339
+ if (!le.paused && le.readyState >= 2) {
1340
+ se(!0);
1340
1341
  return;
1341
1342
  }
1342
- ce(!1);
1343
- const h = () => ce(!0);
1344
- return oe.addEventListener("playing", h), oe.addEventListener("loadeddata", h), () => {
1345
- oe.removeEventListener("playing", h), oe.removeEventListener("loadeddata", h);
1343
+ se(!1);
1344
+ const h = () => se(!0);
1345
+ return le.addEventListener("playing", h), le.addEventListener("loadeddata", h), () => {
1346
+ le.removeEventListener("playing", h), le.removeEventListener("loadeddata", h);
1346
1347
  };
1347
- }, [oe]);
1348
- const [X, Ke] = C(!1);
1349
- I(() => {
1348
+ }, [le]);
1349
+ const [X, Xe] = C(!1);
1350
+ T(() => {
1350
1351
  if (!te) {
1351
- Ke(!1);
1352
+ Xe(!1);
1352
1353
  return;
1353
1354
  }
1354
- if (Je) return;
1355
- const h = setTimeout(() => Ke(!0), 8e3);
1355
+ if (Ke) return;
1356
+ const h = setTimeout(() => Xe(!0), 8e3);
1356
1357
  return () => clearTimeout(h);
1357
- }, [te, Je]);
1358
- const ze = b === "connecting" || te && !!i && !Je && !X, xe = A(null), se = A(null);
1359
- I(() => {
1360
- const h = xe.current;
1358
+ }, [te, Ke]);
1359
+ const dt = b === "connecting" || te && !!i && !Ke && !X, ne = A(null), de = A(null);
1360
+ T(() => {
1361
+ const h = ne.current;
1361
1362
  h && (h.innerHTML = "", M && (M.style.width = "100%", M.style.height = "100%", M.style.objectFit = "cover", M.style.transform = "scaleX(-1)", h.appendChild(M)));
1362
- }, [M]), I(() => {
1363
- const h = se.current;
1363
+ }, [M]), T(() => {
1364
+ const h = de.current;
1364
1365
  h && (h.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", h.appendChild(Z)));
1365
1366
  }, [Z]);
1366
- const [me, ke] = C(!1), [G, ne] = C(!1);
1367
- I(() => {
1368
- if (!me && !G && !R && !_) return;
1367
+ const [ue, ke] = C(!1), [G, re] = C(!1);
1368
+ T(() => {
1369
+ if (!ue && !G && !I && !_) return;
1369
1370
  const h = () => {
1370
- ke(!1), ne(!1), R && L(), _ && u();
1371
+ ke(!1), re(!1), I && k(), _ && u();
1371
1372
  };
1372
1373
  return document.addEventListener("click", h), () => document.removeEventListener("click", h);
1373
1374
  }, [
1374
- me,
1375
+ ue,
1375
1376
  G,
1376
- R,
1377
+ I,
1377
1378
  _,
1378
- L,
1379
+ k,
1379
1380
  u
1380
1381
  ]);
1381
- const [Le, Xe] = C(!1), wt = E(() => Xe((h) => !h), []), [Ee, Oe] = C(""), ut = E(
1382
+ const [Le, Qe] = C(!1), wt = E(() => Qe((h) => !h), []), [Ee, ze] = C(""), ut = E(
1382
1383
  (h) => {
1383
1384
  h.preventDefault();
1384
1385
  const V = Ee.trim();
1385
- V && ($(V), Oe(""));
1386
+ V && (z(V), ze(""));
1386
1387
  },
1387
- [Ee, $]
1388
- ), Qe = s.productName || "Live Layer";
1389
- let de = null, Ce = null;
1388
+ [Ee, z]
1389
+ ), Ze = s.productName || "Live Layer";
1390
+ let fe = null, Ce = null;
1390
1391
  for (let h = m.length - 1; h >= 0; h--) {
1391
1392
  const V = m[h];
1392
- if (!de && V.role === "agent" ? de = V : !Ce && V.role === "user" && (Ce = V), de && Ce) break;
1393
+ if (!fe && V.role === "agent" ? fe = V : !Ce && V.role === "user" && (Ce = V), fe && Ce) break;
1393
1394
  }
1394
- const ft = te ? (de == null ? void 0 : de.text) || null : l || null, He = te && (Ce == null ? void 0 : Ce.text) || null, _t = [
1395
+ const ft = te ? (fe == null ? void 0 : fe.text) || null : l || null, Oe = te && (Ce == null ? void 0 : Ce.text) || null, _t = [
1395
1396
  "ll-expanded",
1396
1397
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1397
1398
  ].join(" ");
1398
- return /* @__PURE__ */ v(
1399
+ return /* @__PURE__ */ y(
1399
1400
  "div",
1400
1401
  {
1401
1402
  className: _t,
1402
1403
  "data-position": e,
1403
- "data-state": te ? "connected" : _e ? "connecting" : "idle",
1404
+ "data-state": te ? "connected" : xe ? "connecting" : "idle",
1404
1405
  role: "dialog",
1405
1406
  "aria-label": `${r} widget`,
1406
1407
  children: [
1407
- /* @__PURE__ */ v("div", { className: "ll-expanded__bg", children: [
1408
+ /* @__PURE__ */ y("div", { className: "ll-expanded__bg", children: [
1408
1409
  i ? /* @__PURE__ */ n(
1409
- _r,
1410
+ kr,
1410
1411
  {
1411
1412
  src: i,
1412
1413
  alt: r,
1413
1414
  className: "ll-expanded__bg-img"
1414
1415
  }
1415
- ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Te = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Te.toUpperCase()) || "A" }) }),
1416
+ ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Me = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Me.toUpperCase()) || "A" }) }),
1416
1417
  o && !te && /* @__PURE__ */ n(
1417
1418
  "video",
1418
1419
  {
@@ -1425,12 +1426,12 @@ const Sr = ({
1425
1426
  }
1426
1427
  )
1427
1428
  ] }),
1428
- /* @__PURE__ */ n("div", { ref: ct, className: "ll-expanded__video" }),
1429
- ze && /* @__PURE__ */ v("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1429
+ /* @__PURE__ */ n("div", { ref: at, className: "ll-expanded__video" }),
1430
+ dt && /* @__PURE__ */ y("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1430
1431
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1431
1432
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: f ? "Switching..." : "Connecting..." })
1432
1433
  ] }),
1433
- D && te && /* @__PURE__ */ v(
1434
+ $ && te && /* @__PURE__ */ y(
1434
1435
  "button",
1435
1436
  {
1436
1437
  type: "button",
@@ -1442,46 +1443,46 @@ const Sr = ({
1442
1443
  ]
1443
1444
  }
1444
1445
  ),
1445
- at && /* @__PURE__ */ v(
1446
+ lt && /* @__PURE__ */ y(
1446
1447
  "div",
1447
1448
  {
1448
1449
  className: "ll-expanded__overlay ll-expanded__overlay--transforming",
1449
1450
  role: "status",
1450
1451
  "aria-live": "polite",
1451
- "aria-label": je,
1452
+ "aria-label": Ve,
1452
1453
  children: [
1453
1454
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1454
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: je })
1455
+ /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: Ve })
1455
1456
  ]
1456
1457
  }
1457
1458
  ),
1458
- _e ? /* @__PURE__ */ v(ot, { children: [
1459
- !ee && /* @__PURE__ */ v("div", { className: "ll-expanded__topbar", children: [
1460
- !he && /* @__PURE__ */ v("div", { className: "ll-expanded__topbar-left", children: [
1461
- /* @__PURE__ */ v("div", { className: "ll-expanded__pill-wrap", children: [
1462
- /* @__PURE__ */ v(
1459
+ xe ? /* @__PURE__ */ y(Ue, { children: [
1460
+ !ee && /* @__PURE__ */ y("div", { className: "ll-expanded__topbar", children: [
1461
+ !ge && /* @__PURE__ */ y("div", { className: "ll-expanded__topbar-left", children: [
1462
+ /* @__PURE__ */ y("div", { className: "ll-expanded__pill-wrap", children: [
1463
+ /* @__PURE__ */ y(
1463
1464
  "button",
1464
1465
  {
1465
1466
  type: "button",
1466
1467
  className: "ll-hpill",
1467
1468
  onClick: (h) => {
1468
- we && (h.stopPropagation(), u());
1469
+ _e && (h.stopPropagation(), u());
1469
1470
  },
1470
- "aria-haspopup": we ? "listbox" : void 0,
1471
- "aria-expanded": we ? _ : void 0,
1471
+ "aria-haspopup": _e ? "listbox" : void 0,
1472
+ "aria-expanded": _e ? _ : void 0,
1472
1473
  children: [
1473
1474
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1474
- we && /* @__PURE__ */ n(ht, {})
1475
+ _e && /* @__PURE__ */ n(ht, {})
1475
1476
  ]
1476
1477
  }
1477
1478
  ),
1478
- we && _ && /* @__PURE__ */ n(
1479
+ _e && _ && /* @__PURE__ */ n(
1479
1480
  "div",
1480
1481
  {
1481
1482
  className: "ll-hmenu",
1482
1483
  onClick: (h) => h.stopPropagation(),
1483
1484
  role: "listbox",
1484
- children: a == null ? void 0 : a.map((h) => /* @__PURE__ */ v(
1485
+ children: a == null ? void 0 : a.map((h) => /* @__PURE__ */ y(
1485
1486
  "button",
1486
1487
  {
1487
1488
  type: "button",
@@ -1507,17 +1508,17 @@ const Sr = ({
1507
1508
  }
1508
1509
  )
1509
1510
  ] }),
1510
- /* @__PURE__ */ v("div", { className: "ll-expanded__pill-wrap", children: [
1511
- /* @__PURE__ */ v(
1511
+ /* @__PURE__ */ y("div", { className: "ll-expanded__pill-wrap", children: [
1512
+ /* @__PURE__ */ y(
1512
1513
  "button",
1513
1514
  {
1514
1515
  type: "button",
1515
1516
  className: "ll-hpill ll-hpill--compact",
1516
1517
  onClick: (h) => {
1517
- h.stopPropagation(), L();
1518
+ h.stopPropagation(), k();
1518
1519
  },
1519
1520
  "aria-haspopup": "listbox",
1520
- "aria-expanded": R,
1521
+ "aria-expanded": I,
1521
1522
  "aria-label": "Language: English",
1522
1523
  title: "Language: English",
1523
1524
  children: [
@@ -1526,7 +1527,7 @@ const Sr = ({
1526
1527
  ]
1527
1528
  }
1528
1529
  ),
1529
- R && /* @__PURE__ */ n(
1530
+ I && /* @__PURE__ */ n(
1530
1531
  "div",
1531
1532
  {
1532
1533
  className: "ll-hmenu",
@@ -1548,21 +1549,21 @@ const Sr = ({
1548
1549
  /* @__PURE__ */ n(
1549
1550
  "span",
1550
1551
  {
1551
- className: `ll-expanded__state ll-expanded__state--${y}`,
1552
- children: y
1552
+ className: `ll-expanded__state ll-expanded__state--${v}`,
1553
+ children: v
1553
1554
  }
1554
1555
  )
1555
1556
  ] }),
1556
- /* @__PURE__ */ v("div", { className: "ll-expanded__header-actions", children: [
1557
- be !== !1 && /* @__PURE__ */ n(
1557
+ /* @__PURE__ */ y("div", { className: "ll-expanded__header-actions", children: [
1558
+ we !== !1 && /* @__PURE__ */ n(
1558
1559
  "button",
1559
1560
  {
1560
1561
  type: "button",
1561
1562
  className: "ll-hbtn",
1562
- onClick: st,
1563
+ onClick: ct,
1563
1564
  "aria-label": "Minimize widget",
1564
1565
  title: "Minimize",
1565
- children: /* @__PURE__ */ n(nn, {})
1566
+ children: /* @__PURE__ */ n(rn, {})
1566
1567
  }
1567
1568
  ),
1568
1569
  /* @__PURE__ */ n(
@@ -1570,34 +1571,34 @@ const Sr = ({
1570
1571
  {
1571
1572
  type: "button",
1572
1573
  className: "ll-hbtn ll-hbtn--danger",
1573
- onClick: dt,
1574
+ onClick: st,
1574
1575
  "aria-label": "End call",
1575
1576
  title: "End call",
1576
- children: /* @__PURE__ */ n(tn, {})
1577
+ children: /* @__PURE__ */ n(nn, {})
1577
1578
  }
1578
1579
  )
1579
1580
  ] })
1580
1581
  ] }),
1581
- ee && /* @__PURE__ */ v("div", { className: "ll-compact-status", "data-state": y, children: [
1582
+ ee && /* @__PURE__ */ y("div", { className: "ll-compact-status", "data-state": v, children: [
1582
1583
  /* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1583
- /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: y })
1584
+ /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: v })
1584
1585
  ] })
1585
1586
  ] }) : (
1586
1587
  // Idle-state header with Live Layer product name + minimize/close.
1587
1588
  // Hidden in compact mode — on a 140×210 docked slot the brand pill
1588
1589
  // and 40px buttons crowded out the central "Start video call"
1589
1590
  // affordance. The user can dismiss by scrolling past the slot.
1590
- !ee && /* @__PURE__ */ v("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1591
- /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Qe }),
1592
- /* @__PURE__ */ v("div", { className: "ll-expanded__header-actions", children: [
1593
- be !== !1 && /* @__PURE__ */ n(
1591
+ !ee && /* @__PURE__ */ y("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1592
+ /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ze }),
1593
+ /* @__PURE__ */ y("div", { className: "ll-expanded__header-actions", children: [
1594
+ we !== !1 && /* @__PURE__ */ n(
1594
1595
  "button",
1595
1596
  {
1596
1597
  type: "button",
1597
1598
  className: "ll-hbtn ll-hbtn--ghost",
1598
- onClick: st,
1599
+ onClick: ct,
1599
1600
  "aria-label": "Minimize widget",
1600
- children: /* @__PURE__ */ n(nn, {})
1601
+ children: /* @__PURE__ */ n(rn, {})
1601
1602
  }
1602
1603
  ),
1603
1604
  /* @__PURE__ */ n(
@@ -1605,9 +1606,9 @@ const Sr = ({
1605
1606
  {
1606
1607
  type: "button",
1607
1608
  className: "ll-hbtn ll-hbtn--danger",
1608
- onClick: dt,
1609
+ onClick: st,
1609
1610
  "aria-label": "Close widget",
1610
- children: /* @__PURE__ */ n(tn, {})
1611
+ children: /* @__PURE__ */ n(nn, {})
1611
1612
  }
1612
1613
  )
1613
1614
  ] })
@@ -1615,13 +1616,13 @@ const Sr = ({
1615
1616
  ),
1616
1617
  bt && /* @__PURE__ */ (() => {
1617
1618
  const h = S ? "Resume session" : b === "disconnected" ? "Reconnect to agent" : "Start video call";
1618
- return /* @__PURE__ */ v(ot, { children: [
1619
- !z && /* @__PURE__ */ v(
1619
+ return /* @__PURE__ */ y(Ue, { children: [
1620
+ !D && /* @__PURE__ */ y(
1620
1621
  "button",
1621
1622
  {
1622
1623
  type: "button",
1623
1624
  className: "ll-expanded__play",
1624
- onClick: Ve,
1625
+ onClick: Ye,
1625
1626
  "aria-label": h,
1626
1627
  children: [
1627
1628
  /* @__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" }) }) }),
@@ -1629,14 +1630,14 @@ const Sr = ({
1629
1630
  ]
1630
1631
  }
1631
1632
  ),
1632
- !ee && /* @__PURE__ */ v("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1633
+ !ee && /* @__PURE__ */ y("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1633
1634
  l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
1634
1635
  /* @__PURE__ */ n(
1635
1636
  "button",
1636
1637
  {
1637
1638
  type: "button",
1638
1639
  className: "ll-expanded__cta",
1639
- onClick: Ve,
1640
+ onClick: Ye,
1640
1641
  "aria-label": h,
1641
1642
  children: h
1642
1643
  }
@@ -1644,29 +1645,29 @@ const Sr = ({
1644
1645
  ] })
1645
1646
  ] });
1646
1647
  })(),
1647
- /* @__PURE__ */ v(
1648
+ /* @__PURE__ */ y(
1648
1649
  "div",
1649
1650
  {
1650
- className: `ll-expanded__pip ${_e && (N || ie) ? "is-visible" : ""}`,
1651
+ className: `ll-expanded__pip ${xe && (N || oe) ? "is-visible" : ""}`,
1651
1652
  children: [
1652
1653
  /* @__PURE__ */ n(
1653
1654
  "div",
1654
1655
  {
1655
- ref: se,
1656
- className: ie ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1656
+ ref: de,
1657
+ className: oe ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1657
1658
  }
1658
1659
  ),
1659
1660
  /* @__PURE__ */ n(
1660
1661
  "div",
1661
1662
  {
1662
- ref: xe,
1663
- className: !ie && N ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1663
+ ref: ne,
1664
+ className: !oe && N ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1664
1665
  }
1665
1666
  )
1666
1667
  ]
1667
1668
  }
1668
1669
  ),
1669
- _e ? /* @__PURE__ */ v("div", { className: "ll-expanded__bottom", children: [
1670
+ xe ? /* @__PURE__ */ y("div", { className: "ll-expanded__bottom", children: [
1670
1671
  !ee && ft && /* @__PURE__ */ n(
1671
1672
  "div",
1672
1673
  {
@@ -1675,27 +1676,27 @@ const Sr = ({
1675
1676
  children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: ft })
1676
1677
  }
1677
1678
  ),
1678
- !ee && He && /* @__PURE__ */ n(
1679
+ !ee && Oe && /* @__PURE__ */ n(
1679
1680
  "div",
1680
1681
  {
1681
1682
  className: "ll-expanded__transcript ll-expanded__transcript--user",
1682
1683
  "data-role": "user",
1683
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: He })
1684
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Oe })
1684
1685
  }
1685
1686
  ),
1686
- !he && !ee && /* @__PURE__ */ v("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
1687
- ve && /* @__PURE__ */ n(
1687
+ !ge && !ee && /* @__PURE__ */ y("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
1688
+ be && /* @__PURE__ */ n(
1688
1689
  "button",
1689
1690
  {
1690
1691
  type: "button",
1691
- className: `ll-tool ${ie ? "is-on" : ""}`,
1692
+ className: `ll-tool ${oe ? "is-on" : ""}`,
1692
1693
  onClick: Ie,
1693
- "aria-label": ie ? "Stop sharing screen" : "Share screen",
1694
- title: ie ? "Stop sharing" : "Share screen",
1695
- children: /* @__PURE__ */ n(fn, {})
1694
+ "aria-label": oe ? "Stop sharing screen" : "Share screen",
1695
+ title: oe ? "Stop sharing" : "Share screen",
1696
+ children: /* @__PURE__ */ n(hn, {})
1696
1697
  }
1697
1698
  ),
1698
- fe && /* @__PURE__ */ v("div", { className: "ll-tool-split", children: [
1699
+ he && /* @__PURE__ */ y("div", { className: "ll-tool-split", children: [
1699
1700
  /* @__PURE__ */ n(
1700
1701
  "button",
1701
1702
  {
@@ -1704,7 +1705,7 @@ const Sr = ({
1704
1705
  onClick: Re,
1705
1706
  "aria-label": N ? "Turn off camera" : "Turn on camera",
1706
1707
  title: N ? "Stop camera" : "Start camera",
1707
- children: /* @__PURE__ */ n(pn, {})
1708
+ children: /* @__PURE__ */ n(mn, {})
1708
1709
  }
1709
1710
  ),
1710
1711
  /* @__PURE__ */ n(
@@ -1713,7 +1714,7 @@ const Sr = ({
1713
1714
  type: "button",
1714
1715
  className: `ll-tool ll-tool--right ${N ? "is-on" : ""}`,
1715
1716
  onClick: (h) => {
1716
- h.stopPropagation(), ne((V) => !V), ke(!1);
1717
+ h.stopPropagation(), re((V) => !V), ke(!1);
1717
1718
  },
1718
1719
  "aria-label": "Camera devices",
1719
1720
  "aria-haspopup": "listbox",
@@ -1722,18 +1723,18 @@ const Sr = ({
1722
1723
  }
1723
1724
  ),
1724
1725
  G && F.length > 0 && /* @__PURE__ */ n(
1725
- rn,
1726
+ on,
1726
1727
  {
1727
1728
  label: "Camera",
1728
1729
  devices: F,
1729
- activeId: re,
1730
+ activeId: ie,
1730
1731
  onPick: (h) => {
1731
- ne(!1), $e(h);
1732
+ re(!1), $e(h);
1732
1733
  }
1733
1734
  }
1734
1735
  )
1735
1736
  ] }),
1736
- /* @__PURE__ */ v("div", { className: "ll-tool-split", children: [
1737
+ /* @__PURE__ */ y("div", { className: "ll-tool-split", children: [
1737
1738
  /* @__PURE__ */ n(
1738
1739
  "button",
1739
1740
  {
@@ -1742,7 +1743,7 @@ const Sr = ({
1742
1743
  onClick: Ae,
1743
1744
  "aria-label": x ? "Unmute microphone" : "Mute microphone",
1744
1745
  title: x ? "Unmute" : "Mute",
1745
- children: /* @__PURE__ */ n(hn, { muted: x })
1746
+ children: /* @__PURE__ */ n(gn, { muted: x })
1746
1747
  }
1747
1748
  ),
1748
1749
  /* @__PURE__ */ n(
@@ -1751,16 +1752,16 @@ const Sr = ({
1751
1752
  type: "button",
1752
1753
  className: `ll-tool ll-tool--right ${x ? "is-muted" : ""}`,
1753
1754
  onClick: (h) => {
1754
- h.stopPropagation(), ke((V) => !V), ne(!1);
1755
+ h.stopPropagation(), ke((V) => !V), re(!1);
1755
1756
  },
1756
1757
  "aria-label": "Microphone devices",
1757
1758
  "aria-haspopup": "listbox",
1758
- "aria-expanded": me,
1759
+ "aria-expanded": ue,
1759
1760
  children: /* @__PURE__ */ n(ht, {})
1760
1761
  }
1761
1762
  ),
1762
- me && B.length > 0 && /* @__PURE__ */ n(
1763
- rn,
1763
+ ue && B.length > 0 && /* @__PURE__ */ n(
1764
+ on,
1764
1765
  {
1765
1766
  label: "Microphone",
1766
1767
  devices: B,
@@ -1775,11 +1776,11 @@ const Sr = ({
1775
1776
  "button",
1776
1777
  {
1777
1778
  type: "button",
1778
- className: `ll-tool ${ae ? "is-muted" : ""}`,
1779
- onClick: Me,
1780
- "aria-label": ae ? "Unmute speaker" : "Mute speaker",
1781
- title: ae ? "Unmute speaker" : "Mute speaker",
1782
- children: /* @__PURE__ */ n(mn, { muted: ae })
1779
+ className: `ll-tool ${ce ? "is-muted" : ""}`,
1780
+ onClick: Te,
1781
+ "aria-label": ce ? "Unmute speaker" : "Mute speaker",
1782
+ title: ce ? "Unmute speaker" : "Mute speaker",
1783
+ children: /* @__PURE__ */ n(yn, { muted: ce })
1783
1784
  }
1784
1785
  ),
1785
1786
  /* @__PURE__ */ n(
@@ -1787,33 +1788,33 @@ const Sr = ({
1787
1788
  {
1788
1789
  type: "button",
1789
1790
  className: "ll-tool ll-tool--danger",
1790
- onClick: Ye,
1791
+ onClick: Ge,
1791
1792
  "aria-label": "End conversation",
1792
1793
  title: "End conversation",
1793
- children: /* @__PURE__ */ n(gn, {})
1794
+ children: /* @__PURE__ */ n(vn, {})
1794
1795
  }
1795
1796
  )
1796
1797
  ] }),
1797
- !he && ee && /* @__PURE__ */ n(
1798
- Lr,
1798
+ !ge && ee && /* @__PURE__ */ n(
1799
+ Cr,
1799
1800
  {
1800
1801
  isMuted: x,
1801
1802
  onToggleMute: Ae,
1802
1803
  isCameraEnabled: N,
1803
1804
  onToggleCamera: Re,
1804
- allowCamera: fe,
1805
- isScreenShareEnabled: ie,
1805
+ allowCamera: he,
1806
+ isScreenShareEnabled: oe,
1806
1807
  onToggleScreenShare: Ie,
1807
- allowScreenShare: ve,
1808
- isSpeakerMuted: ae,
1809
- onToggleSpeaker: Me,
1810
- allowTyping: pe,
1808
+ allowScreenShare: be,
1809
+ isSpeakerMuted: ce,
1810
+ onToggleSpeaker: Te,
1811
+ allowTyping: me,
1811
1812
  isTypingOpen: Le,
1812
1813
  onToggleTyping: wt,
1813
- onDisconnect: Ye
1814
+ onDisconnect: Ge
1814
1815
  }
1815
1816
  ),
1816
- !he && pe && (ee ? Le : !0) && /* @__PURE__ */ v("form", { className: "ll-message-input", onSubmit: ut, children: [
1817
+ !ge && me && (ee ? Le : !0) && /* @__PURE__ */ y("form", { className: "ll-message-input", onSubmit: ut, children: [
1817
1818
  /* @__PURE__ */ n(
1818
1819
  "input",
1819
1820
  {
@@ -1821,7 +1822,7 @@ const Sr = ({
1821
1822
  className: "ll-message-input__field",
1822
1823
  placeholder: "Message...",
1823
1824
  value: Ee,
1824
- onChange: (h) => Oe(h.target.value),
1825
+ onChange: (h) => ze(h.target.value),
1825
1826
  "aria-label": "Message the agent"
1826
1827
  }
1827
1828
  ),
@@ -1831,15 +1832,15 @@ const Sr = ({
1831
1832
  type: "submit",
1832
1833
  className: "ll-message-input__send",
1833
1834
  "aria-label": "Send message",
1834
- children: /* @__PURE__ */ n(Nr, {})
1835
+ children: /* @__PURE__ */ n(Rr, {})
1835
1836
  }
1836
1837
  )
1837
1838
  ] })
1838
1839
  ] }) : null,
1839
1840
  (() => {
1840
- if (T && b !== "error")
1841
- return /* @__PURE__ */ v("div", { className: "ll-expanded__banner", role: "alert", children: [
1842
- /* @__PURE__ */ n("span", { children: T }),
1841
+ if (R && b !== "error")
1842
+ return /* @__PURE__ */ y("div", { className: "ll-expanded__banner", role: "alert", children: [
1843
+ /* @__PURE__ */ n("span", { children: R }),
1843
1844
  /* @__PURE__ */ n(
1844
1845
  "button",
1845
1846
  {
@@ -1851,16 +1852,16 @@ const Sr = ({
1851
1852
  }
1852
1853
  )
1853
1854
  ] });
1854
- if (!z || b !== "error") return null;
1855
+ if (!D || b !== "error") return null;
1855
1856
  let h = "Failed to connect", V = "Try again";
1856
- return z === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : z === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : z === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : z === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : z === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : z.length < 80 && (h = z), /* @__PURE__ */ v("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1857
+ return D === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : D === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : D === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : D === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : D === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : D.length < 80 && (h = D), /* @__PURE__ */ y("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1857
1858
  /* @__PURE__ */ n("span", { children: h }),
1858
1859
  /* @__PURE__ */ n(
1859
1860
  "button",
1860
1861
  {
1861
1862
  type: "button",
1862
1863
  className: "ll-expanded__banner-retry",
1863
- onClick: Ge,
1864
+ onClick: Je,
1864
1865
  children: V
1865
1866
  }
1866
1867
  )
@@ -1873,52 +1874,52 @@ const Sr = ({
1873
1874
  function ht() {
1874
1875
  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" }) });
1875
1876
  }
1876
- function tn() {
1877
- return /* @__PURE__ */ v("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1877
+ function nn() {
1878
+ return /* @__PURE__ */ y("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1878
1879
  /* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1879
1880
  /* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1880
1881
  ] });
1881
1882
  }
1882
- function nn() {
1883
+ function rn() {
1883
1884
  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" }) });
1884
1885
  }
1885
- function fn() {
1886
- return /* @__PURE__ */ v("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: [
1886
+ function hn() {
1887
+ return /* @__PURE__ */ y("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: [
1887
1888
  /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
1888
1889
  /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
1889
1890
  /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
1890
1891
  ] });
1891
1892
  }
1892
- function pn() {
1893
- return /* @__PURE__ */ v("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: [
1893
+ function mn() {
1894
+ return /* @__PURE__ */ y("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: [
1894
1895
  /* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
1895
1896
  /* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
1896
1897
  ] });
1897
1898
  }
1898
- function hn({ muted: e }) {
1899
- return /* @__PURE__ */ v("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: [
1899
+ function gn({ muted: e }) {
1900
+ return /* @__PURE__ */ y("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: [
1900
1901
  /* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
1901
1902
  /* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
1902
1903
  /* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
1903
1904
  e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1904
1905
  ] });
1905
1906
  }
1906
- function mn({ muted: e }) {
1907
- return /* @__PURE__ */ v("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: [
1907
+ function yn({ muted: e }) {
1908
+ return /* @__PURE__ */ y("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: [
1908
1909
  /* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1909
- e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ v(ot, { children: [
1910
+ e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ y(Ue, { children: [
1910
1911
  /* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
1911
1912
  /* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1912
1913
  ] })
1913
1914
  ] });
1914
1915
  }
1915
- function Nr() {
1916
- return /* @__PURE__ */ v("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1916
+ function Rr() {
1917
+ return /* @__PURE__ */ y("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1917
1918
  /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
1918
1919
  /* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
1919
1920
  ] });
1920
1921
  }
1921
- function gn() {
1922
+ function vn() {
1922
1923
  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(
1923
1924
  "path",
1924
1925
  {
@@ -1927,7 +1928,7 @@ function gn() {
1927
1928
  }
1928
1929
  ) });
1929
1930
  }
1930
- const rn = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ v(
1931
+ const on = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ y(
1931
1932
  "div",
1932
1933
  {
1933
1934
  className: "ll-device-menu",
@@ -1937,7 +1938,7 @@ const rn = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
1937
1938
  /* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
1938
1939
  t.map((o, l) => {
1939
1940
  const s = r === o.deviceId;
1940
- return /* @__PURE__ */ v(
1941
+ return /* @__PURE__ */ y(
1941
1942
  "button",
1942
1943
  {
1943
1944
  type: "button",
@@ -1955,14 +1956,14 @@ const rn = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
1955
1956
  })
1956
1957
  ]
1957
1958
  }
1958
- ), Ar = [
1959
+ ), Ir = [
1959
1960
  '[data-ll-private="true"]',
1960
1961
  ".ll-widget"
1961
1962
  ];
1962
1963
  function At(e) {
1963
1964
  let t = e;
1964
1965
  for (; t; ) {
1965
- for (const r of Ar)
1966
+ for (const r of Ir)
1966
1967
  if (t.matches(r)) return !0;
1967
1968
  t = t.parentElement;
1968
1969
  }
@@ -1977,7 +1978,7 @@ function yt(e) {
1977
1978
  }
1978
1979
  return !0;
1979
1980
  }
1980
- const mt = 4096, Rr = 20, Ir = 20, Mr = 10, Tr = 10, Dr = 30, Pr = 20, on = 500, $r = [
1981
+ const mt = 4096, Tr = 20, Mr = 20, Dr = 10, Pr = 10, $r = 30, zr = 20, ln = 500, Or = [
1981
1982
  '[data-ll-private="true"]',
1982
1983
  ".ll-widget",
1983
1984
  "script",
@@ -1989,7 +1990,7 @@ function rt(e) {
1989
1990
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
1990
1991
  let t = e;
1991
1992
  for (; t; ) {
1992
- for (const r of $r)
1993
+ for (const r of Or)
1993
1994
  if (t.matches(r)) return !0;
1994
1995
  t = t.parentElement;
1995
1996
  }
@@ -2002,7 +2003,7 @@ function it(e) {
2002
2003
  const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
2003
2004
  return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
2004
2005
  }
2005
- function ln(e) {
2006
+ function an(e) {
2006
2007
  const t = e.getAttribute("id");
2007
2008
  if (t) {
2008
2009
  const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
@@ -2015,13 +2016,13 @@ function ln(e) {
2015
2016
  const o = e.closest("label");
2016
2017
  return o != null && o.textContent ? o.textContent.trim() : "";
2017
2018
  }
2018
- function ye(e, t) {
2019
+ function ve(e, t) {
2019
2020
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2020
2021
  }
2021
2022
  function Be(e) {
2022
2023
  return e.length;
2023
2024
  }
2024
- function zr(e, t = {}) {
2025
+ function Hr(e, t = {}) {
2025
2026
  const r = t.doc ?? (typeof document < "u" ? document : null);
2026
2027
  if (!r)
2027
2028
  return {
@@ -2039,116 +2040,116 @@ function zr(e, t = {}) {
2039
2040
  r.querySelectorAll("[data-ll-region]")
2040
2041
  ), a = [];
2041
2042
  for (const x of s) {
2042
- if (a.length >= Mr) break;
2043
+ if (a.length >= Dr) break;
2043
2044
  if (rt(x) || !it(x)) continue;
2044
- const T = x.getAttribute("data-ll-region") ?? "", B = x.getAttribute("data-ll-intent") ?? void 0, q = ye(
2045
+ const R = x.getAttribute("data-ll-region") ?? "", B = x.getAttribute("data-ll-intent") ?? void 0, q = ve(
2045
2046
  (x.innerText || x.textContent || "").trim(),
2046
- on * 2
2047
+ ln * 2
2047
2048
  );
2048
- !T || !q || a.push({ id: T, intent: B, text: q });
2049
+ !R || !q || a.push({ id: R, intent: B, text: q });
2049
2050
  }
2050
2051
  const d = [], f = ["H1", "H2", "H3", "H4", "H5", "H6"], _ = Array.from(
2051
2052
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
2052
2053
  );
2053
2054
  for (const x of _) {
2054
2055
  if (rt(x) || !it(x)) continue;
2055
- const T = (x.textContent || "").trim();
2056
- T && d.push(`${x.tagName}: ${ye(T, 200)}`);
2056
+ const R = (x.textContent || "").trim();
2057
+ R && d.push(`${x.tagName}: ${ve(R, 200)}`);
2057
2058
  }
2058
2059
  const u = Array.from(r.querySelectorAll("p, li"));
2059
2060
  for (const x of u) {
2060
2061
  if (rt(x) || !it(x) || f.includes(x.tagName)) continue;
2061
- const T = (x.textContent || "").trim();
2062
- T.length > 10 && d.push(ye(T, on));
2062
+ const R = (x.textContent || "").trim();
2063
+ R.length > 10 && d.push(ve(R, ln));
2063
2064
  }
2064
2065
  const c = d.join(`
2065
- `), R = [], L = Array.from(r.querySelectorAll("a[href]"));
2066
- for (const x of L) {
2067
- if (R.length >= Rr) break;
2066
+ `), I = [], k = Array.from(r.querySelectorAll("a[href]"));
2067
+ for (const x of k) {
2068
+ if (I.length >= Tr) break;
2068
2069
  if (rt(x) || !it(x)) continue;
2069
- const T = x.getAttribute("href") || "", B = (x.textContent || "").trim();
2070
- !T || !B || R.push({ href: T, text: ye(B, 100) });
2070
+ const R = x.getAttribute("href") || "", B = (x.textContent || "").trim();
2071
+ !R || !B || I.push({ href: R, text: ve(B, 100) });
2071
2072
  }
2072
- const b = [], y = Array.from(
2073
+ const b = [], v = Array.from(
2073
2074
  r.querySelectorAll(
2074
2075
  "input, textarea, select"
2075
2076
  )
2076
2077
  );
2077
- for (const x of y) {
2078
- if (b.length >= Ir) break;
2078
+ for (const x of v) {
2079
+ if (b.length >= Mr) break;
2079
2080
  if (rt(x) || !yt(x) || !it(x)) continue;
2080
- const T = ln(x), B = x instanceof HTMLInputElement ? x.type : x.tagName.toLowerCase();
2081
- T && b.push({ label: ye(T, 100), type: B });
2081
+ const R = an(x), B = x instanceof HTMLInputElement ? x.type : x.tagName.toLowerCase();
2082
+ R && b.push({ label: ve(R, 100), type: B });
2082
2083
  }
2083
2084
  const m = Array.from(
2084
2085
  r.querySelectorAll("[data-ll-form]")
2085
2086
  ), S = [];
2086
2087
  for (const x of m) {
2087
- if (S.length >= Tr) break;
2088
+ if (S.length >= Pr) break;
2088
2089
  if (At(x)) continue;
2089
- const T = x.getAttribute("data-ll-form") || "";
2090
- if (!T) continue;
2090
+ const R = x.getAttribute("data-ll-form") || "";
2091
+ if (!R) continue;
2091
2092
  const B = x.getAttribute("data-ll-intent") || void 0, q = Array.from(
2092
2093
  x.querySelectorAll(
2093
2094
  "[data-ll-field]"
2094
2095
  )
2095
2096
  ), N = [];
2096
2097
  for (const M of q) {
2097
- if (N.length >= Dr) break;
2098
+ if (N.length >= $r) break;
2098
2099
  if (!yt(M)) continue;
2099
2100
  const F = M.getAttribute("data-ll-field") || "";
2100
2101
  if (!F) continue;
2101
- const re = ln(M) || F, ie = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), Z = {
2102
+ const ie = an(M) || F, oe = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), Z = {
2102
2103
  name: F,
2103
- label: ye(re, 100),
2104
- type: ie
2104
+ label: ve(ie, 100),
2105
+ type: oe
2105
2106
  };
2106
2107
  if (M.required === !0 && (Z.required = !0), M instanceof HTMLSelectElement) {
2107
- const fe = [];
2108
- for (let ve = 0; ve < M.options.length && !(fe.length >= Pr); ve++) {
2109
- const pe = M.options[ve];
2110
- if (!pe || pe.disabled) continue;
2111
- const be = pe.value || "", he = (pe.textContent || "").trim() || be;
2112
- !be && !he || fe.push({ value: be, label: ye(he, 60) });
2108
+ const he = [];
2109
+ for (let be = 0; be < M.options.length && !(he.length >= zr); be++) {
2110
+ const me = M.options[be];
2111
+ if (!me || me.disabled) continue;
2112
+ const we = me.value || "", ge = (me.textContent || "").trim() || we;
2113
+ !we && !ge || he.push({ value: we, label: ve(ge, 60) });
2113
2114
  }
2114
- fe.length > 0 && (Z.options = fe);
2115
+ he.length > 0 && (Z.options = he);
2115
2116
  }
2116
- const ae = typeof M.validationMessage == "string" ? M.validationMessage : "";
2117
- ae && (Z.validationMessage = ye(ae, 200)), N.push(Z);
2117
+ const ce = typeof M.validationMessage == "string" ? M.validationMessage : "";
2118
+ ce && (Z.validationMessage = ve(ce, 200)), N.push(Z);
2118
2119
  }
2119
- S.push({ id: T, intent: B, fields: N });
2120
+ S.push({ id: R, intent: B, fields: N });
2120
2121
  }
2121
- const D = {
2122
+ const $ = {
2122
2123
  url: i,
2123
2124
  title: l,
2124
2125
  pathname: o,
2125
2126
  regions: a,
2126
2127
  visibleText: c,
2127
- visibleLinks: R,
2128
+ visibleLinks: I,
2128
2129
  visibleFields: b,
2129
2130
  forms: S,
2130
2131
  extras: e
2131
2132
  };
2132
- let z = Be(JSON.stringify(D.regions)) + Be(D.visibleText) + Be(JSON.stringify(D.visibleLinks)) + Be(JSON.stringify(D.visibleFields));
2133
- for (; z > mt && D.visibleFields.length > 0; )
2134
- D.visibleFields.pop(), z = Be(JSON.stringify(D.visibleFields));
2135
- for (; z > mt && D.visibleLinks.length > 0; )
2136
- D.visibleLinks.pop(), z -= 80;
2137
- return Be(D.visibleText) > mt && (D.visibleText = ye(D.visibleText, mt - 100)), D;
2133
+ let D = Be(JSON.stringify($.regions)) + Be($.visibleText) + Be(JSON.stringify($.visibleLinks)) + Be(JSON.stringify($.visibleFields));
2134
+ for (; D > mt && $.visibleFields.length > 0; )
2135
+ $.visibleFields.pop(), D = Be(JSON.stringify($.visibleFields));
2136
+ for (; D > mt && $.visibleLinks.length > 0; )
2137
+ $.visibleLinks.pop(), D -= 80;
2138
+ return Be($.visibleText) > mt && ($.visibleText = ve($.visibleText, mt - 100)), $;
2138
2139
  }
2139
2140
  let qe = null;
2140
- function an(e, t = {}) {
2141
+ function cn(e, t = {}) {
2141
2142
  const r = Date.now(), o = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2142
2143
  if (qe && qe.key === o && r - qe.at < 1e3)
2143
2144
  return qe.ctx;
2144
- const l = zr(e, t);
2145
+ const l = Hr(e, t);
2145
2146
  return qe = { key: o, at: r, ctx: l }, l;
2146
2147
  }
2147
- function Or() {
2148
+ function Wr() {
2148
2149
  qe = null;
2149
2150
  }
2150
- const Hr = 200;
2151
- function Wr(e) {
2151
+ const Br = 200;
2152
+ function qr(e) {
2152
2153
  const t = String(e.href || "");
2153
2154
  return {
2154
2155
  href: t,
@@ -2158,18 +2159,18 @@ function Wr(e) {
2158
2159
  description: e.description
2159
2160
  };
2160
2161
  }
2161
- function Br(e) {
2162
+ function Fr(e) {
2162
2163
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2163
2164
  }
2164
- function qr(e) {
2165
+ function Ur(e) {
2165
2166
  const t = e ?? (typeof document < "u" ? document : null);
2166
2167
  if (!t) return [];
2167
2168
  const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
2168
2169
  for (const s of l) {
2169
- if (o.length >= Hr) break;
2170
+ if (o.length >= Br) break;
2170
2171
  if (At(s)) continue;
2171
2172
  const a = s.getAttribute("href") || "";
2172
- if (!Br(a)) continue;
2173
+ if (!Fr(a)) continue;
2173
2174
  let d = a, f = !0;
2174
2175
  try {
2175
2176
  if (typeof window < "u") {
@@ -2187,22 +2188,22 @@ function qr(e) {
2187
2188
  return o;
2188
2189
  }
2189
2190
  let Fe = null;
2190
- const Fr = 5e3;
2191
+ const jr = 5e3;
2191
2192
  function St() {
2192
2193
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2193
- if (Fe && Fe.pathname === t && e - Fe.at < Fr)
2194
+ if (Fe && Fe.pathname === t && e - Fe.at < jr)
2194
2195
  return Fe.routes;
2195
- const r = qr();
2196
+ const r = Ur();
2196
2197
  return Fe = { at: e, pathname: t, routes: r }, r;
2197
2198
  }
2198
- function Ur() {
2199
+ function Vr() {
2199
2200
  Fe = null;
2200
2201
  }
2201
- function jr(e, t) {
2202
+ function Yr(e, t) {
2202
2203
  const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value"), o = i == null ? void 0 : i.set;
2203
2204
  o ? o.call(e, t) : e.value = t;
2204
2205
  }
2205
- function Vr(e, t, r = {}) {
2206
+ function Gr(e, t, r = {}) {
2206
2207
  const i = r.triggerInput ?? !0, o = r.triggerChange ?? !0;
2207
2208
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2208
2209
  const l = Object.getOwnPropertyDescriptor(
@@ -2212,9 +2213,9 @@ function Vr(e, t, r = {}) {
2212
2213
  s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2213
2214
  return;
2214
2215
  }
2215
- jr(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2216
+ Yr(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2216
2217
  }
2217
- function Yr() {
2218
+ function Jr() {
2218
2219
  if (typeof window > "u" || typeof document > "u")
2219
2220
  return !1;
2220
2221
  const e = document.scrollingElement || document.documentElement;
@@ -2222,19 +2223,19 @@ function Yr() {
2222
2223
  const t = window.getComputedStyle(e);
2223
2224
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2224
2225
  }
2225
- function Gr(e) {
2226
+ function Kr(e) {
2226
2227
  if (!(e instanceof HTMLElement)) return !1;
2227
2228
  const r = window.getComputedStyle(e).overflowY;
2228
2229
  return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2229
2230
  }
2230
- function Jr() {
2231
+ function Xr() {
2231
2232
  if (typeof document > "u") return null;
2232
2233
  const e = Array.from(
2233
2234
  document.querySelectorAll("body, body *")
2234
2235
  );
2235
2236
  let t = null, r = 0;
2236
2237
  for (const i of e) {
2237
- if (!Gr(i)) continue;
2238
+ if (!Kr(i)) continue;
2238
2239
  const o = i.getBoundingClientRect();
2239
2240
  if (o.bottom <= 0 || o.top >= window.innerHeight || o.right <= 0 || o.left >= window.innerWidth || o.width <= 0 || o.height <= 0 || i.closest(".ll-widget")) continue;
2240
2241
  const l = o.width * o.height;
@@ -2242,24 +2243,24 @@ function Jr() {
2242
2243
  }
2243
2244
  return t;
2244
2245
  }
2245
- function Kr() {
2246
+ function Qr() {
2246
2247
  if (typeof window > "u")
2247
2248
  return null;
2248
- if (Yr()) return window;
2249
- const e = Jr();
2249
+ if (Jr()) return window;
2250
+ const e = Xr();
2250
2251
  return e || window;
2251
2252
  }
2252
- function cn(e) {
2253
+ function sn(e) {
2253
2254
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2254
2255
  }
2255
- function Xr(e) {
2256
+ function Zr(e) {
2256
2257
  var t, r;
2257
2258
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2258
2259
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2259
2260
  ((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
2260
2261
  ) : e.scrollHeight - e.clientHeight;
2261
2262
  }
2262
- const Qr = /* @__PURE__ */ new Set([
2263
+ const ei = /* @__PURE__ */ new Set([
2263
2264
  "agent_state",
2264
2265
  "avatar_stream_ready",
2265
2266
  "avatar_active",
@@ -2281,9 +2282,9 @@ const Qr = /* @__PURE__ */ new Set([
2281
2282
  "focus_field",
2282
2283
  "submit_form",
2283
2284
  "request_routes"
2284
- ]), yn = lt(
2285
+ ]), bn = ot(
2285
2286
  function(t, r) {
2286
- var Ot, Ht, Wt, Bt, qt, Ft, Ut;
2287
+ var Ht, Wt, Bt, qt, Ft, Ut, jt;
2287
2288
  const {
2288
2289
  agentId: i,
2289
2290
  apiKey: o,
@@ -2295,69 +2296,69 @@ const Qr = /* @__PURE__ */ new Set([
2295
2296
  autoConnect: _ = !1,
2296
2297
  displayMode: u,
2297
2298
  defaultDisplayMode: c = "expanded",
2298
- onDisplayModeChange: R,
2299
- position: L = "bottom-right",
2299
+ onDisplayModeChange: I,
2300
+ position: k = "bottom-right",
2300
2301
  mobileBreakpoint: b = 640,
2301
- persistKey: y = "ll-widget",
2302
+ persistKey: v = "ll-widget",
2302
2303
  disablePersistence: m = !1,
2303
2304
  teamMembers: S,
2304
- currentTeamMemberId: D,
2305
- onTeamMemberChange: z,
2305
+ currentTeamMemberId: $,
2306
+ onTeamMemberChange: D,
2306
2307
  idleLoopUrl: x,
2307
- greeting: T,
2308
+ greeting: R,
2308
2309
  avatarImageUrl: B,
2309
2310
  agentName: q,
2310
2311
  branding: N = {},
2311
2312
  allowCamera: M = !0,
2312
2313
  allowScreenShare: F = !0,
2313
- allowTyping: re = !0,
2314
- showMinimize: ie = !0,
2314
+ allowTyping: ie = !0,
2315
+ showMinimize: oe = !0,
2315
2316
  chromeless: Z = !1,
2316
- compactControls: ae = !1,
2317
- transforming: fe = !1,
2318
- transformingLabel: ve = "Transforming…",
2319
- showOn: pe,
2320
- hideOn: be,
2321
- pathname: he,
2317
+ compactControls: ce = !1,
2318
+ transforming: he = !1,
2319
+ transformingLabel: be = "Transforming…",
2320
+ showOn: me,
2321
+ hideOn: we,
2322
+ pathname: ge,
2322
2323
  onNavigate: ee,
2323
- onScrollToSelector: at,
2324
- getPageContext: je,
2325
- pageContextExtras: ct,
2326
- getRoutes: oe,
2327
- onScrollPage: Ve,
2328
- onClick: Ye,
2329
- capabilities: Ge,
2324
+ onScrollToSelector: lt,
2325
+ getPageContext: Ve,
2326
+ pageContextExtras: at,
2327
+ getRoutes: le,
2328
+ onScrollPage: Ye,
2329
+ onClick: Ge,
2330
+ capabilities: Je,
2330
2331
  onConnect: De,
2331
2332
  onDisconnect: Ae,
2332
2333
  onTranscript: Pe,
2333
2334
  onAgentState: Re,
2334
2335
  onConnectionStateChange: $e,
2335
2336
  onAgentEvent: Ie,
2336
- onAgentCommand: Me,
2337
- controlledSession: $,
2338
- className: st,
2339
- style: dt,
2337
+ onAgentCommand: Te,
2338
+ controlledSession: z,
2339
+ className: ct,
2340
+ style: st,
2340
2341
  zIndex: vt = 2147483647
2341
- } = t, we = rr(he), _e = dr(we, pe, be);
2342
- I(() => {
2343
- Or(), Ur();
2344
- }, [we]);
2345
- const te = D !== void 0, [bt, Je] = C(() => {
2342
+ } = t, _e = or(ge), xe = fr(_e, me, we);
2343
+ T(() => {
2344
+ Wr(), Vr();
2345
+ }, [_e]);
2346
+ const te = $ !== void 0, [bt, Ke] = C(() => {
2346
2347
  var g;
2347
- return D ?? ((g = S == null ? void 0 : S[0]) == null ? void 0 : g.id);
2348
- }), ce = te ? D : bt, X = Ue(
2349
- () => (S == null ? void 0 : S.find((g) => g.id === ce)) ?? null,
2350
- [S, ce]
2351
- ), Ke = (X == null ? void 0 : X.agentId) ?? i, ze = f === "EMBEDDED", [xe, se] = Zn({
2352
- value: ze ? "expanded" : u,
2353
- defaultValue: ze ? "expanded" : c,
2354
- onChange: R,
2355
- persistKey: y,
2356
- disablePersistence: ze || m
2357
- }), me = tr(b), ke = Bn(), G = qn(), ne = Un(), Le = jn(), Xe = Vn(), [wt, Ee] = C(!1), [Oe, ut] = C(!1), [Qe, de] = C(!1), [Ce, ft] = C(!1), [He, _t] = C(!1), Te = fr({ baseUrl: l, config: d }), h = A(Te);
2358
- h.current = Te;
2359
- const V = A(ee), xt = A(at), kt = A(Ve), Lt = A(Ye), Rt = A(je), It = A(ct), Mt = A(oe), Et = A(Ge), ue = A(null);
2360
- V.current = ee, xt.current = at, kt.current = Ve, Lt.current = Ye, Rt.current = je, It.current = ct, Mt.current = oe, Et.current = Ge;
2348
+ return $ ?? ((g = S == null ? void 0 : S[0]) == null ? void 0 : g.id);
2349
+ }), se = te ? $ : bt, X = je(
2350
+ () => (S == null ? void 0 : S.find((g) => g.id === se)) ?? null,
2351
+ [S, se]
2352
+ ), Xe = (X == null ? void 0 : X.agentId) ?? i, dt = f === "EMBEDDED", [ne, de] = tr({
2353
+ value: u,
2354
+ defaultValue: c,
2355
+ onChange: I,
2356
+ persistKey: v,
2357
+ disablePersistence: dt || m
2358
+ }), ue = rr(b), ke = Fn(), G = Un(), re = Vn(), Le = Yn(), Qe = Gn(), [wt, Ee] = C(!1), [ze, ut] = C(!1), [Ze, fe] = C(!1), [Ce, ft] = C(!1), [Oe, _t] = C(!1), Me = hr({ baseUrl: l, config: d }), h = A(Me);
2359
+ h.current = Me;
2360
+ const V = A(ee), xt = A(lt), kt = A(Ye), Lt = A(Ge), Rt = A(Ve), It = A(at), Tt = A(le), Et = A(Je), pe = A(null);
2361
+ V.current = ee, xt.current = lt, kt.current = Ye, Lt.current = Ge, Rt.current = Ve, It.current = at, Tt.current = le, Et.current = Je;
2361
2362
  function Se(g) {
2362
2363
  const p = Et.current;
2363
2364
  return p ? p.includes(g) : !0;
@@ -2367,9 +2368,9 @@ const Qr = /* @__PURE__ */ new Set([
2367
2368
  `[LiveLayer] Agent command "${g}" blocked — capability "${p}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
2368
2369
  );
2369
2370
  }
2370
- const Ze = E(
2371
+ const et = E(
2371
2372
  (g) => {
2372
- var Y, le, ge, nt;
2373
+ var Y, ae, ye, nt;
2373
2374
  const p = g;
2374
2375
  if (!(!p.type || typeof p.type != "string")) {
2375
2376
  if (Ie == null || Ie({ eventName: p.type, data: g }), p.type === "navigate") {
@@ -2377,8 +2378,8 @@ const Qr = /* @__PURE__ */ new Set([
2377
2378
  Ne("navigate", "navigate");
2378
2379
  return;
2379
2380
  }
2380
- const k = typeof p.href == "string" ? p.href : null;
2381
- if (!k) {
2381
+ const L = typeof p.href == "string" ? p.href : null;
2382
+ if (!L) {
2382
2383
  console.warn(
2383
2384
  `[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
2384
2385
  );
@@ -2386,10 +2387,10 @@ const Qr = /* @__PURE__ */ new Set([
2386
2387
  }
2387
2388
  if (h.current.playPageChange(), V.current) {
2388
2389
  try {
2389
- V.current(k);
2390
+ V.current(L);
2390
2391
  } catch (P) {
2391
2392
  console.warn(
2392
- `[LiveLayer] onNavigate threw for "${k}". Falling back. Error:`,
2393
+ `[LiveLayer] onNavigate threw for "${L}". Falling back. Error:`,
2393
2394
  P
2394
2395
  );
2395
2396
  }
@@ -2397,7 +2398,7 @@ const Qr = /* @__PURE__ */ new Set([
2397
2398
  }
2398
2399
  if (typeof document < "u") {
2399
2400
  const P = document.querySelector(
2400
- `a[href="${k.replace(/"/g, '\\"')}"]`
2401
+ `a[href="${L.replace(/"/g, '\\"')}"]`
2401
2402
  );
2402
2403
  if (P) {
2403
2404
  P.click();
@@ -2406,10 +2407,10 @@ const Qr = /* @__PURE__ */ new Set([
2406
2407
  }
2407
2408
  if (typeof window < "u" && typeof history < "u")
2408
2409
  try {
2409
- history.pushState({}, "", k), window.dispatchEvent(new PopStateEvent("popstate"));
2410
+ history.pushState({}, "", L), window.dispatchEvent(new PopStateEvent("popstate"));
2410
2411
  } catch (P) {
2411
2412
  console.warn(
2412
- `[LiveLayer] history.pushState fallback failed for "${k}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
2413
+ `[LiveLayer] history.pushState fallback failed for "${L}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
2413
2414
  P
2414
2415
  );
2415
2416
  }
@@ -2420,13 +2421,13 @@ const Qr = /* @__PURE__ */ new Set([
2420
2421
  Ne("scroll_to", "scroll");
2421
2422
  return;
2422
2423
  }
2423
- const k = typeof p.selector == "string" ? p.selector : null;
2424
- if (!k) return;
2424
+ const L = typeof p.selector == "string" ? p.selector : null;
2425
+ if (!L) return;
2425
2426
  const P = p.behavior === "instant" ? "instant" : "smooth";
2426
2427
  if (xt.current) {
2427
2428
  try {
2428
2429
  xt.current(
2429
- k,
2430
+ L,
2430
2431
  P
2431
2432
  );
2432
2433
  } catch (W) {
@@ -2437,16 +2438,16 @@ const Qr = /* @__PURE__ */ new Set([
2437
2438
  if (typeof document < "u") {
2438
2439
  let W = null;
2439
2440
  try {
2440
- W = document.querySelector(k);
2441
+ W = document.querySelector(L);
2441
2442
  } catch {
2442
2443
  console.warn(
2443
- `[LiveLayer] scroll_to: invalid selector "${k}".`
2444
+ `[LiveLayer] scroll_to: invalid selector "${L}".`
2444
2445
  );
2445
2446
  return;
2446
2447
  }
2447
2448
  if (!W) {
2448
2449
  console.warn(
2449
- `[LiveLayer] scroll_to: no element matched "${k}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
2450
+ `[LiveLayer] scroll_to: no element matched "${L}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
2450
2451
  );
2451
2452
  return;
2452
2453
  }
@@ -2462,11 +2463,11 @@ const Qr = /* @__PURE__ */ new Set([
2462
2463
  Ne("request_page_context", "read_page");
2463
2464
  return;
2464
2465
  }
2465
- const k = typeof p.requestId == "string" ? p.requestId : void 0, P = (Y = ue.current) == null ? void 0 : Y.call(ue), W = (j) => {
2466
+ const L = typeof p.requestId == "string" ? p.requestId : void 0, P = (Y = pe.current) == null ? void 0 : Y.call(pe), W = (j) => {
2466
2467
  const O = P, K = O == null ? void 0 : O.localParticipant;
2467
2468
  if (K != null && K.publishData)
2468
2469
  try {
2469
- const Q = k ? { ...j, requestId: k } : j, We = new TextEncoder().encode(JSON.stringify(Q));
2470
+ const Q = L ? { ...j, requestId: L } : j, We = new TextEncoder().encode(JSON.stringify(Q));
2470
2471
  K.publishData(We, { reliable: !0 });
2471
2472
  } catch (Q) {
2472
2473
  console.warn("[LiveLayer] publishData failed.", Q);
@@ -2482,7 +2483,7 @@ const Qr = /* @__PURE__ */ new Set([
2482
2483
  O
2483
2484
  ), W({
2484
2485
  type: "page_context",
2485
- context: an(H)
2486
+ context: cn(H)
2486
2487
  });
2487
2488
  });
2488
2489
  return;
@@ -2492,7 +2493,7 @@ const Qr = /* @__PURE__ */ new Set([
2492
2493
  }
2493
2494
  W({
2494
2495
  type: "page_context",
2495
- context: an(H)
2496
+ context: cn(H)
2496
2497
  });
2497
2498
  } catch (j) {
2498
2499
  console.warn(
@@ -2510,10 +2511,10 @@ const Qr = /* @__PURE__ */ new Set([
2510
2511
  Ne("scroll_page", "scroll");
2511
2512
  return;
2512
2513
  }
2513
- const k = p.direction;
2514
- if (k !== "up" && k !== "down" && k !== "top" && k !== "bottom") {
2514
+ const L = p.direction;
2515
+ if (L !== "up" && L !== "down" && L !== "top" && L !== "bottom") {
2515
2516
  console.warn(
2516
- `[LiveLayer] scroll_page: invalid direction "${String(k)}". Expected up | down | top | bottom.`
2517
+ `[LiveLayer] scroll_page: invalid direction "${String(L)}". Expected up | down | top | bottom.`
2517
2518
  );
2518
2519
  return;
2519
2520
  }
@@ -2521,7 +2522,7 @@ const Qr = /* @__PURE__ */ new Set([
2521
2522
  if (kt.current) {
2522
2523
  try {
2523
2524
  kt.current(
2524
- k,
2525
+ L,
2525
2526
  P
2526
2527
  );
2527
2528
  } catch (O) {
@@ -2530,12 +2531,12 @@ const Qr = /* @__PURE__ */ new Set([
2530
2531
  return;
2531
2532
  }
2532
2533
  if (typeof window > "u") return;
2533
- const W = { behavior: P }, H = Kr(), U = (O) => {
2534
+ const W = { behavior: P }, H = Qr(), U = (O) => {
2534
2535
  H instanceof Window ? H.scrollBy({ top: O, ...W }) : H.scrollBy({ top: O, ...W });
2535
2536
  }, j = (O) => {
2536
2537
  H instanceof Window ? H.scrollTo({ top: O, ...W }) : H.scrollTo({ top: O, ...W });
2537
2538
  };
2538
- k === "up" ? U(-cn(H)) : k === "down" ? U(cn(H)) : j(k === "top" ? 0 : Xr(H));
2539
+ L === "up" ? U(-sn(H)) : L === "down" ? U(sn(H)) : j(L === "top" ? 0 : Zr(H));
2539
2540
  return;
2540
2541
  }
2541
2542
  if (p.type === "click") {
@@ -2543,14 +2544,14 @@ const Qr = /* @__PURE__ */ new Set([
2543
2544
  Ne("click", "click");
2544
2545
  return;
2545
2546
  }
2546
- const k = typeof p.selector == "string" ? p.selector : null;
2547
- if (!k) {
2547
+ const L = typeof p.selector == "string" ? p.selector : null;
2548
+ if (!L) {
2548
2549
  console.warn("[LiveLayer] click: missing selector.");
2549
2550
  return;
2550
2551
  }
2551
2552
  if (Lt.current) {
2552
2553
  try {
2553
- Lt.current(k);
2554
+ Lt.current(L);
2554
2555
  } catch (W) {
2555
2556
  console.warn("[LiveLayer] onClick threw.", W);
2556
2557
  }
@@ -2559,16 +2560,16 @@ const Qr = /* @__PURE__ */ new Set([
2559
2560
  if (typeof document > "u") return;
2560
2561
  let P = null;
2561
2562
  try {
2562
- P = document.querySelector(k);
2563
+ P = document.querySelector(L);
2563
2564
  } catch {
2564
2565
  console.warn(
2565
- `[LiveLayer] click: invalid selector "${k}".`
2566
+ `[LiveLayer] click: invalid selector "${L}".`
2566
2567
  );
2567
2568
  return;
2568
2569
  }
2569
2570
  if (!P) {
2570
2571
  console.warn(
2571
- `[LiveLayer] click: no element matched "${k}". See https://livelayer.studio/docs/errors/click-no-match`
2572
+ `[LiveLayer] click: no element matched "${L}". See https://livelayer.studio/docs/errors/click-no-match`
2572
2573
  );
2573
2574
  return;
2574
2575
  }
@@ -2578,7 +2579,7 @@ const Qr = /* @__PURE__ */ new Set([
2578
2579
  );
2579
2580
  return;
2580
2581
  }
2581
- (le = P.click) == null || le.call(P);
2582
+ (ae = P.click) == null || ae.call(P);
2582
2583
  return;
2583
2584
  }
2584
2585
  if (p.type === "fill_form" || p.type === "focus_field") {
@@ -2588,17 +2589,17 @@ const Qr = /* @__PURE__ */ new Set([
2588
2589
  }
2589
2590
  if (typeof document > "u") return;
2590
2591
  p.type === "fill_form" && h.current.playConfirmation();
2591
- const k = typeof p.formId == "string" ? p.formId : null;
2592
- if (!k) {
2592
+ const L = typeof p.formId == "string" ? p.formId : null;
2593
+ if (!L) {
2593
2594
  console.warn(`[LiveLayer] ${p.type}: missing formId.`);
2594
2595
  return;
2595
2596
  }
2596
2597
  const P = document.querySelector(
2597
- `[data-ll-form="${k.replace(/"/g, '\\"')}"]`
2598
+ `[data-ll-form="${L.replace(/"/g, '\\"')}"]`
2598
2599
  );
2599
2600
  if (!P) {
2600
2601
  console.warn(
2601
- `[LiveLayer] ${p.type}: no form with data-ll-form="${k}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
2602
+ `[LiveLayer] ${p.type}: no form with data-ll-form="${L}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
2602
2603
  );
2603
2604
  return;
2604
2605
  }
@@ -2617,7 +2618,7 @@ const Qr = /* @__PURE__ */ new Set([
2617
2618
  const U = P.querySelector(`[data-ll-field="${H.replace(/"/g, '\\"')}"]`);
2618
2619
  if (!U) {
2619
2620
  console.warn(
2620
- `[LiveLayer] focus_field: no field "${H}" in form "${k}".`
2621
+ `[LiveLayer] focus_field: no field "${H}" in form "${L}".`
2621
2622
  );
2622
2623
  return;
2623
2624
  }
@@ -2640,7 +2641,7 @@ const Qr = /* @__PURE__ */ new Set([
2640
2641
  const j = P.querySelector(`[data-ll-field="${H.replace(/"/g, '\\"')}"]`);
2641
2642
  if (!j) {
2642
2643
  console.warn(
2643
- `[LiveLayer] fill_form: no field "${H}" in form "${k}". Skipping.`
2644
+ `[LiveLayer] fill_form: no field "${H}" in form "${L}". Skipping.`
2644
2645
  );
2645
2646
  continue;
2646
2647
  }
@@ -2651,7 +2652,7 @@ const Qr = /* @__PURE__ */ new Set([
2651
2652
  continue;
2652
2653
  }
2653
2654
  try {
2654
- Vr(j, U);
2655
+ Gr(j, U);
2655
2656
  } catch (O) {
2656
2657
  console.warn(
2657
2658
  `[LiveLayer] fill_form: failed to set "${H}".`,
@@ -2667,18 +2668,18 @@ const Qr = /* @__PURE__ */ new Set([
2667
2668
  return;
2668
2669
  }
2669
2670
  if (typeof document > "u") return;
2670
- const k = typeof p.formId == "string" ? p.formId : null;
2671
- if (!k) {
2671
+ const L = typeof p.formId == "string" ? p.formId : null;
2672
+ if (!L) {
2672
2673
  console.warn("[LiveLayer] submit_form: missing formId.");
2673
2674
  return;
2674
2675
  }
2675
2676
  h.current.playConfirmation();
2676
2677
  const P = document.querySelector(
2677
- `[data-ll-form="${k.replace(/"/g, '\\"')}"]`
2678
+ `[data-ll-form="${L.replace(/"/g, '\\"')}"]`
2678
2679
  );
2679
2680
  if (!P) {
2680
2681
  console.warn(
2681
- `[LiveLayer] submit_form: no form with data-ll-form="${k}".`
2682
+ `[LiveLayer] submit_form: no form with data-ll-form="${L}".`
2682
2683
  );
2683
2684
  return;
2684
2685
  }
@@ -2688,18 +2689,18 @@ const Qr = /* @__PURE__ */ new Set([
2688
2689
  );
2689
2690
  return;
2690
2691
  }
2691
- const W = typeof p.requestId == "string" ? p.requestId : void 0, H = (ge = ue.current) == null ? void 0 : ge.call(ue), U = (K) => {
2692
+ const W = typeof p.requestId == "string" ? p.requestId : void 0, H = (ye = pe.current) == null ? void 0 : ye.call(pe), U = (K) => {
2692
2693
  const Q = H, We = Q == null ? void 0 : Q.localParticipant;
2693
2694
  if (We != null && We.publishData)
2694
2695
  try {
2695
- const An = W ? { ...K, requestId: W } : K, Rn = new TextEncoder().encode(JSON.stringify(An));
2696
- We.publishData(Rn, { reliable: !0 });
2696
+ const Tn = W ? { ...K, requestId: W } : K, Mn = new TextEncoder().encode(JSON.stringify(Tn));
2697
+ We.publishData(Mn, { reliable: !0 });
2697
2698
  } catch {
2698
2699
  }
2699
2700
  };
2700
2701
  let j = !1;
2701
2702
  const O = () => {
2702
- j = !0, U({ type: "form_submitted", formId: k });
2703
+ j = !0, U({ type: "form_submitted", formId: L });
2703
2704
  };
2704
2705
  P.addEventListener("submit", O, { once: !0 });
2705
2706
  try {
@@ -2707,7 +2708,7 @@ const Qr = /* @__PURE__ */ new Set([
2707
2708
  } catch (K) {
2708
2709
  console.warn("[LiveLayer] submit_form: requestSubmit threw.", K), P.removeEventListener("submit", O), U({
2709
2710
  type: "form_submit_blocked",
2710
- formId: k,
2711
+ formId: L,
2711
2712
  reason: "exception"
2712
2713
  });
2713
2714
  return;
@@ -2715,7 +2716,7 @@ const Qr = /* @__PURE__ */ new Set([
2715
2716
  setTimeout(() => {
2716
2717
  j || (P.removeEventListener("submit", O), U({
2717
2718
  type: "form_submit_blocked",
2718
- formId: k,
2719
+ formId: L,
2719
2720
  reason: "validation"
2720
2721
  }));
2721
2722
  }, 500);
@@ -2726,16 +2727,16 @@ const Qr = /* @__PURE__ */ new Set([
2726
2727
  Ne("request_routes", "read_page");
2727
2728
  return;
2728
2729
  }
2729
- const k = typeof p.requestId == "string" ? p.requestId : void 0, W = (nt = ue.current) == null ? void 0 : nt.call(ue), H = W == null ? void 0 : W.localParticipant;
2730
+ const L = typeof p.requestId == "string" ? p.requestId : void 0, W = (nt = pe.current) == null ? void 0 : nt.call(pe), H = W == null ? void 0 : W.localParticipant;
2730
2731
  if (!(H != null && H.publishData)) return;
2731
2732
  const U = (O) => {
2732
2733
  try {
2733
- const K = k ? { type: "routes", routes: O, requestId: k } : { type: "routes", routes: O }, Q = new TextEncoder().encode(JSON.stringify(K));
2734
+ const K = L ? { type: "routes", routes: O, requestId: L } : { type: "routes", routes: O }, Q = new TextEncoder().encode(JSON.stringify(K));
2734
2735
  H.publishData(Q, { reliable: !0 });
2735
2736
  } catch (K) {
2736
2737
  console.warn("[LiveLayer] request_routes: publishData failed.", K);
2737
2738
  }
2738
- }, j = Mt.current;
2739
+ }, j = Tt.current;
2739
2740
  if (j) {
2740
2741
  try {
2741
2742
  const O = j(), K = (Q) => {
@@ -2743,7 +2744,7 @@ const Qr = /* @__PURE__ */ new Set([
2743
2744
  U([]);
2744
2745
  return;
2745
2746
  }
2746
- U(Q.map(Wr).slice(0, 200));
2747
+ U(Q.map(qr).slice(0, 200));
2747
2748
  };
2748
2749
  O instanceof Promise ? O.then(K).catch((Q) => {
2749
2750
  console.warn(
@@ -2766,52 +2767,52 @@ const Qr = /* @__PURE__ */ new Set([
2766
2767
  }
2767
2768
  return;
2768
2769
  }
2769
- Qr.has(p.type) || Me == null || Me(p);
2770
+ ei.has(p.type) || Te == null || Te(p);
2770
2771
  }
2771
2772
  },
2772
- [Me, Ie]
2773
- ), J = Wn({
2774
- agentId: $ ? "__controlled__" : Ke,
2773
+ [Te, Ie]
2774
+ ), J = qn({
2775
+ agentId: z ? "__controlled__" : Xe,
2775
2776
  baseUrl: l,
2776
2777
  apiKey: o,
2777
2778
  sessionEndpoint: s,
2778
2779
  sessionBody: a,
2779
- onDataMessage: $ ? void 0 : Ze
2780
+ onDataMessage: z ? void 0 : et
2780
2781
  });
2781
- I(() => {
2782
- if ($ != null && $.subscribeToDataMessages)
2783
- return $.subscribeToDataMessages(Ze);
2784
- }, [$, Ze]), ue.current = () => {
2782
+ T(() => {
2783
+ if (z != null && z.subscribeToDataMessages)
2784
+ return z.subscribeToDataMessages(et);
2785
+ }, [z, et]), pe.current = () => {
2785
2786
  var g;
2786
2787
  return (g = J.getRoom) == null ? void 0 : g.call(J);
2787
- }, I(() => {
2788
+ }, T(() => {
2788
2789
  var Y;
2789
2790
  if (typeof window > "u") return;
2790
2791
  const g = ((Y = window.location) == null ? void 0 : Y.hostname) || "";
2791
2792
  if (g === "localhost" || g === "127.0.0.1" || g === "0.0.0.0" || g.endsWith(".local") || g.endsWith(".test"))
2792
- return window.__livelayerSimulateCommand = (le) => {
2793
+ return window.__livelayerSimulateCommand = (ae) => {
2793
2794
  try {
2794
- Ze(le);
2795
- } catch (ge) {
2796
- console.warn("[LiveLayer] simulate-command threw:", ge);
2795
+ et(ae);
2796
+ } catch (ye) {
2797
+ console.warn("[LiveLayer] simulate-command threw:", ye);
2797
2798
  }
2798
2799
  }, () => {
2799
2800
  delete window.__livelayerSimulateCommand;
2800
2801
  };
2801
- }, [Ze]);
2802
- const w = Ue(() => $ ? {
2803
- connectionState: $.connectionState,
2804
- agentState: $.agentState,
2805
- transcript: $.transcript,
2806
- videoElement: $.videoElement,
2807
- audioElement: $.audioElement,
2808
- canResume: $.canResume,
2809
- error: $.error,
2802
+ }, [et]);
2803
+ const w = je(() => z ? {
2804
+ connectionState: z.connectionState,
2805
+ agentState: z.agentState,
2806
+ transcript: z.transcript,
2807
+ videoElement: z.videoElement,
2808
+ audioElement: z.audioElement,
2809
+ canResume: z.canResume,
2810
+ error: z.error,
2810
2811
  agentConfig: null,
2811
2812
  connect: async () => {
2812
- await $.onConnect();
2813
+ await z.onConnect();
2813
2814
  },
2814
- disconnect: () => $.onDisconnect(),
2815
+ disconnect: () => z.onDisconnect(),
2815
2816
  // Dummy getRoom for shape compatibility — controlled consumers own the Room.
2816
2817
  // Internal session's getRoom returns null when no real connect has happened,
2817
2818
  // so we reuse its reference for type consistency.
@@ -2830,43 +2831,43 @@ const Qr = /* @__PURE__ */ new Set([
2830
2831
  disconnect: J.disconnect,
2831
2832
  getRoom: J.getRoom,
2832
2833
  isControlled: !1
2833
- }, [$, J]), Tt = A(w);
2834
- Tt.current = w;
2835
- const Dt = A($);
2836
- Dt.current = $, Tn(
2834
+ }, [z, J]), Mt = A(w);
2835
+ Mt.current = w;
2836
+ const Dt = A(z);
2837
+ Dt.current = z, $n(
2837
2838
  r,
2838
2839
  () => ({
2839
2840
  sendData: async (g) => {
2840
- var ge, nt;
2841
+ var ye, nt;
2841
2842
  const p = Dt.current;
2842
2843
  if (p != null && p.publishData) {
2843
2844
  try {
2844
2845
  await p.publishData(g);
2845
- } catch (k) {
2846
- console.warn("[AvatarWidget] sendData (controlled) failed:", k);
2846
+ } catch (L) {
2847
+ console.warn("[AvatarWidget] sendData (controlled) failed:", L);
2847
2848
  }
2848
2849
  return;
2849
2850
  }
2850
- const Y = (nt = (ge = Tt.current) == null ? void 0 : ge.getRoom) == null ? void 0 : nt.call(ge), le = Y == null ? void 0 : Y.localParticipant;
2851
- if (le != null && le.publishData)
2851
+ const Y = (nt = (ye = Mt.current) == null ? void 0 : ye.getRoom) == null ? void 0 : nt.call(ye), ae = Y == null ? void 0 : Y.localParticipant;
2852
+ if (ae != null && ae.publishData)
2852
2853
  try {
2853
- const k = new TextEncoder().encode(JSON.stringify(g));
2854
- await le.publishData(k, { reliable: !0 });
2855
- } catch (k) {
2856
- console.warn("[AvatarWidget] sendData failed:", k);
2854
+ const L = new TextEncoder().encode(JSON.stringify(g));
2855
+ await ae.publishData(L, { reliable: !0 });
2856
+ } catch (L) {
2857
+ console.warn("[AvatarWidget] sendData failed:", L);
2857
2858
  }
2858
2859
  }
2859
2860
  }),
2860
2861
  []
2861
2862
  );
2862
2863
  const Pt = A(null);
2863
- I(() => {
2864
+ T(() => {
2864
2865
  const g = w.videoElement, p = Pt.current;
2865
2866
  if (!(!g || !p))
2866
2867
  return p.appendChild(g), () => {
2867
2868
  g.parentNode === p && p.removeChild(g);
2868
2869
  };
2869
- }, [w.videoElement]), I(() => {
2870
+ }, [w.videoElement]), T(() => {
2870
2871
  const g = w.audioElement;
2871
2872
  if (!g) return;
2872
2873
  ke.attach(g);
@@ -2876,7 +2877,7 @@ const Qr = /* @__PURE__ */ new Set([
2876
2877
  }), () => {
2877
2878
  ke.detach();
2878
2879
  };
2879
- }, [w.audioElement]), I(() => {
2880
+ }, [w.audioElement]), T(() => {
2880
2881
  if (w.isControlled || w.connectionState !== "connected") return;
2881
2882
  const g = w.getRoom();
2882
2883
  if (g)
@@ -2884,23 +2885,23 @@ const Qr = /* @__PURE__ */ new Set([
2884
2885
  }), () => {
2885
2886
  G.teardownMic();
2886
2887
  };
2887
- }, [w.isControlled, w.connectionState]), I(() => {
2888
+ }, [w.isControlled, w.connectionState]), T(() => {
2888
2889
  var p;
2889
2890
  if (w.connectionState !== "connected") return;
2890
- const g = w.isControlled ? (p = $ == null ? void 0 : $.getRoom) == null ? void 0 : p.call($) : w.getRoom();
2891
+ const g = w.isControlled ? (p = z == null ? void 0 : z.getRoom) == null ? void 0 : p.call(z) : w.getRoom();
2891
2892
  if (g)
2892
- return ne.attachRoom(g), Le.attachRoom(g), w.isControlled && G.attachRoom(g), Xe.refresh(), () => {
2893
- ne.teardown(), Le.teardown();
2893
+ return re.attachRoom(g), Le.attachRoom(g), w.isControlled && G.attachRoom(g), Qe.refresh(), () => {
2894
+ re.teardown(), Le.teardown();
2894
2895
  };
2895
- }, [w.isControlled, w.connectionState, $]), I(() => {
2896
+ }, [w.isControlled, w.connectionState, z]), T(() => {
2896
2897
  const g = w.audioElement;
2897
- g && (g.muted = He);
2898
- }, [w.audioElement, He]);
2899
- const vn = E((g) => {
2898
+ g && (g.muted = Oe);
2899
+ }, [w.audioElement, Oe]);
2900
+ const wn = E((g) => {
2900
2901
  const p = { type: "user_message", text: g };
2901
- if ($ != null && $.publishData) {
2902
+ if (z != null && z.publishData) {
2902
2903
  try {
2903
- $.publishData(p);
2904
+ z.publishData(p);
2904
2905
  } catch {
2905
2906
  }
2906
2907
  return;
@@ -2908,182 +2909,200 @@ const Qr = /* @__PURE__ */ new Set([
2908
2909
  const Y = w.getRoom();
2909
2910
  if (Y)
2910
2911
  try {
2911
- const le = new TextEncoder().encode(JSON.stringify(p));
2912
- Y.localParticipant.publishData(le, { reliable: !0 });
2912
+ const ae = new TextEncoder().encode(JSON.stringify(p));
2913
+ Y.localParticipant.publishData(ae, { reliable: !0 });
2913
2914
  } catch {
2914
2915
  }
2915
- }, [w, $]), bn = E(() => {
2916
+ }, [w, z]), _n = E(() => {
2916
2917
  _t((g) => !g);
2917
2918
  }, []);
2918
- I(() => {
2919
+ T(() => {
2919
2920
  $e == null || $e(w.connectionState), w.connectionState === "connected" ? De == null || De() : w.connectionState === "disconnected" && (Ae == null || Ae());
2920
- }, [w.connectionState, De, Ae, $e]), I(() => {
2921
+ }, [w.connectionState, De, Ae, $e]), T(() => {
2921
2922
  Pe == null || Pe(w.transcript);
2922
- }, [w.transcript, Pe]), I(() => {
2923
+ }, [w.transcript, Pe]), T(() => {
2923
2924
  Re == null || Re(w.agentState);
2924
- }, [w.agentState, Re]), I(() => {
2925
- Te.setThinking(w.agentState === "thinking");
2926
- }, [w.agentState, Te]);
2925
+ }, [w.agentState, Re]), T(() => {
2926
+ Me.setThinking(w.agentState === "thinking");
2927
+ }, [w.agentState, Me]);
2927
2928
  const $t = A(!1);
2928
- I(() => {
2929
- w.isControlled || !_ || $t.current || _e && w.connectionState === "idle" && ($t.current = !0, w.connect());
2930
- }, [_, w.connectionState, w, _e]);
2931
- const wn = E(
2929
+ T(() => {
2930
+ w.isControlled || !_ || $t.current || xe && w.connectionState === "idle" && ($t.current = !0, w.connect());
2931
+ }, [_, w.connectionState, w, xe]);
2932
+ const xn = E(
2932
2933
  (g) => {
2933
2934
  const p = S == null ? void 0 : S.find((Y) => Y.id === g);
2934
- p && (de(!1), g !== ce && (ut(!0), w.disconnect(), te || Je(g), z == null || z(p)));
2935
+ p && (fe(!1), g !== se && (ut(!0), w.disconnect(), te || Ke(g), D == null || D(p)));
2935
2936
  },
2936
2937
  [
2937
2938
  S,
2938
- ce,
2939
+ se,
2939
2940
  w,
2940
2941
  te,
2941
- z
2942
+ D
2942
2943
  ]
2943
2944
  );
2944
- I(() => {
2945
- Oe && w.connectionState === "connected" && ut(!1);
2946
- }, [w.connectionState, Oe]), I(() => {
2947
- if (!Qe) return;
2945
+ T(() => {
2946
+ ze && w.connectionState === "connected" && ut(!1);
2947
+ }, [w.connectionState, ze]), T(() => {
2948
+ if (!Ze) return;
2948
2949
  const g = (p) => {
2949
- p.key === "Escape" && de(!1);
2950
+ p.key === "Escape" && fe(!1);
2950
2951
  };
2951
2952
  return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
2952
- }, [Qe]);
2953
- const _n = !!B || !!(X != null && X.avatarImageUrl) || w.isControlled, et = Yn(Ke, l, _n);
2954
- Ge === void 0 && ((Ot = et.info) != null && Ot.capabilities) && (Et.current = et.info.capabilities);
2955
- const pt = (X == null ? void 0 : X.name) ?? q ?? ((Ht = w.agentConfig) == null ? void 0 : Ht.name) ?? ((Wt = et.info) == null ? void 0 : Wt.name) ?? "Live Layer", Ct = (X == null ? void 0 : X.avatarImageUrl) ?? B ?? ((Bt = w.agentConfig) == null ? void 0 : Bt.avatarImageUrl) ?? ((qt = et.info) == null ? void 0 : qt.avatarImageUrl) ?? null, xn = x ?? ((Ft = w.agentConfig) == null ? void 0 : Ft.idleLoopUrl) ?? ((Ut = et.info) == null ? void 0 : Ut.idleLoopUrl) ?? null, kn = T ?? null, Ln = E(() => se("expanded"), [se]), En = E(
2956
- () => se("minimized"),
2957
- [se]
2953
+ }, [Ze]);
2954
+ const kn = !!B || !!(X != null && X.avatarImageUrl) || w.isControlled, tt = Jn(Xe, l, kn);
2955
+ Je === void 0 && ((Ht = tt.info) != null && Ht.capabilities) && (Et.current = tt.info.capabilities);
2956
+ const pt = (X == null ? void 0 : X.name) ?? q ?? ((Wt = w.agentConfig) == null ? void 0 : Wt.name) ?? ((Bt = tt.info) == null ? void 0 : Bt.name) ?? "Live Layer", Ct = (X == null ? void 0 : X.avatarImageUrl) ?? B ?? ((qt = w.agentConfig) == null ? void 0 : qt.avatarImageUrl) ?? ((Ft = tt.info) == null ? void 0 : Ft.avatarImageUrl) ?? null, Ln = x ?? ((Ut = w.agentConfig) == null ? void 0 : Ut.idleLoopUrl) ?? ((jt = tt.info) == null ? void 0 : jt.idleLoopUrl) ?? null, En = R ?? null, Cn = E(() => de("expanded"), [de]), Sn = E(
2957
+ () => de("minimized"),
2958
+ [de]
2958
2959
  ), zt = E(() => {
2959
- w.disconnect(), se("hidden");
2960
- }, [w, se]), Cn = E(() => {
2960
+ w.disconnect(), de("hidden");
2961
+ }, [w, de]), Nn = E(() => {
2961
2962
  const g = w.audioElement;
2962
2963
  g && g.play().then(() => Ee(!1)).catch(() => {
2963
2964
  });
2964
- }, [w.audioElement]), Sn = E(() => {
2965
+ }, [w.audioElement]), An = E(() => {
2965
2966
  Ee(!1), w.connect();
2966
- }, [w]), tt = {
2967
- ...dt,
2968
- ...ze ? {} : { zIndex: vt }
2967
+ }, [w]), He = {
2968
+ ...st,
2969
+ ...dt ? {} : { zIndex: vt }
2969
2970
  };
2970
- N.primaryColor && (tt["--ll-color-primary"] = N.primaryColor), N.accentColor && (tt["--ll-color-accent"] = N.accentColor), N.backgroundColor && (tt["--ll-color-bg"] = N.backgroundColor), N.textColor && (tt["--ll-color-fg"] = N.textColor);
2971
- const Nn = [
2971
+ N.primaryColor && (He["--ll-color-primary"] = N.primaryColor), N.accentColor && (He["--ll-color-accent"] = N.accentColor), N.backgroundColor && (He["--ll-color-bg"] = N.backgroundColor), N.textColor && (He["--ll-color-fg"] = N.textColor);
2972
+ const Rn = [
2972
2973
  "ll-widget",
2973
- `ll-widget--${xe}`,
2974
- `ll-widget--${me ? "mobile" : "desktop"}`,
2975
- st
2974
+ `ll-widget--${ne}`,
2975
+ `ll-widget--${ue ? "mobile" : "desktop"}`,
2976
+ ct
2976
2977
  ].filter(Boolean).join(" ");
2977
- return _e ? /* @__PURE__ */ v(
2978
+ if (!xe) return null;
2979
+ const In = /* @__PURE__ */ n(
2978
2980
  "div",
2979
2981
  {
2980
- className: Nn,
2981
- style: tt,
2982
- "data-display-mode": xe,
2983
- "data-position": L,
2982
+ className: Rn,
2983
+ style: He,
2984
+ "data-display-mode": ne,
2985
+ "data-position": k,
2984
2986
  "data-experience-mode": f === "EMBEDDED" ? "embedded" : "widget",
2987
+ children: ne === "expanded" && /* @__PURE__ */ n(
2988
+ Ar,
2989
+ {
2990
+ position: k,
2991
+ isMobile: ue,
2992
+ agentName: pt,
2993
+ avatarImageUrl: Ct,
2994
+ idleLoopUrl: Ln,
2995
+ greeting: En,
2996
+ branding: N,
2997
+ teamMembers: S,
2998
+ currentTeamMemberId: se,
2999
+ isSwitchingTeamMember: ze,
3000
+ teamSwitcherOpen: Ze,
3001
+ onToggleTeamSwitcher: () => fe((g) => !g),
3002
+ onSelectTeamMember: xn,
3003
+ connectionState: w.connectionState,
3004
+ agentState: w.agentState,
3005
+ transcript: w.transcript,
3006
+ isMuted: G.isMuted,
3007
+ micDevices: Qe.mics,
3008
+ activeMicId: G.activeDeviceId,
3009
+ isCameraEnabled: re.isEnabled,
3010
+ cameraPreviewEl: re.previewEl,
3011
+ cameraDevices: Qe.cameras,
3012
+ activeCameraId: re.activeDeviceId,
3013
+ isScreenShareEnabled: Le.isEnabled,
3014
+ screenPreviewEl: Le.previewEl,
3015
+ isSpeakerMuted: Oe,
3016
+ allowCamera: M,
3017
+ allowScreenShare: F,
3018
+ allowTyping: ie,
3019
+ showMinimize: oe,
3020
+ chromeless: Z,
3021
+ compactControls: ce,
3022
+ transforming: he,
3023
+ transformingLabel: be,
3024
+ languageMenuOpen: Ce,
3025
+ onToggleLanguageMenu: () => ft((g) => !g),
3026
+ needsUserGesture: wt,
3027
+ canResume: w.canResume,
3028
+ micError: G.micError,
3029
+ error: w.error,
3030
+ avatarVideoContainerRef: Pt,
3031
+ agentVideoEl: w.videoElement,
3032
+ onConnect: () => void w.connect(),
3033
+ onDisconnect: () => w.disconnect(),
3034
+ onRetry: An,
3035
+ onResumeAudio: Nn,
3036
+ onToggleMute: G.toggleMute,
3037
+ onSwitchMicDevice: (g) => void G.switchDevice(g),
3038
+ onToggleCamera: () => void re.toggle(),
3039
+ onSwitchCameraDevice: (g) => void re.switchDevice(g),
3040
+ onToggleScreenShare: () => void Le.toggle(),
3041
+ onToggleSpeaker: _n,
3042
+ onSendMessage: wn,
3043
+ onMinimize: Sn,
3044
+ onClose: zt,
3045
+ onClearMicError: G.clearError
3046
+ }
3047
+ )
3048
+ }
3049
+ ), Ot = ne === "hidden" || ne === "minimized" ? /* @__PURE__ */ y(
3050
+ "div",
3051
+ {
3052
+ className: [
3053
+ "ll-widget",
3054
+ "ll-widget--floating",
3055
+ `ll-widget--${ne}`,
3056
+ `ll-widget--${ue ? "mobile" : "desktop"}`
3057
+ ].join(" "),
3058
+ style: He,
3059
+ "data-display-mode": ne,
3060
+ "data-position": k,
2985
3061
  children: [
2986
- xe === "hidden" && /* @__PURE__ */ n(
2987
- vr,
3062
+ ne === "hidden" && /* @__PURE__ */ n(
3063
+ wr,
2988
3064
  {
2989
- position: L,
2990
- isMobile: me,
3065
+ position: k,
3066
+ isMobile: ue,
2991
3067
  isSpeaking: w.agentState === "speaking",
2992
- onExpand: () => se("expanded"),
3068
+ onExpand: () => de("expanded"),
2993
3069
  label: `Open ${pt} widget`,
2994
3070
  avatarImageUrl: Ct,
2995
3071
  agentName: pt
2996
3072
  }
2997
3073
  ),
2998
- xe === "minimized" && /* @__PURE__ */ n(
2999
- wr,
3074
+ ne === "minimized" && /* @__PURE__ */ n(
3075
+ xr,
3000
3076
  {
3001
- position: L,
3002
- isMobile: me,
3077
+ position: k,
3078
+ isMobile: ue,
3003
3079
  agentName: pt,
3004
3080
  avatarImageUrl: Ct,
3005
3081
  agentState: w.agentState,
3006
3082
  isMuted: G.isMuted,
3007
3083
  audioLevel: ke,
3008
- onExpand: Ln,
3084
+ onExpand: Cn,
3009
3085
  onToggleMute: G.toggleMute,
3010
3086
  onClose: zt
3011
3087
  }
3012
- ),
3013
- xe === "expanded" && /* @__PURE__ */ n(
3014
- Sr,
3015
- {
3016
- position: L,
3017
- isMobile: me,
3018
- agentName: pt,
3019
- avatarImageUrl: Ct,
3020
- idleLoopUrl: xn,
3021
- greeting: kn,
3022
- branding: N,
3023
- teamMembers: S,
3024
- currentTeamMemberId: ce,
3025
- isSwitchingTeamMember: Oe,
3026
- teamSwitcherOpen: Qe,
3027
- onToggleTeamSwitcher: () => de((g) => !g),
3028
- onSelectTeamMember: wn,
3029
- connectionState: w.connectionState,
3030
- agentState: w.agentState,
3031
- transcript: w.transcript,
3032
- isMuted: G.isMuted,
3033
- micDevices: Xe.mics,
3034
- activeMicId: G.activeDeviceId,
3035
- isCameraEnabled: ne.isEnabled,
3036
- cameraPreviewEl: ne.previewEl,
3037
- cameraDevices: Xe.cameras,
3038
- activeCameraId: ne.activeDeviceId,
3039
- isScreenShareEnabled: Le.isEnabled,
3040
- screenPreviewEl: Le.previewEl,
3041
- isSpeakerMuted: He,
3042
- allowCamera: M,
3043
- allowScreenShare: F,
3044
- allowTyping: re,
3045
- showMinimize: ie,
3046
- chromeless: Z,
3047
- compactControls: ae,
3048
- transforming: fe,
3049
- transformingLabel: ve,
3050
- languageMenuOpen: Ce,
3051
- onToggleLanguageMenu: () => ft((g) => !g),
3052
- needsUserGesture: wt,
3053
- canResume: w.canResume,
3054
- micError: G.micError,
3055
- error: w.error,
3056
- avatarVideoContainerRef: Pt,
3057
- agentVideoEl: w.videoElement,
3058
- onConnect: () => void w.connect(),
3059
- onDisconnect: () => w.disconnect(),
3060
- onRetry: Sn,
3061
- onResumeAudio: Cn,
3062
- onToggleMute: G.toggleMute,
3063
- onSwitchMicDevice: (g) => void G.switchDevice(g),
3064
- onToggleCamera: () => void ne.toggle(),
3065
- onSwitchCameraDevice: (g) => void ne.switchDevice(g),
3066
- onToggleScreenShare: () => void Le.toggle(),
3067
- onToggleSpeaker: bn,
3068
- onSendMessage: vn,
3069
- onMinimize: En,
3070
- onClose: zt,
3071
- onClearMicError: G.clearError
3072
- }
3073
3088
  )
3074
3089
  ]
3075
3090
  }
3076
3091
  ) : null;
3092
+ return /* @__PURE__ */ y(Ue, { children: [
3093
+ In,
3094
+ Ot && typeof document < "u" && un(Ot, document.body)
3095
+ ] });
3077
3096
  }
3078
3097
  );
3079
- yn.displayName = "AvatarWidgetInner";
3080
- const Zr = lt(
3098
+ bn.displayName = "AvatarWidgetInner";
3099
+ const ti = ot(
3081
3100
  function(t, r) {
3082
- return /* @__PURE__ */ n(Hn, { children: /* @__PURE__ */ n(yn, { ...t, ref: r }) });
3101
+ return /* @__PURE__ */ n(Bn, { children: /* @__PURE__ */ n(bn, { ...t, ref: r }) });
3083
3102
  }
3084
3103
  );
3085
- Zr.displayName = "AvatarWidget";
3086
- const ci = ({
3104
+ ti.displayName = "AvatarWidget";
3105
+ const ui = ({
3087
3106
  agentId: e,
3088
3107
  baseUrl: t,
3089
3108
  apiKey: r,
@@ -3095,23 +3114,23 @@ const ci = ({
3095
3114
  const a = A(null), d = A(null), f = A(o);
3096
3115
  f.current = o;
3097
3116
  const _ = E((u) => {
3098
- var R;
3117
+ var I;
3099
3118
  const c = u.detail;
3100
- (R = f.current) == null || R.call(f, c);
3119
+ (I = f.current) == null || I.call(f, c);
3101
3120
  }, []);
3102
- return I(() => {
3121
+ return T(() => {
3103
3122
  const u = a.current;
3104
3123
  if (!u) return;
3105
3124
  const c = document.createElement("livelayer-widget");
3106
3125
  return c.setAttribute("agent-id", e), t && c.setAttribute("base-url", t), r && c.setAttribute("api-key", r), i && c.setAttribute("mode", i), c.addEventListener("agent-event", _), u.appendChild(c), d.current = c, () => {
3107
3126
  c.removeEventListener("agent-event", _), u.removeChild(c), d.current = null;
3108
3127
  };
3109
- }, [e]), I(() => {
3128
+ }, [e]), T(() => {
3110
3129
  d.current && (i ? d.current.setAttribute("mode", i) : d.current.removeAttribute("mode"));
3111
3130
  }, [i]), /* @__PURE__ */ n("div", { ref: a, className: l, style: s });
3112
- }, si = lt(
3131
+ }, fi = ot(
3113
3132
  function({ id: t, intent: r, as: i = "div", className: o, style: l, children: s }, a) {
3114
- return Dn(
3133
+ return zn(
3115
3134
  i,
3116
3135
  {
3117
3136
  ref: a,
@@ -3123,7 +3142,7 @@ const ci = ({
3123
3142
  s
3124
3143
  );
3125
3144
  }
3126
- ), di = lt(
3145
+ ), pi = ot(
3127
3146
  function({ id: t, intent: r, children: i, ...o }, l) {
3128
3147
  return /* @__PURE__ */ n(
3129
3148
  "form",
@@ -3136,7 +3155,7 @@ const ci = ({
3136
3155
  }
3137
3156
  );
3138
3157
  }
3139
- ), ui = lt(
3158
+ ), hi = ot(
3140
3159
  function(t, r) {
3141
3160
  const { name: i, label: o, labelClassName: l } = t, s = { name: i, "data-ll-field": i };
3142
3161
  let a;
@@ -3151,13 +3170,13 @@ const ci = ({
3151
3170
  }
3152
3171
  );
3153
3172
  } else if ("as" in t && t.as === "select") {
3154
- const { name: d, label: f, labelClassName: _, as: u, children: c, ...R } = t;
3173
+ const { name: d, label: f, labelClassName: _, as: u, children: c, ...I } = t;
3155
3174
  a = /* @__PURE__ */ n(
3156
3175
  "select",
3157
3176
  {
3158
3177
  ref: r,
3159
3178
  ...s,
3160
- ...R,
3179
+ ...I,
3161
3180
  children: c
3162
3181
  }
3163
3182
  );
@@ -3172,73 +3191,73 @@ const ci = ({
3172
3191
  }
3173
3192
  );
3174
3193
  }
3175
- return o === void 0 ? a : /* @__PURE__ */ v("label", { className: l, children: [
3194
+ return o === void 0 ? a : /* @__PURE__ */ y("label", { className: l, children: [
3176
3195
  o,
3177
3196
  a
3178
3197
  ] });
3179
3198
  }
3180
3199
  );
3181
- let sn = 1;
3182
- function fi({
3200
+ let dn = 1;
3201
+ function mi({
3183
3202
  onMount: e,
3184
3203
  defaultOpen: t = !1,
3185
3204
  storageKey: r = "ll-debug-open"
3186
3205
  }) {
3187
- const [i, o] = C(t), [l, s] = C([]), [a, d] = C(""), [f, _] = C(!1), u = A(/* @__PURE__ */ new Set()), c = A([]), R = A(f);
3188
- R.current = f, I(() => {
3206
+ const [i, o] = C(t), [l, s] = C([]), [a, d] = C(""), [f, _] = C(!1), u = A(/* @__PURE__ */ new Set()), c = A([]), I = A(f);
3207
+ I.current = f, T(() => {
3189
3208
  try {
3190
- const y = localStorage.getItem(r);
3191
- y === "1" && o(!0), y === "0" && o(!1);
3209
+ const v = localStorage.getItem(r);
3210
+ v === "1" && o(!0), v === "0" && o(!1);
3192
3211
  } catch {
3193
3212
  }
3194
- }, [r]), I(() => {
3213
+ }, [r]), T(() => {
3195
3214
  try {
3196
3215
  localStorage.setItem(r, i ? "1" : "0");
3197
3216
  } catch {
3198
3217
  }
3199
- }, [i, r]), I(() => {
3200
- const y = (m) => {
3218
+ }, [i, r]), T(() => {
3219
+ const v = (m) => {
3201
3220
  (m.metaKey || m.ctrlKey) && m.shiftKey && m.key.toLowerCase() === "l" && (m.preventDefault(), o((S) => !S));
3202
3221
  };
3203
- return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
3204
- }, []), I(() => {
3205
- const y = setInterval(() => {
3206
- if (c.current.length === 0 || R.current) return;
3222
+ return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
3223
+ }, []), T(() => {
3224
+ const v = setInterval(() => {
3225
+ if (c.current.length === 0 || I.current) return;
3207
3226
  const m = c.current.splice(0, c.current.length);
3208
3227
  s(
3209
3228
  (S) => [...m.reverse(), ...S].slice(0, 200)
3210
3229
  );
3211
3230
  }, 100);
3212
- return () => clearInterval(y);
3231
+ return () => clearInterval(v);
3213
3232
  }, []);
3214
- const L = A(!1);
3215
- if (I(() => {
3216
- !e || L.current || (L.current = !0, e((y) => {
3233
+ const k = A(!1);
3234
+ if (T(() => {
3235
+ !e || k.current || (k.current = !0, e((v) => {
3217
3236
  c.current.push({
3218
- id: sn++,
3237
+ id: dn++,
3219
3238
  ts: Date.now(),
3220
3239
  kind: "event",
3221
- type: y.eventName,
3222
- data: y.data
3240
+ type: v.eventName,
3241
+ data: v.data
3223
3242
  });
3224
3243
  }));
3225
- }, [e]), I(() => {
3226
- const y = console.warn, m = console.log, S = (D, z) => function(...x) {
3244
+ }, [e]), T(() => {
3245
+ const v = console.warn, m = console.log, S = ($, D) => function(...x) {
3227
3246
  try {
3228
- const T = typeof x[0] == "string" ? x[0] : "";
3229
- T.startsWith("[LiveLayer]") && c.current.push({
3230
- id: sn++,
3247
+ const R = typeof x[0] == "string" ? x[0] : "";
3248
+ R.startsWith("[LiveLayer]") && c.current.push({
3249
+ id: dn++,
3231
3250
  ts: Date.now(),
3232
- kind: D,
3233
- type: T.slice(0, 120),
3234
- data: { args: x.slice(1).map((B) => ti(B)) }
3251
+ kind: $,
3252
+ type: R.slice(0, 120),
3253
+ data: { args: x.slice(1).map((B) => ri(B)) }
3235
3254
  });
3236
3255
  } catch {
3237
3256
  }
3238
- return z.apply(this, x);
3257
+ return D.apply(this, x);
3239
3258
  };
3240
- return console.warn = S("warn", y), console.log = S("log", m), () => {
3241
- console.warn = y, console.log = m;
3259
+ return console.warn = S("warn", v), console.log = S("log", m), () => {
3260
+ console.warn = v, console.log = m;
3242
3261
  };
3243
3262
  }, []), !i)
3244
3263
  return /* @__PURE__ */ n(
@@ -3267,12 +3286,12 @@ function fi({
3267
3286
  children: "🛰 LL debug"
3268
3287
  }
3269
3288
  );
3270
- const b = l.filter((y) => {
3289
+ const b = l.filter((v) => {
3271
3290
  if (!a) return !0;
3272
3291
  const m = a.toLowerCase();
3273
- return y.type.toLowerCase().includes(m) || JSON.stringify(y.data || {}).toLowerCase().includes(m);
3292
+ return v.type.toLowerCase().includes(m) || JSON.stringify(v.data || {}).toLowerCase().includes(m);
3274
3293
  });
3275
- return /* @__PURE__ */ v(
3294
+ return /* @__PURE__ */ y(
3276
3295
  "div",
3277
3296
  {
3278
3297
  style: {
@@ -3294,7 +3313,7 @@ function fi({
3294
3313
  overflow: "hidden"
3295
3314
  },
3296
3315
  children: [
3297
- /* @__PURE__ */ v(
3316
+ /* @__PURE__ */ y(
3298
3317
  "div",
3299
3318
  {
3300
3319
  style: {
@@ -3307,7 +3326,7 @@ function fi({
3307
3326
  },
3308
3327
  children: [
3309
3328
  /* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
3310
- /* @__PURE__ */ v("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
3329
+ /* @__PURE__ */ y("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
3311
3330
  l.length,
3312
3331
  " event",
3313
3332
  l.length === 1 ? "" : "s"
@@ -3317,7 +3336,7 @@ function fi({
3317
3336
  "button",
3318
3337
  {
3319
3338
  type: "button",
3320
- onClick: () => _((y) => !y),
3339
+ onClick: () => _((v) => !v),
3321
3340
  style: Nt(f ? "#f59e0b" : "transparent"),
3322
3341
  title: "Pause / resume capture",
3323
3342
  children: f ? "▶ resume" : "⏸ pause"
@@ -3354,7 +3373,7 @@ function fi({
3354
3373
  {
3355
3374
  type: "text",
3356
3375
  value: a,
3357
- onChange: (y) => d(y.target.value),
3376
+ onChange: (v) => d(v.target.value),
3358
3377
  placeholder: "filter by type or data…",
3359
3378
  style: {
3360
3379
  margin: 8,
@@ -3376,7 +3395,7 @@ function fi({
3376
3395
  overflowY: "auto",
3377
3396
  padding: "0 8px 8px"
3378
3397
  },
3379
- children: b.length === 0 ? /* @__PURE__ */ v(
3398
+ children: b.length === 0 ? /* @__PURE__ */ y(
3380
3399
  "div",
3381
3400
  {
3382
3401
  style: {
@@ -3406,16 +3425,16 @@ function fi({
3406
3425
  )
3407
3426
  ]
3408
3427
  }
3409
- ) : b.map((y) => /* @__PURE__ */ n(
3410
- ei,
3428
+ ) : b.map((v) => /* @__PURE__ */ n(
3429
+ ni,
3411
3430
  {
3412
- entry: y,
3413
- expanded: u.current.has(y.id),
3431
+ entry: v,
3432
+ expanded: u.current.has(v.id),
3414
3433
  onToggle: () => {
3415
- u.current.has(y.id) ? u.current.delete(y.id) : u.current.add(y.id), s((m) => [...m]);
3434
+ u.current.has(v.id) ? u.current.delete(v.id) : u.current.add(v.id), s((m) => [...m]);
3416
3435
  }
3417
3436
  },
3418
- y.id
3437
+ v.id
3419
3438
  ))
3420
3439
  }
3421
3440
  )
@@ -3423,7 +3442,7 @@ function fi({
3423
3442
  }
3424
3443
  );
3425
3444
  }
3426
- function ei({
3445
+ function ni({
3427
3446
  entry: e,
3428
3447
  expanded: t,
3429
3448
  onToggle: r
@@ -3431,7 +3450,7 @@ function ei({
3431
3450
  const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", o = new Date(e.ts).toLocaleTimeString("en-US", {
3432
3451
  hour12: !1
3433
3452
  });
3434
- return /* @__PURE__ */ v(
3453
+ return /* @__PURE__ */ y(
3435
3454
  "button",
3436
3455
  {
3437
3456
  type: "button",
@@ -3449,7 +3468,7 @@ function ei({
3449
3468
  lineHeight: 1.4
3450
3469
  },
3451
3470
  children: [
3452
- /* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
3471
+ /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
3453
3472
  /* @__PURE__ */ n(
3454
3473
  "span",
3455
3474
  {
@@ -3504,14 +3523,14 @@ function Nt(e) {
3504
3523
  cursor: "pointer"
3505
3524
  };
3506
3525
  }
3507
- function ti(e) {
3526
+ function ri(e) {
3508
3527
  try {
3509
3528
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
3510
3529
  } catch {
3511
3530
  return String(e);
3512
3531
  }
3513
3532
  }
3514
- function pi() {
3533
+ function gi() {
3515
3534
  const [e, t] = C([]), r = E((o) => {
3516
3535
  t((l) => {
3517
3536
  const s = l.findIndex((a) => a.id === o.id);
@@ -3530,33 +3549,33 @@ function pi() {
3530
3549
  };
3531
3550
  }
3532
3551
  export {
3533
- Zr as AvatarWidget,
3534
- Hn as ErrorBoundary,
3535
- fi as LiveLayerDebugPanel,
3536
- ui as LiveLayerField,
3537
- di as LiveLayerForm,
3538
- si as LiveLayerRegion,
3539
- ci as LiveLayerWidget,
3540
- Or as clearPageContextCache,
3541
- Ur as clearRoutesCache,
3542
- zr as extractPageContext,
3543
- qr as extractRoutes,
3544
- an as getCachedPageContext,
3552
+ ti as AvatarWidget,
3553
+ Bn as ErrorBoundary,
3554
+ mi as LiveLayerDebugPanel,
3555
+ hi as LiveLayerField,
3556
+ pi as LiveLayerForm,
3557
+ fi as LiveLayerRegion,
3558
+ ui as LiveLayerWidget,
3559
+ Wr as clearPageContextCache,
3560
+ Vr as clearRoutesCache,
3561
+ Hr as extractPageContext,
3562
+ Ur as extractRoutes,
3563
+ cn as getCachedPageContext,
3545
3564
  St as getCachedRoutes,
3546
- cr as matchesPattern,
3547
- Wr as normalizeRouteInput,
3548
- sr as shouldRenderAtPath,
3549
- Yn as useAgentInfo,
3550
- Bn as useAudioLevel,
3551
- Un as useCameraState,
3552
- Kn as useDisplayMode,
3553
- Zn as useDisplayModePersistence,
3554
- tr as useIsMobile,
3555
- Wn as useLiveKitSession,
3556
- Vn as useMediaDevices,
3557
- qn as useMicrophoneState,
3558
- rr as usePathname,
3559
- dr as useRouteMatch,
3560
- jn as useScreenShareState,
3561
- pi as useTranscript
3565
+ dr as matchesPattern,
3566
+ qr as normalizeRouteInput,
3567
+ ur as shouldRenderAtPath,
3568
+ Jn as useAgentInfo,
3569
+ Fn as useAudioLevel,
3570
+ Vn as useCameraState,
3571
+ Qn as useDisplayMode,
3572
+ tr as useDisplayModePersistence,
3573
+ rr as useIsMobile,
3574
+ qn as useLiveKitSession,
3575
+ Gn as useMediaDevices,
3576
+ Un as useMicrophoneState,
3577
+ or as usePathname,
3578
+ fr as useRouteMatch,
3579
+ Yn as useScreenShareState,
3580
+ gi as useTranscript
3562
3581
  };