@livelayer/react 0.23.5 → 0.24.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.d.ts +13 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +424 -421
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as S, jsx as r, Fragment as Xe } from "react/jsx-runtime";
|
|
3
|
-
import { Component as
|
|
3
|
+
import { Component as $r, useState as M, useRef as R, useEffect as T, useCallback as k, useMemo as dt, useLayoutEffect as sr, forwardRef as un, useImperativeHandle as Hr, createElement as Or } from "react";
|
|
4
4
|
import { createPortal as dn } from "react-dom";
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
5
|
+
import { LiveKitSession as Fr, registerFields as Br } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as Zo, getRegisteredFields as Qo, registerFields as el, setFieldValue as tl } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Wr, Track as cr, createLocalVideoTrack as qr } from "livekit-client";
|
|
8
|
+
class Ur extends $r {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -35,7 +35,7 @@ class qr extends zr {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function jr(e) {
|
|
39
39
|
const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [d, g] = M(null), [p, m] = M(null), [P, x] = M(!1), [L, y] = M(null), w = R(null), D = R(e.onDataMessage);
|
|
40
40
|
D.current = e.onDataMessage, T(() => {
|
|
41
41
|
const v = {
|
|
@@ -54,7 +54,7 @@ function Ur(e) {
|
|
|
54
54
|
(Z = D.current) == null || Z.call(D, B);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: x
|
|
57
|
-
}, z = new
|
|
57
|
+
}, z = new Fr(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -105,7 +105,7 @@ function Ur(e) {
|
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Vr() {
|
|
109
109
|
const e = R(null), t = R(/* @__PURE__ */ new Map()), n = R(null), i = R(/* @__PURE__ */ new Set()), l = k(() => {
|
|
110
110
|
const x = t.current;
|
|
111
111
|
if (x.size === 0) {
|
|
@@ -217,11 +217,11 @@ function jr() {
|
|
|
217
217
|
i.current.clear();
|
|
218
218
|
}, [m]), { attach: d, attachStream: g, detach: m, detachSlot: p, subscribe: P };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Yr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Gr(e = {}) {
|
|
225
225
|
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), d = R(null), g = R(null), p = R({
|
|
226
226
|
active: t,
|
|
227
227
|
lastAutoIntent: null
|
|
@@ -236,7 +236,7 @@ function Yr(e = {}) {
|
|
|
236
236
|
}
|
|
237
237
|
g.current = E, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const v = await
|
|
239
|
+
const v = await Wr({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
@@ -285,7 +285,7 @@ function Yr(e = {}) {
|
|
|
285
285
|
E.stop();
|
|
286
286
|
}
|
|
287
287
|
d.current = null, g.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
|
|
288
|
-
}, [t]), w = k(() => c(null), []), D = k(() =>
|
|
288
|
+
}, [t]), w = k(() => c(null), []), D = k(() => Yr(d.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
291
|
activeDeviceId: o,
|
|
@@ -299,15 +299,15 @@ function Yr(e = {}) {
|
|
|
299
299
|
getMicStream: D
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
302
|
+
const Xr = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
|
+
function Kr() {
|
|
304
304
|
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = R(null), d = R(null), g = k((w) => {
|
|
305
305
|
c.current = w;
|
|
306
306
|
}, []), p = k(() => {
|
|
307
307
|
var E;
|
|
308
308
|
const w = c.current, D = d.current;
|
|
309
309
|
if (D && w) {
|
|
310
|
-
const b = w.localParticipant.getTrackPublication(
|
|
310
|
+
const b = w.localParticipant.getTrackPublication(cr.Source.Camera), v = (b == null ? void 0 : b.track) ?? D;
|
|
311
311
|
try {
|
|
312
312
|
w.localParticipant.unpublishTrack(v);
|
|
313
313
|
} catch {
|
|
@@ -323,9 +323,9 @@ function Xr() {
|
|
|
323
323
|
if (D) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const E = { ...
|
|
326
|
+
const E = { ...Xr };
|
|
327
327
|
w && (E.deviceId = w);
|
|
328
|
-
const b = await
|
|
328
|
+
const b = await qr(E);
|
|
329
329
|
await D.localParticipant.publishTrack(b), d.current = b;
|
|
330
330
|
const O = b.attach();
|
|
331
331
|
o(O), t(!0), w && a(w);
|
|
@@ -362,7 +362,7 @@ function Xr() {
|
|
|
362
362
|
clearError: y
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Jr() {
|
|
366
366
|
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = R(null), a = k((m) => {
|
|
367
367
|
s.current = m;
|
|
368
368
|
}, []), c = k(() => o(null), []), d = k(async () => {
|
|
@@ -381,7 +381,7 @@ function Kr() {
|
|
|
381
381
|
await m.localParticipant.setScreenShareEnabled(!0);
|
|
382
382
|
let P = 0;
|
|
383
383
|
const x = () => {
|
|
384
|
-
const L = m.localParticipant.getTrackPublication(
|
|
384
|
+
const L = m.localParticipant.getTrackPublication(cr.Source.ScreenShare);
|
|
385
385
|
if (L != null && L.track) {
|
|
386
386
|
const y = L.track.attach();
|
|
387
387
|
o(y), t(!0);
|
|
@@ -413,7 +413,7 @@ function Kr() {
|
|
|
413
413
|
}, [e, c]), p = k(() => i(null), []);
|
|
414
414
|
return { isEnabled: e, error: n, previewEl: l, toggle: d, attachRoom: a, teardown: g, clearError: p };
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Zr() {
|
|
417
417
|
const [e, t] = M([]), [n, i] = M([]), l = k(async () => {
|
|
418
418
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
419
419
|
try {
|
|
@@ -428,7 +428,7 @@ function Jr() {
|
|
|
428
428
|
return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
|
|
429
429
|
}, [l]), { mics: e, cameras: n, refresh: l };
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Qr(e, t, n = !1) {
|
|
432
432
|
const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
|
|
433
433
|
return T(() => {
|
|
434
434
|
if (n || !e) {
|
|
@@ -451,7 +451,7 @@ function Zr(e, t, n = !1) {
|
|
|
451
451
|
}), () => d.abort();
|
|
452
452
|
}, [e, t, n]), { info: i, error: o, loading: a };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function ur(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,21 +459,21 @@ function cr(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function dr(e, t) {
|
|
463
463
|
if (!(typeof window > "u"))
|
|
464
464
|
try {
|
|
465
465
|
window.localStorage.setItem(e, t);
|
|
466
466
|
} catch {
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function ei(e) {
|
|
470
470
|
if (!(typeof window > "u"))
|
|
471
471
|
try {
|
|
472
472
|
window.localStorage.removeItem(e);
|
|
473
473
|
} catch {
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function ti({
|
|
477
477
|
value: e,
|
|
478
478
|
defaultValue: t = "expanded",
|
|
479
479
|
onChange: n
|
|
@@ -486,32 +486,32 @@ function ei({
|
|
|
486
486
|
);
|
|
487
487
|
return [s, a];
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
return e &&
|
|
489
|
+
const ni = ["hidden", "minimized", "expanded"];
|
|
490
|
+
function ri(e) {
|
|
491
|
+
return e && ni.includes(e) ? e : null;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function ii({
|
|
494
494
|
value: e,
|
|
495
495
|
defaultValue: t = "expanded",
|
|
496
496
|
onChange: n,
|
|
497
497
|
persistKey: i = "ll-widget",
|
|
498
498
|
disablePersistence: l = !1
|
|
499
499
|
} = {}) {
|
|
500
|
-
const o = `${i}:display-mode`, s = R(!1), [a, c] =
|
|
500
|
+
const o = `${i}:display-mode`, s = R(!1), [a, c] = ti({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
503
|
onChange: (d) => {
|
|
504
|
-
e === void 0 && !l &&
|
|
504
|
+
e === void 0 && !l && dr(o, d), n == null || n(d);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
return T(() => {
|
|
508
508
|
if (s.current || (s.current = !0, l || e !== void 0)) return;
|
|
509
|
-
const d =
|
|
509
|
+
const d = ri(ur(o));
|
|
510
510
|
d && d !== a && c(d);
|
|
511
511
|
}, []), [a, c];
|
|
512
512
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
513
|
+
const oi = 640;
|
|
514
|
+
function li(e = oi) {
|
|
515
515
|
const [t, n] = M(!1);
|
|
516
516
|
return T(() => {
|
|
517
517
|
if (e === !1) {
|
|
@@ -526,11 +526,11 @@ function oi(e = ii) {
|
|
|
526
526
|
});
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
529
|
+
const ai = 280, si = 380, ci = 8, ui = 4;
|
|
530
530
|
function tn(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function di(e) {
|
|
534
534
|
if (!e) return null;
|
|
535
535
|
let t;
|
|
536
536
|
try {
|
|
@@ -559,26 +559,26 @@ function rn(e, t, n, i, l) {
|
|
|
559
559
|
left: Math.max(c, Math.min(g, t))
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function fi(e) {
|
|
563
563
|
const {
|
|
564
564
|
draggable: t,
|
|
565
565
|
resizable: n,
|
|
566
566
|
persistKey: i,
|
|
567
567
|
disablePersistence: l,
|
|
568
|
-
minWidth: o =
|
|
569
|
-
minHeight: s =
|
|
570
|
-
edgeMargin: a =
|
|
568
|
+
minWidth: o = ai,
|
|
569
|
+
minHeight: s = si,
|
|
570
|
+
edgeMargin: a = ci
|
|
571
571
|
} = e, [c, d] = M(null), [g, p] = M(!1), [m, P] = M(!1), x = R(null), L = R(null), y = R(!1), w = R(null);
|
|
572
572
|
w.current = c;
|
|
573
573
|
const D = k(
|
|
574
574
|
(f) => {
|
|
575
|
-
l || (f === null ?
|
|
575
|
+
l || (f === null ? ei(tn(i)) : dr(tn(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
577
|
[l, i]
|
|
578
578
|
);
|
|
579
579
|
T(() => {
|
|
580
580
|
if (y.current || (y.current = !0, l)) return;
|
|
581
|
-
const f =
|
|
581
|
+
const f = di(ur(tn(i)));
|
|
582
582
|
if (!f) return;
|
|
583
583
|
const { vw: N, vh: $ } = Wt(), U = nn(f.width, f.height, {
|
|
584
584
|
minWidth: o,
|
|
@@ -648,7 +648,7 @@ function di(e) {
|
|
|
648
648
|
const N = x.current;
|
|
649
649
|
if (!N) return;
|
|
650
650
|
const $ = f.clientX - N.startClientX, U = f.clientY - N.startClientY;
|
|
651
|
-
if (!N.moved && Math.abs($) + Math.abs(U) >
|
|
651
|
+
if (!N.moved && Math.abs($) + Math.abs(U) > ui && (N.moved = !0, p(!0)), !N.moved) return;
|
|
652
652
|
const { vw: K, vh: re } = Wt(), W = rn(
|
|
653
653
|
N.startTop + U,
|
|
654
654
|
N.startLeft + $,
|
|
@@ -759,9 +759,9 @@ function di(e) {
|
|
|
759
759
|
reset: v
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
762
|
+
const Hn = "__llHistoryPatched", jt = "ll:pathname";
|
|
763
|
+
function pi() {
|
|
764
|
+
if (typeof window > "u" || window.history[Hn]) return;
|
|
765
765
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
766
766
|
window.history.pushState = function(...n) {
|
|
767
767
|
const i = e.apply(this, n);
|
|
@@ -769,65 +769,65 @@ function fi() {
|
|
|
769
769
|
}, window.history.replaceState = function(...n) {
|
|
770
770
|
const i = t.apply(this, n);
|
|
771
771
|
return window.dispatchEvent(new Event(jt)), i;
|
|
772
|
-
}, window.history[
|
|
772
|
+
}, window.history[Hn] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function On() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function hi(e) {
|
|
778
778
|
const [t, n] = M(
|
|
779
|
-
() => e ??
|
|
779
|
+
() => e ?? On()
|
|
780
780
|
);
|
|
781
781
|
return T(() => {
|
|
782
782
|
if (e !== void 0) return;
|
|
783
|
-
|
|
784
|
-
const i = () => n(
|
|
783
|
+
pi();
|
|
784
|
+
const i = () => n(On());
|
|
785
785
|
return i(), window.addEventListener("popstate", i), window.addEventListener(jt, i), () => {
|
|
786
786
|
window.removeEventListener("popstate", i), window.removeEventListener(jt, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
function mi(e) {
|
|
792
|
-
return e.replace(hi, "\\$&");
|
|
793
|
-
}
|
|
790
|
+
const Fn = /* @__PURE__ */ new Map(), mi = /[\\^$+?.()|{}[\]]/g;
|
|
794
791
|
function gi(e) {
|
|
795
|
-
|
|
792
|
+
return e.replace(mi, "\\$&");
|
|
793
|
+
}
|
|
794
|
+
function yi(e) {
|
|
795
|
+
const t = Fn.get(e);
|
|
796
796
|
if (t) return t;
|
|
797
|
-
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a =
|
|
798
|
-
return
|
|
797
|
+
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a = gi(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
|
|
798
|
+
return Fn.set(e, c), c;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function vi(e, t) {
|
|
801
801
|
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
802
|
-
return
|
|
802
|
+
return yi(e).test(n);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
804
|
+
function bi(e, t) {
|
|
805
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : vi(e, t);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function Bn(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
809
|
for (const n of e)
|
|
810
|
-
if (
|
|
810
|
+
if (bi(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
function bi(e, t, n) {
|
|
814
|
-
return e === void 0 ? !0 : Fn(n, e) ? !1 : t && t.length > 0 ? Fn(t, e) : !0;
|
|
815
|
-
}
|
|
816
813
|
function wi(e, t, n) {
|
|
817
|
-
return
|
|
818
|
-
|
|
814
|
+
return e === void 0 ? !0 : Bn(n, e) ? !1 : t && t.length > 0 ? Bn(t, e) : !0;
|
|
815
|
+
}
|
|
816
|
+
function _i(e, t, n) {
|
|
817
|
+
return dt(
|
|
818
|
+
() => wi(e, t, n),
|
|
819
819
|
[e, t, n]
|
|
820
820
|
);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function xi(e) {
|
|
823
823
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
824
824
|
navigate: e.navigate !== !1,
|
|
825
825
|
thinking: e.thinking !== !1,
|
|
826
826
|
action: e.action !== !1
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
const t =
|
|
829
|
+
function Ci(e) {
|
|
830
|
+
const t = dt(() => xi(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = R(null), l = k(
|
|
831
831
|
(c) => {
|
|
832
832
|
try {
|
|
833
833
|
new Audio(`${n}${c}`).play().catch(() => {
|
|
@@ -879,12 +879,12 @@ function xi(e) {
|
|
|
879
879
|
}
|
|
880
880
|
i.current = null;
|
|
881
881
|
}
|
|
882
|
-
}, []),
|
|
882
|
+
}, []), dt(
|
|
883
883
|
() => ({ playPageChange: o, playConfirmation: s, setThinking: a }),
|
|
884
884
|
[o, s, a]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const Wn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -930,7 +930,7 @@ const Bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
}
|
|
933
|
-
),
|
|
933
|
+
), qn = ({ className: e }) => /* @__PURE__ */ r(
|
|
934
934
|
"svg",
|
|
935
935
|
{
|
|
936
936
|
className: e,
|
|
@@ -948,7 +948,7 @@ const Bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
948
948
|
}
|
|
949
949
|
)
|
|
950
950
|
}
|
|
951
|
-
),
|
|
951
|
+
), ki = ({ className: e }) => /* @__PURE__ */ r(
|
|
952
952
|
"svg",
|
|
953
953
|
{
|
|
954
954
|
className: e,
|
|
@@ -959,12 +959,12 @@ const Bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
959
959
|
"aria-hidden": "true",
|
|
960
960
|
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
961
961
|
}
|
|
962
|
-
),
|
|
962
|
+
), Li = {
|
|
963
963
|
left: 180,
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, Un = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
|
|
968
968
|
"svg",
|
|
969
969
|
{
|
|
970
970
|
className: t,
|
|
@@ -972,19 +972,19 @@ const Bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
972
972
|
viewBox: "0 0 24 24",
|
|
973
973
|
stroke: "currentColor",
|
|
974
974
|
strokeWidth: 2,
|
|
975
|
-
style: { transform: `rotate(${
|
|
975
|
+
style: { transform: `rotate(${Li[e]}deg)` },
|
|
976
976
|
"aria-hidden": "true",
|
|
977
977
|
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
978
978
|
}
|
|
979
979
|
);
|
|
980
|
-
function
|
|
980
|
+
function Si(e) {
|
|
981
981
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
function
|
|
983
|
+
const fr = "ll-hidden-tab-center-y", Ei = 5, jn = 16;
|
|
984
|
+
function Ai() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(fr);
|
|
988
988
|
if (!e) return null;
|
|
989
989
|
const t = Number.parseFloat(e);
|
|
990
990
|
return Number.isFinite(t) ? t : null;
|
|
@@ -992,14 +992,14 @@ function Ei() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Vn(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(fr, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const Ni = ({
|
|
1003
1003
|
position: e,
|
|
1004
1004
|
isMobile: t,
|
|
1005
1005
|
isSpeaking: n,
|
|
@@ -1009,10 +1009,10 @@ const Ai = ({
|
|
|
1009
1009
|
agentName: s,
|
|
1010
1010
|
containerEl: a
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const c =
|
|
1012
|
+
const c = Si(e), d = c === "right" ? "left" : "right", g = t ? 80 : 72, p = !!o, m = !!a, [P, x] = M(null), [L, y] = M(!1), w = R(null), D = R(!1), E = k(
|
|
1013
1013
|
(H) => {
|
|
1014
1014
|
if (typeof window > "u") return H;
|
|
1015
|
-
const X = g / 2, f =
|
|
1015
|
+
const X = g / 2, f = jn + X, N = window.innerHeight - jn - X;
|
|
1016
1016
|
return N < f ? Math.max(f, H) : Math.max(f, Math.min(N, H));
|
|
1017
1017
|
},
|
|
1018
1018
|
[g]
|
|
@@ -1022,7 +1022,7 @@ const Ai = ({
|
|
|
1022
1022
|
x(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
const H =
|
|
1025
|
+
const H = Ai();
|
|
1026
1026
|
x(E(H ?? window.innerHeight / 2));
|
|
1027
1027
|
const X = () => {
|
|
1028
1028
|
x((f) => f === null ? null : E(f));
|
|
@@ -1049,7 +1049,7 @@ const Ai = ({
|
|
|
1049
1049
|
const X = w.current;
|
|
1050
1050
|
if (!X) return;
|
|
1051
1051
|
const f = H.clientY - X.startClientY;
|
|
1052
|
-
!X.moved && Math.abs(f) >
|
|
1052
|
+
!X.moved && Math.abs(f) > Ei && (X.moved = !0, y(!0)), X.moved && x(E(X.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
1054
|
[E]
|
|
1055
1055
|
), v = k(
|
|
@@ -1060,7 +1060,7 @@ const Ai = ({
|
|
|
1060
1060
|
H.currentTarget.releasePointerCapture(H.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null, X.moved && (y(!1), D.current = !0, x((f) => (f !== null &&
|
|
1063
|
+
w.current = null, X.moved && (y(!1), D.current = !0, x((f) => (f !== null && Vn(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
@@ -1078,7 +1078,7 @@ const Ai = ({
|
|
|
1078
1078
|
x((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
1080
|
const N = E(f + X);
|
|
1081
|
-
return
|
|
1081
|
+
return Vn(N), N;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
@@ -1113,7 +1113,7 @@ const Ai = ({
|
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
1114
|
/* @__PURE__ */ S(Xe, { children: [
|
|
1115
1115
|
/* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
Un,
|
|
1117
1117
|
{
|
|
1118
1118
|
direction: d,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -1130,7 +1130,7 @@ const Ai = ({
|
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
1132
|
) : /* @__PURE__ */ r(
|
|
1133
|
-
|
|
1133
|
+
Un,
|
|
1134
1134
|
{
|
|
1135
1135
|
direction: d,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
@@ -1138,7 +1138,7 @@ const Ai = ({
|
|
|
1138
1138
|
)
|
|
1139
1139
|
}
|
|
1140
1140
|
);
|
|
1141
|
-
},
|
|
1141
|
+
}, Mi = ({
|
|
1142
1142
|
audioLevel: e,
|
|
1143
1143
|
bars: t = 20,
|
|
1144
1144
|
maxHeight: n = 20,
|
|
@@ -1146,7 +1146,7 @@ const Ai = ({
|
|
|
1146
1146
|
className: l,
|
|
1147
1147
|
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const s = R(null), a = R([]), c =
|
|
1149
|
+
const s = R(null), a = R([]), c = dt(() => {
|
|
1150
1150
|
const g = (Math.sqrt(5) - 1) / 2;
|
|
1151
1151
|
return Array.from({ length: t }, (p, m) => 0.5 + m * g % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
@@ -1170,7 +1170,7 @@ const Ai = ({
|
|
|
1170
1170
|
},
|
|
1171
1171
|
p
|
|
1172
1172
|
)) });
|
|
1173
|
-
},
|
|
1173
|
+
}, Ii = ({
|
|
1174
1174
|
position: e,
|
|
1175
1175
|
isMobile: t,
|
|
1176
1176
|
agentName: n,
|
|
@@ -1207,7 +1207,7 @@ const Ai = ({
|
|
|
1207
1207
|
)
|
|
1208
1208
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1209
1209
|
/* @__PURE__ */ r(
|
|
1210
|
-
|
|
1210
|
+
Mi,
|
|
1211
1211
|
{
|
|
1212
1212
|
audioLevel: s,
|
|
1213
1213
|
bars: 16,
|
|
@@ -1230,10 +1230,10 @@ const Ai = ({
|
|
|
1230
1230
|
(g.key === "Enter" || g.key === " ") && (g.stopPropagation(), g.preventDefault(), c());
|
|
1231
1231
|
},
|
|
1232
1232
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1233
|
-
children: /* @__PURE__ */ r(
|
|
1233
|
+
children: /* @__PURE__ */ r(Wn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
/* @__PURE__ */ r(
|
|
1236
|
+
/* @__PURE__ */ r(qn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
1237
1237
|
] })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
@@ -1270,7 +1270,7 @@ const Ai = ({
|
|
|
1270
1270
|
className: "ll-minimized__btn",
|
|
1271
1271
|
onClick: c,
|
|
1272
1272
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1273
|
-
children: /* @__PURE__ */ r(
|
|
1273
|
+
children: /* @__PURE__ */ r(Wn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ r(
|
|
@@ -1280,7 +1280,7 @@ const Ai = ({
|
|
|
1280
1280
|
className: "ll-minimized__btn",
|
|
1281
1281
|
onClick: a,
|
|
1282
1282
|
"aria-label": `Expand ${n} widget`,
|
|
1283
|
-
children: /* @__PURE__ */ r(
|
|
1283
|
+
children: /* @__PURE__ */ r(qn, { className: "ll-minimized__icon" })
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ r(
|
|
@@ -1290,13 +1290,13 @@ const Ai = ({
|
|
|
1290
1290
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1291
1291
|
onClick: d,
|
|
1292
1292
|
"aria-label": "Close widget",
|
|
1293
|
-
children: /* @__PURE__ */ r(
|
|
1293
|
+
children: /* @__PURE__ */ r(ki, { className: "ll-minimized__icon" })
|
|
1294
1294
|
}
|
|
1295
1295
|
)
|
|
1296
1296
|
] })
|
|
1297
1297
|
] })
|
|
1298
1298
|
}
|
|
1299
|
-
),
|
|
1299
|
+
), Ti = ({
|
|
1300
1300
|
src: e,
|
|
1301
1301
|
alt: t,
|
|
1302
1302
|
preCannedPlaying: n = !1,
|
|
@@ -1334,11 +1334,11 @@ const Ai = ({
|
|
|
1334
1334
|
}
|
|
1335
1335
|
)
|
|
1336
1336
|
);
|
|
1337
|
-
},
|
|
1338
|
-
function
|
|
1337
|
+
}, Ri = "#E06540";
|
|
1338
|
+
function Di({
|
|
1339
1339
|
size: e = 14,
|
|
1340
1340
|
className: t,
|
|
1341
|
-
fill: n =
|
|
1341
|
+
fill: n = Ri
|
|
1342
1342
|
}) {
|
|
1343
1343
|
return /* @__PURE__ */ S(
|
|
1344
1344
|
"svg",
|
|
@@ -1376,14 +1376,14 @@ function Ri({
|
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const Pi = 8, Yn = 8, zi = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
1382
|
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
1385
|
const l = R(null), [o, s] = M(null);
|
|
1386
|
-
return
|
|
1386
|
+
return sr(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
1388
|
s(null);
|
|
1389
1389
|
return;
|
|
@@ -1392,9 +1392,9 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1392
1392
|
if (!a) return;
|
|
1393
1393
|
const c = () => {
|
|
1394
1394
|
const d = a.getBoundingClientRect(), g = {
|
|
1395
|
-
top: d.top -
|
|
1395
|
+
top: d.top - Pi,
|
|
1396
1396
|
left: d.left + d.width / 2
|
|
1397
|
-
}, p =
|
|
1397
|
+
}, p = Yn + 90, m = window.innerWidth - Yn - 90;
|
|
1398
1398
|
g.left < p && (g.left = p), g.left > m && (g.left = m), s(g);
|
|
1399
1399
|
};
|
|
1400
1400
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
@@ -1431,7 +1431,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1431
1431
|
),
|
|
1432
1432
|
document.body
|
|
1433
1433
|
);
|
|
1434
|
-
},
|
|
1434
|
+
}, $i = ({
|
|
1435
1435
|
isMuted: e,
|
|
1436
1436
|
onToggleMute: t,
|
|
1437
1437
|
isCameraEnabled: n,
|
|
@@ -1463,7 +1463,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1463
1463
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1464
1464
|
onClick: t,
|
|
1465
1465
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1466
|
-
children: /* @__PURE__ */ r(
|
|
1466
|
+
children: /* @__PURE__ */ r(mr, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
1469
|
/* @__PURE__ */ r(
|
|
@@ -1476,7 +1476,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
1478
|
"aria-expanded": x,
|
|
1479
|
-
children: /* @__PURE__ */ r(
|
|
1479
|
+
children: /* @__PURE__ */ r(Hi, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
1482
|
/* @__PURE__ */ r(
|
|
@@ -1486,14 +1486,14 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
1487
|
onClick: P,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(yr, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ S(
|
|
1496
|
-
|
|
1496
|
+
zi,
|
|
1497
1497
|
{
|
|
1498
1498
|
open: x,
|
|
1499
1499
|
onClose: () => L(!1),
|
|
@@ -1508,7 +1508,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1508
1508
|
i(), L(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ r(
|
|
1511
|
+
/* @__PURE__ */ r(hr, {}),
|
|
1512
1512
|
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
@@ -1522,7 +1522,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1522
1522
|
s(), L(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */ r(
|
|
1525
|
+
/* @__PURE__ */ r(pr, {}),
|
|
1526
1526
|
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
@@ -1536,7 +1536,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1536
1536
|
d(), L(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ r(
|
|
1539
|
+
/* @__PURE__ */ r(gr, { muted: c }),
|
|
1540
1540
|
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
@@ -1550,7 +1550,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1550
1550
|
m(), L(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */ r(
|
|
1553
|
+
/* @__PURE__ */ r(Oi, {}),
|
|
1554
1554
|
/* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
@@ -1573,7 +1573,7 @@ const Di = 8, Vn = 8, Pi = ({
|
|
|
1573
1573
|
)
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
|
-
function
|
|
1576
|
+
function Hi() {
|
|
1577
1577
|
return /* @__PURE__ */ S(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
@@ -1590,7 +1590,7 @@ function $i() {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function Oi() {
|
|
1594
1594
|
return /* @__PURE__ */ r(
|
|
1595
1595
|
"svg",
|
|
1596
1596
|
{
|
|
@@ -1607,7 +1607,7 @@ function Hi() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const Fi = ({
|
|
1611
1611
|
position: e,
|
|
1612
1612
|
isMobile: t,
|
|
1613
1613
|
agentName: n,
|
|
@@ -1652,10 +1652,10 @@ const Oi = ({
|
|
|
1652
1652
|
avatarVideoContainerRef: Le,
|
|
1653
1653
|
agentVideoEl: oe,
|
|
1654
1654
|
onConnect: Ie,
|
|
1655
|
-
onDisconnect:
|
|
1655
|
+
onDisconnect: ft,
|
|
1656
1656
|
onRetry: kt,
|
|
1657
1657
|
onResumeAudio: Lt,
|
|
1658
|
-
onToggleMute:
|
|
1658
|
+
onToggleMute: pt,
|
|
1659
1659
|
onSwitchMicDevice: St,
|
|
1660
1660
|
onToggleCamera: Ke,
|
|
1661
1661
|
onSwitchCameraDevice: Je,
|
|
@@ -1669,7 +1669,7 @@ const Oi = ({
|
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
1671
|
var rt;
|
|
1672
|
-
const Ve = ((a == null ? void 0 : a.length) ?? 0) > 1, Qe = L === "connecting" || L === "connected", Se = L === "connected", Et = L === "idle" || L === "disconnected" || L === "error", [
|
|
1672
|
+
const Ve = ((a == null ? void 0 : a.length) ?? 0) > 1, Qe = L === "connecting" || L === "connected", Se = L === "connected", Et = L === "idle" || L === "disconnected" || L === "error", [ht, Te] = M(!1);
|
|
1673
1673
|
T(() => {
|
|
1674
1674
|
if (!oe) {
|
|
1675
1675
|
Te(!1);
|
|
@@ -1685,7 +1685,7 @@ const Oi = ({
|
|
|
1685
1685
|
oe.removeEventListener("playing", C), oe.removeEventListener("loadeddata", C);
|
|
1686
1686
|
};
|
|
1687
1687
|
}, [oe]);
|
|
1688
|
-
const [
|
|
1688
|
+
const [mt, At] = M(!1);
|
|
1689
1689
|
T(() => {
|
|
1690
1690
|
y === "speaking" && At(!0);
|
|
1691
1691
|
}, [y]), T(() => {
|
|
@@ -1697,11 +1697,11 @@ const Oi = ({
|
|
|
1697
1697
|
fe(!1);
|
|
1698
1698
|
return;
|
|
1699
1699
|
}
|
|
1700
|
-
if (
|
|
1700
|
+
if (mt) return;
|
|
1701
1701
|
const C = setTimeout(() => fe(!0), 12e3);
|
|
1702
1702
|
return () => clearTimeout(C);
|
|
1703
|
-
}, [Se,
|
|
1704
|
-
const Nt = L === "connecting" || Se && !
|
|
1703
|
+
}, [Se, mt]);
|
|
1704
|
+
const Nt = L === "connecting" || Se && !mt && !Ye, pe = R(null), be = R(null);
|
|
1705
1705
|
T(() => {
|
|
1706
1706
|
const C = pe.current;
|
|
1707
1707
|
C && (C.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", C.appendChild(ae)));
|
|
@@ -1731,20 +1731,20 @@ const Oi = ({
|
|
|
1731
1731
|
se && (We(se), Re(""));
|
|
1732
1732
|
},
|
|
1733
1733
|
[xe, We]
|
|
1734
|
-
), De = s.productName || "Live Layer",
|
|
1734
|
+
), De = s.productName || "Live Layer", gt = !s.hideBranding && !s.productName;
|
|
1735
1735
|
let Pe = null, Ee = null;
|
|
1736
1736
|
for (let C = w.length - 1; C >= 0; C--) {
|
|
1737
1737
|
const se = w[C];
|
|
1738
1738
|
if (!Pe && se.role === "agent" ? Pe = se : !Ee && se.role === "user" && (Ee = se), Pe && Ee) break;
|
|
1739
1739
|
}
|
|
1740
|
-
const nt = Se ? (Pe == null ? void 0 : Pe.text) || null : o || null,
|
|
1740
|
+
const nt = Se ? (Pe == null ? void 0 : Pe.text) || null : o || null, yt = Se && (Ee == null ? void 0 : Ee.text) || null, vt = [
|
|
1741
1741
|
"ll-expanded",
|
|
1742
1742
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1743
1743
|
].join(" ");
|
|
1744
1744
|
return /* @__PURE__ */ S(
|
|
1745
1745
|
"div",
|
|
1746
1746
|
{
|
|
1747
|
-
className:
|
|
1747
|
+
className: vt,
|
|
1748
1748
|
"data-position": e,
|
|
1749
1749
|
"data-state": Se ? "connected" : Qe ? "connecting" : "idle",
|
|
1750
1750
|
role: "dialog",
|
|
@@ -1752,7 +1752,7 @@ const Oi = ({
|
|
|
1752
1752
|
children: [
|
|
1753
1753
|
/* @__PURE__ */ S("div", { className: "ll-expanded__bg", children: [
|
|
1754
1754
|
i ? /* @__PURE__ */ r(
|
|
1755
|
-
|
|
1755
|
+
Ti,
|
|
1756
1756
|
{
|
|
1757
1757
|
src: i,
|
|
1758
1758
|
alt: n,
|
|
@@ -1776,7 +1776,7 @@ const Oi = ({
|
|
|
1776
1776
|
{
|
|
1777
1777
|
ref: Le,
|
|
1778
1778
|
className: "ll-expanded__video",
|
|
1779
|
-
"data-ready":
|
|
1779
|
+
"data-ready": ht
|
|
1780
1780
|
}
|
|
1781
1781
|
),
|
|
1782
1782
|
Nt && /* @__PURE__ */ S("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
@@ -1915,7 +1915,7 @@ const Oi = ({
|
|
|
1915
1915
|
onClick: qe,
|
|
1916
1916
|
"aria-label": "Minimize widget",
|
|
1917
1917
|
title: "Minimize",
|
|
1918
|
-
children: /* @__PURE__ */ r(
|
|
1918
|
+
children: /* @__PURE__ */ r(Xn, {})
|
|
1919
1919
|
}
|
|
1920
1920
|
),
|
|
1921
1921
|
ie !== !1 && /* @__PURE__ */ r(
|
|
@@ -1926,7 +1926,7 @@ const Oi = ({
|
|
|
1926
1926
|
onClick: Ue,
|
|
1927
1927
|
"aria-label": "End call",
|
|
1928
1928
|
title: "End call",
|
|
1929
|
-
children: /* @__PURE__ */ r(
|
|
1929
|
+
children: /* @__PURE__ */ r(Gn, {})
|
|
1930
1930
|
}
|
|
1931
1931
|
)
|
|
1932
1932
|
] })
|
|
@@ -1945,7 +1945,7 @@ const Oi = ({
|
|
|
1945
1945
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1946
1946
|
// the page itself.
|
|
1947
1947
|
/* @__PURE__ */ S("div", { className: "ll-expanded__header ll-expanded__header--idle", ...je, children: [
|
|
1948
|
-
!j && (
|
|
1948
|
+
!j && (gt ? /* @__PURE__ */ S(
|
|
1949
1949
|
"a",
|
|
1950
1950
|
{
|
|
1951
1951
|
className: "ll-expanded__brand ll-expanded__brand--link",
|
|
@@ -1955,7 +1955,7 @@ const Oi = ({
|
|
|
1955
1955
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1956
1956
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1957
1957
|
children: [
|
|
1958
|
-
/* @__PURE__ */ r(
|
|
1958
|
+
/* @__PURE__ */ r(Di, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1959
1959
|
/* @__PURE__ */ r("span", { children: De })
|
|
1960
1960
|
]
|
|
1961
1961
|
}
|
|
@@ -1968,7 +1968,7 @@ const Oi = ({
|
|
|
1968
1968
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1969
1969
|
onClick: qe,
|
|
1970
1970
|
"aria-label": "Minimize widget",
|
|
1971
|
-
children: /* @__PURE__ */ r(
|
|
1971
|
+
children: /* @__PURE__ */ r(Xn, {})
|
|
1972
1972
|
}
|
|
1973
1973
|
),
|
|
1974
1974
|
ie !== !1 && /* @__PURE__ */ r(
|
|
@@ -1978,7 +1978,7 @@ const Oi = ({
|
|
|
1978
1978
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1979
1979
|
onClick: Ue,
|
|
1980
1980
|
"aria-label": "Close widget",
|
|
1981
|
-
children: /* @__PURE__ */ r(
|
|
1981
|
+
children: /* @__PURE__ */ r(Gn, {})
|
|
1982
1982
|
}
|
|
1983
1983
|
)
|
|
1984
1984
|
] })
|
|
@@ -2046,12 +2046,12 @@ const Oi = ({
|
|
|
2046
2046
|
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: nt })
|
|
2047
2047
|
}
|
|
2048
2048
|
),
|
|
2049
|
-
!j &&
|
|
2049
|
+
!j && yt && /* @__PURE__ */ r(
|
|
2050
2050
|
"div",
|
|
2051
2051
|
{
|
|
2052
2052
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
2053
2053
|
"data-role": "user",
|
|
2054
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2054
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: yt })
|
|
2055
2055
|
}
|
|
2056
2056
|
),
|
|
2057
2057
|
!le && !j && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (C) => C.stopPropagation(), children: [
|
|
@@ -2063,7 +2063,7 @@ const Oi = ({
|
|
|
2063
2063
|
onClick: Fe,
|
|
2064
2064
|
"aria-label": f ? "Stop sharing screen" : "Share screen",
|
|
2065
2065
|
title: f ? "Stop sharing" : "Share screen",
|
|
2066
|
-
children: /* @__PURE__ */ r(
|
|
2066
|
+
children: /* @__PURE__ */ r(pr, {})
|
|
2067
2067
|
}
|
|
2068
2068
|
),
|
|
2069
2069
|
U && /* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
|
|
@@ -2075,7 +2075,7 @@ const Oi = ({
|
|
|
2075
2075
|
onClick: Ke,
|
|
2076
2076
|
"aria-label": Z ? "Turn off camera" : "Turn on camera",
|
|
2077
2077
|
title: Z ? "Stop camera" : "Start camera",
|
|
2078
|
-
children: /* @__PURE__ */ r(
|
|
2078
|
+
children: /* @__PURE__ */ r(hr, {})
|
|
2079
2079
|
}
|
|
2080
2080
|
),
|
|
2081
2081
|
/* @__PURE__ */ r(
|
|
@@ -2094,7 +2094,7 @@ const Oi = ({
|
|
|
2094
2094
|
}
|
|
2095
2095
|
),
|
|
2096
2096
|
me && H.length > 0 && /* @__PURE__ */ r(
|
|
2097
|
-
|
|
2097
|
+
Kn,
|
|
2098
2098
|
{
|
|
2099
2099
|
label: "Camera",
|
|
2100
2100
|
devices: H,
|
|
@@ -2112,10 +2112,10 @@ const Oi = ({
|
|
|
2112
2112
|
{
|
|
2113
2113
|
type: "button",
|
|
2114
2114
|
className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
|
|
2115
|
-
onClick:
|
|
2115
|
+
onClick: pt,
|
|
2116
2116
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2117
2117
|
title: O ? "Unmute" : "Mute",
|
|
2118
|
-
children: /* @__PURE__ */ r(
|
|
2118
|
+
children: /* @__PURE__ */ r(mr, { muted: O })
|
|
2119
2119
|
}
|
|
2120
2120
|
),
|
|
2121
2121
|
/* @__PURE__ */ r(
|
|
@@ -2134,7 +2134,7 @@ const Oi = ({
|
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
2136
|
et && z.length > 0 && /* @__PURE__ */ r(
|
|
2137
|
-
|
|
2137
|
+
Kn,
|
|
2138
2138
|
{
|
|
2139
2139
|
label: "Microphone",
|
|
2140
2140
|
devices: z,
|
|
@@ -2154,7 +2154,7 @@ const Oi = ({
|
|
|
2154
2154
|
onClick: Be,
|
|
2155
2155
|
"aria-label": $ ? "Unmute speaker" : "Mute speaker",
|
|
2156
2156
|
title: $ ? "Unmute speaker" : "Mute speaker",
|
|
2157
|
-
children: /* @__PURE__ */ r(
|
|
2157
|
+
children: /* @__PURE__ */ r(gr, { muted: $ })
|
|
2158
2158
|
}
|
|
2159
2159
|
),
|
|
2160
2160
|
/* @__PURE__ */ r(
|
|
@@ -2162,18 +2162,18 @@ const Oi = ({
|
|
|
2162
2162
|
{
|
|
2163
2163
|
type: "button",
|
|
2164
2164
|
className: "ll-tool ll-tool--danger",
|
|
2165
|
-
onClick:
|
|
2165
|
+
onClick: ft,
|
|
2166
2166
|
"aria-label": "End conversation",
|
|
2167
2167
|
title: "End conversation",
|
|
2168
|
-
children: /* @__PURE__ */ r(
|
|
2168
|
+
children: /* @__PURE__ */ r(yr, {})
|
|
2169
2169
|
}
|
|
2170
2170
|
)
|
|
2171
2171
|
] }),
|
|
2172
2172
|
!le && j && /* @__PURE__ */ r(
|
|
2173
|
-
|
|
2173
|
+
$i,
|
|
2174
2174
|
{
|
|
2175
2175
|
isMuted: O,
|
|
2176
|
-
onToggleMute:
|
|
2176
|
+
onToggleMute: pt,
|
|
2177
2177
|
isCameraEnabled: Z,
|
|
2178
2178
|
onToggleCamera: Ke,
|
|
2179
2179
|
allowCamera: U,
|
|
@@ -2185,7 +2185,7 @@ const Oi = ({
|
|
|
2185
2185
|
allowTyping: re,
|
|
2186
2186
|
isTypingOpen: Tt,
|
|
2187
2187
|
onToggleTyping: pn,
|
|
2188
|
-
onDisconnect:
|
|
2188
|
+
onDisconnect: ft
|
|
2189
2189
|
}
|
|
2190
2190
|
),
|
|
2191
2191
|
!le && re && (j ? Tt : !0) && /* @__PURE__ */ S("form", { className: "ll-message-input", onSubmit: Ne, children: [
|
|
@@ -2206,7 +2206,7 @@ const Oi = ({
|
|
|
2206
2206
|
type: "submit",
|
|
2207
2207
|
className: "ll-message-input__send",
|
|
2208
2208
|
"aria-label": "Send message",
|
|
2209
|
-
children: /* @__PURE__ */ r(
|
|
2209
|
+
children: /* @__PURE__ */ r(Bi, {})
|
|
2210
2210
|
}
|
|
2211
2211
|
)
|
|
2212
2212
|
] })
|
|
@@ -2260,29 +2260,29 @@ const Oi = ({
|
|
|
2260
2260
|
function qt() {
|
|
2261
2261
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
|
|
2262
2262
|
}
|
|
2263
|
-
function
|
|
2263
|
+
function Gn() {
|
|
2264
2264
|
return /* @__PURE__ */ S("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
2265
2265
|
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2266
2266
|
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2267
2267
|
] });
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function Xn() {
|
|
2270
2270
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function pr() {
|
|
2273
2273
|
return /* @__PURE__ */ S("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: [
|
|
2274
2274
|
/* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
2275
2275
|
/* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2276
2276
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
2277
2277
|
] });
|
|
2278
2278
|
}
|
|
2279
|
-
function
|
|
2279
|
+
function hr() {
|
|
2280
2280
|
return /* @__PURE__ */ S("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: [
|
|
2281
2281
|
/* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2282
2282
|
/* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2283
2283
|
] });
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2285
|
+
function mr({ muted: e }) {
|
|
2286
2286
|
return /* @__PURE__ */ S("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: [
|
|
2287
2287
|
/* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2288
2288
|
/* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -2290,7 +2290,7 @@ function hr({ muted: e }) {
|
|
|
2290
2290
|
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2291
2291
|
] });
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2293
|
+
function gr({ muted: e }) {
|
|
2294
2294
|
return /* @__PURE__ */ S("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: [
|
|
2295
2295
|
/* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2296
2296
|
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(Xe, { children: [
|
|
@@ -2299,13 +2299,13 @@ function mr({ muted: e }) {
|
|
|
2299
2299
|
] })
|
|
2300
2300
|
] });
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Bi() {
|
|
2303
2303
|
return /* @__PURE__ */ S("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2304
2304
|
/* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2305
2305
|
/* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
|
|
2306
2306
|
] });
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function yr() {
|
|
2309
2309
|
return /* @__PURE__ */ r("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__ */ r(
|
|
2310
2310
|
"path",
|
|
2311
2311
|
{
|
|
@@ -2314,7 +2314,7 @@ function gr() {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
) });
|
|
2316
2316
|
}
|
|
2317
|
-
const
|
|
2317
|
+
const Kn = ({
|
|
2318
2318
|
label: e,
|
|
2319
2319
|
devices: t,
|
|
2320
2320
|
activeId: n,
|
|
@@ -2322,7 +2322,7 @@ const Xn = ({
|
|
|
2322
2322
|
anchorRef: l
|
|
2323
2323
|
}) => {
|
|
2324
2324
|
const [o, s] = M(null);
|
|
2325
|
-
return
|
|
2325
|
+
return sr(() => {
|
|
2326
2326
|
const a = () => {
|
|
2327
2327
|
const c = l.current;
|
|
2328
2328
|
if (!c) return;
|
|
@@ -2374,7 +2374,7 @@ const Xn = ({
|
|
|
2374
2374
|
),
|
|
2375
2375
|
document.body
|
|
2376
2376
|
);
|
|
2377
|
-
},
|
|
2377
|
+
}, Wi = [
|
|
2378
2378
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2379
2379
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2380
2380
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2385,7 +2385,7 @@ const Xn = ({
|
|
|
2385
2385
|
function Vt(e) {
|
|
2386
2386
|
let t = e;
|
|
2387
2387
|
for (; t; ) {
|
|
2388
|
-
for (const n of
|
|
2388
|
+
for (const n of Wi)
|
|
2389
2389
|
if (t.matches(n)) return !0;
|
|
2390
2390
|
t = t.parentElement;
|
|
2391
2391
|
}
|
|
@@ -2400,66 +2400,66 @@ function sn(e) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
return !0;
|
|
2402
2402
|
}
|
|
2403
|
-
const
|
|
2404
|
-
function
|
|
2403
|
+
const qi = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, Jn = /\b(back|previous|prev|go\s*back)\b|←|‹/i, Ui = /\b(submit|finish|done|complete|send)\b/i, Ct = /* @__PURE__ */ new Map();
|
|
2404
|
+
function Zn(e) {
|
|
2405
2405
|
const t = Ct.get(e);
|
|
2406
2406
|
return t && t.isConnected ? t : null;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function st(e) {
|
|
2409
2409
|
if (Vt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
|
|
2410
2410
|
const t = typeof window < "u" && window.getComputedStyle ? window.getComputedStyle(e) : null;
|
|
2411
2411
|
return !!(t && (t.display === "none" || t.visibility === "hidden"));
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function ji(e) {
|
|
2414
2414
|
return !!(e.disabled || e.getAttribute("aria-disabled") === "true");
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2416
|
+
function Vi(e) {
|
|
2417
2417
|
return (e.innerText || e.textContent || e.getAttribute("aria-label") || e.value || "").trim();
|
|
2418
2418
|
}
|
|
2419
|
-
function
|
|
2419
|
+
function Yi(e) {
|
|
2420
2420
|
return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
|
|
2421
|
-
(n) => !
|
|
2421
|
+
(n) => !st(n) && !ji(n)
|
|
2422
2422
|
);
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function vr(e) {
|
|
2425
2425
|
Ct.clear();
|
|
2426
|
-
const t =
|
|
2426
|
+
const t = Yi(e);
|
|
2427
2427
|
let n, i, l;
|
|
2428
2428
|
for (const a of t) {
|
|
2429
|
-
const c =
|
|
2429
|
+
const c = Vi(a);
|
|
2430
2430
|
if (!c || c.length > 40) continue;
|
|
2431
2431
|
const d = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
|
|
2432
|
-
!n &&
|
|
2432
|
+
!n && qi.test(c) && !Jn.test(c) ? (n = { id: "ll-advance", label: c }, Ct.set("ll-advance", a)) : !i && Jn.test(c) ? (i = { id: "ll-back", label: c }, Ct.set("ll-back", a)) : !l && (Ui.test(c) || d) && (l = { id: "ll-submit", label: c }, Ct.set("ll-submit", a));
|
|
2433
2433
|
}
|
|
2434
|
-
const o =
|
|
2434
|
+
const o = eo(e);
|
|
2435
2435
|
return { kind: n || o.totalSteps ? "multi-step" : "single-page", advance: n, back: i, submit: l, ...o };
|
|
2436
2436
|
}
|
|
2437
|
-
const
|
|
2438
|
-
function
|
|
2439
|
-
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0,
|
|
2437
|
+
const Gi = 60;
|
|
2438
|
+
function br(e) {
|
|
2439
|
+
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Gi);
|
|
2440
2440
|
}
|
|
2441
|
-
function
|
|
2441
|
+
function Xi(e) {
|
|
2442
2442
|
const t = e.getAttribute("class");
|
|
2443
2443
|
return t ? t.toLowerCase() : "";
|
|
2444
2444
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2447
|
-
return
|
|
2445
|
+
const Ki = /stepper|wizard|ant-steps|step-indicator/;
|
|
2446
|
+
function Ji(e) {
|
|
2447
|
+
return Ki.test(Xi(e));
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2449
|
+
function Qn(e) {
|
|
2450
2450
|
const t = e.getAttribute("aria-current");
|
|
2451
2451
|
return t === "step" || t === "true" ? !0 : Array.from(e.classList).some(
|
|
2452
2452
|
(n) => /(^|[-_])(active|current|selected)([-_]|$)/i.test(n)
|
|
2453
2453
|
);
|
|
2454
2454
|
}
|
|
2455
|
-
const
|
|
2456
|
-
function
|
|
2457
|
-
return
|
|
2458
|
-
|
|
2455
|
+
const Zi = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
|
|
2456
|
+
function Qi(e) {
|
|
2457
|
+
return Qn(e) ? !0 : Array.from(e.querySelectorAll(Zi)).some(
|
|
2458
|
+
Qn
|
|
2459
2459
|
);
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const n =
|
|
2461
|
+
function er(e, t) {
|
|
2462
|
+
const n = br(
|
|
2463
2463
|
e[t].innerText || e[t].textContent || ""
|
|
2464
2464
|
);
|
|
2465
2465
|
return {
|
|
@@ -2468,23 +2468,23 @@ function Qn(e, t) {
|
|
|
2468
2468
|
...n ? { stepLabel: n } : {}
|
|
2469
2469
|
};
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function eo(e) {
|
|
2472
2472
|
const t = e.querySelector('[aria-current="step"]');
|
|
2473
|
-
if (t && t.parentElement && !
|
|
2473
|
+
if (t && t.parentElement && !st(t)) {
|
|
2474
2474
|
const l = Array.from(t.parentElement.children).filter(
|
|
2475
|
-
(s) => s.tagName === t.tagName && !
|
|
2475
|
+
(s) => s.tagName === t.tagName && !st(s)
|
|
2476
2476
|
), o = l.indexOf(t);
|
|
2477
|
-
if (o >= 0 && l.length >= 2) return
|
|
2477
|
+
if (o >= 0 && l.length >= 2) return er(l, o);
|
|
2478
2478
|
}
|
|
2479
2479
|
const n = e.querySelector('[role="progressbar"]');
|
|
2480
|
-
if (n && !
|
|
2480
|
+
if (n && !st(n)) {
|
|
2481
2481
|
const l = Number(n.getAttribute("aria-valuenow")), o = Number(n.getAttribute("aria-valuemax"));
|
|
2482
2482
|
if (Number.isFinite(l) && Number.isFinite(o) && o >= 2) {
|
|
2483
2483
|
const s = (n.getAttribute("aria-valuetext") || "").trim();
|
|
2484
2484
|
return {
|
|
2485
2485
|
totalSteps: o,
|
|
2486
2486
|
currentStep: l,
|
|
2487
|
-
...s ? { stepLabel:
|
|
2487
|
+
...s ? { stepLabel: br(s) } : {}
|
|
2488
2488
|
};
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
@@ -2492,19 +2492,19 @@ function Qi(e) {
|
|
|
2492
2492
|
e.querySelectorAll(
|
|
2493
2493
|
'[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
|
|
2494
2494
|
)
|
|
2495
|
-
).filter((l) => !
|
|
2495
|
+
).filter((l) => !st(l) && Ji(l));
|
|
2496
2496
|
for (const l of i) {
|
|
2497
2497
|
const o = Array.from(l.children).filter(
|
|
2498
|
-
(a) => !
|
|
2498
|
+
(a) => !st(a) && (a.textContent || "").trim().length > 0
|
|
2499
2499
|
);
|
|
2500
2500
|
if (o.length < 2 || o.length > 12) continue;
|
|
2501
|
-
const s = o.findIndex(
|
|
2501
|
+
const s = o.findIndex(Qi);
|
|
2502
2502
|
if (!(s < 0))
|
|
2503
|
-
return
|
|
2503
|
+
return er(o, s);
|
|
2504
2504
|
}
|
|
2505
2505
|
return {};
|
|
2506
2506
|
}
|
|
2507
|
-
const Ut = 4096,
|
|
2507
|
+
const Ut = 4096, to = 20, no = 20, ro = 10, io = 10, oo = 30, lo = 20, tr = 500, ao = [
|
|
2508
2508
|
'[data-ll-private="true"]',
|
|
2509
2509
|
".ll-widget",
|
|
2510
2510
|
"script",
|
|
@@ -2516,7 +2516,7 @@ function _t(e) {
|
|
|
2516
2516
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2517
2517
|
let t = e;
|
|
2518
2518
|
for (; t; ) {
|
|
2519
|
-
for (const n of
|
|
2519
|
+
for (const n of ao)
|
|
2520
2520
|
if (t.matches(n)) return !0;
|
|
2521
2521
|
t = t.parentElement;
|
|
2522
2522
|
}
|
|
@@ -2529,7 +2529,7 @@ function xt(e) {
|
|
|
2529
2529
|
const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2530
2530
|
return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2532
|
+
function nr(e) {
|
|
2533
2533
|
const t = e.getAttribute("id");
|
|
2534
2534
|
if (t) {
|
|
2535
2535
|
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
@@ -2559,10 +2559,10 @@ function tr(e) {
|
|
|
2559
2559
|
function de(e, t) {
|
|
2560
2560
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2561
2561
|
}
|
|
2562
|
-
function
|
|
2562
|
+
function so(e) {
|
|
2563
2563
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2564
2564
|
}
|
|
2565
|
-
function
|
|
2565
|
+
function co(e) {
|
|
2566
2566
|
const t = e.getAttribute("aria-label");
|
|
2567
2567
|
if (t) return t.trim().slice(0, 80);
|
|
2568
2568
|
const n = e.getAttribute("aria-labelledby");
|
|
@@ -2588,10 +2588,10 @@ function so(e) {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
return null;
|
|
2590
2590
|
}
|
|
2591
|
-
function
|
|
2591
|
+
function at(e) {
|
|
2592
2592
|
return e.length;
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function uo(e, t = {}) {
|
|
2595
2595
|
const n = t.doc ?? (typeof document < "u" ? document : null);
|
|
2596
2596
|
if (!n)
|
|
2597
2597
|
return {
|
|
@@ -2609,11 +2609,11 @@ function co(e, t = {}) {
|
|
|
2609
2609
|
n.querySelectorAll("[data-ll-region]")
|
|
2610
2610
|
), a = [];
|
|
2611
2611
|
for (const v of s) {
|
|
2612
|
-
if (a.length >=
|
|
2612
|
+
if (a.length >= ro) break;
|
|
2613
2613
|
if (_t(v) || !xt(v)) continue;
|
|
2614
2614
|
const z = v.getAttribute("data-ll-region") ?? "", B = v.getAttribute("data-ll-intent") ?? void 0, Z = de(
|
|
2615
2615
|
(v.innerText || v.textContent || "").trim(),
|
|
2616
|
-
|
|
2616
|
+
tr * 2
|
|
2617
2617
|
);
|
|
2618
2618
|
!z || !Z || a.push({ id: z, intent: B, text: Z });
|
|
2619
2619
|
}
|
|
@@ -2629,12 +2629,12 @@ function co(e, t = {}) {
|
|
|
2629
2629
|
for (const v of p) {
|
|
2630
2630
|
if (_t(v) || !xt(v) || d.includes(v.tagName)) continue;
|
|
2631
2631
|
const z = (v.textContent || "").trim();
|
|
2632
|
-
z.length > 10 && c.push(de(z,
|
|
2632
|
+
z.length > 10 && c.push(de(z, tr));
|
|
2633
2633
|
}
|
|
2634
2634
|
const m = c.join(`
|
|
2635
2635
|
`), P = [], x = Array.from(n.querySelectorAll("a[href]"));
|
|
2636
2636
|
for (const v of x) {
|
|
2637
|
-
if (P.length >=
|
|
2637
|
+
if (P.length >= to) break;
|
|
2638
2638
|
if (_t(v) || !xt(v)) continue;
|
|
2639
2639
|
const z = v.getAttribute("href") || "", B = (v.textContent || "").trim();
|
|
2640
2640
|
!z || !B || P.push({ href: z, text: de(B, 100) });
|
|
@@ -2645,17 +2645,17 @@ function co(e, t = {}) {
|
|
|
2645
2645
|
)
|
|
2646
2646
|
);
|
|
2647
2647
|
for (const v of y) {
|
|
2648
|
-
if (L.length >=
|
|
2648
|
+
if (L.length >= no) break;
|
|
2649
2649
|
if (_t(v) || !sn(v) || !xt(v)) continue;
|
|
2650
|
-
const z =
|
|
2650
|
+
const z = nr(v), B = v instanceof HTMLInputElement ? v.type : v.tagName.toLowerCase();
|
|
2651
2651
|
z && L.push({ label: de(z, 100), type: B });
|
|
2652
2652
|
}
|
|
2653
2653
|
const w = Array.from(n.querySelectorAll("form")), D = [];
|
|
2654
2654
|
let E = 0;
|
|
2655
2655
|
for (const v of w) {
|
|
2656
|
-
if (D.length >=
|
|
2656
|
+
if (D.length >= io) break;
|
|
2657
2657
|
if (Vt(v) || v.matches(".ll-widget *, .ll-widget")) continue;
|
|
2658
|
-
const z = v.getAttribute("id") || v.getAttribute("name") ||
|
|
2658
|
+
const z = v.getAttribute("id") || v.getAttribute("name") || so(v.getAttribute("data-ll-intent")) || `form_${E++}`, B = v.getAttribute("data-ll-intent") || co(v) || void 0, Z = Array.from(
|
|
2659
2659
|
v.querySelectorAll(
|
|
2660
2660
|
"input, textarea, select"
|
|
2661
2661
|
)
|
|
@@ -2663,7 +2663,7 @@ function co(e, t = {}) {
|
|
|
2663
2663
|
let H = 0;
|
|
2664
2664
|
const X = /* @__PURE__ */ new Set();
|
|
2665
2665
|
for (const f of Z) {
|
|
2666
|
-
if (ae.length >=
|
|
2666
|
+
if (ae.length >= oo) break;
|
|
2667
2667
|
if (!sn(f)) continue;
|
|
2668
2668
|
if (f instanceof HTMLInputElement) {
|
|
2669
2669
|
const j = f.type;
|
|
@@ -2672,7 +2672,7 @@ function co(e, t = {}) {
|
|
|
2672
2672
|
const N = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
|
|
2673
2673
|
let U = N || $ || `field_${H}`;
|
|
2674
2674
|
X.has(U) && (U = `${U}__${H}`), X.add(U), H++;
|
|
2675
|
-
const K =
|
|
2675
|
+
const K = nr(f) || U, re = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), W = {
|
|
2676
2676
|
name: U,
|
|
2677
2677
|
label: de(K, 100),
|
|
2678
2678
|
type: re
|
|
@@ -2712,7 +2712,7 @@ function co(e, t = {}) {
|
|
|
2712
2712
|
const Ie = (Q.textContent || "").trim();
|
|
2713
2713
|
if (Ie && !W.placeholderOption && (W.placeholderOption = de(Ie, 60)), W.hasEmptyOption = !0, Q.disabled) continue;
|
|
2714
2714
|
}
|
|
2715
|
-
if (j.length >=
|
|
2715
|
+
if (j.length >= lo) break;
|
|
2716
2716
|
const Le = Q.value || "", oe = (Q.textContent || "").trim() || Le;
|
|
2717
2717
|
!Le && !oe || j.push({ value: Le, label: de(oe, 60) });
|
|
2718
2718
|
}
|
|
@@ -2732,36 +2732,36 @@ function co(e, t = {}) {
|
|
|
2732
2732
|
visibleLinks: P,
|
|
2733
2733
|
visibleFields: L,
|
|
2734
2734
|
forms: D,
|
|
2735
|
-
flow:
|
|
2735
|
+
flow: vr(n),
|
|
2736
2736
|
extras: e
|
|
2737
2737
|
};
|
|
2738
|
-
let O =
|
|
2738
|
+
let O = at(JSON.stringify(b.regions)) + at(b.visibleText) + at(JSON.stringify(b.visibleLinks)) + at(JSON.stringify(b.visibleFields));
|
|
2739
2739
|
for (; O > Ut && b.visibleFields.length > 0; )
|
|
2740
|
-
b.visibleFields.pop(), O =
|
|
2740
|
+
b.visibleFields.pop(), O = at(JSON.stringify(b.visibleFields));
|
|
2741
2741
|
for (; O > Ut && b.visibleLinks.length > 0; )
|
|
2742
2742
|
b.visibleLinks.pop(), O -= 80;
|
|
2743
|
-
return
|
|
2743
|
+
return at(b.visibleText) > Ut && (b.visibleText = de(b.visibleText, Ut - 100)), b;
|
|
2744
2744
|
}
|
|
2745
|
-
let
|
|
2746
|
-
function
|
|
2745
|
+
let ct = null;
|
|
2746
|
+
function fo(e) {
|
|
2747
2747
|
const t = e.querySelectorAll("form");
|
|
2748
2748
|
let n = `f${t.length}`;
|
|
2749
2749
|
return t.forEach((i) => {
|
|
2750
2750
|
n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
|
|
2751
2751
|
}), n;
|
|
2752
2752
|
}
|
|
2753
|
-
function
|
|
2754
|
-
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ?
|
|
2755
|
-
if (
|
|
2756
|
-
return
|
|
2757
|
-
const a =
|
|
2758
|
-
return
|
|
2753
|
+
function rr(e, t = {}) {
|
|
2754
|
+
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ? fo(i) : ""}`;
|
|
2755
|
+
if (ct && ct.key === s && n - ct.at < 1e3)
|
|
2756
|
+
return ct.ctx;
|
|
2757
|
+
const a = uo(e, t);
|
|
2758
|
+
return ct = { key: s, at: n, ctx: a }, a;
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2761
|
-
|
|
2760
|
+
function po() {
|
|
2761
|
+
ct = null;
|
|
2762
2762
|
}
|
|
2763
|
-
const
|
|
2764
|
-
function
|
|
2763
|
+
const ho = 200;
|
|
2764
|
+
function mo(e) {
|
|
2765
2765
|
const t = String(e.href || "");
|
|
2766
2766
|
return {
|
|
2767
2767
|
href: t,
|
|
@@ -2771,18 +2771,18 @@ function ho(e) {
|
|
|
2771
2771
|
description: e.description
|
|
2772
2772
|
};
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function go(e) {
|
|
2775
2775
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2777
|
+
function yo(e) {
|
|
2778
2778
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2779
2779
|
if (!t) return [];
|
|
2780
2780
|
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), l = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2781
2781
|
for (const s of o) {
|
|
2782
|
-
if (l.length >=
|
|
2782
|
+
if (l.length >= ho) break;
|
|
2783
2783
|
if (Vt(s)) continue;
|
|
2784
2784
|
const a = s.getAttribute("href") || "";
|
|
2785
|
-
if (!
|
|
2785
|
+
if (!go(a)) continue;
|
|
2786
2786
|
let c = a, d = !0;
|
|
2787
2787
|
try {
|
|
2788
2788
|
if (typeof window < "u") {
|
|
@@ -2799,17 +2799,17 @@ function go(e) {
|
|
|
2799
2799
|
}
|
|
2800
2800
|
return l;
|
|
2801
2801
|
}
|
|
2802
|
-
let
|
|
2803
|
-
const
|
|
2802
|
+
let ut = null;
|
|
2803
|
+
const vo = 5e3;
|
|
2804
2804
|
function on() {
|
|
2805
2805
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2806
|
-
if (
|
|
2807
|
-
return
|
|
2808
|
-
const n =
|
|
2809
|
-
return
|
|
2806
|
+
if (ut && ut.pathname === t && e - ut.at < vo)
|
|
2807
|
+
return ut.routes;
|
|
2808
|
+
const n = yo();
|
|
2809
|
+
return ut = { at: e, pathname: t, routes: n }, n;
|
|
2810
2810
|
}
|
|
2811
|
-
function
|
|
2812
|
-
|
|
2811
|
+
function bo() {
|
|
2812
|
+
ut = null;
|
|
2813
2813
|
}
|
|
2814
2814
|
function cn(e) {
|
|
2815
2815
|
if (e instanceof HTMLInputElement) {
|
|
@@ -2819,7 +2819,7 @@ function cn(e) {
|
|
|
2819
2819
|
}
|
|
2820
2820
|
return !0;
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function wo(e, t) {
|
|
2823
2823
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2824
2824
|
}
|
|
2825
2825
|
function Oe(e) {
|
|
@@ -2829,7 +2829,7 @@ function ln(e) {
|
|
|
2829
2829
|
const t = e.lastIndexOf(".");
|
|
2830
2830
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function _o(e) {
|
|
2833
2833
|
var i;
|
|
2834
2834
|
const t = e.getAttribute("id");
|
|
2835
2835
|
if (t)
|
|
@@ -2843,7 +2843,7 @@ function wo(e) {
|
|
|
2843
2843
|
const n = e.closest("label");
|
|
2844
2844
|
return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
|
|
2845
2845
|
}
|
|
2846
|
-
function
|
|
2846
|
+
function xo(e, t) {
|
|
2847
2847
|
const n = Oe(t);
|
|
2848
2848
|
if (n.length < 2) return null;
|
|
2849
2849
|
let i = null, l = 0;
|
|
@@ -2861,12 +2861,12 @@ function _o(e, t) {
|
|
|
2861
2861
|
c.some((g) => g.length >= 2 && g === n) ? d = 4 : [
|
|
2862
2862
|
Oe(s),
|
|
2863
2863
|
Oe(ln(s)),
|
|
2864
|
-
Oe(
|
|
2864
|
+
Oe(_o(o))
|
|
2865
2865
|
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (d = 2), d > l && (l = d, i = o);
|
|
2866
2866
|
}
|
|
2867
2867
|
return l >= 2 ? i : null;
|
|
2868
2868
|
}
|
|
2869
|
-
function
|
|
2869
|
+
function Co(e, t) {
|
|
2870
2870
|
if (!t) return null;
|
|
2871
2871
|
try {
|
|
2872
2872
|
const o = e.querySelector(
|
|
@@ -2882,22 +2882,22 @@ function xo(e, t) {
|
|
|
2882
2882
|
const l = /* @__PURE__ */ new Map();
|
|
2883
2883
|
for (const o of n) {
|
|
2884
2884
|
if (!cn(o)) continue;
|
|
2885
|
-
const s =
|
|
2885
|
+
const s = wo(o, i);
|
|
2886
2886
|
let a = s;
|
|
2887
2887
|
if (l.has(s) && (a = `${s}__${i}`), a === t) return o;
|
|
2888
2888
|
l.set(s, o), i++;
|
|
2889
2889
|
}
|
|
2890
|
-
return
|
|
2890
|
+
return xo(e, t);
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2893
|
-
const n =
|
|
2892
|
+
function ir(e, t) {
|
|
2893
|
+
const n = Co(e, t);
|
|
2894
2894
|
return n ? sn(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2895
2895
|
}
|
|
2896
|
-
function
|
|
2896
|
+
function ko(e, t) {
|
|
2897
2897
|
const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), l = i == null ? void 0 : i.set;
|
|
2898
2898
|
l ? l.call(e, t) : e.value = t;
|
|
2899
2899
|
}
|
|
2900
|
-
function
|
|
2900
|
+
function Lo(e, t, n = {}) {
|
|
2901
2901
|
const i = n.triggerInput ?? !0, l = n.triggerChange ?? !0;
|
|
2902
2902
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2903
2903
|
const o = Object.getOwnPropertyDescriptor(
|
|
@@ -2907,9 +2907,9 @@ function ko(e, t, n = {}) {
|
|
|
2907
2907
|
s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2908
2908
|
return;
|
|
2909
2909
|
}
|
|
2910
|
-
|
|
2910
|
+
ko(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2911
2911
|
}
|
|
2912
|
-
function
|
|
2912
|
+
function or(e, t) {
|
|
2913
2913
|
if (!t) return null;
|
|
2914
2914
|
const n = t.replace(/"/g, '\\"'), i = (a) => a.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
|
|
2915
2915
|
try {
|
|
@@ -2932,7 +2932,7 @@ function ir(e, t) {
|
|
|
2932
2932
|
).filter((a) => !i(a));
|
|
2933
2933
|
for (const a of s) {
|
|
2934
2934
|
const c = a.getAttribute("data-ll-intent");
|
|
2935
|
-
if (c &&
|
|
2935
|
+
if (c && So(c) === t) return a;
|
|
2936
2936
|
}
|
|
2937
2937
|
if (/^form_\d+$/.test(t)) {
|
|
2938
2938
|
const a = parseInt(t.slice(5), 10);
|
|
@@ -2945,10 +2945,10 @@ function ir(e, t) {
|
|
|
2945
2945
|
}
|
|
2946
2946
|
return s.length === 1 ? s[0] : null;
|
|
2947
2947
|
}
|
|
2948
|
-
function
|
|
2948
|
+
function So(e) {
|
|
2949
2949
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2950
2950
|
}
|
|
2951
|
-
function
|
|
2951
|
+
function Eo() {
|
|
2952
2952
|
if (typeof window > "u" || typeof document > "u")
|
|
2953
2953
|
return !1;
|
|
2954
2954
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2956,19 +2956,19 @@ function So() {
|
|
|
2956
2956
|
const t = window.getComputedStyle(e);
|
|
2957
2957
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2958
2958
|
}
|
|
2959
|
-
function
|
|
2959
|
+
function Ao(e) {
|
|
2960
2960
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2961
2961
|
const n = window.getComputedStyle(e).overflowY;
|
|
2962
2962
|
return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2963
2963
|
}
|
|
2964
|
-
function
|
|
2964
|
+
function No() {
|
|
2965
2965
|
if (typeof document > "u") return null;
|
|
2966
2966
|
const e = Array.from(
|
|
2967
2967
|
document.querySelectorAll("body, body *")
|
|
2968
2968
|
);
|
|
2969
2969
|
let t = null, n = 0;
|
|
2970
2970
|
for (const i of e) {
|
|
2971
|
-
if (!
|
|
2971
|
+
if (!Ao(i)) continue;
|
|
2972
2972
|
const l = i.getBoundingClientRect();
|
|
2973
2973
|
if (l.bottom <= 0 || l.top >= window.innerHeight || l.right <= 0 || l.left >= window.innerWidth || l.width <= 0 || l.height <= 0 || i.closest(".ll-widget")) continue;
|
|
2974
2974
|
const o = l.width * l.height;
|
|
@@ -2976,24 +2976,24 @@ function Ao() {
|
|
|
2976
2976
|
}
|
|
2977
2977
|
return t;
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function Mo() {
|
|
2980
2980
|
if (typeof window > "u")
|
|
2981
2981
|
return null;
|
|
2982
|
-
if (
|
|
2983
|
-
const e =
|
|
2982
|
+
if (Eo()) return window;
|
|
2983
|
+
const e = No();
|
|
2984
2984
|
return e || window;
|
|
2985
2985
|
}
|
|
2986
|
-
function
|
|
2986
|
+
function lr(e) {
|
|
2987
2987
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2988
2988
|
}
|
|
2989
|
-
function
|
|
2989
|
+
function Io(e) {
|
|
2990
2990
|
var t, n;
|
|
2991
2991
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2992
2992
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2993
2993
|
((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
|
|
2994
2994
|
) : e.scrollHeight - e.clientHeight;
|
|
2995
2995
|
}
|
|
2996
|
-
const
|
|
2996
|
+
const To = /* @__PURE__ */ new Set([
|
|
2997
2997
|
"agent_state",
|
|
2998
2998
|
"avatar_stream_ready",
|
|
2999
2999
|
"avatar_active",
|
|
@@ -3028,9 +3028,9 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3028
3028
|
// to onAgentCommand.
|
|
3029
3029
|
"task_field_updated",
|
|
3030
3030
|
"task_completed"
|
|
3031
|
-
]),
|
|
3031
|
+
]), wr = un(
|
|
3032
3032
|
function(t, n) {
|
|
3033
|
-
var kn, Ln, Sn, En, An, Nn, Mn;
|
|
3033
|
+
var kn, Ln, Sn, En, An, Nn, Mn, In;
|
|
3034
3034
|
const {
|
|
3035
3035
|
agentId: i,
|
|
3036
3036
|
apiKey: l,
|
|
@@ -3080,10 +3080,10 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3080
3080
|
pathname: Le,
|
|
3081
3081
|
onNavigate: oe,
|
|
3082
3082
|
onScrollToSelector: Ie,
|
|
3083
|
-
getPageContext:
|
|
3083
|
+
getPageContext: ft,
|
|
3084
3084
|
pageContextExtras: kt,
|
|
3085
3085
|
getRoutes: Lt,
|
|
3086
|
-
onScrollPage:
|
|
3086
|
+
onScrollPage: pt,
|
|
3087
3087
|
onClick: St,
|
|
3088
3088
|
capabilities: Ke,
|
|
3089
3089
|
onConnect: Je,
|
|
@@ -3098,32 +3098,32 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3098
3098
|
className: Ve,
|
|
3099
3099
|
style: Qe,
|
|
3100
3100
|
zIndex: Se = 2147483647
|
|
3101
|
-
} = t, Et =
|
|
3101
|
+
} = t, Et = hi(Le), ht = _i(Et, ge, Q);
|
|
3102
3102
|
T(() => {
|
|
3103
|
-
|
|
3103
|
+
po(), bo();
|
|
3104
3104
|
}, [Et]);
|
|
3105
|
-
const Te = O !== void 0, [
|
|
3105
|
+
const Te = O !== void 0, [mt, At] = M(() => {
|
|
3106
3106
|
var h;
|
|
3107
3107
|
return O ?? ((h = b == null ? void 0 : b[0]) == null ? void 0 : h.id);
|
|
3108
|
-
}), Ye = Te ? O :
|
|
3108
|
+
}), Ye = Te ? O : mt, fe = dt(
|
|
3109
3109
|
() => (b == null ? void 0 : b.find((h) => h.id === Ye)) ?? null,
|
|
3110
3110
|
[b, Ye]
|
|
3111
|
-
), Nt = (fe == null ? void 0 : fe.agentId) ?? i, pe = d === "EMBEDDED", be =
|
|
3111
|
+
), Nt = (fe == null ? void 0 : fe.agentId) ?? i, pe = d === "EMBEDDED", be = li(L), [et, tt] = ii({
|
|
3112
3112
|
value: p,
|
|
3113
3113
|
defaultValue: m,
|
|
3114
3114
|
onChange: P,
|
|
3115
3115
|
persistKey: D,
|
|
3116
3116
|
disablePersistence: pe || E
|
|
3117
3117
|
}), me = pe ? "expanded" : et, we = pe ? () => {
|
|
3118
|
-
} : tt, Mt = U ?? !pe, It = K ?? !pe, Tt = ie || !pe && be, xe =
|
|
3118
|
+
} : tt, Mt = U ?? !pe, It = K ?? !pe, Tt = ie || !pe && be, xe = fi({
|
|
3119
3119
|
draggable: !pe && (y ?? !be),
|
|
3120
3120
|
resizable: !pe && (w ?? !be),
|
|
3121
3121
|
persistKey: D,
|
|
3122
3122
|
disablePersistence: pe || E
|
|
3123
|
-
}), Re =
|
|
3123
|
+
}), Re = Vr(), Ne = Kr(), De = Jr(), gt = Zr(), [Pe, Ee] = M(!1), [nt, yt] = M(!1), [vt, rt] = M(!1), [C, se] = M(!1), [Yt, _r] = M(!1), Rt = Ci({ baseUrl: o, config: c }), Dt = R(Rt);
|
|
3124
3124
|
Dt.current = Rt;
|
|
3125
|
-
const Gt = R(oe), Xt = R(Ie), Kt = R(
|
|
3126
|
-
Gt.current = oe, Xt.current = Ie, Kt.current =
|
|
3125
|
+
const Gt = R(oe), Xt = R(Ie), Kt = R(pt), Jt = R(St), hn = R(ft), mn = R(kt), gn = R(Lt), Zt = R(Ke), Ae = R(null);
|
|
3126
|
+
Gt.current = oe, Xt.current = Ie, Kt.current = pt, Jt.current = St, hn.current = ft, mn.current = kt, gn.current = Lt, Zt.current = Ke;
|
|
3127
3127
|
function Ce(h) {
|
|
3128
3128
|
const u = Zt.current;
|
|
3129
3129
|
return u ? u.includes(h) : !0;
|
|
@@ -3133,9 +3133,9 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3133
3133
|
`[LiveLayer] Agent command "${h}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
3134
3134
|
);
|
|
3135
3135
|
}
|
|
3136
|
-
const
|
|
3136
|
+
const bt = k(
|
|
3137
3137
|
(h) => {
|
|
3138
|
-
var ee, he, Me, wt, ze,
|
|
3138
|
+
var ee, he, Me, wt, ze, Tn, Rn;
|
|
3139
3139
|
const u = h;
|
|
3140
3140
|
if (!(!u.type || typeof u.type != "string")) {
|
|
3141
3141
|
if (Ue == null || Ue({ eventName: u.type, data: h }), u.type === "navigate") {
|
|
@@ -3248,7 +3248,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3248
3248
|
q
|
|
3249
3249
|
), Y({
|
|
3250
3250
|
type: "page_context",
|
|
3251
|
-
context:
|
|
3251
|
+
context: rr(V)
|
|
3252
3252
|
});
|
|
3253
3253
|
});
|
|
3254
3254
|
return;
|
|
@@ -3258,7 +3258,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3258
3258
|
}
|
|
3259
3259
|
Y({
|
|
3260
3260
|
type: "page_context",
|
|
3261
|
-
context:
|
|
3261
|
+
context: rr(V)
|
|
3262
3262
|
});
|
|
3263
3263
|
} catch (ne) {
|
|
3264
3264
|
console.warn(
|
|
@@ -3296,12 +3296,12 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3296
3296
|
return;
|
|
3297
3297
|
}
|
|
3298
3298
|
if (typeof window > "u") return;
|
|
3299
|
-
const Y = { behavior: I }, V =
|
|
3299
|
+
const Y = { behavior: I }, V = Mo(), te = (q) => {
|
|
3300
3300
|
V instanceof Window ? V.scrollBy({ top: q, ...Y }) : V.scrollBy({ top: q, ...Y });
|
|
3301
3301
|
}, ne = (q) => {
|
|
3302
3302
|
V instanceof Window ? V.scrollTo({ top: q, ...Y }) : V.scrollTo({ top: q, ...Y });
|
|
3303
3303
|
};
|
|
3304
|
-
A === "up" ? te(-
|
|
3304
|
+
A === "up" ? te(-lr(V)) : A === "down" ? te(lr(V)) : ne(A === "top" ? 0 : Io(V));
|
|
3305
3305
|
return;
|
|
3306
3306
|
}
|
|
3307
3307
|
if (u.type === "click") {
|
|
@@ -3354,8 +3354,8 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3354
3354
|
}
|
|
3355
3355
|
if (typeof document > "u") return;
|
|
3356
3356
|
const A = u.type === "advance_step" ? "ll-advance" : u.type === "go_back" ? "ll-back" : "ll-submit";
|
|
3357
|
-
let I =
|
|
3358
|
-
if (I || (
|
|
3357
|
+
let I = Zn(A);
|
|
3358
|
+
if (I || (vr(document), I = Zn(A)), !I) {
|
|
3359
3359
|
console.warn(`[LiveLayer] ${u.type}: no "${A}" control found.`);
|
|
3360
3360
|
return;
|
|
3361
3361
|
}
|
|
@@ -3374,7 +3374,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3374
3374
|
console.warn(`[LiveLayer] ${u.type}: missing formId.`);
|
|
3375
3375
|
return;
|
|
3376
3376
|
}
|
|
3377
|
-
const I =
|
|
3377
|
+
const I = or(document, A);
|
|
3378
3378
|
if (!I) {
|
|
3379
3379
|
console.warn(
|
|
3380
3380
|
`[LiveLayer] ${u.type}: no <form> matched id="${A}" (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.`
|
|
@@ -3393,7 +3393,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3393
3393
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3394
3394
|
return;
|
|
3395
3395
|
}
|
|
3396
|
-
const te =
|
|
3396
|
+
const te = ir(I, V);
|
|
3397
3397
|
if (te.el === null) {
|
|
3398
3398
|
te.reason === "private" ? console.warn(
|
|
3399
3399
|
`[LiveLayer] focus_field: field "${V}" is privacy-protected and not focusable.`
|
|
@@ -3412,7 +3412,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3412
3412
|
}
|
|
3413
3413
|
for (const [V, te] of Object.entries(Y)) {
|
|
3414
3414
|
if (typeof te != "string") continue;
|
|
3415
|
-
const ne =
|
|
3415
|
+
const ne = ir(I, V);
|
|
3416
3416
|
if (ne.el === null) {
|
|
3417
3417
|
ne.reason === "private" ? console.warn(
|
|
3418
3418
|
`[LiveLayer] fill_form: field "${V}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
@@ -3422,7 +3422,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3422
3422
|
continue;
|
|
3423
3423
|
}
|
|
3424
3424
|
try {
|
|
3425
|
-
|
|
3425
|
+
Lo(ne.el, te);
|
|
3426
3426
|
} catch (q) {
|
|
3427
3427
|
console.warn(
|
|
3428
3428
|
`[LiveLayer] fill_form: failed to set "${V}".`,
|
|
@@ -3444,7 +3444,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3444
3444
|
return;
|
|
3445
3445
|
}
|
|
3446
3446
|
Dt.current.playConfirmation();
|
|
3447
|
-
const I =
|
|
3447
|
+
const I = or(document, A);
|
|
3448
3448
|
if (!I) {
|
|
3449
3449
|
console.warn(
|
|
3450
3450
|
`[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
|
|
@@ -3466,15 +3466,15 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3466
3466
|
} catch {
|
|
3467
3467
|
}
|
|
3468
3468
|
}, ne = (G) => {
|
|
3469
|
-
var Ge, Ft,
|
|
3469
|
+
var Ge, Ft, zn, $n;
|
|
3470
3470
|
const J = G, ue = (Ge = J.getAttribute) == null ? void 0 : Ge.call(J, "aria-label");
|
|
3471
3471
|
if (ue) return ue;
|
|
3472
3472
|
const He = J.id;
|
|
3473
3473
|
if (He) {
|
|
3474
3474
|
const Bt = (Ft = I.ownerDocument) == null ? void 0 : Ft.querySelector(`label[for="${He}"]`);
|
|
3475
|
-
if ((
|
|
3475
|
+
if ((zn = Bt == null ? void 0 : Bt.textContent) != null && zn.trim()) return Bt.textContent.trim();
|
|
3476
3476
|
}
|
|
3477
|
-
return ((
|
|
3477
|
+
return (($n = J.getAttribute) == null ? void 0 : $n.call(J, "name")) || J.id || J.type || "field";
|
|
3478
3478
|
}, q = () => {
|
|
3479
3479
|
try {
|
|
3480
3480
|
return Array.from(I.elements).filter(
|
|
@@ -3512,11 +3512,11 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3512
3512
|
return ((ue = G.tagName) == null ? void 0 : ue.toLowerCase()) === "input" && (J.type === "checkbox" || J.type === "radio") ? J.checked ? "on" : "" : (J.value || "").trim();
|
|
3513
3513
|
}, Ht = Array.from(I.elements).filter(
|
|
3514
3514
|
(G) => ye(G) && ve(G).length > 0
|
|
3515
|
-
),
|
|
3516
|
-
let
|
|
3515
|
+
), Dn = /(thank you|thanks|we'?ll be in touch|message sent|message has been sent|successfully|submission received|got your message|we received|talk soon|be in touch)/i, Pr = (((Tn = I.parentElement) == null ? void 0 : Tn.textContent) || "").toLowerCase();
|
|
3516
|
+
let Pn = !1, Ot = !1;
|
|
3517
3517
|
const $e = (G) => {
|
|
3518
3518
|
Ot || (Ot = !0, te(G));
|
|
3519
|
-
},
|
|
3519
|
+
}, zr = () => {
|
|
3520
3520
|
const G = Date.now(), J = () => {
|
|
3521
3521
|
var Ge;
|
|
3522
3522
|
if (Ot) return;
|
|
@@ -3534,7 +3534,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3534
3534
|
return;
|
|
3535
3535
|
}
|
|
3536
3536
|
const He = (((Ge = I.parentElement) == null ? void 0 : Ge.textContent) || "").toLowerCase();
|
|
3537
|
-
if (
|
|
3537
|
+
if (Dn.test(He) && !Dn.test(Pr)) {
|
|
3538
3538
|
$e({ type: "form_submitted", formId: A, reason: "success_text" });
|
|
3539
3539
|
return;
|
|
3540
3540
|
}
|
|
@@ -3542,8 +3542,8 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3542
3542
|
};
|
|
3543
3543
|
setTimeout(J, 200);
|
|
3544
3544
|
}, en = (G) => {
|
|
3545
|
-
|
|
3546
|
-
G.defaultPrevented ?
|
|
3545
|
+
Pn = !0, queueMicrotask(() => {
|
|
3546
|
+
G.defaultPrevented ? zr() : $e({ type: "form_submitted", formId: A });
|
|
3547
3547
|
});
|
|
3548
3548
|
};
|
|
3549
3549
|
I.addEventListener("submit", en, { once: !0 });
|
|
@@ -3554,7 +3554,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3554
3554
|
return;
|
|
3555
3555
|
}
|
|
3556
3556
|
setTimeout(() => {
|
|
3557
|
-
!
|
|
3557
|
+
!Pn && !Ot && (I.removeEventListener("submit", en), $e({
|
|
3558
3558
|
type: "form_submit_blocked",
|
|
3559
3559
|
formId: A,
|
|
3560
3560
|
reason: "validation",
|
|
@@ -3568,7 +3568,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3568
3568
|
ke("request_routes", "read_page");
|
|
3569
3569
|
return;
|
|
3570
3570
|
}
|
|
3571
|
-
const A = typeof u.requestId == "string" ? u.requestId : void 0, Y = (
|
|
3571
|
+
const A = typeof u.requestId == "string" ? u.requestId : void 0, Y = (Rn = Ae.current) == null ? void 0 : Rn.call(Ae), V = Y == null ? void 0 : Y.localParticipant;
|
|
3572
3572
|
if (!(V != null && V.publishData)) return;
|
|
3573
3573
|
const te = (q) => {
|
|
3574
3574
|
try {
|
|
@@ -3585,7 +3585,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3585
3585
|
te([]);
|
|
3586
3586
|
return;
|
|
3587
3587
|
}
|
|
3588
|
-
te(ve.map(
|
|
3588
|
+
te(ve.map(mo).slice(0, 200));
|
|
3589
3589
|
};
|
|
3590
3590
|
q instanceof Promise ? q.then(ye).catch((ve) => {
|
|
3591
3591
|
console.warn(
|
|
@@ -3662,22 +3662,22 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3662
3662
|
}
|
|
3663
3663
|
return;
|
|
3664
3664
|
}
|
|
3665
|
-
|
|
3665
|
+
To.has(u.type) || Ze == null || Ze(u);
|
|
3666
3666
|
}
|
|
3667
3667
|
},
|
|
3668
3668
|
[Ze, Ue, je]
|
|
3669
|
-
), ce =
|
|
3669
|
+
), ce = jr({
|
|
3670
3670
|
agentId: F ? "__controlled__" : Nt,
|
|
3671
3671
|
baseUrl: o,
|
|
3672
3672
|
apiKey: l,
|
|
3673
3673
|
sessionEndpoint: s,
|
|
3674
3674
|
sessionBody: a,
|
|
3675
|
-
onDataMessage: F ? void 0 :
|
|
3675
|
+
onDataMessage: F ? void 0 : bt
|
|
3676
3676
|
});
|
|
3677
3677
|
T(() => {
|
|
3678
3678
|
if (F != null && F.subscribeToDataMessages)
|
|
3679
|
-
return F.subscribeToDataMessages(
|
|
3680
|
-
}, [F,
|
|
3679
|
+
return F.subscribeToDataMessages(bt);
|
|
3680
|
+
}, [F, bt]), Ae.current = () => {
|
|
3681
3681
|
var h;
|
|
3682
3682
|
return (h = ce.getRoom) == null ? void 0 : h.call(ce);
|
|
3683
3683
|
}, T(() => {
|
|
@@ -3687,15 +3687,15 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3687
3687
|
if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
|
|
3688
3688
|
return window.__livelayerSimulateCommand = (he) => {
|
|
3689
3689
|
try {
|
|
3690
|
-
|
|
3690
|
+
bt(he);
|
|
3691
3691
|
} catch (Me) {
|
|
3692
3692
|
console.warn("[LiveLayer] simulate-command threw:", Me);
|
|
3693
3693
|
}
|
|
3694
3694
|
}, () => {
|
|
3695
3695
|
delete window.__livelayerSimulateCommand;
|
|
3696
3696
|
};
|
|
3697
|
-
}, [
|
|
3698
|
-
const _ =
|
|
3697
|
+
}, [bt]);
|
|
3698
|
+
const _ = dt(() => F ? {
|
|
3699
3699
|
connectionState: F.connectionState,
|
|
3700
3700
|
agentState: F.agentState,
|
|
3701
3701
|
transcript: F.transcript,
|
|
@@ -3729,7 +3729,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3729
3729
|
}, [F, ce]), yn = R(_);
|
|
3730
3730
|
yn.current = _;
|
|
3731
3731
|
const vn = R(F);
|
|
3732
|
-
vn.current = F,
|
|
3732
|
+
vn.current = F, Hr(
|
|
3733
3733
|
n,
|
|
3734
3734
|
() => ({
|
|
3735
3735
|
sendData: async (h) => {
|
|
@@ -3807,7 +3807,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3807
3807
|
zt.current.clear();
|
|
3808
3808
|
}
|
|
3809
3809
|
}, [_.connectionState]);
|
|
3810
|
-
const _e =
|
|
3810
|
+
const _e = Gr({
|
|
3811
3811
|
gateUntilAgentReady: !0,
|
|
3812
3812
|
agentState: _.agentState
|
|
3813
3813
|
});
|
|
@@ -3827,14 +3827,14 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3827
3827
|
if (_.connectionState !== "connected") return;
|
|
3828
3828
|
const h = _.isControlled ? (u = F == null ? void 0 : F.getRoom) == null ? void 0 : u.call(F) : _.getRoom();
|
|
3829
3829
|
if (h)
|
|
3830
|
-
return Ne.attachRoom(h), De.attachRoom(h), _.isControlled && _e.attachRoom(h),
|
|
3830
|
+
return Ne.attachRoom(h), De.attachRoom(h), _.isControlled && _e.attachRoom(h), gt.refresh(), () => {
|
|
3831
3831
|
Ne.teardown(), De.teardown();
|
|
3832
3832
|
};
|
|
3833
3833
|
}, [_.isControlled, _.connectionState, F]), T(() => {
|
|
3834
3834
|
const h = _.audioElement;
|
|
3835
3835
|
h && (h.muted = Yt);
|
|
3836
3836
|
}, [_.audioElement, Yt]);
|
|
3837
|
-
const
|
|
3837
|
+
const xr = k((h) => {
|
|
3838
3838
|
const u = { type: "user_message", text: h };
|
|
3839
3839
|
if (F != null && F.publishData) {
|
|
3840
3840
|
try {
|
|
@@ -3850,8 +3850,8 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3850
3850
|
ee.localParticipant.publishData(he, { reliable: !0 });
|
|
3851
3851
|
} catch {
|
|
3852
3852
|
}
|
|
3853
|
-
}, [_, F]),
|
|
3854
|
-
|
|
3853
|
+
}, [_, F]), Cr = k(() => {
|
|
3854
|
+
_r((h) => !h);
|
|
3855
3855
|
}, []);
|
|
3856
3856
|
T(() => {
|
|
3857
3857
|
qe == null || qe(_.connectionState), _.connectionState === "connected" ? Je == null || Je() : _.connectionState === "disconnected" && (Fe == null || Fe());
|
|
@@ -3864,12 +3864,12 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3864
3864
|
}, [_.agentState, Rt]);
|
|
3865
3865
|
const wn = R(!1);
|
|
3866
3866
|
T(() => {
|
|
3867
|
-
!g || wn.current ||
|
|
3868
|
-
}, [g, _.connectionState, _,
|
|
3869
|
-
const
|
|
3867
|
+
!g || wn.current || ht && _.connectionState === "idle" && (wn.current = !0, _.connect());
|
|
3868
|
+
}, [g, _.connectionState, _, ht]);
|
|
3869
|
+
const kr = k(
|
|
3870
3870
|
(h) => {
|
|
3871
3871
|
const u = b == null ? void 0 : b.find((ee) => ee.id === h);
|
|
3872
|
-
u && (rt(!1), h !== Ye && (
|
|
3872
|
+
u && (rt(!1), h !== Ye && (yt(!0), _.disconnect(), Te || At(h), v == null || v(u)));
|
|
3873
3873
|
},
|
|
3874
3874
|
[
|
|
3875
3875
|
b,
|
|
@@ -3880,36 +3880,36 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3880
3880
|
]
|
|
3881
3881
|
);
|
|
3882
3882
|
T(() => {
|
|
3883
|
-
nt && _.connectionState === "connected" &&
|
|
3883
|
+
nt && _.connectionState === "connected" && yt(!1);
|
|
3884
3884
|
}, [_.connectionState, nt]), T(() => {
|
|
3885
|
-
if (!
|
|
3885
|
+
if (!vt) return;
|
|
3886
3886
|
const h = (u) => {
|
|
3887
3887
|
u.key === "Escape" && rt(!1);
|
|
3888
3888
|
};
|
|
3889
3889
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
3890
|
-
}, [
|
|
3891
|
-
const
|
|
3892
|
-
Ke === void 0 && ((kn =
|
|
3893
|
-
const $t = (fe == null ? void 0 : fe.name) ?? ae ?? ((Ln = _.agentConfig) == null ? void 0 : Ln.name) ?? ((Sn =
|
|
3890
|
+
}, [vt]);
|
|
3891
|
+
const Lr = !!Z || !!(fe != null && fe.avatarImageUrl) || _.isControlled, ot = Qr(Nt, o, Lr);
|
|
3892
|
+
Ke === void 0 && ((kn = ot.info) != null && kn.capabilities) && (Zt.current = ot.info.capabilities);
|
|
3893
|
+
const $t = (fe == null ? void 0 : fe.name) ?? ae ?? ((Ln = _.agentConfig) == null ? void 0 : Ln.name) ?? ((Sn = ot.info) == null ? void 0 : Sn.name) ?? "Live Layer", Qt = (fe == null ? void 0 : fe.avatarImageUrl) ?? Z ?? ((En = _.agentConfig) == null ? void 0 : En.avatarImageUrl) ?? ((An = ot.info) == null ? void 0 : An.avatarImageUrl) ?? null, Sr = z ?? ((Nn = _.agentConfig) == null ? void 0 : Nn.idleLoopUrl) ?? ((Mn = ot.info) == null ? void 0 : Mn.idleLoopUrl) ?? null, Er = B ?? null, Ar = k(() => we("expanded"), [we]), Nr = k(
|
|
3894
3894
|
() => we("minimized"),
|
|
3895
3895
|
[we]
|
|
3896
3896
|
), _n = k(() => {
|
|
3897
3897
|
_.disconnect(), we("hidden");
|
|
3898
|
-
}, [_, we]),
|
|
3898
|
+
}, [_, we]), Mr = k(() => {
|
|
3899
3899
|
const h = _.audioElement;
|
|
3900
3900
|
h && h.play().then(() => Ee(!1)).catch(() => {
|
|
3901
3901
|
});
|
|
3902
|
-
}, [_.audioElement]),
|
|
3902
|
+
}, [_.audioElement]), Ir = k(() => {
|
|
3903
3903
|
Ee(!1), _.connect();
|
|
3904
|
-
}, [_]),
|
|
3904
|
+
}, [_]), lt = {
|
|
3905
3905
|
...Qe,
|
|
3906
3906
|
...pe ? {} : { zIndex: Se }
|
|
3907
3907
|
};
|
|
3908
|
-
H.primaryColor && (
|
|
3909
|
-
const
|
|
3910
|
-
...
|
|
3908
|
+
H.primaryColor && (lt["--ll-color-primary"] = H.primaryColor), H.accentColor && (lt["--ll-color-accent"] = H.accentColor), H.backgroundColor && (lt["--ll-color-bg"] = H.backgroundColor), H.textColor && (lt["--ll-color-fg"] = H.textColor);
|
|
3909
|
+
const Tr = {
|
|
3910
|
+
...lt,
|
|
3911
3911
|
...xe.style
|
|
3912
|
-
},
|
|
3912
|
+
}, Rr = [
|
|
3913
3913
|
"ll-widget",
|
|
3914
3914
|
`ll-widget--${me}`,
|
|
3915
3915
|
`ll-widget--${be ? "mobile" : "desktop"}`,
|
|
@@ -3918,40 +3918,43 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3918
3918
|
xe.isResizing ? "is-resizing" : null,
|
|
3919
3919
|
Ve
|
|
3920
3920
|
].filter(Boolean).join(" ");
|
|
3921
|
-
if (!
|
|
3922
|
-
const
|
|
3921
|
+
if (!ht) return null;
|
|
3922
|
+
const Dr = /* @__PURE__ */ r(
|
|
3923
3923
|
"div",
|
|
3924
3924
|
{
|
|
3925
|
-
className:
|
|
3926
|
-
style:
|
|
3925
|
+
className: Rr,
|
|
3926
|
+
style: Tr,
|
|
3927
3927
|
"data-display-mode": me,
|
|
3928
3928
|
"data-position": x,
|
|
3929
3929
|
"data-experience-mode": d === "EMBEDDED" ? "embedded" : "widget",
|
|
3930
3930
|
children: me === "expanded" && /* @__PURE__ */ r(
|
|
3931
|
-
|
|
3931
|
+
Fi,
|
|
3932
3932
|
{
|
|
3933
3933
|
position: x,
|
|
3934
3934
|
isMobile: be,
|
|
3935
3935
|
agentName: $t,
|
|
3936
3936
|
avatarImageUrl: Qt,
|
|
3937
|
-
idleLoopUrl:
|
|
3938
|
-
greeting:
|
|
3939
|
-
branding:
|
|
3937
|
+
idleLoopUrl: Sr,
|
|
3938
|
+
greeting: Er,
|
|
3939
|
+
branding: {
|
|
3940
|
+
...H,
|
|
3941
|
+
hideBranding: H.hideBranding ?? ((In = ot.info) == null ? void 0 : In.hideBranding)
|
|
3942
|
+
},
|
|
3940
3943
|
teamMembers: b,
|
|
3941
3944
|
currentTeamMemberId: Ye,
|
|
3942
3945
|
isSwitchingTeamMember: nt,
|
|
3943
|
-
teamSwitcherOpen:
|
|
3946
|
+
teamSwitcherOpen: vt,
|
|
3944
3947
|
onToggleTeamSwitcher: () => rt((h) => !h),
|
|
3945
|
-
onSelectTeamMember:
|
|
3948
|
+
onSelectTeamMember: kr,
|
|
3946
3949
|
connectionState: _.connectionState,
|
|
3947
3950
|
agentState: _.agentState,
|
|
3948
3951
|
transcript: _.transcript,
|
|
3949
3952
|
isMuted: _e.isMuted,
|
|
3950
|
-
micDevices:
|
|
3953
|
+
micDevices: gt.mics,
|
|
3951
3954
|
activeMicId: _e.activeDeviceId,
|
|
3952
3955
|
isCameraEnabled: Ne.isEnabled,
|
|
3953
3956
|
cameraPreviewEl: Ne.previewEl,
|
|
3954
|
-
cameraDevices:
|
|
3957
|
+
cameraDevices: gt.cameras,
|
|
3955
3958
|
activeCameraId: Ne.activeDeviceId,
|
|
3956
3959
|
isScreenShareEnabled: De.isEnabled,
|
|
3957
3960
|
screenPreviewEl: De.previewEl,
|
|
@@ -3982,16 +3985,16 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
3982
3985
|
});
|
|
3983
3986
|
},
|
|
3984
3987
|
onDisconnect: () => _.disconnect(),
|
|
3985
|
-
onRetry:
|
|
3986
|
-
onResumeAudio:
|
|
3988
|
+
onRetry: Ir,
|
|
3989
|
+
onResumeAudio: Mr,
|
|
3987
3990
|
onToggleMute: _e.toggleMute,
|
|
3988
3991
|
onSwitchMicDevice: (h) => void _e.switchDevice(h),
|
|
3989
3992
|
onToggleCamera: () => void Ne.toggle(),
|
|
3990
3993
|
onSwitchCameraDevice: (h) => void Ne.switchDevice(h),
|
|
3991
3994
|
onToggleScreenShare: () => void De.toggle(),
|
|
3992
|
-
onToggleSpeaker:
|
|
3993
|
-
onSendMessage:
|
|
3994
|
-
onMinimize:
|
|
3995
|
+
onToggleSpeaker: Cr,
|
|
3996
|
+
onSendMessage: xr,
|
|
3997
|
+
onMinimize: Nr,
|
|
3995
3998
|
onClose: _n,
|
|
3996
3999
|
onClearMicError: _e.clearError,
|
|
3997
4000
|
dragHandleProps: xe.dragHandleProps,
|
|
@@ -4008,12 +4011,12 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
4008
4011
|
`ll-widget--${me}`,
|
|
4009
4012
|
`ll-widget--${be ? "mobile" : "desktop"}`
|
|
4010
4013
|
].join(" "),
|
|
4011
|
-
style:
|
|
4014
|
+
style: lt,
|
|
4012
4015
|
"data-display-mode": me,
|
|
4013
4016
|
"data-position": x,
|
|
4014
4017
|
children: [
|
|
4015
4018
|
me === "hidden" && /* @__PURE__ */ r(
|
|
4016
|
-
|
|
4019
|
+
Ni,
|
|
4017
4020
|
{
|
|
4018
4021
|
position: x,
|
|
4019
4022
|
isMobile: be,
|
|
@@ -4026,7 +4029,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
4026
4029
|
}
|
|
4027
4030
|
),
|
|
4028
4031
|
me === "minimized" && /* @__PURE__ */ r(
|
|
4029
|
-
|
|
4032
|
+
Ii,
|
|
4030
4033
|
{
|
|
4031
4034
|
position: x,
|
|
4032
4035
|
isMobile: be,
|
|
@@ -4035,7 +4038,7 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
4035
4038
|
agentState: _.agentState,
|
|
4036
4039
|
isMuted: _e.isMuted,
|
|
4037
4040
|
audioLevel: Re,
|
|
4038
|
-
onExpand:
|
|
4041
|
+
onExpand: Ar,
|
|
4039
4042
|
onToggleMute: _e.toggleMute,
|
|
4040
4043
|
onClose: _n
|
|
4041
4044
|
}
|
|
@@ -4044,19 +4047,19 @@ const Io = /* @__PURE__ */ new Set([
|
|
|
4044
4047
|
}
|
|
4045
4048
|
) : null, Cn = W ?? (typeof document < "u" ? document.body : null);
|
|
4046
4049
|
return /* @__PURE__ */ S(Xe, { children: [
|
|
4047
|
-
|
|
4050
|
+
Dr,
|
|
4048
4051
|
xn && Cn && dn(xn, Cn)
|
|
4049
4052
|
] });
|
|
4050
4053
|
}
|
|
4051
4054
|
);
|
|
4052
|
-
|
|
4053
|
-
const
|
|
4055
|
+
wr.displayName = "AvatarWidgetInner";
|
|
4056
|
+
const Ro = un(
|
|
4054
4057
|
function(t, n) {
|
|
4055
|
-
return /* @__PURE__ */ r(
|
|
4058
|
+
return /* @__PURE__ */ r(Ur, { children: /* @__PURE__ */ r(wr, { ...t, ref: n }) });
|
|
4056
4059
|
}
|
|
4057
4060
|
);
|
|
4058
|
-
|
|
4059
|
-
const
|
|
4061
|
+
Ro.displayName = "AvatarWidget";
|
|
4062
|
+
const Uo = ({
|
|
4060
4063
|
agentId: e,
|
|
4061
4064
|
baseUrl: t,
|
|
4062
4065
|
apiKey: n,
|
|
@@ -4082,9 +4085,9 @@ const qo = ({
|
|
|
4082
4085
|
}, [e]), T(() => {
|
|
4083
4086
|
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
4084
4087
|
}, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
|
|
4085
|
-
},
|
|
4088
|
+
}, jo = un(
|
|
4086
4089
|
function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
|
|
4087
|
-
return
|
|
4090
|
+
return Or(
|
|
4088
4091
|
i,
|
|
4089
4092
|
{
|
|
4090
4093
|
ref: a,
|
|
@@ -4097,7 +4100,7 @@ const qo = ({
|
|
|
4097
4100
|
);
|
|
4098
4101
|
}
|
|
4099
4102
|
);
|
|
4100
|
-
function
|
|
4103
|
+
function Vo(e = {}) {
|
|
4101
4104
|
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, d] = M(null), g = R(t), p = R(n), m = R(i);
|
|
4102
4105
|
T(() => {
|
|
4103
4106
|
g.current = t, p.current = n, m.current = i;
|
|
@@ -4140,8 +4143,8 @@ function jo(e = {}) {
|
|
|
4140
4143
|
return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
|
|
4141
4144
|
}, []), { fields: l, isCollecting: s, lastResult: c, reset: P };
|
|
4142
4145
|
}
|
|
4143
|
-
let
|
|
4144
|
-
function
|
|
4146
|
+
let ar = 1;
|
|
4147
|
+
function Yo({
|
|
4145
4148
|
onMount: e,
|
|
4146
4149
|
defaultOpen: t = !1,
|
|
4147
4150
|
storageKey: n = "ll-debug-open"
|
|
@@ -4177,7 +4180,7 @@ function Vo({
|
|
|
4177
4180
|
if (T(() => {
|
|
4178
4181
|
!e || x.current || (x.current = !0, e((y) => {
|
|
4179
4182
|
m.current.push({
|
|
4180
|
-
id:
|
|
4183
|
+
id: ar++,
|
|
4181
4184
|
ts: Date.now(),
|
|
4182
4185
|
kind: "event",
|
|
4183
4186
|
type: y.eventName,
|
|
@@ -4189,11 +4192,11 @@ function Vo({
|
|
|
4189
4192
|
try {
|
|
4190
4193
|
const v = typeof O[0] == "string" ? O[0] : "";
|
|
4191
4194
|
v.startsWith("[LiveLayer]") && m.current.push({
|
|
4192
|
-
id:
|
|
4195
|
+
id: ar++,
|
|
4193
4196
|
ts: Date.now(),
|
|
4194
4197
|
kind: E,
|
|
4195
4198
|
type: v.slice(0, 120),
|
|
4196
|
-
data: { args: O.slice(1).map((z) =>
|
|
4199
|
+
data: { args: O.slice(1).map((z) => Po(z)) }
|
|
4197
4200
|
});
|
|
4198
4201
|
} catch {
|
|
4199
4202
|
}
|
|
@@ -4369,7 +4372,7 @@ function Vo({
|
|
|
4369
4372
|
]
|
|
4370
4373
|
}
|
|
4371
4374
|
) : L.map((y) => /* @__PURE__ */ r(
|
|
4372
|
-
|
|
4375
|
+
Do,
|
|
4373
4376
|
{
|
|
4374
4377
|
entry: y,
|
|
4375
4378
|
expanded: p.current.has(y.id),
|
|
@@ -4385,7 +4388,7 @@ function Vo({
|
|
|
4385
4388
|
}
|
|
4386
4389
|
);
|
|
4387
4390
|
}
|
|
4388
|
-
function
|
|
4391
|
+
function Do({
|
|
4389
4392
|
entry: e,
|
|
4390
4393
|
expanded: t,
|
|
4391
4394
|
onToggle: n
|
|
@@ -4466,21 +4469,21 @@ function an(e) {
|
|
|
4466
4469
|
cursor: "pointer"
|
|
4467
4470
|
};
|
|
4468
4471
|
}
|
|
4469
|
-
function
|
|
4472
|
+
function Po(e) {
|
|
4470
4473
|
try {
|
|
4471
4474
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
4472
4475
|
} catch {
|
|
4473
4476
|
return String(e);
|
|
4474
4477
|
}
|
|
4475
4478
|
}
|
|
4476
|
-
function
|
|
4479
|
+
function zo(e) {
|
|
4477
4480
|
const t = JSON.stringify(e);
|
|
4478
|
-
T(() =>
|
|
4481
|
+
T(() => Br(e), [t]);
|
|
4479
4482
|
}
|
|
4480
|
-
function
|
|
4481
|
-
return
|
|
4483
|
+
function Go({ fields: e, children: t }) {
|
|
4484
|
+
return zo(e), /* @__PURE__ */ r(Xe, { children: t });
|
|
4482
4485
|
}
|
|
4483
|
-
function
|
|
4486
|
+
function Xo() {
|
|
4484
4487
|
const [e, t] = M([]), n = k((l) => {
|
|
4485
4488
|
t((o) => {
|
|
4486
4489
|
const s = o.findIndex((a) => a.id === l.id);
|
|
@@ -4499,38 +4502,38 @@ function Go() {
|
|
|
4499
4502
|
};
|
|
4500
4503
|
}
|
|
4501
4504
|
export {
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4505
|
+
Ro as AvatarWidget,
|
|
4506
|
+
Ur as ErrorBoundary,
|
|
4507
|
+
Go as FieldProvider,
|
|
4508
|
+
Yo as LiveLayerDebugPanel,
|
|
4509
|
+
jo as LiveLayerRegion,
|
|
4510
|
+
Uo as LiveLayerWidget,
|
|
4511
|
+
Zo as clearFieldRegistry,
|
|
4512
|
+
po as clearPageContextCache,
|
|
4513
|
+
bo as clearRoutesCache,
|
|
4514
|
+
uo as extractPageContext,
|
|
4515
|
+
yo as extractRoutes,
|
|
4516
|
+
rr as getCachedPageContext,
|
|
4514
4517
|
on as getCachedRoutes,
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4518
|
+
Qo as getRegisteredFields,
|
|
4519
|
+
bi as matchesPattern,
|
|
4520
|
+
mo as normalizeRouteInput,
|
|
4521
|
+
el as registerFields,
|
|
4522
|
+
tl as setFieldValue,
|
|
4523
|
+
wi as shouldRenderAtPath,
|
|
4524
|
+
Qr as useAgentInfo,
|
|
4525
|
+
Vr as useAudioLevel,
|
|
4526
|
+
Kr as useCameraState,
|
|
4527
|
+
Vo as useCollect,
|
|
4528
|
+
ti as useDisplayMode,
|
|
4529
|
+
ii as useDisplayModePersistence,
|
|
4530
|
+
li as useIsMobile,
|
|
4531
|
+
jr as useLiveKitSession,
|
|
4532
|
+
Zr as useMediaDevices,
|
|
4533
|
+
Gr as useMicrophoneState,
|
|
4534
|
+
hi as usePathname,
|
|
4535
|
+
zo as useRegisterFields,
|
|
4536
|
+
_i as useRouteMatch,
|
|
4537
|
+
Jr as useScreenShareState,
|
|
4538
|
+
Xo as useTranscript
|
|
4536
4539
|
};
|