@livelayer/react 0.10.3 → 0.10.5

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