@livelayer/react 0.15.2 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +940 -952
- package/dist/styles.css +32 -9
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as x, jsx as n, Fragment as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
2
|
+
import { jsxs as x, jsx as n, Fragment as ze } from "react/jsx-runtime";
|
|
3
|
+
import { Component as Vn, useState as N, useRef as M, useEffect as T, useCallback as E, useMemo as Qe, useLayoutEffect as Ln, forwardRef as Pt, useImperativeHandle as Yn, createElement as Gn } from "react";
|
|
4
|
+
import { createPortal as $t } from "react-dom";
|
|
5
|
+
import { LiveKitSession as Kn, registerFields as Jn } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as Fo, getRegisteredFields as Wo, registerFields as qo, setFieldValue as Uo } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Zn } from "livekit-client";
|
|
8
|
+
class Qn extends Vn {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -15,8 +15,8 @@ class rr extends Jn {
|
|
|
15
15
|
return { hasError: !0, error: t };
|
|
16
16
|
}
|
|
17
17
|
componentDidCatch(t, r) {
|
|
18
|
-
var
|
|
19
|
-
(a = (
|
|
18
|
+
var o, a;
|
|
19
|
+
(a = (o = this.props).onError) == null || a.call(o, t, r);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
var t;
|
|
@@ -35,9 +35,9 @@ class rr extends Jn {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const [t, r] = N("idle"), [
|
|
40
|
-
L.current = e.onDataMessage,
|
|
38
|
+
function er(e) {
|
|
39
|
+
const [t, r] = N("idle"), [o, a] = N("idle"), [i, s] = N([]), [l, c] = N(null), [p, w] = N(null), [m, f] = N(null), [R, _] = N(!1), [y, u] = N(null), h = M(null), L = M(e.onDataMessage);
|
|
40
|
+
L.current = e.onDataMessage, T(() => {
|
|
41
41
|
const b = {
|
|
42
42
|
onConnectionStateChange: (O) => {
|
|
43
43
|
r(O), O === "connected" && u(null);
|
|
@@ -54,7 +54,7 @@ function ir(e) {
|
|
|
54
54
|
(q = L.current) == null || q.call(L, O);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: _
|
|
57
|
-
}, P = new
|
|
57
|
+
}, P = new Kn(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -92,12 +92,12 @@ function ir(e) {
|
|
|
92
92
|
}, []);
|
|
93
93
|
return {
|
|
94
94
|
connectionState: t,
|
|
95
|
-
agentState:
|
|
96
|
-
transcript:
|
|
95
|
+
agentState: o,
|
|
96
|
+
transcript: i,
|
|
97
97
|
agentConfig: l,
|
|
98
98
|
videoElement: p,
|
|
99
99
|
audioElement: m,
|
|
100
|
-
canResume:
|
|
100
|
+
canResume: R,
|
|
101
101
|
error: y,
|
|
102
102
|
connect: A,
|
|
103
103
|
disconnect: I,
|
|
@@ -105,8 +105,8 @@ function ir(e) {
|
|
|
105
105
|
session: h.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const e = M(null), t = M(/* @__PURE__ */ new Map()), r = M(null),
|
|
108
|
+
function tr() {
|
|
109
|
+
const e = M(null), t = M(/* @__PURE__ */ new Map()), r = M(null), o = M(/* @__PURE__ */ new Set()), a = E(() => {
|
|
110
110
|
const _ = t.current;
|
|
111
111
|
if (_.size === 0) {
|
|
112
112
|
r.current = null;
|
|
@@ -120,14 +120,14 @@ function or() {
|
|
|
120
120
|
const A = L / h.length / 255;
|
|
121
121
|
A > y && (y = A);
|
|
122
122
|
}
|
|
123
|
-
for (const u of
|
|
123
|
+
for (const u of o.current)
|
|
124
124
|
try {
|
|
125
125
|
u(y);
|
|
126
126
|
} catch (h) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", h);
|
|
128
128
|
}
|
|
129
129
|
r.current = requestAnimationFrame(a);
|
|
130
|
-
}, []),
|
|
130
|
+
}, []), i = E(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = E(() => {
|
|
131
131
|
r.current === null && t.current.size > 0 && (r.current = requestAnimationFrame(a));
|
|
132
132
|
}, [a]), l = E((_) => {
|
|
133
133
|
const y = t.current.get(_);
|
|
@@ -144,7 +144,7 @@ function or() {
|
|
|
144
144
|
}
|
|
145
145
|
}, []), c = E(
|
|
146
146
|
(_, y) => {
|
|
147
|
-
const u =
|
|
147
|
+
const u = i();
|
|
148
148
|
if (!u) return;
|
|
149
149
|
l(_);
|
|
150
150
|
const h = y(u);
|
|
@@ -163,7 +163,7 @@ function or() {
|
|
|
163
163
|
buffer: new Uint8Array(new ArrayBuffer(L.frequencyBinCount))
|
|
164
164
|
}), s();
|
|
165
165
|
},
|
|
166
|
-
[l,
|
|
166
|
+
[l, i, s]
|
|
167
167
|
), p = E(
|
|
168
168
|
(_, y = "agent") => {
|
|
169
169
|
c(y, (u) => {
|
|
@@ -203,10 +203,10 @@ function or() {
|
|
|
203
203
|
r.current !== null && (cancelAnimationFrame(r.current), r.current = null);
|
|
204
204
|
for (const _ of Array.from(t.current.keys()))
|
|
205
205
|
l(_);
|
|
206
|
-
}, [l]),
|
|
207
|
-
|
|
206
|
+
}, [l]), R = E((_) => (o.current.add(_), () => {
|
|
207
|
+
o.current.delete(_);
|
|
208
208
|
}), []);
|
|
209
|
-
return
|
|
209
|
+
return T(() => () => {
|
|
210
210
|
if (f(), e.current) {
|
|
211
211
|
try {
|
|
212
212
|
e.current.close();
|
|
@@ -214,15 +214,15 @@ function or() {
|
|
|
214
214
|
}
|
|
215
215
|
e.current = null;
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
}, [f]), { attach: p, attachStream: w, detach: f, detachSlot: m, subscribe:
|
|
217
|
+
o.current.clear();
|
|
218
|
+
}, [f]), { attach: p, attachStream: w, detach: f, detachSlot: m, subscribe: R };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function nr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const [e, t] = N(!1), [r,
|
|
224
|
+
function rr() {
|
|
225
|
+
const [e, t] = N(!1), [r, o] = N(""), [a, i] = N(null), s = M(null), l = M(null), c = E(async (y) => {
|
|
226
226
|
var u, h;
|
|
227
227
|
if (s.current && l.current) {
|
|
228
228
|
try {
|
|
@@ -231,18 +231,18 @@ function ar() {
|
|
|
231
231
|
}
|
|
232
232
|
s.current.stop(), s.current = null;
|
|
233
233
|
}
|
|
234
|
-
l.current = y,
|
|
234
|
+
l.current = y, i(null);
|
|
235
235
|
try {
|
|
236
|
-
const L = await
|
|
236
|
+
const L = await Xn({
|
|
237
237
|
echoCancellation: !0,
|
|
238
238
|
noiseSuppression: !0
|
|
239
239
|
});
|
|
240
240
|
await y.localParticipant.publishTrack(L), s.current = L, t(L.isMuted);
|
|
241
241
|
const A = (h = (u = L.mediaStreamTrack) == null ? void 0 : u.getSettings) == null ? void 0 : h.call(u);
|
|
242
|
-
A != null && A.deviceId &&
|
|
242
|
+
A != null && A.deviceId && o(A.deviceId);
|
|
243
243
|
} catch (L) {
|
|
244
244
|
const A = L instanceof Error && L.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
245
|
-
throw
|
|
245
|
+
throw i(A), L;
|
|
246
246
|
}
|
|
247
247
|
}, []), p = E((y) => {
|
|
248
248
|
l.current = y;
|
|
@@ -250,7 +250,7 @@ function ar() {
|
|
|
250
250
|
const u = l.current;
|
|
251
251
|
if (u)
|
|
252
252
|
try {
|
|
253
|
-
await u.switchActiveDevice("audioinput", y),
|
|
253
|
+
await u.switchActiveDevice("audioinput", y), o(y);
|
|
254
254
|
} catch (h) {
|
|
255
255
|
console.warn("[useMicrophoneState] switchDevice failed:", h);
|
|
256
256
|
}
|
|
@@ -271,8 +271,8 @@ function ar() {
|
|
|
271
271
|
}
|
|
272
272
|
y.stop();
|
|
273
273
|
}
|
|
274
|
-
s.current = null, l.current = null, t(!1),
|
|
275
|
-
}, []),
|
|
274
|
+
s.current = null, l.current = null, t(!1), o("");
|
|
275
|
+
}, []), R = E(() => i(null), []), _ = E(() => nr(s.current), []);
|
|
276
276
|
return {
|
|
277
277
|
isMuted: e,
|
|
278
278
|
activeDeviceId: r,
|
|
@@ -282,19 +282,19 @@ function ar() {
|
|
|
282
282
|
attachRoom: p,
|
|
283
283
|
switchDevice: w,
|
|
284
284
|
teardownMic: f,
|
|
285
|
-
clearError:
|
|
285
|
+
clearError: R,
|
|
286
286
|
getMicStream: _
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
291
|
-
const [e, t] = N(!1), [r,
|
|
289
|
+
const or = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
290
|
+
function ir() {
|
|
291
|
+
const [e, t] = N(!1), [r, o] = N(null), [a, i] = N(null), [s, l] = N(""), c = M(null), p = M(null), w = E((h) => {
|
|
292
292
|
c.current = h;
|
|
293
293
|
}, []), m = E(() => {
|
|
294
294
|
var A;
|
|
295
295
|
const h = c.current, L = p.current;
|
|
296
296
|
if (L && h) {
|
|
297
|
-
const I = h.localParticipant.getTrackPublication(
|
|
297
|
+
const I = h.localParticipant.getTrackPublication(kn.Source.Camera), b = (I == null ? void 0 : I.track) ?? L;
|
|
298
298
|
try {
|
|
299
299
|
h.localParticipant.unpublishTrack(b);
|
|
300
300
|
} catch {
|
|
@@ -304,18 +304,18 @@ function cr() {
|
|
|
304
304
|
} catch {
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
p.current = null,
|
|
307
|
+
p.current = null, i(null), t(!1);
|
|
308
308
|
}, []), f = E(async (h) => {
|
|
309
309
|
const L = c.current;
|
|
310
310
|
if (L) {
|
|
311
|
-
|
|
311
|
+
o(null);
|
|
312
312
|
try {
|
|
313
|
-
const A = { ...
|
|
313
|
+
const A = { ...or };
|
|
314
314
|
h && (A.deviceId = h);
|
|
315
|
-
const I = await
|
|
315
|
+
const I = await Zn(A);
|
|
316
316
|
await L.localParticipant.publishTrack(I), p.current = I;
|
|
317
317
|
const U = I.attach();
|
|
318
|
-
|
|
318
|
+
i(U), t(!0), h && l(h);
|
|
319
319
|
try {
|
|
320
320
|
L.localParticipant.publishData(
|
|
321
321
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
@@ -325,34 +325,34 @@ function cr() {
|
|
|
325
325
|
}
|
|
326
326
|
} catch (A) {
|
|
327
327
|
const I = A instanceof Error && A.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
328
|
-
|
|
328
|
+
o(I);
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
}, []),
|
|
331
|
+
}, []), R = E(async () => {
|
|
332
332
|
e ? m() : await f(s || void 0);
|
|
333
333
|
}, [e, s, m, f]), _ = E(async (h) => {
|
|
334
334
|
m(), await f(h);
|
|
335
335
|
}, [m, f]), y = E(() => {
|
|
336
|
-
m(), c.current = null,
|
|
337
|
-
}, [m]), u = E(() =>
|
|
338
|
-
return
|
|
336
|
+
m(), c.current = null, o(null), l("");
|
|
337
|
+
}, [m]), u = E(() => o(null), []);
|
|
338
|
+
return T(() => () => {
|
|
339
339
|
p.current && p.current.stop();
|
|
340
340
|
}, []), {
|
|
341
341
|
isEnabled: e,
|
|
342
342
|
error: r,
|
|
343
343
|
previewEl: a,
|
|
344
344
|
activeDeviceId: s,
|
|
345
|
-
toggle:
|
|
345
|
+
toggle: R,
|
|
346
346
|
switchDevice: _,
|
|
347
347
|
attachRoom: w,
|
|
348
348
|
teardown: y,
|
|
349
349
|
clearError: u
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
const [e, t] = N(!1), [r,
|
|
352
|
+
function lr() {
|
|
353
|
+
const [e, t] = N(!1), [r, o] = N(null), [a, i] = N(null), s = M(null), l = E((f) => {
|
|
354
354
|
s.current = f;
|
|
355
|
-
}, []), c = E(() =>
|
|
355
|
+
}, []), c = E(() => i(null), []), p = E(async () => {
|
|
356
356
|
const f = s.current;
|
|
357
357
|
if (f) {
|
|
358
358
|
if (e) {
|
|
@@ -363,15 +363,15 @@ function dr() {
|
|
|
363
363
|
c(), t(!1);
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
|
-
|
|
366
|
+
o(null);
|
|
367
367
|
try {
|
|
368
368
|
await f.localParticipant.setScreenShareEnabled(!0);
|
|
369
|
-
let
|
|
369
|
+
let R = 0;
|
|
370
370
|
const _ = () => {
|
|
371
|
-
const y = f.localParticipant.getTrackPublication(
|
|
371
|
+
const y = f.localParticipant.getTrackPublication(kn.Source.ScreenShare);
|
|
372
372
|
if (y != null && y.track) {
|
|
373
373
|
const u = y.track.attach();
|
|
374
|
-
|
|
374
|
+
i(u), t(!0);
|
|
375
375
|
try {
|
|
376
376
|
f.localParticipant.publishData(
|
|
377
377
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -381,12 +381,12 @@ function dr() {
|
|
|
381
381
|
}
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
R++ < 10 ? setTimeout(_, 100) : t(!0);
|
|
385
385
|
};
|
|
386
386
|
_();
|
|
387
|
-
} catch (
|
|
388
|
-
const _ =
|
|
389
|
-
_ !== "NotAllowedError" && _ !== "AbortError" &&
|
|
387
|
+
} catch (R) {
|
|
388
|
+
const _ = R instanceof Error ? R.name : "";
|
|
389
|
+
_ !== "NotAllowedError" && _ !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}, [e, c]), w = E(() => {
|
|
@@ -396,28 +396,28 @@ function dr() {
|
|
|
396
396
|
f.localParticipant.setScreenShareEnabled(!1);
|
|
397
397
|
} catch {
|
|
398
398
|
}
|
|
399
|
-
c(), t(!1),
|
|
400
|
-
}, [e, c]), m = E(() =>
|
|
399
|
+
c(), t(!1), o(null), s.current = null;
|
|
400
|
+
}, [e, c]), m = E(() => o(null), []);
|
|
401
401
|
return { isEnabled: e, error: r, previewEl: a, toggle: p, attachRoom: l, teardown: w, clearError: m };
|
|
402
402
|
}
|
|
403
|
-
function
|
|
404
|
-
const [e, t] = N([]), [r,
|
|
403
|
+
function ar() {
|
|
404
|
+
const [e, t] = N([]), [r, o] = N([]), a = E(async () => {
|
|
405
405
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
406
406
|
try {
|
|
407
|
-
const
|
|
408
|
-
t(
|
|
407
|
+
const i = await navigator.mediaDevices.enumerateDevices();
|
|
408
|
+
t(i.filter((s) => s.kind === "audioinput")), o(i.filter((s) => s.kind === "videoinput"));
|
|
409
409
|
} catch {
|
|
410
410
|
}
|
|
411
411
|
}, []);
|
|
412
|
-
return
|
|
412
|
+
return T(() => {
|
|
413
413
|
if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
414
|
-
const
|
|
415
|
-
return navigator.mediaDevices.addEventListener("devicechange",
|
|
414
|
+
const i = () => void a();
|
|
415
|
+
return navigator.mediaDevices.addEventListener("devicechange", i), () => navigator.mediaDevices.removeEventListener("devicechange", i);
|
|
416
416
|
}, [a]), { mics: e, cameras: r, refresh: a };
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
const [
|
|
420
|
-
return
|
|
418
|
+
function sr(e, t, r = !1) {
|
|
419
|
+
const [o, a] = N(null), [i, s] = N(null), [l, c] = N(!r && !!e);
|
|
420
|
+
return T(() => {
|
|
421
421
|
if (r || !e) {
|
|
422
422
|
c(!1);
|
|
423
423
|
return;
|
|
@@ -436,9 +436,9 @@ function fr(e, t, r = !1) {
|
|
|
436
436
|
}).catch((m) => {
|
|
437
437
|
p.signal.aborted || (s(m instanceof Error ? m.message : "Agent lookup failed"), c(!1));
|
|
438
438
|
}), () => p.abort();
|
|
439
|
-
}, [e, t, r]), { info:
|
|
439
|
+
}, [e, t, r]), { info: o, error: i, loading: l };
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function cr(e) {
|
|
442
442
|
if (typeof window > "u") return null;
|
|
443
443
|
try {
|
|
444
444
|
return window.localStorage.getItem(e);
|
|
@@ -446,135 +446,135 @@ function En(e) {
|
|
|
446
446
|
return null;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function dr(e, t) {
|
|
450
450
|
if (!(typeof window > "u"))
|
|
451
451
|
try {
|
|
452
452
|
window.localStorage.setItem(e, t);
|
|
453
453
|
} catch {
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function ur({
|
|
457
457
|
value: e,
|
|
458
458
|
defaultValue: t = "expanded",
|
|
459
459
|
onChange: r
|
|
460
460
|
} = {}) {
|
|
461
|
-
const
|
|
461
|
+
const o = e !== void 0, [a, i] = N(t), s = o ? e : a, l = E(
|
|
462
462
|
(c) => {
|
|
463
|
-
c !== s && (
|
|
463
|
+
c !== s && (o || i(c), r == null || r(c));
|
|
464
464
|
},
|
|
465
|
-
[s,
|
|
465
|
+
[s, o, r]
|
|
466
466
|
);
|
|
467
467
|
return [s, l];
|
|
468
468
|
}
|
|
469
|
-
const
|
|
470
|
-
function
|
|
471
|
-
return e &&
|
|
469
|
+
const fr = ["hidden", "minimized", "expanded"];
|
|
470
|
+
function pr(e) {
|
|
471
|
+
return e && fr.includes(e) ? e : null;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function hr({
|
|
474
474
|
value: e,
|
|
475
475
|
defaultValue: t = "expanded",
|
|
476
476
|
onChange: r,
|
|
477
|
-
persistKey:
|
|
477
|
+
persistKey: o = "ll-widget",
|
|
478
478
|
disablePersistence: a = !1
|
|
479
479
|
} = {}) {
|
|
480
|
-
const
|
|
480
|
+
const i = `${o}:display-mode`, s = M(!1), [l, c] = ur({
|
|
481
481
|
value: e,
|
|
482
482
|
defaultValue: t,
|
|
483
483
|
onChange: (p) => {
|
|
484
|
-
e === void 0 && !a &&
|
|
484
|
+
e === void 0 && !a && dr(i, p), r == null || r(p);
|
|
485
485
|
}
|
|
486
486
|
});
|
|
487
|
-
return
|
|
487
|
+
return T(() => {
|
|
488
488
|
if (s.current || (s.current = !0, a || e !== void 0)) return;
|
|
489
|
-
const p =
|
|
489
|
+
const p = pr(cr(i));
|
|
490
490
|
p && p !== l && c(p);
|
|
491
491
|
}, []), [l, c];
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
493
|
+
const mr = 640;
|
|
494
|
+
function gr(e = mr) {
|
|
495
495
|
const [t, r] = N(!1);
|
|
496
|
-
return
|
|
496
|
+
return T(() => {
|
|
497
497
|
if (e === !1) {
|
|
498
498
|
r(!1);
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
501
501
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
502
502
|
return;
|
|
503
|
-
const
|
|
504
|
-
return
|
|
505
|
-
a.removeListener(
|
|
503
|
+
const o = `(max-width: ${e - 1}px)`, a = window.matchMedia(o), i = () => r(a.matches);
|
|
504
|
+
return i(), typeof a.addEventListener == "function" ? (a.addEventListener("change", i), () => a.removeEventListener("change", i)) : (a.addListener(i), () => {
|
|
505
|
+
a.removeListener(i);
|
|
506
506
|
});
|
|
507
507
|
}, [e]), t;
|
|
508
508
|
}
|
|
509
|
-
const
|
|
510
|
-
function
|
|
511
|
-
if (typeof window > "u" || window.history[
|
|
509
|
+
const tn = "__llHistoryPatched", xt = "ll:pathname";
|
|
510
|
+
function yr() {
|
|
511
|
+
if (typeof window > "u" || window.history[tn]) return;
|
|
512
512
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
513
513
|
window.history.pushState = function(...r) {
|
|
514
|
-
const
|
|
515
|
-
return window.dispatchEvent(new Event(xt)),
|
|
514
|
+
const o = e.apply(this, r);
|
|
515
|
+
return window.dispatchEvent(new Event(xt)), o;
|
|
516
516
|
}, window.history.replaceState = function(...r) {
|
|
517
|
-
const
|
|
518
|
-
return window.dispatchEvent(new Event(xt)),
|
|
519
|
-
}, window.history[
|
|
517
|
+
const o = t.apply(this, r);
|
|
518
|
+
return window.dispatchEvent(new Event(xt)), o;
|
|
519
|
+
}, window.history[tn] = !0;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function nn() {
|
|
522
522
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function vr(e) {
|
|
525
525
|
const [t, r] = N(
|
|
526
|
-
() => e ??
|
|
526
|
+
() => e ?? nn()
|
|
527
527
|
);
|
|
528
|
-
return
|
|
528
|
+
return T(() => {
|
|
529
529
|
if (e !== void 0) return;
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
return
|
|
533
|
-
window.removeEventListener("popstate",
|
|
530
|
+
yr();
|
|
531
|
+
const o = () => r(nn());
|
|
532
|
+
return o(), window.addEventListener("popstate", o), window.addEventListener(xt, o), () => {
|
|
533
|
+
window.removeEventListener("popstate", o), window.removeEventListener(xt, o);
|
|
534
534
|
};
|
|
535
535
|
}, [e]), e ?? t;
|
|
536
536
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
return e.replace(
|
|
537
|
+
const rn = /* @__PURE__ */ new Map(), br = /[\\^$+?.()|{}[\]]/g;
|
|
538
|
+
function wr(e) {
|
|
539
|
+
return e.replace(br, "\\$&");
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
const t =
|
|
541
|
+
function _r(e) {
|
|
542
|
+
const t = rn.get(e);
|
|
543
543
|
if (t) return t;
|
|
544
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e,
|
|
545
|
-
return
|
|
544
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", a = "", i = r.replace(/\*\*/g, o).replace(/\*/g, a), l = wr(i).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
|
|
545
|
+
return rn.set(e, c), c;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function xr(e, t) {
|
|
548
548
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
549
|
-
return
|
|
549
|
+
return _r(e).test(r);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
551
|
+
function Lr(e, t) {
|
|
552
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : xr(e, t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function on(e, t) {
|
|
555
555
|
if (!e || e.length === 0) return !1;
|
|
556
556
|
for (const r of e)
|
|
557
|
-
if (
|
|
557
|
+
if (Lr(r, t)) return !0;
|
|
558
558
|
return !1;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
return e === void 0 ? !0 :
|
|
560
|
+
function kr(e, t, r) {
|
|
561
|
+
return e === void 0 ? !0 : on(r, e) ? !1 : t && t.length > 0 ? on(t, e) : !0;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
return
|
|
565
|
-
() =>
|
|
563
|
+
function Cr(e, t, r) {
|
|
564
|
+
return Qe(
|
|
565
|
+
() => kr(e, t, r),
|
|
566
566
|
[e, t, r]
|
|
567
567
|
);
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function Er(e) {
|
|
570
570
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
571
571
|
navigate: e.navigate !== !1,
|
|
572
572
|
thinking: e.thinking !== !1,
|
|
573
573
|
action: e.action !== !1
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
const t =
|
|
576
|
+
function Sr(e) {
|
|
577
|
+
const t = Qe(() => Er(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = M(null), a = E(
|
|
578
578
|
(c) => {
|
|
579
579
|
try {
|
|
580
580
|
new Audio(`${r}${c}`).play().catch(() => {
|
|
@@ -583,55 +583,55 @@ function Ir(e) {
|
|
|
583
583
|
}
|
|
584
584
|
},
|
|
585
585
|
[r]
|
|
586
|
-
),
|
|
586
|
+
), i = E(() => {
|
|
587
587
|
t.navigate && a("/audio/page-change-sound.mp3");
|
|
588
588
|
}, [t.navigate, a]), s = E(() => {
|
|
589
589
|
t.action && a("/audio/confirmation-sound.mp3");
|
|
590
590
|
}, [t.action, a]), l = E(
|
|
591
591
|
(c) => {
|
|
592
592
|
if (!t.thinking) {
|
|
593
|
-
if (
|
|
593
|
+
if (o.current) {
|
|
594
594
|
try {
|
|
595
|
-
|
|
595
|
+
o.current.pause();
|
|
596
596
|
} catch {
|
|
597
597
|
}
|
|
598
|
-
|
|
598
|
+
o.current = null;
|
|
599
599
|
}
|
|
600
600
|
return;
|
|
601
601
|
}
|
|
602
602
|
if (c) {
|
|
603
|
-
if (
|
|
603
|
+
if (o.current) return;
|
|
604
604
|
try {
|
|
605
605
|
const p = new Audio(`${r}/audio/thinking-sound.mp3`);
|
|
606
606
|
p.loop = !0, p.volume = 0.3, p.play().catch(() => {
|
|
607
|
-
|
|
608
|
-
}),
|
|
607
|
+
o.current = null;
|
|
608
|
+
}), o.current = p;
|
|
609
609
|
} catch {
|
|
610
610
|
}
|
|
611
|
-
} else if (
|
|
611
|
+
} else if (o.current) {
|
|
612
612
|
try {
|
|
613
|
-
|
|
613
|
+
o.current.pause();
|
|
614
614
|
} catch {
|
|
615
615
|
}
|
|
616
|
-
|
|
616
|
+
o.current = null;
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
619
|
[r, t.thinking]
|
|
620
620
|
);
|
|
621
|
-
return
|
|
622
|
-
if (
|
|
621
|
+
return T(() => () => {
|
|
622
|
+
if (o.current) {
|
|
623
623
|
try {
|
|
624
|
-
|
|
624
|
+
o.current.pause();
|
|
625
625
|
} catch {
|
|
626
626
|
}
|
|
627
|
-
|
|
627
|
+
o.current = null;
|
|
628
628
|
}
|
|
629
|
-
}, []),
|
|
630
|
-
() => ({ playPageChange:
|
|
631
|
-
[
|
|
629
|
+
}, []), Qe(
|
|
630
|
+
() => ({ playPageChange: i, playConfirmation: s, setThinking: l }),
|
|
631
|
+
[i, s, l]
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
635
635
|
"svg",
|
|
636
636
|
{
|
|
637
637
|
className: t,
|
|
@@ -677,7 +677,7 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
677
677
|
}
|
|
678
678
|
)
|
|
679
679
|
}
|
|
680
|
-
),
|
|
680
|
+
), an = ({ className: e }) => /* @__PURE__ */ n(
|
|
681
681
|
"svg",
|
|
682
682
|
{
|
|
683
683
|
className: e,
|
|
@@ -695,7 +695,7 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
695
695
|
}
|
|
696
696
|
)
|
|
697
697
|
}
|
|
698
|
-
),
|
|
698
|
+
), Nr = ({ className: e }) => /* @__PURE__ */ n(
|
|
699
699
|
"svg",
|
|
700
700
|
{
|
|
701
701
|
className: e,
|
|
@@ -706,12 +706,12 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
706
706
|
"aria-hidden": "true",
|
|
707
707
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
708
708
|
}
|
|
709
|
-
),
|
|
709
|
+
), Ar = {
|
|
710
710
|
left: 180,
|
|
711
711
|
right: 0,
|
|
712
712
|
up: -90,
|
|
713
713
|
down: 90
|
|
714
|
-
},
|
|
714
|
+
}, sn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
715
715
|
"svg",
|
|
716
716
|
{
|
|
717
717
|
className: t,
|
|
@@ -719,19 +719,19 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
719
719
|
viewBox: "0 0 24 24",
|
|
720
720
|
stroke: "currentColor",
|
|
721
721
|
strokeWidth: 2,
|
|
722
|
-
style: { transform: `rotate(${
|
|
722
|
+
style: { transform: `rotate(${Ar[e]}deg)` },
|
|
723
723
|
"aria-hidden": "true",
|
|
724
724
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
725
725
|
}
|
|
726
726
|
);
|
|
727
|
-
function
|
|
727
|
+
function Ir(e) {
|
|
728
728
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
function
|
|
730
|
+
const Cn = "ll-hidden-tab-center-y", Mr = 5, cn = 16;
|
|
731
|
+
function Rr() {
|
|
732
732
|
if (typeof window > "u") return null;
|
|
733
733
|
try {
|
|
734
|
-
const e = window.localStorage.getItem(
|
|
734
|
+
const e = window.localStorage.getItem(Cn);
|
|
735
735
|
if (!e) return null;
|
|
736
736
|
const t = Number.parseFloat(e);
|
|
737
737
|
return Number.isFinite(t) ? t : null;
|
|
@@ -739,37 +739,37 @@ function Pr() {
|
|
|
739
739
|
return null;
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function dn(e) {
|
|
743
743
|
if (!(typeof window > "u"))
|
|
744
744
|
try {
|
|
745
|
-
window.localStorage.setItem(
|
|
745
|
+
window.localStorage.setItem(Cn, String(e));
|
|
746
746
|
} catch {
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
const
|
|
749
|
+
const Tr = ({
|
|
750
750
|
position: e,
|
|
751
751
|
isMobile: t,
|
|
752
752
|
isSpeaking: r,
|
|
753
|
-
onExpand:
|
|
753
|
+
onExpand: o,
|
|
754
754
|
label: a = "Open widget",
|
|
755
|
-
avatarImageUrl:
|
|
755
|
+
avatarImageUrl: i,
|
|
756
756
|
agentName: s,
|
|
757
757
|
containerEl: l
|
|
758
758
|
}) => {
|
|
759
|
-
const c =
|
|
759
|
+
const c = Ir(e), p = c === "right" ? "left" : "right", w = t ? 80 : 72, m = !!i, f = !!l, [R, _] = N(null), [y, u] = N(!1), h = M(null), L = M(!1), A = E(
|
|
760
760
|
(B) => {
|
|
761
761
|
if (typeof window > "u") return B;
|
|
762
|
-
const j = w / 2, S =
|
|
762
|
+
const j = w / 2, S = cn + j, Z = window.innerHeight - cn - j;
|
|
763
763
|
return Z < S ? Math.max(S, B) : Math.max(S, Math.min(Z, B));
|
|
764
764
|
},
|
|
765
765
|
[w]
|
|
766
766
|
);
|
|
767
|
-
|
|
767
|
+
T(() => {
|
|
768
768
|
if (f) {
|
|
769
769
|
_(null);
|
|
770
770
|
return;
|
|
771
771
|
}
|
|
772
|
-
const B =
|
|
772
|
+
const B = Rr();
|
|
773
773
|
_(A(B ?? window.innerHeight / 2));
|
|
774
774
|
const j = () => {
|
|
775
775
|
_((S) => S === null ? null : A(S));
|
|
@@ -778,25 +778,25 @@ const $r = ({
|
|
|
778
778
|
}, [A, f]);
|
|
779
779
|
const I = E(
|
|
780
780
|
(B) => {
|
|
781
|
-
if (!f && !(B.pointerType === "mouse" && B.button !== 0) &&
|
|
781
|
+
if (!f && !(B.pointerType === "mouse" && B.button !== 0) && R !== null) {
|
|
782
782
|
try {
|
|
783
783
|
B.currentTarget.setPointerCapture(B.pointerId);
|
|
784
784
|
} catch {
|
|
785
785
|
}
|
|
786
786
|
h.current = {
|
|
787
787
|
startClientY: B.clientY,
|
|
788
|
-
startCenterY:
|
|
788
|
+
startCenterY: R,
|
|
789
789
|
moved: !1
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
792
|
},
|
|
793
|
-
[
|
|
793
|
+
[R, f]
|
|
794
794
|
), U = E(
|
|
795
795
|
(B) => {
|
|
796
796
|
const j = h.current;
|
|
797
797
|
if (!j) return;
|
|
798
798
|
const S = B.clientY - j.startClientY;
|
|
799
|
-
!j.moved && Math.abs(S) >
|
|
799
|
+
!j.moved && Math.abs(S) > Mr && (j.moved = !0, u(!0)), j.moved && _(A(j.startCenterY + S));
|
|
800
800
|
},
|
|
801
801
|
[A]
|
|
802
802
|
), b = E(
|
|
@@ -807,7 +807,7 @@ const $r = ({
|
|
|
807
807
|
B.currentTarget.releasePointerCapture(B.pointerId);
|
|
808
808
|
} catch {
|
|
809
809
|
}
|
|
810
|
-
h.current = null, j.moved && (u(!1), L.current = !0, _((S) => (S !== null &&
|
|
810
|
+
h.current = null, j.moved && (u(!1), L.current = !0, _((S) => (S !== null && dn(S), S)));
|
|
811
811
|
}
|
|
812
812
|
},
|
|
813
813
|
[]
|
|
@@ -816,8 +816,8 @@ const $r = ({
|
|
|
816
816
|
L.current = !1;
|
|
817
817
|
return;
|
|
818
818
|
}
|
|
819
|
-
|
|
820
|
-
}, [
|
|
819
|
+
o();
|
|
820
|
+
}, [o]), O = E(
|
|
821
821
|
(B) => {
|
|
822
822
|
if (B.key === "ArrowUp" || B.key === "ArrowDown") {
|
|
823
823
|
B.preventDefault();
|
|
@@ -825,7 +825,7 @@ const $r = ({
|
|
|
825
825
|
_((S) => {
|
|
826
826
|
if (S === null) return S;
|
|
827
827
|
const Z = A(S + j);
|
|
828
|
-
return
|
|
828
|
+
return dn(Z), Z;
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
831
|
},
|
|
@@ -838,7 +838,7 @@ const $r = ({
|
|
|
838
838
|
y ? "is-dragging" : null,
|
|
839
839
|
m ? "ll-hidden--with-avatar" : null,
|
|
840
840
|
f ? "ll-hidden--scoped" : null
|
|
841
|
-
].filter(Boolean).join(" "), ne =
|
|
841
|
+
].filter(Boolean).join(" "), ne = R === null ? void 0 : { top: `${R - w / 2}px`, transform: "none" };
|
|
842
842
|
return /* @__PURE__ */ n(
|
|
843
843
|
"button",
|
|
844
844
|
{
|
|
@@ -858,9 +858,9 @@ const $r = ({
|
|
|
858
858
|
// as the click affordance), then the circular avatar photo
|
|
859
859
|
// taking the rest of the tab. Reinforces "this is an
|
|
860
860
|
// avatar-based experience" even when collapsed.
|
|
861
|
-
/* @__PURE__ */ x(
|
|
861
|
+
/* @__PURE__ */ x(ze, { children: [
|
|
862
862
|
/* @__PURE__ */ n(
|
|
863
|
-
|
|
863
|
+
sn,
|
|
864
864
|
{
|
|
865
865
|
direction: p,
|
|
866
866
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -869,7 +869,7 @@ const $r = ({
|
|
|
869
869
|
/* @__PURE__ */ n(
|
|
870
870
|
"img",
|
|
871
871
|
{
|
|
872
|
-
src:
|
|
872
|
+
src: i,
|
|
873
873
|
alt: s ? `${s} avatar` : "Agent avatar",
|
|
874
874
|
className: "ll-hidden__avatar",
|
|
875
875
|
draggable: !1
|
|
@@ -877,7 +877,7 @@ const $r = ({
|
|
|
877
877
|
)
|
|
878
878
|
] })
|
|
879
879
|
) : /* @__PURE__ */ n(
|
|
880
|
-
|
|
880
|
+
sn,
|
|
881
881
|
{
|
|
882
882
|
direction: p,
|
|
883
883
|
className: "ll-hidden__chevron"
|
|
@@ -885,26 +885,26 @@ const $r = ({
|
|
|
885
885
|
)
|
|
886
886
|
}
|
|
887
887
|
);
|
|
888
|
-
},
|
|
888
|
+
}, Dr = ({
|
|
889
889
|
audioLevel: e,
|
|
890
890
|
bars: t = 20,
|
|
891
891
|
maxHeight: r = 20,
|
|
892
|
-
minHeight:
|
|
892
|
+
minHeight: o = 4,
|
|
893
893
|
className: a,
|
|
894
|
-
barClassName:
|
|
894
|
+
barClassName: i
|
|
895
895
|
}) => {
|
|
896
|
-
const s = M(null), l = M([]), c =
|
|
896
|
+
const s = M(null), l = M([]), c = Qe(() => {
|
|
897
897
|
const w = (Math.sqrt(5) - 1) / 2;
|
|
898
898
|
return Array.from({ length: t }, (m, f) => 0.5 + f * w % 1 * 0.5);
|
|
899
899
|
}, [t]);
|
|
900
|
-
|
|
900
|
+
T(() => e.subscribe((m) => {
|
|
901
901
|
for (let f = 0; f < t; f++) {
|
|
902
|
-
const
|
|
903
|
-
if (!
|
|
904
|
-
const _ = Math.max(
|
|
905
|
-
|
|
902
|
+
const R = l.current[f];
|
|
903
|
+
if (!R) continue;
|
|
904
|
+
const _ = Math.max(o, m * r * c[f]);
|
|
905
|
+
R.style.height = `${_}px`;
|
|
906
906
|
}
|
|
907
|
-
}), [e, t, r,
|
|
907
|
+
}), [e, t, r, o, c]);
|
|
908
908
|
const p = ["ll-waveform", a].filter(Boolean).join(" ");
|
|
909
909
|
return /* @__PURE__ */ n("div", { ref: s, className: p, "aria-hidden": "true", children: Array.from({ length: t }, (w, m) => /* @__PURE__ */ n(
|
|
910
910
|
"div",
|
|
@@ -912,18 +912,18 @@ const $r = ({
|
|
|
912
912
|
ref: (f) => {
|
|
913
913
|
l.current[m] = f;
|
|
914
914
|
},
|
|
915
|
-
className: ["ll-waveform__bar",
|
|
916
|
-
style: { height: `${
|
|
915
|
+
className: ["ll-waveform__bar", i].filter(Boolean).join(" "),
|
|
916
|
+
style: { height: `${o}px` }
|
|
917
917
|
},
|
|
918
918
|
m
|
|
919
919
|
)) });
|
|
920
|
-
},
|
|
920
|
+
}, Pr = ({
|
|
921
921
|
position: e,
|
|
922
922
|
isMobile: t,
|
|
923
923
|
agentName: r,
|
|
924
|
-
avatarImageUrl:
|
|
924
|
+
avatarImageUrl: o,
|
|
925
925
|
agentState: a,
|
|
926
|
-
isMuted:
|
|
926
|
+
isMuted: i,
|
|
927
927
|
audioLevel: s,
|
|
928
928
|
onExpand: l,
|
|
929
929
|
onToggleMute: c,
|
|
@@ -942,19 +942,19 @@ const $r = ({
|
|
|
942
942
|
onClick: l,
|
|
943
943
|
"aria-label": `Expand ${r} widget`,
|
|
944
944
|
children: [
|
|
945
|
-
|
|
945
|
+
o ? (
|
|
946
946
|
// eslint-disable-next-line @next/next/no-img-element
|
|
947
947
|
/* @__PURE__ */ n(
|
|
948
948
|
"img",
|
|
949
949
|
{
|
|
950
|
-
src:
|
|
950
|
+
src: o,
|
|
951
951
|
alt: r,
|
|
952
952
|
className: "ll-minimized__avatar"
|
|
953
953
|
}
|
|
954
954
|
)
|
|
955
955
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
956
956
|
/* @__PURE__ */ n(
|
|
957
|
-
|
|
957
|
+
Dr,
|
|
958
958
|
{
|
|
959
959
|
audioLevel: s,
|
|
960
960
|
bars: 16,
|
|
@@ -976,11 +976,11 @@ const $r = ({
|
|
|
976
976
|
onKeyDown: (w) => {
|
|
977
977
|
(w.key === "Enter" || w.key === " ") && (w.stopPropagation(), w.preventDefault(), c());
|
|
978
978
|
},
|
|
979
|
-
"aria-label":
|
|
980
|
-
children: /* @__PURE__ */ n(
|
|
979
|
+
"aria-label": i ? "Unmute microphone" : "Mute microphone",
|
|
980
|
+
children: /* @__PURE__ */ n(ln, { muted: i, className: "ll-minimized__icon" })
|
|
981
981
|
}
|
|
982
982
|
),
|
|
983
|
-
/* @__PURE__ */ n(
|
|
983
|
+
/* @__PURE__ */ n(an, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
984
984
|
] })
|
|
985
985
|
]
|
|
986
986
|
}
|
|
@@ -994,12 +994,12 @@ const $r = ({
|
|
|
994
994
|
role: "region",
|
|
995
995
|
"aria-label": `${r} widget`,
|
|
996
996
|
children: /* @__PURE__ */ x("div", { className: "ll-minimized__surface", children: [
|
|
997
|
-
|
|
997
|
+
o ? (
|
|
998
998
|
// eslint-disable-next-line @next/next/no-img-element
|
|
999
999
|
/* @__PURE__ */ n(
|
|
1000
1000
|
"img",
|
|
1001
1001
|
{
|
|
1002
|
-
src:
|
|
1002
|
+
src: o,
|
|
1003
1003
|
alt: r,
|
|
1004
1004
|
className: "ll-minimized__avatar"
|
|
1005
1005
|
}
|
|
@@ -1016,8 +1016,8 @@ const $r = ({
|
|
|
1016
1016
|
type: "button",
|
|
1017
1017
|
className: "ll-minimized__btn",
|
|
1018
1018
|
onClick: c,
|
|
1019
|
-
"aria-label":
|
|
1020
|
-
children: /* @__PURE__ */ n(
|
|
1019
|
+
"aria-label": i ? "Unmute microphone" : "Mute microphone",
|
|
1020
|
+
children: /* @__PURE__ */ n(ln, { muted: i, className: "ll-minimized__icon" })
|
|
1021
1021
|
}
|
|
1022
1022
|
),
|
|
1023
1023
|
/* @__PURE__ */ n(
|
|
@@ -1027,7 +1027,7 @@ const $r = ({
|
|
|
1027
1027
|
className: "ll-minimized__btn",
|
|
1028
1028
|
onClick: l,
|
|
1029
1029
|
"aria-label": `Expand ${r} widget`,
|
|
1030
|
-
children: /* @__PURE__ */ n(
|
|
1030
|
+
children: /* @__PURE__ */ n(an, { className: "ll-minimized__icon" })
|
|
1031
1031
|
}
|
|
1032
1032
|
),
|
|
1033
1033
|
/* @__PURE__ */ n(
|
|
@@ -1037,21 +1037,21 @@ const $r = ({
|
|
|
1037
1037
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1038
1038
|
onClick: p,
|
|
1039
1039
|
"aria-label": "Close widget",
|
|
1040
|
-
children: /* @__PURE__ */ n(
|
|
1040
|
+
children: /* @__PURE__ */ n(Nr, { className: "ll-minimized__icon" })
|
|
1041
1041
|
}
|
|
1042
1042
|
)
|
|
1043
1043
|
] })
|
|
1044
1044
|
] })
|
|
1045
1045
|
}
|
|
1046
|
-
),
|
|
1046
|
+
), $r = ({
|
|
1047
1047
|
src: e,
|
|
1048
1048
|
alt: t,
|
|
1049
1049
|
preCannedPlaying: r = !1,
|
|
1050
|
-
className:
|
|
1050
|
+
className: o,
|
|
1051
1051
|
style: a
|
|
1052
1052
|
}) => {
|
|
1053
|
-
const [
|
|
1054
|
-
if (
|
|
1053
|
+
const [i, s] = N(!1), l = M(e);
|
|
1054
|
+
if (T(() => {
|
|
1055
1055
|
l.current !== e && (l.current = e, s(!1));
|
|
1056
1056
|
}, [e]), !e) return null;
|
|
1057
1057
|
const c = {
|
|
@@ -1063,7 +1063,7 @@ const $r = ({
|
|
|
1063
1063
|
objectPosition: "top",
|
|
1064
1064
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
1065
1065
|
transform: r ? "scale(1.02)" : "scale(1)",
|
|
1066
|
-
opacity:
|
|
1066
|
+
opacity: i ? 1 : 0,
|
|
1067
1067
|
...a
|
|
1068
1068
|
};
|
|
1069
1069
|
return (
|
|
@@ -1073,7 +1073,7 @@ const $r = ({
|
|
|
1073
1073
|
{
|
|
1074
1074
|
src: e,
|
|
1075
1075
|
alt: t,
|
|
1076
|
-
className:
|
|
1076
|
+
className: o,
|
|
1077
1077
|
style: c,
|
|
1078
1078
|
loading: "eager",
|
|
1079
1079
|
fetchPriority: "high",
|
|
@@ -1081,11 +1081,11 @@ const $r = ({
|
|
|
1081
1081
|
}
|
|
1082
1082
|
)
|
|
1083
1083
|
);
|
|
1084
|
-
},
|
|
1085
|
-
function
|
|
1084
|
+
}, zr = "#E06540";
|
|
1085
|
+
function Hr({
|
|
1086
1086
|
size: e = 14,
|
|
1087
1087
|
className: t,
|
|
1088
|
-
fill: r =
|
|
1088
|
+
fill: r = zr
|
|
1089
1089
|
}) {
|
|
1090
1090
|
return /* @__PURE__ */ x(
|
|
1091
1091
|
"svg",
|
|
@@ -1123,14 +1123,14 @@ function Fr({
|
|
|
1123
1123
|
}
|
|
1124
1124
|
);
|
|
1125
1125
|
}
|
|
1126
|
-
const
|
|
1126
|
+
const Or = 8, un = 8, Br = ({
|
|
1127
1127
|
open: e,
|
|
1128
1128
|
onClose: t,
|
|
1129
1129
|
anchorRef: r,
|
|
1130
|
-
children:
|
|
1130
|
+
children: o
|
|
1131
1131
|
}) => {
|
|
1132
|
-
const a = M(null), [
|
|
1133
|
-
return
|
|
1132
|
+
const a = M(null), [i, s] = N(null);
|
|
1133
|
+
return Ln(() => {
|
|
1134
1134
|
if (!e) {
|
|
1135
1135
|
s(null);
|
|
1136
1136
|
return;
|
|
@@ -1139,15 +1139,15 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1139
1139
|
if (!l) return;
|
|
1140
1140
|
const c = () => {
|
|
1141
1141
|
const p = l.getBoundingClientRect(), w = {
|
|
1142
|
-
top: p.top -
|
|
1142
|
+
top: p.top - Or,
|
|
1143
1143
|
left: p.left + p.width / 2
|
|
1144
|
-
}, m =
|
|
1144
|
+
}, m = un + 90, f = window.innerWidth - un - 90;
|
|
1145
1145
|
w.left < m && (w.left = m), w.left > f && (w.left = f), s(w);
|
|
1146
1146
|
};
|
|
1147
1147
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1148
1148
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1149
1149
|
};
|
|
1150
|
-
}, [e, r]),
|
|
1150
|
+
}, [e, r]), T(() => {
|
|
1151
1151
|
if (!e) return;
|
|
1152
1152
|
const l = (p) => {
|
|
1153
1153
|
const w = p.target, m = a.current, f = r.current;
|
|
@@ -1158,7 +1158,7 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1158
1158
|
return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
|
|
1159
1159
|
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
|
|
1160
1160
|
};
|
|
1161
|
-
}, [e, t, r]), !e ||
|
|
1161
|
+
}, [e, t, r]), !e || i === null || typeof document > "u" ? null : $t(
|
|
1162
1162
|
/* @__PURE__ */ n(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
@@ -1169,22 +1169,22 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1169
1169
|
position: "fixed",
|
|
1170
1170
|
// Lift the popover above the anchor via translateY(-100%).
|
|
1171
1171
|
// top points to (anchorTop - GAP); transform pulls bottom up to there.
|
|
1172
|
-
top:
|
|
1173
|
-
left:
|
|
1172
|
+
top: i.top,
|
|
1173
|
+
left: i.left,
|
|
1174
1174
|
transform: "translate(-50%, -100%)"
|
|
1175
1175
|
},
|
|
1176
|
-
children:
|
|
1176
|
+
children: o
|
|
1177
1177
|
}
|
|
1178
1178
|
),
|
|
1179
1179
|
document.body
|
|
1180
1180
|
);
|
|
1181
|
-
},
|
|
1181
|
+
}, Fr = ({
|
|
1182
1182
|
isMuted: e,
|
|
1183
1183
|
onToggleMute: t,
|
|
1184
1184
|
isCameraEnabled: r,
|
|
1185
|
-
onToggleCamera:
|
|
1185
|
+
onToggleCamera: o,
|
|
1186
1186
|
allowCamera: a,
|
|
1187
|
-
isScreenShareEnabled:
|
|
1187
|
+
isScreenShareEnabled: i,
|
|
1188
1188
|
onToggleScreenShare: s,
|
|
1189
1189
|
allowScreenShare: l,
|
|
1190
1190
|
isSpeakerMuted: c,
|
|
@@ -1192,10 +1192,10 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1192
1192
|
allowTyping: w,
|
|
1193
1193
|
isTypingOpen: m,
|
|
1194
1194
|
onToggleTyping: f,
|
|
1195
|
-
onDisconnect:
|
|
1195
|
+
onDisconnect: R
|
|
1196
1196
|
}) => {
|
|
1197
1197
|
const [_, y] = N(!1), u = M(null);
|
|
1198
|
-
return /* @__PURE__ */ x(
|
|
1198
|
+
return /* @__PURE__ */ x(ze, { children: [
|
|
1199
1199
|
/* @__PURE__ */ x(
|
|
1200
1200
|
"div",
|
|
1201
1201
|
{
|
|
@@ -1210,7 +1210,7 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1210
1210
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1211
1211
|
onClick: t,
|
|
1212
1212
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1213
|
-
children: /* @__PURE__ */ n(
|
|
1213
|
+
children: /* @__PURE__ */ n(Nn, { muted: e })
|
|
1214
1214
|
}
|
|
1215
1215
|
),
|
|
1216
1216
|
/* @__PURE__ */ n(
|
|
@@ -1223,7 +1223,7 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1223
1223
|
"aria-label": "More controls",
|
|
1224
1224
|
"aria-haspopup": "menu",
|
|
1225
1225
|
"aria-expanded": _,
|
|
1226
|
-
children: /* @__PURE__ */ n(
|
|
1226
|
+
children: /* @__PURE__ */ n(Wr, {})
|
|
1227
1227
|
}
|
|
1228
1228
|
),
|
|
1229
1229
|
/* @__PURE__ */ n(
|
|
@@ -1231,16 +1231,16 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1231
1231
|
{
|
|
1232
1232
|
type: "button",
|
|
1233
1233
|
className: "ll-tool ll-tool--danger",
|
|
1234
|
-
onClick:
|
|
1234
|
+
onClick: R,
|
|
1235
1235
|
"aria-label": "End conversation",
|
|
1236
|
-
children: /* @__PURE__ */ n(
|
|
1236
|
+
children: /* @__PURE__ */ n(In, {})
|
|
1237
1237
|
}
|
|
1238
1238
|
)
|
|
1239
1239
|
]
|
|
1240
1240
|
}
|
|
1241
1241
|
),
|
|
1242
1242
|
/* @__PURE__ */ x(
|
|
1243
|
-
|
|
1243
|
+
Br,
|
|
1244
1244
|
{
|
|
1245
1245
|
open: _,
|
|
1246
1246
|
onClose: () => y(!1),
|
|
@@ -1252,10 +1252,10 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1252
1252
|
type: "button",
|
|
1253
1253
|
className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
|
|
1254
1254
|
onClick: () => {
|
|
1255
|
-
|
|
1255
|
+
o(), y(!1);
|
|
1256
1256
|
},
|
|
1257
1257
|
children: [
|
|
1258
|
-
/* @__PURE__ */ n(
|
|
1258
|
+
/* @__PURE__ */ n(Sn, {}),
|
|
1259
1259
|
/* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
|
|
1260
1260
|
]
|
|
1261
1261
|
}
|
|
@@ -1264,13 +1264,13 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1264
1264
|
"button",
|
|
1265
1265
|
{
|
|
1266
1266
|
type: "button",
|
|
1267
|
-
className: `ll-overflow-popover__item ${
|
|
1267
|
+
className: `ll-overflow-popover__item ${i ? "is-on" : ""}`,
|
|
1268
1268
|
onClick: () => {
|
|
1269
1269
|
s(), y(!1);
|
|
1270
1270
|
},
|
|
1271
1271
|
children: [
|
|
1272
|
-
/* @__PURE__ */ n(
|
|
1273
|
-
/* @__PURE__ */ n("span", { children:
|
|
1272
|
+
/* @__PURE__ */ n(En, {}),
|
|
1273
|
+
/* @__PURE__ */ n("span", { children: i ? "Stop sharing" : "Share screen" })
|
|
1274
1274
|
]
|
|
1275
1275
|
}
|
|
1276
1276
|
),
|
|
@@ -1283,7 +1283,7 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1283
1283
|
p(), y(!1);
|
|
1284
1284
|
},
|
|
1285
1285
|
children: [
|
|
1286
|
-
/* @__PURE__ */ n(
|
|
1286
|
+
/* @__PURE__ */ n(An, { muted: c }),
|
|
1287
1287
|
/* @__PURE__ */ n("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1288
1288
|
]
|
|
1289
1289
|
}
|
|
@@ -1297,7 +1297,7 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1297
1297
|
f(), y(!1);
|
|
1298
1298
|
},
|
|
1299
1299
|
children: [
|
|
1300
|
-
/* @__PURE__ */ n(
|
|
1300
|
+
/* @__PURE__ */ n(qr, {}),
|
|
1301
1301
|
/* @__PURE__ */ n("span", { children: m ? "Hide typing" : "Type a message" })
|
|
1302
1302
|
]
|
|
1303
1303
|
}
|
|
@@ -1320,7 +1320,7 @@ const Wr = 8, fn = 8, qr = ({
|
|
|
1320
1320
|
)
|
|
1321
1321
|
] });
|
|
1322
1322
|
};
|
|
1323
|
-
function
|
|
1323
|
+
function Wr() {
|
|
1324
1324
|
return /* @__PURE__ */ x(
|
|
1325
1325
|
"svg",
|
|
1326
1326
|
{
|
|
@@ -1337,7 +1337,7 @@ function jr() {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
);
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function qr() {
|
|
1341
1341
|
return /* @__PURE__ */ n(
|
|
1342
1342
|
"svg",
|
|
1343
1343
|
{
|
|
@@ -1354,13 +1354,13 @@ function Vr() {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
}
|
|
1357
|
-
const
|
|
1357
|
+
const Ur = ({
|
|
1358
1358
|
position: e,
|
|
1359
1359
|
isMobile: t,
|
|
1360
1360
|
agentName: r,
|
|
1361
|
-
avatarImageUrl:
|
|
1361
|
+
avatarImageUrl: o,
|
|
1362
1362
|
idleLoopUrl: a,
|
|
1363
|
-
greeting:
|
|
1363
|
+
greeting: i,
|
|
1364
1364
|
branding: s,
|
|
1365
1365
|
teamMembers: l,
|
|
1366
1366
|
currentTeamMemberId: c,
|
|
@@ -1368,7 +1368,7 @@ const Yr = ({
|
|
|
1368
1368
|
teamSwitcherOpen: w,
|
|
1369
1369
|
onToggleTeamSwitcher: m,
|
|
1370
1370
|
onSelectTeamMember: f,
|
|
1371
|
-
languageMenuOpen:
|
|
1371
|
+
languageMenuOpen: R,
|
|
1372
1372
|
onToggleLanguageMenu: _,
|
|
1373
1373
|
connectionState: y,
|
|
1374
1374
|
agentState: u,
|
|
@@ -1386,119 +1386,119 @@ const Yr = ({
|
|
|
1386
1386
|
activeCameraId: j,
|
|
1387
1387
|
isScreenShareEnabled: S,
|
|
1388
1388
|
screenPreviewEl: Z,
|
|
1389
|
-
isSpeakerMuted:
|
|
1389
|
+
isSpeakerMuted: _e,
|
|
1390
1390
|
allowCamera: de,
|
|
1391
|
-
allowScreenShare:
|
|
1392
|
-
allowTyping:
|
|
1391
|
+
allowScreenShare: He,
|
|
1392
|
+
allowTyping: Oe,
|
|
1393
1393
|
showMinimize: X = !0,
|
|
1394
|
-
showClose:
|
|
1395
|
-
chromeless:
|
|
1394
|
+
showClose: Se = !0,
|
|
1395
|
+
chromeless: xe = !1,
|
|
1396
1396
|
compactControls: F = !1,
|
|
1397
|
-
transforming:
|
|
1397
|
+
transforming: ie,
|
|
1398
1398
|
transformingLabel: Y,
|
|
1399
|
-
avatarVideoContainerRef:
|
|
1399
|
+
avatarVideoContainerRef: fe,
|
|
1400
1400
|
agentVideoEl: K,
|
|
1401
|
-
onConnect:
|
|
1402
|
-
onDisconnect:
|
|
1403
|
-
onRetry:
|
|
1404
|
-
onResumeAudio:
|
|
1405
|
-
onToggleMute:
|
|
1406
|
-
onSwitchMicDevice:
|
|
1407
|
-
onToggleCamera:
|
|
1408
|
-
onSwitchCameraDevice:
|
|
1409
|
-
onToggleScreenShare:
|
|
1410
|
-
onToggleSpeaker:
|
|
1411
|
-
onSendMessage:
|
|
1412
|
-
onMinimize:
|
|
1401
|
+
onConnect: et,
|
|
1402
|
+
onDisconnect: tt,
|
|
1403
|
+
onRetry: ft,
|
|
1404
|
+
onResumeAudio: nt,
|
|
1405
|
+
onToggleMute: Ne,
|
|
1406
|
+
onSwitchMicDevice: Be,
|
|
1407
|
+
onToggleCamera: Ae,
|
|
1408
|
+
onSwitchCameraDevice: Fe,
|
|
1409
|
+
onToggleScreenShare: Ie,
|
|
1410
|
+
onToggleSpeaker: Me,
|
|
1411
|
+
onSendMessage: Re,
|
|
1412
|
+
onMinimize: Te,
|
|
1413
1413
|
onClose: $,
|
|
1414
1414
|
onClearMicError: Lt
|
|
1415
1415
|
}) => {
|
|
1416
|
-
var
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1416
|
+
var gt;
|
|
1417
|
+
const De = ((l == null ? void 0 : l.length) ?? 0) > 1, We = y === "connecting" || y === "connected", pe = y === "connected", rt = y === "idle" || y === "disconnected" || y === "error", [Pe, qe] = N(!1);
|
|
1418
|
+
T(() => {
|
|
1419
1419
|
if (!K) {
|
|
1420
|
-
|
|
1420
|
+
qe(!1);
|
|
1421
1421
|
return;
|
|
1422
1422
|
}
|
|
1423
1423
|
if (!K.paused && K.readyState >= 2) {
|
|
1424
|
-
|
|
1424
|
+
qe(!0);
|
|
1425
1425
|
return;
|
|
1426
1426
|
}
|
|
1427
|
-
|
|
1428
|
-
const g = () =>
|
|
1427
|
+
qe(!1);
|
|
1428
|
+
const g = () => qe(!0);
|
|
1429
1429
|
return K.addEventListener("playing", g), K.addEventListener("loadeddata", g), () => {
|
|
1430
1430
|
K.removeEventListener("playing", g), K.removeEventListener("loadeddata", g);
|
|
1431
1431
|
};
|
|
1432
1432
|
}, [K]);
|
|
1433
|
-
const [kt,
|
|
1434
|
-
|
|
1435
|
-
if (!
|
|
1436
|
-
|
|
1433
|
+
const [kt, Ce] = N(!1);
|
|
1434
|
+
T(() => {
|
|
1435
|
+
if (!pe) {
|
|
1436
|
+
Ce(!1);
|
|
1437
1437
|
return;
|
|
1438
1438
|
}
|
|
1439
|
-
if (
|
|
1440
|
-
const g = setTimeout(() =>
|
|
1439
|
+
if (Pe) return;
|
|
1440
|
+
const g = setTimeout(() => Ce(!0), 8e3);
|
|
1441
1441
|
return () => clearTimeout(g);
|
|
1442
|
-
}, [
|
|
1443
|
-
const le = y === "connecting" ||
|
|
1444
|
-
|
|
1445
|
-
const g =
|
|
1442
|
+
}, [pe, Pe]);
|
|
1443
|
+
const le = y === "connecting" || pe && !!o && !Pe && !kt, ot = M(null), he = M(null);
|
|
1444
|
+
T(() => {
|
|
1445
|
+
const g = ot.current;
|
|
1446
1446
|
g && (g.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "cover", ne.style.transform = "scaleX(-1)", g.appendChild(ne)));
|
|
1447
|
-
}, [ne]),
|
|
1448
|
-
const g =
|
|
1447
|
+
}, [ne]), T(() => {
|
|
1448
|
+
const g = he.current;
|
|
1449
1449
|
g && (g.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", g.appendChild(Z)));
|
|
1450
1450
|
}, [Z]);
|
|
1451
|
-
const [
|
|
1452
|
-
|
|
1453
|
-
if (!
|
|
1451
|
+
const [me, Ue] = N(!1), [je, ae] = N(!1), ge = M(null), pt = M(null);
|
|
1452
|
+
T(() => {
|
|
1453
|
+
if (!me && !je && !R && !w) return;
|
|
1454
1454
|
const g = () => {
|
|
1455
|
-
|
|
1455
|
+
Ue(!1), ae(!1), R && _(), w && m();
|
|
1456
1456
|
};
|
|
1457
1457
|
return document.addEventListener("click", g), () => document.removeEventListener("click", g);
|
|
1458
1458
|
}, [
|
|
1459
|
-
|
|
1459
|
+
me,
|
|
1460
1460
|
je,
|
|
1461
|
-
|
|
1461
|
+
R,
|
|
1462
1462
|
w,
|
|
1463
1463
|
_,
|
|
1464
1464
|
m
|
|
1465
1465
|
]);
|
|
1466
|
-
const [
|
|
1466
|
+
const [ht, $e] = N(!1), se = E(() => $e((g) => !g), []), [ue, Ee] = N(""), it = E(
|
|
1467
1467
|
(g) => {
|
|
1468
1468
|
g.preventDefault();
|
|
1469
|
-
const Q =
|
|
1470
|
-
Q && (
|
|
1469
|
+
const Q = ue.trim();
|
|
1470
|
+
Q && (Re(Q), Ee(""));
|
|
1471
1471
|
},
|
|
1472
|
-
[
|
|
1473
|
-
),
|
|
1474
|
-
let
|
|
1472
|
+
[ue, Re]
|
|
1473
|
+
), mt = s.productName || "Live Layer", lt = !s.productName;
|
|
1474
|
+
let ye = null, Le = null;
|
|
1475
1475
|
for (let g = h.length - 1; g >= 0; g--) {
|
|
1476
1476
|
const Q = h[g];
|
|
1477
|
-
if (!
|
|
1477
|
+
if (!ye && Q.role === "agent" ? ye = Q : !Le && Q.role === "user" && (Le = Q), ye && Le) break;
|
|
1478
1478
|
}
|
|
1479
|
-
const
|
|
1479
|
+
const Ve = pe ? (ye == null ? void 0 : ye.text) || null : i || null, Ye = pe && (Le == null ? void 0 : Le.text) || null, Ct = [
|
|
1480
1480
|
"ll-expanded",
|
|
1481
1481
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1482
1482
|
].join(" ");
|
|
1483
1483
|
return /* @__PURE__ */ x(
|
|
1484
1484
|
"div",
|
|
1485
1485
|
{
|
|
1486
|
-
className:
|
|
1486
|
+
className: Ct,
|
|
1487
1487
|
"data-position": e,
|
|
1488
|
-
"data-state":
|
|
1488
|
+
"data-state": pe ? "connected" : We ? "connecting" : "idle",
|
|
1489
1489
|
role: "dialog",
|
|
1490
1490
|
"aria-label": `${r} widget`,
|
|
1491
1491
|
children: [
|
|
1492
1492
|
/* @__PURE__ */ x("div", { className: "ll-expanded__bg", children: [
|
|
1493
|
-
|
|
1494
|
-
|
|
1493
|
+
o ? /* @__PURE__ */ n(
|
|
1494
|
+
$r,
|
|
1495
1495
|
{
|
|
1496
|
-
src:
|
|
1496
|
+
src: o,
|
|
1497
1497
|
alt: r,
|
|
1498
1498
|
className: "ll-expanded__bg-img"
|
|
1499
1499
|
}
|
|
1500
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1501
|
-
a && !
|
|
1500
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((gt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : gt.toUpperCase()) || "A" }) }),
|
|
1501
|
+
a && !pe && /* @__PURE__ */ n(
|
|
1502
1502
|
"video",
|
|
1503
1503
|
{
|
|
1504
1504
|
className: "ll-expanded__bg-idle",
|
|
@@ -1510,24 +1510,24 @@ const Yr = ({
|
|
|
1510
1510
|
}
|
|
1511
1511
|
)
|
|
1512
1512
|
] }),
|
|
1513
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1513
|
+
/* @__PURE__ */ n("div", { ref: fe, className: "ll-expanded__video" }),
|
|
1514
1514
|
le && /* @__PURE__ */ x("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1515
1515
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1516
1516
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
|
|
1517
1517
|
] }),
|
|
1518
|
-
A &&
|
|
1518
|
+
A && pe && /* @__PURE__ */ x(
|
|
1519
1519
|
"button",
|
|
1520
1520
|
{
|
|
1521
1521
|
type: "button",
|
|
1522
1522
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1523
|
-
onClick:
|
|
1523
|
+
onClick: nt,
|
|
1524
1524
|
children: [
|
|
1525
1525
|
/* @__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" }) }),
|
|
1526
1526
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
1530
|
-
|
|
1530
|
+
ie && /* @__PURE__ */ x(
|
|
1531
1531
|
"div",
|
|
1532
1532
|
{
|
|
1533
1533
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
@@ -1540,9 +1540,9 @@ const Yr = ({
|
|
|
1540
1540
|
]
|
|
1541
1541
|
}
|
|
1542
1542
|
),
|
|
1543
|
-
|
|
1543
|
+
We ? /* @__PURE__ */ x(ze, { children: [
|
|
1544
1544
|
!F && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar", children: [
|
|
1545
|
-
!
|
|
1545
|
+
!xe && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar-left", children: [
|
|
1546
1546
|
/* @__PURE__ */ x("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1547
1547
|
/* @__PURE__ */ x(
|
|
1548
1548
|
"button",
|
|
@@ -1550,17 +1550,17 @@ const Yr = ({
|
|
|
1550
1550
|
type: "button",
|
|
1551
1551
|
className: "ll-hpill",
|
|
1552
1552
|
onClick: (g) => {
|
|
1553
|
-
|
|
1553
|
+
De && (g.stopPropagation(), m());
|
|
1554
1554
|
},
|
|
1555
|
-
"aria-haspopup":
|
|
1556
|
-
"aria-expanded":
|
|
1555
|
+
"aria-haspopup": De ? "listbox" : void 0,
|
|
1556
|
+
"aria-expanded": De ? w : void 0,
|
|
1557
1557
|
children: [
|
|
1558
1558
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1559
|
-
|
|
1559
|
+
De && /* @__PURE__ */ n(wt, {})
|
|
1560
1560
|
]
|
|
1561
1561
|
}
|
|
1562
1562
|
),
|
|
1563
|
-
|
|
1563
|
+
De && w && /* @__PURE__ */ n(
|
|
1564
1564
|
"div",
|
|
1565
1565
|
{
|
|
1566
1566
|
className: "ll-hmenu",
|
|
@@ -1602,7 +1602,7 @@ const Yr = ({
|
|
|
1602
1602
|
g.stopPropagation(), _();
|
|
1603
1603
|
},
|
|
1604
1604
|
"aria-haspopup": "listbox",
|
|
1605
|
-
"aria-expanded":
|
|
1605
|
+
"aria-expanded": R,
|
|
1606
1606
|
"aria-label": "Language: English",
|
|
1607
1607
|
title: "Language: English",
|
|
1608
1608
|
children: [
|
|
@@ -1611,7 +1611,7 @@ const Yr = ({
|
|
|
1611
1611
|
]
|
|
1612
1612
|
}
|
|
1613
1613
|
),
|
|
1614
|
-
|
|
1614
|
+
R && /* @__PURE__ */ n(
|
|
1615
1615
|
"div",
|
|
1616
1616
|
{
|
|
1617
1617
|
className: "ll-hmenu",
|
|
@@ -1644,13 +1644,13 @@ const Yr = ({
|
|
|
1644
1644
|
{
|
|
1645
1645
|
type: "button",
|
|
1646
1646
|
className: "ll-hbtn",
|
|
1647
|
-
onClick:
|
|
1647
|
+
onClick: Te,
|
|
1648
1648
|
"aria-label": "Minimize widget",
|
|
1649
1649
|
title: "Minimize",
|
|
1650
|
-
children: /* @__PURE__ */ n(
|
|
1650
|
+
children: /* @__PURE__ */ n(pn, {})
|
|
1651
1651
|
}
|
|
1652
1652
|
),
|
|
1653
|
-
|
|
1653
|
+
Se !== !1 && /* @__PURE__ */ n(
|
|
1654
1654
|
"button",
|
|
1655
1655
|
{
|
|
1656
1656
|
type: "button",
|
|
@@ -1658,7 +1658,7 @@ const Yr = ({
|
|
|
1658
1658
|
onClick: $,
|
|
1659
1659
|
"aria-label": "End call",
|
|
1660
1660
|
title: "End call",
|
|
1661
|
-
children: /* @__PURE__ */ n(
|
|
1661
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1662
1662
|
}
|
|
1663
1663
|
)
|
|
1664
1664
|
] })
|
|
@@ -1673,7 +1673,7 @@ const Yr = ({
|
|
|
1673
1673
|
// and 40px buttons crowded out the central "Start video call"
|
|
1674
1674
|
// affordance. The user can dismiss by scrolling past the slot.
|
|
1675
1675
|
!F && /* @__PURE__ */ x("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1676
|
-
|
|
1676
|
+
lt ? /* @__PURE__ */ x(
|
|
1677
1677
|
"a",
|
|
1678
1678
|
{
|
|
1679
1679
|
className: "ll-expanded__brand ll-expanded__brand--link",
|
|
@@ -1683,44 +1683,44 @@ const Yr = ({
|
|
|
1683
1683
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1684
1684
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1685
1685
|
children: [
|
|
1686
|
-
/* @__PURE__ */ n(
|
|
1687
|
-
/* @__PURE__ */ n("span", { children:
|
|
1686
|
+
/* @__PURE__ */ n(Hr, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1687
|
+
/* @__PURE__ */ n("span", { children: mt })
|
|
1688
1688
|
]
|
|
1689
1689
|
}
|
|
1690
|
-
) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1690
|
+
) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: mt }),
|
|
1691
1691
|
/* @__PURE__ */ x("div", { className: "ll-expanded__header-actions", children: [
|
|
1692
1692
|
X !== !1 && /* @__PURE__ */ n(
|
|
1693
1693
|
"button",
|
|
1694
1694
|
{
|
|
1695
1695
|
type: "button",
|
|
1696
1696
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1697
|
-
onClick:
|
|
1697
|
+
onClick: Te,
|
|
1698
1698
|
"aria-label": "Minimize widget",
|
|
1699
|
-
children: /* @__PURE__ */ n(
|
|
1699
|
+
children: /* @__PURE__ */ n(pn, {})
|
|
1700
1700
|
}
|
|
1701
1701
|
),
|
|
1702
|
-
|
|
1702
|
+
Se !== !1 && /* @__PURE__ */ n(
|
|
1703
1703
|
"button",
|
|
1704
1704
|
{
|
|
1705
1705
|
type: "button",
|
|
1706
1706
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1707
1707
|
onClick: $,
|
|
1708
1708
|
"aria-label": "Close widget",
|
|
1709
|
-
children: /* @__PURE__ */ n(
|
|
1709
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1710
1710
|
}
|
|
1711
1711
|
)
|
|
1712
1712
|
] })
|
|
1713
1713
|
] })
|
|
1714
1714
|
),
|
|
1715
|
-
|
|
1715
|
+
rt && /* @__PURE__ */ (() => {
|
|
1716
1716
|
const g = L ? "Resume session" : y === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1717
|
-
return /* @__PURE__ */ x(
|
|
1717
|
+
return /* @__PURE__ */ x(ze, { children: [
|
|
1718
1718
|
!I && /* @__PURE__ */ x(
|
|
1719
1719
|
"button",
|
|
1720
1720
|
{
|
|
1721
1721
|
type: "button",
|
|
1722
1722
|
className: "ll-expanded__play",
|
|
1723
|
-
onClick:
|
|
1723
|
+
onClick: et,
|
|
1724
1724
|
"aria-label": g,
|
|
1725
1725
|
children: [
|
|
1726
1726
|
/* @__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" }) }) }),
|
|
@@ -1729,13 +1729,13 @@ const Yr = ({
|
|
|
1729
1729
|
}
|
|
1730
1730
|
),
|
|
1731
1731
|
!F && /* @__PURE__ */ x("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1732
|
-
|
|
1732
|
+
i && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: i }) }),
|
|
1733
1733
|
/* @__PURE__ */ n(
|
|
1734
1734
|
"button",
|
|
1735
1735
|
{
|
|
1736
1736
|
type: "button",
|
|
1737
1737
|
className: "ll-expanded__cta",
|
|
1738
|
-
onClick:
|
|
1738
|
+
onClick: et,
|
|
1739
1739
|
"aria-label": g,
|
|
1740
1740
|
children: g
|
|
1741
1741
|
}
|
|
@@ -1746,52 +1746,52 @@ const Yr = ({
|
|
|
1746
1746
|
/* @__PURE__ */ x(
|
|
1747
1747
|
"div",
|
|
1748
1748
|
{
|
|
1749
|
-
className: `ll-expanded__pip ${
|
|
1749
|
+
className: `ll-expanded__pip ${We && (q || S) ? "is-visible" : ""}`,
|
|
1750
1750
|
children: [
|
|
1751
1751
|
/* @__PURE__ */ n(
|
|
1752
1752
|
"div",
|
|
1753
1753
|
{
|
|
1754
|
-
ref:
|
|
1754
|
+
ref: he,
|
|
1755
1755
|
className: S ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1756
1756
|
}
|
|
1757
1757
|
),
|
|
1758
1758
|
/* @__PURE__ */ n(
|
|
1759
1759
|
"div",
|
|
1760
1760
|
{
|
|
1761
|
-
ref:
|
|
1761
|
+
ref: ot,
|
|
1762
1762
|
className: !S && q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1763
1763
|
}
|
|
1764
1764
|
)
|
|
1765
1765
|
]
|
|
1766
1766
|
}
|
|
1767
1767
|
),
|
|
1768
|
-
|
|
1769
|
-
!F &&
|
|
1768
|
+
We ? /* @__PURE__ */ x("div", { className: "ll-expanded__bottom", children: [
|
|
1769
|
+
!F && Ve && /* @__PURE__ */ n(
|
|
1770
1770
|
"div",
|
|
1771
1771
|
{
|
|
1772
1772
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1773
1773
|
"data-role": "agent",
|
|
1774
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1774
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ve })
|
|
1775
1775
|
}
|
|
1776
1776
|
),
|
|
1777
|
-
!F &&
|
|
1777
|
+
!F && Ye && /* @__PURE__ */ n(
|
|
1778
1778
|
"div",
|
|
1779
1779
|
{
|
|
1780
1780
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
1781
1781
|
"data-role": "user",
|
|
1782
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1782
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ye })
|
|
1783
1783
|
}
|
|
1784
1784
|
),
|
|
1785
|
-
!
|
|
1786
|
-
|
|
1785
|
+
!xe && !F && /* @__PURE__ */ x("div", { className: "ll-toolbar", onClick: (g) => g.stopPropagation(), children: [
|
|
1786
|
+
He && /* @__PURE__ */ n(
|
|
1787
1787
|
"button",
|
|
1788
1788
|
{
|
|
1789
1789
|
type: "button",
|
|
1790
1790
|
className: `ll-tool ${S ? "is-on" : ""}`,
|
|
1791
|
-
onClick:
|
|
1791
|
+
onClick: Ie,
|
|
1792
1792
|
"aria-label": S ? "Stop sharing screen" : "Share screen",
|
|
1793
1793
|
title: S ? "Stop sharing" : "Share screen",
|
|
1794
|
-
children: /* @__PURE__ */ n(
|
|
1794
|
+
children: /* @__PURE__ */ n(En, {})
|
|
1795
1795
|
}
|
|
1796
1796
|
),
|
|
1797
1797
|
de && /* @__PURE__ */ x("div", { className: "ll-tool-split", children: [
|
|
@@ -1800,20 +1800,20 @@ const Yr = ({
|
|
|
1800
1800
|
{
|
|
1801
1801
|
type: "button",
|
|
1802
1802
|
className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
|
|
1803
|
-
onClick:
|
|
1803
|
+
onClick: Ae,
|
|
1804
1804
|
"aria-label": q ? "Turn off camera" : "Turn on camera",
|
|
1805
1805
|
title: q ? "Stop camera" : "Start camera",
|
|
1806
|
-
children: /* @__PURE__ */ n(
|
|
1806
|
+
children: /* @__PURE__ */ n(Sn, {})
|
|
1807
1807
|
}
|
|
1808
1808
|
),
|
|
1809
1809
|
/* @__PURE__ */ n(
|
|
1810
1810
|
"button",
|
|
1811
1811
|
{
|
|
1812
|
-
ref:
|
|
1812
|
+
ref: pt,
|
|
1813
1813
|
type: "button",
|
|
1814
1814
|
className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
|
|
1815
1815
|
onClick: (g) => {
|
|
1816
|
-
g.stopPropagation(),
|
|
1816
|
+
g.stopPropagation(), ae((Q) => !Q), Ue(!1);
|
|
1817
1817
|
},
|
|
1818
1818
|
"aria-label": "Camera devices",
|
|
1819
1819
|
"aria-haspopup": "listbox",
|
|
@@ -1822,14 +1822,14 @@ const Yr = ({
|
|
|
1822
1822
|
}
|
|
1823
1823
|
),
|
|
1824
1824
|
je && B.length > 0 && /* @__PURE__ */ n(
|
|
1825
|
-
|
|
1825
|
+
hn,
|
|
1826
1826
|
{
|
|
1827
1827
|
label: "Camera",
|
|
1828
1828
|
devices: B,
|
|
1829
1829
|
activeId: j,
|
|
1830
|
-
anchorRef:
|
|
1830
|
+
anchorRef: pt,
|
|
1831
1831
|
onPick: (g) => {
|
|
1832
|
-
|
|
1832
|
+
ae(!1), Fe(g);
|
|
1833
1833
|
}
|
|
1834
1834
|
}
|
|
1835
1835
|
)
|
|
@@ -1840,36 +1840,36 @@ const Yr = ({
|
|
|
1840
1840
|
{
|
|
1841
1841
|
type: "button",
|
|
1842
1842
|
className: `ll-tool ll-tool--left ${U ? "is-muted" : ""}`,
|
|
1843
|
-
onClick:
|
|
1843
|
+
onClick: Ne,
|
|
1844
1844
|
"aria-label": U ? "Unmute microphone" : "Mute microphone",
|
|
1845
1845
|
title: U ? "Unmute" : "Mute",
|
|
1846
|
-
children: /* @__PURE__ */ n(
|
|
1846
|
+
children: /* @__PURE__ */ n(Nn, { muted: U })
|
|
1847
1847
|
}
|
|
1848
1848
|
),
|
|
1849
1849
|
/* @__PURE__ */ n(
|
|
1850
1850
|
"button",
|
|
1851
1851
|
{
|
|
1852
|
-
ref:
|
|
1852
|
+
ref: ge,
|
|
1853
1853
|
type: "button",
|
|
1854
1854
|
className: `ll-tool ll-tool--right ${U ? "is-muted" : ""}`,
|
|
1855
1855
|
onClick: (g) => {
|
|
1856
|
-
g.stopPropagation(),
|
|
1856
|
+
g.stopPropagation(), Ue((Q) => !Q), ae(!1);
|
|
1857
1857
|
},
|
|
1858
1858
|
"aria-label": "Microphone devices",
|
|
1859
1859
|
"aria-haspopup": "listbox",
|
|
1860
|
-
"aria-expanded":
|
|
1860
|
+
"aria-expanded": me,
|
|
1861
1861
|
children: /* @__PURE__ */ n(wt, {})
|
|
1862
1862
|
}
|
|
1863
1863
|
),
|
|
1864
|
-
|
|
1865
|
-
|
|
1864
|
+
me && P.length > 0 && /* @__PURE__ */ n(
|
|
1865
|
+
hn,
|
|
1866
1866
|
{
|
|
1867
1867
|
label: "Microphone",
|
|
1868
1868
|
devices: P,
|
|
1869
1869
|
activeId: O,
|
|
1870
|
-
anchorRef:
|
|
1870
|
+
anchorRef: ge,
|
|
1871
1871
|
onPick: (g) => {
|
|
1872
|
-
|
|
1872
|
+
Ue(!1), Be(g);
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
)
|
|
@@ -1878,11 +1878,11 @@ const Yr = ({
|
|
|
1878
1878
|
"button",
|
|
1879
1879
|
{
|
|
1880
1880
|
type: "button",
|
|
1881
|
-
className: `ll-tool ${
|
|
1882
|
-
onClick:
|
|
1883
|
-
"aria-label":
|
|
1884
|
-
title:
|
|
1885
|
-
children: /* @__PURE__ */ n(
|
|
1881
|
+
className: `ll-tool ${_e ? "is-muted" : ""}`,
|
|
1882
|
+
onClick: Me,
|
|
1883
|
+
"aria-label": _e ? "Unmute speaker" : "Mute speaker",
|
|
1884
|
+
title: _e ? "Unmute speaker" : "Mute speaker",
|
|
1885
|
+
children: /* @__PURE__ */ n(An, { muted: _e })
|
|
1886
1886
|
}
|
|
1887
1887
|
),
|
|
1888
1888
|
/* @__PURE__ */ n(
|
|
@@ -1890,51 +1890,51 @@ const Yr = ({
|
|
|
1890
1890
|
{
|
|
1891
1891
|
type: "button",
|
|
1892
1892
|
className: "ll-tool ll-tool--danger",
|
|
1893
|
-
onClick:
|
|
1893
|
+
onClick: tt,
|
|
1894
1894
|
"aria-label": "End conversation",
|
|
1895
1895
|
title: "End conversation",
|
|
1896
|
-
children: /* @__PURE__ */ n(
|
|
1896
|
+
children: /* @__PURE__ */ n(In, {})
|
|
1897
1897
|
}
|
|
1898
1898
|
)
|
|
1899
1899
|
] }),
|
|
1900
|
-
!
|
|
1901
|
-
|
|
1900
|
+
!xe && F && /* @__PURE__ */ n(
|
|
1901
|
+
Fr,
|
|
1902
1902
|
{
|
|
1903
1903
|
isMuted: U,
|
|
1904
|
-
onToggleMute:
|
|
1904
|
+
onToggleMute: Ne,
|
|
1905
1905
|
isCameraEnabled: q,
|
|
1906
|
-
onToggleCamera:
|
|
1906
|
+
onToggleCamera: Ae,
|
|
1907
1907
|
allowCamera: de,
|
|
1908
1908
|
isScreenShareEnabled: S,
|
|
1909
|
-
onToggleScreenShare:
|
|
1910
|
-
allowScreenShare:
|
|
1911
|
-
isSpeakerMuted:
|
|
1912
|
-
onToggleSpeaker:
|
|
1913
|
-
allowTyping:
|
|
1914
|
-
isTypingOpen:
|
|
1915
|
-
onToggleTyping:
|
|
1916
|
-
onDisconnect:
|
|
1909
|
+
onToggleScreenShare: Ie,
|
|
1910
|
+
allowScreenShare: He,
|
|
1911
|
+
isSpeakerMuted: _e,
|
|
1912
|
+
onToggleSpeaker: Me,
|
|
1913
|
+
allowTyping: Oe,
|
|
1914
|
+
isTypingOpen: ht,
|
|
1915
|
+
onToggleTyping: se,
|
|
1916
|
+
onDisconnect: tt
|
|
1917
1917
|
}
|
|
1918
1918
|
),
|
|
1919
|
-
!
|
|
1919
|
+
!xe && Oe && (F ? ht : !0) && /* @__PURE__ */ x("form", { className: "ll-message-input", onSubmit: it, children: [
|
|
1920
1920
|
/* @__PURE__ */ n(
|
|
1921
1921
|
"input",
|
|
1922
1922
|
{
|
|
1923
1923
|
type: "text",
|
|
1924
1924
|
className: "ll-message-input__field",
|
|
1925
1925
|
placeholder: "Message...",
|
|
1926
|
-
value:
|
|
1926
|
+
value: ue,
|
|
1927
1927
|
onChange: (g) => Ee(g.target.value),
|
|
1928
1928
|
"aria-label": "Message the agent"
|
|
1929
1929
|
}
|
|
1930
1930
|
),
|
|
1931
|
-
|
|
1931
|
+
ue.trim() && /* @__PURE__ */ n(
|
|
1932
1932
|
"button",
|
|
1933
1933
|
{
|
|
1934
1934
|
type: "submit",
|
|
1935
1935
|
className: "ll-message-input__send",
|
|
1936
1936
|
"aria-label": "Send message",
|
|
1937
|
-
children: /* @__PURE__ */ n(
|
|
1937
|
+
children: /* @__PURE__ */ n(jr, {})
|
|
1938
1938
|
}
|
|
1939
1939
|
)
|
|
1940
1940
|
] })
|
|
@@ -1963,7 +1963,7 @@ const Yr = ({
|
|
|
1963
1963
|
{
|
|
1964
1964
|
type: "button",
|
|
1965
1965
|
className: "ll-expanded__banner-retry",
|
|
1966
|
-
onClick:
|
|
1966
|
+
onClick: ft,
|
|
1967
1967
|
children: Q
|
|
1968
1968
|
}
|
|
1969
1969
|
)
|
|
@@ -1976,29 +1976,29 @@ const Yr = ({
|
|
|
1976
1976
|
function wt() {
|
|
1977
1977
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function fn() {
|
|
1980
1980
|
return /* @__PURE__ */ x("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1981
1981
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1982
1982
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1983
1983
|
] });
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function pn() {
|
|
1986
1986
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1988
|
+
function En() {
|
|
1989
1989
|
return /* @__PURE__ */ x("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1990
1990
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1991
1991
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1992
1992
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1993
1993
|
] });
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1995
|
+
function Sn() {
|
|
1996
1996
|
return /* @__PURE__ */ x("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1997
1997
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1998
1998
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1999
1999
|
] });
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function Nn({ muted: e }) {
|
|
2002
2002
|
return /* @__PURE__ */ x("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2003
2003
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2004
2004
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -2006,22 +2006,22 @@ function In({ muted: e }) {
|
|
|
2006
2006
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2007
2007
|
] });
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2009
|
+
function An({ muted: e }) {
|
|
2010
2010
|
return /* @__PURE__ */ x("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2011
2011
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2012
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ x(
|
|
2012
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ x(ze, { children: [
|
|
2013
2013
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
2014
2014
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
2015
2015
|
] })
|
|
2016
2016
|
] });
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function jr() {
|
|
2019
2019
|
return /* @__PURE__ */ x("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2020
2020
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2021
2021
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
2022
2022
|
] });
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function In() {
|
|
2025
2025
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
|
|
2026
2026
|
"path",
|
|
2027
2027
|
{
|
|
@@ -2030,15 +2030,15 @@ function Rn() {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
) });
|
|
2032
2032
|
}
|
|
2033
|
-
const
|
|
2033
|
+
const hn = ({
|
|
2034
2034
|
label: e,
|
|
2035
2035
|
devices: t,
|
|
2036
2036
|
activeId: r,
|
|
2037
|
-
onPick:
|
|
2037
|
+
onPick: o,
|
|
2038
2038
|
anchorRef: a
|
|
2039
2039
|
}) => {
|
|
2040
|
-
const [
|
|
2041
|
-
return
|
|
2040
|
+
const [i, s] = N(null);
|
|
2041
|
+
return Ln(() => {
|
|
2042
2042
|
const l = () => {
|
|
2043
2043
|
const c = a.current;
|
|
2044
2044
|
if (!c) return;
|
|
@@ -2051,7 +2051,7 @@ const mn = ({
|
|
|
2051
2051
|
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
2052
2052
|
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
2053
2053
|
};
|
|
2054
|
-
}, [a]),
|
|
2054
|
+
}, [a]), i === null || typeof document > "u" ? null : $t(
|
|
2055
2055
|
/* @__PURE__ */ x(
|
|
2056
2056
|
"div",
|
|
2057
2057
|
{
|
|
@@ -2060,8 +2060,8 @@ const mn = ({
|
|
|
2060
2060
|
role: "listbox",
|
|
2061
2061
|
style: {
|
|
2062
2062
|
position: "fixed",
|
|
2063
|
-
top:
|
|
2064
|
-
left:
|
|
2063
|
+
top: i.top,
|
|
2064
|
+
left: i.left,
|
|
2065
2065
|
// translate up by 100% so its BOTTOM edge sits at pos.top.
|
|
2066
2066
|
transform: "translate(-50%, -100%)"
|
|
2067
2067
|
},
|
|
@@ -2074,7 +2074,7 @@ const mn = ({
|
|
|
2074
2074
|
{
|
|
2075
2075
|
type: "button",
|
|
2076
2076
|
className: `ll-device-menu__item ${p ? "is-active" : ""}`,
|
|
2077
|
-
onClick: () =>
|
|
2077
|
+
onClick: () => o(l.deviceId),
|
|
2078
2078
|
role: "option",
|
|
2079
2079
|
"aria-selected": p,
|
|
2080
2080
|
children: [
|
|
@@ -2090,7 +2090,7 @@ const mn = ({
|
|
|
2090
2090
|
),
|
|
2091
2091
|
document.body
|
|
2092
2092
|
);
|
|
2093
|
-
},
|
|
2093
|
+
}, Vr = [
|
|
2094
2094
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2095
2095
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2096
2096
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2098,17 +2098,17 @@ const mn = ({
|
|
|
2098
2098
|
"[data-ll-skip]",
|
|
2099
2099
|
".ll-widget"
|
|
2100
2100
|
];
|
|
2101
|
-
function
|
|
2101
|
+
function zt(e) {
|
|
2102
2102
|
let t = e;
|
|
2103
2103
|
for (; t; ) {
|
|
2104
|
-
for (const r of
|
|
2104
|
+
for (const r of Vr)
|
|
2105
2105
|
if (t.matches(r)) return !0;
|
|
2106
2106
|
t = t.parentElement;
|
|
2107
2107
|
}
|
|
2108
2108
|
return !1;
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2111
|
-
if (
|
|
2110
|
+
function Dt(e) {
|
|
2111
|
+
if (zt(e)) return !1;
|
|
2112
2112
|
if (e instanceof HTMLInputElement) {
|
|
2113
2113
|
if (e.type === "password") return !1;
|
|
2114
2114
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2116,7 +2116,7 @@ function Pt(e) {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
return !0;
|
|
2118
2118
|
}
|
|
2119
|
-
const _t = 4096,
|
|
2119
|
+
const _t = 4096, Yr = 20, Gr = 20, Kr = 10, Jr = 10, Xr = 30, Zr = 20, mn = 500, Qr = [
|
|
2120
2120
|
'[data-ll-private="true"]',
|
|
2121
2121
|
".ll-widget",
|
|
2122
2122
|
"script",
|
|
@@ -2124,74 +2124,74 @@ const _t = 4096, Jr = 20, Xr = 20, Zr = 10, Qr = 10, ei = 30, ti = 20, gn = 500,
|
|
|
2124
2124
|
"noscript",
|
|
2125
2125
|
"iframe"
|
|
2126
2126
|
];
|
|
2127
|
-
function
|
|
2127
|
+
function dt(e) {
|
|
2128
2128
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2129
2129
|
let t = e;
|
|
2130
2130
|
for (; t; ) {
|
|
2131
|
-
for (const r of
|
|
2131
|
+
for (const r of Qr)
|
|
2132
2132
|
if (t.matches(r)) return !0;
|
|
2133
2133
|
t = t.parentElement;
|
|
2134
2134
|
}
|
|
2135
2135
|
return !1;
|
|
2136
2136
|
}
|
|
2137
|
-
function
|
|
2137
|
+
function ut(e) {
|
|
2138
2138
|
if (typeof window > "u") return !0;
|
|
2139
2139
|
const t = e.getBoundingClientRect();
|
|
2140
2140
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2141
|
-
const r = window.innerHeight || document.documentElement.clientHeight,
|
|
2142
|
-
return t.bottom > 0 && t.right > 0 && t.top < r && t.left <
|
|
2141
|
+
const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
|
|
2142
|
+
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function gn(e) {
|
|
2145
2145
|
const t = e.getAttribute("id");
|
|
2146
2146
|
if (t) {
|
|
2147
|
-
const
|
|
2147
|
+
const i = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${i}"]`);
|
|
2148
2148
|
if (s != null && s.textContent) return s.textContent.trim();
|
|
2149
2149
|
}
|
|
2150
2150
|
const r = e.getAttribute("aria-label");
|
|
2151
2151
|
if (r) return r.trim();
|
|
2152
|
-
const
|
|
2153
|
-
if (
|
|
2154
|
-
const
|
|
2155
|
-
for (const l of Array.from(
|
|
2152
|
+
const o = e.closest("label");
|
|
2153
|
+
if (o) {
|
|
2154
|
+
const i = [];
|
|
2155
|
+
for (const l of Array.from(o.childNodes))
|
|
2156
2156
|
if (l.nodeType === Node.TEXT_NODE) {
|
|
2157
2157
|
const c = (l.textContent || "").trim();
|
|
2158
|
-
c &&
|
|
2158
|
+
c && i.push(c);
|
|
2159
2159
|
} else if (l instanceof HTMLElement) {
|
|
2160
2160
|
if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
|
|
2161
2161
|
continue;
|
|
2162
2162
|
const c = (l.textContent || "").trim();
|
|
2163
|
-
c &&
|
|
2163
|
+
c && i.push(c);
|
|
2164
2164
|
}
|
|
2165
|
-
const s =
|
|
2165
|
+
const s = i.join(" ").trim();
|
|
2166
2166
|
if (s) return s;
|
|
2167
2167
|
}
|
|
2168
2168
|
const a = e.getAttribute("placeholder");
|
|
2169
2169
|
return a ? a.trim() : "";
|
|
2170
2170
|
}
|
|
2171
|
-
function
|
|
2171
|
+
function oe(e, t) {
|
|
2172
2172
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2173
2173
|
}
|
|
2174
|
-
function
|
|
2174
|
+
function eo(e) {
|
|
2175
2175
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2177
|
+
function to(e) {
|
|
2178
2178
|
const t = e.getAttribute("aria-label");
|
|
2179
2179
|
if (t) return t.trim().slice(0, 80);
|
|
2180
2180
|
const r = e.getAttribute("aria-labelledby");
|
|
2181
2181
|
if (r) {
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2182
|
+
const i = document.getElementById(r);
|
|
2183
|
+
if (i != null && i.textContent) return i.textContent.trim().slice(0, 80);
|
|
2184
2184
|
}
|
|
2185
|
-
const
|
|
2185
|
+
const o = e.querySelector(
|
|
2186
2186
|
'button[type="submit"], input[type="submit"], button:not([type])'
|
|
2187
2187
|
);
|
|
2188
|
-
if (
|
|
2189
|
-
const
|
|
2190
|
-
if (
|
|
2191
|
-
return
|
|
2188
|
+
if (o) {
|
|
2189
|
+
const i = o instanceof HTMLInputElement ? o.value : (o.textContent ?? "").trim();
|
|
2190
|
+
if (i && i.length < 60 && !/^(submit|ok|continue)$/i.test(i))
|
|
2191
|
+
return i;
|
|
2192
2192
|
}
|
|
2193
2193
|
let a = e.parentElement;
|
|
2194
|
-
for (let
|
|
2194
|
+
for (let i = 0; a && i < 4; i++, a = a.parentElement) {
|
|
2195
2195
|
const s = a.querySelector("h1, h2, h3, h4");
|
|
2196
2196
|
if (s != null && s.textContent) {
|
|
2197
2197
|
const l = s.textContent.trim();
|
|
@@ -2200,10 +2200,10 @@ function ii(e) {
|
|
|
2200
2200
|
}
|
|
2201
2201
|
return null;
|
|
2202
2202
|
}
|
|
2203
|
-
function
|
|
2203
|
+
function Je(e) {
|
|
2204
2204
|
return e.length;
|
|
2205
2205
|
}
|
|
2206
|
-
function
|
|
2206
|
+
function no(e, t = {}) {
|
|
2207
2207
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
2208
2208
|
if (!r)
|
|
2209
2209
|
return {
|
|
@@ -2217,15 +2217,15 @@ function oi(e, t = {}) {
|
|
|
2217
2217
|
forms: [],
|
|
2218
2218
|
extras: e
|
|
2219
2219
|
};
|
|
2220
|
-
const
|
|
2220
|
+
const o = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", i = r.title || "", s = Array.from(
|
|
2221
2221
|
r.querySelectorAll("[data-ll-region]")
|
|
2222
2222
|
), l = [];
|
|
2223
2223
|
for (const b of s) {
|
|
2224
|
-
if (l.length >=
|
|
2225
|
-
if (
|
|
2226
|
-
const P = b.getAttribute("data-ll-region") ?? "", O = b.getAttribute("data-ll-intent") ?? void 0, q =
|
|
2224
|
+
if (l.length >= Kr) break;
|
|
2225
|
+
if (dt(b) || !ut(b)) continue;
|
|
2226
|
+
const P = b.getAttribute("data-ll-region") ?? "", O = b.getAttribute("data-ll-intent") ?? void 0, q = oe(
|
|
2227
2227
|
(b.innerText || b.textContent || "").trim(),
|
|
2228
|
-
|
|
2228
|
+
mn * 2
|
|
2229
2229
|
);
|
|
2230
2230
|
!P || !q || l.push({ id: P, intent: O, text: q });
|
|
2231
2231
|
}
|
|
@@ -2233,23 +2233,23 @@ function oi(e, t = {}) {
|
|
|
2233
2233
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2234
2234
|
);
|
|
2235
2235
|
for (const b of w) {
|
|
2236
|
-
if (
|
|
2236
|
+
if (dt(b) || !ut(b)) continue;
|
|
2237
2237
|
const P = (b.textContent || "").trim();
|
|
2238
|
-
P && c.push(`${b.tagName}: ${
|
|
2238
|
+
P && c.push(`${b.tagName}: ${oe(P, 200)}`);
|
|
2239
2239
|
}
|
|
2240
2240
|
const m = Array.from(r.querySelectorAll("p, li"));
|
|
2241
2241
|
for (const b of m) {
|
|
2242
|
-
if (
|
|
2242
|
+
if (dt(b) || !ut(b) || p.includes(b.tagName)) continue;
|
|
2243
2243
|
const P = (b.textContent || "").trim();
|
|
2244
|
-
P.length > 10 && c.push(
|
|
2244
|
+
P.length > 10 && c.push(oe(P, mn));
|
|
2245
2245
|
}
|
|
2246
2246
|
const f = c.join(`
|
|
2247
|
-
`),
|
|
2247
|
+
`), R = [], _ = Array.from(r.querySelectorAll("a[href]"));
|
|
2248
2248
|
for (const b of _) {
|
|
2249
|
-
if (
|
|
2250
|
-
if (
|
|
2249
|
+
if (R.length >= Yr) break;
|
|
2250
|
+
if (dt(b) || !ut(b)) continue;
|
|
2251
2251
|
const P = b.getAttribute("href") || "", O = (b.textContent || "").trim();
|
|
2252
|
-
!P || !O ||
|
|
2252
|
+
!P || !O || R.push({ href: P, text: oe(O, 100) });
|
|
2253
2253
|
}
|
|
2254
2254
|
const y = [], u = Array.from(
|
|
2255
2255
|
r.querySelectorAll(
|
|
@@ -2257,17 +2257,17 @@ function oi(e, t = {}) {
|
|
|
2257
2257
|
)
|
|
2258
2258
|
);
|
|
2259
2259
|
for (const b of u) {
|
|
2260
|
-
if (y.length >=
|
|
2261
|
-
if (
|
|
2262
|
-
const P =
|
|
2263
|
-
P && y.push({ label:
|
|
2260
|
+
if (y.length >= Gr) break;
|
|
2261
|
+
if (dt(b) || !Dt(b) || !ut(b)) continue;
|
|
2262
|
+
const P = gn(b), O = b instanceof HTMLInputElement ? b.type : b.tagName.toLowerCase();
|
|
2263
|
+
P && y.push({ label: oe(P, 100), type: O });
|
|
2264
2264
|
}
|
|
2265
2265
|
const h = Array.from(r.querySelectorAll("form")), L = [];
|
|
2266
2266
|
let A = 0;
|
|
2267
2267
|
for (const b of h) {
|
|
2268
|
-
if (L.length >=
|
|
2269
|
-
if (
|
|
2270
|
-
const P = b.getAttribute("id") || b.getAttribute("name") ||
|
|
2268
|
+
if (L.length >= Jr) break;
|
|
2269
|
+
if (zt(b) || b.matches(".ll-widget *, .ll-widget")) continue;
|
|
2270
|
+
const P = b.getAttribute("id") || b.getAttribute("name") || eo(b.getAttribute("data-ll-intent")) || `form_${A++}`, O = b.getAttribute("data-ll-intent") || to(b) || void 0, q = Array.from(
|
|
2271
2271
|
b.querySelectorAll(
|
|
2272
2272
|
"input, textarea, select"
|
|
2273
2273
|
)
|
|
@@ -2275,92 +2275,92 @@ function oi(e, t = {}) {
|
|
|
2275
2275
|
let B = 0;
|
|
2276
2276
|
const j = /* @__PURE__ */ new Set();
|
|
2277
2277
|
for (const S of q) {
|
|
2278
|
-
if (ne.length >=
|
|
2279
|
-
if (!
|
|
2278
|
+
if (ne.length >= Xr) break;
|
|
2279
|
+
if (!Dt(S)) continue;
|
|
2280
2280
|
if (S instanceof HTMLInputElement) {
|
|
2281
2281
|
const F = S.type;
|
|
2282
2282
|
if (F === "submit" || F === "button" || F === "reset" || F === "hidden" || F === "image" || F === "file") continue;
|
|
2283
2283
|
}
|
|
2284
|
-
const Z = S.getAttribute("name") || "",
|
|
2285
|
-
let de = Z ||
|
|
2284
|
+
const Z = S.getAttribute("name") || "", _e = S.getAttribute("id") || "";
|
|
2285
|
+
let de = Z || _e || `field_${B}`;
|
|
2286
2286
|
j.has(de) && (de = `${de}__${B}`), j.add(de), B++;
|
|
2287
|
-
const
|
|
2287
|
+
const He = gn(S) || de, Oe = S instanceof HTMLInputElement ? S.type : S.tagName.toLowerCase(), X = {
|
|
2288
2288
|
name: de,
|
|
2289
|
-
label:
|
|
2290
|
-
type:
|
|
2289
|
+
label: oe(He, 100),
|
|
2290
|
+
type: Oe
|
|
2291
2291
|
};
|
|
2292
2292
|
S.required === !0 && (X.required = !0);
|
|
2293
|
-
const
|
|
2294
|
-
if (
|
|
2293
|
+
const Se = S.getAttribute("placeholder");
|
|
2294
|
+
if (Se && (X.placeholder = oe(Se.trim(), 100)), S instanceof HTMLInputElement || S instanceof HTMLTextAreaElement) {
|
|
2295
2295
|
const F = S.getAttribute("minlength");
|
|
2296
2296
|
if (F !== null) {
|
|
2297
2297
|
const Y = parseInt(F, 10);
|
|
2298
2298
|
!Number.isNaN(Y) && Y >= 0 && (X.minLength = Y);
|
|
2299
2299
|
}
|
|
2300
|
-
const
|
|
2301
|
-
if (
|
|
2302
|
-
const Y = parseInt(
|
|
2300
|
+
const ie = S.getAttribute("maxlength");
|
|
2301
|
+
if (ie !== null) {
|
|
2302
|
+
const Y = parseInt(ie, 10);
|
|
2303
2303
|
!Number.isNaN(Y) && Y >= 0 && (X.maxLength = Y);
|
|
2304
2304
|
}
|
|
2305
2305
|
}
|
|
2306
2306
|
if (S instanceof HTMLInputElement) {
|
|
2307
2307
|
const F = S.getAttribute("min");
|
|
2308
|
-
F !== null && (X.min =
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2308
|
+
F !== null && (X.min = oe(F, 50));
|
|
2309
|
+
const ie = S.getAttribute("max");
|
|
2310
|
+
ie !== null && (X.max = oe(ie, 50));
|
|
2311
2311
|
const Y = S.getAttribute("step");
|
|
2312
|
-
Y !== null && (X.step =
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2312
|
+
Y !== null && (X.step = oe(Y, 20));
|
|
2313
|
+
const fe = S.getAttribute("pattern");
|
|
2314
|
+
fe !== null && (X.pattern = oe(fe, 200));
|
|
2315
2315
|
const K = (S.getAttribute("autocomplete") || "").toLowerCase();
|
|
2316
|
-
K && K !== "off" && !K.startsWith("cc-") && (X.autocomplete =
|
|
2316
|
+
K && K !== "off" && !K.startsWith("cc-") && (X.autocomplete = oe(K, 50));
|
|
2317
2317
|
}
|
|
2318
2318
|
if (S instanceof HTMLSelectElement) {
|
|
2319
2319
|
const F = [];
|
|
2320
|
-
for (let
|
|
2321
|
-
const Y = S.options[
|
|
2320
|
+
for (let ie = 0; ie < S.options.length && !(F.length >= Zr); ie++) {
|
|
2321
|
+
const Y = S.options[ie];
|
|
2322
2322
|
if (!Y || Y.disabled) continue;
|
|
2323
|
-
const
|
|
2324
|
-
!
|
|
2323
|
+
const fe = Y.value || "", K = (Y.textContent || "").trim() || fe;
|
|
2324
|
+
!fe && !K || F.push({ value: fe, label: oe(K, 60) });
|
|
2325
2325
|
}
|
|
2326
2326
|
F.length > 0 && (X.options = F);
|
|
2327
2327
|
}
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2328
|
+
const xe = typeof S.validationMessage == "string" ? S.validationMessage : "";
|
|
2329
|
+
xe && (X.validationMessage = oe(xe, 200)), ne.push(X);
|
|
2330
2330
|
}
|
|
2331
2331
|
L.push({ id: P, intent: O, fields: ne });
|
|
2332
2332
|
}
|
|
2333
2333
|
const I = {
|
|
2334
|
-
url:
|
|
2335
|
-
title:
|
|
2334
|
+
url: o,
|
|
2335
|
+
title: i,
|
|
2336
2336
|
pathname: a,
|
|
2337
2337
|
regions: l,
|
|
2338
2338
|
visibleText: f,
|
|
2339
|
-
visibleLinks:
|
|
2339
|
+
visibleLinks: R,
|
|
2340
2340
|
visibleFields: y,
|
|
2341
2341
|
forms: L,
|
|
2342
2342
|
extras: e
|
|
2343
2343
|
};
|
|
2344
|
-
let U =
|
|
2344
|
+
let U = Je(JSON.stringify(I.regions)) + Je(I.visibleText) + Je(JSON.stringify(I.visibleLinks)) + Je(JSON.stringify(I.visibleFields));
|
|
2345
2345
|
for (; U > _t && I.visibleFields.length > 0; )
|
|
2346
|
-
I.visibleFields.pop(), U =
|
|
2346
|
+
I.visibleFields.pop(), U = Je(JSON.stringify(I.visibleFields));
|
|
2347
2347
|
for (; U > _t && I.visibleLinks.length > 0; )
|
|
2348
2348
|
I.visibleLinks.pop(), U -= 80;
|
|
2349
|
-
return
|
|
2349
|
+
return Je(I.visibleText) > _t && (I.visibleText = oe(I.visibleText, _t - 100)), I;
|
|
2350
2350
|
}
|
|
2351
|
-
let
|
|
2352
|
-
function
|
|
2351
|
+
let Xe = null;
|
|
2352
|
+
function yn(e, t = {}) {
|
|
2353
2353
|
const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
2354
|
-
if (
|
|
2355
|
-
return
|
|
2356
|
-
const
|
|
2357
|
-
return
|
|
2354
|
+
if (Xe && Xe.key === a && r - Xe.at < 1e3)
|
|
2355
|
+
return Xe.ctx;
|
|
2356
|
+
const i = no(e, t);
|
|
2357
|
+
return Xe = { key: a, at: r, ctx: i }, i;
|
|
2358
2358
|
}
|
|
2359
|
-
function
|
|
2360
|
-
|
|
2359
|
+
function ro() {
|
|
2360
|
+
Xe = null;
|
|
2361
2361
|
}
|
|
2362
|
-
const
|
|
2363
|
-
function
|
|
2362
|
+
const oo = 200;
|
|
2363
|
+
function io(e) {
|
|
2364
2364
|
const t = String(e.href || "");
|
|
2365
2365
|
return {
|
|
2366
2366
|
href: t,
|
|
@@ -2370,18 +2370,18 @@ function si(e) {
|
|
|
2370
2370
|
description: e.description
|
|
2371
2371
|
};
|
|
2372
2372
|
}
|
|
2373
|
-
function
|
|
2373
|
+
function lo(e) {
|
|
2374
2374
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function ao(e) {
|
|
2377
2377
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2378
2378
|
if (!t) return [];
|
|
2379
|
-
const r = typeof window < "u" && window.location.origin || "",
|
|
2380
|
-
for (const s of
|
|
2381
|
-
if (a.length >=
|
|
2382
|
-
if (
|
|
2379
|
+
const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), a = [], i = Array.from(t.querySelectorAll("a[href]"));
|
|
2380
|
+
for (const s of i) {
|
|
2381
|
+
if (a.length >= oo) break;
|
|
2382
|
+
if (zt(s)) continue;
|
|
2383
2383
|
const l = s.getAttribute("href") || "";
|
|
2384
|
-
if (!
|
|
2384
|
+
if (!lo(l)) continue;
|
|
2385
2385
|
let c = l, p = !0;
|
|
2386
2386
|
try {
|
|
2387
2387
|
if (typeof window < "u") {
|
|
@@ -2391,26 +2391,26 @@ function di(e) {
|
|
|
2391
2391
|
} catch {
|
|
2392
2392
|
continue;
|
|
2393
2393
|
}
|
|
2394
|
-
if (
|
|
2395
|
-
|
|
2394
|
+
if (o.has(c)) continue;
|
|
2395
|
+
o.add(c);
|
|
2396
2396
|
const w = (s.textContent || "").trim().slice(0, 120);
|
|
2397
2397
|
a.push({ href: c, text: w, internal: p });
|
|
2398
2398
|
}
|
|
2399
2399
|
return a;
|
|
2400
2400
|
}
|
|
2401
|
-
let
|
|
2402
|
-
const
|
|
2403
|
-
function
|
|
2401
|
+
let Ze = null;
|
|
2402
|
+
const so = 5e3;
|
|
2403
|
+
function Rt() {
|
|
2404
2404
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2405
|
-
if (
|
|
2406
|
-
return
|
|
2407
|
-
const r =
|
|
2408
|
-
return
|
|
2405
|
+
if (Ze && Ze.pathname === t && e - Ze.at < so)
|
|
2406
|
+
return Ze.routes;
|
|
2407
|
+
const r = ao();
|
|
2408
|
+
return Ze = { at: e, pathname: t, routes: r }, r;
|
|
2409
2409
|
}
|
|
2410
|
-
function
|
|
2411
|
-
|
|
2410
|
+
function co() {
|
|
2411
|
+
Ze = null;
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function vn(e) {
|
|
2414
2414
|
if (e instanceof HTMLInputElement) {
|
|
2415
2415
|
const t = e.type;
|
|
2416
2416
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2418,53 +2418,53 @@ function bn(e) {
|
|
|
2418
2418
|
}
|
|
2419
2419
|
return !0;
|
|
2420
2420
|
}
|
|
2421
|
-
function
|
|
2421
|
+
function uo(e, t) {
|
|
2422
2422
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function fo(e, t) {
|
|
2425
2425
|
if (!t) return null;
|
|
2426
2426
|
try {
|
|
2427
|
-
const
|
|
2427
|
+
const i = e.querySelector(
|
|
2428
2428
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2429
2429
|
);
|
|
2430
|
-
if (
|
|
2430
|
+
if (i && vn(i)) return i;
|
|
2431
2431
|
} catch {
|
|
2432
2432
|
}
|
|
2433
2433
|
const r = Array.from(
|
|
2434
2434
|
e.querySelectorAll("input, textarea, select")
|
|
2435
2435
|
);
|
|
2436
|
-
let
|
|
2436
|
+
let o = 0;
|
|
2437
2437
|
const a = /* @__PURE__ */ new Map();
|
|
2438
|
-
for (const
|
|
2439
|
-
if (!
|
|
2440
|
-
const s =
|
|
2438
|
+
for (const i of r) {
|
|
2439
|
+
if (!vn(i)) continue;
|
|
2440
|
+
const s = uo(i, o);
|
|
2441
2441
|
let l = s;
|
|
2442
|
-
if (a.has(s) && (l = `${s}__${
|
|
2443
|
-
a.set(s,
|
|
2442
|
+
if (a.has(s) && (l = `${s}__${o}`), l === t) return i;
|
|
2443
|
+
a.set(s, i), o++;
|
|
2444
2444
|
}
|
|
2445
2445
|
return null;
|
|
2446
2446
|
}
|
|
2447
|
-
function
|
|
2448
|
-
const r =
|
|
2449
|
-
return r ?
|
|
2447
|
+
function bn(e, t) {
|
|
2448
|
+
const r = fo(e, t);
|
|
2449
|
+
return r ? Dt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2450
2450
|
}
|
|
2451
|
-
function
|
|
2452
|
-
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype,
|
|
2451
|
+
function po(e, t) {
|
|
2452
|
+
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), a = o == null ? void 0 : o.set;
|
|
2453
2453
|
a ? a.call(e, t) : e.value = t;
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2456
|
-
const
|
|
2455
|
+
function ho(e, t, r = {}) {
|
|
2456
|
+
const o = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
|
|
2457
2457
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2458
|
-
const
|
|
2458
|
+
const i = Object.getOwnPropertyDescriptor(
|
|
2459
2459
|
HTMLInputElement.prototype,
|
|
2460
2460
|
"checked"
|
|
2461
|
-
), s =
|
|
2462
|
-
s ? s.call(e, l) : e.checked = l,
|
|
2461
|
+
), s = i == null ? void 0 : i.set, l = t === "true" || t === "1" || t === "on";
|
|
2462
|
+
s ? s.call(e, l) : e.checked = l, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2463
2463
|
return;
|
|
2464
2464
|
}
|
|
2465
|
-
|
|
2465
|
+
po(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2466
2466
|
}
|
|
2467
|
-
function
|
|
2467
|
+
function wn(e, t) {
|
|
2468
2468
|
if (!t) return null;
|
|
2469
2469
|
const r = t.replace(/"/g, '\\"');
|
|
2470
2470
|
try {
|
|
@@ -2474,23 +2474,23 @@ function _n(e, t) {
|
|
|
2474
2474
|
if (s) return s;
|
|
2475
2475
|
} catch {
|
|
2476
2476
|
}
|
|
2477
|
-
const
|
|
2477
|
+
const o = e.querySelector(
|
|
2478
2478
|
`form[name="${r}"]`
|
|
2479
2479
|
);
|
|
2480
|
-
if (
|
|
2480
|
+
if (o) return o;
|
|
2481
2481
|
const a = e.querySelector(
|
|
2482
2482
|
`form[data-ll-intent="${r}"]`
|
|
2483
2483
|
);
|
|
2484
2484
|
if (a) return a;
|
|
2485
|
-
const
|
|
2486
|
-
for (const s of
|
|
2485
|
+
const i = Array.from(e.querySelectorAll("form"));
|
|
2486
|
+
for (const s of i) {
|
|
2487
2487
|
const l = s.getAttribute("data-ll-intent");
|
|
2488
|
-
if (l &&
|
|
2488
|
+
if (l && mo(l) === t) return s;
|
|
2489
2489
|
}
|
|
2490
2490
|
if (/^form_\d+$/.test(t)) {
|
|
2491
2491
|
const s = parseInt(t.slice(5), 10);
|
|
2492
2492
|
let l = 0;
|
|
2493
|
-
for (const c of
|
|
2493
|
+
for (const c of i)
|
|
2494
2494
|
if (!(c.id || c.getAttribute("name") || c.getAttribute("data-ll-intent"))) {
|
|
2495
2495
|
if (l === s) return c;
|
|
2496
2496
|
l++;
|
|
@@ -2498,10 +2498,10 @@ function _n(e, t) {
|
|
|
2498
2498
|
}
|
|
2499
2499
|
return null;
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function mo(e) {
|
|
2502
2502
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function go() {
|
|
2505
2505
|
if (typeof window > "u" || typeof document > "u")
|
|
2506
2506
|
return !1;
|
|
2507
2507
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2509,44 +2509,44 @@ function vi() {
|
|
|
2509
2509
|
const t = window.getComputedStyle(e);
|
|
2510
2510
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2511
2511
|
}
|
|
2512
|
-
function
|
|
2512
|
+
function yo(e) {
|
|
2513
2513
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2514
2514
|
const r = window.getComputedStyle(e).overflowY;
|
|
2515
2515
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2516
2516
|
}
|
|
2517
|
-
function
|
|
2517
|
+
function vo() {
|
|
2518
2518
|
if (typeof document > "u") return null;
|
|
2519
2519
|
const e = Array.from(
|
|
2520
2520
|
document.querySelectorAll("body, body *")
|
|
2521
2521
|
);
|
|
2522
2522
|
let t = null, r = 0;
|
|
2523
|
-
for (const
|
|
2524
|
-
if (!
|
|
2525
|
-
const a =
|
|
2526
|
-
if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 ||
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2523
|
+
for (const o of e) {
|
|
2524
|
+
if (!yo(o)) continue;
|
|
2525
|
+
const a = o.getBoundingClientRect();
|
|
2526
|
+
if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || o.closest(".ll-widget")) continue;
|
|
2527
|
+
const i = a.width * a.height;
|
|
2528
|
+
i > r && (r = i, t = o);
|
|
2529
2529
|
}
|
|
2530
2530
|
return t;
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2532
|
+
function bo() {
|
|
2533
2533
|
if (typeof window > "u")
|
|
2534
2534
|
return null;
|
|
2535
|
-
if (
|
|
2536
|
-
const e =
|
|
2535
|
+
if (go()) return window;
|
|
2536
|
+
const e = vo();
|
|
2537
2537
|
return e || window;
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function _n(e) {
|
|
2540
2540
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function wo(e) {
|
|
2543
2543
|
var t, r;
|
|
2544
2544
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2545
2545
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2546
2546
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
2547
2547
|
) : e.scrollHeight - e.clientHeight;
|
|
2548
2548
|
}
|
|
2549
|
-
const
|
|
2549
|
+
const _o = /* @__PURE__ */ new Set([
|
|
2550
2550
|
"agent_state",
|
|
2551
2551
|
"avatar_stream_ready",
|
|
2552
2552
|
"avatar_active",
|
|
@@ -2576,27 +2576,28 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2576
2576
|
// to onAgentCommand.
|
|
2577
2577
|
"task_field_updated",
|
|
2578
2578
|
"task_completed"
|
|
2579
|
-
]),
|
|
2579
|
+
]), Mn = Pt(
|
|
2580
2580
|
function(t, r) {
|
|
2581
|
-
var Kt, Jt, Xt, Zt, Qt, en
|
|
2581
|
+
var Gt, Kt, Jt, Xt, Zt, Qt, en;
|
|
2582
2582
|
const {
|
|
2583
|
-
agentId:
|
|
2583
|
+
agentId: o,
|
|
2584
2584
|
apiKey: a,
|
|
2585
|
-
baseUrl:
|
|
2585
|
+
baseUrl: i = "https://app.livelayer.studio",
|
|
2586
2586
|
sessionEndpoint: s,
|
|
2587
2587
|
sessionBody: l,
|
|
2588
2588
|
soundEffects: c,
|
|
2589
2589
|
experienceMode: p = "WIDGET",
|
|
2590
2590
|
autoConnect: w = !1,
|
|
2591
2591
|
displayMode: m,
|
|
2592
|
-
//
|
|
2593
|
-
//
|
|
2594
|
-
//
|
|
2595
|
-
//
|
|
2596
|
-
//
|
|
2597
|
-
//
|
|
2598
|
-
|
|
2599
|
-
|
|
2592
|
+
// Initial display mode. Mobile gets a smaller card layout (not the
|
|
2593
|
+
// full-screen sheet) so "expanded" is the right default on every
|
|
2594
|
+
// viewport — the prior 0.15.1-0.15.3 mobile-flip-to-minimized
|
|
2595
|
+
// logic was solving the wrong problem (user actually wanted the
|
|
2596
|
+
// expanded widget but card-sized, not the bottom bar that
|
|
2597
|
+
// minimized produced). The card sizing now lives in CSS — see
|
|
2598
|
+
// .ll-expanded--mobile in styles.css.
|
|
2599
|
+
defaultDisplayMode: f = "expanded",
|
|
2600
|
+
onDisplayModeChange: R,
|
|
2600
2601
|
position: _ = "bottom-right",
|
|
2601
2602
|
mobileBreakpoint: y = 640,
|
|
2602
2603
|
persistKey: u = "ll-widget",
|
|
@@ -2614,85 +2615,72 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2614
2615
|
allowTyping: j = !0,
|
|
2615
2616
|
showMinimize: S,
|
|
2616
2617
|
showClose: Z,
|
|
2617
|
-
chromeless:
|
|
2618
|
+
chromeless: _e = !1,
|
|
2618
2619
|
floatingChromeContainer: de = null,
|
|
2619
|
-
compactControls:
|
|
2620
|
-
transforming:
|
|
2620
|
+
compactControls: He = !1,
|
|
2621
|
+
transforming: Oe = !1,
|
|
2621
2622
|
transformingLabel: X = "Transforming…",
|
|
2622
|
-
showOn:
|
|
2623
|
-
hideOn:
|
|
2623
|
+
showOn: Se,
|
|
2624
|
+
hideOn: xe,
|
|
2624
2625
|
pathname: F,
|
|
2625
|
-
onNavigate:
|
|
2626
|
+
onNavigate: ie,
|
|
2626
2627
|
onScrollToSelector: Y,
|
|
2627
|
-
getPageContext:
|
|
2628
|
+
getPageContext: fe,
|
|
2628
2629
|
pageContextExtras: K,
|
|
2629
|
-
getRoutes:
|
|
2630
|
-
onScrollPage:
|
|
2631
|
-
onClick:
|
|
2632
|
-
capabilities:
|
|
2633
|
-
onConnect:
|
|
2634
|
-
onDisconnect:
|
|
2635
|
-
onTranscript:
|
|
2636
|
-
onAgentState:
|
|
2637
|
-
onConnectionStateChange:
|
|
2638
|
-
onAgentEvent:
|
|
2639
|
-
onAgentCommand:
|
|
2640
|
-
onCollect:
|
|
2630
|
+
getRoutes: et,
|
|
2631
|
+
onScrollPage: tt,
|
|
2632
|
+
onClick: ft,
|
|
2633
|
+
capabilities: nt,
|
|
2634
|
+
onConnect: Ne,
|
|
2635
|
+
onDisconnect: Be,
|
|
2636
|
+
onTranscript: Ae,
|
|
2637
|
+
onAgentState: Fe,
|
|
2638
|
+
onConnectionStateChange: Ie,
|
|
2639
|
+
onAgentEvent: Me,
|
|
2640
|
+
onAgentCommand: Re,
|
|
2641
|
+
onCollect: Te,
|
|
2641
2642
|
controlledSession: $,
|
|
2642
2643
|
className: Lt,
|
|
2643
|
-
style:
|
|
2644
|
-
zIndex:
|
|
2645
|
-
} = t,
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
}, [
|
|
2649
|
-
const
|
|
2644
|
+
style: De,
|
|
2645
|
+
zIndex: We = 2147483647
|
|
2646
|
+
} = t, pe = vr(F), rt = Cr(pe, Se, xe);
|
|
2647
|
+
T(() => {
|
|
2648
|
+
ro(), co();
|
|
2649
|
+
}, [pe]);
|
|
2650
|
+
const Pe = A !== void 0, [qe, kt] = N(() => {
|
|
2650
2651
|
var v;
|
|
2651
2652
|
return A ?? ((v = L == null ? void 0 : L[0]) == null ? void 0 : v.id);
|
|
2652
|
-
}),
|
|
2653
|
-
() => (L == null ? void 0 : L.find((v) => v.id ===
|
|
2654
|
-
[L,
|
|
2655
|
-
),
|
|
2653
|
+
}), Ce = Pe ? A : qe, le = Qe(
|
|
2654
|
+
() => (L == null ? void 0 : L.find((v) => v.id === Ce)) ?? null,
|
|
2655
|
+
[L, Ce]
|
|
2656
|
+
), ot = (le == null ? void 0 : le.agentId) ?? o, he = p === "EMBEDDED", me = gr(y), [Ue, je] = hr({
|
|
2656
2657
|
value: m,
|
|
2657
|
-
defaultValue:
|
|
2658
|
-
onChange:
|
|
2658
|
+
defaultValue: f,
|
|
2659
|
+
onChange: R,
|
|
2659
2660
|
persistKey: u,
|
|
2660
|
-
disablePersistence:
|
|
2661
|
-
}),
|
|
2662
|
-
|
|
2663
|
-
ct.current || m !== void 0 || f !== void 0 || ue || h || En(`${u}:display-mode`) || (ce && Ce === "expanded" && Ve("minimized"), ct.current = !0);
|
|
2664
|
-
}, [
|
|
2665
|
-
ce,
|
|
2666
|
-
Ce,
|
|
2667
|
-
f,
|
|
2668
|
-
m,
|
|
2669
|
-
ue,
|
|
2670
|
-
h,
|
|
2671
|
-
u,
|
|
2672
|
-
Ve
|
|
2673
|
-
]);
|
|
2674
|
-
const fe = ue ? "expanded" : Ce, xe = ue ? () => {
|
|
2675
|
-
} : Ve, Ct = S ?? !ue, Ye = Z ?? !ue, Ee = or(), ae = ar(), me = cr(), ze = dr(), ge = ur(), [Se, Ge] = N(!1), [Ke, gt] = N(!1), [Je, g] = N(!1), [Q, Dn] = N(!1), [Et, Pn] = N(!1), yt = Ir({ baseUrl: o, config: c }), vt = M(yt);
|
|
2661
|
+
disablePersistence: he || h
|
|
2662
|
+
}), ae = he ? "expanded" : Ue, ge = he ? () => {
|
|
2663
|
+
} : je, pt = S ?? !he, ht = Z ?? !he, $e = tr(), se = rr(), ue = ir(), Ee = lr(), it = ar(), [mt, lt] = N(!1), [ye, Le] = N(!1), [Ve, Ye] = N(!1), [Ct, gt] = N(!1), [g, Q] = N(!1), yt = Sr({ baseUrl: i, config: c }), vt = M(yt);
|
|
2676
2664
|
vt.current = yt;
|
|
2677
|
-
const
|
|
2678
|
-
|
|
2679
|
-
function
|
|
2680
|
-
const d =
|
|
2665
|
+
const Et = M(ie), St = M(Y), Nt = M(tt), At = M(ft), Ht = M(fe), Ot = M(K), Bt = M(et), It = M(nt), ve = M(null);
|
|
2666
|
+
Et.current = ie, St.current = Y, Nt.current = tt, At.current = ft, Ht.current = fe, Ot.current = K, Bt.current = et, It.current = nt;
|
|
2667
|
+
function be(v) {
|
|
2668
|
+
const d = It.current;
|
|
2681
2669
|
return d ? d.includes(v) : !0;
|
|
2682
2670
|
}
|
|
2683
|
-
function
|
|
2671
|
+
function we(v, d) {
|
|
2684
2672
|
console.warn(
|
|
2685
2673
|
`[LiveLayer] Agent command "${v}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2686
2674
|
);
|
|
2687
2675
|
}
|
|
2688
|
-
const
|
|
2676
|
+
const at = E(
|
|
2689
2677
|
(v) => {
|
|
2690
|
-
var J, re,
|
|
2678
|
+
var J, re, ke, ct;
|
|
2691
2679
|
const d = v;
|
|
2692
2680
|
if (!(!d.type || typeof d.type != "string")) {
|
|
2693
|
-
if (
|
|
2694
|
-
if (!
|
|
2695
|
-
|
|
2681
|
+
if (Me == null || Me({ eventName: d.type, data: v }), d.type === "navigate") {
|
|
2682
|
+
if (!be("navigate")) {
|
|
2683
|
+
we("navigate", "navigate");
|
|
2696
2684
|
return;
|
|
2697
2685
|
}
|
|
2698
2686
|
const k = typeof d.href == "string" ? d.href : null;
|
|
@@ -2702,9 +2690,9 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2702
2690
|
);
|
|
2703
2691
|
return;
|
|
2704
2692
|
}
|
|
2705
|
-
if (vt.current.playPageChange(),
|
|
2693
|
+
if (vt.current.playPageChange(), Et.current) {
|
|
2706
2694
|
try {
|
|
2707
|
-
|
|
2695
|
+
Et.current(k);
|
|
2708
2696
|
} catch (D) {
|
|
2709
2697
|
console.warn(
|
|
2710
2698
|
`[LiveLayer] onNavigate threw for "${k}". Falling back. Error:`,
|
|
@@ -2734,16 +2722,16 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2734
2722
|
return;
|
|
2735
2723
|
}
|
|
2736
2724
|
if (d.type === "scroll_to") {
|
|
2737
|
-
if (!
|
|
2738
|
-
|
|
2725
|
+
if (!be("scroll")) {
|
|
2726
|
+
we("scroll_to", "scroll");
|
|
2739
2727
|
return;
|
|
2740
2728
|
}
|
|
2741
2729
|
const k = typeof d.selector == "string" ? d.selector : null;
|
|
2742
2730
|
if (!k) return;
|
|
2743
2731
|
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2744
|
-
if (
|
|
2732
|
+
if (St.current) {
|
|
2745
2733
|
try {
|
|
2746
|
-
|
|
2734
|
+
St.current(
|
|
2747
2735
|
k,
|
|
2748
2736
|
D
|
|
2749
2737
|
);
|
|
@@ -2776,20 +2764,20 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2776
2764
|
return;
|
|
2777
2765
|
}
|
|
2778
2766
|
if (d.type === "request_page_context") {
|
|
2779
|
-
if (!
|
|
2780
|
-
|
|
2767
|
+
if (!be("read_page")) {
|
|
2768
|
+
we("request_page_context", "read_page");
|
|
2781
2769
|
return;
|
|
2782
2770
|
}
|
|
2783
|
-
const k = typeof d.requestId == "string" ? d.requestId : void 0, D = (J =
|
|
2771
|
+
const k = typeof d.requestId == "string" ? d.requestId : void 0, D = (J = ve.current) == null ? void 0 : J.call(ve), W = (G) => {
|
|
2784
2772
|
const z = D, te = z == null ? void 0 : z.localParticipant;
|
|
2785
2773
|
if (te != null && te.publishData)
|
|
2786
2774
|
try {
|
|
2787
|
-
const
|
|
2788
|
-
te.publishData(
|
|
2789
|
-
} catch (
|
|
2790
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2775
|
+
const ce = k ? { ...G, requestId: k } : G, Ke = new TextEncoder().encode(JSON.stringify(ce));
|
|
2776
|
+
te.publishData(Ke, { reliable: !0 });
|
|
2777
|
+
} catch (ce) {
|
|
2778
|
+
console.warn("[LiveLayer] publishData failed.", ce);
|
|
2791
2779
|
}
|
|
2792
|
-
}, H =
|
|
2780
|
+
}, H = Ot.current, V = Ht.current;
|
|
2793
2781
|
try {
|
|
2794
2782
|
if (V) {
|
|
2795
2783
|
const G = V(H);
|
|
@@ -2800,7 +2788,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2800
2788
|
z
|
|
2801
2789
|
), W({
|
|
2802
2790
|
type: "page_context",
|
|
2803
|
-
context:
|
|
2791
|
+
context: yn(H)
|
|
2804
2792
|
});
|
|
2805
2793
|
});
|
|
2806
2794
|
return;
|
|
@@ -2810,7 +2798,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2810
2798
|
}
|
|
2811
2799
|
W({
|
|
2812
2800
|
type: "page_context",
|
|
2813
|
-
context:
|
|
2801
|
+
context: yn(H)
|
|
2814
2802
|
});
|
|
2815
2803
|
} catch (G) {
|
|
2816
2804
|
console.warn(
|
|
@@ -2824,8 +2812,8 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2824
2812
|
return;
|
|
2825
2813
|
}
|
|
2826
2814
|
if (d.type === "scroll_page") {
|
|
2827
|
-
if (!
|
|
2828
|
-
|
|
2815
|
+
if (!be("scroll")) {
|
|
2816
|
+
we("scroll_page", "scroll");
|
|
2829
2817
|
return;
|
|
2830
2818
|
}
|
|
2831
2819
|
const k = d.direction;
|
|
@@ -2836,9 +2824,9 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2836
2824
|
return;
|
|
2837
2825
|
}
|
|
2838
2826
|
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2839
|
-
if (
|
|
2827
|
+
if (Nt.current) {
|
|
2840
2828
|
try {
|
|
2841
|
-
|
|
2829
|
+
Nt.current(
|
|
2842
2830
|
k,
|
|
2843
2831
|
D
|
|
2844
2832
|
);
|
|
@@ -2848,17 +2836,17 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2848
2836
|
return;
|
|
2849
2837
|
}
|
|
2850
2838
|
if (typeof window > "u") return;
|
|
2851
|
-
const W = { behavior: D }, H =
|
|
2839
|
+
const W = { behavior: D }, H = bo(), V = (z) => {
|
|
2852
2840
|
H instanceof Window ? H.scrollBy({ top: z, ...W }) : H.scrollBy({ top: z, ...W });
|
|
2853
2841
|
}, G = (z) => {
|
|
2854
2842
|
H instanceof Window ? H.scrollTo({ top: z, ...W }) : H.scrollTo({ top: z, ...W });
|
|
2855
2843
|
};
|
|
2856
|
-
k === "up" ? V(-
|
|
2844
|
+
k === "up" ? V(-_n(H)) : k === "down" ? V(_n(H)) : G(k === "top" ? 0 : wo(H));
|
|
2857
2845
|
return;
|
|
2858
2846
|
}
|
|
2859
2847
|
if (d.type === "click") {
|
|
2860
|
-
if (!
|
|
2861
|
-
|
|
2848
|
+
if (!be("click")) {
|
|
2849
|
+
we("click", "click");
|
|
2862
2850
|
return;
|
|
2863
2851
|
}
|
|
2864
2852
|
const k = typeof d.selector == "string" ? d.selector : null;
|
|
@@ -2866,9 +2854,9 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2866
2854
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2867
2855
|
return;
|
|
2868
2856
|
}
|
|
2869
|
-
if (
|
|
2857
|
+
if (At.current) {
|
|
2870
2858
|
try {
|
|
2871
|
-
|
|
2859
|
+
At.current(k);
|
|
2872
2860
|
} catch (W) {
|
|
2873
2861
|
console.warn("[LiveLayer] onClick threw.", W);
|
|
2874
2862
|
}
|
|
@@ -2900,8 +2888,8 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2900
2888
|
return;
|
|
2901
2889
|
}
|
|
2902
2890
|
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
2903
|
-
if (!
|
|
2904
|
-
|
|
2891
|
+
if (!be("fill_forms")) {
|
|
2892
|
+
we(d.type, "fill_forms");
|
|
2905
2893
|
return;
|
|
2906
2894
|
}
|
|
2907
2895
|
if (typeof document > "u") return;
|
|
@@ -2911,7 +2899,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2911
2899
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
2912
2900
|
return;
|
|
2913
2901
|
}
|
|
2914
|
-
const D =
|
|
2902
|
+
const D = wn(document, k);
|
|
2915
2903
|
if (!D) {
|
|
2916
2904
|
console.warn(
|
|
2917
2905
|
`[LiveLayer] ${d.type}: no <form> matched id="${k}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
|
|
@@ -2930,7 +2918,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2930
2918
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2931
2919
|
return;
|
|
2932
2920
|
}
|
|
2933
|
-
const V =
|
|
2921
|
+
const V = bn(D, H);
|
|
2934
2922
|
if (V.el === null) {
|
|
2935
2923
|
V.reason === "private" ? console.warn(
|
|
2936
2924
|
`[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
|
|
@@ -2949,7 +2937,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2949
2937
|
}
|
|
2950
2938
|
for (const [H, V] of Object.entries(W)) {
|
|
2951
2939
|
if (typeof V != "string") continue;
|
|
2952
|
-
const G =
|
|
2940
|
+
const G = bn(D, H);
|
|
2953
2941
|
if (G.el === null) {
|
|
2954
2942
|
G.reason === "private" ? console.warn(
|
|
2955
2943
|
`[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
@@ -2959,7 +2947,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2959
2947
|
continue;
|
|
2960
2948
|
}
|
|
2961
2949
|
try {
|
|
2962
|
-
|
|
2950
|
+
ho(G.el, V);
|
|
2963
2951
|
} catch (z) {
|
|
2964
2952
|
console.warn(
|
|
2965
2953
|
`[LiveLayer] fill_form: failed to set "${H}".`,
|
|
@@ -2970,8 +2958,8 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2970
2958
|
return;
|
|
2971
2959
|
}
|
|
2972
2960
|
if (d.type === "submit_form") {
|
|
2973
|
-
if (!
|
|
2974
|
-
|
|
2961
|
+
if (!be("submit_forms")) {
|
|
2962
|
+
we("submit_form", "submit_forms");
|
|
2975
2963
|
return;
|
|
2976
2964
|
}
|
|
2977
2965
|
if (typeof document > "u") return;
|
|
@@ -2981,7 +2969,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2981
2969
|
return;
|
|
2982
2970
|
}
|
|
2983
2971
|
vt.current.playConfirmation();
|
|
2984
|
-
const D =
|
|
2972
|
+
const D = wn(document, k);
|
|
2985
2973
|
if (!D) {
|
|
2986
2974
|
console.warn(
|
|
2987
2975
|
`[LiveLayer] submit_form: no <form> matched id="${k}" (or matching name / data-ll-intent slug).`
|
|
@@ -2994,12 +2982,12 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
2994
2982
|
);
|
|
2995
2983
|
return;
|
|
2996
2984
|
}
|
|
2997
|
-
const W = typeof d.requestId == "string" ? d.requestId : void 0, H = (
|
|
2998
|
-
const
|
|
2999
|
-
if (
|
|
2985
|
+
const W = typeof d.requestId == "string" ? d.requestId : void 0, H = (ke = ve.current) == null ? void 0 : ke.call(ve), V = (te) => {
|
|
2986
|
+
const ce = H, Ke = ce == null ? void 0 : ce.localParticipant;
|
|
2987
|
+
if (Ke != null && Ke.publishData)
|
|
3000
2988
|
try {
|
|
3001
|
-
const
|
|
3002
|
-
|
|
2989
|
+
const Un = W ? { ...te, requestId: W } : te, jn = new TextEncoder().encode(JSON.stringify(Un));
|
|
2990
|
+
Ke.publishData(jn, { reliable: !0 });
|
|
3003
2991
|
} catch {
|
|
3004
2992
|
}
|
|
3005
2993
|
};
|
|
@@ -3028,53 +3016,53 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3028
3016
|
return;
|
|
3029
3017
|
}
|
|
3030
3018
|
if (d.type === "request_routes") {
|
|
3031
|
-
if (!
|
|
3032
|
-
|
|
3019
|
+
if (!be("read_page")) {
|
|
3020
|
+
we("request_routes", "read_page");
|
|
3033
3021
|
return;
|
|
3034
3022
|
}
|
|
3035
|
-
const k = typeof d.requestId == "string" ? d.requestId : void 0, W = (
|
|
3023
|
+
const k = typeof d.requestId == "string" ? d.requestId : void 0, W = (ct = ve.current) == null ? void 0 : ct.call(ve), H = W == null ? void 0 : W.localParticipant;
|
|
3036
3024
|
if (!(H != null && H.publishData)) return;
|
|
3037
3025
|
const V = (z) => {
|
|
3038
3026
|
try {
|
|
3039
|
-
const te = k ? { type: "routes", routes: z, requestId: k } : { type: "routes", routes: z },
|
|
3040
|
-
H.publishData(
|
|
3027
|
+
const te = k ? { type: "routes", routes: z, requestId: k } : { type: "routes", routes: z }, ce = new TextEncoder().encode(JSON.stringify(te));
|
|
3028
|
+
H.publishData(ce, { reliable: !0 });
|
|
3041
3029
|
} catch (te) {
|
|
3042
3030
|
console.warn("[LiveLayer] request_routes: publishData failed.", te);
|
|
3043
3031
|
}
|
|
3044
|
-
}, G =
|
|
3032
|
+
}, G = Bt.current;
|
|
3045
3033
|
if (G) {
|
|
3046
3034
|
try {
|
|
3047
|
-
const z = G(), te = (
|
|
3048
|
-
if (!Array.isArray(
|
|
3035
|
+
const z = G(), te = (ce) => {
|
|
3036
|
+
if (!Array.isArray(ce)) {
|
|
3049
3037
|
V([]);
|
|
3050
3038
|
return;
|
|
3051
3039
|
}
|
|
3052
|
-
V(
|
|
3040
|
+
V(ce.map(io).slice(0, 200));
|
|
3053
3041
|
};
|
|
3054
|
-
z instanceof Promise ? z.then(te).catch((
|
|
3042
|
+
z instanceof Promise ? z.then(te).catch((ce) => {
|
|
3055
3043
|
console.warn(
|
|
3056
3044
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3057
|
-
|
|
3058
|
-
), V(
|
|
3045
|
+
ce
|
|
3046
|
+
), V(Rt());
|
|
3059
3047
|
}) : te(z);
|
|
3060
3048
|
} catch (z) {
|
|
3061
3049
|
console.warn(
|
|
3062
3050
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3063
3051
|
z
|
|
3064
|
-
), V(
|
|
3052
|
+
), V(Rt());
|
|
3065
3053
|
}
|
|
3066
3054
|
return;
|
|
3067
3055
|
}
|
|
3068
3056
|
try {
|
|
3069
|
-
V(
|
|
3057
|
+
V(Rt());
|
|
3070
3058
|
} catch (z) {
|
|
3071
3059
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
|
|
3072
3060
|
}
|
|
3073
3061
|
return;
|
|
3074
3062
|
}
|
|
3075
3063
|
if (d.type === "task_field_updated") {
|
|
3076
|
-
if (!
|
|
3077
|
-
|
|
3064
|
+
if (!be("collect_data")) {
|
|
3065
|
+
we("task_field_updated", "collect_data");
|
|
3078
3066
|
return;
|
|
3079
3067
|
}
|
|
3080
3068
|
const k = {
|
|
@@ -3097,8 +3085,8 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3097
3085
|
return;
|
|
3098
3086
|
}
|
|
3099
3087
|
if (d.type === "task_completed") {
|
|
3100
|
-
if (!
|
|
3101
|
-
|
|
3088
|
+
if (!be("collect_data")) {
|
|
3089
|
+
we("task_completed", "collect_data");
|
|
3102
3090
|
return;
|
|
3103
3091
|
}
|
|
3104
3092
|
const k = d.result;
|
|
@@ -3118,7 +3106,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3118
3106
|
} catch {
|
|
3119
3107
|
}
|
|
3120
3108
|
try {
|
|
3121
|
-
|
|
3109
|
+
Te == null || Te(
|
|
3122
3110
|
k
|
|
3123
3111
|
);
|
|
3124
3112
|
} catch (D) {
|
|
@@ -3126,40 +3114,40 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3126
3114
|
}
|
|
3127
3115
|
return;
|
|
3128
3116
|
}
|
|
3129
|
-
|
|
3117
|
+
_o.has(d.type) || Re == null || Re(d);
|
|
3130
3118
|
}
|
|
3131
3119
|
},
|
|
3132
|
-
[
|
|
3133
|
-
), ee =
|
|
3134
|
-
agentId: $ ? "__controlled__" :
|
|
3135
|
-
baseUrl:
|
|
3120
|
+
[Re, Me, Te]
|
|
3121
|
+
), ee = er({
|
|
3122
|
+
agentId: $ ? "__controlled__" : ot,
|
|
3123
|
+
baseUrl: i,
|
|
3136
3124
|
apiKey: a,
|
|
3137
3125
|
sessionEndpoint: s,
|
|
3138
3126
|
sessionBody: l,
|
|
3139
|
-
onDataMessage: $ ? void 0 :
|
|
3127
|
+
onDataMessage: $ ? void 0 : at
|
|
3140
3128
|
});
|
|
3141
|
-
|
|
3129
|
+
T(() => {
|
|
3142
3130
|
if ($ != null && $.subscribeToDataMessages)
|
|
3143
|
-
return $.subscribeToDataMessages(
|
|
3144
|
-
}, [$,
|
|
3131
|
+
return $.subscribeToDataMessages(at);
|
|
3132
|
+
}, [$, at]), ve.current = () => {
|
|
3145
3133
|
var v;
|
|
3146
3134
|
return (v = ee.getRoom) == null ? void 0 : v.call(ee);
|
|
3147
|
-
},
|
|
3135
|
+
}, T(() => {
|
|
3148
3136
|
var J;
|
|
3149
3137
|
if (typeof window > "u") return;
|
|
3150
3138
|
const v = ((J = window.location) == null ? void 0 : J.hostname) || "";
|
|
3151
3139
|
if (v === "localhost" || v === "127.0.0.1" || v === "0.0.0.0" || v.endsWith(".local") || v.endsWith(".test"))
|
|
3152
3140
|
return window.__livelayerSimulateCommand = (re) => {
|
|
3153
3141
|
try {
|
|
3154
|
-
|
|
3155
|
-
} catch (
|
|
3156
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
3142
|
+
at(re);
|
|
3143
|
+
} catch (ke) {
|
|
3144
|
+
console.warn("[LiveLayer] simulate-command threw:", ke);
|
|
3157
3145
|
}
|
|
3158
3146
|
}, () => {
|
|
3159
3147
|
delete window.__livelayerSimulateCommand;
|
|
3160
3148
|
};
|
|
3161
|
-
}, [
|
|
3162
|
-
const C =
|
|
3149
|
+
}, [at]);
|
|
3150
|
+
const C = Qe(() => $ ? {
|
|
3163
3151
|
connectionState: $.connectionState,
|
|
3164
3152
|
agentState: $.agentState,
|
|
3165
3153
|
transcript: $.transcript,
|
|
@@ -3190,15 +3178,15 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3190
3178
|
disconnect: ee.disconnect,
|
|
3191
3179
|
getRoom: ee.getRoom,
|
|
3192
3180
|
isControlled: !1
|
|
3193
|
-
}, [$, ee]),
|
|
3194
|
-
|
|
3195
|
-
const
|
|
3196
|
-
|
|
3181
|
+
}, [$, ee]), Ft = M(C);
|
|
3182
|
+
Ft.current = C;
|
|
3183
|
+
const Wt = M($);
|
|
3184
|
+
Wt.current = $, Yn(
|
|
3197
3185
|
r,
|
|
3198
3186
|
() => ({
|
|
3199
3187
|
sendData: async (v) => {
|
|
3200
|
-
var
|
|
3201
|
-
const d =
|
|
3188
|
+
var ke, ct;
|
|
3189
|
+
const d = Wt.current;
|
|
3202
3190
|
if (d != null && d.publishData) {
|
|
3203
3191
|
try {
|
|
3204
3192
|
await d.publishData(v);
|
|
@@ -3207,7 +3195,7 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3207
3195
|
}
|
|
3208
3196
|
return;
|
|
3209
3197
|
}
|
|
3210
|
-
const J = (
|
|
3198
|
+
const J = (ct = (ke = Ft.current) == null ? void 0 : ke.getRoom) == null ? void 0 : ct.call(ke), re = J == null ? void 0 : J.localParticipant;
|
|
3211
3199
|
if (re != null && re.publishData)
|
|
3212
3200
|
try {
|
|
3213
3201
|
const k = new TextEncoder().encode(JSON.stringify(v));
|
|
@@ -3219,48 +3207,48 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3219
3207
|
}),
|
|
3220
3208
|
[]
|
|
3221
3209
|
);
|
|
3222
|
-
const
|
|
3223
|
-
|
|
3224
|
-
const v = C.videoElement, d =
|
|
3210
|
+
const qt = M(null);
|
|
3211
|
+
T(() => {
|
|
3212
|
+
const v = C.videoElement, d = qt.current;
|
|
3225
3213
|
if (!(!v || !d))
|
|
3226
3214
|
return d.appendChild(v), () => {
|
|
3227
3215
|
v.parentNode === d && d.removeChild(v);
|
|
3228
3216
|
};
|
|
3229
|
-
}, [C.videoElement]),
|
|
3217
|
+
}, [C.videoElement]), T(() => {
|
|
3230
3218
|
const v = C.audioElement;
|
|
3231
3219
|
if (!v) return;
|
|
3232
3220
|
const d = document.createElement("div");
|
|
3233
|
-
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d),
|
|
3221
|
+
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d), $e.attach(v);
|
|
3234
3222
|
const J = v.play();
|
|
3235
3223
|
return J && typeof J.catch == "function" && J.catch((re) => {
|
|
3236
|
-
(re == null ? void 0 : re.name) === "NotAllowedError" &&
|
|
3224
|
+
(re == null ? void 0 : re.name) === "NotAllowedError" && lt(!0);
|
|
3237
3225
|
}), () => {
|
|
3238
|
-
|
|
3226
|
+
$e.detach(), v.parentNode === d && d.removeChild(v), d.parentNode === document.body && document.body.removeChild(d);
|
|
3239
3227
|
};
|
|
3240
|
-
}, [C.audioElement]),
|
|
3228
|
+
}, [C.audioElement]), T(() => {
|
|
3241
3229
|
if (C.isControlled || C.connectionState !== "connected") return;
|
|
3242
3230
|
const v = C.getRoom();
|
|
3243
3231
|
if (v)
|
|
3244
|
-
return
|
|
3245
|
-
const d =
|
|
3246
|
-
d &&
|
|
3232
|
+
return se.setupMic(v).then(() => {
|
|
3233
|
+
const d = se.getMicStream();
|
|
3234
|
+
d && $e.attachStream(d, "mic");
|
|
3247
3235
|
}).catch(() => {
|
|
3248
3236
|
}), () => {
|
|
3249
|
-
|
|
3237
|
+
$e.detachSlot("mic"), se.teardownMic();
|
|
3250
3238
|
};
|
|
3251
|
-
}, [C.isControlled, C.connectionState]),
|
|
3239
|
+
}, [C.isControlled, C.connectionState]), T(() => {
|
|
3252
3240
|
var d;
|
|
3253
3241
|
if (C.connectionState !== "connected") return;
|
|
3254
3242
|
const v = C.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : C.getRoom();
|
|
3255
3243
|
if (v)
|
|
3256
|
-
return
|
|
3257
|
-
|
|
3244
|
+
return ue.attachRoom(v), Ee.attachRoom(v), C.isControlled && se.attachRoom(v), it.refresh(), () => {
|
|
3245
|
+
ue.teardown(), Ee.teardown();
|
|
3258
3246
|
};
|
|
3259
|
-
}, [C.isControlled, C.connectionState, $]),
|
|
3247
|
+
}, [C.isControlled, C.connectionState, $]), T(() => {
|
|
3260
3248
|
const v = C.audioElement;
|
|
3261
|
-
v && (v.muted =
|
|
3262
|
-
}, [C.audioElement,
|
|
3263
|
-
const
|
|
3249
|
+
v && (v.muted = g);
|
|
3250
|
+
}, [C.audioElement, g]);
|
|
3251
|
+
const Rn = E((v) => {
|
|
3264
3252
|
const d = { type: "user_message", text: v };
|
|
3265
3253
|
if ($ != null && $.publishData) {
|
|
3266
3254
|
try {
|
|
@@ -3276,247 +3264,247 @@ const Li = /* @__PURE__ */ new Set([
|
|
|
3276
3264
|
J.localParticipant.publishData(re, { reliable: !0 });
|
|
3277
3265
|
} catch {
|
|
3278
3266
|
}
|
|
3279
|
-
}, [C, $]),
|
|
3280
|
-
|
|
3267
|
+
}, [C, $]), Tn = E(() => {
|
|
3268
|
+
Q((v) => !v);
|
|
3281
3269
|
}, []);
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
}, [C.connectionState,
|
|
3285
|
-
|
|
3286
|
-
}, [C.transcript,
|
|
3287
|
-
|
|
3288
|
-
}, [C.agentState,
|
|
3270
|
+
T(() => {
|
|
3271
|
+
Ie == null || Ie(C.connectionState), C.connectionState === "connected" ? Ne == null || Ne() : C.connectionState === "disconnected" && (Be == null || Be());
|
|
3272
|
+
}, [C.connectionState, Ne, Be, Ie]), T(() => {
|
|
3273
|
+
Ae == null || Ae(C.transcript);
|
|
3274
|
+
}, [C.transcript, Ae]), T(() => {
|
|
3275
|
+
Fe == null || Fe(C.agentState);
|
|
3276
|
+
}, [C.agentState, Fe]), T(() => {
|
|
3289
3277
|
yt.setThinking(C.agentState === "thinking");
|
|
3290
3278
|
}, [C.agentState, yt]);
|
|
3291
|
-
const
|
|
3292
|
-
|
|
3293
|
-
!w ||
|
|
3294
|
-
}, [w, C.connectionState, C,
|
|
3295
|
-
const
|
|
3279
|
+
const Ut = M(!1);
|
|
3280
|
+
T(() => {
|
|
3281
|
+
!w || Ut.current || rt && C.connectionState === "idle" && (Ut.current = !0, C.connect());
|
|
3282
|
+
}, [w, C.connectionState, C, rt]);
|
|
3283
|
+
const Dn = E(
|
|
3296
3284
|
(v) => {
|
|
3297
3285
|
const d = L == null ? void 0 : L.find((J) => J.id === v);
|
|
3298
|
-
d && (
|
|
3286
|
+
d && (Ye(!1), v !== Ce && (Le(!0), C.disconnect(), Pe || kt(v), I == null || I(d)));
|
|
3299
3287
|
},
|
|
3300
3288
|
[
|
|
3301
3289
|
L,
|
|
3302
|
-
|
|
3290
|
+
Ce,
|
|
3303
3291
|
C,
|
|
3304
|
-
|
|
3292
|
+
Pe,
|
|
3305
3293
|
I
|
|
3306
3294
|
]
|
|
3307
3295
|
);
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
}, [C.connectionState,
|
|
3311
|
-
if (!
|
|
3296
|
+
T(() => {
|
|
3297
|
+
ye && C.connectionState === "connected" && Le(!1);
|
|
3298
|
+
}, [C.connectionState, ye]), T(() => {
|
|
3299
|
+
if (!Ve) return;
|
|
3312
3300
|
const v = (d) => {
|
|
3313
|
-
d.key === "Escape" &&
|
|
3301
|
+
d.key === "Escape" && Ye(!1);
|
|
3314
3302
|
};
|
|
3315
3303
|
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
3316
|
-
}, [
|
|
3317
|
-
const
|
|
3318
|
-
|
|
3319
|
-
const bt = (le == null ? void 0 : le.name) ?? O ?? ((
|
|
3320
|
-
() =>
|
|
3321
|
-
[
|
|
3322
|
-
),
|
|
3323
|
-
C.disconnect(),
|
|
3324
|
-
}, [C,
|
|
3304
|
+
}, [Ve]);
|
|
3305
|
+
const Pn = !!P || !!(le != null && le.avatarImageUrl) || C.isControlled, st = sr(ot, i, Pn);
|
|
3306
|
+
nt === void 0 && ((Gt = st.info) != null && Gt.capabilities) && (It.current = st.info.capabilities);
|
|
3307
|
+
const bt = (le == null ? void 0 : le.name) ?? O ?? ((Kt = C.agentConfig) == null ? void 0 : Kt.name) ?? ((Jt = st.info) == null ? void 0 : Jt.name) ?? "Live Layer", Mt = (le == null ? void 0 : le.avatarImageUrl) ?? P ?? ((Xt = C.agentConfig) == null ? void 0 : Xt.avatarImageUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.avatarImageUrl) ?? null, $n = U ?? ((Qt = C.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((en = st.info) == null ? void 0 : en.idleLoopUrl) ?? null, zn = b ?? null, Hn = E(() => ge("expanded"), [ge]), On = E(
|
|
3308
|
+
() => ge("minimized"),
|
|
3309
|
+
[ge]
|
|
3310
|
+
), jt = E(() => {
|
|
3311
|
+
C.disconnect(), ge("hidden");
|
|
3312
|
+
}, [C, ge]), Bn = E(() => {
|
|
3325
3313
|
const v = C.audioElement;
|
|
3326
|
-
v && v.play().then(() =>
|
|
3314
|
+
v && v.play().then(() => lt(!1)).catch(() => {
|
|
3327
3315
|
});
|
|
3328
|
-
}, [C.audioElement]),
|
|
3329
|
-
|
|
3330
|
-
}, [C]),
|
|
3331
|
-
...
|
|
3332
|
-
...
|
|
3316
|
+
}, [C.audioElement]), Fn = E(() => {
|
|
3317
|
+
lt(!1), C.connect();
|
|
3318
|
+
}, [C]), Ge = {
|
|
3319
|
+
...De,
|
|
3320
|
+
...he ? {} : { zIndex: We }
|
|
3333
3321
|
};
|
|
3334
|
-
q.primaryColor && (
|
|
3335
|
-
const
|
|
3322
|
+
q.primaryColor && (Ge["--ll-color-primary"] = q.primaryColor), q.accentColor && (Ge["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Ge["--ll-color-bg"] = q.backgroundColor), q.textColor && (Ge["--ll-color-fg"] = q.textColor);
|
|
3323
|
+
const Wn = [
|
|
3336
3324
|
"ll-widget",
|
|
3337
|
-
`ll-widget--${
|
|
3338
|
-
`ll-widget--${
|
|
3325
|
+
`ll-widget--${ae}`,
|
|
3326
|
+
`ll-widget--${me ? "mobile" : "desktop"}`,
|
|
3339
3327
|
Lt
|
|
3340
3328
|
].filter(Boolean).join(" ");
|
|
3341
|
-
if (!
|
|
3342
|
-
const
|
|
3329
|
+
if (!rt) return null;
|
|
3330
|
+
const qn = /* @__PURE__ */ n(
|
|
3343
3331
|
"div",
|
|
3344
3332
|
{
|
|
3345
|
-
className:
|
|
3346
|
-
style:
|
|
3347
|
-
"data-display-mode":
|
|
3333
|
+
className: Wn,
|
|
3334
|
+
style: Ge,
|
|
3335
|
+
"data-display-mode": ae,
|
|
3348
3336
|
"data-position": _,
|
|
3349
3337
|
"data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
|
|
3350
|
-
children:
|
|
3351
|
-
|
|
3338
|
+
children: ae === "expanded" && /* @__PURE__ */ n(
|
|
3339
|
+
Ur,
|
|
3352
3340
|
{
|
|
3353
3341
|
position: _,
|
|
3354
|
-
isMobile:
|
|
3342
|
+
isMobile: me,
|
|
3355
3343
|
agentName: bt,
|
|
3356
|
-
avatarImageUrl:
|
|
3357
|
-
idleLoopUrl:
|
|
3358
|
-
greeting:
|
|
3344
|
+
avatarImageUrl: Mt,
|
|
3345
|
+
idleLoopUrl: $n,
|
|
3346
|
+
greeting: zn,
|
|
3359
3347
|
branding: q,
|
|
3360
3348
|
teamMembers: L,
|
|
3361
|
-
currentTeamMemberId:
|
|
3362
|
-
isSwitchingTeamMember:
|
|
3363
|
-
teamSwitcherOpen:
|
|
3364
|
-
onToggleTeamSwitcher: () =>
|
|
3365
|
-
onSelectTeamMember:
|
|
3349
|
+
currentTeamMemberId: Ce,
|
|
3350
|
+
isSwitchingTeamMember: ye,
|
|
3351
|
+
teamSwitcherOpen: Ve,
|
|
3352
|
+
onToggleTeamSwitcher: () => Ye((v) => !v),
|
|
3353
|
+
onSelectTeamMember: Dn,
|
|
3366
3354
|
connectionState: C.connectionState,
|
|
3367
3355
|
agentState: C.agentState,
|
|
3368
3356
|
transcript: C.transcript,
|
|
3369
|
-
isMuted:
|
|
3370
|
-
micDevices:
|
|
3371
|
-
activeMicId:
|
|
3372
|
-
isCameraEnabled:
|
|
3373
|
-
cameraPreviewEl:
|
|
3374
|
-
cameraDevices:
|
|
3375
|
-
activeCameraId:
|
|
3376
|
-
isScreenShareEnabled:
|
|
3377
|
-
screenPreviewEl:
|
|
3378
|
-
isSpeakerMuted:
|
|
3357
|
+
isMuted: se.isMuted,
|
|
3358
|
+
micDevices: it.mics,
|
|
3359
|
+
activeMicId: se.activeDeviceId,
|
|
3360
|
+
isCameraEnabled: ue.isEnabled,
|
|
3361
|
+
cameraPreviewEl: ue.previewEl,
|
|
3362
|
+
cameraDevices: it.cameras,
|
|
3363
|
+
activeCameraId: ue.activeDeviceId,
|
|
3364
|
+
isScreenShareEnabled: Ee.isEnabled,
|
|
3365
|
+
screenPreviewEl: Ee.previewEl,
|
|
3366
|
+
isSpeakerMuted: g,
|
|
3379
3367
|
allowCamera: ne,
|
|
3380
3368
|
allowScreenShare: B,
|
|
3381
3369
|
allowTyping: j,
|
|
3382
|
-
showMinimize:
|
|
3383
|
-
showClose:
|
|
3384
|
-
chromeless:
|
|
3385
|
-
compactControls:
|
|
3386
|
-
transforming:
|
|
3370
|
+
showMinimize: pt,
|
|
3371
|
+
showClose: ht,
|
|
3372
|
+
chromeless: _e,
|
|
3373
|
+
compactControls: He,
|
|
3374
|
+
transforming: Oe,
|
|
3387
3375
|
transformingLabel: X,
|
|
3388
|
-
languageMenuOpen:
|
|
3389
|
-
onToggleLanguageMenu: () =>
|
|
3390
|
-
needsUserGesture:
|
|
3376
|
+
languageMenuOpen: Ct,
|
|
3377
|
+
onToggleLanguageMenu: () => gt((v) => !v),
|
|
3378
|
+
needsUserGesture: mt,
|
|
3391
3379
|
canResume: C.canResume,
|
|
3392
|
-
micError:
|
|
3380
|
+
micError: se.micError,
|
|
3393
3381
|
error: C.error,
|
|
3394
|
-
avatarVideoContainerRef:
|
|
3382
|
+
avatarVideoContainerRef: qt,
|
|
3395
3383
|
agentVideoEl: C.videoElement,
|
|
3396
3384
|
onConnect: () => void C.connect(),
|
|
3397
3385
|
onDisconnect: () => C.disconnect(),
|
|
3398
|
-
onRetry:
|
|
3399
|
-
onResumeAudio:
|
|
3400
|
-
onToggleMute:
|
|
3401
|
-
onSwitchMicDevice: (v) => void
|
|
3402
|
-
onToggleCamera: () => void
|
|
3403
|
-
onSwitchCameraDevice: (v) => void
|
|
3404
|
-
onToggleScreenShare: () => void
|
|
3405
|
-
onToggleSpeaker:
|
|
3406
|
-
onSendMessage:
|
|
3407
|
-
onMinimize:
|
|
3408
|
-
onClose:
|
|
3409
|
-
onClearMicError:
|
|
3386
|
+
onRetry: Fn,
|
|
3387
|
+
onResumeAudio: Bn,
|
|
3388
|
+
onToggleMute: se.toggleMute,
|
|
3389
|
+
onSwitchMicDevice: (v) => void se.switchDevice(v),
|
|
3390
|
+
onToggleCamera: () => void ue.toggle(),
|
|
3391
|
+
onSwitchCameraDevice: (v) => void ue.switchDevice(v),
|
|
3392
|
+
onToggleScreenShare: () => void Ee.toggle(),
|
|
3393
|
+
onToggleSpeaker: Tn,
|
|
3394
|
+
onSendMessage: Rn,
|
|
3395
|
+
onMinimize: On,
|
|
3396
|
+
onClose: jt,
|
|
3397
|
+
onClearMicError: se.clearError
|
|
3410
3398
|
}
|
|
3411
3399
|
)
|
|
3412
3400
|
}
|
|
3413
|
-
),
|
|
3401
|
+
), Vt = !he && (ae === "hidden" || ae === "minimized") ? /* @__PURE__ */ x(
|
|
3414
3402
|
"div",
|
|
3415
3403
|
{
|
|
3416
3404
|
className: [
|
|
3417
3405
|
"ll-widget",
|
|
3418
3406
|
"ll-widget--floating",
|
|
3419
|
-
`ll-widget--${
|
|
3420
|
-
`ll-widget--${
|
|
3407
|
+
`ll-widget--${ae}`,
|
|
3408
|
+
`ll-widget--${me ? "mobile" : "desktop"}`
|
|
3421
3409
|
].join(" "),
|
|
3422
|
-
style:
|
|
3423
|
-
"data-display-mode":
|
|
3410
|
+
style: Ge,
|
|
3411
|
+
"data-display-mode": ae,
|
|
3424
3412
|
"data-position": _,
|
|
3425
3413
|
children: [
|
|
3426
|
-
|
|
3427
|
-
|
|
3414
|
+
ae === "hidden" && /* @__PURE__ */ n(
|
|
3415
|
+
Tr,
|
|
3428
3416
|
{
|
|
3429
3417
|
position: _,
|
|
3430
|
-
isMobile:
|
|
3418
|
+
isMobile: me,
|
|
3431
3419
|
isSpeaking: C.agentState === "speaking",
|
|
3432
|
-
onExpand: () =>
|
|
3420
|
+
onExpand: () => ge("expanded"),
|
|
3433
3421
|
label: `Open ${bt} widget`,
|
|
3434
|
-
avatarImageUrl:
|
|
3422
|
+
avatarImageUrl: Mt,
|
|
3435
3423
|
agentName: bt,
|
|
3436
3424
|
containerEl: de
|
|
3437
3425
|
}
|
|
3438
3426
|
),
|
|
3439
|
-
|
|
3440
|
-
|
|
3427
|
+
ae === "minimized" && /* @__PURE__ */ n(
|
|
3428
|
+
Pr,
|
|
3441
3429
|
{
|
|
3442
3430
|
position: _,
|
|
3443
|
-
isMobile:
|
|
3431
|
+
isMobile: me,
|
|
3444
3432
|
agentName: bt,
|
|
3445
|
-
avatarImageUrl:
|
|
3433
|
+
avatarImageUrl: Mt,
|
|
3446
3434
|
agentState: C.agentState,
|
|
3447
|
-
isMuted:
|
|
3448
|
-
audioLevel:
|
|
3449
|
-
onExpand:
|
|
3450
|
-
onToggleMute:
|
|
3451
|
-
onClose:
|
|
3435
|
+
isMuted: se.isMuted,
|
|
3436
|
+
audioLevel: $e,
|
|
3437
|
+
onExpand: Hn,
|
|
3438
|
+
onToggleMute: se.toggleMute,
|
|
3439
|
+
onClose: jt
|
|
3452
3440
|
}
|
|
3453
3441
|
)
|
|
3454
3442
|
]
|
|
3455
3443
|
}
|
|
3456
|
-
) : null,
|
|
3457
|
-
return /* @__PURE__ */ x(
|
|
3458
|
-
|
|
3459
|
-
|
|
3444
|
+
) : null, Yt = de ?? (typeof document < "u" ? document.body : null);
|
|
3445
|
+
return /* @__PURE__ */ x(ze, { children: [
|
|
3446
|
+
qn,
|
|
3447
|
+
Vt && Yt && $t(Vt, Yt)
|
|
3460
3448
|
] });
|
|
3461
3449
|
}
|
|
3462
3450
|
);
|
|
3463
|
-
|
|
3464
|
-
const
|
|
3451
|
+
Mn.displayName = "AvatarWidgetInner";
|
|
3452
|
+
const xo = Pt(
|
|
3465
3453
|
function(t, r) {
|
|
3466
|
-
return /* @__PURE__ */ n(
|
|
3454
|
+
return /* @__PURE__ */ n(Qn, { children: /* @__PURE__ */ n(Mn, { ...t, ref: r }) });
|
|
3467
3455
|
}
|
|
3468
3456
|
);
|
|
3469
|
-
|
|
3470
|
-
const
|
|
3457
|
+
xo.displayName = "AvatarWidget";
|
|
3458
|
+
const To = ({
|
|
3471
3459
|
agentId: e,
|
|
3472
3460
|
baseUrl: t,
|
|
3473
3461
|
apiKey: r,
|
|
3474
|
-
mode:
|
|
3462
|
+
mode: o,
|
|
3475
3463
|
onAgentEvent: a,
|
|
3476
|
-
className:
|
|
3464
|
+
className: i,
|
|
3477
3465
|
style: s
|
|
3478
3466
|
}) => {
|
|
3479
3467
|
const l = M(null), c = M(null), p = M(a);
|
|
3480
3468
|
p.current = a;
|
|
3481
3469
|
const w = E((m) => {
|
|
3482
|
-
var
|
|
3470
|
+
var R;
|
|
3483
3471
|
const f = m.detail;
|
|
3484
|
-
(
|
|
3472
|
+
(R = p.current) == null || R.call(p, f);
|
|
3485
3473
|
}, []);
|
|
3486
|
-
return
|
|
3474
|
+
return T(() => {
|
|
3487
3475
|
const m = l.current;
|
|
3488
3476
|
if (!m) return;
|
|
3489
3477
|
const f = document.createElement("livelayer-widget");
|
|
3490
|
-
return f.setAttribute("agent-id", e), t && f.setAttribute("base-url", t), r && f.setAttribute("api-key", r),
|
|
3478
|
+
return f.setAttribute("agent-id", e), t && f.setAttribute("base-url", t), r && f.setAttribute("api-key", r), o && f.setAttribute("mode", o), f.addEventListener("agent-event", w), m.appendChild(f), c.current = f, () => {
|
|
3491
3479
|
f.removeEventListener("agent-event", w), m.removeChild(f), c.current = null;
|
|
3492
3480
|
};
|
|
3493
|
-
}, [e]),
|
|
3494
|
-
c.current && (
|
|
3495
|
-
}, [
|
|
3496
|
-
},
|
|
3497
|
-
function({ id: t, intent: r, as:
|
|
3498
|
-
return
|
|
3499
|
-
|
|
3481
|
+
}, [e]), T(() => {
|
|
3482
|
+
c.current && (o ? c.current.setAttribute("mode", o) : c.current.removeAttribute("mode"));
|
|
3483
|
+
}, [o]), /* @__PURE__ */ n("div", { ref: l, className: i, style: s });
|
|
3484
|
+
}, Do = Pt(
|
|
3485
|
+
function({ id: t, intent: r, as: o = "div", className: a, style: i, children: s }, l) {
|
|
3486
|
+
return Gn(
|
|
3487
|
+
o,
|
|
3500
3488
|
{
|
|
3501
3489
|
ref: l,
|
|
3502
3490
|
"data-ll-region": t,
|
|
3503
3491
|
"data-ll-intent": r,
|
|
3504
3492
|
className: a,
|
|
3505
|
-
style:
|
|
3493
|
+
style: i
|
|
3506
3494
|
},
|
|
3507
3495
|
s
|
|
3508
3496
|
);
|
|
3509
3497
|
}
|
|
3510
3498
|
);
|
|
3511
|
-
function
|
|
3512
|
-
const { onFieldUpdate: t, onComplete: r, source:
|
|
3513
|
-
|
|
3514
|
-
w.current = t, m.current = r, f.current =
|
|
3515
|
-
}, [t, r,
|
|
3516
|
-
const
|
|
3517
|
-
|
|
3499
|
+
function Po(e = {}) {
|
|
3500
|
+
const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [a, i] = N({}), [s, l] = N(!1), [c, p] = N(null), w = M(t), m = M(r), f = M(o);
|
|
3501
|
+
T(() => {
|
|
3502
|
+
w.current = t, m.current = r, f.current = o;
|
|
3503
|
+
}, [t, r, o]);
|
|
3504
|
+
const R = E(() => {
|
|
3505
|
+
i({}), l(!1);
|
|
3518
3506
|
}, []);
|
|
3519
|
-
return
|
|
3507
|
+
return T(() => {
|
|
3520
3508
|
if (typeof window > "u") return;
|
|
3521
3509
|
const _ = (y) => {
|
|
3522
3510
|
var h, L;
|
|
@@ -3525,7 +3513,7 @@ function zi(e = {}) {
|
|
|
3525
3513
|
if (u.phase === "field") {
|
|
3526
3514
|
if (f.current !== "all" && u.source !== f.current)
|
|
3527
3515
|
return;
|
|
3528
|
-
l(!0),
|
|
3516
|
+
l(!0), i(
|
|
3529
3517
|
(A) => A[u.fieldName] === u.value ? A : { ...A, [u.fieldName]: u.value }
|
|
3530
3518
|
);
|
|
3531
3519
|
try {
|
|
@@ -3549,34 +3537,34 @@ function zi(e = {}) {
|
|
|
3549
3537
|
}
|
|
3550
3538
|
};
|
|
3551
3539
|
return document.addEventListener("ll-collected", _), () => document.removeEventListener("ll-collected", _);
|
|
3552
|
-
}, []), { fields: a, isCollecting: s, lastResult: c, reset:
|
|
3540
|
+
}, []), { fields: a, isCollecting: s, lastResult: c, reset: R };
|
|
3553
3541
|
}
|
|
3554
|
-
let
|
|
3555
|
-
function
|
|
3542
|
+
let xn = 1;
|
|
3543
|
+
function $o({
|
|
3556
3544
|
onMount: e,
|
|
3557
3545
|
defaultOpen: t = !1,
|
|
3558
3546
|
storageKey: r = "ll-debug-open"
|
|
3559
3547
|
}) {
|
|
3560
|
-
const [
|
|
3561
|
-
|
|
3548
|
+
const [o, a] = N(t), [i, s] = N([]), [l, c] = N(""), [p, w] = N(!1), m = M(/* @__PURE__ */ new Set()), f = M([]), R = M(p);
|
|
3549
|
+
R.current = p, T(() => {
|
|
3562
3550
|
try {
|
|
3563
3551
|
const u = localStorage.getItem(r);
|
|
3564
3552
|
u === "1" && a(!0), u === "0" && a(!1);
|
|
3565
3553
|
} catch {
|
|
3566
3554
|
}
|
|
3567
|
-
}, [r]),
|
|
3555
|
+
}, [r]), T(() => {
|
|
3568
3556
|
try {
|
|
3569
|
-
localStorage.setItem(r,
|
|
3557
|
+
localStorage.setItem(r, o ? "1" : "0");
|
|
3570
3558
|
} catch {
|
|
3571
3559
|
}
|
|
3572
|
-
}, [
|
|
3560
|
+
}, [o, r]), T(() => {
|
|
3573
3561
|
const u = (h) => {
|
|
3574
3562
|
(h.metaKey || h.ctrlKey) && h.shiftKey && h.key.toLowerCase() === "l" && (h.preventDefault(), a((L) => !L));
|
|
3575
3563
|
};
|
|
3576
3564
|
return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
|
|
3577
|
-
}, []),
|
|
3565
|
+
}, []), T(() => {
|
|
3578
3566
|
const u = setInterval(() => {
|
|
3579
|
-
if (f.current.length === 0 ||
|
|
3567
|
+
if (f.current.length === 0 || R.current) return;
|
|
3580
3568
|
const h = f.current.splice(0, f.current.length);
|
|
3581
3569
|
s(
|
|
3582
3570
|
(L) => [...h.reverse(), ...L].slice(0, 200)
|
|
@@ -3585,26 +3573,26 @@ function Hi({
|
|
|
3585
3573
|
return () => clearInterval(u);
|
|
3586
3574
|
}, []);
|
|
3587
3575
|
const _ = M(!1);
|
|
3588
|
-
if (
|
|
3576
|
+
if (T(() => {
|
|
3589
3577
|
!e || _.current || (_.current = !0, e((u) => {
|
|
3590
3578
|
f.current.push({
|
|
3591
|
-
id:
|
|
3579
|
+
id: xn++,
|
|
3592
3580
|
ts: Date.now(),
|
|
3593
3581
|
kind: "event",
|
|
3594
3582
|
type: u.eventName,
|
|
3595
3583
|
data: u.data
|
|
3596
3584
|
});
|
|
3597
3585
|
}));
|
|
3598
|
-
}, [e]),
|
|
3586
|
+
}, [e]), T(() => {
|
|
3599
3587
|
const u = console.warn, h = console.log, L = (A, I) => function(...U) {
|
|
3600
3588
|
try {
|
|
3601
3589
|
const b = typeof U[0] == "string" ? U[0] : "";
|
|
3602
3590
|
b.startsWith("[LiveLayer]") && f.current.push({
|
|
3603
|
-
id:
|
|
3591
|
+
id: xn++,
|
|
3604
3592
|
ts: Date.now(),
|
|
3605
3593
|
kind: A,
|
|
3606
3594
|
type: b.slice(0, 120),
|
|
3607
|
-
data: { args: U.slice(1).map((P) =>
|
|
3595
|
+
data: { args: U.slice(1).map((P) => ko(P)) }
|
|
3608
3596
|
});
|
|
3609
3597
|
} catch {
|
|
3610
3598
|
}
|
|
@@ -3613,7 +3601,7 @@ function Hi({
|
|
|
3613
3601
|
return console.warn = L("warn", u), console.log = L("log", h), () => {
|
|
3614
3602
|
console.warn = u, console.log = h;
|
|
3615
3603
|
};
|
|
3616
|
-
}, []), !
|
|
3604
|
+
}, []), !o)
|
|
3617
3605
|
return /* @__PURE__ */ n(
|
|
3618
3606
|
"button",
|
|
3619
3607
|
{
|
|
@@ -3640,7 +3628,7 @@ function Hi({
|
|
|
3640
3628
|
children: "🛰 LL debug"
|
|
3641
3629
|
}
|
|
3642
3630
|
);
|
|
3643
|
-
const y =
|
|
3631
|
+
const y = i.filter((u) => {
|
|
3644
3632
|
if (!l) return !0;
|
|
3645
3633
|
const h = l.toLowerCase();
|
|
3646
3634
|
return u.type.toLowerCase().includes(h) || JSON.stringify(u.data || {}).toLowerCase().includes(h);
|
|
@@ -3681,9 +3669,9 @@ function Hi({
|
|
|
3681
3669
|
children: [
|
|
3682
3670
|
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3683
3671
|
/* @__PURE__ */ x("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3684
|
-
|
|
3672
|
+
i.length,
|
|
3685
3673
|
" event",
|
|
3686
|
-
|
|
3674
|
+
i.length === 1 ? "" : "s"
|
|
3687
3675
|
] }),
|
|
3688
3676
|
/* @__PURE__ */ n("span", { style: { flex: 1 } }),
|
|
3689
3677
|
/* @__PURE__ */ n(
|
|
@@ -3691,7 +3679,7 @@ function Hi({
|
|
|
3691
3679
|
{
|
|
3692
3680
|
type: "button",
|
|
3693
3681
|
onClick: () => w((u) => !u),
|
|
3694
|
-
style:
|
|
3682
|
+
style: Tt(p ? "#f59e0b" : "transparent"),
|
|
3695
3683
|
title: "Pause / resume capture",
|
|
3696
3684
|
children: p ? "▶ resume" : "⏸ pause"
|
|
3697
3685
|
}
|
|
@@ -3703,7 +3691,7 @@ function Hi({
|
|
|
3703
3691
|
onClick: () => {
|
|
3704
3692
|
s([]), f.current = [];
|
|
3705
3693
|
},
|
|
3706
|
-
style:
|
|
3694
|
+
style: Tt("transparent"),
|
|
3707
3695
|
title: "Clear buffer",
|
|
3708
3696
|
children: "clear"
|
|
3709
3697
|
}
|
|
@@ -3713,7 +3701,7 @@ function Hi({
|
|
|
3713
3701
|
{
|
|
3714
3702
|
type: "button",
|
|
3715
3703
|
onClick: () => a(!1),
|
|
3716
|
-
style:
|
|
3704
|
+
style: Tt("transparent"),
|
|
3717
3705
|
"aria-label": "Close",
|
|
3718
3706
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
3719
3707
|
children: "✕"
|
|
@@ -3780,7 +3768,7 @@ function Hi({
|
|
|
3780
3768
|
]
|
|
3781
3769
|
}
|
|
3782
3770
|
) : y.map((u) => /* @__PURE__ */ n(
|
|
3783
|
-
|
|
3771
|
+
Lo,
|
|
3784
3772
|
{
|
|
3785
3773
|
entry: u,
|
|
3786
3774
|
expanded: m.current.has(u.id),
|
|
@@ -3796,12 +3784,12 @@ function Hi({
|
|
|
3796
3784
|
}
|
|
3797
3785
|
);
|
|
3798
3786
|
}
|
|
3799
|
-
function
|
|
3787
|
+
function Lo({
|
|
3800
3788
|
entry: e,
|
|
3801
3789
|
expanded: t,
|
|
3802
3790
|
onToggle: r
|
|
3803
3791
|
}) {
|
|
3804
|
-
const
|
|
3792
|
+
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", a = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
3805
3793
|
hour12: !1
|
|
3806
3794
|
});
|
|
3807
3795
|
return /* @__PURE__ */ x(
|
|
@@ -3838,7 +3826,7 @@ function Ci({
|
|
|
3838
3826
|
"span",
|
|
3839
3827
|
{
|
|
3840
3828
|
style: {
|
|
3841
|
-
color:
|
|
3829
|
+
color: o,
|
|
3842
3830
|
fontWeight: 600,
|
|
3843
3831
|
flexShrink: 0
|
|
3844
3832
|
},
|
|
@@ -3866,7 +3854,7 @@ function Ci({
|
|
|
3866
3854
|
}
|
|
3867
3855
|
);
|
|
3868
3856
|
}
|
|
3869
|
-
function
|
|
3857
|
+
function Tt(e) {
|
|
3870
3858
|
return {
|
|
3871
3859
|
background: e,
|
|
3872
3860
|
color: "#fff",
|
|
@@ -3877,71 +3865,71 @@ function Dt(e) {
|
|
|
3877
3865
|
cursor: "pointer"
|
|
3878
3866
|
};
|
|
3879
3867
|
}
|
|
3880
|
-
function
|
|
3868
|
+
function ko(e) {
|
|
3881
3869
|
try {
|
|
3882
3870
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3883
3871
|
} catch {
|
|
3884
3872
|
return String(e);
|
|
3885
3873
|
}
|
|
3886
3874
|
}
|
|
3887
|
-
function
|
|
3875
|
+
function Co(e) {
|
|
3888
3876
|
const t = JSON.stringify(e);
|
|
3889
|
-
|
|
3877
|
+
T(() => Jn(e), [t]);
|
|
3890
3878
|
}
|
|
3891
|
-
function
|
|
3892
|
-
return
|
|
3879
|
+
function zo({ fields: e, children: t }) {
|
|
3880
|
+
return Co(e), /* @__PURE__ */ n(ze, { children: t });
|
|
3893
3881
|
}
|
|
3894
|
-
function
|
|
3882
|
+
function Ho() {
|
|
3895
3883
|
const [e, t] = N([]), r = E((a) => {
|
|
3896
|
-
t((
|
|
3897
|
-
const s =
|
|
3884
|
+
t((i) => {
|
|
3885
|
+
const s = i.findIndex((l) => l.id === a.id);
|
|
3898
3886
|
if (s >= 0) {
|
|
3899
|
-
const l =
|
|
3887
|
+
const l = i.slice();
|
|
3900
3888
|
return l[s] = a, l;
|
|
3901
3889
|
}
|
|
3902
|
-
return [...
|
|
3890
|
+
return [...i, a];
|
|
3903
3891
|
});
|
|
3904
|
-
}, []),
|
|
3892
|
+
}, []), o = E(() => t([]), []);
|
|
3905
3893
|
return {
|
|
3906
3894
|
entries: e,
|
|
3907
3895
|
pushSegment: r,
|
|
3908
|
-
clear:
|
|
3896
|
+
clear: o,
|
|
3909
3897
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
3910
3898
|
};
|
|
3911
3899
|
}
|
|
3912
3900
|
export {
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3901
|
+
xo as AvatarWidget,
|
|
3902
|
+
Qn as ErrorBoundary,
|
|
3903
|
+
zo as FieldProvider,
|
|
3904
|
+
$o as LiveLayerDebugPanel,
|
|
3905
|
+
Do as LiveLayerRegion,
|
|
3906
|
+
To as LiveLayerWidget,
|
|
3907
|
+
Fo as clearFieldRegistry,
|
|
3908
|
+
ro as clearPageContextCache,
|
|
3909
|
+
co as clearRoutesCache,
|
|
3910
|
+
no as extractPageContext,
|
|
3911
|
+
ao as extractRoutes,
|
|
3912
|
+
yn as getCachedPageContext,
|
|
3913
|
+
Rt as getCachedRoutes,
|
|
3914
|
+
Wo as getRegisteredFields,
|
|
3915
|
+
Lr as matchesPattern,
|
|
3916
|
+
io as normalizeRouteInput,
|
|
3917
|
+
qo as registerFields,
|
|
3918
|
+
Uo as setFieldValue,
|
|
3919
|
+
kr as shouldRenderAtPath,
|
|
3920
|
+
sr as useAgentInfo,
|
|
3921
|
+
tr as useAudioLevel,
|
|
3922
|
+
ir as useCameraState,
|
|
3923
|
+
Po as useCollect,
|
|
3924
|
+
ur as useDisplayMode,
|
|
3925
|
+
hr as useDisplayModePersistence,
|
|
3926
|
+
gr as useIsMobile,
|
|
3927
|
+
er as useLiveKitSession,
|
|
3928
|
+
ar as useMediaDevices,
|
|
3929
|
+
rr as useMicrophoneState,
|
|
3930
|
+
vr as usePathname,
|
|
3931
|
+
Co as useRegisterFields,
|
|
3932
|
+
Cr as useRouteMatch,
|
|
3933
|
+
lr as useScreenShareState,
|
|
3934
|
+
Ho as useTranscript
|
|
3947
3935
|
};
|