@livelayer/react 0.5.9 → 0.5.11

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,8 +1,8 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as n, Fragment as ut } from "react/jsx-runtime";
3
- import { Component as dn, useState as S, useRef as E, useEffect as T, useCallback as k, useMemo as Ze, forwardRef as ft, createElement as un } from "react";
2
+ import { jsxs as _, jsx as n, Fragment as ht } from "react/jsx-runtime";
3
+ import { Component as dn, useState as L, useRef as E, useEffect as R, useCallback as k, useMemo as ot, forwardRef as mt, createElement as un } from "react";
4
4
  import { LiveKitSession as fn } from "@livelayer/sdk";
5
- import { createLocalAudioTrack as pn, Track as jt, createLocalVideoTrack as hn } from "livekit-client";
5
+ import { createLocalAudioTrack as pn, Track as Gt, createLocalVideoTrack as hn } from "livekit-client";
6
6
  class mn extends dn {
7
7
  constructor() {
8
8
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
@@ -18,7 +18,7 @@ class mn extends dn {
18
18
  }
19
19
  render() {
20
20
  var t;
21
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ w("div", { className: "ll-error-boundary", role: "alert", children: [
21
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ _("div", { className: "ll-error-boundary", role: "alert", children: [
22
22
  /* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
23
23
  /* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
24
24
  /* @__PURE__ */ n(
@@ -34,8 +34,8 @@ class mn extends dn {
34
34
  }
35
35
  }
36
36
  function gn(e) {
37
- const [t, r] = S("idle"), [o, i] = S("idle"), [l, s] = S([]), [d, f] = S(null), [g, m] = S(null), [a, c] = S(null), [R, C] = S(!1), [L, v] = S(null), b = E(null), z = E(e.onDataMessage);
38
- z.current = e.onDataMessage, T(() => {
37
+ const [t, r] = L("idle"), [o, i] = L("idle"), [l, s] = L([]), [d, f] = L(null), [y, g] = L(null), [a, c] = L(null), [I, C] = L(!1), [S, v] = L(null), b = E(null), z = E(e.onDataMessage);
38
+ z.current = e.onDataMessage, R(() => {
39
39
  const N = {
40
40
  onConnectionStateChange: (D) => {
41
41
  r(D), D === "connected" && v(null);
@@ -44,15 +44,15 @@ function gn(e) {
44
44
  onTranscript: (D) => s([...D]),
45
45
  onAgentConfig: f,
46
46
  onAudioTrack: (D) => c(D),
47
- onVideoTrack: (D) => m(D),
48
- onVideoTrackRemoved: () => m(null),
47
+ onVideoTrack: (D) => g(D),
48
+ onVideoTrackRemoved: () => g(null),
49
49
  onError: (D) => v(D),
50
50
  onDataMessage: (D) => {
51
51
  var A;
52
52
  (A = z.current) == null || A.call(z, D);
53
53
  },
54
54
  onResumabilityChange: C
55
- }, B = new fn(
55
+ }, q = new fn(
56
56
  {
57
57
  agentId: e.agentId,
58
58
  baseUrl: e.baseUrl,
@@ -62,9 +62,9 @@ function gn(e) {
62
62
  },
63
63
  N
64
64
  );
65
- return b.current = B, r("idle"), i("idle"), s([]), f(null), m(null), c(null), C(!1), v(null), () => {
65
+ return b.current = q, r("idle"), i("idle"), s([]), f(null), g(null), c(null), C(!1), v(null), () => {
66
66
  var D;
67
- (D = B.destroy) == null || D.call(B), b.current = null;
67
+ (D = q.destroy) == null || D.call(q), b.current = null;
68
68
  };
69
69
  }, [
70
70
  e.agentId,
@@ -73,18 +73,18 @@ function gn(e) {
73
73
  e.sessionEndpoint,
74
74
  JSON.stringify(e.sessionBody ?? {})
75
75
  ]);
76
- const I = k(async () => {
76
+ const M = k(async () => {
77
77
  const N = b.current;
78
78
  if (N)
79
79
  try {
80
80
  await N.connect();
81
- } catch (B) {
82
- throw v(B instanceof Error ? B.message : String(B)), B;
81
+ } catch (q) {
82
+ throw v(q instanceof Error ? q.message : String(q)), q;
83
83
  }
84
84
  }, []), H = k(() => {
85
85
  const N = b.current;
86
86
  N && N.disconnect();
87
- }, []), p = k(() => {
87
+ }, []), h = k(() => {
88
88
  var N;
89
89
  return ((N = b.current) == null ? void 0 : N.getRoom()) ?? null;
90
90
  }, []);
@@ -93,13 +93,13 @@ function gn(e) {
93
93
  agentState: o,
94
94
  transcript: l,
95
95
  agentConfig: d,
96
- videoElement: g,
96
+ videoElement: y,
97
97
  audioElement: a,
98
- canResume: R,
99
- error: L,
100
- connect: I,
98
+ canResume: I,
99
+ error: S,
100
+ connect: M,
101
101
  disconnect: H,
102
- getRoom: p,
102
+ getRoom: h,
103
103
  session: b.current
104
104
  };
105
105
  }
@@ -115,12 +115,12 @@ function yn() {
115
115
  ));
116
116
  const c = l.current;
117
117
  a.getByteFrequencyData(c);
118
- let R = 0;
119
- for (let L = 0; L < c.length; L++) R += c[L];
120
- const C = R / c.length / 255;
121
- for (const L of i.current)
118
+ let I = 0;
119
+ for (let S = 0; S < c.length; S++) I += c[S];
120
+ const C = I / c.length / 255;
121
+ for (const S of i.current)
122
122
  try {
123
- L(C);
123
+ S(C);
124
124
  } catch (v) {
125
125
  console.error("[useAudioLevel] subscriber threw:", v);
126
126
  }
@@ -150,7 +150,7 @@ function yn() {
150
150
  }
151
151
  },
152
152
  [d, s]
153
- ), g = k(() => {
153
+ ), y = k(() => {
154
154
  if (o.current !== null && (cancelAnimationFrame(o.current), o.current = null), r.current) {
155
155
  try {
156
156
  r.current.disconnect();
@@ -158,11 +158,11 @@ function yn() {
158
158
  }
159
159
  r.current = null;
160
160
  }
161
- }, []), m = k((a) => (i.current.add(a), () => {
161
+ }, []), g = k((a) => (i.current.add(a), () => {
162
162
  i.current.delete(a);
163
163
  }), []);
164
- return T(() => () => {
165
- if (g(), t.current) {
164
+ return R(() => () => {
165
+ if (y(), t.current) {
166
166
  try {
167
167
  t.current.disconnect();
168
168
  } catch {
@@ -177,10 +177,10 @@ function yn() {
177
177
  e.current = null;
178
178
  }
179
179
  i.current.clear(), l.current = null;
180
- }, [g]), { attach: f, detach: g, subscribe: m };
180
+ }, [y]), { attach: f, detach: y, subscribe: g };
181
181
  }
182
182
  function vn() {
183
- const [e, t] = S(!1), [r, o] = S(null), i = E(null), l = E(null), s = k(async (m) => {
183
+ const [e, t] = L(!1), [r, o] = L(null), i = E(null), l = E(null), s = k(async (g) => {
184
184
  if (i.current && l.current) {
185
185
  try {
186
186
  await l.current.localParticipant.unpublishTrack(i.current);
@@ -188,69 +188,69 @@ function vn() {
188
188
  }
189
189
  i.current.stop(), i.current = null;
190
190
  }
191
- l.current = m, o(null);
191
+ l.current = g, o(null);
192
192
  try {
193
193
  const a = await pn({
194
194
  echoCancellation: !0,
195
195
  noiseSuppression: !0
196
196
  });
197
- await m.localParticipant.publishTrack(a), i.current = a, t(a.isMuted);
197
+ await g.localParticipant.publishTrack(a), i.current = a, t(a.isMuted);
198
198
  } catch (a) {
199
199
  const c = a instanceof Error && a.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
200
200
  throw o(c), a;
201
201
  }
202
202
  }, []), d = k(() => {
203
- const m = i.current;
204
- m && (m.isMuted ? (m.unmute(), t(!1)) : (m.mute(), t(!0)));
203
+ const g = i.current;
204
+ g && (g.isMuted ? (g.unmute(), t(!1)) : (g.mute(), t(!0)));
205
205
  }, []), f = k(() => {
206
- const m = i.current, a = l.current;
207
- if (m && a) {
206
+ const g = i.current, a = l.current;
207
+ if (g && a) {
208
208
  try {
209
- a.localParticipant.unpublishTrack(m);
209
+ a.localParticipant.unpublishTrack(g);
210
210
  } catch {
211
211
  }
212
- m.stop();
212
+ g.stop();
213
213
  }
214
214
  i.current = null, l.current = null, t(!1);
215
- }, []), g = k(() => o(null), []);
215
+ }, []), y = k(() => o(null), []);
216
216
  return {
217
217
  isMuted: e,
218
218
  micError: r,
219
219
  toggleMute: d,
220
220
  setupMic: s,
221
221
  teardownMic: f,
222
- clearError: g
222
+ clearError: y
223
223
  };
224
224
  }
225
225
  const bn = { resolution: { width: 640, height: 480, frameRate: 24 } };
226
226
  function wn() {
227
- const [e, t] = S(!1), [r, o] = S(null), [i, l] = S(null), [s, d] = S(""), f = E(null), g = E(null), m = k((b) => {
227
+ const [e, t] = L(!1), [r, o] = L(null), [i, l] = L(null), [s, d] = L(""), f = E(null), y = E(null), g = k((b) => {
228
228
  f.current = b;
229
229
  }, []), a = k(() => {
230
- const b = f.current, z = g.current;
230
+ const b = f.current, z = y.current;
231
231
  if (z && b) {
232
- const I = b.localParticipant.getTrackPublication(jt.Source.Camera);
233
- if (I != null && I.track) {
232
+ const M = b.localParticipant.getTrackPublication(Gt.Source.Camera);
233
+ if (M != null && M.track) {
234
234
  try {
235
- b.localParticipant.unpublishTrack(I.track);
235
+ b.localParticipant.unpublishTrack(M.track);
236
236
  } catch {
237
237
  }
238
- I.track.stop();
238
+ M.track.stop();
239
239
  } else
240
240
  z.stop();
241
241
  }
242
- g.current = null, l(null), t(!1);
242
+ y.current = null, l(null), t(!1);
243
243
  }, []), c = k(async (b) => {
244
244
  const z = f.current;
245
245
  if (z) {
246
246
  o(null);
247
247
  try {
248
- const I = { ...bn };
249
- b && (I.deviceId = b);
250
- const H = await hn(I);
251
- await z.localParticipant.publishTrack(H), g.current = H;
252
- const p = H.attach();
253
- l(p), t(!0), b && d(b);
248
+ const M = { ...bn };
249
+ b && (M.deviceId = b);
250
+ const H = await hn(M);
251
+ await z.localParticipant.publishTrack(H), y.current = H;
252
+ const h = H.attach();
253
+ l(h), t(!0), b && d(b);
254
254
  try {
255
255
  z.localParticipant.publishData(
256
256
  new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
@@ -258,36 +258,36 @@ function wn() {
258
258
  );
259
259
  } catch {
260
260
  }
261
- } catch (I) {
262
- const H = I instanceof Error && I.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
261
+ } catch (M) {
262
+ const H = M instanceof Error && M.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
263
263
  o(H);
264
264
  }
265
265
  }
266
- }, []), R = k(async () => {
266
+ }, []), I = k(async () => {
267
267
  e ? a() : await c(s || void 0);
268
268
  }, [e, s, a, c]), C = k(async (b) => {
269
269
  a(), await c(b);
270
- }, [a, c]), L = k(() => {
270
+ }, [a, c]), S = k(() => {
271
271
  a(), f.current = null, o(null), d("");
272
272
  }, [a]), v = k(() => o(null), []);
273
- return T(() => () => {
274
- g.current && g.current.stop();
273
+ return R(() => () => {
274
+ y.current && y.current.stop();
275
275
  }, []), {
276
276
  isEnabled: e,
277
277
  error: r,
278
278
  previewEl: i,
279
279
  activeDeviceId: s,
280
- toggle: R,
280
+ toggle: I,
281
281
  switchDevice: C,
282
- attachRoom: m,
283
- teardown: L,
282
+ attachRoom: g,
283
+ teardown: S,
284
284
  clearError: v
285
285
  };
286
286
  }
287
287
  function _n() {
288
- const [e, t] = S(!1), [r, o] = S(null), [i, l] = S(null), s = E(null), d = k((c) => {
288
+ const [e, t] = L(!1), [r, o] = L(null), [i, l] = L(null), s = E(null), d = k((c) => {
289
289
  s.current = c;
290
- }, []), f = k(() => l(null), []), g = k(async () => {
290
+ }, []), f = k(() => l(null), []), y = k(async () => {
291
291
  const c = s.current;
292
292
  if (c) {
293
293
  if (e) {
@@ -301,11 +301,11 @@ function _n() {
301
301
  o(null);
302
302
  try {
303
303
  await c.localParticipant.setScreenShareEnabled(!0);
304
- let R = 0;
304
+ let I = 0;
305
305
  const C = () => {
306
- const L = c.localParticipant.getTrackPublication(jt.Source.ScreenShare);
307
- if (L != null && L.track) {
308
- const v = L.track.attach();
306
+ const S = c.localParticipant.getTrackPublication(Gt.Source.ScreenShare);
307
+ if (S != null && S.track) {
308
+ const v = S.track.attach();
309
309
  l(v), t(!0);
310
310
  try {
311
311
  c.localParticipant.publishData(
@@ -316,15 +316,15 @@ function _n() {
316
316
  }
317
317
  return;
318
318
  }
319
- R++ < 10 ? setTimeout(C, 100) : t(!0);
319
+ I++ < 10 ? setTimeout(C, 100) : t(!0);
320
320
  };
321
321
  C();
322
- } catch (R) {
323
- const C = R instanceof Error ? R.name : "";
322
+ } catch (I) {
323
+ const C = I instanceof Error ? I.name : "";
324
324
  C !== "NotAllowedError" && C !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
325
325
  }
326
326
  }
327
- }, [e, f]), m = k(() => {
327
+ }, [e, f]), g = k(() => {
328
328
  const c = s.current;
329
329
  if (c && e)
330
330
  try {
@@ -333,10 +333,10 @@ function _n() {
333
333
  }
334
334
  f(), t(!1), o(null), s.current = null;
335
335
  }, [e, f]), a = k(() => o(null), []);
336
- return { isEnabled: e, error: r, previewEl: i, toggle: g, attachRoom: d, teardown: m, clearError: a };
336
+ return { isEnabled: e, error: r, previewEl: i, toggle: y, attachRoom: d, teardown: g, clearError: a };
337
337
  }
338
338
  function xn() {
339
- const [e, t] = S([]), [r, o] = S([]), i = k(async () => {
339
+ const [e, t] = L([]), [r, o] = L([]), i = k(async () => {
340
340
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
341
341
  try {
342
342
  const l = await navigator.mediaDevices.enumerateDevices();
@@ -344,22 +344,22 @@ function xn() {
344
344
  } catch {
345
345
  }
346
346
  }, []);
347
- return T(() => {
347
+ return R(() => {
348
348
  if (i(), typeof navigator > "u" || !navigator.mediaDevices) return;
349
349
  const l = () => void i();
350
350
  return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
351
351
  }, [i]), { mics: e, cameras: r, refresh: i };
352
352
  }
353
353
  function kn(e, t, r = !1) {
354
- const [o, i] = S(null), [l, s] = S(null), [d, f] = S(!r && !!e);
355
- return T(() => {
354
+ const [o, i] = L(null), [l, s] = L(null), [d, f] = L(!r && !!e);
355
+ return R(() => {
356
356
  if (r || !e) {
357
357
  f(!1);
358
358
  return;
359
359
  }
360
- const g = new AbortController(), m = t || "https://app.livelayer.studio";
361
- return f(!0), s(null), fetch(`${m}/api/widget/agent/${encodeURIComponent(e)}`, {
362
- signal: g.signal
360
+ const y = new AbortController(), g = t || "https://app.livelayer.studio";
361
+ return f(!0), s(null), fetch(`${g}/api/widget/agent/${encodeURIComponent(e)}`, {
362
+ signal: y.signal
363
363
  }).then(async (a) => {
364
364
  if (!a.ok) {
365
365
  const c = await a.json().catch(() => ({}));
@@ -367,10 +367,10 @@ function kn(e, t, r = !1) {
367
367
  }
368
368
  return a.json();
369
369
  }).then((a) => {
370
- g.signal.aborted || (i(a), f(!1));
370
+ y.signal.aborted || (i(a), f(!1));
371
371
  }).catch((a) => {
372
- g.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), f(!1));
373
- }), () => g.abort();
372
+ y.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), f(!1));
373
+ }), () => y.abort();
374
374
  }, [e, t, r]), { info: o, error: l, loading: d };
375
375
  }
376
376
  function Ln(e) {
@@ -393,7 +393,7 @@ function Cn({
393
393
  defaultValue: t = "expanded",
394
394
  onChange: r
395
395
  } = {}) {
396
- const o = e !== void 0, [i, l] = S(t), s = o ? e : i, d = k(
396
+ const o = e !== void 0, [i, l] = L(t), s = o ? e : i, d = k(
397
397
  (f) => {
398
398
  f !== s && (o || l(f), r == null || r(f));
399
399
  },
@@ -415,20 +415,20 @@ function An({
415
415
  const l = `${o}:display-mode`, s = E(!1), [d, f] = Cn({
416
416
  value: e,
417
417
  defaultValue: t,
418
- onChange: (g) => {
419
- e === void 0 && !i && Sn(l, g), r == null || r(g);
418
+ onChange: (y) => {
419
+ e === void 0 && !i && Sn(l, y), r == null || r(y);
420
420
  }
421
421
  });
422
- return T(() => {
422
+ return R(() => {
423
423
  if (s.current || (s.current = !0, i || e !== void 0)) return;
424
- const g = Nn(Ln(l));
425
- g && g !== d && f(g);
424
+ const y = Nn(Ln(l));
425
+ y && y !== d && f(y);
426
426
  }, []), [d, f];
427
427
  }
428
428
  const Rn = 640;
429
429
  function In(e = Rn) {
430
- const [t, r] = S(!1);
431
- return T(() => {
430
+ const [t, r] = L(!1);
431
+ return R(() => {
432
432
  if (e === !1) {
433
433
  r(!1);
434
434
  return;
@@ -441,43 +441,43 @@ function In(e = Rn) {
441
441
  });
442
442
  }, [e]), t;
443
443
  }
444
- const Nt = "__llHistoryPatched", et = "ll:pathname";
444
+ const It = "__llHistoryPatched", it = "ll:pathname";
445
445
  function Mn() {
446
- if (typeof window > "u" || window.history[Nt]) return;
446
+ if (typeof window > "u" || window.history[It]) return;
447
447
  const e = window.history.pushState, t = window.history.replaceState;
448
448
  window.history.pushState = function(...r) {
449
449
  const o = e.apply(this, r);
450
- return window.dispatchEvent(new Event(et)), o;
450
+ return window.dispatchEvent(new Event(it)), o;
451
451
  }, window.history.replaceState = function(...r) {
452
452
  const o = t.apply(this, r);
453
- return window.dispatchEvent(new Event(et)), o;
454
- }, window.history[Nt] = !0;
453
+ return window.dispatchEvent(new Event(it)), o;
454
+ }, window.history[It] = !0;
455
455
  }
456
- function At() {
456
+ function Mt() {
457
457
  return typeof window > "u" ? "/" : window.location.pathname || "/";
458
458
  }
459
459
  function Tn(e) {
460
- const [t, r] = S(
461
- () => e ?? At()
460
+ const [t, r] = L(
461
+ () => e ?? Mt()
462
462
  );
463
- return T(() => {
463
+ return R(() => {
464
464
  if (e !== void 0) return;
465
465
  Mn();
466
- const o = () => r(At());
467
- return o(), window.addEventListener("popstate", o), window.addEventListener(et, o), () => {
468
- window.removeEventListener("popstate", o), window.removeEventListener(et, o);
466
+ const o = () => r(Mt());
467
+ return o(), window.addEventListener("popstate", o), window.addEventListener(it, o), () => {
468
+ window.removeEventListener("popstate", o), window.removeEventListener(it, o);
469
469
  };
470
470
  }, [e]), e ?? t;
471
471
  }
472
- const Rt = /* @__PURE__ */ new Map(), Pn = /[\\^$+?.()|{}[\]]/g;
472
+ const Tt = /* @__PURE__ */ new Map(), Pn = /[\\^$+?.()|{}[\]]/g;
473
473
  function Dn(e) {
474
474
  return e.replace(Pn, "\\$&");
475
475
  }
476
476
  function $n(e) {
477
- const t = Rt.get(e);
477
+ const t = Tt.get(e);
478
478
  if (t) return t;
479
479
  const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), d = Dn(l).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(i, "g"), "[^/]+"), f = new RegExp(`^${d}\\/?$`);
480
- return Rt.set(e, f), f;
480
+ return Tt.set(e, f), f;
481
481
  }
482
482
  function zn(e, t) {
483
483
  const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
@@ -486,22 +486,22 @@ function zn(e, t) {
486
486
  function Hn(e, t) {
487
487
  return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : zn(e, t);
488
488
  }
489
- function It(e, t) {
489
+ function Pt(e, t) {
490
490
  if (!e || e.length === 0) return !1;
491
491
  for (const r of e)
492
492
  if (Hn(r, t)) return !0;
493
493
  return !1;
494
494
  }
495
495
  function On(e, t, r) {
496
- return e === void 0 ? !0 : It(r, e) ? !1 : t && t.length > 0 ? It(t, e) : !0;
496
+ return e === void 0 ? !0 : Pt(r, e) ? !1 : t && t.length > 0 ? Pt(t, e) : !0;
497
497
  }
498
- function qn(e, t, r) {
499
- return Ze(
498
+ function Bn(e, t, r) {
499
+ return ot(
500
500
  () => On(e, t, r),
501
501
  [e, t, r]
502
502
  );
503
503
  }
504
- const Mt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
504
+ const Dt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
505
505
  "svg",
506
506
  {
507
507
  className: t,
@@ -547,7 +547,7 @@ const Mt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
547
547
  }
548
548
  )
549
549
  }
550
- ), Tt = ({ className: e }) => /* @__PURE__ */ n(
550
+ ), $t = ({ className: e }) => /* @__PURE__ */ n(
551
551
  "svg",
552
552
  {
553
553
  className: e,
@@ -565,7 +565,7 @@ const Mt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
565
565
  }
566
566
  )
567
567
  }
568
- ), Bn = ({ className: e }) => /* @__PURE__ */ n(
568
+ ), qn = ({ className: e }) => /* @__PURE__ */ n(
569
569
  "svg",
570
570
  {
571
571
  className: e,
@@ -581,7 +581,7 @@ const Mt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
581
581
  right: 0,
582
582
  up: -90,
583
583
  down: 90
584
- }, Pt = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
584
+ }, zt = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
585
585
  "svg",
586
586
  {
587
587
  className: t,
@@ -597,11 +597,11 @@ const Mt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
597
597
  function Fn(e) {
598
598
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
599
599
  }
600
- const Vt = "ll-hidden-tab-center-y", Un = 5, Dt = 16;
600
+ const Jt = "ll-hidden-tab-center-y", Un = 5, Ht = 16;
601
601
  function jn() {
602
602
  if (typeof window > "u") return null;
603
603
  try {
604
- const e = window.localStorage.getItem(Vt);
604
+ const e = window.localStorage.getItem(Jt);
605
605
  if (!e) return null;
606
606
  const t = Number.parseFloat(e);
607
607
  return Number.isFinite(t) ? t : null;
@@ -609,10 +609,10 @@ function jn() {
609
609
  return null;
610
610
  }
611
611
  }
612
- function $t(e) {
612
+ function Ot(e) {
613
613
  if (!(typeof window > "u"))
614
614
  try {
615
- window.localStorage.setItem(Vt, String(e));
615
+ window.localStorage.setItem(Jt, String(e));
616
616
  } catch {
617
617
  }
618
618
  }
@@ -625,15 +625,15 @@ const Vn = ({
625
625
  avatarImageUrl: l,
626
626
  agentName: s
627
627
  }) => {
628
- const d = Fn(e), f = d === "right" ? "left" : "right", g = t ? 80 : 72, m = !!l, [a, c] = S(null), [R, C] = S(!1), L = E(null), v = E(!1), b = k(
628
+ const d = Fn(e), f = d === "right" ? "left" : "right", y = t ? 80 : 72, g = !!l, [a, c] = L(null), [I, C] = L(!1), S = E(null), v = E(!1), b = k(
629
629
  (A) => {
630
630
  if (typeof window > "u") return A;
631
- const O = g / 2, W = Dt + O, Y = window.innerHeight - Dt - O;
631
+ const O = y / 2, W = Ht + O, Y = window.innerHeight - Ht - O;
632
632
  return Y < W ? Math.max(W, A) : Math.max(W, Math.min(Y, A));
633
633
  },
634
- [g]
634
+ [y]
635
635
  );
636
- T(() => {
636
+ R(() => {
637
637
  const A = jn();
638
638
  c(b(A ?? window.innerHeight / 2));
639
639
  const O = () => {
@@ -648,7 +648,7 @@ const Vn = ({
648
648
  A.currentTarget.setPointerCapture(A.pointerId);
649
649
  } catch {
650
650
  }
651
- L.current = {
651
+ S.current = {
652
652
  startClientY: A.clientY,
653
653
  startCenterY: a,
654
654
  moved: !1
@@ -656,9 +656,9 @@ const Vn = ({
656
656
  }
657
657
  },
658
658
  [a]
659
- ), I = k(
659
+ ), M = k(
660
660
  (A) => {
661
- const O = L.current;
661
+ const O = S.current;
662
662
  if (!O) return;
663
663
  const W = A.clientY - O.startClientY;
664
664
  !O.moved && Math.abs(W) > Un && (O.moved = !0, C(!0)), O.moved && c(b(O.startCenterY + W));
@@ -666,17 +666,17 @@ const Vn = ({
666
666
  [b]
667
667
  ), H = k(
668
668
  (A) => {
669
- const O = L.current;
669
+ const O = S.current;
670
670
  if (O) {
671
671
  try {
672
672
  A.currentTarget.releasePointerCapture(A.pointerId);
673
673
  } catch {
674
674
  }
675
- L.current = null, O.moved && (C(!1), v.current = !0, c((W) => (W !== null && $t(W), W)));
675
+ S.current = null, O.moved && (C(!1), v.current = !0, c((W) => (W !== null && Ot(W), W)));
676
676
  }
677
677
  },
678
678
  []
679
- ), p = k(() => {
679
+ ), h = k(() => {
680
680
  if (v.current) {
681
681
  v.current = !1;
682
682
  return;
@@ -690,41 +690,41 @@ const Vn = ({
690
690
  c((W) => {
691
691
  if (W === null) return W;
692
692
  const Y = b(W + O);
693
- return $t(Y), Y;
693
+ return Ot(Y), Y;
694
694
  });
695
695
  }
696
696
  },
697
697
  [b]
698
- ), B = [
698
+ ), q = [
699
699
  "ll-hidden",
700
700
  `ll-hidden--${d}`,
701
701
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
702
702
  r ? "ll-hidden--speaking" : null,
703
- R ? "is-dragging" : null,
704
- m ? "ll-hidden--with-avatar" : null
705
- ].filter(Boolean).join(" "), D = a === null ? void 0 : { top: `${a - g / 2}px`, transform: "none" };
703
+ I ? "is-dragging" : null,
704
+ g ? "ll-hidden--with-avatar" : null
705
+ ].filter(Boolean).join(" "), D = a === null ? void 0 : { top: `${a - y / 2}px`, transform: "none" };
706
706
  return /* @__PURE__ */ n(
707
707
  "button",
708
708
  {
709
709
  type: "button",
710
- className: B,
710
+ className: q,
711
711
  onPointerDown: z,
712
- onPointerMove: I,
712
+ onPointerMove: M,
713
713
  onPointerUp: H,
714
714
  onPointerCancel: H,
715
- onClick: p,
715
+ onClick: h,
716
716
  onKeyDown: N,
717
717
  "aria-label": i,
718
718
  "data-position": e,
719
719
  style: D,
720
- children: m ? (
720
+ children: g ? (
721
721
  // Layout: tiny chevron flush against the inward edge (peeks out
722
722
  // as the click affordance), then the circular avatar photo
723
723
  // taking the rest of the tab. Reinforces "this is an
724
724
  // avatar-based experience" even when collapsed.
725
- /* @__PURE__ */ w(ut, { children: [
725
+ /* @__PURE__ */ _(ht, { children: [
726
726
  /* @__PURE__ */ n(
727
- Pt,
727
+ zt,
728
728
  {
729
729
  direction: f,
730
730
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
@@ -741,7 +741,7 @@ const Vn = ({
741
741
  )
742
742
  ] })
743
743
  ) : /* @__PURE__ */ n(
744
- Pt,
744
+ zt,
745
745
  {
746
746
  direction: f,
747
747
  className: "ll-hidden__chevron"
@@ -757,20 +757,20 @@ const Vn = ({
757
757
  className: i,
758
758
  barClassName: l
759
759
  }) => {
760
- const s = E(null), d = E([]), f = Ze(() => {
761
- const m = (Math.sqrt(5) - 1) / 2;
762
- return Array.from({ length: t }, (a, c) => 0.5 + c * m % 1 * 0.5);
760
+ const s = E(null), d = E([]), f = ot(() => {
761
+ const g = (Math.sqrt(5) - 1) / 2;
762
+ return Array.from({ length: t }, (a, c) => 0.5 + c * g % 1 * 0.5);
763
763
  }, [t]);
764
- T(() => e.subscribe((a) => {
764
+ R(() => e.subscribe((a) => {
765
765
  for (let c = 0; c < t; c++) {
766
- const R = d.current[c];
767
- if (!R) continue;
766
+ const I = d.current[c];
767
+ if (!I) continue;
768
768
  const C = Math.max(o, a * r * f[c]);
769
- R.style.height = `${C}px`;
769
+ I.style.height = `${C}px`;
770
770
  }
771
771
  }), [e, t, r, o, f]);
772
- const g = ["ll-waveform", i].filter(Boolean).join(" ");
773
- return /* @__PURE__ */ n("div", { ref: s, className: g, "aria-hidden": "true", children: Array.from({ length: t }, (m, a) => /* @__PURE__ */ n(
772
+ const y = ["ll-waveform", i].filter(Boolean).join(" ");
773
+ return /* @__PURE__ */ n("div", { ref: s, className: y, "aria-hidden": "true", children: Array.from({ length: t }, (g, a) => /* @__PURE__ */ n(
774
774
  "div",
775
775
  {
776
776
  ref: (c) => {
@@ -791,14 +791,14 @@ const Vn = ({
791
791
  audioLevel: s,
792
792
  onExpand: d,
793
793
  onToggleMute: f,
794
- onClose: g
794
+ onClose: y
795
795
  }) => t ? /* @__PURE__ */ n(
796
796
  "div",
797
797
  {
798
798
  className: "ll-minimized ll-minimized--mobile",
799
799
  role: "region",
800
800
  "aria-label": `${r} widget`,
801
- children: /* @__PURE__ */ w(
801
+ children: /* @__PURE__ */ _(
802
802
  "button",
803
803
  {
804
804
  type: "button",
@@ -827,24 +827,24 @@ const Vn = ({
827
827
  }
828
828
  ),
829
829
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
830
- /* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
830
+ /* @__PURE__ */ _("div", { className: "ll-minimized__controls", children: [
831
831
  /* @__PURE__ */ n(
832
832
  "span",
833
833
  {
834
834
  className: "ll-minimized__btn",
835
835
  role: "button",
836
836
  tabIndex: 0,
837
- onClick: (m) => {
838
- m.stopPropagation(), f();
837
+ onClick: (g) => {
838
+ g.stopPropagation(), f();
839
839
  },
840
- onKeyDown: (m) => {
841
- (m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), f());
840
+ onKeyDown: (g) => {
841
+ (g.key === "Enter" || g.key === " ") && (g.stopPropagation(), g.preventDefault(), f());
842
842
  },
843
843
  "aria-label": l ? "Unmute microphone" : "Mute microphone",
844
- children: /* @__PURE__ */ n(Mt, { muted: l, className: "ll-minimized__icon" })
844
+ children: /* @__PURE__ */ n(Dt, { muted: l, className: "ll-minimized__icon" })
845
845
  }
846
846
  ),
847
- /* @__PURE__ */ n(Tt, { className: "ll-minimized__icon ll-minimized__icon--expand" })
847
+ /* @__PURE__ */ n($t, { className: "ll-minimized__icon ll-minimized__icon--expand" })
848
848
  ] })
849
849
  ]
850
850
  }
@@ -857,7 +857,7 @@ const Vn = ({
857
857
  "data-position": e,
858
858
  role: "region",
859
859
  "aria-label": `${r} widget`,
860
- children: /* @__PURE__ */ w("div", { className: "ll-minimized__surface", children: [
860
+ children: /* @__PURE__ */ _("div", { className: "ll-minimized__surface", children: [
861
861
  o ? (
862
862
  // eslint-disable-next-line @next/next/no-img-element
863
863
  /* @__PURE__ */ n(
@@ -869,11 +869,11 @@ const Vn = ({
869
869
  }
870
870
  )
871
871
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
872
- /* @__PURE__ */ w("div", { className: "ll-minimized__meta", children: [
872
+ /* @__PURE__ */ _("div", { className: "ll-minimized__meta", children: [
873
873
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
874
874
  /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
875
875
  ] }),
876
- /* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
876
+ /* @__PURE__ */ _("div", { className: "ll-minimized__controls", children: [
877
877
  /* @__PURE__ */ n(
878
878
  "button",
879
879
  {
@@ -881,7 +881,7 @@ const Vn = ({
881
881
  className: "ll-minimized__btn",
882
882
  onClick: f,
883
883
  "aria-label": l ? "Unmute microphone" : "Mute microphone",
884
- children: /* @__PURE__ */ n(Mt, { muted: l, className: "ll-minimized__icon" })
884
+ children: /* @__PURE__ */ n(Dt, { muted: l, className: "ll-minimized__icon" })
885
885
  }
886
886
  ),
887
887
  /* @__PURE__ */ n(
@@ -891,7 +891,7 @@ const Vn = ({
891
891
  className: "ll-minimized__btn",
892
892
  onClick: d,
893
893
  "aria-label": `Expand ${r} widget`,
894
- children: /* @__PURE__ */ n(Tt, { className: "ll-minimized__icon" })
894
+ children: /* @__PURE__ */ n($t, { className: "ll-minimized__icon" })
895
895
  }
896
896
  ),
897
897
  /* @__PURE__ */ n(
@@ -899,9 +899,9 @@ const Vn = ({
899
899
  {
900
900
  type: "button",
901
901
  className: "ll-minimized__btn ll-minimized__btn--close",
902
- onClick: g,
902
+ onClick: y,
903
903
  "aria-label": "Close widget",
904
- children: /* @__PURE__ */ n(Bn, { className: "ll-minimized__icon" })
904
+ children: /* @__PURE__ */ n(qn, { className: "ll-minimized__icon" })
905
905
  }
906
906
  )
907
907
  ] })
@@ -914,8 +914,8 @@ const Vn = ({
914
914
  className: o,
915
915
  style: i
916
916
  }) => {
917
- const [l, s] = S(!1), d = E(e);
918
- if (T(() => {
917
+ const [l, s] = L(!1), d = E(e);
918
+ if (R(() => {
919
919
  d.current !== e && (d.current = e, s(!1));
920
920
  }, [e]), !e) return null;
921
921
  const f = {
@@ -955,91 +955,118 @@ const Vn = ({
955
955
  branding: s,
956
956
  teamMembers: d,
957
957
  currentTeamMemberId: f,
958
- isSwitchingTeamMember: g,
959
- teamSwitcherOpen: m,
958
+ isSwitchingTeamMember: y,
959
+ teamSwitcherOpen: g,
960
960
  onToggleTeamSwitcher: a,
961
961
  onSelectTeamMember: c,
962
- languageMenuOpen: R,
962
+ languageMenuOpen: I,
963
963
  onToggleLanguageMenu: C,
964
- connectionState: L,
964
+ connectionState: S,
965
965
  agentState: v,
966
966
  transcript: b,
967
967
  canResume: z,
968
- needsUserGesture: I,
968
+ needsUserGesture: M,
969
969
  error: H,
970
- isMuted: p,
970
+ isMuted: h,
971
971
  micError: N,
972
- micDevices: B,
972
+ micDevices: q,
973
973
  isCameraEnabled: D,
974
974
  cameraPreviewEl: A,
975
975
  cameraDevices: O,
976
976
  activeCameraId: W,
977
977
  isScreenShareEnabled: Y,
978
- screenPreviewEl: te,
979
- isSpeakerMuted: ue,
980
- allowCamera: qe,
981
- allowScreenShare: Be,
982
- allowTyping: We,
983
- avatarVideoContainerRef: Fe,
978
+ screenPreviewEl: ne,
979
+ isSpeakerMuted: me,
980
+ allowCamera: je,
981
+ allowScreenShare: Ve,
982
+ allowTyping: Ye,
983
+ avatarVideoContainerRef: Ge,
984
+ agentVideoEl: te,
984
985
  onConnect: ge,
985
- onDisconnect: ye,
986
- onRetry: ve,
987
- onResumeAudio: be,
988
- onToggleMute: we,
989
- onToggleCamera: _e,
990
- onSwitchCameraDevice: xe,
991
- onToggleScreenShare: ke,
992
- onToggleSpeaker: V,
993
- onSendMessage: Ue,
994
- onMinimize: je,
995
- onClose: Ve,
996
- onClearMicError: fe
986
+ onDisconnect: we,
987
+ onRetry: _e,
988
+ onResumeAudio: xe,
989
+ onToggleMute: ke,
990
+ onToggleCamera: Le,
991
+ onSwitchCameraDevice: Se,
992
+ onToggleScreenShare: V,
993
+ onToggleSpeaker: at,
994
+ onSendMessage: Je,
995
+ onMinimize: Ke,
996
+ onClose: se,
997
+ onClearMicError: Pe
997
998
  }) => {
998
- var Ce;
999
- const ae = b.length > 0 ? b[b.length - 1] : null, ie = ((d == null ? void 0 : d.length) ?? 0) > 1, Le = L === "connecting" || L === "connected", Se = L === "connected", pe = L === "idle" || L === "disconnected" || L === "error", K = E(null), Me = E(null);
1000
- T(() => {
1001
- const y = K.current;
1002
- y && (y.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "cover", A.style.transform = "scaleX(-1)", y.appendChild(A)));
1003
- }, [A]), T(() => {
1004
- const y = Me.current;
1005
- y && (y.innerHTML = "", te && (te.style.width = "100%", te.style.height = "100%", te.style.objectFit = "contain", y.appendChild(te)));
999
+ var Qe;
1000
+ const Q = b.length > 0 ? b[b.length - 1] : null, ye = ((d == null ? void 0 : d.length) ?? 0) > 1, Ce = S === "connecting" || S === "connected", K = S === "connected", Z = S === "idle" || S === "disconnected" || S === "error", [Ee, oe] = L(!1);
1001
+ R(() => {
1002
+ if (!te) {
1003
+ oe(!1);
1004
+ return;
1005
+ }
1006
+ if (!te.paused && te.readyState >= 2) {
1007
+ oe(!0);
1008
+ return;
1009
+ }
1010
+ oe(!1);
1011
+ const p = () => oe(!0);
1012
+ return te.addEventListener("playing", p), te.addEventListener("loadeddata", p), () => {
1013
+ te.removeEventListener("playing", p), te.removeEventListener("loadeddata", p);
1014
+ };
1006
1015
  }, [te]);
1007
- const [ne, ee] = S(!1), [le, ce] = S(!1);
1008
- T(() => {
1009
- if (!ne && !le && !R && !m) return;
1010
- const y = () => {
1011
- ee(!1), ce(!1), R && C(), m && a();
1016
+ const [ce, ve] = L(!1);
1017
+ R(() => {
1018
+ if (!K) {
1019
+ ve(!1);
1020
+ return;
1021
+ }
1022
+ if (Ee) return;
1023
+ const p = setTimeout(() => ve(!0), 8e3);
1024
+ return () => clearTimeout(p);
1025
+ }, [K, Ee]);
1026
+ const De = S === "connecting" || K && !!o && !Ee && !ce, re = E(null), ie = E(null);
1027
+ R(() => {
1028
+ const p = re.current;
1029
+ p && (p.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "cover", A.style.transform = "scaleX(-1)", p.appendChild(A)));
1030
+ }, [A]), R(() => {
1031
+ const p = ie.current;
1032
+ p && (p.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "contain", p.appendChild(ne)));
1033
+ }, [ne]);
1034
+ const [le, de] = L(!1), [Ne, ue] = L(!1);
1035
+ R(() => {
1036
+ if (!le && !Ne && !I && !g) return;
1037
+ const p = () => {
1038
+ de(!1), ue(!1), I && C(), g && a();
1012
1039
  };
1013
- return document.addEventListener("click", y), () => document.removeEventListener("click", y);
1040
+ return document.addEventListener("click", p), () => document.removeEventListener("click", p);
1014
1041
  }, [
1015
- ne,
1016
1042
  le,
1017
- R,
1018
- m,
1043
+ Ne,
1044
+ I,
1045
+ g,
1019
1046
  C,
1020
1047
  a
1021
1048
  ]);
1022
- const [Z, re] = S(""), he = k(
1023
- (y) => {
1024
- y.preventDefault();
1025
- const X = Z.trim();
1026
- X && (Ue(X), re(""));
1049
+ const [fe, $e] = L(""), ze = k(
1050
+ (p) => {
1051
+ p.preventDefault();
1052
+ const X = fe.trim();
1053
+ X && (Je(X), $e(""));
1027
1054
  },
1028
- [Z, Ue]
1029
- ), Te = s.productName || "Live Layer", Ye = Se && (ae != null && ae.text) ? ae.text : l || "", Pe = [
1055
+ [fe, Je]
1056
+ ), He = s.productName || "Live Layer", Xe = K && (Q != null && Q.text) ? Q.text : l || "", ct = K && (Q == null ? void 0 : Q.role) === "agent", Oe = [
1030
1057
  "ll-expanded",
1031
1058
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1032
1059
  ].join(" ");
1033
- return /* @__PURE__ */ w(
1060
+ return /* @__PURE__ */ _(
1034
1061
  "div",
1035
1062
  {
1036
- className: Pe,
1063
+ className: Oe,
1037
1064
  "data-position": e,
1038
- "data-state": Se ? "connected" : Le ? "connecting" : "idle",
1065
+ "data-state": K ? "connected" : Ce ? "connecting" : "idle",
1039
1066
  role: "dialog",
1040
1067
  "aria-label": `${r} widget`,
1041
1068
  children: [
1042
- /* @__PURE__ */ w("div", { className: "ll-expanded__bg", children: [
1069
+ /* @__PURE__ */ _("div", { className: "ll-expanded__bg", children: [
1043
1070
  o ? /* @__PURE__ */ n(
1044
1071
  Jn,
1045
1072
  {
@@ -1047,8 +1074,8 @@ const Vn = ({
1047
1074
  alt: r,
1048
1075
  className: "ll-expanded__bg-img"
1049
1076
  }
1050
- ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Ce = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Ce.toUpperCase()) || "A" }) }),
1051
- i && !Se && /* @__PURE__ */ n(
1077
+ ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Qe = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Qe.toUpperCase()) || "A" }) }),
1078
+ i && !K && /* @__PURE__ */ n(
1052
1079
  "video",
1053
1080
  {
1054
1081
  className: "ll-expanded__bg-idle",
@@ -1060,98 +1087,98 @@ const Vn = ({
1060
1087
  }
1061
1088
  )
1062
1089
  ] }),
1063
- /* @__PURE__ */ n("div", { ref: Fe, className: "ll-expanded__video" }),
1064
- L === "connecting" && /* @__PURE__ */ w("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1090
+ /* @__PURE__ */ n("div", { ref: Ge, className: "ll-expanded__video" }),
1091
+ De && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1065
1092
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1066
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: g ? "Switching..." : "Connecting..." })
1093
+ /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: y ? "Switching..." : "Connecting..." })
1067
1094
  ] }),
1068
- I && Se && /* @__PURE__ */ w(
1095
+ M && K && /* @__PURE__ */ _(
1069
1096
  "button",
1070
1097
  {
1071
1098
  type: "button",
1072
1099
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1073
- onClick: be,
1100
+ onClick: xe,
1074
1101
  children: [
1075
1102
  /* @__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" }) }),
1076
1103
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
1077
1104
  ]
1078
1105
  }
1079
1106
  ),
1080
- Le ? /* @__PURE__ */ w("div", { className: "ll-expanded__topbar", children: [
1081
- /* @__PURE__ */ w("div", { className: "ll-expanded__topbar-left", children: [
1082
- /* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
1083
- /* @__PURE__ */ w(
1107
+ Ce ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
1108
+ /* @__PURE__ */ _("div", { className: "ll-expanded__topbar-left", children: [
1109
+ /* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
1110
+ /* @__PURE__ */ _(
1084
1111
  "button",
1085
1112
  {
1086
1113
  type: "button",
1087
1114
  className: "ll-hpill",
1088
- onClick: (y) => {
1089
- ie && (y.stopPropagation(), a());
1115
+ onClick: (p) => {
1116
+ ye && (p.stopPropagation(), a());
1090
1117
  },
1091
- "aria-haspopup": ie ? "listbox" : void 0,
1092
- "aria-expanded": ie ? m : void 0,
1118
+ "aria-haspopup": ye ? "listbox" : void 0,
1119
+ "aria-expanded": ye ? g : void 0,
1093
1120
  children: [
1094
1121
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1095
- ie && /* @__PURE__ */ n(Xe, {})
1122
+ ye && /* @__PURE__ */ n(nt, {})
1096
1123
  ]
1097
1124
  }
1098
1125
  ),
1099
- ie && m && /* @__PURE__ */ n(
1126
+ ye && g && /* @__PURE__ */ n(
1100
1127
  "div",
1101
1128
  {
1102
1129
  className: "ll-hmenu",
1103
- onClick: (y) => y.stopPropagation(),
1130
+ onClick: (p) => p.stopPropagation(),
1104
1131
  role: "listbox",
1105
- children: d == null ? void 0 : d.map((y) => /* @__PURE__ */ w(
1132
+ children: d == null ? void 0 : d.map((p) => /* @__PURE__ */ _(
1106
1133
  "button",
1107
1134
  {
1108
1135
  type: "button",
1109
- className: `ll-hmenu__item ${y.id === f ? "is-active" : ""}`,
1110
- onClick: () => c(y.id),
1136
+ className: `ll-hmenu__item ${p.id === f ? "is-active" : ""}`,
1137
+ onClick: () => c(p.id),
1111
1138
  role: "option",
1112
- "aria-selected": y.id === f,
1139
+ "aria-selected": p.id === f,
1113
1140
  children: [
1114
- y.avatarImageUrl && /* @__PURE__ */ n(
1141
+ p.avatarImageUrl && /* @__PURE__ */ n(
1115
1142
  "img",
1116
1143
  {
1117
- src: y.avatarImageUrl,
1144
+ src: p.avatarImageUrl,
1118
1145
  alt: "",
1119
1146
  className: "ll-hmenu__avatar"
1120
1147
  }
1121
1148
  ),
1122
- /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: y.name }),
1123
- y.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: y.role })
1149
+ /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: p.name }),
1150
+ p.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: p.role })
1124
1151
  ]
1125
1152
  },
1126
- y.id
1153
+ p.id
1127
1154
  ))
1128
1155
  }
1129
1156
  )
1130
1157
  ] }),
1131
- /* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
1132
- /* @__PURE__ */ w(
1158
+ /* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
1159
+ /* @__PURE__ */ _(
1133
1160
  "button",
1134
1161
  {
1135
1162
  type: "button",
1136
1163
  className: "ll-hpill ll-hpill--compact",
1137
- onClick: (y) => {
1138
- y.stopPropagation(), C();
1164
+ onClick: (p) => {
1165
+ p.stopPropagation(), C();
1139
1166
  },
1140
1167
  "aria-haspopup": "listbox",
1141
- "aria-expanded": R,
1168
+ "aria-expanded": I,
1142
1169
  "aria-label": "Language: English",
1143
1170
  title: "Language: English",
1144
1171
  children: [
1145
1172
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
1146
- /* @__PURE__ */ n(Xe, {})
1173
+ /* @__PURE__ */ n(nt, {})
1147
1174
  ]
1148
1175
  }
1149
1176
  ),
1150
- R && /* @__PURE__ */ n(
1177
+ I && /* @__PURE__ */ n(
1151
1178
  "div",
1152
1179
  {
1153
1180
  className: "ll-hmenu",
1154
- onClick: (y) => y.stopPropagation(),
1181
+ onClick: (p) => p.stopPropagation(),
1155
1182
  role: "listbox",
1156
1183
  children: /* @__PURE__ */ n(
1157
1184
  "button",
@@ -1174,16 +1201,16 @@ const Vn = ({
1174
1201
  }
1175
1202
  )
1176
1203
  ] }),
1177
- /* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
1204
+ /* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
1178
1205
  /* @__PURE__ */ n(
1179
1206
  "button",
1180
1207
  {
1181
1208
  type: "button",
1182
1209
  className: "ll-hbtn",
1183
- onClick: je,
1210
+ onClick: Ke,
1184
1211
  "aria-label": "Minimize widget",
1185
1212
  title: "Minimize",
1186
- children: /* @__PURE__ */ n(Ht, {})
1213
+ children: /* @__PURE__ */ n(qt, {})
1187
1214
  }
1188
1215
  ),
1189
1216
  /* @__PURE__ */ n(
@@ -1191,26 +1218,26 @@ const Vn = ({
1191
1218
  {
1192
1219
  type: "button",
1193
1220
  className: "ll-hbtn ll-hbtn--danger",
1194
- onClick: Ve,
1221
+ onClick: se,
1195
1222
  "aria-label": "End call",
1196
1223
  title: "End call",
1197
- children: /* @__PURE__ */ n(zt, {})
1224
+ children: /* @__PURE__ */ n(Bt, {})
1198
1225
  }
1199
1226
  )
1200
1227
  ] })
1201
1228
  ] }) : (
1202
1229
  // Idle-state header with Live Layer product name + minimize/close
1203
- /* @__PURE__ */ w("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1204
- /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Te }),
1205
- /* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
1230
+ /* @__PURE__ */ _("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1231
+ /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: He }),
1232
+ /* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
1206
1233
  /* @__PURE__ */ n(
1207
1234
  "button",
1208
1235
  {
1209
1236
  type: "button",
1210
1237
  className: "ll-hbtn ll-hbtn--ghost",
1211
- onClick: je,
1238
+ onClick: Ke,
1212
1239
  "aria-label": "Minimize widget",
1213
- children: /* @__PURE__ */ n(Ht, {})
1240
+ children: /* @__PURE__ */ n(qt, {})
1214
1241
  }
1215
1242
  ),
1216
1243
  /* @__PURE__ */ n(
@@ -1218,31 +1245,31 @@ const Vn = ({
1218
1245
  {
1219
1246
  type: "button",
1220
1247
  className: "ll-hbtn ll-hbtn--danger",
1221
- onClick: Ve,
1248
+ onClick: se,
1222
1249
  "aria-label": "Close widget",
1223
- children: /* @__PURE__ */ n(zt, {})
1250
+ children: /* @__PURE__ */ n(Bt, {})
1224
1251
  }
1225
1252
  )
1226
1253
  ] })
1227
1254
  ] })
1228
1255
  ),
1229
- pe && /* @__PURE__ */ (() => {
1230
- const y = z ? "Restart paused session" : L === "disconnected" ? "Reconnect to agent" : "Start video call", X = z ? "Pick up where you left off" : null;
1231
- return /* @__PURE__ */ w(ut, { children: [
1232
- L === "idle" && !z && !H && /* @__PURE__ */ w(
1256
+ Z && /* @__PURE__ */ (() => {
1257
+ const p = z ? "Restart paused session" : S === "disconnected" ? "Reconnect to agent" : "Start video call", X = z ? "Pick up where you left off" : null;
1258
+ return /* @__PURE__ */ _(ht, { children: [
1259
+ S === "idle" && !z && !H && /* @__PURE__ */ _(
1233
1260
  "button",
1234
1261
  {
1235
1262
  type: "button",
1236
1263
  className: "ll-expanded__play",
1237
1264
  onClick: ge,
1238
- "aria-label": y,
1265
+ "aria-label": p,
1239
1266
  children: [
1240
1267
  /* @__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" }) }) }),
1241
- /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: y })
1268
+ /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: p })
1242
1269
  ]
1243
1270
  }
1244
1271
  ),
1245
- /* @__PURE__ */ w("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1272
+ /* @__PURE__ */ _("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1246
1273
  l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
1247
1274
  X && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: X }),
1248
1275
  /* @__PURE__ */ n(
@@ -1251,56 +1278,63 @@ const Vn = ({
1251
1278
  type: "button",
1252
1279
  className: "ll-expanded__cta",
1253
1280
  onClick: ge,
1254
- "aria-label": y,
1255
- children: y
1281
+ "aria-label": p,
1282
+ children: p
1256
1283
  }
1257
1284
  )
1258
1285
  ] })
1259
1286
  ] });
1260
1287
  })(),
1261
- /* @__PURE__ */ w(
1288
+ /* @__PURE__ */ _(
1262
1289
  "div",
1263
1290
  {
1264
- className: `ll-expanded__pip ${Le && (D || Y) ? "is-visible" : ""}`,
1291
+ className: `ll-expanded__pip ${Ce && (D || Y) ? "is-visible" : ""}`,
1265
1292
  children: [
1266
1293
  /* @__PURE__ */ n(
1267
1294
  "div",
1268
1295
  {
1269
- ref: Me,
1296
+ ref: ie,
1270
1297
  className: Y ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1271
1298
  }
1272
1299
  ),
1273
1300
  /* @__PURE__ */ n(
1274
1301
  "div",
1275
1302
  {
1276
- ref: K,
1303
+ ref: re,
1277
1304
  className: !Y && D ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1278
1305
  }
1279
1306
  )
1280
1307
  ]
1281
1308
  }
1282
1309
  ),
1283
- Le ? /* @__PURE__ */ w("div", { className: "ll-expanded__bottom", children: [
1284
- Ye && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ye }) }),
1285
- /* @__PURE__ */ w("div", { className: "ll-toolbar", onClick: (y) => y.stopPropagation(), children: [
1286
- Be && /* @__PURE__ */ n(
1310
+ Ce ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
1311
+ Xe && /* @__PURE__ */ n(
1312
+ "div",
1313
+ {
1314
+ className: `ll-expanded__transcript${ct ? " ll-expanded__transcript--agent" : ""}`,
1315
+ "data-role": K ? (Q == null ? void 0 : Q.role) ?? "agent" : "agent",
1316
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Xe })
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ _("div", { className: "ll-toolbar", onClick: (p) => p.stopPropagation(), children: [
1320
+ Ve && /* @__PURE__ */ n(
1287
1321
  "button",
1288
1322
  {
1289
1323
  type: "button",
1290
1324
  className: `ll-tool ${Y ? "is-on" : ""}`,
1291
- onClick: ke,
1325
+ onClick: V,
1292
1326
  "aria-label": Y ? "Stop sharing screen" : "Share screen",
1293
1327
  title: Y ? "Stop sharing" : "Share screen",
1294
1328
  children: /* @__PURE__ */ n(Xn, {})
1295
1329
  }
1296
1330
  ),
1297
- qe && /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
1331
+ je && /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
1298
1332
  /* @__PURE__ */ n(
1299
1333
  "button",
1300
1334
  {
1301
1335
  type: "button",
1302
1336
  className: `ll-tool ll-tool--left ${D ? "is-on" : ""}`,
1303
- onClick: _e,
1337
+ onClick: Le,
1304
1338
  "aria-label": D ? "Turn off camera" : "Turn on camera",
1305
1339
  title: D ? "Stop camera" : "Start camera",
1306
1340
  children: /* @__PURE__ */ n(Qn, {})
@@ -1311,60 +1345,60 @@ const Vn = ({
1311
1345
  {
1312
1346
  type: "button",
1313
1347
  className: `ll-tool ll-tool--right ${D ? "is-on" : ""}`,
1314
- onClick: (y) => {
1315
- y.stopPropagation(), ce((X) => !X), ee(!1);
1348
+ onClick: (p) => {
1349
+ p.stopPropagation(), ue((X) => !X), de(!1);
1316
1350
  },
1317
1351
  "aria-label": "Camera devices",
1318
1352
  "aria-haspopup": "listbox",
1319
- "aria-expanded": le,
1320
- children: /* @__PURE__ */ n(Xe, {})
1353
+ "aria-expanded": Ne,
1354
+ children: /* @__PURE__ */ n(nt, {})
1321
1355
  }
1322
1356
  ),
1323
- le && O.length > 0 && /* @__PURE__ */ n(
1324
- Ot,
1357
+ Ne && O.length > 0 && /* @__PURE__ */ n(
1358
+ Wt,
1325
1359
  {
1326
1360
  label: "Camera",
1327
1361
  devices: O,
1328
1362
  activeId: W,
1329
- onPick: (y) => {
1330
- ce(!1), xe(y);
1363
+ onPick: (p) => {
1364
+ ue(!1), Se(p);
1331
1365
  }
1332
1366
  }
1333
1367
  )
1334
1368
  ] }),
1335
- /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
1369
+ /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
1336
1370
  /* @__PURE__ */ n(
1337
1371
  "button",
1338
1372
  {
1339
1373
  type: "button",
1340
- className: `ll-tool ll-tool--left ${p ? "is-muted" : ""}`,
1341
- onClick: we,
1342
- "aria-label": p ? "Unmute microphone" : "Mute microphone",
1343
- title: p ? "Unmute" : "Mute",
1344
- children: /* @__PURE__ */ n(Zn, { muted: p })
1374
+ className: `ll-tool ll-tool--left ${h ? "is-muted" : ""}`,
1375
+ onClick: ke,
1376
+ "aria-label": h ? "Unmute microphone" : "Mute microphone",
1377
+ title: h ? "Unmute" : "Mute",
1378
+ children: /* @__PURE__ */ n(Zn, { muted: h })
1345
1379
  }
1346
1380
  ),
1347
1381
  /* @__PURE__ */ n(
1348
1382
  "button",
1349
1383
  {
1350
1384
  type: "button",
1351
- className: `ll-tool ll-tool--right ${p ? "is-muted" : ""}`,
1352
- onClick: (y) => {
1353
- y.stopPropagation(), ee((X) => !X), ce(!1);
1385
+ className: `ll-tool ll-tool--right ${h ? "is-muted" : ""}`,
1386
+ onClick: (p) => {
1387
+ p.stopPropagation(), de((X) => !X), ue(!1);
1354
1388
  },
1355
1389
  "aria-label": "Microphone devices",
1356
1390
  "aria-haspopup": "listbox",
1357
- "aria-expanded": ne,
1358
- children: /* @__PURE__ */ n(Xe, {})
1391
+ "aria-expanded": le,
1392
+ children: /* @__PURE__ */ n(nt, {})
1359
1393
  }
1360
1394
  ),
1361
- ne && B.length > 0 && /* @__PURE__ */ n(
1362
- Ot,
1395
+ le && q.length > 0 && /* @__PURE__ */ n(
1396
+ Wt,
1363
1397
  {
1364
1398
  label: "Microphone",
1365
- devices: B,
1399
+ devices: q,
1366
1400
  activeId: "",
1367
- onPick: () => ee(!1)
1401
+ onPick: () => de(!1)
1368
1402
  }
1369
1403
  )
1370
1404
  ] }),
@@ -1372,11 +1406,11 @@ const Vn = ({
1372
1406
  "button",
1373
1407
  {
1374
1408
  type: "button",
1375
- className: `ll-tool ${ue ? "is-muted" : ""}`,
1376
- onClick: V,
1377
- "aria-label": ue ? "Unmute speaker" : "Mute speaker",
1378
- title: ue ? "Unmute speaker" : "Mute speaker",
1379
- children: /* @__PURE__ */ n(er, { muted: ue })
1409
+ className: `ll-tool ${me ? "is-muted" : ""}`,
1410
+ onClick: at,
1411
+ "aria-label": me ? "Unmute speaker" : "Mute speaker",
1412
+ title: me ? "Unmute speaker" : "Mute speaker",
1413
+ children: /* @__PURE__ */ n(er, { muted: me })
1380
1414
  }
1381
1415
  ),
1382
1416
  /* @__PURE__ */ n(
@@ -1384,26 +1418,26 @@ const Vn = ({
1384
1418
  {
1385
1419
  type: "button",
1386
1420
  className: "ll-tool ll-tool--danger",
1387
- onClick: ye,
1421
+ onClick: we,
1388
1422
  "aria-label": "End conversation",
1389
1423
  title: "End conversation",
1390
1424
  children: /* @__PURE__ */ n(nr, {})
1391
1425
  }
1392
1426
  )
1393
1427
  ] }),
1394
- We && /* @__PURE__ */ w("form", { className: "ll-message-input", onSubmit: he, children: [
1428
+ Ye && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: ze, children: [
1395
1429
  /* @__PURE__ */ n(
1396
1430
  "input",
1397
1431
  {
1398
1432
  type: "text",
1399
1433
  className: "ll-message-input__field",
1400
1434
  placeholder: "Message...",
1401
- value: Z,
1402
- onChange: (y) => re(y.target.value),
1435
+ value: fe,
1436
+ onChange: (p) => $e(p.target.value),
1403
1437
  "aria-label": "Message the agent"
1404
1438
  }
1405
1439
  ),
1406
- Z.trim() && /* @__PURE__ */ n(
1440
+ fe.trim() && /* @__PURE__ */ n(
1407
1441
  "button",
1408
1442
  {
1409
1443
  type: "submit",
@@ -1415,30 +1449,30 @@ const Vn = ({
1415
1449
  ] })
1416
1450
  ] }) : null,
1417
1451
  (() => {
1418
- if (N && L !== "error")
1419
- return /* @__PURE__ */ w("div", { className: "ll-expanded__banner", role: "alert", children: [
1452
+ if (N && S !== "error")
1453
+ return /* @__PURE__ */ _("div", { className: "ll-expanded__banner", role: "alert", children: [
1420
1454
  /* @__PURE__ */ n("span", { children: N }),
1421
1455
  /* @__PURE__ */ n(
1422
1456
  "button",
1423
1457
  {
1424
1458
  type: "button",
1425
1459
  className: "ll-expanded__banner-x",
1426
- onClick: fe,
1460
+ onClick: Pe,
1427
1461
  "aria-label": "Dismiss",
1428
1462
  children: "×"
1429
1463
  }
1430
1464
  )
1431
1465
  ] });
1432
- if (!H || L !== "error") return null;
1433
- let y = "Failed to connect", X = "Try again";
1434
- return H === "MIC_PERMISSION_DENIED" ? y = "Microphone blocked. Allow access to talk." : H === "MIC_NOT_FOUND" ? y = "No microphone found. Plug one in + retry." : H === "MIC_UNAVAILABLE" ? y = "Mic unavailable. Check other apps using it." : H === "AGENT_TIMEOUT" ? y = "Agent didn't pick up. Try again." : H === "CONNECT_FAILED" ? y = "Connection failed. Check your network." : H.length < 80 && (y = H), /* @__PURE__ */ w("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1435
- /* @__PURE__ */ n("span", { children: y }),
1466
+ if (!H || S !== "error") return null;
1467
+ let p = "Failed to connect", X = "Try again";
1468
+ return H === "MIC_PERMISSION_DENIED" ? p = "Microphone blocked. Allow access to talk." : H === "MIC_NOT_FOUND" ? p = "No microphone found. Plug one in + retry." : H === "MIC_UNAVAILABLE" ? p = "Mic unavailable. Check other apps using it." : H === "AGENT_TIMEOUT" ? p = "Agent didn't pick up. Try again." : H === "CONNECT_FAILED" ? p = "Connection failed. Check your network." : H.length < 80 && (p = H), /* @__PURE__ */ _("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1469
+ /* @__PURE__ */ n("span", { children: p }),
1436
1470
  /* @__PURE__ */ n(
1437
1471
  "button",
1438
1472
  {
1439
1473
  type: "button",
1440
1474
  className: "ll-expanded__banner-retry",
1441
- onClick: ve,
1475
+ onClick: _e,
1442
1476
  children: X
1443
1477
  }
1444
1478
  )
@@ -1448,33 +1482,33 @@ const Vn = ({
1448
1482
  }
1449
1483
  );
1450
1484
  };
1451
- function Xe() {
1485
+ function nt() {
1452
1486
  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" }) });
1453
1487
  }
1454
- function zt() {
1455
- return /* @__PURE__ */ w("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1488
+ function Bt() {
1489
+ return /* @__PURE__ */ _("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1456
1490
  /* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1457
1491
  /* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1458
1492
  ] });
1459
1493
  }
1460
- function Ht() {
1494
+ function qt() {
1461
1495
  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" }) });
1462
1496
  }
1463
1497
  function Xn() {
1464
- return /* @__PURE__ */ w("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: [
1498
+ return /* @__PURE__ */ _("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: [
1465
1499
  /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
1466
1500
  /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
1467
1501
  /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
1468
1502
  ] });
1469
1503
  }
1470
1504
  function Qn() {
1471
- return /* @__PURE__ */ w("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: [
1505
+ return /* @__PURE__ */ _("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: [
1472
1506
  /* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
1473
1507
  /* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
1474
1508
  ] });
1475
1509
  }
1476
1510
  function Zn({ muted: e }) {
1477
- return /* @__PURE__ */ w("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: [
1511
+ return /* @__PURE__ */ _("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: [
1478
1512
  /* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
1479
1513
  /* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
1480
1514
  /* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
@@ -1482,16 +1516,16 @@ function Zn({ muted: e }) {
1482
1516
  ] });
1483
1517
  }
1484
1518
  function er({ muted: e }) {
1485
- return /* @__PURE__ */ w("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: [
1519
+ return /* @__PURE__ */ _("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: [
1486
1520
  /* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1487
- e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ w(ut, { children: [
1521
+ e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(ht, { children: [
1488
1522
  /* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
1489
1523
  /* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1490
1524
  ] })
1491
1525
  ] });
1492
1526
  }
1493
1527
  function tr() {
1494
- return /* @__PURE__ */ w("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1528
+ return /* @__PURE__ */ _("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1495
1529
  /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
1496
1530
  /* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
1497
1531
  ] });
@@ -1505,7 +1539,7 @@ function nr() {
1505
1539
  }
1506
1540
  ) });
1507
1541
  }
1508
- const Ot = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */ w(
1542
+ const Wt = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */ _(
1509
1543
  "div",
1510
1544
  {
1511
1545
  className: "ll-device-menu",
@@ -1515,7 +1549,7 @@ const Ot = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */
1515
1549
  /* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
1516
1550
  t.map((i, l) => {
1517
1551
  const s = r === i.deviceId;
1518
- return /* @__PURE__ */ w(
1552
+ return /* @__PURE__ */ _(
1519
1553
  "button",
1520
1554
  {
1521
1555
  type: "button",
@@ -1537,7 +1571,7 @@ const Ot = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */
1537
1571
  '[data-ll-private="true"]',
1538
1572
  ".ll-widget"
1539
1573
  ];
1540
- function pt(e) {
1574
+ function gt(e) {
1541
1575
  let t = e;
1542
1576
  for (; t; ) {
1543
1577
  for (const r of rr)
@@ -1546,8 +1580,8 @@ function pt(e) {
1546
1580
  }
1547
1581
  return !1;
1548
1582
  }
1549
- function tt(e) {
1550
- if (pt(e)) return !1;
1583
+ function lt(e) {
1584
+ if (gt(e)) return !1;
1551
1585
  if (e instanceof HTMLInputElement) {
1552
1586
  if (e.type === "password") return !1;
1553
1587
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -1555,7 +1589,7 @@ function tt(e) {
1555
1589
  }
1556
1590
  return !0;
1557
1591
  }
1558
- const Qe = 4096, or = 20, ir = 20, lr = 10, ar = 10, cr = 30, qt = 500, sr = [
1592
+ const rt = 4096, or = 20, ir = 20, lr = 10, ar = 10, cr = 30, Ft = 500, sr = [
1559
1593
  '[data-ll-private="true"]',
1560
1594
  ".ll-widget",
1561
1595
  "script",
@@ -1563,7 +1597,7 @@ const Qe = 4096, or = 20, ir = 20, lr = 10, ar = 10, cr = 30, qt = 500, sr = [
1563
1597
  "noscript",
1564
1598
  "iframe"
1565
1599
  ];
1566
- function He(e) {
1600
+ function Fe(e) {
1567
1601
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
1568
1602
  let t = e;
1569
1603
  for (; t; ) {
@@ -1573,14 +1607,14 @@ function He(e) {
1573
1607
  }
1574
1608
  return !1;
1575
1609
  }
1576
- function Oe(e) {
1610
+ function Ue(e) {
1577
1611
  if (typeof window > "u") return !0;
1578
1612
  const t = e.getBoundingClientRect();
1579
1613
  if (t.width <= 0 || t.height <= 0) return !1;
1580
1614
  const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
1581
1615
  return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
1582
1616
  }
1583
- function Bt(e) {
1617
+ function Ut(e) {
1584
1618
  const t = e.getAttribute("id");
1585
1619
  if (t) {
1586
1620
  const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
@@ -1593,10 +1627,10 @@ function Bt(e) {
1593
1627
  const i = e.closest("label");
1594
1628
  return i != null && i.textContent ? i.textContent.trim() : "";
1595
1629
  }
1596
- function me(e, t) {
1630
+ function be(e, t) {
1597
1631
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
1598
1632
  }
1599
- function Ae(e) {
1633
+ function Ie(e) {
1600
1634
  return e.length;
1601
1635
  }
1602
1636
  function dr(e, t = {}) {
@@ -1616,99 +1650,99 @@ function dr(e, t = {}) {
1616
1650
  const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
1617
1651
  r.querySelectorAll("[data-ll-region]")
1618
1652
  ), d = [];
1619
- for (const p of s) {
1653
+ for (const h of s) {
1620
1654
  if (d.length >= lr) break;
1621
- if (He(p) || !Oe(p)) continue;
1622
- const N = p.getAttribute("data-ll-region") ?? "", B = p.getAttribute("data-ll-intent") ?? void 0, D = me(
1623
- (p.innerText || p.textContent || "").trim(),
1624
- qt * 2
1655
+ if (Fe(h) || !Ue(h)) continue;
1656
+ const N = h.getAttribute("data-ll-region") ?? "", q = h.getAttribute("data-ll-intent") ?? void 0, D = be(
1657
+ (h.innerText || h.textContent || "").trim(),
1658
+ Ft * 2
1625
1659
  );
1626
- !N || !D || d.push({ id: N, intent: B, text: D });
1660
+ !N || !D || d.push({ id: N, intent: q, text: D });
1627
1661
  }
1628
- const f = [], g = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
1662
+ const f = [], y = ["H1", "H2", "H3", "H4", "H5", "H6"], g = Array.from(
1629
1663
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
1630
1664
  );
1631
- for (const p of m) {
1632
- if (He(p) || !Oe(p)) continue;
1633
- const N = (p.textContent || "").trim();
1634
- N && f.push(`${p.tagName}: ${me(N, 200)}`);
1665
+ for (const h of g) {
1666
+ if (Fe(h) || !Ue(h)) continue;
1667
+ const N = (h.textContent || "").trim();
1668
+ N && f.push(`${h.tagName}: ${be(N, 200)}`);
1635
1669
  }
1636
1670
  const a = Array.from(r.querySelectorAll("p, li"));
1637
- for (const p of a) {
1638
- if (He(p) || !Oe(p) || g.includes(p.tagName)) continue;
1639
- const N = (p.textContent || "").trim();
1640
- N.length > 10 && f.push(me(N, qt));
1671
+ for (const h of a) {
1672
+ if (Fe(h) || !Ue(h) || y.includes(h.tagName)) continue;
1673
+ const N = (h.textContent || "").trim();
1674
+ N.length > 10 && f.push(be(N, Ft));
1641
1675
  }
1642
1676
  const c = f.join(`
1643
- `), R = [], C = Array.from(r.querySelectorAll("a[href]"));
1644
- for (const p of C) {
1645
- if (R.length >= or) break;
1646
- if (He(p) || !Oe(p)) continue;
1647
- const N = p.getAttribute("href") || "", B = (p.textContent || "").trim();
1648
- !N || !B || R.push({ href: N, text: me(B, 100) });
1677
+ `), I = [], C = Array.from(r.querySelectorAll("a[href]"));
1678
+ for (const h of C) {
1679
+ if (I.length >= or) break;
1680
+ if (Fe(h) || !Ue(h)) continue;
1681
+ const N = h.getAttribute("href") || "", q = (h.textContent || "").trim();
1682
+ !N || !q || I.push({ href: N, text: be(q, 100) });
1649
1683
  }
1650
- const L = [], v = Array.from(
1684
+ const S = [], v = Array.from(
1651
1685
  r.querySelectorAll(
1652
1686
  "input, textarea, select"
1653
1687
  )
1654
1688
  );
1655
- for (const p of v) {
1656
- if (L.length >= ir) break;
1657
- if (He(p) || !tt(p) || !Oe(p)) continue;
1658
- const N = Bt(p), B = p instanceof HTMLInputElement ? p.type : p.tagName.toLowerCase();
1659
- N && L.push({ label: me(N, 100), type: B });
1689
+ for (const h of v) {
1690
+ if (S.length >= ir) break;
1691
+ if (Fe(h) || !lt(h) || !Ue(h)) continue;
1692
+ const N = Ut(h), q = h instanceof HTMLInputElement ? h.type : h.tagName.toLowerCase();
1693
+ N && S.push({ label: be(N, 100), type: q });
1660
1694
  }
1661
1695
  const b = Array.from(
1662
1696
  r.querySelectorAll("[data-ll-form]")
1663
1697
  ), z = [];
1664
- for (const p of b) {
1698
+ for (const h of b) {
1665
1699
  if (z.length >= ar) break;
1666
- if (pt(p)) continue;
1667
- const N = p.getAttribute("data-ll-form") || "";
1700
+ if (gt(h)) continue;
1701
+ const N = h.getAttribute("data-ll-form") || "";
1668
1702
  if (!N) continue;
1669
- const B = p.getAttribute("data-ll-intent") || void 0, D = Array.from(
1670
- p.querySelectorAll(
1703
+ const q = h.getAttribute("data-ll-intent") || void 0, D = Array.from(
1704
+ h.querySelectorAll(
1671
1705
  "[data-ll-field]"
1672
1706
  )
1673
1707
  ), A = [];
1674
1708
  for (const O of D) {
1675
1709
  if (A.length >= cr) break;
1676
- if (!tt(O)) continue;
1710
+ if (!lt(O)) continue;
1677
1711
  const W = O.getAttribute("data-ll-field") || "";
1678
1712
  if (!W) continue;
1679
- const Y = Bt(O) || W, te = O instanceof HTMLInputElement ? O.type : O.tagName.toLowerCase();
1680
- A.push({ name: W, label: me(Y, 100), type: te });
1713
+ const Y = Ut(O) || W, ne = O instanceof HTMLInputElement ? O.type : O.tagName.toLowerCase();
1714
+ A.push({ name: W, label: be(Y, 100), type: ne });
1681
1715
  }
1682
- z.push({ id: N, intent: B, fields: A });
1716
+ z.push({ id: N, intent: q, fields: A });
1683
1717
  }
1684
- const I = {
1718
+ const M = {
1685
1719
  url: o,
1686
1720
  title: l,
1687
1721
  pathname: i,
1688
1722
  regions: d,
1689
1723
  visibleText: c,
1690
- visibleLinks: R,
1691
- visibleFields: L,
1724
+ visibleLinks: I,
1725
+ visibleFields: S,
1692
1726
  forms: z,
1693
1727
  extras: e
1694
1728
  };
1695
- let H = Ae(JSON.stringify(I.regions)) + Ae(I.visibleText) + Ae(JSON.stringify(I.visibleLinks)) + Ae(JSON.stringify(I.visibleFields));
1696
- for (; H > Qe && I.visibleFields.length > 0; )
1697
- I.visibleFields.pop(), H = Ae(JSON.stringify(I.visibleFields));
1698
- for (; H > Qe && I.visibleLinks.length > 0; )
1699
- I.visibleLinks.pop(), H -= 80;
1700
- return Ae(I.visibleText) > Qe && (I.visibleText = me(I.visibleText, Qe - 100)), I;
1701
- }
1702
- let Re = null;
1703
- function Wt(e, t = {}) {
1729
+ let H = Ie(JSON.stringify(M.regions)) + Ie(M.visibleText) + Ie(JSON.stringify(M.visibleLinks)) + Ie(JSON.stringify(M.visibleFields));
1730
+ for (; H > rt && M.visibleFields.length > 0; )
1731
+ M.visibleFields.pop(), H = Ie(JSON.stringify(M.visibleFields));
1732
+ for (; H > rt && M.visibleLinks.length > 0; )
1733
+ M.visibleLinks.pop(), H -= 80;
1734
+ return Ie(M.visibleText) > rt && (M.visibleText = be(M.visibleText, rt - 100)), M;
1735
+ }
1736
+ let Me = null;
1737
+ function jt(e, t = {}) {
1704
1738
  const r = Date.now(), i = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
1705
- if (Re && Re.key === i && r - Re.at < 1e3)
1706
- return Re.ctx;
1739
+ if (Me && Me.key === i && r - Me.at < 1e3)
1740
+ return Me.ctx;
1707
1741
  const l = dr(e, t);
1708
- return Re = { key: i, at: r, ctx: l }, l;
1742
+ return Me = { key: i, at: r, ctx: l }, l;
1709
1743
  }
1710
1744
  function ur() {
1711
- Re = null;
1745
+ Me = null;
1712
1746
  }
1713
1747
  const fr = 200;
1714
1748
  function pr(e) {
@@ -1730,36 +1764,36 @@ function mr(e) {
1730
1764
  const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), i = [], l = Array.from(t.querySelectorAll("a[href]"));
1731
1765
  for (const s of l) {
1732
1766
  if (i.length >= fr) break;
1733
- if (pt(s)) continue;
1767
+ if (gt(s)) continue;
1734
1768
  const d = s.getAttribute("href") || "";
1735
1769
  if (!hr(d)) continue;
1736
- let f = d, g = !0;
1770
+ let f = d, y = !0;
1737
1771
  try {
1738
1772
  if (typeof window < "u") {
1739
1773
  const a = new URL(d, r);
1740
- g = a.origin === r, g && d.startsWith("http") && (f = a.pathname + a.search + a.hash);
1774
+ y = a.origin === r, y && d.startsWith("http") && (f = a.pathname + a.search + a.hash);
1741
1775
  }
1742
1776
  } catch {
1743
1777
  continue;
1744
1778
  }
1745
1779
  if (o.has(f)) continue;
1746
1780
  o.add(f);
1747
- const m = (s.textContent || "").trim().slice(0, 120);
1748
- i.push({ href: f, text: m, internal: g });
1781
+ const g = (s.textContent || "").trim().slice(0, 120);
1782
+ i.push({ href: f, text: g, internal: y });
1749
1783
  }
1750
1784
  return i;
1751
1785
  }
1752
- let Ie = null;
1786
+ let Te = null;
1753
1787
  const gr = 5e3;
1754
- function st() {
1788
+ function ft() {
1755
1789
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
1756
- if (Ie && Ie.pathname === t && e - Ie.at < gr)
1757
- return Ie.routes;
1790
+ if (Te && Te.pathname === t && e - Te.at < gr)
1791
+ return Te.routes;
1758
1792
  const r = mr();
1759
- return Ie = { at: e, pathname: t, routes: r }, r;
1793
+ return Te = { at: e, pathname: t, routes: r }, r;
1760
1794
  }
1761
1795
  function yr() {
1762
- Ie = null;
1796
+ Te = null;
1763
1797
  }
1764
1798
  function vr(e, t) {
1765
1799
  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;
@@ -1812,7 +1846,7 @@ function kr() {
1812
1846
  const e = xr();
1813
1847
  return e || window;
1814
1848
  }
1815
- function Ft(e) {
1849
+ function Vt(e) {
1816
1850
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
1817
1851
  }
1818
1852
  function Lr(e) {
@@ -1846,7 +1880,7 @@ const Sr = /* @__PURE__ */ new Set([
1846
1880
  "request_routes"
1847
1881
  ]);
1848
1882
  function Cr(e) {
1849
- var wt, _t, xt, kt, Lt, St, Ct;
1883
+ var kt, Lt, St, Ct, Et, Nt, At;
1850
1884
  const {
1851
1885
  agentId: t,
1852
1886
  apiKey: r,
@@ -1856,79 +1890,79 @@ function Cr(e) {
1856
1890
  autoConnect: s = !1,
1857
1891
  displayMode: d,
1858
1892
  defaultDisplayMode: f = "expanded",
1859
- onDisplayModeChange: g,
1860
- position: m = "bottom-right",
1893
+ onDisplayModeChange: y,
1894
+ position: g = "bottom-right",
1861
1895
  mobileBreakpoint: a = 640,
1862
1896
  persistKey: c = "ll-widget",
1863
- disablePersistence: R = !1,
1897
+ disablePersistence: I = !1,
1864
1898
  teamMembers: C,
1865
- currentTeamMemberId: L,
1899
+ currentTeamMemberId: S,
1866
1900
  onTeamMemberChange: v,
1867
1901
  idleLoopUrl: b,
1868
1902
  greeting: z,
1869
- avatarImageUrl: I,
1903
+ avatarImageUrl: M,
1870
1904
  agentName: H,
1871
- branding: p = {},
1905
+ branding: h = {},
1872
1906
  allowCamera: N = !0,
1873
- allowScreenShare: B = !0,
1907
+ allowScreenShare: q = !0,
1874
1908
  allowTyping: D = !0,
1875
1909
  showOn: A,
1876
1910
  hideOn: O,
1877
1911
  pathname: W,
1878
1912
  onNavigate: Y,
1879
- onScrollToSelector: te,
1880
- getPageContext: ue,
1881
- pageContextExtras: qe,
1882
- getRoutes: Be,
1883
- onScrollPage: We,
1884
- onClick: Fe,
1885
- capabilities: ge,
1886
- onConnect: ye,
1887
- onDisconnect: ve,
1888
- onTranscript: be,
1889
- onAgentState: we,
1890
- onConnectionStateChange: _e,
1891
- onAgentEvent: xe,
1892
- onAgentCommand: ke,
1913
+ onScrollToSelector: ne,
1914
+ getPageContext: me,
1915
+ pageContextExtras: je,
1916
+ getRoutes: Ve,
1917
+ onScrollPage: Ye,
1918
+ onClick: Ge,
1919
+ capabilities: te,
1920
+ onConnect: ge,
1921
+ onDisconnect: we,
1922
+ onTranscript: _e,
1923
+ onAgentState: xe,
1924
+ onConnectionStateChange: ke,
1925
+ onAgentEvent: Le,
1926
+ onAgentCommand: Se,
1893
1927
  controlledSession: V,
1894
- className: Ue,
1895
- style: je,
1896
- zIndex: Ve = 2147483647
1897
- } = e, fe = Tn(W), ae = qn(fe, A, O);
1898
- T(() => {
1928
+ className: at,
1929
+ style: Je,
1930
+ zIndex: Ke = 2147483647
1931
+ } = e, se = Tn(W), Pe = Bn(se, A, O);
1932
+ R(() => {
1899
1933
  ur(), yr();
1900
- }, [fe]);
1901
- const ie = L !== void 0, [Le, Se] = S(() => {
1902
- var h;
1903
- return L ?? ((h = C == null ? void 0 : C[0]) == null ? void 0 : h.id);
1904
- }), pe = ie ? L : Le, K = Ze(
1905
- () => (C == null ? void 0 : C.find((h) => h.id === pe)) ?? null,
1906
- [C, pe]
1907
- ), Me = (K == null ? void 0 : K.agentId) ?? t, [ne, ee] = An({
1934
+ }, [se]);
1935
+ const Q = S !== void 0, [ye, Ce] = L(() => {
1936
+ var m;
1937
+ return S ?? ((m = C == null ? void 0 : C[0]) == null ? void 0 : m.id);
1938
+ }), K = Q ? S : ye, Z = ot(
1939
+ () => (C == null ? void 0 : C.find((m) => m.id === K)) ?? null,
1940
+ [C, K]
1941
+ ), Ee = (Z == null ? void 0 : Z.agentId) ?? t, [oe, ce] = An({
1908
1942
  value: d,
1909
1943
  defaultValue: f,
1910
- onChange: g,
1944
+ onChange: y,
1911
1945
  persistKey: c,
1912
- disablePersistence: R
1913
- }), le = In(a), ce = yn(), Z = vn(), re = wn(), he = _n(), Te = xn(), [Ye, Pe] = S(!1), [Ce, y] = S(!1), [X, Ge] = S(!1), [Yt, Gt] = S(!1), [nt, Jt] = S(!1), rt = E(Y), ot = E(te), it = E(We), lt = E(Fe), ht = E(ue), mt = E(qe), gt = E(Be), at = E(ge), oe = E(null);
1914
- rt.current = Y, ot.current = te, it.current = We, lt.current = Fe, ht.current = ue, mt.current = qe, gt.current = Be, at.current = ge;
1915
- function se(h) {
1916
- const u = at.current;
1917
- return u ? u.includes(h) : !0;
1946
+ disablePersistence: I
1947
+ }), ve = In(a), De = yn(), re = vn(), ie = wn(), le = _n(), de = xn(), [Ne, ue] = L(!1), [fe, $e] = L(!1), [ze, He] = L(!1), [Xe, ct] = L(!1), [Oe, Qe] = L(!1), p = E(Y), X = E(ne), Ze = E(Ye), st = E(Ge), yt = E(me), vt = E(je), bt = E(Ve), dt = E(te), ae = E(null);
1948
+ p.current = Y, X.current = ne, Ze.current = Ye, st.current = Ge, yt.current = me, vt.current = je, bt.current = Ve, dt.current = te;
1949
+ function pe(m) {
1950
+ const u = dt.current;
1951
+ return u ? u.includes(m) : !0;
1918
1952
  }
1919
- function de(h, u) {
1953
+ function he(m, u) {
1920
1954
  console.warn(
1921
- `[LiveLayer] Agent command "${h}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
1955
+ `[LiveLayer] Agent command "${m}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
1922
1956
  );
1923
1957
  }
1924
- const De = k(
1925
- (h) => {
1926
- var G, Ee, Ke, Et;
1927
- const u = h;
1958
+ const Be = k(
1959
+ (m) => {
1960
+ var G, Ae, tt, Rt;
1961
+ const u = m;
1928
1962
  if (!(!u.type || typeof u.type != "string")) {
1929
- if (xe == null || xe({ eventName: u.type, data: h }), u.type === "navigate") {
1930
- if (!se("navigate")) {
1931
- de("navigate", "navigate");
1963
+ if (Le == null || Le({ eventName: u.type, data: m }), u.type === "navigate") {
1964
+ if (!pe("navigate")) {
1965
+ he("navigate", "navigate");
1932
1966
  return;
1933
1967
  }
1934
1968
  const x = typeof u.href == "string" ? u.href : null;
@@ -1938,121 +1972,121 @@ function Cr(e) {
1938
1972
  );
1939
1973
  return;
1940
1974
  }
1941
- if (rt.current) {
1975
+ if (p.current) {
1942
1976
  try {
1943
- rt.current(x);
1944
- } catch (M) {
1977
+ p.current(x);
1978
+ } catch (T) {
1945
1979
  console.warn(
1946
1980
  `[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
1947
- M
1981
+ T
1948
1982
  );
1949
1983
  }
1950
1984
  return;
1951
1985
  }
1952
1986
  if (typeof document < "u") {
1953
- const M = document.querySelector(
1987
+ const T = document.querySelector(
1954
1988
  `a[href="${x.replace(/"/g, '\\"')}"]`
1955
1989
  );
1956
- if (M) {
1957
- M.click();
1990
+ if (T) {
1991
+ T.click();
1958
1992
  return;
1959
1993
  }
1960
1994
  }
1961
1995
  if (typeof window < "u" && typeof history < "u")
1962
1996
  try {
1963
1997
  history.pushState({}, "", x), window.dispatchEvent(new PopStateEvent("popstate"));
1964
- } catch (M) {
1998
+ } catch (T) {
1965
1999
  console.warn(
1966
2000
  `[LiveLayer] history.pushState fallback failed for "${x}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
1967
- M
2001
+ T
1968
2002
  );
1969
2003
  }
1970
2004
  return;
1971
2005
  }
1972
2006
  if (u.type === "scroll_to") {
1973
- if (!se("scroll")) {
1974
- de("scroll_to", "scroll");
2007
+ if (!pe("scroll")) {
2008
+ he("scroll_to", "scroll");
1975
2009
  return;
1976
2010
  }
1977
2011
  const x = typeof u.selector == "string" ? u.selector : null;
1978
2012
  if (!x) return;
1979
- const M = u.behavior === "instant" ? "instant" : "smooth";
1980
- if (ot.current) {
2013
+ const T = u.behavior === "instant" ? "instant" : "smooth";
2014
+ if (X.current) {
1981
2015
  try {
1982
- ot.current(
2016
+ X.current(
1983
2017
  x,
1984
- M
2018
+ T
1985
2019
  );
1986
- } catch (q) {
1987
- console.warn("[LiveLayer] onScrollToSelector threw.", q);
2020
+ } catch (B) {
2021
+ console.warn("[LiveLayer] onScrollToSelector threw.", B);
1988
2022
  }
1989
2023
  return;
1990
2024
  }
1991
2025
  if (typeof document < "u") {
1992
- let q = null;
2026
+ let B = null;
1993
2027
  try {
1994
- q = document.querySelector(x);
2028
+ B = document.querySelector(x);
1995
2029
  } catch {
1996
2030
  console.warn(
1997
2031
  `[LiveLayer] scroll_to: invalid selector "${x}".`
1998
2032
  );
1999
2033
  return;
2000
2034
  }
2001
- if (!q) {
2035
+ if (!B) {
2002
2036
  console.warn(
2003
2037
  `[LiveLayer] scroll_to: no element matched "${x}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
2004
2038
  );
2005
2039
  return;
2006
2040
  }
2007
- q.scrollIntoView({
2008
- behavior: M,
2041
+ B.scrollIntoView({
2042
+ behavior: T,
2009
2043
  block: "start"
2010
2044
  });
2011
2045
  }
2012
2046
  return;
2013
2047
  }
2014
2048
  if (u.type === "request_page_context") {
2015
- if (!se("read_page")) {
2016
- de("request_page_context", "read_page");
2049
+ if (!pe("read_page")) {
2050
+ he("request_page_context", "read_page");
2017
2051
  return;
2018
2052
  }
2019
- const x = typeof u.requestId == "string" ? u.requestId : void 0, M = (G = oe.current) == null ? void 0 : G.call(oe), q = (j) => {
2020
- const P = M, J = P == null ? void 0 : P.localParticipant;
2053
+ const x = typeof u.requestId == "string" ? u.requestId : void 0, T = (G = ae.current) == null ? void 0 : G.call(ae), B = (j) => {
2054
+ const P = T, J = P == null ? void 0 : P.localParticipant;
2021
2055
  if (J != null && J.publishData)
2022
2056
  try {
2023
- const Q = x ? { ...j, requestId: x } : j, Ne = new TextEncoder().encode(JSON.stringify(Q));
2024
- J.publishData(Ne, { reliable: !0 });
2025
- } catch (Q) {
2026
- console.warn("[LiveLayer] publishData failed.", Q);
2057
+ const ee = x ? { ...j, requestId: x } : j, Re = new TextEncoder().encode(JSON.stringify(ee));
2058
+ J.publishData(Re, { reliable: !0 });
2059
+ } catch (ee) {
2060
+ console.warn("[LiveLayer] publishData failed.", ee);
2027
2061
  }
2028
- }, $ = mt.current, F = ht.current;
2062
+ }, $ = vt.current, F = yt.current;
2029
2063
  try {
2030
2064
  if (F) {
2031
2065
  const j = F($);
2032
2066
  if (j instanceof Promise) {
2033
- q({ type: "page_context_pending" }), j.then((P) => q({ type: "page_context", context: P })).catch((P) => {
2067
+ B({ type: "page_context_pending" }), j.then((P) => B({ type: "page_context", context: P })).catch((P) => {
2034
2068
  console.warn(
2035
2069
  "[LiveLayer] getPageContext rejected; falling back to default walker.",
2036
2070
  P
2037
- ), q({
2071
+ ), B({
2038
2072
  type: "page_context",
2039
- context: Wt($)
2073
+ context: jt($)
2040
2074
  });
2041
2075
  });
2042
2076
  return;
2043
2077
  }
2044
- q({ type: "page_context", context: j });
2078
+ B({ type: "page_context", context: j });
2045
2079
  return;
2046
2080
  }
2047
- q({
2081
+ B({
2048
2082
  type: "page_context",
2049
- context: Wt($)
2083
+ context: jt($)
2050
2084
  });
2051
2085
  } catch (j) {
2052
2086
  console.warn(
2053
2087
  "[LiveLayer] page-context extraction threw. Sending empty context.",
2054
2088
  j
2055
- ), q({
2089
+ ), B({
2056
2090
  type: "page_context",
2057
2091
  context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: $ }
2058
2092
  });
@@ -2060,8 +2094,8 @@ function Cr(e) {
2060
2094
  return;
2061
2095
  }
2062
2096
  if (u.type === "scroll_page") {
2063
- if (!se("scroll")) {
2064
- de("scroll_page", "scroll");
2097
+ if (!pe("scroll")) {
2098
+ he("scroll_page", "scroll");
2065
2099
  return;
2066
2100
  }
2067
2101
  const x = u.direction;
@@ -2071,12 +2105,12 @@ function Cr(e) {
2071
2105
  );
2072
2106
  return;
2073
2107
  }
2074
- const M = u.behavior === "instant" ? "instant" : "smooth";
2075
- if (it.current) {
2108
+ const T = u.behavior === "instant" ? "instant" : "smooth";
2109
+ if (Ze.current) {
2076
2110
  try {
2077
- it.current(
2111
+ Ze.current(
2078
2112
  x,
2079
- M
2113
+ T
2080
2114
  );
2081
2115
  } catch (P) {
2082
2116
  console.warn("[LiveLayer] onScrollPage threw.", P);
@@ -2084,17 +2118,17 @@ function Cr(e) {
2084
2118
  return;
2085
2119
  }
2086
2120
  if (typeof window > "u") return;
2087
- const q = { behavior: M }, $ = kr(), F = (P) => {
2088
- $ instanceof Window ? $.scrollBy({ top: P, ...q }) : $.scrollBy({ top: P, ...q });
2121
+ const B = { behavior: T }, $ = kr(), F = (P) => {
2122
+ $ instanceof Window ? $.scrollBy({ top: P, ...B }) : $.scrollBy({ top: P, ...B });
2089
2123
  }, j = (P) => {
2090
- $ instanceof Window ? $.scrollTo({ top: P, ...q }) : $.scrollTo({ top: P, ...q });
2124
+ $ instanceof Window ? $.scrollTo({ top: P, ...B }) : $.scrollTo({ top: P, ...B });
2091
2125
  };
2092
- x === "up" ? F(-Ft($)) : x === "down" ? F(Ft($)) : j(x === "top" ? 0 : Lr($));
2126
+ x === "up" ? F(-Vt($)) : x === "down" ? F(Vt($)) : j(x === "top" ? 0 : Lr($));
2093
2127
  return;
2094
2128
  }
2095
2129
  if (u.type === "click") {
2096
- if (!se("click")) {
2097
- de("click", "click");
2130
+ if (!pe("click")) {
2131
+ he("click", "click");
2098
2132
  return;
2099
2133
  }
2100
2134
  const x = typeof u.selector == "string" ? u.selector : null;
@@ -2102,42 +2136,42 @@ function Cr(e) {
2102
2136
  console.warn("[LiveLayer] click: missing selector.");
2103
2137
  return;
2104
2138
  }
2105
- if (lt.current) {
2139
+ if (st.current) {
2106
2140
  try {
2107
- lt.current(x);
2108
- } catch (q) {
2109
- console.warn("[LiveLayer] onClick threw.", q);
2141
+ st.current(x);
2142
+ } catch (B) {
2143
+ console.warn("[LiveLayer] onClick threw.", B);
2110
2144
  }
2111
2145
  return;
2112
2146
  }
2113
2147
  if (typeof document > "u") return;
2114
- let M = null;
2148
+ let T = null;
2115
2149
  try {
2116
- M = document.querySelector(x);
2150
+ T = document.querySelector(x);
2117
2151
  } catch {
2118
2152
  console.warn(
2119
2153
  `[LiveLayer] click: invalid selector "${x}".`
2120
2154
  );
2121
2155
  return;
2122
2156
  }
2123
- if (!M) {
2157
+ if (!T) {
2124
2158
  console.warn(
2125
2159
  `[LiveLayer] click: no element matched "${x}". See https://livelayer.studio/docs/errors/click-no-match`
2126
2160
  );
2127
2161
  return;
2128
2162
  }
2129
- if (M.closest('[data-ll-private="true"], .ll-widget')) {
2163
+ if (T.closest('[data-ll-private="true"], .ll-widget')) {
2130
2164
  console.warn(
2131
2165
  "[LiveLayer] click: refusing to click element inside a private subtree."
2132
2166
  );
2133
2167
  return;
2134
2168
  }
2135
- (Ee = M.click) == null || Ee.call(M);
2169
+ (Ae = T.click) == null || Ae.call(T);
2136
2170
  return;
2137
2171
  }
2138
2172
  if (u.type === "fill_form" || u.type === "focus_field") {
2139
- if (!se("fill_forms")) {
2140
- de(u.type, "fill_forms");
2173
+ if (!pe("fill_forms")) {
2174
+ he(u.type, "fill_forms");
2141
2175
  return;
2142
2176
  }
2143
2177
  if (typeof document > "u") return;
@@ -2146,16 +2180,16 @@ function Cr(e) {
2146
2180
  console.warn(`[LiveLayer] ${u.type}: missing formId.`);
2147
2181
  return;
2148
2182
  }
2149
- const M = document.querySelector(
2183
+ const T = document.querySelector(
2150
2184
  `[data-ll-form="${x.replace(/"/g, '\\"')}"]`
2151
2185
  );
2152
- if (!M) {
2186
+ if (!T) {
2153
2187
  console.warn(
2154
2188
  `[LiveLayer] ${u.type}: no form with data-ll-form="${x}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
2155
2189
  );
2156
2190
  return;
2157
2191
  }
2158
- if (M.closest('[data-ll-private="true"], .ll-widget')) {
2192
+ if (T.closest('[data-ll-private="true"], .ll-widget')) {
2159
2193
  console.warn(
2160
2194
  `[LiveLayer] ${u.type}: refusing to touch a form in a private subtree.`
2161
2195
  );
@@ -2167,14 +2201,14 @@ function Cr(e) {
2167
2201
  console.warn("[LiveLayer] focus_field: missing fieldName.");
2168
2202
  return;
2169
2203
  }
2170
- const F = M.querySelector(`[data-ll-field="${$.replace(/"/g, '\\"')}"]`);
2204
+ const F = T.querySelector(`[data-ll-field="${$.replace(/"/g, '\\"')}"]`);
2171
2205
  if (!F) {
2172
2206
  console.warn(
2173
2207
  `[LiveLayer] focus_field: no field "${$}" in form "${x}".`
2174
2208
  );
2175
2209
  return;
2176
2210
  }
2177
- if (!tt(F)) {
2211
+ if (!lt(F)) {
2178
2212
  console.warn(
2179
2213
  `[LiveLayer] focus_field: field "${$}" is privacy-protected and not focusable.`
2180
2214
  );
@@ -2183,21 +2217,21 @@ function Cr(e) {
2183
2217
  F.focus();
2184
2218
  return;
2185
2219
  }
2186
- const q = u.values && typeof u.values == "object" ? u.values : null;
2187
- if (!q) {
2220
+ const B = u.values && typeof u.values == "object" ? u.values : null;
2221
+ if (!B) {
2188
2222
  console.warn("[LiveLayer] fill_form: missing or invalid values.");
2189
2223
  return;
2190
2224
  }
2191
- for (const [$, F] of Object.entries(q)) {
2225
+ for (const [$, F] of Object.entries(B)) {
2192
2226
  if (typeof F != "string") continue;
2193
- const j = M.querySelector(`[data-ll-field="${$.replace(/"/g, '\\"')}"]`);
2227
+ const j = T.querySelector(`[data-ll-field="${$.replace(/"/g, '\\"')}"]`);
2194
2228
  if (!j) {
2195
2229
  console.warn(
2196
2230
  `[LiveLayer] fill_form: no field "${$}" in form "${x}". Skipping.`
2197
2231
  );
2198
2232
  continue;
2199
2233
  }
2200
- if (!tt(j)) {
2234
+ if (!lt(j)) {
2201
2235
  console.warn(
2202
2236
  `[LiveLayer] fill_form: field "${$}" is privacy-protected (password / cc-* / private). Skipping.`
2203
2237
  );
@@ -2215,8 +2249,8 @@ function Cr(e) {
2215
2249
  return;
2216
2250
  }
2217
2251
  if (u.type === "submit_form") {
2218
- if (!se("submit_forms")) {
2219
- de("submit_form", "submit_forms");
2252
+ if (!pe("submit_forms")) {
2253
+ he("submit_form", "submit_forms");
2220
2254
  return;
2221
2255
  }
2222
2256
  if (typeof document > "u") return;
@@ -2225,27 +2259,27 @@ function Cr(e) {
2225
2259
  console.warn("[LiveLayer] submit_form: missing formId.");
2226
2260
  return;
2227
2261
  }
2228
- const M = document.querySelector(
2262
+ const T = document.querySelector(
2229
2263
  `[data-ll-form="${x.replace(/"/g, '\\"')}"]`
2230
2264
  );
2231
- if (!M) {
2265
+ if (!T) {
2232
2266
  console.warn(
2233
2267
  `[LiveLayer] submit_form: no form with data-ll-form="${x}".`
2234
2268
  );
2235
2269
  return;
2236
2270
  }
2237
- if (M.closest('[data-ll-private="true"], .ll-widget')) {
2271
+ if (T.closest('[data-ll-private="true"], .ll-widget')) {
2238
2272
  console.warn(
2239
2273
  "[LiveLayer] submit_form: refusing to submit a form in a private subtree."
2240
2274
  );
2241
2275
  return;
2242
2276
  }
2243
- const q = typeof u.requestId == "string" ? u.requestId : void 0, $ = (Ke = oe.current) == null ? void 0 : Ke.call(oe), F = (J) => {
2244
- const Q = $, Ne = Q == null ? void 0 : Q.localParticipant;
2245
- if (Ne != null && Ne.publishData)
2277
+ const B = typeof u.requestId == "string" ? u.requestId : void 0, $ = (tt = ae.current) == null ? void 0 : tt.call(ae), F = (J) => {
2278
+ const ee = $, Re = ee == null ? void 0 : ee.localParticipant;
2279
+ if (Re != null && Re.publishData)
2246
2280
  try {
2247
- const cn = q ? { ...J, requestId: q } : J, sn = new TextEncoder().encode(JSON.stringify(cn));
2248
- Ne.publishData(sn, { reliable: !0 });
2281
+ const cn = B ? { ...J, requestId: B } : J, sn = new TextEncoder().encode(JSON.stringify(cn));
2282
+ Re.publishData(sn, { reliable: !0 });
2249
2283
  } catch {
2250
2284
  }
2251
2285
  };
@@ -2253,11 +2287,11 @@ function Cr(e) {
2253
2287
  const P = () => {
2254
2288
  j = !0, F({ type: "form_submitted", formId: x });
2255
2289
  };
2256
- M.addEventListener("submit", P, { once: !0 });
2290
+ T.addEventListener("submit", P, { once: !0 });
2257
2291
  try {
2258
- typeof M.requestSubmit == "function" ? M.requestSubmit() : M.submit();
2292
+ typeof T.requestSubmit == "function" ? T.requestSubmit() : T.submit();
2259
2293
  } catch (J) {
2260
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", J), M.removeEventListener("submit", P), F({
2294
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", J), T.removeEventListener("submit", P), F({
2261
2295
  type: "form_submit_blocked",
2262
2296
  formId: x,
2263
2297
  reason: "exception"
@@ -2265,7 +2299,7 @@ function Cr(e) {
2265
2299
  return;
2266
2300
  }
2267
2301
  setTimeout(() => {
2268
- j || (M.removeEventListener("submit", P), F({
2302
+ j || (T.removeEventListener("submit", P), F({
2269
2303
  type: "form_submit_blocked",
2270
2304
  formId: x,
2271
2305
  reason: "validation"
@@ -2274,96 +2308,96 @@ function Cr(e) {
2274
2308
  return;
2275
2309
  }
2276
2310
  if (u.type === "request_routes") {
2277
- if (!se("read_page")) {
2278
- de("request_routes", "read_page");
2311
+ if (!pe("read_page")) {
2312
+ he("request_routes", "read_page");
2279
2313
  return;
2280
2314
  }
2281
- const x = typeof u.requestId == "string" ? u.requestId : void 0, q = (Et = oe.current) == null ? void 0 : Et.call(oe), $ = q == null ? void 0 : q.localParticipant;
2315
+ const x = typeof u.requestId == "string" ? u.requestId : void 0, B = (Rt = ae.current) == null ? void 0 : Rt.call(ae), $ = B == null ? void 0 : B.localParticipant;
2282
2316
  if (!($ != null && $.publishData)) return;
2283
2317
  const F = (P) => {
2284
2318
  try {
2285
- const J = x ? { type: "routes", routes: P, requestId: x } : { type: "routes", routes: P }, Q = new TextEncoder().encode(JSON.stringify(J));
2286
- $.publishData(Q, { reliable: !0 });
2319
+ const J = x ? { type: "routes", routes: P, requestId: x } : { type: "routes", routes: P }, ee = new TextEncoder().encode(JSON.stringify(J));
2320
+ $.publishData(ee, { reliable: !0 });
2287
2321
  } catch (J) {
2288
2322
  console.warn("[LiveLayer] request_routes: publishData failed.", J);
2289
2323
  }
2290
- }, j = gt.current;
2324
+ }, j = bt.current;
2291
2325
  if (j) {
2292
2326
  try {
2293
- const P = j(), J = (Q) => {
2294
- if (!Array.isArray(Q)) {
2327
+ const P = j(), J = (ee) => {
2328
+ if (!Array.isArray(ee)) {
2295
2329
  F([]);
2296
2330
  return;
2297
2331
  }
2298
- F(Q.map(pr).slice(0, 200));
2332
+ F(ee.map(pr).slice(0, 200));
2299
2333
  };
2300
- P instanceof Promise ? P.then(J).catch((Q) => {
2334
+ P instanceof Promise ? P.then(J).catch((ee) => {
2301
2335
  console.warn(
2302
2336
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
2303
- Q
2304
- ), F(st());
2337
+ ee
2338
+ ), F(ft());
2305
2339
  }) : J(P);
2306
2340
  } catch (P) {
2307
2341
  console.warn(
2308
2342
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
2309
2343
  P
2310
- ), F(st());
2344
+ ), F(ft());
2311
2345
  }
2312
2346
  return;
2313
2347
  }
2314
2348
  try {
2315
- F(st());
2349
+ F(ft());
2316
2350
  } catch (P) {
2317
2351
  console.warn("[LiveLayer] request_routes: extractRoutes threw.", P);
2318
2352
  }
2319
2353
  return;
2320
2354
  }
2321
- Sr.has(u.type) || ke == null || ke(u);
2355
+ Sr.has(u.type) || Se == null || Se(u);
2322
2356
  }
2323
2357
  },
2324
- [ke, xe]
2358
+ [Se, Le]
2325
2359
  ), U = gn({
2326
- agentId: V ? "__controlled__" : Me,
2360
+ agentId: V ? "__controlled__" : Ee,
2327
2361
  baseUrl: o,
2328
2362
  apiKey: r,
2329
2363
  sessionEndpoint: i,
2330
2364
  sessionBody: l,
2331
- onDataMessage: V ? void 0 : De
2365
+ onDataMessage: V ? void 0 : Be
2332
2366
  });
2333
- T(() => {
2367
+ R(() => {
2334
2368
  if (V != null && V.subscribeToDataMessages)
2335
- return V.subscribeToDataMessages(De);
2336
- }, [V, De]), oe.current = () => {
2337
- var h;
2338
- return (h = U.getRoom) == null ? void 0 : h.call(U);
2339
- }, T(() => {
2369
+ return V.subscribeToDataMessages(Be);
2370
+ }, [V, Be]), ae.current = () => {
2371
+ var m;
2372
+ return (m = U.getRoom) == null ? void 0 : m.call(U);
2373
+ }, R(() => {
2340
2374
  var G;
2341
- if (!fe) return;
2342
- const h = (G = U.getRoom) == null ? void 0 : G.call(U), u = h == null ? void 0 : h.localParticipant;
2375
+ if (!se) return;
2376
+ const m = (G = U.getRoom) == null ? void 0 : G.call(U), u = m == null ? void 0 : m.localParticipant;
2343
2377
  if (u != null && u.publishData)
2344
2378
  try {
2345
- const Ee = new TextEncoder().encode(
2346
- JSON.stringify({ type: "pathname", pathname: fe })
2379
+ const Ae = new TextEncoder().encode(
2380
+ JSON.stringify({ type: "pathname", pathname: se })
2347
2381
  );
2348
- u.publishData(Ee, { reliable: !0 });
2382
+ u.publishData(Ae, { reliable: !0 });
2349
2383
  } catch {
2350
2384
  }
2351
- }, [fe, U, U.connectionState]), T(() => {
2385
+ }, [se, U, U.connectionState]), R(() => {
2352
2386
  var G;
2353
2387
  if (typeof window > "u") return;
2354
- const h = ((G = window.location) == null ? void 0 : G.hostname) || "";
2355
- if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
2356
- return window.__livelayerSimulateCommand = (Ee) => {
2388
+ const m = ((G = window.location) == null ? void 0 : G.hostname) || "";
2389
+ if (m === "localhost" || m === "127.0.0.1" || m === "0.0.0.0" || m.endsWith(".local") || m.endsWith(".test"))
2390
+ return window.__livelayerSimulateCommand = (Ae) => {
2357
2391
  try {
2358
- De(Ee);
2359
- } catch (Ke) {
2360
- console.warn("[LiveLayer] simulate-command threw:", Ke);
2392
+ Be(Ae);
2393
+ } catch (tt) {
2394
+ console.warn("[LiveLayer] simulate-command threw:", tt);
2361
2395
  }
2362
2396
  }, () => {
2363
2397
  delete window.__livelayerSimulateCommand;
2364
2398
  };
2365
- }, [De]);
2366
- const _ = Ze(() => V ? {
2399
+ }, [Be]);
2400
+ const w = ot(() => V ? {
2367
2401
  connectionState: V.connectionState,
2368
2402
  agentState: V.agentState,
2369
2403
  transcript: V.transcript,
@@ -2394,191 +2428,192 @@ function Cr(e) {
2394
2428
  disconnect: U.disconnect,
2395
2429
  getRoom: U.getRoom,
2396
2430
  isControlled: !1
2397
- }, [V, U]), yt = E(null);
2398
- T(() => {
2399
- const h = _.videoElement, u = yt.current;
2400
- if (!(!h || !u))
2401
- return u.appendChild(h), () => {
2402
- h.parentNode === u && u.removeChild(h);
2431
+ }, [V, U]), wt = E(null);
2432
+ R(() => {
2433
+ const m = w.videoElement, u = wt.current;
2434
+ if (!(!m || !u))
2435
+ return u.appendChild(m), () => {
2436
+ m.parentNode === u && u.removeChild(m);
2403
2437
  };
2404
- }, [_.videoElement]), T(() => {
2405
- const h = _.audioElement;
2406
- if (!h) return;
2407
- ce.attach(h);
2408
- const u = h.play();
2438
+ }, [w.videoElement]), R(() => {
2439
+ const m = w.audioElement;
2440
+ if (!m) return;
2441
+ De.attach(m);
2442
+ const u = m.play();
2409
2443
  return u && typeof u.catch == "function" && u.catch((G) => {
2410
- (G == null ? void 0 : G.name) === "NotAllowedError" && Pe(!0);
2444
+ (G == null ? void 0 : G.name) === "NotAllowedError" && ue(!0);
2411
2445
  }), () => {
2412
- ce.detach();
2446
+ De.detach();
2413
2447
  };
2414
- }, [_.audioElement]), T(() => {
2415
- if (_.isControlled || _.connectionState !== "connected") return;
2416
- const h = _.getRoom();
2417
- if (h)
2418
- return Z.setupMic(h).catch(() => {
2419
- }), re.attachRoom(h), he.attachRoom(h), Te.refresh(), () => {
2420
- Z.teardownMic(), re.teardown(), he.teardown();
2448
+ }, [w.audioElement]), R(() => {
2449
+ if (w.isControlled || w.connectionState !== "connected") return;
2450
+ const m = w.getRoom();
2451
+ if (m)
2452
+ return re.setupMic(m).catch(() => {
2453
+ }), ie.attachRoom(m), le.attachRoom(m), de.refresh(), () => {
2454
+ re.teardownMic(), ie.teardown(), le.teardown();
2421
2455
  };
2422
- }, [_.isControlled, _.connectionState]), T(() => {
2423
- const h = _.audioElement;
2424
- h && (h.muted = nt);
2425
- }, [_.audioElement, nt]);
2426
- const Kt = k((h) => {
2427
- const u = _.getRoom();
2456
+ }, [w.isControlled, w.connectionState]), R(() => {
2457
+ const m = w.audioElement;
2458
+ m && (m.muted = Oe);
2459
+ }, [w.audioElement, Oe]);
2460
+ const Kt = k((m) => {
2461
+ const u = w.getRoom();
2428
2462
  if (u)
2429
2463
  try {
2430
2464
  const G = new TextEncoder().encode(
2431
- JSON.stringify({ type: "user_message", text: h })
2465
+ JSON.stringify({ type: "user_message", text: m })
2432
2466
  );
2433
2467
  u.localParticipant.publishData(G, { reliable: !0 });
2434
2468
  } catch {
2435
2469
  }
2436
- }, [_]), Xt = k(() => {
2437
- Jt((h) => !h);
2470
+ }, [w]), Xt = k(() => {
2471
+ Qe((m) => !m);
2438
2472
  }, []);
2439
- T(() => {
2440
- _e == null || _e(_.connectionState), _.connectionState === "connected" ? ye == null || ye() : _.connectionState === "disconnected" && (ve == null || ve());
2441
- }, [_.connectionState, ye, ve, _e]), T(() => {
2442
- be == null || be(_.transcript);
2443
- }, [_.transcript, be]), T(() => {
2444
- we == null || we(_.agentState);
2445
- }, [_.agentState, we]);
2446
- const vt = E(!1);
2447
- T(() => {
2448
- _.isControlled || !s || vt.current || ae && _.connectionState === "idle" && (vt.current = !0, _.connect());
2449
- }, [s, _.connectionState, _, ae]);
2473
+ R(() => {
2474
+ ke == null || ke(w.connectionState), w.connectionState === "connected" ? ge == null || ge() : w.connectionState === "disconnected" && (we == null || we());
2475
+ }, [w.connectionState, ge, we, ke]), R(() => {
2476
+ _e == null || _e(w.transcript);
2477
+ }, [w.transcript, _e]), R(() => {
2478
+ xe == null || xe(w.agentState);
2479
+ }, [w.agentState, xe]);
2480
+ const _t = E(!1);
2481
+ R(() => {
2482
+ w.isControlled || !s || _t.current || Pe && w.connectionState === "idle" && (_t.current = !0, w.connect());
2483
+ }, [s, w.connectionState, w, Pe]);
2450
2484
  const Qt = k(
2451
- (h) => {
2452
- const u = C == null ? void 0 : C.find((G) => G.id === h);
2453
- u && (Ge(!1), h !== pe && (y(!0), _.disconnect(), ie || Se(h), v == null || v(u)));
2485
+ (m) => {
2486
+ const u = C == null ? void 0 : C.find((G) => G.id === m);
2487
+ u && (He(!1), m !== K && ($e(!0), w.disconnect(), Q || Ce(m), v == null || v(u)));
2454
2488
  },
2455
2489
  [
2456
2490
  C,
2457
- pe,
2458
- _,
2459
- ie,
2491
+ K,
2492
+ w,
2493
+ Q,
2460
2494
  v
2461
2495
  ]
2462
2496
  );
2463
- T(() => {
2464
- Ce && _.connectionState === "connected" && y(!1);
2465
- }, [_.connectionState, Ce]), T(() => {
2466
- if (!X) return;
2467
- const h = (u) => {
2468
- u.key === "Escape" && Ge(!1);
2497
+ R(() => {
2498
+ fe && w.connectionState === "connected" && $e(!1);
2499
+ }, [w.connectionState, fe]), R(() => {
2500
+ if (!ze) return;
2501
+ const m = (u) => {
2502
+ u.key === "Escape" && He(!1);
2469
2503
  };
2470
- return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
2471
- }, [X]);
2472
- const Zt = !!I || !!(K != null && K.avatarImageUrl) || _.isControlled, $e = kn(Me, o, Zt);
2473
- ge === void 0 && ((wt = $e.info) != null && wt.capabilities) && (at.current = $e.info.capabilities);
2474
- const Je = (K == null ? void 0 : K.name) ?? H ?? ((_t = _.agentConfig) == null ? void 0 : _t.name) ?? ((xt = $e.info) == null ? void 0 : xt.name) ?? "Live Layer", ct = (K == null ? void 0 : K.avatarImageUrl) ?? I ?? ((kt = _.agentConfig) == null ? void 0 : kt.avatarImageUrl) ?? ((Lt = $e.info) == null ? void 0 : Lt.avatarImageUrl) ?? null, en = b ?? ((St = _.agentConfig) == null ? void 0 : St.idleLoopUrl) ?? ((Ct = $e.info) == null ? void 0 : Ct.idleLoopUrl) ?? null, tn = z ?? null, nn = k(() => ee("expanded"), [ee]), rn = k(
2475
- () => ee("minimized"),
2476
- [ee]
2477
- ), bt = k(() => {
2478
- _.disconnect(), ee("hidden");
2479
- }, [_, ee]), on = k(() => {
2480
- const h = _.audioElement;
2481
- h && h.play().then(() => Pe(!1)).catch(() => {
2504
+ return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
2505
+ }, [ze]);
2506
+ const Zt = !!M || !!(Z != null && Z.avatarImageUrl) || w.isControlled, qe = kn(Ee, o, Zt);
2507
+ te === void 0 && ((kt = qe.info) != null && kt.capabilities) && (dt.current = qe.info.capabilities);
2508
+ const et = (Z == null ? void 0 : Z.name) ?? H ?? ((Lt = w.agentConfig) == null ? void 0 : Lt.name) ?? ((St = qe.info) == null ? void 0 : St.name) ?? "Live Layer", ut = (Z == null ? void 0 : Z.avatarImageUrl) ?? M ?? ((Ct = w.agentConfig) == null ? void 0 : Ct.avatarImageUrl) ?? ((Et = qe.info) == null ? void 0 : Et.avatarImageUrl) ?? null, en = b ?? ((Nt = w.agentConfig) == null ? void 0 : Nt.idleLoopUrl) ?? ((At = qe.info) == null ? void 0 : At.idleLoopUrl) ?? null, tn = z ?? null, nn = k(() => ce("expanded"), [ce]), rn = k(
2509
+ () => ce("minimized"),
2510
+ [ce]
2511
+ ), xt = k(() => {
2512
+ w.disconnect(), ce("hidden");
2513
+ }, [w, ce]), on = k(() => {
2514
+ const m = w.audioElement;
2515
+ m && m.play().then(() => ue(!1)).catch(() => {
2482
2516
  });
2483
- }, [_.audioElement]), ln = k(() => {
2484
- Pe(!1), _.connect();
2485
- }, [_]), ze = {
2486
- ...je,
2487
- zIndex: Ve
2517
+ }, [w.audioElement]), ln = k(() => {
2518
+ ue(!1), w.connect();
2519
+ }, [w]), We = {
2520
+ ...Je,
2521
+ zIndex: Ke
2488
2522
  };
2489
- p.primaryColor && (ze["--ll-color-primary"] = p.primaryColor), p.accentColor && (ze["--ll-color-accent"] = p.accentColor), p.backgroundColor && (ze["--ll-color-bg"] = p.backgroundColor), p.textColor && (ze["--ll-color-fg"] = p.textColor);
2523
+ h.primaryColor && (We["--ll-color-primary"] = h.primaryColor), h.accentColor && (We["--ll-color-accent"] = h.accentColor), h.backgroundColor && (We["--ll-color-bg"] = h.backgroundColor), h.textColor && (We["--ll-color-fg"] = h.textColor);
2490
2524
  const an = [
2491
2525
  "ll-widget",
2492
- `ll-widget--${ne}`,
2493
- `ll-widget--${le ? "mobile" : "desktop"}`,
2494
- Ue
2526
+ `ll-widget--${oe}`,
2527
+ `ll-widget--${ve ? "mobile" : "desktop"}`,
2528
+ at
2495
2529
  ].filter(Boolean).join(" ");
2496
- return ae ? /* @__PURE__ */ w(
2530
+ return Pe ? /* @__PURE__ */ _(
2497
2531
  "div",
2498
2532
  {
2499
2533
  className: an,
2500
- style: ze,
2501
- "data-display-mode": ne,
2502
- "data-position": m,
2534
+ style: We,
2535
+ "data-display-mode": oe,
2536
+ "data-position": g,
2503
2537
  children: [
2504
- ne === "hidden" && /* @__PURE__ */ n(
2538
+ oe === "hidden" && /* @__PURE__ */ n(
2505
2539
  Vn,
2506
2540
  {
2507
- position: m,
2508
- isMobile: le,
2509
- isSpeaking: _.agentState === "speaking",
2510
- onExpand: () => ee("expanded"),
2511
- label: `Open ${Je} widget`,
2512
- avatarImageUrl: ct,
2513
- agentName: Je
2541
+ position: g,
2542
+ isMobile: ve,
2543
+ isSpeaking: w.agentState === "speaking",
2544
+ onExpand: () => ce("expanded"),
2545
+ label: `Open ${et} widget`,
2546
+ avatarImageUrl: ut,
2547
+ agentName: et
2514
2548
  }
2515
2549
  ),
2516
- ne === "minimized" && /* @__PURE__ */ n(
2550
+ oe === "minimized" && /* @__PURE__ */ n(
2517
2551
  Gn,
2518
2552
  {
2519
- position: m,
2520
- isMobile: le,
2521
- agentName: Je,
2522
- avatarImageUrl: ct,
2523
- agentState: _.agentState,
2524
- isMuted: Z.isMuted,
2525
- audioLevel: ce,
2553
+ position: g,
2554
+ isMobile: ve,
2555
+ agentName: et,
2556
+ avatarImageUrl: ut,
2557
+ agentState: w.agentState,
2558
+ isMuted: re.isMuted,
2559
+ audioLevel: De,
2526
2560
  onExpand: nn,
2527
- onToggleMute: Z.toggleMute,
2528
- onClose: bt
2561
+ onToggleMute: re.toggleMute,
2562
+ onClose: xt
2529
2563
  }
2530
2564
  ),
2531
- ne === "expanded" && /* @__PURE__ */ n(
2565
+ oe === "expanded" && /* @__PURE__ */ n(
2532
2566
  Kn,
2533
2567
  {
2534
- position: m,
2535
- isMobile: le,
2536
- agentName: Je,
2537
- avatarImageUrl: ct,
2568
+ position: g,
2569
+ isMobile: ve,
2570
+ agentName: et,
2571
+ avatarImageUrl: ut,
2538
2572
  idleLoopUrl: en,
2539
2573
  greeting: tn,
2540
- branding: p,
2574
+ branding: h,
2541
2575
  teamMembers: C,
2542
- currentTeamMemberId: pe,
2543
- isSwitchingTeamMember: Ce,
2544
- teamSwitcherOpen: X,
2545
- onToggleTeamSwitcher: () => Ge((h) => !h),
2576
+ currentTeamMemberId: K,
2577
+ isSwitchingTeamMember: fe,
2578
+ teamSwitcherOpen: ze,
2579
+ onToggleTeamSwitcher: () => He((m) => !m),
2546
2580
  onSelectTeamMember: Qt,
2547
- connectionState: _.connectionState,
2548
- agentState: _.agentState,
2549
- transcript: _.transcript,
2550
- isMuted: Z.isMuted,
2551
- micDevices: Te.mics,
2552
- isCameraEnabled: re.isEnabled,
2553
- cameraPreviewEl: re.previewEl,
2554
- cameraDevices: Te.cameras,
2555
- activeCameraId: re.activeDeviceId,
2556
- isScreenShareEnabled: he.isEnabled,
2557
- screenPreviewEl: he.previewEl,
2558
- isSpeakerMuted: nt,
2581
+ connectionState: w.connectionState,
2582
+ agentState: w.agentState,
2583
+ transcript: w.transcript,
2584
+ isMuted: re.isMuted,
2585
+ micDevices: de.mics,
2586
+ isCameraEnabled: ie.isEnabled,
2587
+ cameraPreviewEl: ie.previewEl,
2588
+ cameraDevices: de.cameras,
2589
+ activeCameraId: ie.activeDeviceId,
2590
+ isScreenShareEnabled: le.isEnabled,
2591
+ screenPreviewEl: le.previewEl,
2592
+ isSpeakerMuted: Oe,
2559
2593
  allowCamera: N,
2560
- allowScreenShare: B,
2594
+ allowScreenShare: q,
2561
2595
  allowTyping: D,
2562
- languageMenuOpen: Yt,
2563
- onToggleLanguageMenu: () => Gt((h) => !h),
2564
- needsUserGesture: Ye,
2565
- canResume: _.canResume,
2566
- micError: Z.micError,
2567
- error: _.error,
2568
- avatarVideoContainerRef: yt,
2569
- onConnect: () => void _.connect(),
2570
- onDisconnect: () => _.disconnect(),
2596
+ languageMenuOpen: Xe,
2597
+ onToggleLanguageMenu: () => ct((m) => !m),
2598
+ needsUserGesture: Ne,
2599
+ canResume: w.canResume,
2600
+ micError: re.micError,
2601
+ error: w.error,
2602
+ avatarVideoContainerRef: wt,
2603
+ agentVideoEl: w.videoElement,
2604
+ onConnect: () => void w.connect(),
2605
+ onDisconnect: () => w.disconnect(),
2571
2606
  onRetry: ln,
2572
2607
  onResumeAudio: on,
2573
- onToggleMute: Z.toggleMute,
2574
- onToggleCamera: () => void re.toggle(),
2575
- onSwitchCameraDevice: (h) => void re.switchDevice(h),
2576
- onToggleScreenShare: () => void he.toggle(),
2608
+ onToggleMute: re.toggleMute,
2609
+ onToggleCamera: () => void ie.toggle(),
2610
+ onSwitchCameraDevice: (m) => void ie.switchDevice(m),
2611
+ onToggleScreenShare: () => void le.toggle(),
2577
2612
  onToggleSpeaker: Xt,
2578
2613
  onSendMessage: Kt,
2579
2614
  onMinimize: rn,
2580
- onClose: bt,
2581
- onClearMicError: Z.clearError
2615
+ onClose: xt,
2616
+ onClearMicError: re.clearError
2582
2617
  }
2583
2618
  )
2584
2619
  ]
@@ -2597,24 +2632,24 @@ const Dr = ({
2597
2632
  className: l,
2598
2633
  style: s
2599
2634
  }) => {
2600
- const d = E(null), f = E(null), g = E(i);
2601
- g.current = i;
2602
- const m = k((a) => {
2603
- var R;
2635
+ const d = E(null), f = E(null), y = E(i);
2636
+ y.current = i;
2637
+ const g = k((a) => {
2638
+ var I;
2604
2639
  const c = a.detail;
2605
- (R = g.current) == null || R.call(g, c);
2640
+ (I = y.current) == null || I.call(y, c);
2606
2641
  }, []);
2607
- return T(() => {
2642
+ return R(() => {
2608
2643
  const a = d.current;
2609
2644
  if (!a) return;
2610
2645
  const c = document.createElement("livelayer-widget");
2611
- 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", m), a.appendChild(c), f.current = c, () => {
2612
- c.removeEventListener("agent-event", m), a.removeChild(c), f.current = null;
2646
+ 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", g), a.appendChild(c), f.current = c, () => {
2647
+ c.removeEventListener("agent-event", g), a.removeChild(c), f.current = null;
2613
2648
  };
2614
- }, [e]), T(() => {
2649
+ }, [e]), R(() => {
2615
2650
  f.current && (o ? f.current.setAttribute("mode", o) : f.current.removeAttribute("mode"));
2616
2651
  }, [o]), /* @__PURE__ */ n("div", { ref: d, className: l, style: s });
2617
- }, $r = ft(
2652
+ }, $r = mt(
2618
2653
  function({ id: t, intent: r, as: o = "div", className: i, style: l, children: s }, d) {
2619
2654
  return un(
2620
2655
  o,
@@ -2628,7 +2663,7 @@ const Dr = ({
2628
2663
  s
2629
2664
  );
2630
2665
  }
2631
- ), zr = ft(
2666
+ ), zr = mt(
2632
2667
  function({ id: t, intent: r, children: o, ...i }, l) {
2633
2668
  return /* @__PURE__ */ n(
2634
2669
  "form",
@@ -2641,12 +2676,12 @@ const Dr = ({
2641
2676
  }
2642
2677
  );
2643
2678
  }
2644
- ), Hr = ft(
2679
+ ), Hr = mt(
2645
2680
  function(t, r) {
2646
2681
  const { name: o, label: i, labelClassName: l } = t, s = { name: o, "data-ll-field": o };
2647
2682
  let d;
2648
2683
  if ("as" in t && t.as === "textarea") {
2649
- const { name: f, label: g, labelClassName: m, as: a, ...c } = t;
2684
+ const { name: f, label: y, labelClassName: g, as: a, ...c } = t;
2650
2685
  d = /* @__PURE__ */ n(
2651
2686
  "textarea",
2652
2687
  {
@@ -2656,18 +2691,18 @@ const Dr = ({
2656
2691
  }
2657
2692
  );
2658
2693
  } else if ("as" in t && t.as === "select") {
2659
- const { name: f, label: g, labelClassName: m, as: a, children: c, ...R } = t;
2694
+ const { name: f, label: y, labelClassName: g, as: a, children: c, ...I } = t;
2660
2695
  d = /* @__PURE__ */ n(
2661
2696
  "select",
2662
2697
  {
2663
2698
  ref: r,
2664
2699
  ...s,
2665
- ...R,
2700
+ ...I,
2666
2701
  children: c
2667
2702
  }
2668
2703
  );
2669
2704
  } else {
2670
- const { name: f, label: g, labelClassName: m, as: a, ...c } = t;
2705
+ const { name: f, label: y, labelClassName: g, as: a, ...c } = t;
2671
2706
  d = /* @__PURE__ */ n(
2672
2707
  "input",
2673
2708
  {
@@ -2677,38 +2712,38 @@ const Dr = ({
2677
2712
  }
2678
2713
  );
2679
2714
  }
2680
- return i === void 0 ? d : /* @__PURE__ */ w("label", { className: l, children: [
2715
+ return i === void 0 ? d : /* @__PURE__ */ _("label", { className: l, children: [
2681
2716
  i,
2682
2717
  d
2683
2718
  ] });
2684
2719
  }
2685
2720
  );
2686
- let Ut = 1;
2721
+ let Yt = 1;
2687
2722
  function Or({
2688
2723
  onMount: e,
2689
2724
  defaultOpen: t = !1,
2690
2725
  storageKey: r = "ll-debug-open"
2691
2726
  }) {
2692
- const [o, i] = S(t), [l, s] = S([]), [d, f] = S(""), [g, m] = S(!1), a = E(/* @__PURE__ */ new Set()), c = E([]), R = E(g);
2693
- R.current = g, T(() => {
2727
+ const [o, i] = L(t), [l, s] = L([]), [d, f] = L(""), [y, g] = L(!1), a = E(/* @__PURE__ */ new Set()), c = E([]), I = E(y);
2728
+ I.current = y, R(() => {
2694
2729
  try {
2695
2730
  const v = localStorage.getItem(r);
2696
2731
  v === "1" && i(!0), v === "0" && i(!1);
2697
2732
  } catch {
2698
2733
  }
2699
- }, [r]), T(() => {
2734
+ }, [r]), R(() => {
2700
2735
  try {
2701
2736
  localStorage.setItem(r, o ? "1" : "0");
2702
2737
  } catch {
2703
2738
  }
2704
- }, [o, r]), T(() => {
2739
+ }, [o, r]), R(() => {
2705
2740
  const v = (b) => {
2706
2741
  (b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), i((z) => !z));
2707
2742
  };
2708
2743
  return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
2709
- }, []), T(() => {
2744
+ }, []), R(() => {
2710
2745
  const v = setInterval(() => {
2711
- if (c.current.length === 0 || R.current) return;
2746
+ if (c.current.length === 0 || I.current) return;
2712
2747
  const b = c.current.splice(0, c.current.length);
2713
2748
  s(
2714
2749
  (z) => [...b.reverse(), ...z].slice(0, 200)
@@ -2717,30 +2752,30 @@ function Or({
2717
2752
  return () => clearInterval(v);
2718
2753
  }, []);
2719
2754
  const C = E(!1);
2720
- if (T(() => {
2755
+ if (R(() => {
2721
2756
  !e || C.current || (C.current = !0, e((v) => {
2722
2757
  c.current.push({
2723
- id: Ut++,
2758
+ id: Yt++,
2724
2759
  ts: Date.now(),
2725
2760
  kind: "event",
2726
2761
  type: v.eventName,
2727
2762
  data: v.data
2728
2763
  });
2729
2764
  }));
2730
- }, [e]), T(() => {
2731
- const v = console.warn, b = console.log, z = (I, H) => function(...p) {
2765
+ }, [e]), R(() => {
2766
+ const v = console.warn, b = console.log, z = (M, H) => function(...h) {
2732
2767
  try {
2733
- const N = typeof p[0] == "string" ? p[0] : "";
2768
+ const N = typeof h[0] == "string" ? h[0] : "";
2734
2769
  N.startsWith("[LiveLayer]") && c.current.push({
2735
- id: Ut++,
2770
+ id: Yt++,
2736
2771
  ts: Date.now(),
2737
- kind: I,
2772
+ kind: M,
2738
2773
  type: N.slice(0, 120),
2739
- data: { args: p.slice(1).map((B) => Nr(B)) }
2774
+ data: { args: h.slice(1).map((q) => Nr(q)) }
2740
2775
  });
2741
2776
  } catch {
2742
2777
  }
2743
- return H.apply(this, p);
2778
+ return H.apply(this, h);
2744
2779
  };
2745
2780
  return console.warn = z("warn", v), console.log = z("log", b), () => {
2746
2781
  console.warn = v, console.log = b;
@@ -2772,12 +2807,12 @@ function Or({
2772
2807
  children: "🛰 LL debug"
2773
2808
  }
2774
2809
  );
2775
- const L = l.filter((v) => {
2810
+ const S = l.filter((v) => {
2776
2811
  if (!d) return !0;
2777
2812
  const b = d.toLowerCase();
2778
2813
  return v.type.toLowerCase().includes(b) || JSON.stringify(v.data || {}).toLowerCase().includes(b);
2779
2814
  });
2780
- return /* @__PURE__ */ w(
2815
+ return /* @__PURE__ */ _(
2781
2816
  "div",
2782
2817
  {
2783
2818
  style: {
@@ -2799,7 +2834,7 @@ function Or({
2799
2834
  overflow: "hidden"
2800
2835
  },
2801
2836
  children: [
2802
- /* @__PURE__ */ w(
2837
+ /* @__PURE__ */ _(
2803
2838
  "div",
2804
2839
  {
2805
2840
  style: {
@@ -2812,7 +2847,7 @@ function Or({
2812
2847
  },
2813
2848
  children: [
2814
2849
  /* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
2815
- /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
2850
+ /* @__PURE__ */ _("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
2816
2851
  l.length,
2817
2852
  " event",
2818
2853
  l.length === 1 ? "" : "s"
@@ -2822,10 +2857,10 @@ function Or({
2822
2857
  "button",
2823
2858
  {
2824
2859
  type: "button",
2825
- onClick: () => m((v) => !v),
2826
- style: dt(g ? "#f59e0b" : "transparent"),
2860
+ onClick: () => g((v) => !v),
2861
+ style: pt(y ? "#f59e0b" : "transparent"),
2827
2862
  title: "Pause / resume capture",
2828
- children: g ? "▶ resume" : "⏸ pause"
2863
+ children: y ? "▶ resume" : "⏸ pause"
2829
2864
  }
2830
2865
  ),
2831
2866
  /* @__PURE__ */ n(
@@ -2835,7 +2870,7 @@ function Or({
2835
2870
  onClick: () => {
2836
2871
  s([]), c.current = [];
2837
2872
  },
2838
- style: dt("transparent"),
2873
+ style: pt("transparent"),
2839
2874
  title: "Clear buffer",
2840
2875
  children: "clear"
2841
2876
  }
@@ -2845,7 +2880,7 @@ function Or({
2845
2880
  {
2846
2881
  type: "button",
2847
2882
  onClick: () => i(!1),
2848
- style: dt("transparent"),
2883
+ style: pt("transparent"),
2849
2884
  "aria-label": "Close",
2850
2885
  title: "Close (Cmd/Ctrl + Shift + L)",
2851
2886
  children: "✕"
@@ -2881,7 +2916,7 @@ function Or({
2881
2916
  overflowY: "auto",
2882
2917
  padding: "0 8px 8px"
2883
2918
  },
2884
- children: L.length === 0 ? /* @__PURE__ */ w(
2919
+ children: S.length === 0 ? /* @__PURE__ */ _(
2885
2920
  "div",
2886
2921
  {
2887
2922
  style: {
@@ -2911,7 +2946,7 @@ function Or({
2911
2946
  )
2912
2947
  ]
2913
2948
  }
2914
- ) : L.map((v) => /* @__PURE__ */ n(
2949
+ ) : S.map((v) => /* @__PURE__ */ n(
2915
2950
  Er,
2916
2951
  {
2917
2952
  entry: v,
@@ -2936,7 +2971,7 @@ function Er({
2936
2971
  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", {
2937
2972
  hour12: !1
2938
2973
  });
2939
- return /* @__PURE__ */ w(
2974
+ return /* @__PURE__ */ _(
2940
2975
  "button",
2941
2976
  {
2942
2977
  type: "button",
@@ -2954,7 +2989,7 @@ function Er({
2954
2989
  lineHeight: 1.4
2955
2990
  },
2956
2991
  children: [
2957
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
2992
+ /* @__PURE__ */ _("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
2958
2993
  /* @__PURE__ */ n(
2959
2994
  "span",
2960
2995
  {
@@ -2998,7 +3033,7 @@ function Er({
2998
3033
  }
2999
3034
  );
3000
3035
  }
3001
- function dt(e) {
3036
+ function pt(e) {
3002
3037
  return {
3003
3038
  background: e,
3004
3039
  color: "#fff",
@@ -3016,8 +3051,8 @@ function Nr(e) {
3016
3051
  return String(e);
3017
3052
  }
3018
3053
  }
3019
- function qr() {
3020
- const [e, t] = S([]), r = k((i) => {
3054
+ function Br() {
3055
+ const [e, t] = L([]), r = k((i) => {
3021
3056
  t((l) => {
3022
3057
  const s = l.findIndex((d) => d.id === i.id);
3023
3058
  if (s >= 0) {
@@ -3046,8 +3081,8 @@ export {
3046
3081
  yr as clearRoutesCache,
3047
3082
  dr as extractPageContext,
3048
3083
  mr as extractRoutes,
3049
- Wt as getCachedPageContext,
3050
- st as getCachedRoutes,
3084
+ jt as getCachedPageContext,
3085
+ ft as getCachedRoutes,
3051
3086
  Hn as matchesPattern,
3052
3087
  pr as normalizeRouteInput,
3053
3088
  On as shouldRenderAtPath,
@@ -3061,7 +3096,7 @@ export {
3061
3096
  xn as useMediaDevices,
3062
3097
  vn as useMicrophoneState,
3063
3098
  Tn as usePathname,
3064
- qn as useRouteMatch,
3099
+ Bn as useRouteMatch,
3065
3100
  _n as useScreenShareState,
3066
- qr as useTranscript
3101
+ Br as useTranscript
3067
3102
  };