@livelayer/react 0.21.4 → 0.22.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 +27 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +1276 -1151
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as k, jsx as r, Fragment as We } from "react/jsx-runtime";
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
3
|
+
import { Component as br, useState as M, useRef as I, useEffect as R, useCallback as C, useMemo as rt, useLayoutEffect as Wn, forwardRef as Zt, useImperativeHandle as wr, createElement as _r } from "react";
|
|
4
|
+
import { createPortal as Qt } from "react-dom";
|
|
5
|
+
import { LiveKitSession as xr, registerFields as Lr } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as Do, getRegisteredFields as Po, registerFields as zo, setFieldValue as $o } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Cr, Track as qn, createLocalVideoTrack as kr } from "livekit-client";
|
|
8
|
+
class Sr extends br {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -15,8 +15,8 @@ class yr extends ur {
|
|
|
15
15
|
return { hasError: !0, error: t };
|
|
16
16
|
}
|
|
17
17
|
componentDidCatch(t, n) {
|
|
18
|
-
var i,
|
|
19
|
-
(
|
|
18
|
+
var i, l;
|
|
19
|
+
(l = (i = this.props).onError) == null || l.call(i, t, n);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
var t;
|
|
@@ -35,26 +35,26 @@ class yr extends ur {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const [t, n] = M("idle"), [i,
|
|
40
|
-
|
|
38
|
+
function Er(e) {
|
|
39
|
+
const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [u, m] = M(null), [p, h] = M(null), [D, x] = M(!1), [E, y] = M(null), w = I(null), T = I(e.onDataMessage);
|
|
40
|
+
T.current = e.onDataMessage, R(() => {
|
|
41
41
|
const g = {
|
|
42
|
-
onConnectionStateChange: (
|
|
43
|
-
n(
|
|
42
|
+
onConnectionStateChange: (B) => {
|
|
43
|
+
n(B), B === "connected" && y(null);
|
|
44
44
|
},
|
|
45
|
-
onAgentStateChange:
|
|
46
|
-
onTranscript: (
|
|
45
|
+
onAgentStateChange: l,
|
|
46
|
+
onTranscript: (B) => s([...B]),
|
|
47
47
|
onAgentConfig: c,
|
|
48
|
-
onAudioTrack: (
|
|
49
|
-
onVideoTrack: (
|
|
48
|
+
onAudioTrack: (B) => h(B),
|
|
49
|
+
onVideoTrack: (B) => m(B),
|
|
50
50
|
onVideoTrackRemoved: () => m(null),
|
|
51
|
-
onError: (
|
|
52
|
-
onDataMessage: (
|
|
51
|
+
onError: (B) => y(B),
|
|
52
|
+
onDataMessage: (B) => {
|
|
53
53
|
var K;
|
|
54
|
-
(K =
|
|
54
|
+
(K = T.current) == null || K.call(T, B);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: x
|
|
57
|
-
},
|
|
57
|
+
}, z = new xr(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -64,9 +64,9 @@ function vr(e) {
|
|
|
64
64
|
},
|
|
65
65
|
g
|
|
66
66
|
);
|
|
67
|
-
return w.current =
|
|
68
|
-
var
|
|
69
|
-
(
|
|
67
|
+
return w.current = z, n("idle"), l("idle"), s([]), c(null), m(null), h(null), x(!1), y(null), () => {
|
|
68
|
+
var B;
|
|
69
|
+
(B = z.destroy) == null || B.call(z), w.current = null;
|
|
70
70
|
};
|
|
71
71
|
}, [
|
|
72
72
|
e.agentId,
|
|
@@ -80,8 +80,8 @@ function vr(e) {
|
|
|
80
80
|
if (g)
|
|
81
81
|
try {
|
|
82
82
|
await g.connect();
|
|
83
|
-
} catch (
|
|
84
|
-
throw y(
|
|
83
|
+
} catch (z) {
|
|
84
|
+
throw y(z instanceof Error ? z.message : String(z)), z;
|
|
85
85
|
}
|
|
86
86
|
}, []), v = C(() => {
|
|
87
87
|
const g = w.current;
|
|
@@ -94,10 +94,10 @@ function vr(e) {
|
|
|
94
94
|
connectionState: t,
|
|
95
95
|
agentState: i,
|
|
96
96
|
transcript: o,
|
|
97
|
-
agentConfig:
|
|
97
|
+
agentConfig: a,
|
|
98
98
|
videoElement: u,
|
|
99
99
|
audioElement: p,
|
|
100
|
-
canResume:
|
|
100
|
+
canResume: D,
|
|
101
101
|
error: E,
|
|
102
102
|
connect: S,
|
|
103
103
|
disconnect: v,
|
|
@@ -105,8 +105,8 @@ function vr(e) {
|
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()),
|
|
108
|
+
function Ar() {
|
|
109
|
+
const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()), l = C(() => {
|
|
110
110
|
const x = t.current;
|
|
111
111
|
if (x.size === 0) {
|
|
112
112
|
n.current = null;
|
|
@@ -115,9 +115,9 @@ function br() {
|
|
|
115
115
|
let E = 0;
|
|
116
116
|
for (const { analyser: y, buffer: w } of x.values()) {
|
|
117
117
|
y.getByteFrequencyData(w);
|
|
118
|
-
let
|
|
119
|
-
for (let v = 0; v < w.length; v++)
|
|
120
|
-
const S =
|
|
118
|
+
let T = 0;
|
|
119
|
+
for (let v = 0; v < w.length; v++) T += w[v];
|
|
120
|
+
const S = T / w.length / 255;
|
|
121
121
|
S > E && (E = S);
|
|
122
122
|
}
|
|
123
123
|
for (const y of i.current)
|
|
@@ -126,10 +126,10 @@ function br() {
|
|
|
126
126
|
} catch (w) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", w);
|
|
128
128
|
}
|
|
129
|
-
n.current = requestAnimationFrame(
|
|
129
|
+
n.current = requestAnimationFrame(l);
|
|
130
130
|
}, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = C(() => {
|
|
131
|
-
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(
|
|
132
|
-
}, [
|
|
131
|
+
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(l));
|
|
132
|
+
}, [l]), a = C((x) => {
|
|
133
133
|
const E = t.current.get(x);
|
|
134
134
|
if (E) {
|
|
135
135
|
try {
|
|
@@ -146,24 +146,24 @@ function br() {
|
|
|
146
146
|
(x, E) => {
|
|
147
147
|
const y = o();
|
|
148
148
|
if (!y) return;
|
|
149
|
-
|
|
149
|
+
a(x);
|
|
150
150
|
const w = E(y);
|
|
151
151
|
if (!w) return;
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const T = y.createAnalyser();
|
|
153
|
+
T.fftSize = 64;
|
|
154
154
|
try {
|
|
155
|
-
w.connect(
|
|
155
|
+
w.connect(T);
|
|
156
156
|
} catch (S) {
|
|
157
157
|
console.warn("[useAudioLevel] connect failed for slot", x, S);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
t.current.set(x, {
|
|
161
|
-
analyser:
|
|
161
|
+
analyser: T,
|
|
162
162
|
node: w,
|
|
163
|
-
buffer: new Uint8Array(new ArrayBuffer(
|
|
163
|
+
buffer: new Uint8Array(new ArrayBuffer(T.frequencyBinCount))
|
|
164
164
|
}), s();
|
|
165
165
|
},
|
|
166
|
-
[
|
|
166
|
+
[a, o, s]
|
|
167
167
|
), u = C(
|
|
168
168
|
(x, E = "agent") => {
|
|
169
169
|
c(E, (y) => {
|
|
@@ -196,17 +196,17 @@ function br() {
|
|
|
196
196
|
[c]
|
|
197
197
|
), p = C(
|
|
198
198
|
(x) => {
|
|
199
|
-
|
|
199
|
+
a(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
200
200
|
},
|
|
201
|
-
[
|
|
201
|
+
[a]
|
|
202
202
|
), h = C(() => {
|
|
203
203
|
n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
204
204
|
for (const x of Array.from(t.current.keys()))
|
|
205
|
-
|
|
206
|
-
}, [
|
|
205
|
+
a(x);
|
|
206
|
+
}, [a]), D = C((x) => (i.current.add(x), () => {
|
|
207
207
|
i.current.delete(x);
|
|
208
208
|
}), []);
|
|
209
|
-
return
|
|
209
|
+
return R(() => () => {
|
|
210
210
|
if (h(), e.current) {
|
|
211
211
|
try {
|
|
212
212
|
e.current.close();
|
|
@@ -215,14 +215,14 @@ function br() {
|
|
|
215
215
|
e.current = null;
|
|
216
216
|
}
|
|
217
217
|
i.current.clear();
|
|
218
|
-
}, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe:
|
|
218
|
+
}, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe: D };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Nr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i,
|
|
224
|
+
function Mr(e = {}) {
|
|
225
|
+
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), u = I(null), m = I(null), p = I({
|
|
226
226
|
active: t,
|
|
227
227
|
lastAutoIntent: null
|
|
228
228
|
}), h = C(async (S) => {
|
|
@@ -236,18 +236,18 @@ function _r(e = {}) {
|
|
|
236
236
|
}
|
|
237
237
|
m.current = S, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const g = await
|
|
239
|
+
const g = await Cr({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
243
|
-
await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1,
|
|
244
|
-
const
|
|
245
|
-
|
|
243
|
+
await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, l(!0)) : l(g.isMuted);
|
|
244
|
+
const z = (O = (v = g.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
|
|
245
|
+
z != null && z.deviceId && s(z.deviceId);
|
|
246
246
|
} catch (g) {
|
|
247
|
-
const
|
|
248
|
-
throw c(
|
|
247
|
+
const z = g instanceof Error && g.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
248
|
+
throw c(z), g;
|
|
249
249
|
}
|
|
250
|
-
}, []),
|
|
250
|
+
}, []), D = C((S) => {
|
|
251
251
|
m.current = S;
|
|
252
252
|
}, []), x = C(async (S) => {
|
|
253
253
|
const v = m.current;
|
|
@@ -259,21 +259,21 @@ function _r(e = {}) {
|
|
|
259
259
|
}
|
|
260
260
|
}, []), E = C(async () => {
|
|
261
261
|
const S = m.current, v = !i;
|
|
262
|
-
if (
|
|
262
|
+
if (l(v), p.current.active = !1, !!S)
|
|
263
263
|
try {
|
|
264
264
|
await S.localParticipant.setMicrophoneEnabled(!v);
|
|
265
265
|
} catch (O) {
|
|
266
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O),
|
|
266
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!v);
|
|
267
267
|
}
|
|
268
268
|
}, [i]);
|
|
269
|
-
|
|
269
|
+
R(() => {
|
|
270
270
|
if (!p.current.active || n !== "listening") return;
|
|
271
271
|
const S = m.current, v = S == null ? void 0 : S.localParticipant;
|
|
272
272
|
if (!v) {
|
|
273
273
|
p.current.active = !1;
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0,
|
|
276
|
+
v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, l(!1)), p.current.active = !1;
|
|
277
277
|
}, [n]);
|
|
278
278
|
const y = C(() => {
|
|
279
279
|
const S = u.current, v = m.current;
|
|
@@ -284,30 +284,30 @@ function _r(e = {}) {
|
|
|
284
284
|
}
|
|
285
285
|
S.stop();
|
|
286
286
|
}
|
|
287
|
-
u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null },
|
|
288
|
-
}, [t]), w = C(() => c(null), []),
|
|
287
|
+
u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
|
|
288
|
+
}, [t]), w = C(() => c(null), []), T = C(() => Nr(u.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
291
|
activeDeviceId: o,
|
|
292
|
-
micError:
|
|
292
|
+
micError: a,
|
|
293
293
|
toggleMute: E,
|
|
294
294
|
setupMic: h,
|
|
295
|
-
attachRoom:
|
|
295
|
+
attachRoom: D,
|
|
296
296
|
switchDevice: x,
|
|
297
297
|
teardownMic: y,
|
|
298
298
|
clearError: w,
|
|
299
|
-
getMicStream:
|
|
299
|
+
getMicStream: T
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
const [e, t] = M(!1), [n, i] = M(null), [
|
|
302
|
+
const Ir = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
|
+
function Tr() {
|
|
304
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = I(null), u = I(null), m = C((w) => {
|
|
305
305
|
c.current = w;
|
|
306
306
|
}, []), p = C(() => {
|
|
307
307
|
var S;
|
|
308
|
-
const w = c.current,
|
|
309
|
-
if (
|
|
310
|
-
const v = w.localParticipant.getTrackPublication(
|
|
308
|
+
const w = c.current, T = u.current;
|
|
309
|
+
if (T && w) {
|
|
310
|
+
const v = w.localParticipant.getTrackPublication(qn.Source.Camera), g = (v == null ? void 0 : v.track) ?? T;
|
|
311
311
|
try {
|
|
312
312
|
w.localParticipant.unpublishTrack(g);
|
|
313
313
|
} catch {
|
|
@@ -319,18 +319,18 @@ function Lr() {
|
|
|
319
319
|
}
|
|
320
320
|
u.current = null, o(null), t(!1);
|
|
321
321
|
}, []), h = C(async (w) => {
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
322
|
+
const T = c.current;
|
|
323
|
+
if (T) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const S = { ...
|
|
326
|
+
const S = { ...Ir };
|
|
327
327
|
w && (S.deviceId = w);
|
|
328
|
-
const v = await
|
|
329
|
-
await
|
|
328
|
+
const v = await kr(S);
|
|
329
|
+
await T.localParticipant.publishTrack(v), u.current = v;
|
|
330
330
|
const O = v.attach();
|
|
331
|
-
o(O), t(!0), w &&
|
|
331
|
+
o(O), t(!0), w && a(w);
|
|
332
332
|
try {
|
|
333
|
-
|
|
333
|
+
T.localParticipant.publishData(
|
|
334
334
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
335
335
|
{ reliable: !0 }
|
|
336
336
|
);
|
|
@@ -341,29 +341,29 @@ function Lr() {
|
|
|
341
341
|
i(v);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
}, []),
|
|
344
|
+
}, []), D = C(async () => {
|
|
345
345
|
e ? p() : await h(s || void 0);
|
|
346
346
|
}, [e, s, p, h]), x = C(async (w) => {
|
|
347
347
|
p(), await h(w);
|
|
348
348
|
}, [p, h]), E = C(() => {
|
|
349
|
-
p(), c.current = null, i(null),
|
|
349
|
+
p(), c.current = null, i(null), a("");
|
|
350
350
|
}, [p]), y = C(() => i(null), []);
|
|
351
|
-
return
|
|
351
|
+
return R(() => () => {
|
|
352
352
|
u.current && u.current.stop();
|
|
353
353
|
}, []), {
|
|
354
354
|
isEnabled: e,
|
|
355
355
|
error: n,
|
|
356
|
-
previewEl:
|
|
356
|
+
previewEl: l,
|
|
357
357
|
activeDeviceId: s,
|
|
358
|
-
toggle:
|
|
358
|
+
toggle: D,
|
|
359
359
|
switchDevice: x,
|
|
360
360
|
attachRoom: m,
|
|
361
361
|
teardown: E,
|
|
362
362
|
clearError: y
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const [e, t] = M(!1), [n, i] = M(null), [
|
|
365
|
+
function Rr() {
|
|
366
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = I(null), a = C((h) => {
|
|
367
367
|
s.current = h;
|
|
368
368
|
}, []), c = C(() => o(null), []), u = C(async () => {
|
|
369
369
|
const h = s.current;
|
|
@@ -379,9 +379,9 @@ function Cr() {
|
|
|
379
379
|
i(null);
|
|
380
380
|
try {
|
|
381
381
|
await h.localParticipant.setScreenShareEnabled(!0);
|
|
382
|
-
let
|
|
382
|
+
let D = 0;
|
|
383
383
|
const x = () => {
|
|
384
|
-
const E = h.localParticipant.getTrackPublication(
|
|
384
|
+
const E = h.localParticipant.getTrackPublication(qn.Source.ScreenShare);
|
|
385
385
|
if (E != null && E.track) {
|
|
386
386
|
const y = E.track.attach();
|
|
387
387
|
o(y), t(!0);
|
|
@@ -394,11 +394,11 @@ function Cr() {
|
|
|
394
394
|
}
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
D++ < 10 ? setTimeout(x, 100) : t(!0);
|
|
398
398
|
};
|
|
399
399
|
x();
|
|
400
|
-
} catch (
|
|
401
|
-
const x =
|
|
400
|
+
} catch (D) {
|
|
401
|
+
const x = D instanceof Error ? D.name : "";
|
|
402
402
|
x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
@@ -411,10 +411,10 @@ function Cr() {
|
|
|
411
411
|
}
|
|
412
412
|
c(), t(!1), i(null), s.current = null;
|
|
413
413
|
}, [e, c]), p = C(() => i(null), []);
|
|
414
|
-
return { isEnabled: e, error: n, previewEl:
|
|
414
|
+
return { isEnabled: e, error: n, previewEl: l, toggle: u, attachRoom: a, teardown: m, clearError: p };
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
const [e, t] = M([]), [n, i] = M([]),
|
|
416
|
+
function Dr() {
|
|
417
|
+
const [e, t] = M([]), [n, i] = M([]), l = C(async () => {
|
|
418
418
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
419
419
|
try {
|
|
420
420
|
const o = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -422,15 +422,15 @@ function kr() {
|
|
|
422
422
|
} catch {
|
|
423
423
|
}
|
|
424
424
|
}, []);
|
|
425
|
-
return
|
|
426
|
-
if (
|
|
427
|
-
const o = () => void
|
|
425
|
+
return R(() => {
|
|
426
|
+
if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
427
|
+
const o = () => void l();
|
|
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
|
|
432
|
-
const [i,
|
|
433
|
-
return
|
|
431
|
+
function Pr(e, t, n = !1) {
|
|
432
|
+
const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
|
|
433
|
+
return R(() => {
|
|
434
434
|
if (n || !e) {
|
|
435
435
|
c(!1);
|
|
436
436
|
return;
|
|
@@ -445,13 +445,13 @@ function Sr(e, t, n = !1) {
|
|
|
445
445
|
}
|
|
446
446
|
return p.json();
|
|
447
447
|
}).then((p) => {
|
|
448
|
-
u.signal.aborted || (
|
|
448
|
+
u.signal.aborted || (l(p), c(!1));
|
|
449
449
|
}).catch((p) => {
|
|
450
450
|
u.signal.aborted || (s(p instanceof Error ? p.message : "Agent lookup failed"), c(!1));
|
|
451
451
|
}), () => u.abort();
|
|
452
|
-
}, [e, t, n]), { info: i, error: o, loading:
|
|
452
|
+
}, [e, t, n]), { info: i, error: o, loading: a };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Un(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,78 +459,78 @@ function $n(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function jn(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 zr(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 $r({
|
|
477
477
|
value: e,
|
|
478
478
|
defaultValue: t = "expanded",
|
|
479
479
|
onChange: n
|
|
480
480
|
} = {}) {
|
|
481
|
-
const i = e !== void 0, [
|
|
481
|
+
const i = e !== void 0, [l, o] = M(t), s = i ? e : l, a = C(
|
|
482
482
|
(c) => {
|
|
483
483
|
c !== s && (i || o(c), n == null || n(c));
|
|
484
484
|
},
|
|
485
485
|
[s, i, n]
|
|
486
486
|
);
|
|
487
|
-
return [s,
|
|
487
|
+
return [s, a];
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
return e &&
|
|
489
|
+
const Hr = ["hidden", "minimized", "expanded"];
|
|
490
|
+
function Or(e) {
|
|
491
|
+
return e && Hr.includes(e) ? e : null;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Fr({
|
|
494
494
|
value: e,
|
|
495
495
|
defaultValue: t = "expanded",
|
|
496
496
|
onChange: n,
|
|
497
497
|
persistKey: i = "ll-widget",
|
|
498
|
-
disablePersistence:
|
|
498
|
+
disablePersistence: l = !1
|
|
499
499
|
} = {}) {
|
|
500
|
-
const o = `${i}:display-mode`, s = I(!1), [
|
|
500
|
+
const o = `${i}:display-mode`, s = I(!1), [a, c] = $r({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
503
|
onChange: (u) => {
|
|
504
|
-
e === void 0 && !
|
|
504
|
+
e === void 0 && !l && jn(o, u), n == null || n(u);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
|
-
return
|
|
508
|
-
if (s.current || (s.current = !0,
|
|
509
|
-
const u =
|
|
510
|
-
u && u !==
|
|
511
|
-
}, []), [
|
|
507
|
+
return R(() => {
|
|
508
|
+
if (s.current || (s.current = !0, l || e !== void 0)) return;
|
|
509
|
+
const u = Or(Un(o));
|
|
510
|
+
u && u !== a && c(u);
|
|
511
|
+
}, []), [a, c];
|
|
512
512
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
513
|
+
const Br = 640;
|
|
514
|
+
function Wr(e = Br) {
|
|
515
515
|
const [t, n] = M(!1);
|
|
516
|
-
return
|
|
516
|
+
return R(() => {
|
|
517
517
|
if (e === !1) {
|
|
518
518
|
n(!1);
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
521
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
522
522
|
return;
|
|
523
|
-
const i = `(max-width: ${e - 1}px)`,
|
|
524
|
-
return o(), typeof
|
|
525
|
-
|
|
523
|
+
const i = `(max-width: ${e - 1}px)`, l = window.matchMedia(i), o = () => n(l.matches);
|
|
524
|
+
return o(), typeof l.addEventListener == "function" ? (l.addEventListener("change", o), () => l.removeEventListener("change", o)) : (l.addListener(o), () => {
|
|
525
|
+
l.removeListener(o);
|
|
526
526
|
});
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
529
|
+
const qr = 280, Ur = 380, jr = 8, Vr = 4;
|
|
530
|
+
function Ut(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function Yr(e) {
|
|
534
534
|
if (!e) return null;
|
|
535
535
|
let t;
|
|
536
536
|
try {
|
|
@@ -539,94 +539,94 @@ function Hr(e) {
|
|
|
539
539
|
return null;
|
|
540
540
|
}
|
|
541
541
|
if (typeof t != "object" || t === null) return null;
|
|
542
|
-
const n = t, { top: i, left:
|
|
543
|
-
return typeof i != "number" || typeof
|
|
542
|
+
const n = t, { top: i, left: l, width: o, height: s } = n;
|
|
543
|
+
return typeof i != "number" || typeof l != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(l) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: l, width: o, height: s };
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function At() {
|
|
546
546
|
return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
const { minWidth: i, minHeight:
|
|
548
|
+
function jt(e, t, n) {
|
|
549
|
+
const { minWidth: i, minHeight: l, edgeMargin: o, vw: s, vh: a } = n, c = Math.max(i, s - o * 2), u = Math.max(l, a - o * 2);
|
|
550
550
|
return {
|
|
551
551
|
width: Math.max(i, Math.min(c, e)),
|
|
552
|
-
height: Math.max(
|
|
552
|
+
height: Math.max(l, Math.min(u, t))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const { edgeMargin: o, vw: s, vh:
|
|
555
|
+
function Vt(e, t, n, i, l) {
|
|
556
|
+
const { edgeMargin: o, vw: s, vh: a } = l, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, a - i - o);
|
|
557
557
|
return {
|
|
558
558
|
top: Math.max(u, Math.min(p, e)),
|
|
559
559
|
left: Math.max(c, Math.min(m, t))
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Gr(e) {
|
|
563
563
|
const {
|
|
564
564
|
draggable: t,
|
|
565
565
|
resizable: n,
|
|
566
566
|
persistKey: i,
|
|
567
|
-
disablePersistence:
|
|
568
|
-
minWidth: o =
|
|
569
|
-
minHeight: s =
|
|
570
|
-
edgeMargin:
|
|
571
|
-
} = e, [c, u] = M(null), [m, p] = M(!1), [h,
|
|
567
|
+
disablePersistence: l,
|
|
568
|
+
minWidth: o = qr,
|
|
569
|
+
minHeight: s = Ur,
|
|
570
|
+
edgeMargin: a = jr
|
|
571
|
+
} = e, [c, u] = M(null), [m, p] = M(!1), [h, D] = M(!1), x = I(null), E = I(null), y = I(!1), w = I(null);
|
|
572
572
|
w.current = c;
|
|
573
|
-
const
|
|
573
|
+
const T = C(
|
|
574
574
|
(f) => {
|
|
575
|
-
|
|
575
|
+
l || (f === null ? zr(Ut(i)) : jn(Ut(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
|
-
[
|
|
577
|
+
[l, i]
|
|
578
578
|
);
|
|
579
|
-
|
|
580
|
-
if (y.current || (y.current = !0,
|
|
581
|
-
const f =
|
|
579
|
+
R(() => {
|
|
580
|
+
if (y.current || (y.current = !0, l)) return;
|
|
581
|
+
const f = Yr(Un(Ut(i)));
|
|
582
582
|
if (!f) return;
|
|
583
|
-
const { vw:
|
|
583
|
+
const { vw: A, vh: $ } = At(), q = jt(f.width, f.height, {
|
|
584
584
|
minWidth: o,
|
|
585
585
|
minHeight: s,
|
|
586
|
-
edgeMargin:
|
|
587
|
-
vw:
|
|
588
|
-
vh:
|
|
589
|
-
}), X =
|
|
590
|
-
edgeMargin:
|
|
591
|
-
vw:
|
|
592
|
-
vh:
|
|
586
|
+
edgeMargin: a,
|
|
587
|
+
vw: A,
|
|
588
|
+
vh: $
|
|
589
|
+
}), X = Vt(f.top, f.left, q.width, q.height, {
|
|
590
|
+
edgeMargin: a,
|
|
591
|
+
vw: A,
|
|
592
|
+
vh: $
|
|
593
593
|
});
|
|
594
594
|
u({ ...X, ...q });
|
|
595
|
-
}, []),
|
|
595
|
+
}, []), R(() => {
|
|
596
596
|
if (typeof window > "u") return;
|
|
597
597
|
const f = () => {
|
|
598
|
-
u((
|
|
599
|
-
if (
|
|
600
|
-
const { vw:
|
|
598
|
+
u((A) => {
|
|
599
|
+
if (A === null) return null;
|
|
600
|
+
const { vw: $, vh: q } = At(), X = jt(A.width, A.height, {
|
|
601
601
|
minWidth: o,
|
|
602
602
|
minHeight: s,
|
|
603
|
-
edgeMargin:
|
|
604
|
-
vw:
|
|
603
|
+
edgeMargin: a,
|
|
604
|
+
vw: $,
|
|
605
605
|
vh: q
|
|
606
606
|
});
|
|
607
|
-
return { ...
|
|
608
|
-
edgeMargin:
|
|
609
|
-
vw:
|
|
607
|
+
return { ...Vt(A.top, A.left, X.width, X.height, {
|
|
608
|
+
edgeMargin: a,
|
|
609
|
+
vw: $,
|
|
610
610
|
vh: q
|
|
611
611
|
}), ...X };
|
|
612
612
|
});
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
615
|
-
}, [o, s,
|
|
615
|
+
}, [o, s, a]);
|
|
616
616
|
const S = C(
|
|
617
617
|
(f) => {
|
|
618
618
|
if (!t || f.pointerType === "mouse" && f.button !== 0) return;
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
619
|
+
const A = f.target;
|
|
620
|
+
if (A && typeof A.closest == "function" && A.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
|
|
621
621
|
return;
|
|
622
|
-
let
|
|
622
|
+
let $, q, X, ee;
|
|
623
623
|
const V = w.current;
|
|
624
624
|
if (V)
|
|
625
|
-
({ top:
|
|
625
|
+
({ top: $, left: q, width: X, height: ee } = V);
|
|
626
626
|
else {
|
|
627
627
|
const te = f.currentTarget.closest(".ll-widget"), oe = te == null ? void 0 : te.getBoundingClientRect();
|
|
628
628
|
if (!oe) return;
|
|
629
|
-
|
|
629
|
+
$ = oe.top, q = oe.left, X = oe.width, ee = oe.height;
|
|
630
630
|
}
|
|
631
631
|
try {
|
|
632
632
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
@@ -635,7 +635,7 @@ function Or(e) {
|
|
|
635
635
|
x.current = {
|
|
636
636
|
startClientX: f.clientX,
|
|
637
637
|
startClientY: f.clientY,
|
|
638
|
-
startTop:
|
|
638
|
+
startTop: $,
|
|
639
639
|
startLeft: q,
|
|
640
640
|
width: X,
|
|
641
641
|
height: ee,
|
|
@@ -645,46 +645,46 @@ function Or(e) {
|
|
|
645
645
|
[t]
|
|
646
646
|
), v = C(
|
|
647
647
|
(f) => {
|
|
648
|
-
const
|
|
649
|
-
if (!
|
|
650
|
-
const
|
|
651
|
-
if (!
|
|
652
|
-
const { vw: X, vh: ee } =
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
{ edgeMargin:
|
|
648
|
+
const A = x.current;
|
|
649
|
+
if (!A) return;
|
|
650
|
+
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY;
|
|
651
|
+
if (!A.moved && Math.abs($) + Math.abs(q) > Vr && (A.moved = !0, p(!0)), !A.moved) return;
|
|
652
|
+
const { vw: X, vh: ee } = At(), V = Vt(
|
|
653
|
+
A.startTop + q,
|
|
654
|
+
A.startLeft + $,
|
|
655
|
+
A.width,
|
|
656
|
+
A.height,
|
|
657
|
+
{ edgeMargin: a, vw: X, vh: ee }
|
|
658
658
|
);
|
|
659
|
-
u({ ...V, width:
|
|
659
|
+
u({ ...V, width: A.width, height: A.height });
|
|
660
660
|
},
|
|
661
|
-
[
|
|
661
|
+
[a]
|
|
662
662
|
), O = C(
|
|
663
663
|
(f) => {
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
664
|
+
const A = x.current;
|
|
665
|
+
if (A) {
|
|
666
666
|
try {
|
|
667
667
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
668
668
|
} catch {
|
|
669
669
|
}
|
|
670
|
-
x.current = null,
|
|
670
|
+
x.current = null, A.moved && (p(!1), u(($) => ($ && T($), $)));
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
|
-
[
|
|
673
|
+
[T]
|
|
674
674
|
), g = C(() => {
|
|
675
|
-
x.current = null, E.current = null, p(!1),
|
|
676
|
-
}, [
|
|
675
|
+
x.current = null, E.current = null, p(!1), D(!1), u(null), T(null);
|
|
676
|
+
}, [T]), z = C(
|
|
677
677
|
(f) => {
|
|
678
678
|
if (!n || f.pointerType === "mouse" && f.button !== 0) return;
|
|
679
679
|
f.stopPropagation();
|
|
680
|
-
let
|
|
680
|
+
let A, $, q, X;
|
|
681
681
|
const ee = w.current;
|
|
682
682
|
if (ee)
|
|
683
|
-
({ top:
|
|
683
|
+
({ top: A, left: $, width: q, height: X } = ee);
|
|
684
684
|
else {
|
|
685
685
|
const V = f.currentTarget.closest(".ll-widget"), te = V == null ? void 0 : V.getBoundingClientRect();
|
|
686
686
|
if (!te) return;
|
|
687
|
-
|
|
687
|
+
A = te.top, $ = te.left, q = te.width, X = te.height;
|
|
688
688
|
}
|
|
689
689
|
try {
|
|
690
690
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
@@ -695,27 +695,27 @@ function Or(e) {
|
|
|
695
695
|
startClientY: f.clientY,
|
|
696
696
|
startWidth: q,
|
|
697
697
|
startHeight: X,
|
|
698
|
-
top:
|
|
699
|
-
left:
|
|
700
|
-
},
|
|
698
|
+
top: A,
|
|
699
|
+
left: $
|
|
700
|
+
}, D(!0);
|
|
701
701
|
},
|
|
702
702
|
[n]
|
|
703
|
-
),
|
|
703
|
+
), B = C(
|
|
704
704
|
(f) => {
|
|
705
|
-
const
|
|
706
|
-
if (!
|
|
707
|
-
const
|
|
705
|
+
const A = E.current;
|
|
706
|
+
if (!A) return;
|
|
707
|
+
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh: ee } = At(), V = X - A.left - a, te = ee - A.top - a, oe = jt(A.startWidth + $, A.startHeight + q, {
|
|
708
708
|
minWidth: o,
|
|
709
709
|
minHeight: s,
|
|
710
|
-
edgeMargin:
|
|
710
|
+
edgeMargin: a,
|
|
711
711
|
// Clamp the available viewport to the room from the anchored corner
|
|
712
712
|
// so the widget can't grow past the bottom/right edge.
|
|
713
|
-
vw: Math.min(X,
|
|
714
|
-
vh: Math.min(ee,
|
|
713
|
+
vw: Math.min(X, A.left + V + a),
|
|
714
|
+
vh: Math.min(ee, A.top + te + a)
|
|
715
715
|
});
|
|
716
|
-
u({ top:
|
|
716
|
+
u({ top: A.top, left: A.left, ...oe });
|
|
717
717
|
},
|
|
718
|
-
[
|
|
718
|
+
[a, o, s]
|
|
719
719
|
), K = C(
|
|
720
720
|
(f) => {
|
|
721
721
|
if (E.current) {
|
|
@@ -723,10 +723,10 @@ function Or(e) {
|
|
|
723
723
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
724
724
|
} catch {
|
|
725
725
|
}
|
|
726
|
-
E.current = null,
|
|
726
|
+
E.current = null, D(!1), u(($) => ($ && T($), $));
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
|
-
[
|
|
729
|
+
[T]
|
|
730
730
|
);
|
|
731
731
|
return {
|
|
732
732
|
style: c === null ? {} : {
|
|
@@ -750,8 +750,8 @@ function Or(e) {
|
|
|
750
750
|
"data-ll-drag-handle": t ? "" : void 0
|
|
751
751
|
},
|
|
752
752
|
resizeHandleProps: {
|
|
753
|
-
onPointerDown:
|
|
754
|
-
onPointerMove:
|
|
753
|
+
onPointerDown: z,
|
|
754
|
+
onPointerMove: B,
|
|
755
755
|
onPointerUp: K,
|
|
756
756
|
onPointerCancel: K,
|
|
757
757
|
"data-ll-resize-handle": n ? "" : void 0
|
|
@@ -759,75 +759,75 @@ function Or(e) {
|
|
|
759
759
|
reset: g
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
762
|
+
const vn = "__llHistoryPatched", It = "ll:pathname";
|
|
763
|
+
function Xr() {
|
|
764
|
+
if (typeof window > "u" || window.history[vn]) 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);
|
|
768
|
-
return window.dispatchEvent(new Event(
|
|
768
|
+
return window.dispatchEvent(new Event(It)), i;
|
|
769
769
|
}, window.history.replaceState = function(...n) {
|
|
770
770
|
const i = t.apply(this, n);
|
|
771
|
-
return window.dispatchEvent(new Event(
|
|
772
|
-
}, window.history[
|
|
771
|
+
return window.dispatchEvent(new Event(It)), i;
|
|
772
|
+
}, window.history[vn] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function bn() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Kr(e) {
|
|
778
778
|
const [t, n] = M(
|
|
779
|
-
() => e ??
|
|
779
|
+
() => e ?? bn()
|
|
780
780
|
);
|
|
781
|
-
return
|
|
781
|
+
return R(() => {
|
|
782
782
|
if (e !== void 0) return;
|
|
783
|
-
|
|
784
|
-
const i = () => n(
|
|
785
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
786
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
783
|
+
Xr();
|
|
784
|
+
const i = () => n(bn());
|
|
785
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(It, i), () => {
|
|
786
|
+
window.removeEventListener("popstate", i), window.removeEventListener(It, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
function
|
|
792
|
-
return e.replace(
|
|
790
|
+
const wn = /* @__PURE__ */ new Map(), Jr = /[\\^$+?.()|{}[\]]/g;
|
|
791
|
+
function Zr(e) {
|
|
792
|
+
return e.replace(Jr, "\\$&");
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
const t =
|
|
794
|
+
function Qr(e) {
|
|
795
|
+
const t = wn.get(e);
|
|
796
796
|
if (t) return t;
|
|
797
|
-
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "",
|
|
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 = Zr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
|
|
798
|
+
return wn.set(e, c), c;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function ei(e, t) {
|
|
801
801
|
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
802
|
-
return
|
|
802
|
+
return Qr(e).test(n);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
804
|
+
function ti(e, t) {
|
|
805
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : ei(e, t);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function _n(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
809
|
for (const n of e)
|
|
810
|
-
if (
|
|
810
|
+
if (ti(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return e === void 0 ? !0 :
|
|
813
|
+
function ni(e, t, n) {
|
|
814
|
+
return e === void 0 ? !0 : _n(n, e) ? !1 : t && t.length > 0 ? _n(t, e) : !0;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
818
|
-
() =>
|
|
816
|
+
function ri(e, t, n) {
|
|
817
|
+
return rt(
|
|
818
|
+
() => ni(e, t, n),
|
|
819
819
|
[e, t, n]
|
|
820
820
|
);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function ii(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 oi(e) {
|
|
830
|
+
const t = rt(() => ii(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = I(null), l = C(
|
|
831
831
|
(c) => {
|
|
832
832
|
try {
|
|
833
833
|
new Audio(`${n}${c}`).play().catch(() => {
|
|
@@ -837,10 +837,10 @@ function Kr(e) {
|
|
|
837
837
|
},
|
|
838
838
|
[n]
|
|
839
839
|
), o = C(() => {
|
|
840
|
-
t.navigate &&
|
|
841
|
-
}, [t.navigate,
|
|
842
|
-
t.action &&
|
|
843
|
-
}, [t.action,
|
|
840
|
+
t.navigate && l("/audio/page-change-sound.mp3");
|
|
841
|
+
}, [t.navigate, l]), s = C(() => {
|
|
842
|
+
t.action && l("/audio/confirmation-sound.mp3");
|
|
843
|
+
}, [t.action, l]), a = C(
|
|
844
844
|
(c) => {
|
|
845
845
|
if (!t.thinking) {
|
|
846
846
|
if (i.current) {
|
|
@@ -871,7 +871,7 @@ function Kr(e) {
|
|
|
871
871
|
},
|
|
872
872
|
[n, t.thinking]
|
|
873
873
|
);
|
|
874
|
-
return
|
|
874
|
+
return R(() => () => {
|
|
875
875
|
if (i.current) {
|
|
876
876
|
try {
|
|
877
877
|
i.current.pause();
|
|
@@ -879,12 +879,12 @@ function Kr(e) {
|
|
|
879
879
|
}
|
|
880
880
|
i.current = null;
|
|
881
881
|
}
|
|
882
|
-
}, []),
|
|
883
|
-
() => ({ playPageChange: o, playConfirmation: s, setThinking:
|
|
884
|
-
[o, s,
|
|
882
|
+
}, []), rt(
|
|
883
|
+
() => ({ playPageChange: o, playConfirmation: s, setThinking: a }),
|
|
884
|
+
[o, s, a]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const xn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -930,7 +930,7 @@ const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
}
|
|
933
|
-
),
|
|
933
|
+
), Ln = ({ 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__ */ k(
|
|
|
948
948
|
}
|
|
949
949
|
)
|
|
950
950
|
}
|
|
951
|
-
),
|
|
951
|
+
), li = ({ 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__ */ k(
|
|
|
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
|
+
), ai = {
|
|
963
963
|
left: 180,
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, Cn = ({ 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__ */ k(
|
|
|
972
972
|
viewBox: "0 0 24 24",
|
|
973
973
|
stroke: "currentColor",
|
|
974
974
|
strokeWidth: 2,
|
|
975
|
-
style: { transform: `rotate(${
|
|
975
|
+
style: { transform: `rotate(${ai[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 Vn = "ll-hidden-tab-center-y", ci = 5, kn = 16;
|
|
984
|
+
function ui() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(Vn);
|
|
988
988
|
if (!e) return null;
|
|
989
989
|
const t = Number.parseFloat(e);
|
|
990
990
|
return Number.isFinite(t) ? t : null;
|
|
@@ -992,93 +992,93 @@ function ti() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Sn(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(Vn, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const di = ({
|
|
1003
1003
|
position: e,
|
|
1004
1004
|
isMobile: t,
|
|
1005
1005
|
isSpeaking: n,
|
|
1006
1006
|
onExpand: i,
|
|
1007
|
-
label:
|
|
1007
|
+
label: l = "Open widget",
|
|
1008
1008
|
avatarImageUrl: o,
|
|
1009
1009
|
agentName: s,
|
|
1010
|
-
containerEl:
|
|
1010
|
+
containerEl: a
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const c =
|
|
1013
|
-
(
|
|
1014
|
-
if (typeof window > "u") return
|
|
1015
|
-
const G = m / 2, f =
|
|
1016
|
-
return
|
|
1012
|
+
const c = si(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!a, [D, x] = M(null), [E, y] = M(!1), w = I(null), T = I(!1), S = C(
|
|
1013
|
+
(H) => {
|
|
1014
|
+
if (typeof window > "u") return H;
|
|
1015
|
+
const G = m / 2, f = kn + G, A = window.innerHeight - kn - G;
|
|
1016
|
+
return A < f ? Math.max(f, H) : Math.max(f, Math.min(A, H));
|
|
1017
1017
|
},
|
|
1018
1018
|
[m]
|
|
1019
1019
|
);
|
|
1020
|
-
|
|
1020
|
+
R(() => {
|
|
1021
1021
|
if (h) {
|
|
1022
1022
|
x(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
const
|
|
1026
|
-
x(S(
|
|
1025
|
+
const H = ui();
|
|
1026
|
+
x(S(H ?? window.innerHeight / 2));
|
|
1027
1027
|
const G = () => {
|
|
1028
1028
|
x((f) => f === null ? null : S(f));
|
|
1029
1029
|
};
|
|
1030
1030
|
return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
|
|
1031
1031
|
}, [S, h]);
|
|
1032
1032
|
const v = C(
|
|
1033
|
-
(
|
|
1034
|
-
if (!h && !(
|
|
1033
|
+
(H) => {
|
|
1034
|
+
if (!h && !(H.pointerType === "mouse" && H.button !== 0) && D !== null) {
|
|
1035
1035
|
try {
|
|
1036
|
-
|
|
1036
|
+
H.currentTarget.setPointerCapture(H.pointerId);
|
|
1037
1037
|
} catch {
|
|
1038
1038
|
}
|
|
1039
1039
|
w.current = {
|
|
1040
|
-
startClientY:
|
|
1041
|
-
startCenterY:
|
|
1040
|
+
startClientY: H.clientY,
|
|
1041
|
+
startCenterY: D,
|
|
1042
1042
|
moved: !1
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
1045
|
},
|
|
1046
|
-
[
|
|
1046
|
+
[D, h]
|
|
1047
1047
|
), O = C(
|
|
1048
|
-
(
|
|
1048
|
+
(H) => {
|
|
1049
1049
|
const G = w.current;
|
|
1050
1050
|
if (!G) return;
|
|
1051
|
-
const f =
|
|
1052
|
-
!G.moved && Math.abs(f) >
|
|
1051
|
+
const f = H.clientY - G.startClientY;
|
|
1052
|
+
!G.moved && Math.abs(f) > ci && (G.moved = !0, y(!0)), G.moved && x(S(G.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
1054
|
[S]
|
|
1055
1055
|
), g = C(
|
|
1056
|
-
(
|
|
1056
|
+
(H) => {
|
|
1057
1057
|
const G = w.current;
|
|
1058
1058
|
if (G) {
|
|
1059
1059
|
try {
|
|
1060
|
-
|
|
1060
|
+
H.currentTarget.releasePointerCapture(H.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null, G.moved && (y(!1),
|
|
1063
|
+
w.current = null, G.moved && (y(!1), T.current = !0, x((f) => (f !== null && Sn(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
1067
|
-
),
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1067
|
+
), z = C(() => {
|
|
1068
|
+
if (T.current) {
|
|
1069
|
+
T.current = !1;
|
|
1070
1070
|
return;
|
|
1071
1071
|
}
|
|
1072
1072
|
i();
|
|
1073
|
-
}, [i]),
|
|
1074
|
-
(
|
|
1075
|
-
if (
|
|
1076
|
-
|
|
1077
|
-
const G =
|
|
1073
|
+
}, [i]), B = C(
|
|
1074
|
+
(H) => {
|
|
1075
|
+
if (H.key === "ArrowUp" || H.key === "ArrowDown") {
|
|
1076
|
+
H.preventDefault();
|
|
1077
|
+
const G = H.key === "ArrowUp" ? -8 : 8;
|
|
1078
1078
|
x((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
1080
|
+
const A = S(f + G);
|
|
1081
|
+
return Sn(A), A;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
@@ -1091,7 +1091,7 @@ const ni = ({
|
|
|
1091
1091
|
E ? "is-dragging" : null,
|
|
1092
1092
|
p ? "ll-hidden--with-avatar" : null,
|
|
1093
1093
|
h ? "ll-hidden--scoped" : null
|
|
1094
|
-
].filter(Boolean).join(" "), ae =
|
|
1094
|
+
].filter(Boolean).join(" "), ae = D === null ? void 0 : { top: `${D - m / 2}px`, transform: "none" };
|
|
1095
1095
|
return /* @__PURE__ */ r(
|
|
1096
1096
|
"button",
|
|
1097
1097
|
{
|
|
@@ -1101,9 +1101,9 @@ const ni = ({
|
|
|
1101
1101
|
onPointerMove: O,
|
|
1102
1102
|
onPointerUp: g,
|
|
1103
1103
|
onPointerCancel: g,
|
|
1104
|
-
onClick:
|
|
1105
|
-
onKeyDown:
|
|
1106
|
-
"aria-label":
|
|
1104
|
+
onClick: z,
|
|
1105
|
+
onKeyDown: B,
|
|
1106
|
+
"aria-label": l,
|
|
1107
1107
|
"data-position": e,
|
|
1108
1108
|
style: ae,
|
|
1109
1109
|
children: p ? (
|
|
@@ -1113,7 +1113,7 @@ const ni = ({
|
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
1114
|
/* @__PURE__ */ k(We, { children: [
|
|
1115
1115
|
/* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
Cn,
|
|
1117
1117
|
{
|
|
1118
1118
|
direction: u,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -1130,7 +1130,7 @@ const ni = ({
|
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
1132
|
) : /* @__PURE__ */ r(
|
|
1133
|
-
|
|
1133
|
+
Cn,
|
|
1134
1134
|
{
|
|
1135
1135
|
direction: u,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
@@ -1138,47 +1138,47 @@ const ni = ({
|
|
|
1138
1138
|
)
|
|
1139
1139
|
}
|
|
1140
1140
|
);
|
|
1141
|
-
},
|
|
1141
|
+
}, fi = ({
|
|
1142
1142
|
audioLevel: e,
|
|
1143
1143
|
bars: t = 20,
|
|
1144
1144
|
maxHeight: n = 20,
|
|
1145
1145
|
minHeight: i = 4,
|
|
1146
|
-
className:
|
|
1146
|
+
className: l,
|
|
1147
1147
|
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const s = I(null),
|
|
1149
|
+
const s = I(null), a = I([]), c = rt(() => {
|
|
1150
1150
|
const m = (Math.sqrt(5) - 1) / 2;
|
|
1151
1151
|
return Array.from({ length: t }, (p, h) => 0.5 + h * m % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
1153
|
-
|
|
1153
|
+
R(() => e.subscribe((p) => {
|
|
1154
1154
|
for (let h = 0; h < t; h++) {
|
|
1155
|
-
const
|
|
1156
|
-
if (!
|
|
1155
|
+
const D = a.current[h];
|
|
1156
|
+
if (!D) continue;
|
|
1157
1157
|
const x = Math.max(i, p * n * c[h]);
|
|
1158
|
-
|
|
1158
|
+
D.style.height = `${x}px`;
|
|
1159
1159
|
}
|
|
1160
1160
|
}), [e, t, n, i, c]);
|
|
1161
|
-
const u = ["ll-waveform",
|
|
1161
|
+
const u = ["ll-waveform", l].filter(Boolean).join(" ");
|
|
1162
1162
|
return /* @__PURE__ */ r("div", { ref: s, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (m, p) => /* @__PURE__ */ r(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
1165
1165
|
ref: (h) => {
|
|
1166
|
-
|
|
1166
|
+
a.current[p] = h;
|
|
1167
1167
|
},
|
|
1168
1168
|
className: ["ll-waveform__bar", o].filter(Boolean).join(" "),
|
|
1169
1169
|
style: { height: `${i}px` }
|
|
1170
1170
|
},
|
|
1171
1171
|
p
|
|
1172
1172
|
)) });
|
|
1173
|
-
},
|
|
1173
|
+
}, pi = ({
|
|
1174
1174
|
position: e,
|
|
1175
1175
|
isMobile: t,
|
|
1176
1176
|
agentName: n,
|
|
1177
1177
|
avatarImageUrl: i,
|
|
1178
|
-
agentState:
|
|
1178
|
+
agentState: l,
|
|
1179
1179
|
isMuted: o,
|
|
1180
1180
|
audioLevel: s,
|
|
1181
|
-
onExpand:
|
|
1181
|
+
onExpand: a,
|
|
1182
1182
|
onToggleMute: c,
|
|
1183
1183
|
onClose: u
|
|
1184
1184
|
}) => t ? /* @__PURE__ */ r(
|
|
@@ -1192,7 +1192,7 @@ const ni = ({
|
|
|
1192
1192
|
{
|
|
1193
1193
|
type: "button",
|
|
1194
1194
|
className: "ll-minimized__surface",
|
|
1195
|
-
onClick:
|
|
1195
|
+
onClick: a,
|
|
1196
1196
|
"aria-label": `Expand ${n} widget`,
|
|
1197
1197
|
children: [
|
|
1198
1198
|
i ? (
|
|
@@ -1207,7 +1207,7 @@ const ni = ({
|
|
|
1207
1207
|
)
|
|
1208
1208
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1209
1209
|
/* @__PURE__ */ r(
|
|
1210
|
-
|
|
1210
|
+
fi,
|
|
1211
1211
|
{
|
|
1212
1212
|
audioLevel: s,
|
|
1213
1213
|
bars: 16,
|
|
@@ -1230,10 +1230,10 @@ const ni = ({
|
|
|
1230
1230
|
(m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), c());
|
|
1231
1231
|
},
|
|
1232
1232
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1233
|
-
children: /* @__PURE__ */ r(
|
|
1233
|
+
children: /* @__PURE__ */ r(xn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
/* @__PURE__ */ r(
|
|
1236
|
+
/* @__PURE__ */ r(Ln, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
1237
1237
|
] })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
@@ -1260,7 +1260,7 @@ const ni = ({
|
|
|
1260
1260
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1261
1261
|
/* @__PURE__ */ k("div", { className: "ll-minimized__meta", children: [
|
|
1262
1262
|
/* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
|
|
1263
|
-
/* @__PURE__ */ r("span", { className: "ll-minimized__state", children:
|
|
1263
|
+
/* @__PURE__ */ r("span", { className: "ll-minimized__state", children: l === "speaking" ? "Speaking" : l === "thinking" ? "Thinking" : "Listening" })
|
|
1264
1264
|
] }),
|
|
1265
1265
|
/* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
|
|
1266
1266
|
/* @__PURE__ */ r(
|
|
@@ -1270,7 +1270,7 @@ const ni = ({
|
|
|
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(xn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ r(
|
|
@@ -1278,9 +1278,9 @@ const ni = ({
|
|
|
1278
1278
|
{
|
|
1279
1279
|
type: "button",
|
|
1280
1280
|
className: "ll-minimized__btn",
|
|
1281
|
-
onClick:
|
|
1281
|
+
onClick: a,
|
|
1282
1282
|
"aria-label": `Expand ${n} widget`,
|
|
1283
|
-
children: /* @__PURE__ */ r(
|
|
1283
|
+
children: /* @__PURE__ */ r(Ln, { className: "ll-minimized__icon" })
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ r(
|
|
@@ -1290,22 +1290,22 @@ const ni = ({
|
|
|
1290
1290
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1291
1291
|
onClick: u,
|
|
1292
1292
|
"aria-label": "Close widget",
|
|
1293
|
-
children: /* @__PURE__ */ r(
|
|
1293
|
+
children: /* @__PURE__ */ r(li, { className: "ll-minimized__icon" })
|
|
1294
1294
|
}
|
|
1295
1295
|
)
|
|
1296
1296
|
] })
|
|
1297
1297
|
] })
|
|
1298
1298
|
}
|
|
1299
|
-
),
|
|
1299
|
+
), hi = ({
|
|
1300
1300
|
src: e,
|
|
1301
1301
|
alt: t,
|
|
1302
1302
|
preCannedPlaying: n = !1,
|
|
1303
1303
|
className: i,
|
|
1304
|
-
style:
|
|
1304
|
+
style: l
|
|
1305
1305
|
}) => {
|
|
1306
|
-
const [o, s] = M(!1),
|
|
1307
|
-
if (
|
|
1308
|
-
|
|
1306
|
+
const [o, s] = M(!1), a = I(e);
|
|
1307
|
+
if (R(() => {
|
|
1308
|
+
a.current !== e && (a.current = e, s(!1));
|
|
1309
1309
|
}, [e]), !e) return null;
|
|
1310
1310
|
const c = {
|
|
1311
1311
|
position: "absolute",
|
|
@@ -1317,7 +1317,7 @@ const ni = ({
|
|
|
1317
1317
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
1318
1318
|
transform: n ? "scale(1.02)" : "scale(1)",
|
|
1319
1319
|
opacity: o ? 1 : 0,
|
|
1320
|
-
...
|
|
1320
|
+
...l
|
|
1321
1321
|
};
|
|
1322
1322
|
return (
|
|
1323
1323
|
// eslint-disable-next-line @next/next/no-img-element
|
|
@@ -1334,11 +1334,11 @@ const ni = ({
|
|
|
1334
1334
|
}
|
|
1335
1335
|
)
|
|
1336
1336
|
);
|
|
1337
|
-
},
|
|
1338
|
-
function
|
|
1337
|
+
}, mi = "#E06540";
|
|
1338
|
+
function gi({
|
|
1339
1339
|
size: e = 14,
|
|
1340
1340
|
className: t,
|
|
1341
|
-
fill: n =
|
|
1341
|
+
fill: n = mi
|
|
1342
1342
|
}) {
|
|
1343
1343
|
return /* @__PURE__ */ k(
|
|
1344
1344
|
"svg",
|
|
@@ -1376,46 +1376,46 @@ function ai({
|
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const yi = 8, En = 8, vi = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
1382
|
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
1385
|
+
const l = I(null), [o, s] = M(null);
|
|
1386
|
+
return Wn(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
1388
|
s(null);
|
|
1389
1389
|
return;
|
|
1390
1390
|
}
|
|
1391
|
-
const
|
|
1392
|
-
if (!
|
|
1391
|
+
const a = n.current;
|
|
1392
|
+
if (!a) return;
|
|
1393
1393
|
const c = () => {
|
|
1394
|
-
const u =
|
|
1395
|
-
top: u.top -
|
|
1394
|
+
const u = a.getBoundingClientRect(), m = {
|
|
1395
|
+
top: u.top - yi,
|
|
1396
1396
|
left: u.left + u.width / 2
|
|
1397
|
-
}, p =
|
|
1397
|
+
}, p = En + 90, h = window.innerWidth - En - 90;
|
|
1398
1398
|
m.left < p && (m.left = p), m.left > h && (m.left = h), s(m);
|
|
1399
1399
|
};
|
|
1400
1400
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1401
1401
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1402
1402
|
};
|
|
1403
|
-
}, [e, n]),
|
|
1403
|
+
}, [e, n]), R(() => {
|
|
1404
1404
|
if (!e) return;
|
|
1405
|
-
const
|
|
1406
|
-
const m = u.target, p =
|
|
1405
|
+
const a = (u) => {
|
|
1406
|
+
const m = u.target, p = l.current, h = n.current;
|
|
1407
1407
|
p && p.contains(m) || h && h.contains(m) || t();
|
|
1408
1408
|
}, c = (u) => {
|
|
1409
1409
|
u.key === "Escape" && (u.stopPropagation(), t());
|
|
1410
1410
|
};
|
|
1411
|
-
return document.addEventListener("mousedown",
|
|
1412
|
-
document.removeEventListener("mousedown",
|
|
1411
|
+
return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
|
|
1412
|
+
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
|
|
1413
1413
|
};
|
|
1414
|
-
}, [e, t, n]), !e || o === null || typeof document > "u" ? null :
|
|
1414
|
+
}, [e, t, n]), !e || o === null || typeof document > "u" ? null : Qt(
|
|
1415
1415
|
/* @__PURE__ */ r(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
1418
|
-
ref:
|
|
1418
|
+
ref: l,
|
|
1419
1419
|
className: "ll-overflow-popover",
|
|
1420
1420
|
role: "menu",
|
|
1421
1421
|
style: {
|
|
@@ -1431,21 +1431,21 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1431
1431
|
),
|
|
1432
1432
|
document.body
|
|
1433
1433
|
);
|
|
1434
|
-
},
|
|
1434
|
+
}, bi = ({
|
|
1435
1435
|
isMuted: e,
|
|
1436
1436
|
onToggleMute: t,
|
|
1437
1437
|
isCameraEnabled: n,
|
|
1438
1438
|
onToggleCamera: i,
|
|
1439
|
-
allowCamera:
|
|
1439
|
+
allowCamera: l,
|
|
1440
1440
|
isScreenShareEnabled: o,
|
|
1441
1441
|
onToggleScreenShare: s,
|
|
1442
|
-
allowScreenShare:
|
|
1442
|
+
allowScreenShare: a,
|
|
1443
1443
|
isSpeakerMuted: c,
|
|
1444
1444
|
onToggleSpeaker: u,
|
|
1445
1445
|
allowTyping: m,
|
|
1446
1446
|
isTypingOpen: p,
|
|
1447
1447
|
onToggleTyping: h,
|
|
1448
|
-
onDisconnect:
|
|
1448
|
+
onDisconnect: D
|
|
1449
1449
|
}) => {
|
|
1450
1450
|
const [x, E] = M(!1), y = I(null);
|
|
1451
1451
|
return /* @__PURE__ */ k(We, { children: [
|
|
@@ -1463,7 +1463,7 @@ const si = 8, Cn = 8, ci = ({
|
|
|
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(Xn, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
1469
|
/* @__PURE__ */ r(
|
|
@@ -1476,7 +1476,7 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
1478
|
"aria-expanded": x,
|
|
1479
|
-
children: /* @__PURE__ */ r(
|
|
1479
|
+
children: /* @__PURE__ */ r(wi, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
1482
|
/* @__PURE__ */ r(
|
|
@@ -1484,22 +1484,22 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1484
1484
|
{
|
|
1485
1485
|
type: "button",
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
|
-
onClick:
|
|
1487
|
+
onClick: D,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(Jn, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ k(
|
|
1496
|
-
|
|
1496
|
+
vi,
|
|
1497
1497
|
{
|
|
1498
1498
|
open: x,
|
|
1499
1499
|
onClose: () => E(!1),
|
|
1500
1500
|
anchorRef: y,
|
|
1501
1501
|
children: [
|
|
1502
|
-
|
|
1502
|
+
l && /* @__PURE__ */ k(
|
|
1503
1503
|
"button",
|
|
1504
1504
|
{
|
|
1505
1505
|
type: "button",
|
|
@@ -1508,12 +1508,12 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1508
1508
|
i(), E(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ r(
|
|
1511
|
+
/* @__PURE__ */ r(Gn, {}),
|
|
1512
1512
|
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
1515
1515
|
),
|
|
1516
|
-
|
|
1516
|
+
a && /* @__PURE__ */ k(
|
|
1517
1517
|
"button",
|
|
1518
1518
|
{
|
|
1519
1519
|
type: "button",
|
|
@@ -1522,7 +1522,7 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1522
1522
|
s(), E(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */ r(
|
|
1525
|
+
/* @__PURE__ */ r(Yn, {}),
|
|
1526
1526
|
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
@@ -1536,7 +1536,7 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1536
1536
|
u(), E(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ r(
|
|
1539
|
+
/* @__PURE__ */ r(Kn, { muted: c }),
|
|
1540
1540
|
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
@@ -1550,7 +1550,7 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1550
1550
|
h(), E(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */ r(
|
|
1553
|
+
/* @__PURE__ */ r(_i, {}),
|
|
1554
1554
|
/* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
@@ -1573,7 +1573,7 @@ const si = 8, Cn = 8, ci = ({
|
|
|
1573
1573
|
)
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
|
-
function
|
|
1576
|
+
function wi() {
|
|
1577
1577
|
return /* @__PURE__ */ k(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
@@ -1590,7 +1590,7 @@ function di() {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function _i() {
|
|
1594
1594
|
return /* @__PURE__ */ r(
|
|
1595
1595
|
"svg",
|
|
1596
1596
|
{
|
|
@@ -1607,39 +1607,39 @@ function fi() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const xi = ({
|
|
1611
1611
|
position: e,
|
|
1612
1612
|
isMobile: t,
|
|
1613
1613
|
agentName: n,
|
|
1614
1614
|
avatarImageUrl: i,
|
|
1615
|
-
idleLoopUrl:
|
|
1615
|
+
idleLoopUrl: l,
|
|
1616
1616
|
greeting: o,
|
|
1617
1617
|
branding: s,
|
|
1618
|
-
teamMembers:
|
|
1618
|
+
teamMembers: a,
|
|
1619
1619
|
currentTeamMemberId: c,
|
|
1620
1620
|
isSwitchingTeamMember: u,
|
|
1621
1621
|
teamSwitcherOpen: m,
|
|
1622
1622
|
onToggleTeamSwitcher: p,
|
|
1623
1623
|
onSelectTeamMember: h,
|
|
1624
|
-
languageMenuOpen:
|
|
1624
|
+
languageMenuOpen: D,
|
|
1625
1625
|
onToggleLanguageMenu: x,
|
|
1626
1626
|
connectionState: E,
|
|
1627
1627
|
agentState: y,
|
|
1628
1628
|
transcript: w,
|
|
1629
|
-
canResume:
|
|
1629
|
+
canResume: T,
|
|
1630
1630
|
needsUserGesture: S,
|
|
1631
1631
|
error: v,
|
|
1632
1632
|
isMuted: O,
|
|
1633
1633
|
micError: g,
|
|
1634
|
-
micDevices:
|
|
1635
|
-
activeMicId:
|
|
1634
|
+
micDevices: z,
|
|
1635
|
+
activeMicId: B,
|
|
1636
1636
|
isCameraEnabled: K,
|
|
1637
1637
|
cameraPreviewEl: ae,
|
|
1638
|
-
cameraDevices:
|
|
1638
|
+
cameraDevices: H,
|
|
1639
1639
|
activeCameraId: G,
|
|
1640
1640
|
isScreenShareEnabled: f,
|
|
1641
|
-
screenPreviewEl:
|
|
1642
|
-
isSpeakerMuted:
|
|
1641
|
+
screenPreviewEl: A,
|
|
1642
|
+
isSpeakerMuted: $,
|
|
1643
1643
|
allowCamera: q,
|
|
1644
1644
|
allowScreenShare: X,
|
|
1645
1645
|
allowTyping: ee,
|
|
@@ -1649,115 +1649,115 @@ const pi = ({
|
|
|
1649
1649
|
compactControls: U = !1,
|
|
1650
1650
|
transforming: me,
|
|
1651
1651
|
transformingLabel: Q,
|
|
1652
|
-
avatarVideoContainerRef:
|
|
1652
|
+
avatarVideoContainerRef: _e,
|
|
1653
1653
|
agentVideoEl: ne,
|
|
1654
|
-
onConnect:
|
|
1655
|
-
onDisconnect:
|
|
1656
|
-
onRetry:
|
|
1657
|
-
onResumeAudio:
|
|
1658
|
-
onToggleMute:
|
|
1659
|
-
onSwitchMicDevice:
|
|
1660
|
-
onToggleCamera:
|
|
1661
|
-
onSwitchCameraDevice:
|
|
1654
|
+
onConnect: it,
|
|
1655
|
+
onDisconnect: ot,
|
|
1656
|
+
onRetry: yt,
|
|
1657
|
+
onResumeAudio: vt,
|
|
1658
|
+
onToggleMute: lt,
|
|
1659
|
+
onSwitchMicDevice: bt,
|
|
1660
|
+
onToggleCamera: qe,
|
|
1661
|
+
onSwitchCameraDevice: Ue,
|
|
1662
1662
|
onToggleScreenShare: Re,
|
|
1663
|
-
onToggleSpeaker:
|
|
1663
|
+
onToggleSpeaker: De,
|
|
1664
1664
|
onSendMessage: Pe,
|
|
1665
|
-
onMinimize:
|
|
1666
|
-
onClose:
|
|
1667
|
-
onClearMicError:
|
|
1668
|
-
dragHandleProps:
|
|
1665
|
+
onMinimize: ze,
|
|
1666
|
+
onClose: $e,
|
|
1667
|
+
onClearMicError: je,
|
|
1668
|
+
dragHandleProps: He,
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
|
-
var
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1671
|
+
var ut;
|
|
1672
|
+
const Oe = ((a == null ? void 0 : a.length) ?? 0) > 1, Ve = E === "connecting" || E === "connected", xe = E === "connected", wt = E === "idle" || E === "disconnected" || E === "error", [Fe, Ae] = M(!1);
|
|
1673
|
+
R(() => {
|
|
1674
1674
|
if (!ne) {
|
|
1675
|
-
|
|
1675
|
+
Ae(!1);
|
|
1676
1676
|
return;
|
|
1677
1677
|
}
|
|
1678
1678
|
if (!ne.paused && ne.readyState >= 2) {
|
|
1679
|
-
|
|
1679
|
+
Ae(!0);
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
|
-
|
|
1683
|
-
const _ = () =>
|
|
1682
|
+
Ae(!1);
|
|
1683
|
+
const _ = () => Ae(!0);
|
|
1684
1684
|
return ne.addEventListener("playing", _), ne.addEventListener("loadeddata", _), () => {
|
|
1685
1685
|
ne.removeEventListener("playing", _), ne.removeEventListener("loadeddata", _);
|
|
1686
1686
|
};
|
|
1687
1687
|
}, [ne]);
|
|
1688
|
-
const [
|
|
1689
|
-
|
|
1690
|
-
if (!
|
|
1691
|
-
|
|
1688
|
+
const [Rt, _t] = M(!1);
|
|
1689
|
+
R(() => {
|
|
1690
|
+
if (!xe) {
|
|
1691
|
+
_t(!1);
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
if (
|
|
1695
|
-
const _ = setTimeout(() =>
|
|
1694
|
+
if (Fe) return;
|
|
1695
|
+
const _ = setTimeout(() => _t(!0), 8e3);
|
|
1696
1696
|
return () => clearTimeout(_);
|
|
1697
|
-
}, [
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1697
|
+
}, [xe, Fe]);
|
|
1698
|
+
const Be = E === "connecting" || xe && !!i && !Fe && !Rt, ue = I(null), at = I(null);
|
|
1699
|
+
R(() => {
|
|
1700
1700
|
const _ = ue.current;
|
|
1701
1701
|
_ && (_.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", _.appendChild(ae)));
|
|
1702
|
-
}, [ae]),
|
|
1703
|
-
const _ =
|
|
1704
|
-
_ && (_.innerHTML = "",
|
|
1705
|
-
}, [
|
|
1706
|
-
const [le, pe] = M(!1), [
|
|
1707
|
-
|
|
1708
|
-
if (!le && !
|
|
1702
|
+
}, [ae]), R(() => {
|
|
1703
|
+
const _ = at.current;
|
|
1704
|
+
_ && (_.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", _.appendChild(A)));
|
|
1705
|
+
}, [A]);
|
|
1706
|
+
const [le, pe] = M(!1), [Ye, Ge] = M(!1), ge = I(null), Le = I(null);
|
|
1707
|
+
R(() => {
|
|
1708
|
+
if (!le && !Ye && !D && !m) return;
|
|
1709
1709
|
const _ = () => {
|
|
1710
|
-
pe(!1),
|
|
1710
|
+
pe(!1), Ge(!1), D && x(), m && p();
|
|
1711
1711
|
};
|
|
1712
1712
|
return document.addEventListener("click", _), () => document.removeEventListener("click", _);
|
|
1713
1713
|
}, [
|
|
1714
1714
|
le,
|
|
1715
|
-
|
|
1716
|
-
|
|
1715
|
+
Ye,
|
|
1716
|
+
D,
|
|
1717
1717
|
m,
|
|
1718
1718
|
x,
|
|
1719
1719
|
p
|
|
1720
1720
|
]);
|
|
1721
|
-
const [
|
|
1721
|
+
const [xt, Dt] = M(!1), Pt = C(() => Dt((_) => !_), []), [st, zt] = M(""), Ne = C(
|
|
1722
1722
|
(_) => {
|
|
1723
1723
|
_.preventDefault();
|
|
1724
|
-
const re =
|
|
1725
|
-
re && (Pe(re),
|
|
1724
|
+
const re = st.trim();
|
|
1725
|
+
re && (Pe(re), zt(""));
|
|
1726
1726
|
},
|
|
1727
|
-
[
|
|
1727
|
+
[st, Pe]
|
|
1728
1728
|
), Me = s.productName || "Live Layer", Se = !s.productName;
|
|
1729
|
-
let ye = null,
|
|
1729
|
+
let ye = null, Ce = null;
|
|
1730
1730
|
for (let _ = w.length - 1; _ >= 0; _--) {
|
|
1731
1731
|
const re = w[_];
|
|
1732
|
-
if (!ye && re.role === "agent" ? ye = re : !
|
|
1732
|
+
if (!ye && re.role === "agent" ? ye = re : !Ce && re.role === "user" && (Ce = re), ye && Ce) break;
|
|
1733
1733
|
}
|
|
1734
|
-
const
|
|
1734
|
+
const Lt = xe ? (ye == null ? void 0 : ye.text) || null : o || null, Xe = xe && (Ce == null ? void 0 : Ce.text) || null, ct = [
|
|
1735
1735
|
"ll-expanded",
|
|
1736
1736
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1737
1737
|
].join(" ");
|
|
1738
1738
|
return /* @__PURE__ */ k(
|
|
1739
1739
|
"div",
|
|
1740
1740
|
{
|
|
1741
|
-
className:
|
|
1741
|
+
className: ct,
|
|
1742
1742
|
"data-position": e,
|
|
1743
|
-
"data-state":
|
|
1743
|
+
"data-state": xe ? "connected" : Ve ? "connecting" : "idle",
|
|
1744
1744
|
role: "dialog",
|
|
1745
1745
|
"aria-label": `${n} widget`,
|
|
1746
1746
|
children: [
|
|
1747
1747
|
/* @__PURE__ */ k("div", { className: "ll-expanded__bg", children: [
|
|
1748
1748
|
i ? /* @__PURE__ */ r(
|
|
1749
|
-
|
|
1749
|
+
hi,
|
|
1750
1750
|
{
|
|
1751
1751
|
src: i,
|
|
1752
1752
|
alt: n,
|
|
1753
1753
|
className: "ll-expanded__bg-img"
|
|
1754
1754
|
}
|
|
1755
|
-
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1756
|
-
|
|
1755
|
+
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((ut = n == null ? void 0 : n.charAt(0)) == null ? void 0 : ut.toUpperCase()) || "A" }) }),
|
|
1756
|
+
l && !xe && /* @__PURE__ */ r(
|
|
1757
1757
|
"video",
|
|
1758
1758
|
{
|
|
1759
1759
|
className: "ll-expanded__bg-idle",
|
|
1760
|
-
src:
|
|
1760
|
+
src: l,
|
|
1761
1761
|
autoPlay: !0,
|
|
1762
1762
|
loop: !0,
|
|
1763
1763
|
muted: !0,
|
|
@@ -1765,17 +1765,17 @@ const pi = ({
|
|
|
1765
1765
|
}
|
|
1766
1766
|
)
|
|
1767
1767
|
] }),
|
|
1768
|
-
/* @__PURE__ */ r("div", { ref:
|
|
1769
|
-
|
|
1768
|
+
/* @__PURE__ */ r("div", { ref: _e, className: "ll-expanded__video" }),
|
|
1769
|
+
Be && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1770
1770
|
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1771
1771
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
|
|
1772
1772
|
] }),
|
|
1773
|
-
S &&
|
|
1773
|
+
S && xe && /* @__PURE__ */ k(
|
|
1774
1774
|
"button",
|
|
1775
1775
|
{
|
|
1776
1776
|
type: "button",
|
|
1777
1777
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1778
|
-
onClick:
|
|
1778
|
+
onClick: vt,
|
|
1779
1779
|
children: [
|
|
1780
1780
|
/* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1781
1781
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
@@ -1795,8 +1795,8 @@ const pi = ({
|
|
|
1795
1795
|
]
|
|
1796
1796
|
}
|
|
1797
1797
|
),
|
|
1798
|
-
|
|
1799
|
-
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar",
|
|
1798
|
+
Ve ? /* @__PURE__ */ k(We, { children: [
|
|
1799
|
+
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...He, children: [
|
|
1800
1800
|
!oe && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar-left", children: [
|
|
1801
1801
|
/* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1802
1802
|
/* @__PURE__ */ k(
|
|
@@ -1805,23 +1805,23 @@ const pi = ({
|
|
|
1805
1805
|
type: "button",
|
|
1806
1806
|
className: "ll-hpill",
|
|
1807
1807
|
onClick: (_) => {
|
|
1808
|
-
|
|
1808
|
+
Oe && (_.stopPropagation(), p());
|
|
1809
1809
|
},
|
|
1810
|
-
"aria-haspopup":
|
|
1811
|
-
"aria-expanded":
|
|
1810
|
+
"aria-haspopup": Oe ? "listbox" : void 0,
|
|
1811
|
+
"aria-expanded": Oe ? m : void 0,
|
|
1812
1812
|
children: [
|
|
1813
1813
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
|
|
1814
|
-
|
|
1814
|
+
Oe && /* @__PURE__ */ r(Nt, {})
|
|
1815
1815
|
]
|
|
1816
1816
|
}
|
|
1817
1817
|
),
|
|
1818
|
-
|
|
1818
|
+
Oe && m && /* @__PURE__ */ r(
|
|
1819
1819
|
"div",
|
|
1820
1820
|
{
|
|
1821
1821
|
className: "ll-hmenu",
|
|
1822
1822
|
onClick: (_) => _.stopPropagation(),
|
|
1823
1823
|
role: "listbox",
|
|
1824
|
-
children:
|
|
1824
|
+
children: a == null ? void 0 : a.map((_) => /* @__PURE__ */ k(
|
|
1825
1825
|
"button",
|
|
1826
1826
|
{
|
|
1827
1827
|
type: "button",
|
|
@@ -1857,16 +1857,16 @@ const pi = ({
|
|
|
1857
1857
|
_.stopPropagation(), x();
|
|
1858
1858
|
},
|
|
1859
1859
|
"aria-haspopup": "listbox",
|
|
1860
|
-
"aria-expanded":
|
|
1860
|
+
"aria-expanded": D,
|
|
1861
1861
|
"aria-label": "Language: English",
|
|
1862
1862
|
title: "Language: English",
|
|
1863
1863
|
children: [
|
|
1864
1864
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1865
|
-
/* @__PURE__ */ r(
|
|
1865
|
+
/* @__PURE__ */ r(Nt, {})
|
|
1866
1866
|
]
|
|
1867
1867
|
}
|
|
1868
1868
|
),
|
|
1869
|
-
|
|
1869
|
+
D && /* @__PURE__ */ r(
|
|
1870
1870
|
"div",
|
|
1871
1871
|
{
|
|
1872
1872
|
className: "ll-hmenu",
|
|
@@ -1899,10 +1899,10 @@ const pi = ({
|
|
|
1899
1899
|
{
|
|
1900
1900
|
type: "button",
|
|
1901
1901
|
className: "ll-hbtn",
|
|
1902
|
-
onClick:
|
|
1902
|
+
onClick: ze,
|
|
1903
1903
|
"aria-label": "Minimize widget",
|
|
1904
1904
|
title: "Minimize",
|
|
1905
|
-
children: /* @__PURE__ */ r(
|
|
1905
|
+
children: /* @__PURE__ */ r(Nn, {})
|
|
1906
1906
|
}
|
|
1907
1907
|
),
|
|
1908
1908
|
te !== !1 && /* @__PURE__ */ r(
|
|
@@ -1910,10 +1910,10 @@ const pi = ({
|
|
|
1910
1910
|
{
|
|
1911
1911
|
type: "button",
|
|
1912
1912
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1913
|
-
onClick:
|
|
1913
|
+
onClick: $e,
|
|
1914
1914
|
"aria-label": "End call",
|
|
1915
1915
|
title: "End call",
|
|
1916
|
-
children: /* @__PURE__ */ r(
|
|
1916
|
+
children: /* @__PURE__ */ r(An, {})
|
|
1917
1917
|
}
|
|
1918
1918
|
)
|
|
1919
1919
|
] })
|
|
@@ -1931,7 +1931,7 @@ const pi = ({
|
|
|
1931
1931
|
// can always dismiss; making the whole header disappear (the
|
|
1932
1932
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1933
1933
|
// the page itself.
|
|
1934
|
-
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle",
|
|
1934
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...He, children: [
|
|
1935
1935
|
!U && (Se ? /* @__PURE__ */ k(
|
|
1936
1936
|
"a",
|
|
1937
1937
|
{
|
|
@@ -1942,7 +1942,7 @@ const pi = ({
|
|
|
1942
1942
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1943
1943
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1944
1944
|
children: [
|
|
1945
|
-
/* @__PURE__ */ r(
|
|
1945
|
+
/* @__PURE__ */ r(gi, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1946
1946
|
/* @__PURE__ */ r("span", { children: Me })
|
|
1947
1947
|
]
|
|
1948
1948
|
}
|
|
@@ -1953,9 +1953,9 @@ const pi = ({
|
|
|
1953
1953
|
{
|
|
1954
1954
|
type: "button",
|
|
1955
1955
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1956
|
-
onClick:
|
|
1956
|
+
onClick: ze,
|
|
1957
1957
|
"aria-label": "Minimize widget",
|
|
1958
|
-
children: /* @__PURE__ */ r(
|
|
1958
|
+
children: /* @__PURE__ */ r(Nn, {})
|
|
1959
1959
|
}
|
|
1960
1960
|
),
|
|
1961
1961
|
te !== !1 && /* @__PURE__ */ r(
|
|
@@ -1963,23 +1963,23 @@ const pi = ({
|
|
|
1963
1963
|
{
|
|
1964
1964
|
type: "button",
|
|
1965
1965
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1966
|
-
onClick:
|
|
1966
|
+
onClick: $e,
|
|
1967
1967
|
"aria-label": "Close widget",
|
|
1968
|
-
children: /* @__PURE__ */ r(
|
|
1968
|
+
children: /* @__PURE__ */ r(An, {})
|
|
1969
1969
|
}
|
|
1970
1970
|
)
|
|
1971
1971
|
] })
|
|
1972
1972
|
] })
|
|
1973
1973
|
),
|
|
1974
|
-
|
|
1975
|
-
const _ =
|
|
1974
|
+
wt && /* @__PURE__ */ (() => {
|
|
1975
|
+
const _ = T ? "Resume session" : E === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1976
1976
|
return /* @__PURE__ */ k(We, { children: [
|
|
1977
1977
|
!v && /* @__PURE__ */ k(
|
|
1978
1978
|
"button",
|
|
1979
1979
|
{
|
|
1980
1980
|
type: "button",
|
|
1981
1981
|
className: "ll-expanded__play",
|
|
1982
|
-
onClick:
|
|
1982
|
+
onClick: it,
|
|
1983
1983
|
"aria-label": _,
|
|
1984
1984
|
children: [
|
|
1985
1985
|
/* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
@@ -1994,7 +1994,7 @@ const pi = ({
|
|
|
1994
1994
|
{
|
|
1995
1995
|
type: "button",
|
|
1996
1996
|
className: "ll-expanded__cta",
|
|
1997
|
-
onClick:
|
|
1997
|
+
onClick: it,
|
|
1998
1998
|
"aria-label": _,
|
|
1999
1999
|
children: _
|
|
2000
2000
|
}
|
|
@@ -2005,12 +2005,12 @@ const pi = ({
|
|
|
2005
2005
|
/* @__PURE__ */ k(
|
|
2006
2006
|
"div",
|
|
2007
2007
|
{
|
|
2008
|
-
className: `ll-expanded__pip ${
|
|
2008
|
+
className: `ll-expanded__pip ${Ve && (K || f) ? "is-visible" : ""}`,
|
|
2009
2009
|
children: [
|
|
2010
2010
|
/* @__PURE__ */ r(
|
|
2011
2011
|
"div",
|
|
2012
2012
|
{
|
|
2013
|
-
ref:
|
|
2013
|
+
ref: at,
|
|
2014
2014
|
className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2015
2015
|
}
|
|
2016
2016
|
),
|
|
@@ -2024,21 +2024,21 @@ const pi = ({
|
|
|
2024
2024
|
]
|
|
2025
2025
|
}
|
|
2026
2026
|
),
|
|
2027
|
-
|
|
2028
|
-
!U &&
|
|
2027
|
+
Ve ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
|
|
2028
|
+
!U && Lt && /* @__PURE__ */ r(
|
|
2029
2029
|
"div",
|
|
2030
2030
|
{
|
|
2031
2031
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
2032
2032
|
"data-role": "agent",
|
|
2033
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2033
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Lt })
|
|
2034
2034
|
}
|
|
2035
2035
|
),
|
|
2036
|
-
!U &&
|
|
2036
|
+
!U && Xe && /* @__PURE__ */ r(
|
|
2037
2037
|
"div",
|
|
2038
2038
|
{
|
|
2039
2039
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
2040
2040
|
"data-role": "user",
|
|
2041
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2041
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Xe })
|
|
2042
2042
|
}
|
|
2043
2043
|
),
|
|
2044
2044
|
!oe && !U && /* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (_) => _.stopPropagation(), children: [
|
|
@@ -2050,7 +2050,7 @@ const pi = ({
|
|
|
2050
2050
|
onClick: Re,
|
|
2051
2051
|
"aria-label": f ? "Stop sharing screen" : "Share screen",
|
|
2052
2052
|
title: f ? "Stop sharing" : "Share screen",
|
|
2053
|
-
children: /* @__PURE__ */ r(
|
|
2053
|
+
children: /* @__PURE__ */ r(Yn, {})
|
|
2054
2054
|
}
|
|
2055
2055
|
),
|
|
2056
2056
|
q && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
|
|
@@ -2059,36 +2059,36 @@ const pi = ({
|
|
|
2059
2059
|
{
|
|
2060
2060
|
type: "button",
|
|
2061
2061
|
className: `ll-tool ll-tool--left ${K ? "is-on" : ""}`,
|
|
2062
|
-
onClick:
|
|
2062
|
+
onClick: qe,
|
|
2063
2063
|
"aria-label": K ? "Turn off camera" : "Turn on camera",
|
|
2064
2064
|
title: K ? "Stop camera" : "Start camera",
|
|
2065
|
-
children: /* @__PURE__ */ r(
|
|
2065
|
+
children: /* @__PURE__ */ r(Gn, {})
|
|
2066
2066
|
}
|
|
2067
2067
|
),
|
|
2068
2068
|
/* @__PURE__ */ r(
|
|
2069
2069
|
"button",
|
|
2070
2070
|
{
|
|
2071
|
-
ref:
|
|
2071
|
+
ref: Le,
|
|
2072
2072
|
type: "button",
|
|
2073
2073
|
className: `ll-tool ll-tool--right ${K ? "is-on" : ""}`,
|
|
2074
2074
|
onClick: (_) => {
|
|
2075
|
-
_.stopPropagation(),
|
|
2075
|
+
_.stopPropagation(), Ge((re) => !re), pe(!1);
|
|
2076
2076
|
},
|
|
2077
2077
|
"aria-label": "Camera devices",
|
|
2078
2078
|
"aria-haspopup": "listbox",
|
|
2079
|
-
"aria-expanded":
|
|
2080
|
-
children: /* @__PURE__ */ r(
|
|
2079
|
+
"aria-expanded": Ye,
|
|
2080
|
+
children: /* @__PURE__ */ r(Nt, {})
|
|
2081
2081
|
}
|
|
2082
2082
|
),
|
|
2083
|
-
|
|
2084
|
-
|
|
2083
|
+
Ye && H.length > 0 && /* @__PURE__ */ r(
|
|
2084
|
+
Mn,
|
|
2085
2085
|
{
|
|
2086
2086
|
label: "Camera",
|
|
2087
|
-
devices:
|
|
2087
|
+
devices: H,
|
|
2088
2088
|
activeId: G,
|
|
2089
|
-
anchorRef:
|
|
2089
|
+
anchorRef: Le,
|
|
2090
2090
|
onPick: (_) => {
|
|
2091
|
-
|
|
2091
|
+
Ge(!1), Ue(_);
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
2094
|
)
|
|
@@ -2099,10 +2099,10 @@ const pi = ({
|
|
|
2099
2099
|
{
|
|
2100
2100
|
type: "button",
|
|
2101
2101
|
className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
|
|
2102
|
-
onClick:
|
|
2102
|
+
onClick: lt,
|
|
2103
2103
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2104
2104
|
title: O ? "Unmute" : "Mute",
|
|
2105
|
-
children: /* @__PURE__ */ r(
|
|
2105
|
+
children: /* @__PURE__ */ r(Xn, { muted: O })
|
|
2106
2106
|
}
|
|
2107
2107
|
),
|
|
2108
2108
|
/* @__PURE__ */ r(
|
|
@@ -2112,23 +2112,23 @@ const pi = ({
|
|
|
2112
2112
|
type: "button",
|
|
2113
2113
|
className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
|
|
2114
2114
|
onClick: (_) => {
|
|
2115
|
-
_.stopPropagation(), pe((re) => !re),
|
|
2115
|
+
_.stopPropagation(), pe((re) => !re), Ge(!1);
|
|
2116
2116
|
},
|
|
2117
2117
|
"aria-label": "Microphone devices",
|
|
2118
2118
|
"aria-haspopup": "listbox",
|
|
2119
2119
|
"aria-expanded": le,
|
|
2120
|
-
children: /* @__PURE__ */ r(
|
|
2120
|
+
children: /* @__PURE__ */ r(Nt, {})
|
|
2121
2121
|
}
|
|
2122
2122
|
),
|
|
2123
|
-
le &&
|
|
2124
|
-
|
|
2123
|
+
le && z.length > 0 && /* @__PURE__ */ r(
|
|
2124
|
+
Mn,
|
|
2125
2125
|
{
|
|
2126
2126
|
label: "Microphone",
|
|
2127
|
-
devices:
|
|
2128
|
-
activeId:
|
|
2127
|
+
devices: z,
|
|
2128
|
+
activeId: B,
|
|
2129
2129
|
anchorRef: ge,
|
|
2130
2130
|
onPick: (_) => {
|
|
2131
|
-
pe(!1),
|
|
2131
|
+
pe(!1), bt(_);
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
2134
|
)
|
|
@@ -2137,11 +2137,11 @@ const pi = ({
|
|
|
2137
2137
|
"button",
|
|
2138
2138
|
{
|
|
2139
2139
|
type: "button",
|
|
2140
|
-
className: `ll-tool ${
|
|
2141
|
-
onClick:
|
|
2142
|
-
"aria-label":
|
|
2143
|
-
title:
|
|
2144
|
-
children: /* @__PURE__ */ r(
|
|
2140
|
+
className: `ll-tool ${$ ? "is-muted" : ""}`,
|
|
2141
|
+
onClick: De,
|
|
2142
|
+
"aria-label": $ ? "Unmute speaker" : "Mute speaker",
|
|
2143
|
+
title: $ ? "Unmute speaker" : "Mute speaker",
|
|
2144
|
+
children: /* @__PURE__ */ r(Kn, { muted: $ })
|
|
2145
2145
|
}
|
|
2146
2146
|
),
|
|
2147
2147
|
/* @__PURE__ */ r(
|
|
@@ -2149,51 +2149,51 @@ const pi = ({
|
|
|
2149
2149
|
{
|
|
2150
2150
|
type: "button",
|
|
2151
2151
|
className: "ll-tool ll-tool--danger",
|
|
2152
|
-
onClick:
|
|
2152
|
+
onClick: ot,
|
|
2153
2153
|
"aria-label": "End conversation",
|
|
2154
2154
|
title: "End conversation",
|
|
2155
|
-
children: /* @__PURE__ */ r(
|
|
2155
|
+
children: /* @__PURE__ */ r(Jn, {})
|
|
2156
2156
|
}
|
|
2157
2157
|
)
|
|
2158
2158
|
] }),
|
|
2159
2159
|
!oe && U && /* @__PURE__ */ r(
|
|
2160
|
-
|
|
2160
|
+
bi,
|
|
2161
2161
|
{
|
|
2162
2162
|
isMuted: O,
|
|
2163
|
-
onToggleMute:
|
|
2163
|
+
onToggleMute: lt,
|
|
2164
2164
|
isCameraEnabled: K,
|
|
2165
|
-
onToggleCamera:
|
|
2165
|
+
onToggleCamera: qe,
|
|
2166
2166
|
allowCamera: q,
|
|
2167
2167
|
isScreenShareEnabled: f,
|
|
2168
2168
|
onToggleScreenShare: Re,
|
|
2169
2169
|
allowScreenShare: X,
|
|
2170
|
-
isSpeakerMuted:
|
|
2171
|
-
onToggleSpeaker:
|
|
2170
|
+
isSpeakerMuted: $,
|
|
2171
|
+
onToggleSpeaker: De,
|
|
2172
2172
|
allowTyping: ee,
|
|
2173
|
-
isTypingOpen:
|
|
2174
|
-
onToggleTyping:
|
|
2175
|
-
onDisconnect:
|
|
2173
|
+
isTypingOpen: xt,
|
|
2174
|
+
onToggleTyping: Pt,
|
|
2175
|
+
onDisconnect: ot
|
|
2176
2176
|
}
|
|
2177
2177
|
),
|
|
2178
|
-
!oe && ee && (U ?
|
|
2178
|
+
!oe && ee && (U ? xt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ne, children: [
|
|
2179
2179
|
/* @__PURE__ */ r(
|
|
2180
2180
|
"input",
|
|
2181
2181
|
{
|
|
2182
2182
|
type: "text",
|
|
2183
2183
|
className: "ll-message-input__field",
|
|
2184
2184
|
placeholder: "Message...",
|
|
2185
|
-
value:
|
|
2186
|
-
onChange: (_) =>
|
|
2185
|
+
value: st,
|
|
2186
|
+
onChange: (_) => zt(_.target.value),
|
|
2187
2187
|
"aria-label": "Message the agent"
|
|
2188
2188
|
}
|
|
2189
2189
|
),
|
|
2190
|
-
|
|
2190
|
+
st.trim() && /* @__PURE__ */ r(
|
|
2191
2191
|
"button",
|
|
2192
2192
|
{
|
|
2193
2193
|
type: "submit",
|
|
2194
2194
|
className: "ll-message-input__send",
|
|
2195
2195
|
"aria-label": "Send message",
|
|
2196
|
-
children: /* @__PURE__ */ r(
|
|
2196
|
+
children: /* @__PURE__ */ r(Li, {})
|
|
2197
2197
|
}
|
|
2198
2198
|
)
|
|
2199
2199
|
] })
|
|
@@ -2207,7 +2207,7 @@ const pi = ({
|
|
|
2207
2207
|
{
|
|
2208
2208
|
type: "button",
|
|
2209
2209
|
className: "ll-expanded__banner-x",
|
|
2210
|
-
onClick:
|
|
2210
|
+
onClick: je,
|
|
2211
2211
|
"aria-label": "Dismiss",
|
|
2212
2212
|
children: "×"
|
|
2213
2213
|
}
|
|
@@ -2222,7 +2222,7 @@ const pi = ({
|
|
|
2222
2222
|
{
|
|
2223
2223
|
type: "button",
|
|
2224
2224
|
className: "ll-expanded__banner-retry",
|
|
2225
|
-
onClick:
|
|
2225
|
+
onClick: yt,
|
|
2226
2226
|
children: re
|
|
2227
2227
|
}
|
|
2228
2228
|
)
|
|
@@ -2244,32 +2244,32 @@ const pi = ({
|
|
|
2244
2244
|
}
|
|
2245
2245
|
);
|
|
2246
2246
|
};
|
|
2247
|
-
function
|
|
2247
|
+
function Nt() {
|
|
2248
2248
|
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" }) });
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function An() {
|
|
2251
2251
|
return /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
2252
2252
|
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2253
2253
|
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2254
2254
|
] });
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2256
|
+
function Nn() {
|
|
2257
2257
|
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" }) });
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2259
|
+
function Yn() {
|
|
2260
2260
|
return /* @__PURE__ */ k("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: [
|
|
2261
2261
|
/* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
2262
2262
|
/* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2263
2263
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
2264
2264
|
] });
|
|
2265
2265
|
}
|
|
2266
|
-
function
|
|
2266
|
+
function Gn() {
|
|
2267
2267
|
return /* @__PURE__ */ k("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: [
|
|
2268
2268
|
/* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2269
2269
|
/* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2270
2270
|
] });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function Xn({ muted: e }) {
|
|
2273
2273
|
return /* @__PURE__ */ k("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("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2275
2275
|
/* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -2277,7 +2277,7 @@ function Bn({ muted: e }) {
|
|
|
2277
2277
|
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2278
2278
|
] });
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function Kn({ muted: e }) {
|
|
2281
2281
|
return /* @__PURE__ */ k("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: [
|
|
2282
2282
|
/* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2283
2283
|
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(We, { children: [
|
|
@@ -2286,13 +2286,13 @@ function qn({ muted: e }) {
|
|
|
2286
2286
|
] })
|
|
2287
2287
|
] });
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2289
|
+
function Li() {
|
|
2290
2290
|
return /* @__PURE__ */ k("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2291
2291
|
/* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2292
2292
|
/* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
|
|
2293
2293
|
] });
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function Jn() {
|
|
2296
2296
|
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(
|
|
2297
2297
|
"path",
|
|
2298
2298
|
{
|
|
@@ -2301,17 +2301,17 @@ function Un() {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
) });
|
|
2303
2303
|
}
|
|
2304
|
-
const
|
|
2304
|
+
const Mn = ({
|
|
2305
2305
|
label: e,
|
|
2306
2306
|
devices: t,
|
|
2307
2307
|
activeId: n,
|
|
2308
2308
|
onPick: i,
|
|
2309
|
-
anchorRef:
|
|
2309
|
+
anchorRef: l
|
|
2310
2310
|
}) => {
|
|
2311
2311
|
const [o, s] = M(null);
|
|
2312
|
-
return
|
|
2313
|
-
const
|
|
2314
|
-
const c =
|
|
2312
|
+
return Wn(() => {
|
|
2313
|
+
const a = () => {
|
|
2314
|
+
const c = l.current;
|
|
2315
2315
|
if (!c) return;
|
|
2316
2316
|
const u = c.getBoundingClientRect(), m = 126, p = window.innerWidth - 16 - 110, h = u.left + u.width / 2;
|
|
2317
2317
|
s({
|
|
@@ -2319,15 +2319,15 @@ const En = ({
|
|
|
2319
2319
|
left: Math.max(m, Math.min(p, h))
|
|
2320
2320
|
});
|
|
2321
2321
|
};
|
|
2322
|
-
return
|
|
2323
|
-
window.removeEventListener("scroll",
|
|
2322
|
+
return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
2323
|
+
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
2324
2324
|
};
|
|
2325
|
-
}, [
|
|
2325
|
+
}, [l]), o === null || typeof document > "u" ? null : Qt(
|
|
2326
2326
|
/* @__PURE__ */ k(
|
|
2327
2327
|
"div",
|
|
2328
2328
|
{
|
|
2329
2329
|
className: "ll-device-menu ll-device-menu--floating",
|
|
2330
|
-
onClick: (
|
|
2330
|
+
onClick: (a) => a.stopPropagation(),
|
|
2331
2331
|
role: "listbox",
|
|
2332
2332
|
style: {
|
|
2333
2333
|
position: "fixed",
|
|
@@ -2338,22 +2338,22 @@ const En = ({
|
|
|
2338
2338
|
},
|
|
2339
2339
|
children: [
|
|
2340
2340
|
/* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
|
|
2341
|
-
t.map((
|
|
2342
|
-
const u = n ===
|
|
2341
|
+
t.map((a, c) => {
|
|
2342
|
+
const u = n === a.deviceId;
|
|
2343
2343
|
return /* @__PURE__ */ k(
|
|
2344
2344
|
"button",
|
|
2345
2345
|
{
|
|
2346
2346
|
type: "button",
|
|
2347
2347
|
className: `ll-device-menu__item ${u ? "is-active" : ""}`,
|
|
2348
|
-
onClick: () => i(
|
|
2348
|
+
onClick: () => i(a.deviceId),
|
|
2349
2349
|
role: "option",
|
|
2350
2350
|
"aria-selected": u,
|
|
2351
2351
|
children: [
|
|
2352
2352
|
u && /* @__PURE__ */ r("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
2353
|
-
/* @__PURE__ */ r("span", { className: "ll-device-menu__name", children:
|
|
2353
|
+
/* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: a.label || `${e} ${c + 1}` })
|
|
2354
2354
|
]
|
|
2355
2355
|
},
|
|
2356
|
-
|
|
2356
|
+
a.deviceId || c
|
|
2357
2357
|
);
|
|
2358
2358
|
})
|
|
2359
2359
|
]
|
|
@@ -2361,7 +2361,7 @@ const En = ({
|
|
|
2361
2361
|
),
|
|
2362
2362
|
document.body
|
|
2363
2363
|
);
|
|
2364
|
-
},
|
|
2364
|
+
}, Ci = [
|
|
2365
2365
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2366
2366
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2367
2367
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2369,17 +2369,17 @@ const En = ({
|
|
|
2369
2369
|
"[data-ll-skip]",
|
|
2370
2370
|
".ll-widget"
|
|
2371
2371
|
];
|
|
2372
|
-
function
|
|
2372
|
+
function Tt(e) {
|
|
2373
2373
|
let t = e;
|
|
2374
2374
|
for (; t; ) {
|
|
2375
|
-
for (const n of
|
|
2375
|
+
for (const n of Ci)
|
|
2376
2376
|
if (t.matches(n)) return !0;
|
|
2377
2377
|
t = t.parentElement;
|
|
2378
2378
|
}
|
|
2379
2379
|
return !1;
|
|
2380
2380
|
}
|
|
2381
|
-
function
|
|
2382
|
-
if (
|
|
2381
|
+
function Kt(e) {
|
|
2382
|
+
if (Tt(e)) return !1;
|
|
2383
2383
|
if (e instanceof HTMLInputElement) {
|
|
2384
2384
|
if (e.type === "password") return !1;
|
|
2385
2385
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2387,7 +2387,111 @@ function Vt(e) {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
return !0;
|
|
2389
2389
|
}
|
|
2390
|
-
const
|
|
2390
|
+
const ki = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, In = /\b(back|previous|prev|go\s*back)\b|←|‹/i, Si = /\b(submit|finish|done|complete|send)\b/i, gt = /* @__PURE__ */ new Map();
|
|
2391
|
+
function Tn(e) {
|
|
2392
|
+
const t = gt.get(e);
|
|
2393
|
+
return t && t.isConnected ? t : null;
|
|
2394
|
+
}
|
|
2395
|
+
function et(e) {
|
|
2396
|
+
if (Tt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
|
|
2397
|
+
const t = typeof window < "u" && window.getComputedStyle ? window.getComputedStyle(e) : null;
|
|
2398
|
+
return !!(t && (t.display === "none" || t.visibility === "hidden"));
|
|
2399
|
+
}
|
|
2400
|
+
function Ei(e) {
|
|
2401
|
+
return !!(e.disabled || e.getAttribute("aria-disabled") === "true");
|
|
2402
|
+
}
|
|
2403
|
+
function Ai(e) {
|
|
2404
|
+
return (e.innerText || e.textContent || e.getAttribute("aria-label") || e.value || "").trim();
|
|
2405
|
+
}
|
|
2406
|
+
function Ni(e) {
|
|
2407
|
+
return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
|
|
2408
|
+
(n) => !et(n) && !Ei(n)
|
|
2409
|
+
);
|
|
2410
|
+
}
|
|
2411
|
+
function Zn(e) {
|
|
2412
|
+
gt.clear();
|
|
2413
|
+
const t = Ni(e);
|
|
2414
|
+
let n, i, l;
|
|
2415
|
+
for (const a of t) {
|
|
2416
|
+
const c = Ai(a);
|
|
2417
|
+
if (!c || c.length > 40) continue;
|
|
2418
|
+
const u = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
|
|
2419
|
+
!n && ki.test(c) && !In.test(c) ? (n = { id: "ll-advance", label: c }, gt.set("ll-advance", a)) : !i && In.test(c) ? (i = { id: "ll-back", label: c }, gt.set("ll-back", a)) : !l && (Si.test(c) || u) && (l = { id: "ll-submit", label: c }, gt.set("ll-submit", a));
|
|
2420
|
+
}
|
|
2421
|
+
const o = zi(e);
|
|
2422
|
+
return { kind: n || o.totalSteps ? "multi-step" : "single-page", advance: n, back: i, submit: l, ...o };
|
|
2423
|
+
}
|
|
2424
|
+
const Mi = 60;
|
|
2425
|
+
function Qn(e) {
|
|
2426
|
+
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Mi);
|
|
2427
|
+
}
|
|
2428
|
+
function Ii(e) {
|
|
2429
|
+
const t = e.getAttribute("class");
|
|
2430
|
+
return t ? t.toLowerCase() : "";
|
|
2431
|
+
}
|
|
2432
|
+
const Ti = /stepper|wizard|ant-steps|step-indicator/;
|
|
2433
|
+
function Ri(e) {
|
|
2434
|
+
return Ti.test(Ii(e));
|
|
2435
|
+
}
|
|
2436
|
+
function Rn(e) {
|
|
2437
|
+
const t = e.getAttribute("aria-current");
|
|
2438
|
+
return t === "step" || t === "true" ? !0 : Array.from(e.classList).some(
|
|
2439
|
+
(n) => /(^|[-_])(active|current|selected)([-_]|$)/i.test(n)
|
|
2440
|
+
);
|
|
2441
|
+
}
|
|
2442
|
+
const Di = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
|
|
2443
|
+
function Pi(e) {
|
|
2444
|
+
return Rn(e) ? !0 : Array.from(e.querySelectorAll(Di)).some(
|
|
2445
|
+
Rn
|
|
2446
|
+
);
|
|
2447
|
+
}
|
|
2448
|
+
function Dn(e, t) {
|
|
2449
|
+
const n = Qn(
|
|
2450
|
+
e[t].innerText || e[t].textContent || ""
|
|
2451
|
+
);
|
|
2452
|
+
return {
|
|
2453
|
+
totalSteps: e.length,
|
|
2454
|
+
currentStep: t + 1,
|
|
2455
|
+
...n ? { stepLabel: n } : {}
|
|
2456
|
+
};
|
|
2457
|
+
}
|
|
2458
|
+
function zi(e) {
|
|
2459
|
+
const t = e.querySelector('[aria-current="step"]');
|
|
2460
|
+
if (t && t.parentElement && !et(t)) {
|
|
2461
|
+
const l = Array.from(t.parentElement.children).filter(
|
|
2462
|
+
(s) => s.tagName === t.tagName && !et(s)
|
|
2463
|
+
), o = l.indexOf(t);
|
|
2464
|
+
if (o >= 0 && l.length >= 2) return Dn(l, o);
|
|
2465
|
+
}
|
|
2466
|
+
const n = e.querySelector('[role="progressbar"]');
|
|
2467
|
+
if (n && !et(n)) {
|
|
2468
|
+
const l = Number(n.getAttribute("aria-valuenow")), o = Number(n.getAttribute("aria-valuemax"));
|
|
2469
|
+
if (Number.isFinite(l) && Number.isFinite(o) && o >= 2) {
|
|
2470
|
+
const s = (n.getAttribute("aria-valuetext") || "").trim();
|
|
2471
|
+
return {
|
|
2472
|
+
totalSteps: o,
|
|
2473
|
+
currentStep: l,
|
|
2474
|
+
...s ? { stepLabel: Qn(s) } : {}
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
const i = Array.from(
|
|
2479
|
+
e.querySelectorAll(
|
|
2480
|
+
'[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
|
|
2481
|
+
)
|
|
2482
|
+
).filter((l) => !et(l) && Ri(l));
|
|
2483
|
+
for (const l of i) {
|
|
2484
|
+
const o = Array.from(l.children).filter(
|
|
2485
|
+
(a) => !et(a) && (a.textContent || "").trim().length > 0
|
|
2486
|
+
);
|
|
2487
|
+
if (o.length < 2 || o.length > 12) continue;
|
|
2488
|
+
const s = o.findIndex(Pi);
|
|
2489
|
+
if (!(s < 0))
|
|
2490
|
+
return Dn(o, s);
|
|
2491
|
+
}
|
|
2492
|
+
return {};
|
|
2493
|
+
}
|
|
2494
|
+
const Mt = 4096, $i = 20, Hi = 20, Oi = 10, Fi = 10, Bi = 30, Wi = 20, Pn = 500, qi = [
|
|
2391
2495
|
'[data-ll-private="true"]',
|
|
2392
2496
|
".ll-widget",
|
|
2393
2497
|
"script",
|
|
@@ -2395,24 +2499,24 @@ const Et = 4096, gi = 20, yi = 20, vi = 10, bi = 10, wi = 30, _i = 20, Nn = 500,
|
|
|
2395
2499
|
"noscript",
|
|
2396
2500
|
"iframe"
|
|
2397
2501
|
];
|
|
2398
|
-
function
|
|
2502
|
+
function ht(e) {
|
|
2399
2503
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2400
2504
|
let t = e;
|
|
2401
2505
|
for (; t; ) {
|
|
2402
|
-
for (const n of
|
|
2506
|
+
for (const n of qi)
|
|
2403
2507
|
if (t.matches(n)) return !0;
|
|
2404
2508
|
t = t.parentElement;
|
|
2405
2509
|
}
|
|
2406
2510
|
return !1;
|
|
2407
2511
|
}
|
|
2408
|
-
function
|
|
2512
|
+
function mt(e) {
|
|
2409
2513
|
if (typeof window > "u") return !0;
|
|
2410
2514
|
const t = e.getBoundingClientRect();
|
|
2411
2515
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2412
2516
|
const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2413
2517
|
return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
|
|
2414
2518
|
}
|
|
2415
|
-
function
|
|
2519
|
+
function zn(e) {
|
|
2416
2520
|
const t = e.getAttribute("id");
|
|
2417
2521
|
if (t) {
|
|
2418
2522
|
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
@@ -2423,29 +2527,29 @@ function An(e) {
|
|
|
2423
2527
|
const i = e.closest("label");
|
|
2424
2528
|
if (i) {
|
|
2425
2529
|
const o = [];
|
|
2426
|
-
for (const
|
|
2427
|
-
if (
|
|
2428
|
-
const c = (
|
|
2530
|
+
for (const a of Array.from(i.childNodes))
|
|
2531
|
+
if (a.nodeType === Node.TEXT_NODE) {
|
|
2532
|
+
const c = (a.textContent || "").trim();
|
|
2429
2533
|
c && o.push(c);
|
|
2430
|
-
} else if (
|
|
2431
|
-
if (
|
|
2534
|
+
} else if (a instanceof HTMLElement) {
|
|
2535
|
+
if (a instanceof HTMLInputElement || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement || a instanceof HTMLButtonElement)
|
|
2432
2536
|
continue;
|
|
2433
|
-
const c = (
|
|
2537
|
+
const c = (a.textContent || "").trim();
|
|
2434
2538
|
c && o.push(c);
|
|
2435
2539
|
}
|
|
2436
2540
|
const s = o.join(" ").trim();
|
|
2437
2541
|
if (s) return s;
|
|
2438
2542
|
}
|
|
2439
|
-
const
|
|
2440
|
-
return
|
|
2543
|
+
const l = e.getAttribute("placeholder");
|
|
2544
|
+
return l ? l.trim() : "";
|
|
2441
2545
|
}
|
|
2442
2546
|
function fe(e, t) {
|
|
2443
2547
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2444
2548
|
}
|
|
2445
|
-
function
|
|
2549
|
+
function Ui(e) {
|
|
2446
2550
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2447
2551
|
}
|
|
2448
|
-
function
|
|
2552
|
+
function ji(e) {
|
|
2449
2553
|
const t = e.getAttribute("aria-label");
|
|
2450
2554
|
if (t) return t.trim().slice(0, 80);
|
|
2451
2555
|
const n = e.getAttribute("aria-labelledby");
|
|
@@ -2461,20 +2565,20 @@ function Ci(e) {
|
|
|
2461
2565
|
if (o && o.length < 60 && !/^(submit|ok|continue)$/i.test(o))
|
|
2462
2566
|
return o;
|
|
2463
2567
|
}
|
|
2464
|
-
let
|
|
2465
|
-
for (let o = 0;
|
|
2466
|
-
const s =
|
|
2568
|
+
let l = e.parentElement;
|
|
2569
|
+
for (let o = 0; l && o < 4; o++, l = l.parentElement) {
|
|
2570
|
+
const s = l.querySelector("h1, h2, h3, h4");
|
|
2467
2571
|
if (s != null && s.textContent) {
|
|
2468
|
-
const
|
|
2469
|
-
if (
|
|
2572
|
+
const a = s.textContent.trim();
|
|
2573
|
+
if (a && a.length < 80) return a;
|
|
2470
2574
|
}
|
|
2471
2575
|
}
|
|
2472
2576
|
return null;
|
|
2473
2577
|
}
|
|
2474
|
-
function
|
|
2578
|
+
function Qe(e) {
|
|
2475
2579
|
return e.length;
|
|
2476
2580
|
}
|
|
2477
|
-
function
|
|
2581
|
+
function Vi(e, t = {}) {
|
|
2478
2582
|
const n = t.doc ?? (typeof document < "u" ? document : null);
|
|
2479
2583
|
if (!n)
|
|
2480
2584
|
return {
|
|
@@ -2488,39 +2592,39 @@ function ki(e, t = {}) {
|
|
|
2488
2592
|
forms: [],
|
|
2489
2593
|
extras: e
|
|
2490
2594
|
};
|
|
2491
|
-
const i = typeof window < "u" && window.location.href || "",
|
|
2595
|
+
const i = typeof window < "u" && window.location.href || "", l = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
|
|
2492
2596
|
n.querySelectorAll("[data-ll-region]")
|
|
2493
|
-
),
|
|
2597
|
+
), a = [];
|
|
2494
2598
|
for (const g of s) {
|
|
2495
|
-
if (
|
|
2496
|
-
if (
|
|
2497
|
-
const
|
|
2599
|
+
if (a.length >= Oi) break;
|
|
2600
|
+
if (ht(g) || !mt(g)) continue;
|
|
2601
|
+
const z = g.getAttribute("data-ll-region") ?? "", B = g.getAttribute("data-ll-intent") ?? void 0, K = fe(
|
|
2498
2602
|
(g.innerText || g.textContent || "").trim(),
|
|
2499
|
-
|
|
2603
|
+
Pn * 2
|
|
2500
2604
|
);
|
|
2501
|
-
!
|
|
2605
|
+
!z || !K || a.push({ id: z, intent: B, text: K });
|
|
2502
2606
|
}
|
|
2503
2607
|
const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
|
|
2504
2608
|
n.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2505
2609
|
);
|
|
2506
2610
|
for (const g of m) {
|
|
2507
|
-
if (
|
|
2508
|
-
const
|
|
2509
|
-
|
|
2611
|
+
if (ht(g) || !mt(g)) continue;
|
|
2612
|
+
const z = (g.textContent || "").trim();
|
|
2613
|
+
z && c.push(`${g.tagName}: ${fe(z, 200)}`);
|
|
2510
2614
|
}
|
|
2511
2615
|
const p = Array.from(n.querySelectorAll("p, li"));
|
|
2512
2616
|
for (const g of p) {
|
|
2513
|
-
if (
|
|
2514
|
-
const
|
|
2515
|
-
|
|
2617
|
+
if (ht(g) || !mt(g) || u.includes(g.tagName)) continue;
|
|
2618
|
+
const z = (g.textContent || "").trim();
|
|
2619
|
+
z.length > 10 && c.push(fe(z, Pn));
|
|
2516
2620
|
}
|
|
2517
2621
|
const h = c.join(`
|
|
2518
|
-
`),
|
|
2622
|
+
`), D = [], x = Array.from(n.querySelectorAll("a[href]"));
|
|
2519
2623
|
for (const g of x) {
|
|
2520
|
-
if (
|
|
2521
|
-
if (
|
|
2522
|
-
const
|
|
2523
|
-
!
|
|
2624
|
+
if (D.length >= $i) break;
|
|
2625
|
+
if (ht(g) || !mt(g)) continue;
|
|
2626
|
+
const z = g.getAttribute("href") || "", B = (g.textContent || "").trim();
|
|
2627
|
+
!z || !B || D.push({ href: z, text: fe(B, 100) });
|
|
2524
2628
|
}
|
|
2525
2629
|
const E = [], y = Array.from(
|
|
2526
2630
|
n.querySelectorAll(
|
|
@@ -2528,34 +2632,34 @@ function ki(e, t = {}) {
|
|
|
2528
2632
|
)
|
|
2529
2633
|
);
|
|
2530
2634
|
for (const g of y) {
|
|
2531
|
-
if (E.length >=
|
|
2532
|
-
if (
|
|
2533
|
-
const
|
|
2534
|
-
|
|
2635
|
+
if (E.length >= Hi) break;
|
|
2636
|
+
if (ht(g) || !Kt(g) || !mt(g)) continue;
|
|
2637
|
+
const z = zn(g), B = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
2638
|
+
z && E.push({ label: fe(z, 100), type: B });
|
|
2535
2639
|
}
|
|
2536
|
-
const w = Array.from(n.querySelectorAll("form")),
|
|
2640
|
+
const w = Array.from(n.querySelectorAll("form")), T = [];
|
|
2537
2641
|
let S = 0;
|
|
2538
2642
|
for (const g of w) {
|
|
2539
|
-
if (
|
|
2540
|
-
if (
|
|
2541
|
-
const
|
|
2643
|
+
if (T.length >= Fi) break;
|
|
2644
|
+
if (Tt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
|
|
2645
|
+
const z = g.getAttribute("id") || g.getAttribute("name") || Ui(g.getAttribute("data-ll-intent")) || `form_${S++}`, B = g.getAttribute("data-ll-intent") || ji(g) || void 0, K = Array.from(
|
|
2542
2646
|
g.querySelectorAll(
|
|
2543
2647
|
"input, textarea, select"
|
|
2544
2648
|
)
|
|
2545
2649
|
), ae = [];
|
|
2546
|
-
let
|
|
2650
|
+
let H = 0;
|
|
2547
2651
|
const G = /* @__PURE__ */ new Set();
|
|
2548
2652
|
for (const f of K) {
|
|
2549
|
-
if (ae.length >=
|
|
2550
|
-
if (!
|
|
2653
|
+
if (ae.length >= Bi) break;
|
|
2654
|
+
if (!Kt(f)) continue;
|
|
2551
2655
|
if (f instanceof HTMLInputElement) {
|
|
2552
2656
|
const U = f.type;
|
|
2553
2657
|
if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
|
|
2554
2658
|
}
|
|
2555
|
-
const
|
|
2556
|
-
let q =
|
|
2557
|
-
G.has(q) && (q = `${q}__${
|
|
2558
|
-
const X =
|
|
2659
|
+
const A = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
|
|
2660
|
+
let q = A || $ || `field_${H}`;
|
|
2661
|
+
G.has(q) && (q = `${q}__${H}`), G.add(q), H++;
|
|
2662
|
+
const X = zn(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
|
|
2559
2663
|
name: q,
|
|
2560
2664
|
label: fe(X, 100),
|
|
2561
2665
|
type: ee
|
|
@@ -2581,64 +2685,65 @@ function ki(e, t = {}) {
|
|
|
2581
2685
|
me !== null && (V.max = fe(me, 50));
|
|
2582
2686
|
const Q = f.getAttribute("step");
|
|
2583
2687
|
Q !== null && (V.step = fe(Q, 20));
|
|
2584
|
-
const
|
|
2585
|
-
|
|
2688
|
+
const _e = f.getAttribute("pattern");
|
|
2689
|
+
_e !== null && (V.pattern = fe(_e, 200));
|
|
2586
2690
|
const ne = (f.getAttribute("autocomplete") || "").toLowerCase();
|
|
2587
2691
|
ne && ne !== "off" && !ne.startsWith("cc-") && (V.autocomplete = fe(ne, 50));
|
|
2588
2692
|
}
|
|
2589
2693
|
if (f instanceof HTMLSelectElement) {
|
|
2590
2694
|
const U = [];
|
|
2591
|
-
for (let me = 0; me < f.options.length && !(U.length >=
|
|
2695
|
+
for (let me = 0; me < f.options.length && !(U.length >= Wi); me++) {
|
|
2592
2696
|
const Q = f.options[me];
|
|
2593
2697
|
if (!Q || Q.disabled) continue;
|
|
2594
|
-
const
|
|
2595
|
-
!
|
|
2698
|
+
const _e = Q.value || "", ne = (Q.textContent || "").trim() || _e;
|
|
2699
|
+
!_e && !ne || U.push({ value: _e, label: fe(ne, 60) });
|
|
2596
2700
|
}
|
|
2597
2701
|
U.length > 0 && (V.options = U);
|
|
2598
2702
|
}
|
|
2599
2703
|
const oe = typeof f.validationMessage == "string" ? f.validationMessage : "";
|
|
2600
2704
|
oe && (V.validationMessage = fe(oe, 200)), ae.push(V);
|
|
2601
2705
|
}
|
|
2602
|
-
|
|
2706
|
+
T.push({ id: z, intent: B, fields: ae });
|
|
2603
2707
|
}
|
|
2604
2708
|
const v = {
|
|
2605
2709
|
url: i,
|
|
2606
2710
|
title: o,
|
|
2607
|
-
pathname:
|
|
2608
|
-
regions:
|
|
2711
|
+
pathname: l,
|
|
2712
|
+
regions: a,
|
|
2609
2713
|
visibleText: h,
|
|
2610
|
-
visibleLinks:
|
|
2714
|
+
visibleLinks: D,
|
|
2611
2715
|
visibleFields: E,
|
|
2612
|
-
forms:
|
|
2716
|
+
forms: T,
|
|
2717
|
+
flow: Zn(n),
|
|
2613
2718
|
extras: e
|
|
2614
2719
|
};
|
|
2615
|
-
let O =
|
|
2616
|
-
for (; O >
|
|
2617
|
-
v.visibleFields.pop(), O =
|
|
2618
|
-
for (; O >
|
|
2720
|
+
let O = Qe(JSON.stringify(v.regions)) + Qe(v.visibleText) + Qe(JSON.stringify(v.visibleLinks)) + Qe(JSON.stringify(v.visibleFields));
|
|
2721
|
+
for (; O > Mt && v.visibleFields.length > 0; )
|
|
2722
|
+
v.visibleFields.pop(), O = Qe(JSON.stringify(v.visibleFields));
|
|
2723
|
+
for (; O > Mt && v.visibleLinks.length > 0; )
|
|
2619
2724
|
v.visibleLinks.pop(), O -= 80;
|
|
2620
|
-
return
|
|
2725
|
+
return Qe(v.visibleText) > Mt && (v.visibleText = fe(v.visibleText, Mt - 100)), v;
|
|
2621
2726
|
}
|
|
2622
|
-
let
|
|
2623
|
-
function
|
|
2727
|
+
let tt = null;
|
|
2728
|
+
function Yi(e) {
|
|
2624
2729
|
const t = e.querySelectorAll("form");
|
|
2625
2730
|
let n = `f${t.length}`;
|
|
2626
2731
|
return t.forEach((i) => {
|
|
2627
2732
|
n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
|
|
2628
2733
|
}), n;
|
|
2629
2734
|
}
|
|
2630
|
-
function
|
|
2631
|
-
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null),
|
|
2632
|
-
if (
|
|
2633
|
-
return
|
|
2634
|
-
const
|
|
2635
|
-
return
|
|
2735
|
+
function $n(e, t = {}) {
|
|
2736
|
+
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 ? Yi(i) : ""}`;
|
|
2737
|
+
if (tt && tt.key === s && n - tt.at < 1e3)
|
|
2738
|
+
return tt.ctx;
|
|
2739
|
+
const a = Vi(e, t);
|
|
2740
|
+
return tt = { key: s, at: n, ctx: a }, a;
|
|
2636
2741
|
}
|
|
2637
|
-
function
|
|
2638
|
-
|
|
2742
|
+
function Gi() {
|
|
2743
|
+
tt = null;
|
|
2639
2744
|
}
|
|
2640
|
-
const
|
|
2641
|
-
function
|
|
2745
|
+
const Xi = 200;
|
|
2746
|
+
function Ki(e) {
|
|
2642
2747
|
const t = String(e.href || "");
|
|
2643
2748
|
return {
|
|
2644
2749
|
href: t,
|
|
@@ -2648,23 +2753,23 @@ function Ai(e) {
|
|
|
2648
2753
|
description: e.description
|
|
2649
2754
|
};
|
|
2650
2755
|
}
|
|
2651
|
-
function
|
|
2756
|
+
function Ji(e) {
|
|
2652
2757
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2653
2758
|
}
|
|
2654
|
-
function
|
|
2759
|
+
function Zi(e) {
|
|
2655
2760
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2656
2761
|
if (!t) return [];
|
|
2657
|
-
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(),
|
|
2762
|
+
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), l = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2658
2763
|
for (const s of o) {
|
|
2659
|
-
if (
|
|
2660
|
-
if (
|
|
2661
|
-
const
|
|
2662
|
-
if (!
|
|
2663
|
-
let c =
|
|
2764
|
+
if (l.length >= Xi) break;
|
|
2765
|
+
if (Tt(s)) continue;
|
|
2766
|
+
const a = s.getAttribute("href") || "";
|
|
2767
|
+
if (!Ji(a)) continue;
|
|
2768
|
+
let c = a, u = !0;
|
|
2664
2769
|
try {
|
|
2665
2770
|
if (typeof window < "u") {
|
|
2666
|
-
const p = new URL(
|
|
2667
|
-
u = p.origin === n, u &&
|
|
2771
|
+
const p = new URL(a, n);
|
|
2772
|
+
u = p.origin === n, u && a.startsWith("http") && (c = p.pathname + p.search + p.hash);
|
|
2668
2773
|
}
|
|
2669
2774
|
} catch {
|
|
2670
2775
|
continue;
|
|
@@ -2672,23 +2777,23 @@ function Ii(e) {
|
|
|
2672
2777
|
if (i.has(c)) continue;
|
|
2673
2778
|
i.add(c);
|
|
2674
2779
|
const m = (s.textContent || "").trim().slice(0, 120);
|
|
2675
|
-
|
|
2780
|
+
l.push({ href: c, text: m, internal: u });
|
|
2676
2781
|
}
|
|
2677
|
-
return
|
|
2782
|
+
return l;
|
|
2678
2783
|
}
|
|
2679
|
-
let
|
|
2680
|
-
const
|
|
2681
|
-
function
|
|
2784
|
+
let nt = null;
|
|
2785
|
+
const Qi = 5e3;
|
|
2786
|
+
function Yt() {
|
|
2682
2787
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2683
|
-
if (
|
|
2684
|
-
return
|
|
2685
|
-
const n =
|
|
2686
|
-
return
|
|
2788
|
+
if (nt && nt.pathname === t && e - nt.at < Qi)
|
|
2789
|
+
return nt.routes;
|
|
2790
|
+
const n = Zi();
|
|
2791
|
+
return nt = { at: e, pathname: t, routes: n }, n;
|
|
2687
2792
|
}
|
|
2688
|
-
function
|
|
2689
|
-
|
|
2793
|
+
function eo() {
|
|
2794
|
+
nt = null;
|
|
2690
2795
|
}
|
|
2691
|
-
function
|
|
2796
|
+
function Jt(e) {
|
|
2692
2797
|
if (e instanceof HTMLInputElement) {
|
|
2693
2798
|
const t = e.type;
|
|
2694
2799
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2696,136 +2801,136 @@ function Yt(e) {
|
|
|
2696
2801
|
}
|
|
2697
2802
|
return !0;
|
|
2698
2803
|
}
|
|
2699
|
-
function
|
|
2804
|
+
function to(e, t) {
|
|
2700
2805
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2701
2806
|
}
|
|
2702
|
-
function
|
|
2807
|
+
function Te(e) {
|
|
2703
2808
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2704
2809
|
}
|
|
2705
|
-
function
|
|
2810
|
+
function Gt(e) {
|
|
2706
2811
|
const t = e.lastIndexOf(".");
|
|
2707
2812
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
2708
2813
|
}
|
|
2709
|
-
function
|
|
2814
|
+
function no(e) {
|
|
2710
2815
|
var i;
|
|
2711
2816
|
const t = e.getAttribute("id");
|
|
2712
2817
|
if (t)
|
|
2713
2818
|
try {
|
|
2714
|
-
const
|
|
2819
|
+
const l = (i = e.ownerDocument) == null ? void 0 : i.querySelector(
|
|
2715
2820
|
`label[for="${t.replace(/"/g, '\\"')}"]`
|
|
2716
2821
|
);
|
|
2717
|
-
if (
|
|
2822
|
+
if (l != null && l.textContent) return l.textContent;
|
|
2718
2823
|
} catch {
|
|
2719
2824
|
}
|
|
2720
2825
|
const n = e.closest("label");
|
|
2721
2826
|
return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
|
|
2722
2827
|
}
|
|
2723
|
-
function
|
|
2724
|
-
const n =
|
|
2828
|
+
function ro(e, t) {
|
|
2829
|
+
const n = Te(t);
|
|
2725
2830
|
if (n.length < 2) return null;
|
|
2726
|
-
let i = null,
|
|
2831
|
+
let i = null, l = 0;
|
|
2727
2832
|
for (const o of Array.from(
|
|
2728
2833
|
e.querySelectorAll("input, textarea, select")
|
|
2729
2834
|
)) {
|
|
2730
|
-
if (!
|
|
2731
|
-
const s = o.getAttribute("name") || "",
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2835
|
+
if (!Jt(o)) continue;
|
|
2836
|
+
const s = o.getAttribute("name") || "", a = o.getAttribute("id") || "", c = [
|
|
2837
|
+
Te(Gt(s)),
|
|
2838
|
+
Te(Gt(a)),
|
|
2839
|
+
Te(s),
|
|
2840
|
+
Te(a)
|
|
2736
2841
|
];
|
|
2737
2842
|
let u = 0;
|
|
2738
2843
|
c.some((m) => m.length >= 2 && m === n) ? u = 4 : [
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u >
|
|
2844
|
+
Te(s),
|
|
2845
|
+
Te(Gt(s)),
|
|
2846
|
+
Te(no(o))
|
|
2847
|
+
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > l && (l = u, i = o);
|
|
2743
2848
|
}
|
|
2744
|
-
return
|
|
2849
|
+
return l >= 2 ? i : null;
|
|
2745
2850
|
}
|
|
2746
|
-
function
|
|
2851
|
+
function io(e, t) {
|
|
2747
2852
|
if (!t) return null;
|
|
2748
2853
|
try {
|
|
2749
2854
|
const o = e.querySelector(
|
|
2750
2855
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2751
2856
|
);
|
|
2752
|
-
if (o &&
|
|
2857
|
+
if (o && Jt(o)) return o;
|
|
2753
2858
|
} catch {
|
|
2754
2859
|
}
|
|
2755
2860
|
const n = Array.from(
|
|
2756
2861
|
e.querySelectorAll("input, textarea, select")
|
|
2757
2862
|
);
|
|
2758
2863
|
let i = 0;
|
|
2759
|
-
const
|
|
2864
|
+
const l = /* @__PURE__ */ new Map();
|
|
2760
2865
|
for (const o of n) {
|
|
2761
|
-
if (!
|
|
2762
|
-
const s =
|
|
2763
|
-
let
|
|
2764
|
-
if (
|
|
2765
|
-
|
|
2866
|
+
if (!Jt(o)) continue;
|
|
2867
|
+
const s = to(o, i);
|
|
2868
|
+
let a = s;
|
|
2869
|
+
if (l.has(s) && (a = `${s}__${i}`), a === t) return o;
|
|
2870
|
+
l.set(s, o), i++;
|
|
2766
2871
|
}
|
|
2767
|
-
return
|
|
2872
|
+
return ro(e, t);
|
|
2768
2873
|
}
|
|
2769
|
-
function
|
|
2770
|
-
const n =
|
|
2771
|
-
return n ?
|
|
2874
|
+
function Hn(e, t) {
|
|
2875
|
+
const n = io(e, t);
|
|
2876
|
+
return n ? Kt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2772
2877
|
}
|
|
2773
|
-
function
|
|
2774
|
-
const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"),
|
|
2775
|
-
|
|
2878
|
+
function oo(e, t) {
|
|
2879
|
+
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;
|
|
2880
|
+
l ? l.call(e, t) : e.value = t;
|
|
2776
2881
|
}
|
|
2777
|
-
function
|
|
2778
|
-
const i = n.triggerInput ?? !0,
|
|
2882
|
+
function lo(e, t, n = {}) {
|
|
2883
|
+
const i = n.triggerInput ?? !0, l = n.triggerChange ?? !0;
|
|
2779
2884
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2780
2885
|
const o = Object.getOwnPropertyDescriptor(
|
|
2781
2886
|
HTMLInputElement.prototype,
|
|
2782
2887
|
"checked"
|
|
2783
|
-
), s = o == null ? void 0 : o.set,
|
|
2784
|
-
s ? s.call(e,
|
|
2888
|
+
), s = o == null ? void 0 : o.set, a = t === "true" || t === "1" || t === "on";
|
|
2889
|
+
s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2785
2890
|
return;
|
|
2786
2891
|
}
|
|
2787
|
-
|
|
2892
|
+
oo(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2788
2893
|
}
|
|
2789
|
-
function
|
|
2894
|
+
function On(e, t) {
|
|
2790
2895
|
if (!t) return null;
|
|
2791
|
-
const n = t.replace(/"/g, '\\"'), i = (
|
|
2896
|
+
const n = t.replace(/"/g, '\\"'), i = (a) => a.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
|
|
2792
2897
|
try {
|
|
2793
|
-
const
|
|
2898
|
+
const a = e.querySelector(
|
|
2794
2899
|
`form#${CSS.escape(t)}`
|
|
2795
2900
|
);
|
|
2796
|
-
if (
|
|
2901
|
+
if (a && !i(a)) return a;
|
|
2797
2902
|
} catch {
|
|
2798
2903
|
}
|
|
2799
|
-
const
|
|
2904
|
+
const l = e.querySelector(
|
|
2800
2905
|
`form[name="${n}"]`
|
|
2801
2906
|
);
|
|
2802
|
-
if (
|
|
2907
|
+
if (l && !i(l)) return l;
|
|
2803
2908
|
const o = e.querySelector(
|
|
2804
2909
|
`form[data-ll-intent="${n}"]`
|
|
2805
2910
|
);
|
|
2806
2911
|
if (o && !i(o)) return o;
|
|
2807
2912
|
const s = Array.from(
|
|
2808
2913
|
e.querySelectorAll("form")
|
|
2809
|
-
).filter((
|
|
2810
|
-
for (const
|
|
2811
|
-
const c =
|
|
2812
|
-
if (c &&
|
|
2914
|
+
).filter((a) => !i(a));
|
|
2915
|
+
for (const a of s) {
|
|
2916
|
+
const c = a.getAttribute("data-ll-intent");
|
|
2917
|
+
if (c && ao(c) === t) return a;
|
|
2813
2918
|
}
|
|
2814
2919
|
if (/^form_\d+$/.test(t)) {
|
|
2815
|
-
const
|
|
2920
|
+
const a = parseInt(t.slice(5), 10);
|
|
2816
2921
|
let c = 0;
|
|
2817
2922
|
for (const u of s)
|
|
2818
2923
|
if (!(u.id || u.getAttribute("name") || u.getAttribute("data-ll-intent"))) {
|
|
2819
|
-
if (c ===
|
|
2924
|
+
if (c === a) return u;
|
|
2820
2925
|
c++;
|
|
2821
2926
|
}
|
|
2822
2927
|
}
|
|
2823
2928
|
return s.length === 1 ? s[0] : null;
|
|
2824
2929
|
}
|
|
2825
|
-
function
|
|
2930
|
+
function ao(e) {
|
|
2826
2931
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2827
2932
|
}
|
|
2828
|
-
function
|
|
2933
|
+
function so() {
|
|
2829
2934
|
if (typeof window > "u" || typeof document > "u")
|
|
2830
2935
|
return !1;
|
|
2831
2936
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2833,44 +2938,44 @@ function Wi() {
|
|
|
2833
2938
|
const t = window.getComputedStyle(e);
|
|
2834
2939
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2835
2940
|
}
|
|
2836
|
-
function
|
|
2941
|
+
function co(e) {
|
|
2837
2942
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2838
2943
|
const n = window.getComputedStyle(e).overflowY;
|
|
2839
2944
|
return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2840
2945
|
}
|
|
2841
|
-
function
|
|
2946
|
+
function uo() {
|
|
2842
2947
|
if (typeof document > "u") return null;
|
|
2843
2948
|
const e = Array.from(
|
|
2844
2949
|
document.querySelectorAll("body, body *")
|
|
2845
2950
|
);
|
|
2846
2951
|
let t = null, n = 0;
|
|
2847
2952
|
for (const i of e) {
|
|
2848
|
-
if (!
|
|
2849
|
-
const
|
|
2850
|
-
if (
|
|
2851
|
-
const o =
|
|
2953
|
+
if (!co(i)) continue;
|
|
2954
|
+
const l = i.getBoundingClientRect();
|
|
2955
|
+
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;
|
|
2956
|
+
const o = l.width * l.height;
|
|
2852
2957
|
o > n && (n = o, t = i);
|
|
2853
2958
|
}
|
|
2854
2959
|
return t;
|
|
2855
2960
|
}
|
|
2856
|
-
function
|
|
2961
|
+
function fo() {
|
|
2857
2962
|
if (typeof window > "u")
|
|
2858
2963
|
return null;
|
|
2859
|
-
if (
|
|
2860
|
-
const e =
|
|
2964
|
+
if (so()) return window;
|
|
2965
|
+
const e = uo();
|
|
2861
2966
|
return e || window;
|
|
2862
2967
|
}
|
|
2863
|
-
function
|
|
2968
|
+
function Fn(e) {
|
|
2864
2969
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2865
2970
|
}
|
|
2866
|
-
function
|
|
2971
|
+
function po(e) {
|
|
2867
2972
|
var t, n;
|
|
2868
2973
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2869
2974
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2870
2975
|
((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
|
|
2871
2976
|
) : e.scrollHeight - e.clientHeight;
|
|
2872
2977
|
}
|
|
2873
|
-
const
|
|
2978
|
+
const ho = /* @__PURE__ */ new Set([
|
|
2874
2979
|
"agent_state",
|
|
2875
2980
|
"avatar_stream_ready",
|
|
2876
2981
|
"avatar_active",
|
|
@@ -2892,6 +2997,11 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
2892
2997
|
"focus_field",
|
|
2893
2998
|
"submit_form",
|
|
2894
2999
|
"request_routes",
|
|
3000
|
+
// 0.22.0 — multi-step flow controls (handled internally via the flow
|
|
3001
|
+
// registry; see detectFlow). Not bubbled to onAgentCommand.
|
|
3002
|
+
"advance_step",
|
|
3003
|
+
"go_back",
|
|
3004
|
+
"submit_flow",
|
|
2895
3005
|
// 0.12.0 — structured collection (unified API).
|
|
2896
3006
|
// Both `task_field_updated` and `task_completed` data-channel commands
|
|
2897
3007
|
// fan out into a single document-level `ll-collected` CustomEvent
|
|
@@ -2900,15 +3010,15 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
2900
3010
|
// to onAgentCommand.
|
|
2901
3011
|
"task_field_updated",
|
|
2902
3012
|
"task_completed"
|
|
2903
|
-
]),
|
|
3013
|
+
]), er = Zt(
|
|
2904
3014
|
function(t, n) {
|
|
2905
|
-
var
|
|
3015
|
+
var dn, fn, pn, hn, mn, gn, yn;
|
|
2906
3016
|
const {
|
|
2907
3017
|
agentId: i,
|
|
2908
|
-
apiKey:
|
|
3018
|
+
apiKey: l,
|
|
2909
3019
|
baseUrl: o = "https://app.livelayer.studio",
|
|
2910
3020
|
sessionEndpoint: s,
|
|
2911
|
-
sessionBody:
|
|
3021
|
+
sessionBody: a,
|
|
2912
3022
|
soundEffects: c,
|
|
2913
3023
|
experienceMode: u = "WIDGET",
|
|
2914
3024
|
autoConnect: m = !1,
|
|
@@ -2921,25 +3031,25 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
2921
3031
|
// minimized produced). The card sizing now lives in CSS — see
|
|
2922
3032
|
// .ll-expanded--mobile in styles.css.
|
|
2923
3033
|
defaultDisplayMode: h = "expanded",
|
|
2924
|
-
onDisplayModeChange:
|
|
3034
|
+
onDisplayModeChange: D,
|
|
2925
3035
|
position: x = "bottom-right",
|
|
2926
3036
|
mobileBreakpoint: E = 640,
|
|
2927
3037
|
draggable: y,
|
|
2928
3038
|
resizable: w,
|
|
2929
|
-
persistKey:
|
|
3039
|
+
persistKey: T = "ll-widget",
|
|
2930
3040
|
disablePersistence: S = !1,
|
|
2931
3041
|
teamMembers: v,
|
|
2932
3042
|
currentTeamMemberId: O,
|
|
2933
3043
|
onTeamMemberChange: g,
|
|
2934
|
-
idleLoopUrl:
|
|
2935
|
-
greeting:
|
|
3044
|
+
idleLoopUrl: z,
|
|
3045
|
+
greeting: B,
|
|
2936
3046
|
avatarImageUrl: K,
|
|
2937
3047
|
agentName: ae,
|
|
2938
|
-
branding:
|
|
3048
|
+
branding: H = {},
|
|
2939
3049
|
allowCamera: G = !0,
|
|
2940
3050
|
allowScreenShare: f = !0,
|
|
2941
|
-
allowTyping:
|
|
2942
|
-
blurUntilFirstSpeech:
|
|
3051
|
+
allowTyping: A = !0,
|
|
3052
|
+
blurUntilFirstSpeech: $ = !0,
|
|
2943
3053
|
showMinimize: q,
|
|
2944
3054
|
showClose: X,
|
|
2945
3055
|
chromeless: ee = !1,
|
|
@@ -2949,123 +3059,123 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
2949
3059
|
transformingLabel: U = "Transforming…",
|
|
2950
3060
|
showOn: me,
|
|
2951
3061
|
hideOn: Q,
|
|
2952
|
-
pathname:
|
|
3062
|
+
pathname: _e,
|
|
2953
3063
|
onNavigate: ne,
|
|
2954
|
-
onScrollToSelector:
|
|
2955
|
-
getPageContext:
|
|
2956
|
-
pageContextExtras:
|
|
2957
|
-
getRoutes:
|
|
2958
|
-
onScrollPage:
|
|
2959
|
-
onClick:
|
|
2960
|
-
capabilities:
|
|
2961
|
-
onConnect:
|
|
3064
|
+
onScrollToSelector: it,
|
|
3065
|
+
getPageContext: ot,
|
|
3066
|
+
pageContextExtras: yt,
|
|
3067
|
+
getRoutes: vt,
|
|
3068
|
+
onScrollPage: lt,
|
|
3069
|
+
onClick: bt,
|
|
3070
|
+
capabilities: qe,
|
|
3071
|
+
onConnect: Ue,
|
|
2962
3072
|
onDisconnect: Re,
|
|
2963
|
-
onTranscript:
|
|
3073
|
+
onTranscript: De,
|
|
2964
3074
|
onAgentState: Pe,
|
|
2965
|
-
onConnectionStateChange:
|
|
2966
|
-
onAgentEvent:
|
|
2967
|
-
onAgentCommand:
|
|
2968
|
-
onCollect:
|
|
3075
|
+
onConnectionStateChange: ze,
|
|
3076
|
+
onAgentEvent: $e,
|
|
3077
|
+
onAgentCommand: je,
|
|
3078
|
+
onCollect: He,
|
|
2969
3079
|
controlledSession: F,
|
|
2970
|
-
className:
|
|
2971
|
-
style:
|
|
2972
|
-
zIndex:
|
|
2973
|
-
} = t,
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
}, [
|
|
2977
|
-
const
|
|
3080
|
+
className: Oe,
|
|
3081
|
+
style: Ve,
|
|
3082
|
+
zIndex: xe = 2147483647
|
|
3083
|
+
} = t, wt = Kr(_e), Fe = ri(wt, me, Q);
|
|
3084
|
+
R(() => {
|
|
3085
|
+
Gi(), eo();
|
|
3086
|
+
}, [wt]);
|
|
3087
|
+
const Ae = O !== void 0, [Rt, _t] = M(() => {
|
|
2978
3088
|
var b;
|
|
2979
3089
|
return O ?? ((b = v == null ? void 0 : v[0]) == null ? void 0 : b.id);
|
|
2980
|
-
}),
|
|
2981
|
-
() => (v == null ? void 0 : v.find((b) => b.id ===
|
|
2982
|
-
[v,
|
|
2983
|
-
),
|
|
3090
|
+
}), Be = Ae ? O : Rt, ue = rt(
|
|
3091
|
+
() => (v == null ? void 0 : v.find((b) => b.id === Be)) ?? null,
|
|
3092
|
+
[v, Be]
|
|
3093
|
+
), at = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Wr(E), [Ye, Ge] = Fr({
|
|
2984
3094
|
value: p,
|
|
2985
3095
|
defaultValue: h,
|
|
2986
|
-
onChange:
|
|
2987
|
-
persistKey:
|
|
3096
|
+
onChange: D,
|
|
3097
|
+
persistKey: T,
|
|
2988
3098
|
disablePersistence: le || S
|
|
2989
|
-
}), ge = le ? "expanded" :
|
|
2990
|
-
} :
|
|
3099
|
+
}), ge = le ? "expanded" : Ye, Le = le ? () => {
|
|
3100
|
+
} : Ge, xt = q ?? !le, Dt = X ?? !le, Pt = te || !le && pe, Ne = Gr({
|
|
2991
3101
|
draggable: !le && (y ?? !pe),
|
|
2992
3102
|
resizable: !le && (w ?? !pe),
|
|
2993
|
-
persistKey:
|
|
3103
|
+
persistKey: T,
|
|
2994
3104
|
disablePersistence: le || S
|
|
2995
|
-
}), Me =
|
|
2996
|
-
|
|
2997
|
-
const
|
|
2998
|
-
|
|
2999
|
-
function
|
|
3000
|
-
const d =
|
|
3105
|
+
}), Me = Ar(), Se = Tr(), ye = Rr(), Ce = Dr(), [Lt, Xe] = M(!1), [ct, ut] = M(!1), [_, re] = M(!1), [tr, nr] = M(!1), [$t, rr] = M(!1), Ct = oi({ baseUrl: o, config: c }), kt = I(Ct);
|
|
3106
|
+
kt.current = Ct;
|
|
3107
|
+
const Ht = I(ne), Ot = I(it), Ft = I(lt), Bt = I(bt), en = I(ot), tn = I(yt), nn = I(vt), Wt = I(qe), ke = I(null);
|
|
3108
|
+
Ht.current = ne, Ot.current = it, Ft.current = lt, Bt.current = bt, en.current = ot, tn.current = yt, nn.current = vt, Wt.current = qe;
|
|
3109
|
+
function be(b) {
|
|
3110
|
+
const d = Wt.current;
|
|
3001
3111
|
return d ? d.includes(b) : !0;
|
|
3002
3112
|
}
|
|
3003
|
-
function
|
|
3113
|
+
function we(b, d) {
|
|
3004
3114
|
console.warn(
|
|
3005
3115
|
`[LiveLayer] Agent command "${b}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
3006
3116
|
);
|
|
3007
3117
|
}
|
|
3008
|
-
const
|
|
3118
|
+
const dt = C(
|
|
3009
3119
|
(b) => {
|
|
3010
|
-
var ie, de, Ee,
|
|
3120
|
+
var ie, de, Ee, pt, Ie;
|
|
3011
3121
|
const d = b;
|
|
3012
3122
|
if (!(!d.type || typeof d.type != "string")) {
|
|
3013
|
-
if (
|
|
3014
|
-
if (!
|
|
3015
|
-
|
|
3123
|
+
if ($e == null || $e({ eventName: d.type, data: b }), d.type === "navigate") {
|
|
3124
|
+
if (!be("navigate")) {
|
|
3125
|
+
we("navigate", "navigate");
|
|
3016
3126
|
return;
|
|
3017
3127
|
}
|
|
3018
|
-
const
|
|
3019
|
-
if (!
|
|
3128
|
+
const N = typeof d.href == "string" ? d.href : null;
|
|
3129
|
+
if (!N) {
|
|
3020
3130
|
console.warn(
|
|
3021
3131
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
3022
3132
|
);
|
|
3023
3133
|
return;
|
|
3024
3134
|
}
|
|
3025
|
-
if (
|
|
3135
|
+
if (kt.current.playPageChange(), Ht.current) {
|
|
3026
3136
|
try {
|
|
3027
|
-
|
|
3028
|
-
} catch (
|
|
3137
|
+
Ht.current(N);
|
|
3138
|
+
} catch (P) {
|
|
3029
3139
|
console.warn(
|
|
3030
|
-
`[LiveLayer] onNavigate threw for "${
|
|
3031
|
-
|
|
3140
|
+
`[LiveLayer] onNavigate threw for "${N}". Falling back. Error:`,
|
|
3141
|
+
P
|
|
3032
3142
|
);
|
|
3033
3143
|
}
|
|
3034
3144
|
return;
|
|
3035
3145
|
}
|
|
3036
3146
|
if (typeof document < "u") {
|
|
3037
|
-
const
|
|
3038
|
-
`a[href="${
|
|
3147
|
+
const P = document.querySelector(
|
|
3148
|
+
`a[href="${N.replace(/"/g, '\\"')}"]`
|
|
3039
3149
|
);
|
|
3040
|
-
if (
|
|
3041
|
-
|
|
3150
|
+
if (P) {
|
|
3151
|
+
P.click();
|
|
3042
3152
|
return;
|
|
3043
3153
|
}
|
|
3044
3154
|
}
|
|
3045
3155
|
if (typeof window < "u" && typeof history < "u")
|
|
3046
3156
|
try {
|
|
3047
|
-
history.pushState({}, "",
|
|
3048
|
-
} catch (
|
|
3157
|
+
history.pushState({}, "", N), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3158
|
+
} catch (P) {
|
|
3049
3159
|
console.warn(
|
|
3050
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
3051
|
-
|
|
3160
|
+
`[LiveLayer] history.pushState fallback failed for "${N}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
3161
|
+
P
|
|
3052
3162
|
);
|
|
3053
3163
|
}
|
|
3054
3164
|
return;
|
|
3055
3165
|
}
|
|
3056
3166
|
if (d.type === "scroll_to") {
|
|
3057
|
-
if (!
|
|
3058
|
-
|
|
3167
|
+
if (!be("scroll")) {
|
|
3168
|
+
we("scroll_to", "scroll");
|
|
3059
3169
|
return;
|
|
3060
3170
|
}
|
|
3061
|
-
const
|
|
3062
|
-
if (!
|
|
3063
|
-
const
|
|
3064
|
-
if (
|
|
3171
|
+
const N = typeof d.selector == "string" ? d.selector : null;
|
|
3172
|
+
if (!N) return;
|
|
3173
|
+
const P = d.behavior === "instant" ? "instant" : "smooth";
|
|
3174
|
+
if (Ot.current) {
|
|
3065
3175
|
try {
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3176
|
+
Ot.current(
|
|
3177
|
+
N,
|
|
3178
|
+
P
|
|
3069
3179
|
);
|
|
3070
3180
|
} catch (Y) {
|
|
3071
3181
|
console.warn("[LiveLayer] onScrollToSelector threw.", Y);
|
|
@@ -3075,52 +3185,52 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3075
3185
|
if (typeof document < "u") {
|
|
3076
3186
|
let Y = null;
|
|
3077
3187
|
try {
|
|
3078
|
-
Y = document.querySelector(
|
|
3188
|
+
Y = document.querySelector(N);
|
|
3079
3189
|
} catch {
|
|
3080
3190
|
console.warn(
|
|
3081
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
3191
|
+
`[LiveLayer] scroll_to: invalid selector "${N}".`
|
|
3082
3192
|
);
|
|
3083
3193
|
return;
|
|
3084
3194
|
}
|
|
3085
3195
|
if (!Y) {
|
|
3086
3196
|
console.warn(
|
|
3087
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
3197
|
+
`[LiveLayer] scroll_to: no element matched "${N}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
3088
3198
|
);
|
|
3089
3199
|
return;
|
|
3090
3200
|
}
|
|
3091
3201
|
Y.scrollIntoView({
|
|
3092
|
-
behavior:
|
|
3202
|
+
behavior: P,
|
|
3093
3203
|
block: "start"
|
|
3094
3204
|
});
|
|
3095
3205
|
}
|
|
3096
3206
|
return;
|
|
3097
3207
|
}
|
|
3098
3208
|
if (d.type === "request_page_context") {
|
|
3099
|
-
if (!
|
|
3100
|
-
|
|
3209
|
+
if (!be("read_page")) {
|
|
3210
|
+
we("request_page_context", "read_page");
|
|
3101
3211
|
return;
|
|
3102
3212
|
}
|
|
3103
|
-
const
|
|
3104
|
-
const
|
|
3213
|
+
const N = typeof d.requestId == "string" ? d.requestId : void 0, P = (ie = ke.current) == null ? void 0 : ie.call(ke), Y = (Z) => {
|
|
3214
|
+
const W = P, ce = W == null ? void 0 : W.localParticipant;
|
|
3105
3215
|
if (ce != null && ce.publishData)
|
|
3106
3216
|
try {
|
|
3107
|
-
const he =
|
|
3108
|
-
ce.publishData(
|
|
3217
|
+
const he = N ? { ...Z, requestId: N } : Z, Ze = new TextEncoder().encode(JSON.stringify(he));
|
|
3218
|
+
ce.publishData(Ze, { reliable: !0 });
|
|
3109
3219
|
} catch (he) {
|
|
3110
3220
|
console.warn("[LiveLayer] publishData failed.", he);
|
|
3111
3221
|
}
|
|
3112
|
-
}, j =
|
|
3222
|
+
}, j = tn.current, J = en.current;
|
|
3113
3223
|
try {
|
|
3114
3224
|
if (J) {
|
|
3115
3225
|
const Z = J(j);
|
|
3116
3226
|
if (Z instanceof Promise) {
|
|
3117
|
-
Y({ type: "page_context_pending" }), Z.then((
|
|
3227
|
+
Y({ type: "page_context_pending" }), Z.then((W) => Y({ type: "page_context", context: W })).catch((W) => {
|
|
3118
3228
|
console.warn(
|
|
3119
3229
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
3120
|
-
|
|
3230
|
+
W
|
|
3121
3231
|
), Y({
|
|
3122
3232
|
type: "page_context",
|
|
3123
|
-
context:
|
|
3233
|
+
context: $n(j)
|
|
3124
3234
|
});
|
|
3125
3235
|
});
|
|
3126
3236
|
return;
|
|
@@ -3130,7 +3240,7 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3130
3240
|
}
|
|
3131
3241
|
Y({
|
|
3132
3242
|
type: "page_context",
|
|
3133
|
-
context:
|
|
3243
|
+
context: $n(j)
|
|
3134
3244
|
});
|
|
3135
3245
|
} catch (Z) {
|
|
3136
3246
|
console.warn(
|
|
@@ -3144,101 +3254,116 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3144
3254
|
return;
|
|
3145
3255
|
}
|
|
3146
3256
|
if (d.type === "scroll_page") {
|
|
3147
|
-
if (!
|
|
3148
|
-
|
|
3257
|
+
if (!be("scroll")) {
|
|
3258
|
+
we("scroll_page", "scroll");
|
|
3149
3259
|
return;
|
|
3150
3260
|
}
|
|
3151
|
-
const
|
|
3152
|
-
if (
|
|
3261
|
+
const N = d.direction;
|
|
3262
|
+
if (N !== "up" && N !== "down" && N !== "top" && N !== "bottom") {
|
|
3153
3263
|
console.warn(
|
|
3154
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
3264
|
+
`[LiveLayer] scroll_page: invalid direction "${String(N)}". Expected up | down | top | bottom.`
|
|
3155
3265
|
);
|
|
3156
3266
|
return;
|
|
3157
3267
|
}
|
|
3158
|
-
const
|
|
3159
|
-
if (
|
|
3268
|
+
const P = d.behavior === "instant" ? "instant" : "smooth";
|
|
3269
|
+
if (Ft.current) {
|
|
3160
3270
|
try {
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3271
|
+
Ft.current(
|
|
3272
|
+
N,
|
|
3273
|
+
P
|
|
3164
3274
|
);
|
|
3165
|
-
} catch (
|
|
3166
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
3275
|
+
} catch (W) {
|
|
3276
|
+
console.warn("[LiveLayer] onScrollPage threw.", W);
|
|
3167
3277
|
}
|
|
3168
3278
|
return;
|
|
3169
3279
|
}
|
|
3170
3280
|
if (typeof window > "u") return;
|
|
3171
|
-
const Y = { behavior:
|
|
3172
|
-
j instanceof Window ? j.scrollBy({ top:
|
|
3173
|
-
}, Z = (
|
|
3174
|
-
j instanceof Window ? j.scrollTo({ top:
|
|
3281
|
+
const Y = { behavior: P }, j = fo(), J = (W) => {
|
|
3282
|
+
j instanceof Window ? j.scrollBy({ top: W, ...Y }) : j.scrollBy({ top: W, ...Y });
|
|
3283
|
+
}, Z = (W) => {
|
|
3284
|
+
j instanceof Window ? j.scrollTo({ top: W, ...Y }) : j.scrollTo({ top: W, ...Y });
|
|
3175
3285
|
};
|
|
3176
|
-
|
|
3286
|
+
N === "up" ? J(-Fn(j)) : N === "down" ? J(Fn(j)) : Z(N === "top" ? 0 : po(j));
|
|
3177
3287
|
return;
|
|
3178
3288
|
}
|
|
3179
3289
|
if (d.type === "click") {
|
|
3180
|
-
if (!
|
|
3181
|
-
|
|
3290
|
+
if (!be("click")) {
|
|
3291
|
+
we("click", "click");
|
|
3182
3292
|
return;
|
|
3183
3293
|
}
|
|
3184
|
-
const
|
|
3185
|
-
if (!
|
|
3294
|
+
const N = typeof d.selector == "string" ? d.selector : null;
|
|
3295
|
+
if (!N) {
|
|
3186
3296
|
console.warn("[LiveLayer] click: missing selector.");
|
|
3187
3297
|
return;
|
|
3188
3298
|
}
|
|
3189
|
-
if (
|
|
3299
|
+
if (Bt.current) {
|
|
3190
3300
|
try {
|
|
3191
|
-
|
|
3301
|
+
Bt.current(N);
|
|
3192
3302
|
} catch (Y) {
|
|
3193
3303
|
console.warn("[LiveLayer] onClick threw.", Y);
|
|
3194
3304
|
}
|
|
3195
3305
|
return;
|
|
3196
3306
|
}
|
|
3197
3307
|
if (typeof document > "u") return;
|
|
3198
|
-
let
|
|
3308
|
+
let P = null;
|
|
3199
3309
|
try {
|
|
3200
|
-
|
|
3310
|
+
P = document.querySelector(N);
|
|
3201
3311
|
} catch {
|
|
3202
3312
|
console.warn(
|
|
3203
|
-
`[LiveLayer] click: invalid selector "${
|
|
3313
|
+
`[LiveLayer] click: invalid selector "${N}".`
|
|
3204
3314
|
);
|
|
3205
3315
|
return;
|
|
3206
3316
|
}
|
|
3207
|
-
if (!
|
|
3317
|
+
if (!P) {
|
|
3208
3318
|
console.warn(
|
|
3209
|
-
`[LiveLayer] click: no element matched "${
|
|
3319
|
+
`[LiveLayer] click: no element matched "${N}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
3210
3320
|
);
|
|
3211
3321
|
return;
|
|
3212
3322
|
}
|
|
3213
|
-
if (
|
|
3323
|
+
if (P.closest('[data-ll-private="true"], .ll-widget')) {
|
|
3214
3324
|
console.warn(
|
|
3215
3325
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
3216
3326
|
);
|
|
3217
3327
|
return;
|
|
3218
3328
|
}
|
|
3219
|
-
(de =
|
|
3329
|
+
(de = P.click) == null || de.call(P);
|
|
3330
|
+
return;
|
|
3331
|
+
}
|
|
3332
|
+
if (d.type === "advance_step" || d.type === "go_back" || d.type === "submit_flow") {
|
|
3333
|
+
if (!be("click")) {
|
|
3334
|
+
we(d.type, "click");
|
|
3335
|
+
return;
|
|
3336
|
+
}
|
|
3337
|
+
if (typeof document > "u") return;
|
|
3338
|
+
const N = d.type === "advance_step" ? "ll-advance" : d.type === "go_back" ? "ll-back" : "ll-submit";
|
|
3339
|
+
let P = Tn(N);
|
|
3340
|
+
if (P || (Zn(document), P = Tn(N)), !P) {
|
|
3341
|
+
console.warn(`[LiveLayer] ${d.type}: no "${N}" control found.`);
|
|
3342
|
+
return;
|
|
3343
|
+
}
|
|
3344
|
+
(Ee = P.click) == null || Ee.call(P);
|
|
3220
3345
|
return;
|
|
3221
3346
|
}
|
|
3222
3347
|
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
3223
|
-
if (!
|
|
3224
|
-
|
|
3348
|
+
if (!be("fill_forms")) {
|
|
3349
|
+
we(d.type, "fill_forms");
|
|
3225
3350
|
return;
|
|
3226
3351
|
}
|
|
3227
3352
|
if (typeof document > "u") return;
|
|
3228
|
-
d.type === "fill_form" &&
|
|
3229
|
-
const
|
|
3230
|
-
if (!
|
|
3353
|
+
d.type === "fill_form" && kt.current.playConfirmation();
|
|
3354
|
+
const N = typeof d.formId == "string" ? d.formId : null;
|
|
3355
|
+
if (!N) {
|
|
3231
3356
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
3232
3357
|
return;
|
|
3233
3358
|
}
|
|
3234
|
-
const
|
|
3235
|
-
if (!
|
|
3359
|
+
const P = On(document, N);
|
|
3360
|
+
if (!P) {
|
|
3236
3361
|
console.warn(
|
|
3237
|
-
`[LiveLayer] ${d.type}: no <form> matched id="${
|
|
3362
|
+
`[LiveLayer] ${d.type}: no <form> matched id="${N}" (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.`
|
|
3238
3363
|
);
|
|
3239
3364
|
return;
|
|
3240
3365
|
}
|
|
3241
|
-
if (
|
|
3366
|
+
if (P.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
3242
3367
|
console.warn(
|
|
3243
3368
|
`[LiveLayer] ${d.type}: refusing to touch a form in a private / opted-out subtree.`
|
|
3244
3369
|
);
|
|
@@ -3250,12 +3375,12 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3250
3375
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3251
3376
|
return;
|
|
3252
3377
|
}
|
|
3253
|
-
const J =
|
|
3378
|
+
const J = Hn(P, j);
|
|
3254
3379
|
if (J.el === null) {
|
|
3255
3380
|
J.reason === "private" ? console.warn(
|
|
3256
3381
|
`[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
|
|
3257
3382
|
) : console.warn(
|
|
3258
|
-
`[LiveLayer] focus_field: no input matching key="${j}" in form "${
|
|
3383
|
+
`[LiveLayer] focus_field: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
|
|
3259
3384
|
);
|
|
3260
3385
|
return;
|
|
3261
3386
|
}
|
|
@@ -3269,135 +3394,135 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3269
3394
|
}
|
|
3270
3395
|
for (const [j, J] of Object.entries(Y)) {
|
|
3271
3396
|
if (typeof J != "string") continue;
|
|
3272
|
-
const Z =
|
|
3397
|
+
const Z = Hn(P, j);
|
|
3273
3398
|
if (Z.el === null) {
|
|
3274
3399
|
Z.reason === "private" ? console.warn(
|
|
3275
3400
|
`[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
3276
3401
|
) : console.warn(
|
|
3277
|
-
`[LiveLayer] fill_form: no input matching key="${j}" in form "${
|
|
3402
|
+
`[LiveLayer] fill_form: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
|
|
3278
3403
|
);
|
|
3279
3404
|
continue;
|
|
3280
3405
|
}
|
|
3281
3406
|
try {
|
|
3282
|
-
|
|
3283
|
-
} catch (
|
|
3407
|
+
lo(Z.el, J);
|
|
3408
|
+
} catch (W) {
|
|
3284
3409
|
console.warn(
|
|
3285
3410
|
`[LiveLayer] fill_form: failed to set "${j}".`,
|
|
3286
|
-
|
|
3411
|
+
W
|
|
3287
3412
|
);
|
|
3288
3413
|
}
|
|
3289
3414
|
}
|
|
3290
3415
|
return;
|
|
3291
3416
|
}
|
|
3292
3417
|
if (d.type === "submit_form") {
|
|
3293
|
-
if (!
|
|
3294
|
-
|
|
3418
|
+
if (!be("submit_forms")) {
|
|
3419
|
+
we("submit_form", "submit_forms");
|
|
3295
3420
|
return;
|
|
3296
3421
|
}
|
|
3297
3422
|
if (typeof document > "u") return;
|
|
3298
|
-
const
|
|
3299
|
-
if (!
|
|
3423
|
+
const N = typeof d.formId == "string" ? d.formId : null;
|
|
3424
|
+
if (!N) {
|
|
3300
3425
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
3301
3426
|
return;
|
|
3302
3427
|
}
|
|
3303
|
-
|
|
3304
|
-
const
|
|
3305
|
-
if (!
|
|
3428
|
+
kt.current.playConfirmation();
|
|
3429
|
+
const P = On(document, N);
|
|
3430
|
+
if (!P) {
|
|
3306
3431
|
console.warn(
|
|
3307
|
-
`[LiveLayer] submit_form: no <form> matched id="${
|
|
3432
|
+
`[LiveLayer] submit_form: no <form> matched id="${N}" (or matching name / data-ll-intent slug).`
|
|
3308
3433
|
);
|
|
3309
3434
|
return;
|
|
3310
3435
|
}
|
|
3311
|
-
if (
|
|
3436
|
+
if (P.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
3312
3437
|
console.warn(
|
|
3313
3438
|
"[LiveLayer] submit_form: refusing to submit a form in a private / opted-out subtree."
|
|
3314
3439
|
);
|
|
3315
3440
|
return;
|
|
3316
3441
|
}
|
|
3317
|
-
const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (
|
|
3318
|
-
const he = j,
|
|
3319
|
-
if (
|
|
3442
|
+
const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (pt = ke.current) == null ? void 0 : pt.call(ke), J = (ce) => {
|
|
3443
|
+
const he = j, Ze = he == null ? void 0 : he.localParticipant;
|
|
3444
|
+
if (Ze != null && Ze.publishData)
|
|
3320
3445
|
try {
|
|
3321
|
-
const
|
|
3322
|
-
|
|
3446
|
+
const yr = Y ? { ...ce, requestId: Y } : ce, vr = new TextEncoder().encode(JSON.stringify(yr));
|
|
3447
|
+
Ze.publishData(vr, { reliable: !0 });
|
|
3323
3448
|
} catch {
|
|
3324
3449
|
}
|
|
3325
3450
|
};
|
|
3326
3451
|
let Z = !1;
|
|
3327
|
-
const
|
|
3328
|
-
Z = !0, J({ type: "form_submitted", formId:
|
|
3452
|
+
const W = () => {
|
|
3453
|
+
Z = !0, J({ type: "form_submitted", formId: N });
|
|
3329
3454
|
};
|
|
3330
|
-
|
|
3455
|
+
P.addEventListener("submit", W, { once: !0 });
|
|
3331
3456
|
try {
|
|
3332
|
-
typeof
|
|
3457
|
+
typeof P.requestSubmit == "function" ? P.requestSubmit() : P.submit();
|
|
3333
3458
|
} catch (ce) {
|
|
3334
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.", ce),
|
|
3459
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", ce), P.removeEventListener("submit", W), J({
|
|
3335
3460
|
type: "form_submit_blocked",
|
|
3336
|
-
formId:
|
|
3461
|
+
formId: N,
|
|
3337
3462
|
reason: "exception"
|
|
3338
3463
|
});
|
|
3339
3464
|
return;
|
|
3340
3465
|
}
|
|
3341
3466
|
setTimeout(() => {
|
|
3342
|
-
Z || (
|
|
3467
|
+
Z || (P.removeEventListener("submit", W), J({
|
|
3343
3468
|
type: "form_submit_blocked",
|
|
3344
|
-
formId:
|
|
3469
|
+
formId: N,
|
|
3345
3470
|
reason: "validation"
|
|
3346
3471
|
}));
|
|
3347
3472
|
}, 500);
|
|
3348
3473
|
return;
|
|
3349
3474
|
}
|
|
3350
3475
|
if (d.type === "request_routes") {
|
|
3351
|
-
if (!
|
|
3352
|
-
|
|
3476
|
+
if (!be("read_page")) {
|
|
3477
|
+
we("request_routes", "read_page");
|
|
3353
3478
|
return;
|
|
3354
3479
|
}
|
|
3355
|
-
const
|
|
3480
|
+
const N = typeof d.requestId == "string" ? d.requestId : void 0, Y = (Ie = ke.current) == null ? void 0 : Ie.call(ke), j = Y == null ? void 0 : Y.localParticipant;
|
|
3356
3481
|
if (!(j != null && j.publishData)) return;
|
|
3357
|
-
const J = (
|
|
3482
|
+
const J = (W) => {
|
|
3358
3483
|
try {
|
|
3359
|
-
const ce =
|
|
3484
|
+
const ce = N ? { type: "routes", routes: W, requestId: N } : { type: "routes", routes: W }, he = new TextEncoder().encode(JSON.stringify(ce));
|
|
3360
3485
|
j.publishData(he, { reliable: !0 });
|
|
3361
3486
|
} catch (ce) {
|
|
3362
3487
|
console.warn("[LiveLayer] request_routes: publishData failed.", ce);
|
|
3363
3488
|
}
|
|
3364
|
-
}, Z =
|
|
3489
|
+
}, Z = nn.current;
|
|
3365
3490
|
if (Z) {
|
|
3366
3491
|
try {
|
|
3367
|
-
const
|
|
3492
|
+
const W = Z(), ce = (he) => {
|
|
3368
3493
|
if (!Array.isArray(he)) {
|
|
3369
3494
|
J([]);
|
|
3370
3495
|
return;
|
|
3371
3496
|
}
|
|
3372
|
-
J(he.map(
|
|
3497
|
+
J(he.map(Ki).slice(0, 200));
|
|
3373
3498
|
};
|
|
3374
|
-
|
|
3499
|
+
W instanceof Promise ? W.then(ce).catch((he) => {
|
|
3375
3500
|
console.warn(
|
|
3376
3501
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3377
3502
|
he
|
|
3378
|
-
), J(
|
|
3379
|
-
}) : ce(
|
|
3380
|
-
} catch (
|
|
3503
|
+
), J(Yt());
|
|
3504
|
+
}) : ce(W);
|
|
3505
|
+
} catch (W) {
|
|
3381
3506
|
console.warn(
|
|
3382
3507
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3383
|
-
|
|
3384
|
-
), J(
|
|
3508
|
+
W
|
|
3509
|
+
), J(Yt());
|
|
3385
3510
|
}
|
|
3386
3511
|
return;
|
|
3387
3512
|
}
|
|
3388
3513
|
try {
|
|
3389
|
-
J(
|
|
3390
|
-
} catch (
|
|
3391
|
-
console.warn("[LiveLayer] request_routes: extractRoutes threw.",
|
|
3514
|
+
J(Yt());
|
|
3515
|
+
} catch (W) {
|
|
3516
|
+
console.warn("[LiveLayer] request_routes: extractRoutes threw.", W);
|
|
3392
3517
|
}
|
|
3393
3518
|
return;
|
|
3394
3519
|
}
|
|
3395
3520
|
if (d.type === "task_field_updated") {
|
|
3396
|
-
if (!
|
|
3397
|
-
|
|
3521
|
+
if (!be("collect_data")) {
|
|
3522
|
+
we("task_field_updated", "collect_data");
|
|
3398
3523
|
return;
|
|
3399
3524
|
}
|
|
3400
|
-
const
|
|
3525
|
+
const N = {
|
|
3401
3526
|
phase: "field",
|
|
3402
3527
|
fieldId: typeof d.fieldId == "string" ? d.fieldId : "",
|
|
3403
3528
|
fieldName: typeof d.fieldName == "string" ? d.fieldName : typeof d.fieldId == "string" ? d.fieldId : "",
|
|
@@ -3410,19 +3535,19 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3410
3535
|
if (typeof document < "u")
|
|
3411
3536
|
try {
|
|
3412
3537
|
document.dispatchEvent(
|
|
3413
|
-
new CustomEvent("ll-collected", { detail:
|
|
3538
|
+
new CustomEvent("ll-collected", { detail: N })
|
|
3414
3539
|
);
|
|
3415
3540
|
} catch {
|
|
3416
3541
|
}
|
|
3417
3542
|
return;
|
|
3418
3543
|
}
|
|
3419
3544
|
if (d.type === "task_completed") {
|
|
3420
|
-
if (!
|
|
3421
|
-
|
|
3545
|
+
if (!be("collect_data")) {
|
|
3546
|
+
we("task_completed", "collect_data");
|
|
3422
3547
|
return;
|
|
3423
3548
|
}
|
|
3424
|
-
const
|
|
3425
|
-
if (!
|
|
3549
|
+
const N = d.result;
|
|
3550
|
+
if (!N || typeof N != "object") {
|
|
3426
3551
|
console.warn(
|
|
3427
3552
|
"[LiveLayer] task_completed missing `result` payload."
|
|
3428
3553
|
);
|
|
@@ -3432,54 +3557,54 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3432
3557
|
try {
|
|
3433
3558
|
document.dispatchEvent(
|
|
3434
3559
|
new CustomEvent("ll-collected", {
|
|
3435
|
-
detail: { phase: "complete", result:
|
|
3560
|
+
detail: { phase: "complete", result: N }
|
|
3436
3561
|
})
|
|
3437
3562
|
);
|
|
3438
3563
|
} catch {
|
|
3439
3564
|
}
|
|
3440
3565
|
try {
|
|
3441
|
-
|
|
3442
|
-
|
|
3566
|
+
He == null || He(
|
|
3567
|
+
N
|
|
3443
3568
|
);
|
|
3444
|
-
} catch (
|
|
3445
|
-
console.warn("[LiveLayer] onCollect threw.",
|
|
3569
|
+
} catch (P) {
|
|
3570
|
+
console.warn("[LiveLayer] onCollect threw.", P);
|
|
3446
3571
|
}
|
|
3447
3572
|
return;
|
|
3448
3573
|
}
|
|
3449
|
-
|
|
3574
|
+
ho.has(d.type) || je == null || je(d);
|
|
3450
3575
|
}
|
|
3451
3576
|
},
|
|
3452
|
-
[
|
|
3453
|
-
), se =
|
|
3454
|
-
agentId: F ? "__controlled__" :
|
|
3577
|
+
[je, $e, He]
|
|
3578
|
+
), se = Er({
|
|
3579
|
+
agentId: F ? "__controlled__" : at,
|
|
3455
3580
|
baseUrl: o,
|
|
3456
|
-
apiKey:
|
|
3581
|
+
apiKey: l,
|
|
3457
3582
|
sessionEndpoint: s,
|
|
3458
|
-
sessionBody:
|
|
3459
|
-
onDataMessage: F ? void 0 :
|
|
3583
|
+
sessionBody: a,
|
|
3584
|
+
onDataMessage: F ? void 0 : dt
|
|
3460
3585
|
});
|
|
3461
|
-
|
|
3586
|
+
R(() => {
|
|
3462
3587
|
if (F != null && F.subscribeToDataMessages)
|
|
3463
|
-
return F.subscribeToDataMessages(
|
|
3464
|
-
}, [F,
|
|
3588
|
+
return F.subscribeToDataMessages(dt);
|
|
3589
|
+
}, [F, dt]), ke.current = () => {
|
|
3465
3590
|
var b;
|
|
3466
3591
|
return (b = se.getRoom) == null ? void 0 : b.call(se);
|
|
3467
|
-
},
|
|
3592
|
+
}, R(() => {
|
|
3468
3593
|
var ie;
|
|
3469
3594
|
if (typeof window > "u") return;
|
|
3470
3595
|
const b = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
|
|
3471
3596
|
if (b === "localhost" || b === "127.0.0.1" || b === "0.0.0.0" || b.endsWith(".local") || b.endsWith(".test"))
|
|
3472
3597
|
return window.__livelayerSimulateCommand = (de) => {
|
|
3473
3598
|
try {
|
|
3474
|
-
|
|
3599
|
+
dt(de);
|
|
3475
3600
|
} catch (Ee) {
|
|
3476
3601
|
console.warn("[LiveLayer] simulate-command threw:", Ee);
|
|
3477
3602
|
}
|
|
3478
3603
|
}, () => {
|
|
3479
3604
|
delete window.__livelayerSimulateCommand;
|
|
3480
3605
|
};
|
|
3481
|
-
}, [
|
|
3482
|
-
const L =
|
|
3606
|
+
}, [dt]);
|
|
3607
|
+
const L = rt(() => F ? {
|
|
3483
3608
|
connectionState: F.connectionState,
|
|
3484
3609
|
agentState: F.agentState,
|
|
3485
3610
|
transcript: F.transcript,
|
|
@@ -3510,84 +3635,84 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3510
3635
|
disconnect: se.disconnect,
|
|
3511
3636
|
getRoom: se.getRoom,
|
|
3512
3637
|
isControlled: !1
|
|
3513
|
-
}, [F, se]),
|
|
3514
|
-
|
|
3515
|
-
const
|
|
3516
|
-
|
|
3638
|
+
}, [F, se]), rn = I(L);
|
|
3639
|
+
rn.current = L;
|
|
3640
|
+
const on = I(F);
|
|
3641
|
+
on.current = F, wr(
|
|
3517
3642
|
n,
|
|
3518
3643
|
() => ({
|
|
3519
3644
|
sendData: async (b) => {
|
|
3520
|
-
var Ee,
|
|
3521
|
-
const d =
|
|
3645
|
+
var Ee, pt;
|
|
3646
|
+
const d = on.current;
|
|
3522
3647
|
if (d != null && d.publishData) {
|
|
3523
3648
|
try {
|
|
3524
3649
|
await d.publishData(b);
|
|
3525
|
-
} catch (
|
|
3526
|
-
console.warn("[AvatarWidget] sendData (controlled) failed:",
|
|
3650
|
+
} catch (Ie) {
|
|
3651
|
+
console.warn("[AvatarWidget] sendData (controlled) failed:", Ie);
|
|
3527
3652
|
}
|
|
3528
3653
|
return;
|
|
3529
3654
|
}
|
|
3530
|
-
const ie = (
|
|
3655
|
+
const ie = (pt = (Ee = rn.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : pt.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
|
|
3531
3656
|
if (de != null && de.publishData)
|
|
3532
3657
|
try {
|
|
3533
|
-
const
|
|
3534
|
-
await de.publishData(
|
|
3535
|
-
} catch (
|
|
3536
|
-
console.warn("[AvatarWidget] sendData failed:",
|
|
3658
|
+
const Ie = new TextEncoder().encode(JSON.stringify(b));
|
|
3659
|
+
await de.publishData(Ie, { reliable: !0 });
|
|
3660
|
+
} catch (Ie) {
|
|
3661
|
+
console.warn("[AvatarWidget] sendData failed:", Ie);
|
|
3537
3662
|
}
|
|
3538
3663
|
}
|
|
3539
3664
|
}),
|
|
3540
3665
|
[]
|
|
3541
3666
|
);
|
|
3542
|
-
const
|
|
3543
|
-
|
|
3544
|
-
const b = L.videoElement, d =
|
|
3667
|
+
const ln = I(null);
|
|
3668
|
+
R(() => {
|
|
3669
|
+
const b = L.videoElement, d = ln.current;
|
|
3545
3670
|
if (!(!b || !d))
|
|
3546
3671
|
return d.appendChild(b), () => {
|
|
3547
3672
|
b.parentNode === d && d.removeChild(b);
|
|
3548
3673
|
};
|
|
3549
3674
|
}, [L.videoElement]);
|
|
3550
|
-
const [
|
|
3551
|
-
|
|
3552
|
-
if (
|
|
3553
|
-
|
|
3675
|
+
const [Ke, St] = M(!1);
|
|
3676
|
+
R(() => {
|
|
3677
|
+
if (!$) {
|
|
3678
|
+
St(!0);
|
|
3554
3679
|
return;
|
|
3555
3680
|
}
|
|
3556
|
-
L.agentState === "speaking" && !
|
|
3557
|
-
}, [
|
|
3558
|
-
if (
|
|
3681
|
+
L.agentState === "speaking" && !Ke && St(!0);
|
|
3682
|
+
}, [$, L.agentState, Ke]), R(() => {
|
|
3683
|
+
if (!$) return;
|
|
3559
3684
|
const b = L.connectionState;
|
|
3560
|
-
(b === "disconnected" || b === "idle") &&
|
|
3561
|
-
}, [
|
|
3562
|
-
if (
|
|
3563
|
-
const b = setTimeout(() =>
|
|
3685
|
+
(b === "disconnected" || b === "idle") && St(!1);
|
|
3686
|
+
}, [$, L.connectionState]), R(() => {
|
|
3687
|
+
if (!$ || !L.videoElement || Ke) return;
|
|
3688
|
+
const b = setTimeout(() => St(!0), 5e3);
|
|
3564
3689
|
return () => clearTimeout(b);
|
|
3565
|
-
}, [
|
|
3690
|
+
}, [$, L.videoElement, Ke]), R(() => {
|
|
3566
3691
|
const b = L.videoElement;
|
|
3567
3692
|
if (b) {
|
|
3568
|
-
if (
|
|
3693
|
+
if (!$) {
|
|
3569
3694
|
b.style.filter = "";
|
|
3570
3695
|
return;
|
|
3571
3696
|
}
|
|
3572
|
-
b.style.transition = "filter 500ms ease-out", b.style.filter =
|
|
3697
|
+
b.style.transition = "filter 500ms ease-out", b.style.filter = Ke ? "" : "blur(8px)";
|
|
3573
3698
|
}
|
|
3574
|
-
}, [
|
|
3699
|
+
}, [$, L.videoElement, Ke]), R(() => {
|
|
3575
3700
|
const b = L.audioElement;
|
|
3576
3701
|
if (!b) return;
|
|
3577
3702
|
const d = document.createElement("div");
|
|
3578
3703
|
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d), Me.attach(b);
|
|
3579
3704
|
const ie = b.play();
|
|
3580
3705
|
return ie && typeof ie.catch == "function" && ie.catch((de) => {
|
|
3581
|
-
(de == null ? void 0 : de.name) === "NotAllowedError" &&
|
|
3706
|
+
(de == null ? void 0 : de.name) === "NotAllowedError" && Xe(!0);
|
|
3582
3707
|
}), () => {
|
|
3583
3708
|
Me.detach(), b.parentNode === d && d.removeChild(b), d.parentNode === document.body && document.body.removeChild(d);
|
|
3584
3709
|
};
|
|
3585
3710
|
}, [L.audioElement]);
|
|
3586
|
-
const ve =
|
|
3711
|
+
const ve = Mr({
|
|
3587
3712
|
gateUntilAgentReady: !0,
|
|
3588
3713
|
agentState: L.agentState
|
|
3589
3714
|
});
|
|
3590
|
-
|
|
3715
|
+
R(() => {
|
|
3591
3716
|
if (L.isControlled || L.connectionState !== "connected") return;
|
|
3592
3717
|
const b = L.getRoom();
|
|
3593
3718
|
if (b)
|
|
@@ -3598,19 +3723,19 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3598
3723
|
}), () => {
|
|
3599
3724
|
Me.detachSlot("mic"), ve.teardownMic();
|
|
3600
3725
|
};
|
|
3601
|
-
}, [L.isControlled, L.connectionState]),
|
|
3726
|
+
}, [L.isControlled, L.connectionState]), R(() => {
|
|
3602
3727
|
var d;
|
|
3603
3728
|
if (L.connectionState !== "connected") return;
|
|
3604
3729
|
const b = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
|
|
3605
3730
|
if (b)
|
|
3606
|
-
return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b),
|
|
3731
|
+
return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b), Ce.refresh(), () => {
|
|
3607
3732
|
Se.teardown(), ye.teardown();
|
|
3608
3733
|
};
|
|
3609
|
-
}, [L.isControlled, L.connectionState, F]),
|
|
3734
|
+
}, [L.isControlled, L.connectionState, F]), R(() => {
|
|
3610
3735
|
const b = L.audioElement;
|
|
3611
|
-
b && (b.muted =
|
|
3612
|
-
}, [L.audioElement,
|
|
3613
|
-
const
|
|
3736
|
+
b && (b.muted = $t);
|
|
3737
|
+
}, [L.audioElement, $t]);
|
|
3738
|
+
const ir = C((b) => {
|
|
3614
3739
|
const d = { type: "user_message", text: b };
|
|
3615
3740
|
if (F != null && F.publishData) {
|
|
3616
3741
|
try {
|
|
@@ -3626,149 +3751,149 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3626
3751
|
ie.localParticipant.publishData(de, { reliable: !0 });
|
|
3627
3752
|
} catch {
|
|
3628
3753
|
}
|
|
3629
|
-
}, [L, F]),
|
|
3630
|
-
|
|
3754
|
+
}, [L, F]), or = C(() => {
|
|
3755
|
+
rr((b) => !b);
|
|
3631
3756
|
}, []);
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
}, [L.connectionState,
|
|
3635
|
-
|
|
3636
|
-
}, [L.transcript,
|
|
3757
|
+
R(() => {
|
|
3758
|
+
ze == null || ze(L.connectionState), L.connectionState === "connected" ? Ue == null || Ue() : L.connectionState === "disconnected" && (Re == null || Re());
|
|
3759
|
+
}, [L.connectionState, Ue, Re, ze]), R(() => {
|
|
3760
|
+
De == null || De(L.transcript);
|
|
3761
|
+
}, [L.transcript, De]), R(() => {
|
|
3637
3762
|
Pe == null || Pe(L.agentState);
|
|
3638
|
-
}, [L.agentState, Pe]),
|
|
3639
|
-
|
|
3640
|
-
}, [L.agentState,
|
|
3641
|
-
const
|
|
3642
|
-
|
|
3643
|
-
!m ||
|
|
3644
|
-
}, [m, L.connectionState, L,
|
|
3645
|
-
const
|
|
3763
|
+
}, [L.agentState, Pe]), R(() => {
|
|
3764
|
+
Ct.setThinking(L.agentState === "thinking");
|
|
3765
|
+
}, [L.agentState, Ct]);
|
|
3766
|
+
const an = I(!1);
|
|
3767
|
+
R(() => {
|
|
3768
|
+
!m || an.current || Fe && L.connectionState === "idle" && (an.current = !0, L.connect());
|
|
3769
|
+
}, [m, L.connectionState, L, Fe]);
|
|
3770
|
+
const lr = C(
|
|
3646
3771
|
(b) => {
|
|
3647
3772
|
const d = v == null ? void 0 : v.find((ie) => ie.id === b);
|
|
3648
|
-
d && (re(!1), b !==
|
|
3773
|
+
d && (re(!1), b !== Be && (ut(!0), L.disconnect(), Ae || _t(b), g == null || g(d)));
|
|
3649
3774
|
},
|
|
3650
3775
|
[
|
|
3651
3776
|
v,
|
|
3652
|
-
|
|
3777
|
+
Be,
|
|
3653
3778
|
L,
|
|
3654
|
-
|
|
3779
|
+
Ae,
|
|
3655
3780
|
g
|
|
3656
3781
|
]
|
|
3657
3782
|
);
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
}, [L.connectionState,
|
|
3783
|
+
R(() => {
|
|
3784
|
+
ct && L.connectionState === "connected" && ut(!1);
|
|
3785
|
+
}, [L.connectionState, ct]), R(() => {
|
|
3661
3786
|
if (!_) return;
|
|
3662
3787
|
const b = (d) => {
|
|
3663
3788
|
d.key === "Escape" && re(!1);
|
|
3664
3789
|
};
|
|
3665
3790
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3666
3791
|
}, [_]);
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3669
|
-
const
|
|
3670
|
-
() =>
|
|
3671
|
-
[
|
|
3672
|
-
),
|
|
3673
|
-
L.disconnect(),
|
|
3674
|
-
}, [L,
|
|
3792
|
+
const ar = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ft = Pr(at, o, ar);
|
|
3793
|
+
qe === void 0 && ((dn = ft.info) != null && dn.capabilities) && (Wt.current = ft.info.capabilities);
|
|
3794
|
+
const Et = (ue == null ? void 0 : ue.name) ?? ae ?? ((fn = L.agentConfig) == null ? void 0 : fn.name) ?? ((pn = ft.info) == null ? void 0 : pn.name) ?? "Live Layer", qt = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((hn = L.agentConfig) == null ? void 0 : hn.avatarImageUrl) ?? ((mn = ft.info) == null ? void 0 : mn.avatarImageUrl) ?? null, sr = z ?? ((gn = L.agentConfig) == null ? void 0 : gn.idleLoopUrl) ?? ((yn = ft.info) == null ? void 0 : yn.idleLoopUrl) ?? null, cr = B ?? null, ur = C(() => Le("expanded"), [Le]), dr = C(
|
|
3795
|
+
() => Le("minimized"),
|
|
3796
|
+
[Le]
|
|
3797
|
+
), sn = C(() => {
|
|
3798
|
+
L.disconnect(), Le("hidden");
|
|
3799
|
+
}, [L, Le]), fr = C(() => {
|
|
3675
3800
|
const b = L.audioElement;
|
|
3676
|
-
b && b.play().then(() =>
|
|
3801
|
+
b && b.play().then(() => Xe(!1)).catch(() => {
|
|
3677
3802
|
});
|
|
3678
|
-
}, [L.audioElement]),
|
|
3679
|
-
|
|
3680
|
-
}, [L]),
|
|
3681
|
-
...
|
|
3682
|
-
...le ? {} : { zIndex:
|
|
3803
|
+
}, [L.audioElement]), pr = C(() => {
|
|
3804
|
+
Xe(!1), L.connect();
|
|
3805
|
+
}, [L]), Je = {
|
|
3806
|
+
...Ve,
|
|
3807
|
+
...le ? {} : { zIndex: xe }
|
|
3683
3808
|
};
|
|
3684
|
-
|
|
3685
|
-
const
|
|
3686
|
-
...
|
|
3687
|
-
...
|
|
3688
|
-
},
|
|
3809
|
+
H.primaryColor && (Je["--ll-color-primary"] = H.primaryColor), H.accentColor && (Je["--ll-color-accent"] = H.accentColor), H.backgroundColor && (Je["--ll-color-bg"] = H.backgroundColor), H.textColor && (Je["--ll-color-fg"] = H.textColor);
|
|
3810
|
+
const hr = {
|
|
3811
|
+
...Je,
|
|
3812
|
+
...Ne.style
|
|
3813
|
+
}, mr = [
|
|
3689
3814
|
"ll-widget",
|
|
3690
3815
|
`ll-widget--${ge}`,
|
|
3691
3816
|
`ll-widget--${pe ? "mobile" : "desktop"}`,
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3817
|
+
Ne.hasGeometry ? "ll-widget--has-geometry" : null,
|
|
3818
|
+
Ne.isDragging ? "is-dragging" : null,
|
|
3819
|
+
Ne.isResizing ? "is-resizing" : null,
|
|
3820
|
+
Oe
|
|
3696
3821
|
].filter(Boolean).join(" ");
|
|
3697
|
-
if (!
|
|
3698
|
-
const
|
|
3822
|
+
if (!Fe) return null;
|
|
3823
|
+
const gr = /* @__PURE__ */ r(
|
|
3699
3824
|
"div",
|
|
3700
3825
|
{
|
|
3701
|
-
className:
|
|
3702
|
-
style:
|
|
3826
|
+
className: mr,
|
|
3827
|
+
style: hr,
|
|
3703
3828
|
"data-display-mode": ge,
|
|
3704
3829
|
"data-position": x,
|
|
3705
3830
|
"data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
|
|
3706
3831
|
children: ge === "expanded" && /* @__PURE__ */ r(
|
|
3707
|
-
|
|
3832
|
+
xi,
|
|
3708
3833
|
{
|
|
3709
3834
|
position: x,
|
|
3710
3835
|
isMobile: pe,
|
|
3711
|
-
agentName:
|
|
3712
|
-
avatarImageUrl:
|
|
3713
|
-
idleLoopUrl:
|
|
3714
|
-
greeting:
|
|
3715
|
-
branding:
|
|
3836
|
+
agentName: Et,
|
|
3837
|
+
avatarImageUrl: qt,
|
|
3838
|
+
idleLoopUrl: sr,
|
|
3839
|
+
greeting: cr,
|
|
3840
|
+
branding: H,
|
|
3716
3841
|
teamMembers: v,
|
|
3717
|
-
currentTeamMemberId:
|
|
3718
|
-
isSwitchingTeamMember:
|
|
3842
|
+
currentTeamMemberId: Be,
|
|
3843
|
+
isSwitchingTeamMember: ct,
|
|
3719
3844
|
teamSwitcherOpen: _,
|
|
3720
3845
|
onToggleTeamSwitcher: () => re((b) => !b),
|
|
3721
|
-
onSelectTeamMember:
|
|
3846
|
+
onSelectTeamMember: lr,
|
|
3722
3847
|
connectionState: L.connectionState,
|
|
3723
3848
|
agentState: L.agentState,
|
|
3724
3849
|
transcript: L.transcript,
|
|
3725
3850
|
isMuted: ve.isMuted,
|
|
3726
|
-
micDevices:
|
|
3851
|
+
micDevices: Ce.mics,
|
|
3727
3852
|
activeMicId: ve.activeDeviceId,
|
|
3728
3853
|
isCameraEnabled: Se.isEnabled,
|
|
3729
3854
|
cameraPreviewEl: Se.previewEl,
|
|
3730
|
-
cameraDevices:
|
|
3855
|
+
cameraDevices: Ce.cameras,
|
|
3731
3856
|
activeCameraId: Se.activeDeviceId,
|
|
3732
3857
|
isScreenShareEnabled: ye.isEnabled,
|
|
3733
3858
|
screenPreviewEl: ye.previewEl,
|
|
3734
|
-
isSpeakerMuted:
|
|
3859
|
+
isSpeakerMuted: $t,
|
|
3735
3860
|
allowCamera: G,
|
|
3736
3861
|
allowScreenShare: f,
|
|
3737
|
-
allowTyping:
|
|
3738
|
-
showMinimize: pe && !le ? !1 :
|
|
3739
|
-
showClose:
|
|
3862
|
+
allowTyping: A,
|
|
3863
|
+
showMinimize: pe && !le ? !1 : xt,
|
|
3864
|
+
showClose: Dt,
|
|
3740
3865
|
chromeless: ee,
|
|
3741
|
-
compactControls:
|
|
3866
|
+
compactControls: Pt,
|
|
3742
3867
|
transforming: oe,
|
|
3743
3868
|
transformingLabel: U,
|
|
3744
|
-
languageMenuOpen:
|
|
3745
|
-
onToggleLanguageMenu: () =>
|
|
3746
|
-
needsUserGesture:
|
|
3869
|
+
languageMenuOpen: tr,
|
|
3870
|
+
onToggleLanguageMenu: () => nr((b) => !b),
|
|
3871
|
+
needsUserGesture: Lt,
|
|
3747
3872
|
canResume: L.canResume,
|
|
3748
3873
|
micError: ve.micError,
|
|
3749
3874
|
error: L.error,
|
|
3750
|
-
avatarVideoContainerRef:
|
|
3875
|
+
avatarVideoContainerRef: ln,
|
|
3751
3876
|
agentVideoEl: L.videoElement,
|
|
3752
3877
|
onConnect: () => void L.connect(),
|
|
3753
3878
|
onDisconnect: () => L.disconnect(),
|
|
3754
|
-
onRetry:
|
|
3755
|
-
onResumeAudio:
|
|
3879
|
+
onRetry: pr,
|
|
3880
|
+
onResumeAudio: fr,
|
|
3756
3881
|
onToggleMute: ve.toggleMute,
|
|
3757
3882
|
onSwitchMicDevice: (b) => void ve.switchDevice(b),
|
|
3758
3883
|
onToggleCamera: () => void Se.toggle(),
|
|
3759
3884
|
onSwitchCameraDevice: (b) => void Se.switchDevice(b),
|
|
3760
3885
|
onToggleScreenShare: () => void ye.toggle(),
|
|
3761
|
-
onToggleSpeaker:
|
|
3762
|
-
onSendMessage:
|
|
3763
|
-
onMinimize:
|
|
3764
|
-
onClose:
|
|
3886
|
+
onToggleSpeaker: or,
|
|
3887
|
+
onSendMessage: ir,
|
|
3888
|
+
onMinimize: dr,
|
|
3889
|
+
onClose: sn,
|
|
3765
3890
|
onClearMicError: ve.clearError,
|
|
3766
|
-
dragHandleProps:
|
|
3767
|
-
resizeHandleProps:
|
|
3891
|
+
dragHandleProps: Ne.dragHandleProps,
|
|
3892
|
+
resizeHandleProps: Ne.resizeHandleProps
|
|
3768
3893
|
}
|
|
3769
3894
|
)
|
|
3770
3895
|
}
|
|
3771
|
-
),
|
|
3896
|
+
), cn = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
|
|
3772
3897
|
"div",
|
|
3773
3898
|
{
|
|
3774
3899
|
className: [
|
|
@@ -3777,113 +3902,113 @@ const Vi = /* @__PURE__ */ new Set([
|
|
|
3777
3902
|
`ll-widget--${ge}`,
|
|
3778
3903
|
`ll-widget--${pe ? "mobile" : "desktop"}`
|
|
3779
3904
|
].join(" "),
|
|
3780
|
-
style:
|
|
3905
|
+
style: Je,
|
|
3781
3906
|
"data-display-mode": ge,
|
|
3782
3907
|
"data-position": x,
|
|
3783
3908
|
children: [
|
|
3784
3909
|
ge === "hidden" && /* @__PURE__ */ r(
|
|
3785
|
-
|
|
3910
|
+
di,
|
|
3786
3911
|
{
|
|
3787
3912
|
position: x,
|
|
3788
3913
|
isMobile: pe,
|
|
3789
3914
|
isSpeaking: L.agentState === "speaking",
|
|
3790
|
-
onExpand: () =>
|
|
3791
|
-
label: `Open ${
|
|
3792
|
-
avatarImageUrl:
|
|
3793
|
-
agentName:
|
|
3915
|
+
onExpand: () => Le("expanded"),
|
|
3916
|
+
label: `Open ${Et} widget`,
|
|
3917
|
+
avatarImageUrl: qt,
|
|
3918
|
+
agentName: Et,
|
|
3794
3919
|
containerEl: V
|
|
3795
3920
|
}
|
|
3796
3921
|
),
|
|
3797
3922
|
ge === "minimized" && /* @__PURE__ */ r(
|
|
3798
|
-
|
|
3923
|
+
pi,
|
|
3799
3924
|
{
|
|
3800
3925
|
position: x,
|
|
3801
3926
|
isMobile: pe,
|
|
3802
|
-
agentName:
|
|
3803
|
-
avatarImageUrl:
|
|
3927
|
+
agentName: Et,
|
|
3928
|
+
avatarImageUrl: qt,
|
|
3804
3929
|
agentState: L.agentState,
|
|
3805
3930
|
isMuted: ve.isMuted,
|
|
3806
3931
|
audioLevel: Me,
|
|
3807
|
-
onExpand:
|
|
3932
|
+
onExpand: ur,
|
|
3808
3933
|
onToggleMute: ve.toggleMute,
|
|
3809
|
-
onClose:
|
|
3934
|
+
onClose: sn
|
|
3810
3935
|
}
|
|
3811
3936
|
)
|
|
3812
3937
|
]
|
|
3813
3938
|
}
|
|
3814
|
-
) : null,
|
|
3939
|
+
) : null, un = V ?? (typeof document < "u" ? document.body : null);
|
|
3815
3940
|
return /* @__PURE__ */ k(We, { children: [
|
|
3816
|
-
|
|
3817
|
-
|
|
3941
|
+
gr,
|
|
3942
|
+
cn && un && Qt(cn, un)
|
|
3818
3943
|
] });
|
|
3819
3944
|
}
|
|
3820
3945
|
);
|
|
3821
|
-
|
|
3822
|
-
const
|
|
3946
|
+
er.displayName = "AvatarWidgetInner";
|
|
3947
|
+
const mo = Zt(
|
|
3823
3948
|
function(t, n) {
|
|
3824
|
-
return /* @__PURE__ */ r(
|
|
3949
|
+
return /* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ r(er, { ...t, ref: n }) });
|
|
3825
3950
|
}
|
|
3826
3951
|
);
|
|
3827
|
-
|
|
3828
|
-
const
|
|
3952
|
+
mo.displayName = "AvatarWidget";
|
|
3953
|
+
const So = ({
|
|
3829
3954
|
agentId: e,
|
|
3830
3955
|
baseUrl: t,
|
|
3831
3956
|
apiKey: n,
|
|
3832
3957
|
mode: i,
|
|
3833
|
-
onAgentEvent:
|
|
3958
|
+
onAgentEvent: l,
|
|
3834
3959
|
className: o,
|
|
3835
3960
|
style: s
|
|
3836
3961
|
}) => {
|
|
3837
|
-
const
|
|
3838
|
-
u.current =
|
|
3962
|
+
const a = I(null), c = I(null), u = I(l);
|
|
3963
|
+
u.current = l;
|
|
3839
3964
|
const m = C((p) => {
|
|
3840
|
-
var
|
|
3965
|
+
var D;
|
|
3841
3966
|
const h = p.detail;
|
|
3842
|
-
(
|
|
3967
|
+
(D = u.current) == null || D.call(u, h);
|
|
3843
3968
|
}, []);
|
|
3844
|
-
return
|
|
3845
|
-
const p =
|
|
3969
|
+
return R(() => {
|
|
3970
|
+
const p = a.current;
|
|
3846
3971
|
if (!p) return;
|
|
3847
3972
|
const h = document.createElement("livelayer-widget");
|
|
3848
3973
|
return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event", m), p.appendChild(h), c.current = h, () => {
|
|
3849
3974
|
h.removeEventListener("agent-event", m), p.removeChild(h), c.current = null;
|
|
3850
3975
|
};
|
|
3851
|
-
}, [e]),
|
|
3976
|
+
}, [e]), R(() => {
|
|
3852
3977
|
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
3853
|
-
}, [i]), /* @__PURE__ */ r("div", { ref:
|
|
3854
|
-
},
|
|
3855
|
-
function({ id: t, intent: n, as: i = "div", className:
|
|
3856
|
-
return
|
|
3978
|
+
}, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
|
|
3979
|
+
}, Eo = Zt(
|
|
3980
|
+
function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
|
|
3981
|
+
return _r(
|
|
3857
3982
|
i,
|
|
3858
3983
|
{
|
|
3859
|
-
ref:
|
|
3984
|
+
ref: a,
|
|
3860
3985
|
"data-ll-region": t,
|
|
3861
3986
|
"data-ll-intent": n,
|
|
3862
|
-
className:
|
|
3987
|
+
className: l,
|
|
3863
3988
|
style: o
|
|
3864
3989
|
},
|
|
3865
3990
|
s
|
|
3866
3991
|
);
|
|
3867
3992
|
}
|
|
3868
3993
|
);
|
|
3869
|
-
function
|
|
3870
|
-
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [
|
|
3871
|
-
|
|
3994
|
+
function Ao(e = {}) {
|
|
3995
|
+
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, u] = M(null), m = I(t), p = I(n), h = I(i);
|
|
3996
|
+
R(() => {
|
|
3872
3997
|
m.current = t, p.current = n, h.current = i;
|
|
3873
3998
|
}, [t, n, i]);
|
|
3874
|
-
const
|
|
3875
|
-
o({}),
|
|
3999
|
+
const D = C(() => {
|
|
4000
|
+
o({}), a(!1);
|
|
3876
4001
|
}, []);
|
|
3877
|
-
return
|
|
4002
|
+
return R(() => {
|
|
3878
4003
|
if (typeof window > "u") return;
|
|
3879
4004
|
const x = (E) => {
|
|
3880
|
-
var w,
|
|
4005
|
+
var w, T;
|
|
3881
4006
|
const y = E.detail;
|
|
3882
4007
|
if (y) {
|
|
3883
4008
|
if (y.phase === "field") {
|
|
3884
4009
|
if (h.current !== "all" && y.source !== h.current)
|
|
3885
4010
|
return;
|
|
3886
|
-
|
|
4011
|
+
a(!0), o(
|
|
3887
4012
|
(S) => S[y.fieldName] === y.value ? S : { ...S, [y.fieldName]: y.value }
|
|
3888
4013
|
);
|
|
3889
4014
|
try {
|
|
@@ -3897,9 +4022,9 @@ function lo(e = {}) {
|
|
|
3897
4022
|
const S = y.result;
|
|
3898
4023
|
if (h.current !== "all" && S.source !== h.current)
|
|
3899
4024
|
return;
|
|
3900
|
-
u(S),
|
|
4025
|
+
u(S), a(!1);
|
|
3901
4026
|
try {
|
|
3902
|
-
(
|
|
4027
|
+
(T = p.current) == null || T.call(p, S);
|
|
3903
4028
|
} catch (v) {
|
|
3904
4029
|
console.warn("[LiveLayer] useCollect onComplete threw.", v);
|
|
3905
4030
|
}
|
|
@@ -3907,68 +4032,68 @@ function lo(e = {}) {
|
|
|
3907
4032
|
}
|
|
3908
4033
|
};
|
|
3909
4034
|
return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
|
|
3910
|
-
}, []), { fields:
|
|
4035
|
+
}, []), { fields: l, isCollecting: s, lastResult: c, reset: D };
|
|
3911
4036
|
}
|
|
3912
|
-
let
|
|
3913
|
-
function
|
|
4037
|
+
let Bn = 1;
|
|
4038
|
+
function No({
|
|
3914
4039
|
onMount: e,
|
|
3915
4040
|
defaultOpen: t = !1,
|
|
3916
4041
|
storageKey: n = "ll-debug-open"
|
|
3917
4042
|
}) {
|
|
3918
|
-
const [i,
|
|
3919
|
-
|
|
4043
|
+
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [u, m] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), D = I(u);
|
|
4044
|
+
D.current = u, R(() => {
|
|
3920
4045
|
try {
|
|
3921
4046
|
const y = localStorage.getItem(n);
|
|
3922
|
-
y === "1" &&
|
|
4047
|
+
y === "1" && l(!0), y === "0" && l(!1);
|
|
3923
4048
|
} catch {
|
|
3924
4049
|
}
|
|
3925
|
-
}, [n]),
|
|
4050
|
+
}, [n]), R(() => {
|
|
3926
4051
|
try {
|
|
3927
4052
|
localStorage.setItem(n, i ? "1" : "0");
|
|
3928
4053
|
} catch {
|
|
3929
4054
|
}
|
|
3930
|
-
}, [i, n]),
|
|
4055
|
+
}, [i, n]), R(() => {
|
|
3931
4056
|
const y = (w) => {
|
|
3932
|
-
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(),
|
|
4057
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((T) => !T));
|
|
3933
4058
|
};
|
|
3934
4059
|
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3935
|
-
}, []),
|
|
4060
|
+
}, []), R(() => {
|
|
3936
4061
|
const y = setInterval(() => {
|
|
3937
|
-
if (h.current.length === 0 ||
|
|
4062
|
+
if (h.current.length === 0 || D.current) return;
|
|
3938
4063
|
const w = h.current.splice(0, h.current.length);
|
|
3939
4064
|
s(
|
|
3940
|
-
(
|
|
4065
|
+
(T) => [...w.reverse(), ...T].slice(0, 200)
|
|
3941
4066
|
);
|
|
3942
4067
|
}, 100);
|
|
3943
4068
|
return () => clearInterval(y);
|
|
3944
4069
|
}, []);
|
|
3945
4070
|
const x = I(!1);
|
|
3946
|
-
if (
|
|
4071
|
+
if (R(() => {
|
|
3947
4072
|
!e || x.current || (x.current = !0, e((y) => {
|
|
3948
4073
|
h.current.push({
|
|
3949
|
-
id:
|
|
4074
|
+
id: Bn++,
|
|
3950
4075
|
ts: Date.now(),
|
|
3951
4076
|
kind: "event",
|
|
3952
4077
|
type: y.eventName,
|
|
3953
4078
|
data: y.data
|
|
3954
4079
|
});
|
|
3955
4080
|
}));
|
|
3956
|
-
}, [e]),
|
|
3957
|
-
const y = console.warn, w = console.log,
|
|
4081
|
+
}, [e]), R(() => {
|
|
4082
|
+
const y = console.warn, w = console.log, T = (S, v) => function(...O) {
|
|
3958
4083
|
try {
|
|
3959
4084
|
const g = typeof O[0] == "string" ? O[0] : "";
|
|
3960
4085
|
g.startsWith("[LiveLayer]") && h.current.push({
|
|
3961
|
-
id:
|
|
4086
|
+
id: Bn++,
|
|
3962
4087
|
ts: Date.now(),
|
|
3963
4088
|
kind: S,
|
|
3964
4089
|
type: g.slice(0, 120),
|
|
3965
|
-
data: { args: O.slice(1).map((
|
|
4090
|
+
data: { args: O.slice(1).map((z) => yo(z)) }
|
|
3966
4091
|
});
|
|
3967
4092
|
} catch {
|
|
3968
4093
|
}
|
|
3969
4094
|
return v.apply(this, O);
|
|
3970
4095
|
};
|
|
3971
|
-
return console.warn =
|
|
4096
|
+
return console.warn = T("warn", y), console.log = T("log", w), () => {
|
|
3972
4097
|
console.warn = y, console.log = w;
|
|
3973
4098
|
};
|
|
3974
4099
|
}, []), !i)
|
|
@@ -3976,7 +4101,7 @@ function ao({
|
|
|
3976
4101
|
"button",
|
|
3977
4102
|
{
|
|
3978
4103
|
type: "button",
|
|
3979
|
-
onClick: () =>
|
|
4104
|
+
onClick: () => l(!0),
|
|
3980
4105
|
title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
|
|
3981
4106
|
"aria-label": "Open LiveLayer debug panel",
|
|
3982
4107
|
style: {
|
|
@@ -3999,8 +4124,8 @@ function ao({
|
|
|
3999
4124
|
}
|
|
4000
4125
|
);
|
|
4001
4126
|
const E = o.filter((y) => {
|
|
4002
|
-
if (!
|
|
4003
|
-
const w =
|
|
4127
|
+
if (!a) return !0;
|
|
4128
|
+
const w = a.toLowerCase();
|
|
4004
4129
|
return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
|
|
4005
4130
|
});
|
|
4006
4131
|
return /* @__PURE__ */ k(
|
|
@@ -4049,7 +4174,7 @@ function ao({
|
|
|
4049
4174
|
{
|
|
4050
4175
|
type: "button",
|
|
4051
4176
|
onClick: () => m((y) => !y),
|
|
4052
|
-
style:
|
|
4177
|
+
style: Xt(u ? "#f59e0b" : "transparent"),
|
|
4053
4178
|
title: "Pause / resume capture",
|
|
4054
4179
|
children: u ? "▶ resume" : "⏸ pause"
|
|
4055
4180
|
}
|
|
@@ -4061,7 +4186,7 @@ function ao({
|
|
|
4061
4186
|
onClick: () => {
|
|
4062
4187
|
s([]), h.current = [];
|
|
4063
4188
|
},
|
|
4064
|
-
style:
|
|
4189
|
+
style: Xt("transparent"),
|
|
4065
4190
|
title: "Clear buffer",
|
|
4066
4191
|
children: "clear"
|
|
4067
4192
|
}
|
|
@@ -4070,8 +4195,8 @@ function ao({
|
|
|
4070
4195
|
"button",
|
|
4071
4196
|
{
|
|
4072
4197
|
type: "button",
|
|
4073
|
-
onClick: () =>
|
|
4074
|
-
style:
|
|
4198
|
+
onClick: () => l(!1),
|
|
4199
|
+
style: Xt("transparent"),
|
|
4075
4200
|
"aria-label": "Close",
|
|
4076
4201
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
4077
4202
|
children: "✕"
|
|
@@ -4084,7 +4209,7 @@ function ao({
|
|
|
4084
4209
|
"input",
|
|
4085
4210
|
{
|
|
4086
4211
|
type: "text",
|
|
4087
|
-
value:
|
|
4212
|
+
value: a,
|
|
4088
4213
|
onChange: (y) => c(y.target.value),
|
|
4089
4214
|
placeholder: "filter by type or data…",
|
|
4090
4215
|
style: {
|
|
@@ -4138,7 +4263,7 @@ function ao({
|
|
|
4138
4263
|
]
|
|
4139
4264
|
}
|
|
4140
4265
|
) : E.map((y) => /* @__PURE__ */ r(
|
|
4141
|
-
|
|
4266
|
+
go,
|
|
4142
4267
|
{
|
|
4143
4268
|
entry: y,
|
|
4144
4269
|
expanded: p.current.has(y.id),
|
|
@@ -4154,12 +4279,12 @@ function ao({
|
|
|
4154
4279
|
}
|
|
4155
4280
|
);
|
|
4156
4281
|
}
|
|
4157
|
-
function
|
|
4282
|
+
function go({
|
|
4158
4283
|
entry: e,
|
|
4159
4284
|
expanded: t,
|
|
4160
4285
|
onToggle: n
|
|
4161
4286
|
}) {
|
|
4162
|
-
const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1",
|
|
4287
|
+
const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", l = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
4163
4288
|
hour12: !1
|
|
4164
4289
|
});
|
|
4165
4290
|
return /* @__PURE__ */ k(
|
|
@@ -4189,7 +4314,7 @@ function Gi({
|
|
|
4189
4314
|
fontVariantNumeric: "tabular-nums",
|
|
4190
4315
|
fontSize: 10
|
|
4191
4316
|
},
|
|
4192
|
-
children:
|
|
4317
|
+
children: l
|
|
4193
4318
|
}
|
|
4194
4319
|
),
|
|
4195
4320
|
/* @__PURE__ */ r(
|
|
@@ -4224,7 +4349,7 @@ function Gi({
|
|
|
4224
4349
|
}
|
|
4225
4350
|
);
|
|
4226
4351
|
}
|
|
4227
|
-
function
|
|
4352
|
+
function Xt(e) {
|
|
4228
4353
|
return {
|
|
4229
4354
|
background: e,
|
|
4230
4355
|
color: "#fff",
|
|
@@ -4235,29 +4360,29 @@ function jt(e) {
|
|
|
4235
4360
|
cursor: "pointer"
|
|
4236
4361
|
};
|
|
4237
4362
|
}
|
|
4238
|
-
function
|
|
4363
|
+
function yo(e) {
|
|
4239
4364
|
try {
|
|
4240
4365
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
4241
4366
|
} catch {
|
|
4242
4367
|
return String(e);
|
|
4243
4368
|
}
|
|
4244
4369
|
}
|
|
4245
|
-
function
|
|
4370
|
+
function vo(e) {
|
|
4246
4371
|
const t = JSON.stringify(e);
|
|
4247
|
-
|
|
4372
|
+
R(() => Lr(e), [t]);
|
|
4248
4373
|
}
|
|
4249
|
-
function
|
|
4250
|
-
return
|
|
4374
|
+
function Mo({ fields: e, children: t }) {
|
|
4375
|
+
return vo(e), /* @__PURE__ */ r(We, { children: t });
|
|
4251
4376
|
}
|
|
4252
|
-
function
|
|
4253
|
-
const [e, t] = M([]), n = C((
|
|
4377
|
+
function Io() {
|
|
4378
|
+
const [e, t] = M([]), n = C((l) => {
|
|
4254
4379
|
t((o) => {
|
|
4255
|
-
const s = o.findIndex((
|
|
4380
|
+
const s = o.findIndex((a) => a.id === l.id);
|
|
4256
4381
|
if (s >= 0) {
|
|
4257
|
-
const
|
|
4258
|
-
return
|
|
4382
|
+
const a = o.slice();
|
|
4383
|
+
return a[s] = l, a;
|
|
4259
4384
|
}
|
|
4260
|
-
return [...o,
|
|
4385
|
+
return [...o, l];
|
|
4261
4386
|
});
|
|
4262
4387
|
}, []), i = C(() => t([]), []);
|
|
4263
4388
|
return {
|
|
@@ -4268,38 +4393,38 @@ function co() {
|
|
|
4268
4393
|
};
|
|
4269
4394
|
}
|
|
4270
4395
|
export {
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4396
|
+
mo as AvatarWidget,
|
|
4397
|
+
Sr as ErrorBoundary,
|
|
4398
|
+
Mo as FieldProvider,
|
|
4399
|
+
No as LiveLayerDebugPanel,
|
|
4400
|
+
Eo as LiveLayerRegion,
|
|
4401
|
+
So as LiveLayerWidget,
|
|
4402
|
+
Do as clearFieldRegistry,
|
|
4403
|
+
Gi as clearPageContextCache,
|
|
4404
|
+
eo as clearRoutesCache,
|
|
4405
|
+
Vi as extractPageContext,
|
|
4406
|
+
Zi as extractRoutes,
|
|
4407
|
+
$n as getCachedPageContext,
|
|
4408
|
+
Yt as getCachedRoutes,
|
|
4409
|
+
Po as getRegisteredFields,
|
|
4410
|
+
ti as matchesPattern,
|
|
4411
|
+
Ki as normalizeRouteInput,
|
|
4412
|
+
zo as registerFields,
|
|
4413
|
+
$o as setFieldValue,
|
|
4414
|
+
ni as shouldRenderAtPath,
|
|
4415
|
+
Pr as useAgentInfo,
|
|
4416
|
+
Ar as useAudioLevel,
|
|
4417
|
+
Tr as useCameraState,
|
|
4418
|
+
Ao as useCollect,
|
|
4419
|
+
$r as useDisplayMode,
|
|
4420
|
+
Fr as useDisplayModePersistence,
|
|
4421
|
+
Wr as useIsMobile,
|
|
4422
|
+
Er as useLiveKitSession,
|
|
4423
|
+
Dr as useMediaDevices,
|
|
4424
|
+
Mr as useMicrophoneState,
|
|
4425
|
+
Kr as usePathname,
|
|
4426
|
+
vo as useRegisterFields,
|
|
4427
|
+
ri as useRouteMatch,
|
|
4428
|
+
Rr as useScreenShareState,
|
|
4429
|
+
Io as useTranscript
|
|
4305
4430
|
};
|