@livelayer/react 0.4.0 → 0.5.1
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 +14 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +956 -942
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { LiveKitSession as
|
|
5
|
-
import { createLocalAudioTrack as
|
|
6
|
-
class
|
|
2
|
+
import { jsxs as k, jsx as n, Fragment as Ht } from "react/jsx-runtime";
|
|
3
|
+
import { Component as nn, useState as C, useRef as M, useEffect as P, useCallback as x, useMemo as Ke, forwardRef as at, createElement as rn } from "react";
|
|
4
|
+
import { LiveKitSession as on } from "@livelayer/sdk";
|
|
5
|
+
import { createLocalAudioTrack as ln, Track as Ot, createLocalVideoTrack as an } from "livekit-client";
|
|
6
|
+
class cn extends nn {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
9
9
|
this.setState({ hasError: !1, error: null });
|
|
@@ -18,7 +18,7 @@ class on extends Zt {
|
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
var t;
|
|
21
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
21
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ k("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
22
22
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
23
23
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
24
24
|
/* @__PURE__ */ n(
|
|
@@ -33,12 +33,12 @@ class on extends Zt {
|
|
|
33
33
|
] }) : this.props.children;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [t, r] =
|
|
38
|
-
$.current = e.onDataMessage,
|
|
39
|
-
const
|
|
36
|
+
function sn(e) {
|
|
37
|
+
const [t, r] = C("idle"), [i, o] = C("idle"), [l, s] = C([]), [d, u] = C(null), [y, p] = C(null), [a, c] = C(null), [S, L] = C(!1), [N, H] = C(null), R = M(null), $ = M(e.onDataMessage);
|
|
38
|
+
$.current = e.onDataMessage, P(() => {
|
|
39
|
+
const v = {
|
|
40
40
|
onConnectionStateChange: (w) => {
|
|
41
|
-
r(w), w === "connected" &&
|
|
41
|
+
r(w), w === "connected" && H(null);
|
|
42
42
|
},
|
|
43
43
|
onAgentStateChange: o,
|
|
44
44
|
onTranscript: (w) => s([...w]),
|
|
@@ -46,13 +46,13 @@ function ln(e) {
|
|
|
46
46
|
onAudioTrack: (w) => c(w),
|
|
47
47
|
onVideoTrack: (w) => p(w),
|
|
48
48
|
onVideoTrackRemoved: () => p(null),
|
|
49
|
-
onError: (w) =>
|
|
49
|
+
onError: (w) => H(w),
|
|
50
50
|
onDataMessage: (w) => {
|
|
51
|
-
var
|
|
52
|
-
(
|
|
51
|
+
var O;
|
|
52
|
+
(O = $.current) == null || O.call($, w);
|
|
53
53
|
},
|
|
54
|
-
onResumabilityChange:
|
|
55
|
-
},
|
|
54
|
+
onResumabilityChange: L
|
|
55
|
+
}, E = new on(
|
|
56
56
|
{
|
|
57
57
|
agentId: e.agentId,
|
|
58
58
|
baseUrl: e.baseUrl,
|
|
@@ -60,11 +60,11 @@ function ln(e) {
|
|
|
60
60
|
sessionEndpoint: e.sessionEndpoint,
|
|
61
61
|
sessionBody: e.sessionBody
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
v
|
|
64
64
|
);
|
|
65
|
-
return
|
|
65
|
+
return R.current = E, r("idle"), o("idle"), s([]), u(null), p(null), c(null), L(!1), H(null), () => {
|
|
66
66
|
var w;
|
|
67
|
-
(w =
|
|
67
|
+
(w = E.destroy) == null || w.call(E), R.current = null;
|
|
68
68
|
};
|
|
69
69
|
}, [
|
|
70
70
|
e.agentId,
|
|
@@ -73,38 +73,38 @@ function ln(e) {
|
|
|
73
73
|
e.sessionEndpoint,
|
|
74
74
|
JSON.stringify(e.sessionBody ?? {})
|
|
75
75
|
]);
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
76
|
+
const I = x(async () => {
|
|
77
|
+
const v = R.current;
|
|
78
|
+
if (v)
|
|
79
79
|
try {
|
|
80
|
-
await
|
|
81
|
-
} catch (
|
|
82
|
-
throw
|
|
80
|
+
await v.connect();
|
|
81
|
+
} catch (E) {
|
|
82
|
+
throw H(E instanceof Error ? E.message : String(E)), E;
|
|
83
83
|
}
|
|
84
|
-
}, []), D =
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
}, []),
|
|
88
|
-
var
|
|
89
|
-
return ((
|
|
84
|
+
}, []), D = x(() => {
|
|
85
|
+
const v = R.current;
|
|
86
|
+
v && v.disconnect();
|
|
87
|
+
}, []), g = x(() => {
|
|
88
|
+
var v;
|
|
89
|
+
return ((v = R.current) == null ? void 0 : v.getRoom()) ?? null;
|
|
90
90
|
}, []);
|
|
91
91
|
return {
|
|
92
92
|
connectionState: t,
|
|
93
93
|
agentState: i,
|
|
94
94
|
transcript: l,
|
|
95
95
|
agentConfig: d,
|
|
96
|
-
videoElement:
|
|
96
|
+
videoElement: y,
|
|
97
97
|
audioElement: a,
|
|
98
|
-
canResume:
|
|
99
|
-
error:
|
|
100
|
-
connect:
|
|
98
|
+
canResume: S,
|
|
99
|
+
error: N,
|
|
100
|
+
connect: I,
|
|
101
101
|
disconnect: D,
|
|
102
|
-
getRoom:
|
|
103
|
-
session:
|
|
102
|
+
getRoom: g,
|
|
103
|
+
session: R.current
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
106
|
+
function dn() {
|
|
107
|
+
const e = M(null), t = M(null), r = M(null), i = M(null), o = M(/* @__PURE__ */ new Set()), l = M(null), s = x(() => {
|
|
108
108
|
const a = t.current;
|
|
109
109
|
if (!a) {
|
|
110
110
|
i.current = null;
|
|
@@ -115,21 +115,21 @@ function an() {
|
|
|
115
115
|
));
|
|
116
116
|
const c = l.current;
|
|
117
117
|
a.getByteFrequencyData(c);
|
|
118
|
-
let
|
|
119
|
-
for (let
|
|
120
|
-
const
|
|
121
|
-
for (const
|
|
118
|
+
let S = 0;
|
|
119
|
+
for (let N = 0; N < c.length; N++) S += c[N];
|
|
120
|
+
const L = S / c.length / 255;
|
|
121
|
+
for (const N of o.current)
|
|
122
122
|
try {
|
|
123
|
-
|
|
124
|
-
} catch (
|
|
125
|
-
console.error("[useAudioLevel] subscriber threw:",
|
|
123
|
+
N(L);
|
|
124
|
+
} catch (H) {
|
|
125
|
+
console.error("[useAudioLevel] subscriber threw:", H);
|
|
126
126
|
}
|
|
127
127
|
i.current = requestAnimationFrame(s);
|
|
128
|
-
}, []), d =
|
|
128
|
+
}, []), d = x(() => {
|
|
129
129
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
130
130
|
const a = new AudioContext(), c = a.createAnalyser();
|
|
131
131
|
c.fftSize = 64, c.connect(a.destination), e.current = a, t.current = c;
|
|
132
|
-
}, []), u =
|
|
132
|
+
}, []), u = x(
|
|
133
133
|
(a) => {
|
|
134
134
|
if (d(), !(!e.current || !t.current)) {
|
|
135
135
|
if (r.current) {
|
|
@@ -150,7 +150,7 @@ function an() {
|
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
[d, s]
|
|
153
|
-
),
|
|
153
|
+
), y = x(() => {
|
|
154
154
|
if (i.current !== null && (cancelAnimationFrame(i.current), i.current = null), r.current) {
|
|
155
155
|
try {
|
|
156
156
|
r.current.disconnect();
|
|
@@ -158,11 +158,11 @@ function an() {
|
|
|
158
158
|
}
|
|
159
159
|
r.current = null;
|
|
160
160
|
}
|
|
161
|
-
}, []), p =
|
|
161
|
+
}, []), p = x((a) => (o.current.add(a), () => {
|
|
162
162
|
o.current.delete(a);
|
|
163
163
|
}), []);
|
|
164
|
-
return
|
|
165
|
-
if (
|
|
164
|
+
return P(() => () => {
|
|
165
|
+
if (y(), t.current) {
|
|
166
166
|
try {
|
|
167
167
|
t.current.disconnect();
|
|
168
168
|
} catch {
|
|
@@ -177,10 +177,10 @@ function an() {
|
|
|
177
177
|
e.current = null;
|
|
178
178
|
}
|
|
179
179
|
o.current.clear(), l.current = null;
|
|
180
|
-
}, [
|
|
180
|
+
}, [y]), { attach: u, detach: y, subscribe: p };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const [e, t] =
|
|
182
|
+
function un() {
|
|
183
|
+
const [e, t] = C(!1), [r, i] = C(null), o = M(null), l = M(null), s = x(async (p) => {
|
|
184
184
|
if (o.current && l.current) {
|
|
185
185
|
try {
|
|
186
186
|
await l.current.localParticipant.unpublishTrack(o.current);
|
|
@@ -190,7 +190,7 @@ function cn() {
|
|
|
190
190
|
}
|
|
191
191
|
l.current = p, i(null);
|
|
192
192
|
try {
|
|
193
|
-
const a = await
|
|
193
|
+
const a = await ln({
|
|
194
194
|
echoCancellation: !0,
|
|
195
195
|
noiseSuppression: !0
|
|
196
196
|
});
|
|
@@ -199,10 +199,10 @@ function cn() {
|
|
|
199
199
|
const c = a instanceof Error && a.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
200
200
|
throw i(c), a;
|
|
201
201
|
}
|
|
202
|
-
}, []), d =
|
|
202
|
+
}, []), d = x(() => {
|
|
203
203
|
const p = o.current;
|
|
204
204
|
p && (p.isMuted ? (p.unmute(), t(!1)) : (p.mute(), t(!0)));
|
|
205
|
-
}, []), u =
|
|
205
|
+
}, []), u = x(() => {
|
|
206
206
|
const p = o.current, a = l.current;
|
|
207
207
|
if (p && a) {
|
|
208
208
|
try {
|
|
@@ -212,45 +212,45 @@ function cn() {
|
|
|
212
212
|
p.stop();
|
|
213
213
|
}
|
|
214
214
|
o.current = null, l.current = null, t(!1);
|
|
215
|
-
}, []),
|
|
215
|
+
}, []), y = x(() => i(null), []);
|
|
216
216
|
return {
|
|
217
217
|
isMuted: e,
|
|
218
218
|
micError: r,
|
|
219
219
|
toggleMute: d,
|
|
220
220
|
setupMic: s,
|
|
221
221
|
teardownMic: u,
|
|
222
|
-
clearError:
|
|
222
|
+
clearError: y
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
const [e, t] =
|
|
228
|
-
u.current =
|
|
229
|
-
}, []), a =
|
|
230
|
-
const
|
|
231
|
-
if ($ &&
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
225
|
+
const fn = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
226
|
+
function pn() {
|
|
227
|
+
const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), [s, d] = C(""), u = M(null), y = M(null), p = x((R) => {
|
|
228
|
+
u.current = R;
|
|
229
|
+
}, []), a = x(() => {
|
|
230
|
+
const R = u.current, $ = y.current;
|
|
231
|
+
if ($ && R) {
|
|
232
|
+
const I = R.localParticipant.getTrackPublication(Ot.Source.Camera);
|
|
233
|
+
if (I != null && I.track) {
|
|
234
234
|
try {
|
|
235
|
-
|
|
235
|
+
R.localParticipant.unpublishTrack(I.track);
|
|
236
236
|
} catch {
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
I.track.stop();
|
|
239
239
|
} else
|
|
240
240
|
$.stop();
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
}, []), c =
|
|
242
|
+
y.current = null, l(null), t(!1);
|
|
243
|
+
}, []), c = x(async (R) => {
|
|
244
244
|
const $ = u.current;
|
|
245
245
|
if ($) {
|
|
246
246
|
i(null);
|
|
247
247
|
try {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
const D = await
|
|
251
|
-
await $.localParticipant.publishTrack(D),
|
|
252
|
-
const
|
|
253
|
-
l(
|
|
248
|
+
const I = { ...fn };
|
|
249
|
+
R && (I.deviceId = R);
|
|
250
|
+
const D = await an(I);
|
|
251
|
+
await $.localParticipant.publishTrack(D), y.current = D;
|
|
252
|
+
const g = D.attach();
|
|
253
|
+
l(g), t(!0), R && d(R);
|
|
254
254
|
try {
|
|
255
255
|
$.localParticipant.publishData(
|
|
256
256
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
@@ -258,36 +258,36 @@ function dn() {
|
|
|
258
258
|
);
|
|
259
259
|
} catch {
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
const D =
|
|
261
|
+
} catch (I) {
|
|
262
|
+
const D = I instanceof Error && I.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
263
263
|
i(D);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
}, []),
|
|
266
|
+
}, []), S = x(async () => {
|
|
267
267
|
e ? a() : await c(s || void 0);
|
|
268
|
-
}, [e, s, a, c]),
|
|
269
|
-
a(), await c(
|
|
270
|
-
}, [a, c]),
|
|
268
|
+
}, [e, s, a, c]), L = x(async (R) => {
|
|
269
|
+
a(), await c(R);
|
|
270
|
+
}, [a, c]), N = x(() => {
|
|
271
271
|
a(), u.current = null, i(null), d("");
|
|
272
|
-
}, [a]),
|
|
273
|
-
return
|
|
274
|
-
|
|
272
|
+
}, [a]), H = x(() => i(null), []);
|
|
273
|
+
return P(() => () => {
|
|
274
|
+
y.current && y.current.stop();
|
|
275
275
|
}, []), {
|
|
276
276
|
isEnabled: e,
|
|
277
277
|
error: r,
|
|
278
278
|
previewEl: o,
|
|
279
279
|
activeDeviceId: s,
|
|
280
|
-
toggle:
|
|
281
|
-
switchDevice:
|
|
280
|
+
toggle: S,
|
|
281
|
+
switchDevice: L,
|
|
282
282
|
attachRoom: p,
|
|
283
|
-
teardown:
|
|
284
|
-
clearError:
|
|
283
|
+
teardown: N,
|
|
284
|
+
clearError: H
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const [e, t] =
|
|
287
|
+
function hn() {
|
|
288
|
+
const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), s = M(null), d = x((c) => {
|
|
289
289
|
s.current = c;
|
|
290
|
-
}, []), u =
|
|
290
|
+
}, []), u = x(() => l(null), []), y = x(async () => {
|
|
291
291
|
const c = s.current;
|
|
292
292
|
if (c) {
|
|
293
293
|
if (e) {
|
|
@@ -301,12 +301,12 @@ function un() {
|
|
|
301
301
|
i(null);
|
|
302
302
|
try {
|
|
303
303
|
await c.localParticipant.setScreenShareEnabled(!0);
|
|
304
|
-
let
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
l(
|
|
304
|
+
let S = 0;
|
|
305
|
+
const L = () => {
|
|
306
|
+
const N = c.localParticipant.getTrackPublication(Ot.Source.ScreenShare);
|
|
307
|
+
if (N != null && N.track) {
|
|
308
|
+
const H = N.track.attach();
|
|
309
|
+
l(H), t(!0);
|
|
310
310
|
try {
|
|
311
311
|
c.localParticipant.publishData(
|
|
312
312
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -316,15 +316,15 @@ function un() {
|
|
|
316
316
|
}
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
S++ < 10 ? setTimeout(L, 100) : t(!0);
|
|
320
320
|
};
|
|
321
|
-
|
|
322
|
-
} catch (
|
|
323
|
-
const
|
|
324
|
-
|
|
321
|
+
L();
|
|
322
|
+
} catch (S) {
|
|
323
|
+
const L = S instanceof Error ? S.name : "";
|
|
324
|
+
L !== "NotAllowedError" && L !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
}, [e, u]), p =
|
|
327
|
+
}, [e, u]), p = x(() => {
|
|
328
328
|
const c = s.current;
|
|
329
329
|
if (c && e)
|
|
330
330
|
try {
|
|
@@ -332,11 +332,11 @@ function un() {
|
|
|
332
332
|
} catch {
|
|
333
333
|
}
|
|
334
334
|
u(), t(!1), i(null), s.current = null;
|
|
335
|
-
}, [e, u]), a =
|
|
336
|
-
return { isEnabled: e, error: r, previewEl: o, toggle:
|
|
335
|
+
}, [e, u]), a = x(() => i(null), []);
|
|
336
|
+
return { isEnabled: e, error: r, previewEl: o, toggle: y, attachRoom: d, teardown: p, clearError: a };
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
const [e, t] =
|
|
338
|
+
function mn() {
|
|
339
|
+
const [e, t] = C([]), [r, i] = C([]), o = x(async () => {
|
|
340
340
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
341
341
|
try {
|
|
342
342
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -344,22 +344,22 @@ function fn() {
|
|
|
344
344
|
} catch {
|
|
345
345
|
}
|
|
346
346
|
}, []);
|
|
347
|
-
return
|
|
347
|
+
return P(() => {
|
|
348
348
|
if (o(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
349
349
|
const l = () => void o();
|
|
350
350
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
351
351
|
}, [o]), { mics: e, cameras: r, refresh: o };
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const [i, o] =
|
|
355
|
-
return
|
|
353
|
+
function gn(e, t, r = !1) {
|
|
354
|
+
const [i, o] = C(null), [l, s] = C(null), [d, u] = C(!r && !!e);
|
|
355
|
+
return P(() => {
|
|
356
356
|
if (r || !e) {
|
|
357
357
|
u(!1);
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const y = new AbortController(), p = t || "https://app.livelayer.studio";
|
|
361
361
|
return u(!0), s(null), fetch(`${p}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
362
|
-
signal:
|
|
362
|
+
signal: y.signal
|
|
363
363
|
}).then(async (a) => {
|
|
364
364
|
if (!a.ok) {
|
|
365
365
|
const c = await a.json().catch(() => ({}));
|
|
@@ -367,13 +367,13 @@ function pn(e, t, r = !1) {
|
|
|
367
367
|
}
|
|
368
368
|
return a.json();
|
|
369
369
|
}).then((a) => {
|
|
370
|
-
|
|
370
|
+
y.signal.aborted || (o(a), u(!1));
|
|
371
371
|
}).catch((a) => {
|
|
372
|
-
|
|
373
|
-
}), () =>
|
|
372
|
+
y.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), u(!1));
|
|
373
|
+
}), () => y.abort();
|
|
374
374
|
}, [e, t, r]), { info: i, error: l, loading: d };
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function yn(e) {
|
|
377
377
|
if (typeof window > "u") return null;
|
|
378
378
|
try {
|
|
379
379
|
return window.localStorage.getItem(e);
|
|
@@ -381,19 +381,19 @@ function hn(e) {
|
|
|
381
381
|
return null;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function vn(e, t) {
|
|
385
385
|
if (!(typeof window > "u"))
|
|
386
386
|
try {
|
|
387
387
|
window.localStorage.setItem(e, t);
|
|
388
388
|
} catch {
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function bn({
|
|
392
392
|
value: e,
|
|
393
393
|
defaultValue: t = "expanded",
|
|
394
394
|
onChange: r
|
|
395
395
|
} = {}) {
|
|
396
|
-
const i = e !== void 0, [o, l] =
|
|
396
|
+
const i = e !== void 0, [o, l] = C(t), s = i ? e : o, d = x(
|
|
397
397
|
(u) => {
|
|
398
398
|
u !== s && (i || l(u), r == null || r(u));
|
|
399
399
|
},
|
|
@@ -401,34 +401,34 @@ function gn({
|
|
|
401
401
|
);
|
|
402
402
|
return [s, d];
|
|
403
403
|
}
|
|
404
|
-
const
|
|
405
|
-
function
|
|
406
|
-
return e &&
|
|
404
|
+
const wn = ["hidden", "minimized", "expanded"];
|
|
405
|
+
function _n(e) {
|
|
406
|
+
return e && wn.includes(e) ? e : null;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function xn({
|
|
409
409
|
value: e,
|
|
410
410
|
defaultValue: t = "expanded",
|
|
411
411
|
onChange: r,
|
|
412
412
|
persistKey: i = "ll-widget",
|
|
413
413
|
disablePersistence: o = !1
|
|
414
414
|
} = {}) {
|
|
415
|
-
const l = `${i}:display-mode`, s =
|
|
415
|
+
const l = `${i}:display-mode`, s = M(!1), [d, u] = bn({
|
|
416
416
|
value: e,
|
|
417
417
|
defaultValue: t,
|
|
418
|
-
onChange: (
|
|
419
|
-
e === void 0 && !o &&
|
|
418
|
+
onChange: (y) => {
|
|
419
|
+
e === void 0 && !o && vn(l, y), r == null || r(y);
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
|
-
return
|
|
422
|
+
return P(() => {
|
|
423
423
|
if (s.current || (s.current = !0, o || e !== void 0)) return;
|
|
424
|
-
const
|
|
425
|
-
|
|
424
|
+
const y = _n(yn(l));
|
|
425
|
+
y && y !== d && u(y);
|
|
426
426
|
}, []), [d, u];
|
|
427
427
|
}
|
|
428
|
-
const
|
|
429
|
-
function
|
|
430
|
-
const [t, r] =
|
|
431
|
-
return
|
|
428
|
+
const kn = 640;
|
|
429
|
+
function Ln(e = kn) {
|
|
430
|
+
const [t, r] = C(!1);
|
|
431
|
+
return P(() => {
|
|
432
432
|
if (e === !1) {
|
|
433
433
|
r(!1);
|
|
434
434
|
return;
|
|
@@ -441,67 +441,67 @@ function _n(e = wn) {
|
|
|
441
441
|
});
|
|
442
442
|
}, [e]), t;
|
|
443
443
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
if (typeof window > "u" || window.history[
|
|
444
|
+
const Lt = "__llHistoryPatched", Xe = "ll:pathname";
|
|
445
|
+
function En() {
|
|
446
|
+
if (typeof window > "u" || window.history[Lt]) return;
|
|
447
447
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
448
448
|
window.history.pushState = function(...r) {
|
|
449
449
|
const i = e.apply(this, r);
|
|
450
|
-
return window.dispatchEvent(new Event(
|
|
450
|
+
return window.dispatchEvent(new Event(Xe)), i;
|
|
451
451
|
}, window.history.replaceState = function(...r) {
|
|
452
452
|
const i = t.apply(this, r);
|
|
453
|
-
return window.dispatchEvent(new Event(
|
|
454
|
-
}, window.history[
|
|
453
|
+
return window.dispatchEvent(new Event(Xe)), i;
|
|
454
|
+
}, window.history[Lt] = !0;
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function Et() {
|
|
457
457
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
const [t, r] =
|
|
461
|
-
() => e ??
|
|
459
|
+
function Cn(e) {
|
|
460
|
+
const [t, r] = C(
|
|
461
|
+
() => e ?? Et()
|
|
462
462
|
);
|
|
463
|
-
return
|
|
463
|
+
return P(() => {
|
|
464
464
|
if (e !== void 0) return;
|
|
465
|
-
|
|
466
|
-
const i = () => r(
|
|
467
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
468
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
465
|
+
En();
|
|
466
|
+
const i = () => r(Et());
|
|
467
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(Xe, i), () => {
|
|
468
|
+
window.removeEventListener("popstate", i), window.removeEventListener(Xe, i);
|
|
469
469
|
};
|
|
470
470
|
}, [e]), e ?? t;
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
function
|
|
474
|
-
return e.replace(
|
|
472
|
+
const Ct = /* @__PURE__ */ new Map(), Sn = /[\\^$+?.()|{}[\]]/g;
|
|
473
|
+
function Nn(e) {
|
|
474
|
+
return e.replace(Sn, "\\$&");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
const t =
|
|
476
|
+
function An(e) {
|
|
477
|
+
const t = Ct.get(e);
|
|
478
478
|
if (t) return t;
|
|
479
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), d =
|
|
480
|
-
return
|
|
479
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), d = Nn(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), u = new RegExp(`^${d}\\/?$`);
|
|
480
|
+
return Ct.set(e, u), u;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function In(e, t) {
|
|
483
483
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
484
|
-
return
|
|
484
|
+
return An(e).test(r);
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
486
|
+
function Mn(e, t) {
|
|
487
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : In(e, t);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function St(e, t) {
|
|
490
490
|
if (!e || e.length === 0) return !1;
|
|
491
491
|
for (const r of e)
|
|
492
|
-
if (
|
|
492
|
+
if (Mn(r, t)) return !0;
|
|
493
493
|
return !1;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
return e === void 0 ? !0 :
|
|
495
|
+
function Rn(e, t, r) {
|
|
496
|
+
return e === void 0 ? !0 : St(r, e) ? !1 : t && t.length > 0 ? St(t, e) : !0;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
return
|
|
500
|
-
() =>
|
|
498
|
+
function Tn(e, t, r) {
|
|
499
|
+
return Ke(
|
|
500
|
+
() => Rn(e, t, r),
|
|
501
501
|
[e, t, r]
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
|
-
const
|
|
504
|
+
const Nt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
505
505
|
"svg",
|
|
506
506
|
{
|
|
507
507
|
className: t,
|
|
@@ -547,7 +547,7 @@ const Ct = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ L(
|
|
|
547
547
|
}
|
|
548
548
|
)
|
|
549
549
|
}
|
|
550
|
-
),
|
|
550
|
+
), At = ({ className: e }) => /* @__PURE__ */ n(
|
|
551
551
|
"svg",
|
|
552
552
|
{
|
|
553
553
|
className: e,
|
|
@@ -565,7 +565,7 @@ const Ct = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ L(
|
|
|
565
565
|
}
|
|
566
566
|
)
|
|
567
567
|
}
|
|
568
|
-
),
|
|
568
|
+
), Pn = ({ className: e }) => /* @__PURE__ */ n(
|
|
569
569
|
"svg",
|
|
570
570
|
{
|
|
571
571
|
className: e,
|
|
@@ -576,12 +576,12 @@ const Ct = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ L(
|
|
|
576
576
|
"aria-hidden": "true",
|
|
577
577
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
578
578
|
}
|
|
579
|
-
),
|
|
579
|
+
), Dn = {
|
|
580
580
|
left: 180,
|
|
581
581
|
right: 0,
|
|
582
582
|
up: -90,
|
|
583
583
|
down: 90
|
|
584
|
-
},
|
|
584
|
+
}, $n = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
585
585
|
"svg",
|
|
586
586
|
{
|
|
587
587
|
className: t,
|
|
@@ -589,19 +589,19 @@ const Ct = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ L(
|
|
|
589
589
|
viewBox: "0 0 24 24",
|
|
590
590
|
stroke: "currentColor",
|
|
591
591
|
strokeWidth: 2,
|
|
592
|
-
style: { transform: `rotate(${
|
|
592
|
+
style: { transform: `rotate(${Dn[e]}deg)` },
|
|
593
593
|
"aria-hidden": "true",
|
|
594
594
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
595
595
|
}
|
|
596
596
|
);
|
|
597
|
-
function
|
|
597
|
+
function zn(e) {
|
|
598
598
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
function
|
|
600
|
+
const qt = "ll-hidden-tab-center-y", Hn = 5, It = 16;
|
|
601
|
+
function On() {
|
|
602
602
|
if (typeof window > "u") return null;
|
|
603
603
|
try {
|
|
604
|
-
const e = window.localStorage.getItem(
|
|
604
|
+
const e = window.localStorage.getItem(qt);
|
|
605
605
|
if (!e) return null;
|
|
606
606
|
const t = Number.parseFloat(e);
|
|
607
607
|
return Number.isFinite(t) ? t : null;
|
|
@@ -609,115 +609,115 @@ function $n() {
|
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function Mt(e) {
|
|
613
613
|
if (!(typeof window > "u"))
|
|
614
614
|
try {
|
|
615
|
-
window.localStorage.setItem(
|
|
615
|
+
window.localStorage.setItem(qt, String(e));
|
|
616
616
|
} catch {
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
const
|
|
619
|
+
const qn = ({
|
|
620
620
|
position: e,
|
|
621
621
|
isMobile: t,
|
|
622
622
|
isSpeaking: r,
|
|
623
623
|
onExpand: i,
|
|
624
624
|
label: o = "Open widget"
|
|
625
625
|
}) => {
|
|
626
|
-
const l =
|
|
627
|
-
(
|
|
628
|
-
if (typeof window > "u") return
|
|
629
|
-
const
|
|
630
|
-
return
|
|
626
|
+
const l = zn(e), s = l === "right" ? "left" : "right", d = t ? 80 : 72, [u, y] = C(null), [p, a] = C(!1), c = M(null), S = M(!1), L = x(
|
|
627
|
+
(v) => {
|
|
628
|
+
if (typeof window > "u") return v;
|
|
629
|
+
const E = d / 2, w = It + E, O = window.innerHeight - It - E;
|
|
630
|
+
return O < w ? Math.max(w, v) : Math.max(w, Math.min(O, v));
|
|
631
631
|
},
|
|
632
632
|
[d]
|
|
633
633
|
);
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
|
|
634
|
+
P(() => {
|
|
635
|
+
const v = On();
|
|
636
|
+
y(L(v ?? window.innerHeight / 2));
|
|
637
|
+
const E = () => {
|
|
638
|
+
y((w) => w === null ? null : L(w));
|
|
639
639
|
};
|
|
640
|
-
return window.addEventListener("resize",
|
|
641
|
-
}, [
|
|
642
|
-
const
|
|
643
|
-
(
|
|
644
|
-
if (!(
|
|
640
|
+
return window.addEventListener("resize", E), () => window.removeEventListener("resize", E);
|
|
641
|
+
}, [L]);
|
|
642
|
+
const N = x(
|
|
643
|
+
(v) => {
|
|
644
|
+
if (!(v.pointerType === "mouse" && v.button !== 0) && u !== null) {
|
|
645
645
|
try {
|
|
646
|
-
|
|
646
|
+
v.currentTarget.setPointerCapture(v.pointerId);
|
|
647
647
|
} catch {
|
|
648
648
|
}
|
|
649
649
|
c.current = {
|
|
650
|
-
startClientY:
|
|
650
|
+
startClientY: v.clientY,
|
|
651
651
|
startCenterY: u,
|
|
652
652
|
moved: !1
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
},
|
|
656
656
|
[u]
|
|
657
|
-
),
|
|
658
|
-
(
|
|
659
|
-
const
|
|
660
|
-
if (!
|
|
661
|
-
const w =
|
|
662
|
-
!
|
|
657
|
+
), H = x(
|
|
658
|
+
(v) => {
|
|
659
|
+
const E = c.current;
|
|
660
|
+
if (!E) return;
|
|
661
|
+
const w = v.clientY - E.startClientY;
|
|
662
|
+
!E.moved && Math.abs(w) > Hn && (E.moved = !0, a(!0)), E.moved && y(L(E.startCenterY + w));
|
|
663
663
|
},
|
|
664
|
-
[
|
|
665
|
-
),
|
|
666
|
-
(
|
|
667
|
-
const
|
|
668
|
-
if (
|
|
664
|
+
[L]
|
|
665
|
+
), R = x(
|
|
666
|
+
(v) => {
|
|
667
|
+
const E = c.current;
|
|
668
|
+
if (E) {
|
|
669
669
|
try {
|
|
670
|
-
|
|
670
|
+
v.currentTarget.releasePointerCapture(v.pointerId);
|
|
671
671
|
} catch {
|
|
672
672
|
}
|
|
673
|
-
c.current = null,
|
|
673
|
+
c.current = null, E.moved && (a(!1), S.current = !0, y((w) => (w !== null && Mt(w), w)));
|
|
674
674
|
}
|
|
675
675
|
},
|
|
676
676
|
[]
|
|
677
|
-
), $ =
|
|
678
|
-
if (
|
|
679
|
-
|
|
677
|
+
), $ = x(() => {
|
|
678
|
+
if (S.current) {
|
|
679
|
+
S.current = !1;
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
i();
|
|
683
|
-
}, [i]),
|
|
684
|
-
(
|
|
685
|
-
if (
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
|
|
683
|
+
}, [i]), I = x(
|
|
684
|
+
(v) => {
|
|
685
|
+
if (v.key === "ArrowUp" || v.key === "ArrowDown") {
|
|
686
|
+
v.preventDefault();
|
|
687
|
+
const E = v.key === "ArrowUp" ? -8 : 8;
|
|
688
|
+
y((w) => {
|
|
689
689
|
if (w === null) return w;
|
|
690
|
-
const
|
|
691
|
-
return
|
|
690
|
+
const O = L(w + E);
|
|
691
|
+
return Mt(O), O;
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
},
|
|
695
|
-
[
|
|
695
|
+
[L]
|
|
696
696
|
), D = [
|
|
697
697
|
"ll-hidden",
|
|
698
698
|
`ll-hidden--${l}`,
|
|
699
699
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
700
700
|
r ? "ll-hidden--speaking" : null,
|
|
701
701
|
p ? "is-dragging" : null
|
|
702
|
-
].filter(Boolean).join(" "),
|
|
702
|
+
].filter(Boolean).join(" "), g = u === null ? void 0 : { top: `${u - d / 2}px`, transform: "none" };
|
|
703
703
|
return /* @__PURE__ */ n(
|
|
704
704
|
"button",
|
|
705
705
|
{
|
|
706
706
|
type: "button",
|
|
707
707
|
className: D,
|
|
708
|
-
onPointerDown:
|
|
709
|
-
onPointerMove:
|
|
710
|
-
onPointerUp:
|
|
711
|
-
onPointerCancel:
|
|
708
|
+
onPointerDown: N,
|
|
709
|
+
onPointerMove: H,
|
|
710
|
+
onPointerUp: R,
|
|
711
|
+
onPointerCancel: R,
|
|
712
712
|
onClick: $,
|
|
713
|
-
onKeyDown:
|
|
713
|
+
onKeyDown: I,
|
|
714
714
|
"aria-label": o,
|
|
715
715
|
"data-position": e,
|
|
716
|
-
style:
|
|
717
|
-
children: /* @__PURE__ */ n(
|
|
716
|
+
style: g,
|
|
717
|
+
children: /* @__PURE__ */ n($n, { direction: s, className: "ll-hidden__chevron" })
|
|
718
718
|
}
|
|
719
719
|
);
|
|
720
|
-
},
|
|
720
|
+
}, Bn = ({
|
|
721
721
|
audioLevel: e,
|
|
722
722
|
bars: t = 20,
|
|
723
723
|
maxHeight: r = 20,
|
|
@@ -725,20 +725,20 @@ const zn = ({
|
|
|
725
725
|
className: o,
|
|
726
726
|
barClassName: l
|
|
727
727
|
}) => {
|
|
728
|
-
const s =
|
|
728
|
+
const s = M(null), d = M([]), u = Ke(() => {
|
|
729
729
|
const p = (Math.sqrt(5) - 1) / 2;
|
|
730
730
|
return Array.from({ length: t }, (a, c) => 0.5 + c * p % 1 * 0.5);
|
|
731
731
|
}, [t]);
|
|
732
|
-
|
|
732
|
+
P(() => e.subscribe((a) => {
|
|
733
733
|
for (let c = 0; c < t; c++) {
|
|
734
|
-
const
|
|
735
|
-
if (!
|
|
736
|
-
const
|
|
737
|
-
|
|
734
|
+
const S = d.current[c];
|
|
735
|
+
if (!S) continue;
|
|
736
|
+
const L = Math.max(i, a * r * u[c]);
|
|
737
|
+
S.style.height = `${L}px`;
|
|
738
738
|
}
|
|
739
739
|
}), [e, t, r, i, u]);
|
|
740
|
-
const
|
|
741
|
-
return /* @__PURE__ */ n("div", { ref: s, className:
|
|
740
|
+
const y = ["ll-waveform", o].filter(Boolean).join(" ");
|
|
741
|
+
return /* @__PURE__ */ n("div", { ref: s, className: y, "aria-hidden": "true", children: Array.from({ length: t }, (p, a) => /* @__PURE__ */ n(
|
|
742
742
|
"div",
|
|
743
743
|
{
|
|
744
744
|
ref: (c) => {
|
|
@@ -749,7 +749,7 @@ const zn = ({
|
|
|
749
749
|
},
|
|
750
750
|
a
|
|
751
751
|
)) });
|
|
752
|
-
},
|
|
752
|
+
}, Un = ({
|
|
753
753
|
position: e,
|
|
754
754
|
isMobile: t,
|
|
755
755
|
agentName: r,
|
|
@@ -759,14 +759,14 @@ const zn = ({
|
|
|
759
759
|
audioLevel: s,
|
|
760
760
|
onExpand: d,
|
|
761
761
|
onToggleMute: u,
|
|
762
|
-
onClose:
|
|
762
|
+
onClose: y
|
|
763
763
|
}) => t ? /* @__PURE__ */ n(
|
|
764
764
|
"div",
|
|
765
765
|
{
|
|
766
766
|
className: "ll-minimized ll-minimized--mobile",
|
|
767
767
|
role: "region",
|
|
768
768
|
"aria-label": `${r} widget`,
|
|
769
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ k(
|
|
770
770
|
"button",
|
|
771
771
|
{
|
|
772
772
|
type: "button",
|
|
@@ -786,7 +786,7 @@ const zn = ({
|
|
|
786
786
|
)
|
|
787
787
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
788
788
|
/* @__PURE__ */ n(
|
|
789
|
-
|
|
789
|
+
Bn,
|
|
790
790
|
{
|
|
791
791
|
audioLevel: s,
|
|
792
792
|
bars: 16,
|
|
@@ -795,7 +795,7 @@ const zn = ({
|
|
|
795
795
|
}
|
|
796
796
|
),
|
|
797
797
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
798
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
|
|
799
799
|
/* @__PURE__ */ n(
|
|
800
800
|
"span",
|
|
801
801
|
{
|
|
@@ -809,10 +809,10 @@ const zn = ({
|
|
|
809
809
|
(p.key === "Enter" || p.key === " ") && (p.stopPropagation(), p.preventDefault(), u());
|
|
810
810
|
},
|
|
811
811
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
812
|
-
children: /* @__PURE__ */ n(
|
|
812
|
+
children: /* @__PURE__ */ n(Nt, { muted: l, className: "ll-minimized__icon" })
|
|
813
813
|
}
|
|
814
814
|
),
|
|
815
|
-
/* @__PURE__ */ n(
|
|
815
|
+
/* @__PURE__ */ n(At, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
816
816
|
] })
|
|
817
817
|
]
|
|
818
818
|
}
|
|
@@ -825,7 +825,7 @@ const zn = ({
|
|
|
825
825
|
"data-position": e,
|
|
826
826
|
role: "region",
|
|
827
827
|
"aria-label": `${r} widget`,
|
|
828
|
-
children: /* @__PURE__ */
|
|
828
|
+
children: /* @__PURE__ */ k("div", { className: "ll-minimized__surface", children: [
|
|
829
829
|
i ? (
|
|
830
830
|
// eslint-disable-next-line @next/next/no-img-element
|
|
831
831
|
/* @__PURE__ */ n(
|
|
@@ -837,11 +837,11 @@ const zn = ({
|
|
|
837
837
|
}
|
|
838
838
|
)
|
|
839
839
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
840
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ k("div", { className: "ll-minimized__meta", children: [
|
|
841
841
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
842
842
|
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: o === "speaking" ? "Speaking" : o === "thinking" ? "Thinking" : "Listening" })
|
|
843
843
|
] }),
|
|
844
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
|
|
845
845
|
/* @__PURE__ */ n(
|
|
846
846
|
"button",
|
|
847
847
|
{
|
|
@@ -849,7 +849,7 @@ const zn = ({
|
|
|
849
849
|
className: "ll-minimized__btn",
|
|
850
850
|
onClick: u,
|
|
851
851
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
852
|
-
children: /* @__PURE__ */ n(
|
|
852
|
+
children: /* @__PURE__ */ n(Nt, { muted: l, className: "ll-minimized__icon" })
|
|
853
853
|
}
|
|
854
854
|
),
|
|
855
855
|
/* @__PURE__ */ n(
|
|
@@ -859,7 +859,7 @@ const zn = ({
|
|
|
859
859
|
className: "ll-minimized__btn",
|
|
860
860
|
onClick: d,
|
|
861
861
|
"aria-label": `Expand ${r} widget`,
|
|
862
|
-
children: /* @__PURE__ */ n(
|
|
862
|
+
children: /* @__PURE__ */ n(At, { className: "ll-minimized__icon" })
|
|
863
863
|
}
|
|
864
864
|
),
|
|
865
865
|
/* @__PURE__ */ n(
|
|
@@ -867,23 +867,23 @@ const zn = ({
|
|
|
867
867
|
{
|
|
868
868
|
type: "button",
|
|
869
869
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
870
|
-
onClick:
|
|
870
|
+
onClick: y,
|
|
871
871
|
"aria-label": "Close widget",
|
|
872
|
-
children: /* @__PURE__ */ n(
|
|
872
|
+
children: /* @__PURE__ */ n(Pn, { className: "ll-minimized__icon" })
|
|
873
873
|
}
|
|
874
874
|
)
|
|
875
875
|
] })
|
|
876
876
|
] })
|
|
877
877
|
}
|
|
878
|
-
),
|
|
878
|
+
), Fn = ({
|
|
879
879
|
src: e,
|
|
880
880
|
alt: t,
|
|
881
881
|
preCannedPlaying: r = !1,
|
|
882
882
|
className: i,
|
|
883
883
|
style: o
|
|
884
884
|
}) => {
|
|
885
|
-
const [l, s] =
|
|
886
|
-
if (
|
|
885
|
+
const [l, s] = C(!1), d = M(e);
|
|
886
|
+
if (P(() => {
|
|
887
887
|
d.current !== e && (d.current = e, s(!1));
|
|
888
888
|
}, [e]), !e) return null;
|
|
889
889
|
const u = {
|
|
@@ -913,7 +913,7 @@ const zn = ({
|
|
|
913
913
|
}
|
|
914
914
|
)
|
|
915
915
|
);
|
|
916
|
-
},
|
|
916
|
+
}, Wn = ({
|
|
917
917
|
position: e,
|
|
918
918
|
isMobile: t,
|
|
919
919
|
agentName: r,
|
|
@@ -923,100 +923,100 @@ const zn = ({
|
|
|
923
923
|
branding: s,
|
|
924
924
|
teamMembers: d,
|
|
925
925
|
currentTeamMemberId: u,
|
|
926
|
-
isSwitchingTeamMember:
|
|
926
|
+
isSwitchingTeamMember: y,
|
|
927
927
|
teamSwitcherOpen: p,
|
|
928
928
|
onToggleTeamSwitcher: a,
|
|
929
929
|
onSelectTeamMember: c,
|
|
930
|
-
languageMenuOpen:
|
|
931
|
-
onToggleLanguageMenu:
|
|
932
|
-
connectionState:
|
|
933
|
-
agentState:
|
|
934
|
-
transcript:
|
|
930
|
+
languageMenuOpen: S,
|
|
931
|
+
onToggleLanguageMenu: L,
|
|
932
|
+
connectionState: N,
|
|
933
|
+
agentState: H,
|
|
934
|
+
transcript: R,
|
|
935
935
|
canResume: $,
|
|
936
|
-
needsUserGesture:
|
|
936
|
+
needsUserGesture: I,
|
|
937
937
|
error: D,
|
|
938
|
-
isMuted:
|
|
939
|
-
micError:
|
|
940
|
-
micDevices:
|
|
938
|
+
isMuted: g,
|
|
939
|
+
micError: v,
|
|
940
|
+
micDevices: E,
|
|
941
941
|
isCameraEnabled: w,
|
|
942
|
-
cameraPreviewEl:
|
|
943
|
-
cameraDevices:
|
|
944
|
-
activeCameraId:
|
|
945
|
-
isScreenShareEnabled:
|
|
946
|
-
screenPreviewEl:
|
|
947
|
-
isSpeakerMuted:
|
|
948
|
-
allowCamera:
|
|
949
|
-
allowScreenShare:
|
|
950
|
-
allowTyping:
|
|
951
|
-
avatarVideoContainerRef:
|
|
952
|
-
onConnect:
|
|
953
|
-
onDisconnect:
|
|
954
|
-
onRetry:
|
|
955
|
-
onResumeAudio:
|
|
956
|
-
onToggleMute:
|
|
957
|
-
onToggleCamera:
|
|
958
|
-
onSwitchCameraDevice:
|
|
959
|
-
onToggleScreenShare:
|
|
960
|
-
onToggleSpeaker:
|
|
961
|
-
onSendMessage:
|
|
962
|
-
onMinimize:
|
|
963
|
-
onClose:
|
|
964
|
-
onClearMicError:
|
|
942
|
+
cameraPreviewEl: O,
|
|
943
|
+
cameraDevices: J,
|
|
944
|
+
activeCameraId: de,
|
|
945
|
+
isScreenShareEnabled: Q,
|
|
946
|
+
screenPreviewEl: Z,
|
|
947
|
+
isSpeakerMuted: ue,
|
|
948
|
+
allowCamera: qe,
|
|
949
|
+
allowScreenShare: Be,
|
|
950
|
+
allowTyping: Ue,
|
|
951
|
+
avatarVideoContainerRef: Ne,
|
|
952
|
+
onConnect: fe,
|
|
953
|
+
onDisconnect: ge,
|
|
954
|
+
onRetry: ye,
|
|
955
|
+
onResumeAudio: ve,
|
|
956
|
+
onToggleMute: be,
|
|
957
|
+
onToggleCamera: we,
|
|
958
|
+
onSwitchCameraDevice: _e,
|
|
959
|
+
onToggleScreenShare: q,
|
|
960
|
+
onToggleSpeaker: Qe,
|
|
961
|
+
onSendMessage: Fe,
|
|
962
|
+
onMinimize: We,
|
|
963
|
+
onClose: Ae,
|
|
964
|
+
onClearMicError: Ie
|
|
965
965
|
}) => {
|
|
966
|
-
var
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
const h =
|
|
970
|
-
h && (h.innerHTML = "",
|
|
971
|
-
}, [
|
|
972
|
-
const h =
|
|
973
|
-
h && (h.innerHTML = "",
|
|
974
|
-
}, [
|
|
975
|
-
const [
|
|
976
|
-
|
|
977
|
-
if (!
|
|
966
|
+
var Pe;
|
|
967
|
+
const ie = R.length > 0 ? R[R.length - 1] : null, pe = ((d == null ? void 0 : d.length) ?? 0) > 1, xe = N === "connecting" || N === "connected", ee = N === "connected", V = N === "idle" || N === "disconnected" || N === "error", Me = M(null), oe = M(null);
|
|
968
|
+
P(() => {
|
|
969
|
+
const h = Me.current;
|
|
970
|
+
h && (h.innerHTML = "", O && (O.style.width = "100%", O.style.height = "100%", O.style.objectFit = "cover", O.style.transform = "scaleX(-1)", h.appendChild(O)));
|
|
971
|
+
}, [O]), P(() => {
|
|
972
|
+
const h = oe.current;
|
|
973
|
+
h && (h.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", h.appendChild(Z)));
|
|
974
|
+
}, [Z]);
|
|
975
|
+
const [K, ne] = C(!1), [le, Y] = C(!1);
|
|
976
|
+
P(() => {
|
|
977
|
+
if (!K && !le && !S && !p) return;
|
|
978
978
|
const h = () => {
|
|
979
|
-
ne(!1),
|
|
979
|
+
ne(!1), Y(!1), S && L(), p && a();
|
|
980
980
|
};
|
|
981
981
|
return document.addEventListener("click", h), () => document.removeEventListener("click", h);
|
|
982
982
|
}, [
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
983
|
+
K,
|
|
984
|
+
le,
|
|
985
|
+
S,
|
|
986
986
|
p,
|
|
987
|
-
|
|
987
|
+
L,
|
|
988
988
|
a
|
|
989
989
|
]);
|
|
990
|
-
const [
|
|
990
|
+
const [X, ae] = C(""), Re = x(
|
|
991
991
|
(h) => {
|
|
992
992
|
h.preventDefault();
|
|
993
|
-
const
|
|
994
|
-
|
|
993
|
+
const W = X.trim();
|
|
994
|
+
W && (Fe(W), ae(""));
|
|
995
995
|
},
|
|
996
|
-
[
|
|
997
|
-
),
|
|
996
|
+
[X, Fe]
|
|
997
|
+
), Ze = s.productName || "Live Layer", ke = ee && (ie != null && ie.text) ? ie.text : l || "", Te = [
|
|
998
998
|
"ll-expanded",
|
|
999
999
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1000
1000
|
].join(" ");
|
|
1001
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ k(
|
|
1002
1002
|
"div",
|
|
1003
1003
|
{
|
|
1004
|
-
className:
|
|
1004
|
+
className: Te,
|
|
1005
1005
|
"data-position": e,
|
|
1006
|
-
"data-state":
|
|
1006
|
+
"data-state": ee ? "connected" : xe ? "connecting" : "idle",
|
|
1007
1007
|
role: "dialog",
|
|
1008
1008
|
"aria-label": `${r} widget`,
|
|
1009
1009
|
children: [
|
|
1010
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__bg", children: [
|
|
1011
1011
|
i ? /* @__PURE__ */ n(
|
|
1012
|
-
|
|
1012
|
+
Fn,
|
|
1013
1013
|
{
|
|
1014
1014
|
src: i,
|
|
1015
1015
|
alt: r,
|
|
1016
1016
|
className: "ll-expanded__bg-img"
|
|
1017
1017
|
}
|
|
1018
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1019
|
-
o && !
|
|
1018
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Pe = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Pe.toUpperCase()) || "A" }) }),
|
|
1019
|
+
o && !ee && /* @__PURE__ */ n(
|
|
1020
1020
|
"video",
|
|
1021
1021
|
{
|
|
1022
1022
|
className: "ll-expanded__bg-idle",
|
|
@@ -1028,49 +1028,49 @@ const zn = ({
|
|
|
1028
1028
|
}
|
|
1029
1029
|
)
|
|
1030
1030
|
] }),
|
|
1031
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1032
|
-
|
|
1031
|
+
/* @__PURE__ */ n("div", { ref: Ne, className: "ll-expanded__video" }),
|
|
1032
|
+
N === "connecting" && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1033
1033
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1034
|
-
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children:
|
|
1034
|
+
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: y ? "Switching..." : "Connecting..." })
|
|
1035
1035
|
] }),
|
|
1036
|
-
|
|
1036
|
+
I && ee && /* @__PURE__ */ k(
|
|
1037
1037
|
"button",
|
|
1038
1038
|
{
|
|
1039
1039
|
type: "button",
|
|
1040
1040
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1041
|
-
onClick:
|
|
1041
|
+
onClick: ve,
|
|
1042
1042
|
children: [
|
|
1043
1043
|
/* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1044
1044
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1045
1045
|
]
|
|
1046
1046
|
}
|
|
1047
1047
|
),
|
|
1048
|
-
|
|
1049
|
-
/* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1048
|
+
xe ? /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", children: [
|
|
1049
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__topbar-left", children: [
|
|
1050
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1051
|
+
/* @__PURE__ */ k(
|
|
1052
1052
|
"button",
|
|
1053
1053
|
{
|
|
1054
1054
|
type: "button",
|
|
1055
1055
|
className: "ll-hpill",
|
|
1056
1056
|
onClick: (h) => {
|
|
1057
|
-
|
|
1057
|
+
pe && (h.stopPropagation(), a());
|
|
1058
1058
|
},
|
|
1059
|
-
"aria-haspopup":
|
|
1060
|
-
"aria-expanded":
|
|
1059
|
+
"aria-haspopup": pe ? "listbox" : void 0,
|
|
1060
|
+
"aria-expanded": pe ? p : void 0,
|
|
1061
1061
|
children: [
|
|
1062
1062
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1063
|
-
|
|
1063
|
+
pe && /* @__PURE__ */ n(Ye, {})
|
|
1064
1064
|
]
|
|
1065
1065
|
}
|
|
1066
1066
|
),
|
|
1067
|
-
|
|
1067
|
+
pe && p && /* @__PURE__ */ n(
|
|
1068
1068
|
"div",
|
|
1069
1069
|
{
|
|
1070
1070
|
className: "ll-hmenu",
|
|
1071
1071
|
onClick: (h) => h.stopPropagation(),
|
|
1072
1072
|
role: "listbox",
|
|
1073
|
-
children: d == null ? void 0 : d.map((h) => /* @__PURE__ */
|
|
1073
|
+
children: d == null ? void 0 : d.map((h) => /* @__PURE__ */ k(
|
|
1074
1074
|
"button",
|
|
1075
1075
|
{
|
|
1076
1076
|
type: "button",
|
|
@@ -1096,26 +1096,26 @@ const zn = ({
|
|
|
1096
1096
|
}
|
|
1097
1097
|
)
|
|
1098
1098
|
] }),
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1100
|
+
/* @__PURE__ */ k(
|
|
1101
1101
|
"button",
|
|
1102
1102
|
{
|
|
1103
1103
|
type: "button",
|
|
1104
1104
|
className: "ll-hpill ll-hpill--compact",
|
|
1105
1105
|
onClick: (h) => {
|
|
1106
|
-
h.stopPropagation(),
|
|
1106
|
+
h.stopPropagation(), L();
|
|
1107
1107
|
},
|
|
1108
1108
|
"aria-haspopup": "listbox",
|
|
1109
|
-
"aria-expanded":
|
|
1109
|
+
"aria-expanded": S,
|
|
1110
1110
|
"aria-label": "Language: English",
|
|
1111
1111
|
title: "Language: English",
|
|
1112
1112
|
children: [
|
|
1113
1113
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1114
|
-
/* @__PURE__ */ n(
|
|
1114
|
+
/* @__PURE__ */ n(Ye, {})
|
|
1115
1115
|
]
|
|
1116
1116
|
}
|
|
1117
1117
|
),
|
|
1118
|
-
|
|
1118
|
+
S && /* @__PURE__ */ n(
|
|
1119
1119
|
"div",
|
|
1120
1120
|
{
|
|
1121
1121
|
className: "ll-hmenu",
|
|
@@ -1137,21 +1137,21 @@ const zn = ({
|
|
|
1137
1137
|
/* @__PURE__ */ n(
|
|
1138
1138
|
"span",
|
|
1139
1139
|
{
|
|
1140
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1141
|
-
children:
|
|
1140
|
+
className: `ll-expanded__state ll-expanded__state--${H}`,
|
|
1141
|
+
children: H
|
|
1142
1142
|
}
|
|
1143
1143
|
)
|
|
1144
1144
|
] }),
|
|
1145
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
|
|
1146
1146
|
/* @__PURE__ */ n(
|
|
1147
1147
|
"button",
|
|
1148
1148
|
{
|
|
1149
1149
|
type: "button",
|
|
1150
1150
|
className: "ll-hbtn",
|
|
1151
|
-
onClick:
|
|
1151
|
+
onClick: We,
|
|
1152
1152
|
"aria-label": "Minimize widget",
|
|
1153
1153
|
title: "Minimize",
|
|
1154
|
-
children: /* @__PURE__ */ n(
|
|
1154
|
+
children: /* @__PURE__ */ n(Tt, {})
|
|
1155
1155
|
}
|
|
1156
1156
|
),
|
|
1157
1157
|
/* @__PURE__ */ n(
|
|
@@ -1159,26 +1159,26 @@ const zn = ({
|
|
|
1159
1159
|
{
|
|
1160
1160
|
type: "button",
|
|
1161
1161
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1162
|
-
onClick:
|
|
1162
|
+
onClick: Ae,
|
|
1163
1163
|
"aria-label": "End call",
|
|
1164
1164
|
title: "End call",
|
|
1165
|
-
children: /* @__PURE__ */ n(
|
|
1165
|
+
children: /* @__PURE__ */ n(Rt, {})
|
|
1166
1166
|
}
|
|
1167
1167
|
)
|
|
1168
1168
|
] })
|
|
1169
1169
|
] }) : (
|
|
1170
1170
|
// Idle-state header with Live Layer product name + minimize/close
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
-
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1173
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1172
|
+
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ze }),
|
|
1173
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
|
|
1174
1174
|
/* @__PURE__ */ n(
|
|
1175
1175
|
"button",
|
|
1176
1176
|
{
|
|
1177
1177
|
type: "button",
|
|
1178
1178
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1179
|
-
onClick:
|
|
1179
|
+
onClick: We,
|
|
1180
1180
|
"aria-label": "Minimize widget",
|
|
1181
|
-
children: /* @__PURE__ */ n(
|
|
1181
|
+
children: /* @__PURE__ */ n(Tt, {})
|
|
1182
1182
|
}
|
|
1183
1183
|
),
|
|
1184
1184
|
/* @__PURE__ */ n(
|
|
@@ -1186,23 +1186,23 @@ const zn = ({
|
|
|
1186
1186
|
{
|
|
1187
1187
|
type: "button",
|
|
1188
1188
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1189
|
-
onClick:
|
|
1189
|
+
onClick: Ae,
|
|
1190
1190
|
"aria-label": "Close widget",
|
|
1191
|
-
children: /* @__PURE__ */ n(
|
|
1191
|
+
children: /* @__PURE__ */ n(Rt, {})
|
|
1192
1192
|
}
|
|
1193
1193
|
)
|
|
1194
1194
|
] })
|
|
1195
1195
|
] })
|
|
1196
1196
|
),
|
|
1197
|
-
|
|
1198
|
-
const h = $ ? "Restart paused session" :
|
|
1199
|
-
return /* @__PURE__ */
|
|
1200
|
-
|
|
1197
|
+
V && /* @__PURE__ */ (() => {
|
|
1198
|
+
const h = $ ? "Restart paused session" : N === "disconnected" ? "Reconnect to agent" : "Start video call", W = $ ? "Pick up where you left off" : null;
|
|
1199
|
+
return /* @__PURE__ */ k(Ht, { children: [
|
|
1200
|
+
N === "idle" && !$ && !D && /* @__PURE__ */ k(
|
|
1201
1201
|
"button",
|
|
1202
1202
|
{
|
|
1203
1203
|
type: "button",
|
|
1204
1204
|
className: "ll-expanded__play",
|
|
1205
|
-
onClick:
|
|
1205
|
+
onClick: fe,
|
|
1206
1206
|
"aria-label": h,
|
|
1207
1207
|
children: [
|
|
1208
1208
|
/* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
@@ -1210,15 +1210,15 @@ const zn = ({
|
|
|
1210
1210
|
]
|
|
1211
1211
|
}
|
|
1212
1212
|
),
|
|
1213
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1214
1214
|
l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
|
|
1215
|
-
|
|
1215
|
+
W && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: W }),
|
|
1216
1216
|
/* @__PURE__ */ n(
|
|
1217
1217
|
"button",
|
|
1218
1218
|
{
|
|
1219
1219
|
type: "button",
|
|
1220
1220
|
className: "ll-expanded__cta",
|
|
1221
|
-
onClick:
|
|
1221
|
+
onClick: fe,
|
|
1222
1222
|
"aria-label": h,
|
|
1223
1223
|
children: h
|
|
1224
1224
|
}
|
|
@@ -1226,52 +1226,52 @@ const zn = ({
|
|
|
1226
1226
|
] })
|
|
1227
1227
|
] });
|
|
1228
1228
|
})(),
|
|
1229
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ k(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
|
-
className: `ll-expanded__pip ${
|
|
1232
|
+
className: `ll-expanded__pip ${xe && (w || Q) ? "is-visible" : ""}`,
|
|
1233
1233
|
children: [
|
|
1234
1234
|
/* @__PURE__ */ n(
|
|
1235
1235
|
"div",
|
|
1236
1236
|
{
|
|
1237
|
-
ref:
|
|
1238
|
-
className:
|
|
1237
|
+
ref: oe,
|
|
1238
|
+
className: Q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1239
1239
|
}
|
|
1240
1240
|
),
|
|
1241
1241
|
/* @__PURE__ */ n(
|
|
1242
1242
|
"div",
|
|
1243
1243
|
{
|
|
1244
|
-
ref:
|
|
1245
|
-
className: !
|
|
1244
|
+
ref: Me,
|
|
1245
|
+
className: !Q && w ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1246
1246
|
}
|
|
1247
1247
|
)
|
|
1248
1248
|
]
|
|
1249
1249
|
}
|
|
1250
1250
|
),
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
|
|
1251
|
+
xe ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
|
|
1252
|
+
ke && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: ke }) }),
|
|
1253
|
+
/* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
|
|
1254
|
+
Be && /* @__PURE__ */ n(
|
|
1255
1255
|
"button",
|
|
1256
1256
|
{
|
|
1257
1257
|
type: "button",
|
|
1258
|
-
className: `ll-tool ${
|
|
1259
|
-
onClick:
|
|
1260
|
-
"aria-label":
|
|
1261
|
-
title:
|
|
1262
|
-
children: /* @__PURE__ */ n(
|
|
1258
|
+
className: `ll-tool ${Q ? "is-on" : ""}`,
|
|
1259
|
+
onClick: q,
|
|
1260
|
+
"aria-label": Q ? "Stop sharing screen" : "Share screen",
|
|
1261
|
+
title: Q ? "Stop sharing" : "Share screen",
|
|
1262
|
+
children: /* @__PURE__ */ n(jn, {})
|
|
1263
1263
|
}
|
|
1264
1264
|
),
|
|
1265
|
-
|
|
1265
|
+
qe && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
|
|
1266
1266
|
/* @__PURE__ */ n(
|
|
1267
1267
|
"button",
|
|
1268
1268
|
{
|
|
1269
1269
|
type: "button",
|
|
1270
1270
|
className: `ll-tool ll-tool--left ${w ? "is-on" : ""}`,
|
|
1271
|
-
onClick:
|
|
1271
|
+
onClick: we,
|
|
1272
1272
|
"aria-label": w ? "Turn off camera" : "Turn on camera",
|
|
1273
1273
|
title: w ? "Stop camera" : "Start camera",
|
|
1274
|
-
children: /* @__PURE__ */ n(
|
|
1274
|
+
children: /* @__PURE__ */ n(Vn, {})
|
|
1275
1275
|
}
|
|
1276
1276
|
),
|
|
1277
1277
|
/* @__PURE__ */ n(
|
|
@@ -1280,57 +1280,57 @@ const zn = ({
|
|
|
1280
1280
|
type: "button",
|
|
1281
1281
|
className: `ll-tool ll-tool--right ${w ? "is-on" : ""}`,
|
|
1282
1282
|
onClick: (h) => {
|
|
1283
|
-
h.stopPropagation(),
|
|
1283
|
+
h.stopPropagation(), Y((W) => !W), ne(!1);
|
|
1284
1284
|
},
|
|
1285
1285
|
"aria-label": "Camera devices",
|
|
1286
1286
|
"aria-haspopup": "listbox",
|
|
1287
|
-
"aria-expanded":
|
|
1288
|
-
children: /* @__PURE__ */ n(
|
|
1287
|
+
"aria-expanded": le,
|
|
1288
|
+
children: /* @__PURE__ */ n(Ye, {})
|
|
1289
1289
|
}
|
|
1290
1290
|
),
|
|
1291
|
-
|
|
1292
|
-
|
|
1291
|
+
le && J.length > 0 && /* @__PURE__ */ n(
|
|
1292
|
+
Pt,
|
|
1293
1293
|
{
|
|
1294
1294
|
label: "Camera",
|
|
1295
|
-
devices:
|
|
1296
|
-
activeId:
|
|
1295
|
+
devices: J,
|
|
1296
|
+
activeId: de,
|
|
1297
1297
|
onPick: (h) => {
|
|
1298
|
-
|
|
1298
|
+
Y(!1), _e(h);
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
1301
|
)
|
|
1302
1302
|
] }),
|
|
1303
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
|
|
1304
1304
|
/* @__PURE__ */ n(
|
|
1305
1305
|
"button",
|
|
1306
1306
|
{
|
|
1307
1307
|
type: "button",
|
|
1308
|
-
className: `ll-tool ll-tool--left ${
|
|
1309
|
-
onClick:
|
|
1310
|
-
"aria-label":
|
|
1311
|
-
title:
|
|
1312
|
-
children: /* @__PURE__ */ n(
|
|
1308
|
+
className: `ll-tool ll-tool--left ${g ? "is-muted" : ""}`,
|
|
1309
|
+
onClick: be,
|
|
1310
|
+
"aria-label": g ? "Unmute microphone" : "Mute microphone",
|
|
1311
|
+
title: g ? "Unmute" : "Mute",
|
|
1312
|
+
children: /* @__PURE__ */ n(Yn, { muted: g })
|
|
1313
1313
|
}
|
|
1314
1314
|
),
|
|
1315
1315
|
/* @__PURE__ */ n(
|
|
1316
1316
|
"button",
|
|
1317
1317
|
{
|
|
1318
1318
|
type: "button",
|
|
1319
|
-
className: `ll-tool ll-tool--right ${
|
|
1319
|
+
className: `ll-tool ll-tool--right ${g ? "is-muted" : ""}`,
|
|
1320
1320
|
onClick: (h) => {
|
|
1321
|
-
h.stopPropagation(), ne((
|
|
1321
|
+
h.stopPropagation(), ne((W) => !W), Y(!1);
|
|
1322
1322
|
},
|
|
1323
1323
|
"aria-label": "Microphone devices",
|
|
1324
1324
|
"aria-haspopup": "listbox",
|
|
1325
|
-
"aria-expanded":
|
|
1326
|
-
children: /* @__PURE__ */ n(
|
|
1325
|
+
"aria-expanded": K,
|
|
1326
|
+
children: /* @__PURE__ */ n(Ye, {})
|
|
1327
1327
|
}
|
|
1328
1328
|
),
|
|
1329
|
-
|
|
1330
|
-
|
|
1329
|
+
K && E.length > 0 && /* @__PURE__ */ n(
|
|
1330
|
+
Pt,
|
|
1331
1331
|
{
|
|
1332
1332
|
label: "Microphone",
|
|
1333
|
-
devices:
|
|
1333
|
+
devices: E,
|
|
1334
1334
|
activeId: "",
|
|
1335
1335
|
onPick: () => ne(!1)
|
|
1336
1336
|
}
|
|
@@ -1340,33 +1340,33 @@ const zn = ({
|
|
|
1340
1340
|
"button",
|
|
1341
1341
|
{
|
|
1342
1342
|
type: "button",
|
|
1343
|
-
className: `ll-tool ${
|
|
1344
|
-
onClick:
|
|
1345
|
-
"aria-label":
|
|
1346
|
-
title:
|
|
1347
|
-
children: /* @__PURE__ */ n(
|
|
1343
|
+
className: `ll-tool ${ue ? "is-muted" : ""}`,
|
|
1344
|
+
onClick: Qe,
|
|
1345
|
+
"aria-label": ue ? "Unmute speaker" : "Mute speaker",
|
|
1346
|
+
title: ue ? "Unmute speaker" : "Mute speaker",
|
|
1347
|
+
children: /* @__PURE__ */ n(Gn, { muted: ue })
|
|
1348
1348
|
}
|
|
1349
1349
|
)
|
|
1350
1350
|
] }),
|
|
1351
|
-
|
|
1351
|
+
Ue && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Re, children: [
|
|
1352
1352
|
/* @__PURE__ */ n(
|
|
1353
1353
|
"input",
|
|
1354
1354
|
{
|
|
1355
1355
|
type: "text",
|
|
1356
1356
|
className: "ll-message-input__field",
|
|
1357
1357
|
placeholder: "Message...",
|
|
1358
|
-
value:
|
|
1359
|
-
onChange: (h) =>
|
|
1358
|
+
value: X,
|
|
1359
|
+
onChange: (h) => ae(h.target.value),
|
|
1360
1360
|
"aria-label": "Message the agent"
|
|
1361
1361
|
}
|
|
1362
1362
|
),
|
|
1363
|
-
|
|
1363
|
+
X.trim() && /* @__PURE__ */ n(
|
|
1364
1364
|
"button",
|
|
1365
1365
|
{
|
|
1366
1366
|
type: "submit",
|
|
1367
1367
|
className: "ll-message-input__send",
|
|
1368
1368
|
"aria-label": "Send message",
|
|
1369
|
-
children: /* @__PURE__ */ n(
|
|
1369
|
+
children: /* @__PURE__ */ n(Kn, {})
|
|
1370
1370
|
}
|
|
1371
1371
|
)
|
|
1372
1372
|
] }),
|
|
@@ -1375,37 +1375,37 @@ const zn = ({
|
|
|
1375
1375
|
{
|
|
1376
1376
|
type: "button",
|
|
1377
1377
|
className: "ll-expanded__end",
|
|
1378
|
-
onClick:
|
|
1378
|
+
onClick: ge,
|
|
1379
1379
|
children: "End conversation"
|
|
1380
1380
|
}
|
|
1381
1381
|
)
|
|
1382
1382
|
] }) : null,
|
|
1383
1383
|
(() => {
|
|
1384
|
-
if (
|
|
1385
|
-
return /* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */ n("span", { children:
|
|
1384
|
+
if (v && N !== "error")
|
|
1385
|
+
return /* @__PURE__ */ k("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1386
|
+
/* @__PURE__ */ n("span", { children: v }),
|
|
1387
1387
|
/* @__PURE__ */ n(
|
|
1388
1388
|
"button",
|
|
1389
1389
|
{
|
|
1390
1390
|
type: "button",
|
|
1391
1391
|
className: "ll-expanded__banner-x",
|
|
1392
|
-
onClick:
|
|
1392
|
+
onClick: Ie,
|
|
1393
1393
|
"aria-label": "Dismiss",
|
|
1394
1394
|
children: "×"
|
|
1395
1395
|
}
|
|
1396
1396
|
)
|
|
1397
1397
|
] });
|
|
1398
|
-
if (!D ||
|
|
1399
|
-
let h = "Failed to connect",
|
|
1400
|
-
return D === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : D === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : D === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : D === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : D === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : D.length < 80 && (h = D), /* @__PURE__ */
|
|
1398
|
+
if (!D || N !== "error") return null;
|
|
1399
|
+
let h = "Failed to connect", W = "Try again";
|
|
1400
|
+
return D === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : D === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : D === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : D === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : D === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : D.length < 80 && (h = D), /* @__PURE__ */ k("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1401
1401
|
/* @__PURE__ */ n("span", { children: h }),
|
|
1402
1402
|
/* @__PURE__ */ n(
|
|
1403
1403
|
"button",
|
|
1404
1404
|
{
|
|
1405
1405
|
type: "button",
|
|
1406
1406
|
className: "ll-expanded__banner-retry",
|
|
1407
|
-
onClick:
|
|
1408
|
-
children:
|
|
1407
|
+
onClick: ye,
|
|
1408
|
+
children: W
|
|
1409
1409
|
}
|
|
1410
1410
|
)
|
|
1411
1411
|
] });
|
|
@@ -1414,55 +1414,55 @@ const zn = ({
|
|
|
1414
1414
|
}
|
|
1415
1415
|
);
|
|
1416
1416
|
};
|
|
1417
|
-
function
|
|
1417
|
+
function Ye() {
|
|
1418
1418
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1421
|
-
return /* @__PURE__ */
|
|
1420
|
+
function Rt() {
|
|
1421
|
+
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: [
|
|
1422
1422
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1423
1423
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1424
1424
|
] });
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function Tt() {
|
|
1427
1427
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1430
|
-
return /* @__PURE__ */
|
|
1429
|
+
function jn() {
|
|
1430
|
+
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: [
|
|
1431
1431
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1432
1432
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1433
1433
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1434
1434
|
] });
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
return /* @__PURE__ */
|
|
1436
|
+
function Vn() {
|
|
1437
|
+
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: [
|
|
1438
1438
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1439
1439
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1440
1440
|
] });
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1443
|
-
return /* @__PURE__ */
|
|
1442
|
+
function Yn({ muted: e }) {
|
|
1443
|
+
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: [
|
|
1444
1444
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1445
1445
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1446
1446
|
/* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
1447
1447
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1448
1448
|
] });
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return /* @__PURE__ */
|
|
1450
|
+
function Gn({ muted: e }) {
|
|
1451
|
+
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: [
|
|
1452
1452
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1453
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
1453
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(Ht, { children: [
|
|
1454
1454
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1455
1455
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1456
1456
|
] })
|
|
1457
1457
|
] });
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1460
|
-
return /* @__PURE__ */
|
|
1459
|
+
function Kn() {
|
|
1460
|
+
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: [
|
|
1461
1461
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1462
1462
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1463
1463
|
] });
|
|
1464
1464
|
}
|
|
1465
|
-
const
|
|
1465
|
+
const Pt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ k(
|
|
1466
1466
|
"div",
|
|
1467
1467
|
{
|
|
1468
1468
|
className: "ll-device-menu",
|
|
@@ -1472,7 +1472,7 @@ const Tt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
|
|
|
1472
1472
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1473
1473
|
t.map((o, l) => {
|
|
1474
1474
|
const s = r === o.deviceId;
|
|
1475
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ k(
|
|
1476
1476
|
"button",
|
|
1477
1477
|
{
|
|
1478
1478
|
type: "button",
|
|
@@ -1490,21 +1490,21 @@ const Tt = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */
|
|
|
1490
1490
|
})
|
|
1491
1491
|
]
|
|
1492
1492
|
}
|
|
1493
|
-
),
|
|
1493
|
+
), Xn = [
|
|
1494
1494
|
'[data-ll-private="true"]',
|
|
1495
1495
|
".ll-widget"
|
|
1496
1496
|
];
|
|
1497
|
-
function
|
|
1497
|
+
function ct(e) {
|
|
1498
1498
|
let t = e;
|
|
1499
1499
|
for (; t; ) {
|
|
1500
|
-
for (const r of
|
|
1500
|
+
for (const r of Xn)
|
|
1501
1501
|
if (t.matches(r)) return !0;
|
|
1502
1502
|
t = t.parentElement;
|
|
1503
1503
|
}
|
|
1504
1504
|
return !1;
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (
|
|
1506
|
+
function Je(e) {
|
|
1507
|
+
if (ct(e)) return !1;
|
|
1508
1508
|
if (e instanceof HTMLInputElement) {
|
|
1509
1509
|
if (e.type === "password") return !1;
|
|
1510
1510
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -1512,7 +1512,7 @@ function Ve(e) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
return !0;
|
|
1514
1514
|
}
|
|
1515
|
-
const
|
|
1515
|
+
const Ge = 4096, Jn = 20, Qn = 20, Zn = 10, er = 10, tr = 30, Dt = 500, nr = [
|
|
1516
1516
|
'[data-ll-private="true"]',
|
|
1517
1517
|
".ll-widget",
|
|
1518
1518
|
"script",
|
|
@@ -1520,24 +1520,24 @@ const qe = 4096, Gn = 20, Kn = 20, Xn = 10, Jn = 10, Qn = 30, It = 500, Zn = [
|
|
|
1520
1520
|
"noscript",
|
|
1521
1521
|
"iframe"
|
|
1522
1522
|
];
|
|
1523
|
-
function
|
|
1523
|
+
function He(e) {
|
|
1524
1524
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
1525
1525
|
let t = e;
|
|
1526
1526
|
for (; t; ) {
|
|
1527
|
-
for (const r of
|
|
1527
|
+
for (const r of nr)
|
|
1528
1528
|
if (t.matches(r)) return !0;
|
|
1529
1529
|
t = t.parentElement;
|
|
1530
1530
|
}
|
|
1531
1531
|
return !1;
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function Oe(e) {
|
|
1534
1534
|
if (typeof window > "u") return !0;
|
|
1535
1535
|
const t = e.getBoundingClientRect();
|
|
1536
1536
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
1537
1537
|
const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
1538
1538
|
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1540
|
+
function $t(e) {
|
|
1541
1541
|
const t = e.getAttribute("id");
|
|
1542
1542
|
if (t) {
|
|
1543
1543
|
const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
|
|
@@ -1550,13 +1550,13 @@ function Pt(e) {
|
|
|
1550
1550
|
const o = e.closest("label");
|
|
1551
1551
|
return o != null && o.textContent ? o.textContent.trim() : "";
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1553
|
+
function me(e, t) {
|
|
1554
1554
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1556
|
+
function Ee(e) {
|
|
1557
1557
|
return e.length;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function rr(e, t = {}) {
|
|
1560
1560
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
1561
1561
|
if (!r)
|
|
1562
1562
|
return {
|
|
@@ -1573,118 +1573,118 @@ function er(e, t = {}) {
|
|
|
1573
1573
|
const i = typeof window < "u" && window.location.href || "", o = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
|
|
1574
1574
|
r.querySelectorAll("[data-ll-region]")
|
|
1575
1575
|
), d = [];
|
|
1576
|
-
for (const
|
|
1577
|
-
if (d.length >=
|
|
1578
|
-
if (
|
|
1579
|
-
const
|
|
1580
|
-
(
|
|
1581
|
-
|
|
1576
|
+
for (const g of s) {
|
|
1577
|
+
if (d.length >= Zn) break;
|
|
1578
|
+
if (He(g) || !Oe(g)) continue;
|
|
1579
|
+
const v = g.getAttribute("data-ll-region") ?? "", E = g.getAttribute("data-ll-intent") ?? void 0, w = me(
|
|
1580
|
+
(g.innerText || g.textContent || "").trim(),
|
|
1581
|
+
Dt * 2
|
|
1582
1582
|
);
|
|
1583
|
-
!
|
|
1583
|
+
!v || !w || d.push({ id: v, intent: E, text: w });
|
|
1584
1584
|
}
|
|
1585
|
-
const u = [],
|
|
1585
|
+
const u = [], y = ["H1", "H2", "H3", "H4", "H5", "H6"], p = Array.from(
|
|
1586
1586
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
1587
1587
|
);
|
|
1588
|
-
for (const
|
|
1589
|
-
if (
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1588
|
+
for (const g of p) {
|
|
1589
|
+
if (He(g) || !Oe(g)) continue;
|
|
1590
|
+
const v = (g.textContent || "").trim();
|
|
1591
|
+
v && u.push(`${g.tagName}: ${me(v, 200)}`);
|
|
1592
1592
|
}
|
|
1593
1593
|
const a = Array.from(r.querySelectorAll("p, li"));
|
|
1594
|
-
for (const
|
|
1595
|
-
if (
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1594
|
+
for (const g of a) {
|
|
1595
|
+
if (He(g) || !Oe(g) || y.includes(g.tagName)) continue;
|
|
1596
|
+
const v = (g.textContent || "").trim();
|
|
1597
|
+
v.length > 10 && u.push(me(v, Dt));
|
|
1598
1598
|
}
|
|
1599
1599
|
const c = u.join(`
|
|
1600
|
-
`),
|
|
1601
|
-
for (const
|
|
1602
|
-
if (
|
|
1603
|
-
if (
|
|
1604
|
-
const
|
|
1605
|
-
!
|
|
1600
|
+
`), S = [], L = Array.from(r.querySelectorAll("a[href]"));
|
|
1601
|
+
for (const g of L) {
|
|
1602
|
+
if (S.length >= Jn) break;
|
|
1603
|
+
if (He(g) || !Oe(g)) continue;
|
|
1604
|
+
const v = g.getAttribute("href") || "", E = (g.textContent || "").trim();
|
|
1605
|
+
!v || !E || S.push({ href: v, text: me(E, 100) });
|
|
1606
1606
|
}
|
|
1607
|
-
const
|
|
1607
|
+
const N = [], H = Array.from(
|
|
1608
1608
|
r.querySelectorAll(
|
|
1609
1609
|
"input, textarea, select"
|
|
1610
1610
|
)
|
|
1611
1611
|
);
|
|
1612
|
-
for (const
|
|
1613
|
-
if (
|
|
1614
|
-
if (
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1612
|
+
for (const g of H) {
|
|
1613
|
+
if (N.length >= Qn) break;
|
|
1614
|
+
if (He(g) || !Je(g) || !Oe(g)) continue;
|
|
1615
|
+
const v = $t(g), E = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
1616
|
+
v && N.push({ label: me(v, 100), type: E });
|
|
1617
1617
|
}
|
|
1618
|
-
const
|
|
1618
|
+
const R = Array.from(
|
|
1619
1619
|
r.querySelectorAll("[data-ll-form]")
|
|
1620
1620
|
), $ = [];
|
|
1621
|
-
for (const
|
|
1622
|
-
if ($.length >=
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1625
|
-
if (!
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1621
|
+
for (const g of R) {
|
|
1622
|
+
if ($.length >= er) break;
|
|
1623
|
+
if (ct(g)) continue;
|
|
1624
|
+
const v = g.getAttribute("data-ll-form") || "";
|
|
1625
|
+
if (!v) continue;
|
|
1626
|
+
const E = g.getAttribute("data-ll-intent") || void 0, w = Array.from(
|
|
1627
|
+
g.querySelectorAll(
|
|
1628
1628
|
"[data-ll-field]"
|
|
1629
1629
|
)
|
|
1630
|
-
),
|
|
1631
|
-
for (const
|
|
1632
|
-
if (
|
|
1633
|
-
if (!
|
|
1634
|
-
const
|
|
1635
|
-
if (!
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1630
|
+
), O = [];
|
|
1631
|
+
for (const J of w) {
|
|
1632
|
+
if (O.length >= tr) break;
|
|
1633
|
+
if (!Je(J)) continue;
|
|
1634
|
+
const de = J.getAttribute("data-ll-field") || "";
|
|
1635
|
+
if (!de) continue;
|
|
1636
|
+
const Q = $t(J) || de, Z = J instanceof HTMLInputElement ? J.type : J.tagName.toLowerCase();
|
|
1637
|
+
O.push({ name: de, label: me(Q, 100), type: Z });
|
|
1638
1638
|
}
|
|
1639
|
-
$.push({ id:
|
|
1639
|
+
$.push({ id: v, intent: E, fields: O });
|
|
1640
1640
|
}
|
|
1641
|
-
const
|
|
1641
|
+
const I = {
|
|
1642
1642
|
url: i,
|
|
1643
1643
|
title: l,
|
|
1644
1644
|
pathname: o,
|
|
1645
1645
|
regions: d,
|
|
1646
1646
|
visibleText: c,
|
|
1647
|
-
visibleLinks:
|
|
1648
|
-
visibleFields:
|
|
1647
|
+
visibleLinks: S,
|
|
1648
|
+
visibleFields: N,
|
|
1649
1649
|
forms: $,
|
|
1650
1650
|
extras: e
|
|
1651
1651
|
};
|
|
1652
|
-
let D =
|
|
1653
|
-
for (; D >
|
|
1654
|
-
|
|
1655
|
-
for (; D >
|
|
1656
|
-
|
|
1657
|
-
return
|
|
1652
|
+
let D = Ee(JSON.stringify(I.regions)) + Ee(I.visibleText) + Ee(JSON.stringify(I.visibleLinks)) + Ee(JSON.stringify(I.visibleFields));
|
|
1653
|
+
for (; D > Ge && I.visibleFields.length > 0; )
|
|
1654
|
+
I.visibleFields.pop(), D = Ee(JSON.stringify(I.visibleFields));
|
|
1655
|
+
for (; D > Ge && I.visibleLinks.length > 0; )
|
|
1656
|
+
I.visibleLinks.pop(), D -= 80;
|
|
1657
|
+
return Ee(I.visibleText) > Ge && (I.visibleText = me(I.visibleText, Ge - 100)), I;
|
|
1658
1658
|
}
|
|
1659
|
-
let
|
|
1660
|
-
function
|
|
1659
|
+
let Ce = null;
|
|
1660
|
+
function zt(e, t = {}) {
|
|
1661
1661
|
const r = Date.now(), o = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
1662
|
-
if (
|
|
1663
|
-
return
|
|
1664
|
-
const l =
|
|
1665
|
-
return
|
|
1662
|
+
if (Ce && Ce.key === o && r - Ce.at < 1e3)
|
|
1663
|
+
return Ce.ctx;
|
|
1664
|
+
const l = rr(e, t);
|
|
1665
|
+
return Ce = { key: o, at: r, ctx: l }, l;
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1668
|
-
|
|
1667
|
+
function ir() {
|
|
1668
|
+
Ce = null;
|
|
1669
1669
|
}
|
|
1670
|
-
const
|
|
1671
|
-
function
|
|
1670
|
+
const or = 200;
|
|
1671
|
+
function lr(e) {
|
|
1672
1672
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function ar(e) {
|
|
1675
1675
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
1676
1676
|
if (!t) return [];
|
|
1677
1677
|
const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
1678
1678
|
for (const s of l) {
|
|
1679
|
-
if (o.length >=
|
|
1680
|
-
if (
|
|
1679
|
+
if (o.length >= or) break;
|
|
1680
|
+
if (ct(s)) continue;
|
|
1681
1681
|
const d = s.getAttribute("href") || "";
|
|
1682
|
-
if (!
|
|
1683
|
-
let u = d,
|
|
1682
|
+
if (!lr(d)) continue;
|
|
1683
|
+
let u = d, y = !0;
|
|
1684
1684
|
try {
|
|
1685
1685
|
if (typeof window < "u") {
|
|
1686
1686
|
const a = new URL(d, r);
|
|
1687
|
-
|
|
1687
|
+
y = a.origin === r, y && d.startsWith("http") && (u = a.pathname + a.search + a.hash);
|
|
1688
1688
|
}
|
|
1689
1689
|
} catch {
|
|
1690
1690
|
continue;
|
|
@@ -1692,27 +1692,27 @@ function ir(e) {
|
|
|
1692
1692
|
if (i.has(u)) continue;
|
|
1693
1693
|
i.add(u);
|
|
1694
1694
|
const p = (s.textContent || "").trim().slice(0, 120);
|
|
1695
|
-
o.push({ href: u, text: p, internal:
|
|
1695
|
+
o.push({ href: u, text: p, internal: y });
|
|
1696
1696
|
}
|
|
1697
1697
|
return o;
|
|
1698
1698
|
}
|
|
1699
|
-
let
|
|
1700
|
-
const
|
|
1701
|
-
function
|
|
1699
|
+
let Se = null;
|
|
1700
|
+
const cr = 5e3;
|
|
1701
|
+
function sr() {
|
|
1702
1702
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
1703
|
-
if (
|
|
1704
|
-
return
|
|
1705
|
-
const r =
|
|
1706
|
-
return
|
|
1703
|
+
if (Se && Se.pathname === t && e - Se.at < cr)
|
|
1704
|
+
return Se.routes;
|
|
1705
|
+
const r = ar();
|
|
1706
|
+
return Se = { at: e, pathname: t, routes: r }, r;
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1708
|
+
function dr() {
|
|
1709
|
+
Se = null;
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1711
|
+
function ur(e, t) {
|
|
1712
1712
|
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value"), o = i == null ? void 0 : i.set;
|
|
1713
1713
|
o ? o.call(e, t) : e.value = t;
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function fr(e, t, r = {}) {
|
|
1716
1716
|
const i = r.triggerInput ?? !0, o = r.triggerChange ?? !0;
|
|
1717
1717
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
1718
1718
|
const l = Object.getOwnPropertyDescriptor(
|
|
@@ -1722,9 +1722,9 @@ function sr(e, t, r = {}) {
|
|
|
1722
1722
|
s ? s.call(e, d) : e.checked = d, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1723
1723
|
return;
|
|
1724
1724
|
}
|
|
1725
|
-
|
|
1725
|
+
ur(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1726
1726
|
}
|
|
1727
|
-
const
|
|
1727
|
+
const pr = /* @__PURE__ */ new Set([
|
|
1728
1728
|
"agent_state",
|
|
1729
1729
|
"avatar_stream_ready",
|
|
1730
1730
|
"avatar_active",
|
|
@@ -1747,8 +1747,8 @@ const dr = /* @__PURE__ */ new Set([
|
|
|
1747
1747
|
"submit_form",
|
|
1748
1748
|
"request_routes"
|
|
1749
1749
|
]);
|
|
1750
|
-
function
|
|
1751
|
-
var
|
|
1750
|
+
function hr(e) {
|
|
1751
|
+
var gt, yt, vt, bt, wt, _t, xt;
|
|
1752
1752
|
const {
|
|
1753
1753
|
agentId: t,
|
|
1754
1754
|
apiKey: r,
|
|
@@ -1758,467 +1758,479 @@ function ur(e) {
|
|
|
1758
1758
|
autoConnect: s = !1,
|
|
1759
1759
|
displayMode: d,
|
|
1760
1760
|
defaultDisplayMode: u = "expanded",
|
|
1761
|
-
onDisplayModeChange:
|
|
1761
|
+
onDisplayModeChange: y,
|
|
1762
1762
|
position: p = "bottom-right",
|
|
1763
1763
|
mobileBreakpoint: a = 640,
|
|
1764
1764
|
persistKey: c = "ll-widget",
|
|
1765
|
-
disablePersistence:
|
|
1766
|
-
teamMembers:
|
|
1767
|
-
currentTeamMemberId:
|
|
1768
|
-
onTeamMemberChange:
|
|
1769
|
-
idleLoopUrl:
|
|
1765
|
+
disablePersistence: S = !1,
|
|
1766
|
+
teamMembers: L,
|
|
1767
|
+
currentTeamMemberId: N,
|
|
1768
|
+
onTeamMemberChange: H,
|
|
1769
|
+
idleLoopUrl: R,
|
|
1770
1770
|
greeting: $,
|
|
1771
|
-
avatarImageUrl:
|
|
1771
|
+
avatarImageUrl: I,
|
|
1772
1772
|
agentName: D,
|
|
1773
|
-
branding:
|
|
1774
|
-
allowCamera:
|
|
1775
|
-
allowScreenShare:
|
|
1773
|
+
branding: g = {},
|
|
1774
|
+
allowCamera: v = !0,
|
|
1775
|
+
allowScreenShare: E = !0,
|
|
1776
1776
|
allowTyping: w = !0,
|
|
1777
|
-
showOn:
|
|
1778
|
-
hideOn:
|
|
1779
|
-
pathname:
|
|
1780
|
-
onNavigate:
|
|
1781
|
-
onScrollToSelector:
|
|
1782
|
-
getPageContext:
|
|
1783
|
-
pageContextExtras:
|
|
1784
|
-
onScrollPage:
|
|
1785
|
-
onClick:
|
|
1786
|
-
capabilities:
|
|
1787
|
-
onConnect:
|
|
1788
|
-
onDisconnect:
|
|
1789
|
-
onTranscript:
|
|
1790
|
-
onAgentState:
|
|
1791
|
-
onConnectionStateChange:
|
|
1792
|
-
onAgentEvent:
|
|
1793
|
-
onAgentCommand:
|
|
1794
|
-
controlledSession:
|
|
1795
|
-
className:
|
|
1796
|
-
style:
|
|
1797
|
-
zIndex:
|
|
1798
|
-
} = e,
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
}, [
|
|
1802
|
-
const
|
|
1803
|
-
var
|
|
1804
|
-
return
|
|
1805
|
-
}),
|
|
1806
|
-
() => (
|
|
1807
|
-
[
|
|
1808
|
-
),
|
|
1777
|
+
showOn: O,
|
|
1778
|
+
hideOn: J,
|
|
1779
|
+
pathname: de,
|
|
1780
|
+
onNavigate: Q,
|
|
1781
|
+
onScrollToSelector: Z,
|
|
1782
|
+
getPageContext: ue,
|
|
1783
|
+
pageContextExtras: qe,
|
|
1784
|
+
onScrollPage: Be,
|
|
1785
|
+
onClick: Ue,
|
|
1786
|
+
capabilities: Ne,
|
|
1787
|
+
onConnect: fe,
|
|
1788
|
+
onDisconnect: ge,
|
|
1789
|
+
onTranscript: ye,
|
|
1790
|
+
onAgentState: ve,
|
|
1791
|
+
onConnectionStateChange: be,
|
|
1792
|
+
onAgentEvent: we,
|
|
1793
|
+
onAgentCommand: _e,
|
|
1794
|
+
controlledSession: q,
|
|
1795
|
+
className: Qe,
|
|
1796
|
+
style: Fe,
|
|
1797
|
+
zIndex: We = 2147483647
|
|
1798
|
+
} = e, Ae = Cn(de), Ie = Tn(Ae, O, J);
|
|
1799
|
+
P(() => {
|
|
1800
|
+
ir(), dr();
|
|
1801
|
+
}, [Ae]);
|
|
1802
|
+
const ie = N !== void 0, [pe, xe] = C(() => {
|
|
1803
|
+
var m;
|
|
1804
|
+
return N ?? ((m = L == null ? void 0 : L[0]) == null ? void 0 : m.id);
|
|
1805
|
+
}), ee = ie ? N : pe, V = Ke(
|
|
1806
|
+
() => (L == null ? void 0 : L.find((m) => m.id === ee)) ?? null,
|
|
1807
|
+
[L, ee]
|
|
1808
|
+
), Me = (V == null ? void 0 : V.agentId) ?? t, [oe, K] = xn({
|
|
1809
1809
|
value: d,
|
|
1810
1810
|
defaultValue: u,
|
|
1811
|
-
onChange:
|
|
1811
|
+
onChange: y,
|
|
1812
1812
|
persistKey: c,
|
|
1813
|
-
disablePersistence:
|
|
1814
|
-
}), ne =
|
|
1815
|
-
|
|
1816
|
-
function
|
|
1817
|
-
const f =
|
|
1818
|
-
return f ? f.includes(
|
|
1813
|
+
disablePersistence: S
|
|
1814
|
+
}), ne = Ln(a), le = dn(), Y = un(), X = pn(), ae = hn(), Re = mn(), [Ze, ke] = C(!1), [Te, Pe] = C(!1), [h, W] = C(!1), [st, Bt] = C(!1), [et, Ut] = C(!1), tt = M(Q), nt = M(Z), rt = M(Be), it = M(Ue), dt = M(ue), ut = M(qe), ot = M(Ne), te = M(null);
|
|
1815
|
+
tt.current = Q, nt.current = Z, rt.current = Be, it.current = Ue, dt.current = ue, ut.current = qe, ot.current = Ne;
|
|
1816
|
+
function ce(m) {
|
|
1817
|
+
const f = ot.current;
|
|
1818
|
+
return f ? f.includes(m) : !0;
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1820
|
+
function se(m, f) {
|
|
1821
1821
|
console.warn(
|
|
1822
|
-
`[LiveLayer] Agent command "${
|
|
1822
|
+
`[LiveLayer] Agent command "${m}" blocked — capability "${f}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
1823
1823
|
);
|
|
1824
1824
|
}
|
|
1825
|
-
const
|
|
1826
|
-
(
|
|
1827
|
-
var
|
|
1828
|
-
const f =
|
|
1825
|
+
const De = x(
|
|
1826
|
+
(m) => {
|
|
1827
|
+
var G, je, Ve, kt;
|
|
1828
|
+
const f = m;
|
|
1829
1829
|
if (!(!f.type || typeof f.type != "string")) {
|
|
1830
|
-
if (
|
|
1831
|
-
if (!
|
|
1832
|
-
|
|
1830
|
+
if (we == null || we({ eventName: f.type, data: m }), f.type === "navigate") {
|
|
1831
|
+
if (!ce("navigate")) {
|
|
1832
|
+
se("navigate", "navigate");
|
|
1833
1833
|
return;
|
|
1834
1834
|
}
|
|
1835
|
-
const
|
|
1836
|
-
if (!
|
|
1835
|
+
const _ = typeof f.href == "string" ? f.href : null;
|
|
1836
|
+
if (!_) {
|
|
1837
1837
|
console.warn(
|
|
1838
1838
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
1839
1839
|
);
|
|
1840
1840
|
return;
|
|
1841
1841
|
}
|
|
1842
|
-
if (
|
|
1842
|
+
if (tt.current) {
|
|
1843
1843
|
try {
|
|
1844
|
-
|
|
1845
|
-
} catch (
|
|
1844
|
+
tt.current(_);
|
|
1845
|
+
} catch (A) {
|
|
1846
1846
|
console.warn(
|
|
1847
|
-
`[LiveLayer] onNavigate threw for "${
|
|
1848
|
-
|
|
1847
|
+
`[LiveLayer] onNavigate threw for "${_}". Falling back. Error:`,
|
|
1848
|
+
A
|
|
1849
1849
|
);
|
|
1850
1850
|
}
|
|
1851
1851
|
return;
|
|
1852
1852
|
}
|
|
1853
1853
|
if (typeof document < "u") {
|
|
1854
|
-
const
|
|
1855
|
-
`a[href="${
|
|
1854
|
+
const A = document.querySelector(
|
|
1855
|
+
`a[href="${_.replace(/"/g, '\\"')}"]`
|
|
1856
1856
|
);
|
|
1857
|
-
if (
|
|
1858
|
-
|
|
1857
|
+
if (A) {
|
|
1858
|
+
A.click();
|
|
1859
1859
|
return;
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
1862
|
if (typeof window < "u" && typeof history < "u")
|
|
1863
1863
|
try {
|
|
1864
|
-
history.pushState({}, "",
|
|
1865
|
-
} catch (
|
|
1864
|
+
history.pushState({}, "", _), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
1865
|
+
} catch (A) {
|
|
1866
1866
|
console.warn(
|
|
1867
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
1868
|
-
|
|
1867
|
+
`[LiveLayer] history.pushState fallback failed for "${_}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
1868
|
+
A
|
|
1869
1869
|
);
|
|
1870
1870
|
}
|
|
1871
1871
|
return;
|
|
1872
1872
|
}
|
|
1873
1873
|
if (f.type === "scroll_to") {
|
|
1874
|
-
if (!
|
|
1875
|
-
|
|
1874
|
+
if (!ce("scroll")) {
|
|
1875
|
+
se("scroll_to", "scroll");
|
|
1876
1876
|
return;
|
|
1877
1877
|
}
|
|
1878
|
-
const
|
|
1879
|
-
if (!
|
|
1880
|
-
const
|
|
1881
|
-
if (
|
|
1878
|
+
const _ = typeof f.selector == "string" ? f.selector : null;
|
|
1879
|
+
if (!_) return;
|
|
1880
|
+
const A = f.behavior === "instant" ? "instant" : "smooth";
|
|
1881
|
+
if (nt.current) {
|
|
1882
1882
|
try {
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1883
|
+
nt.current(
|
|
1884
|
+
_,
|
|
1885
|
+
A
|
|
1886
1886
|
);
|
|
1887
|
-
} catch (
|
|
1888
|
-
console.warn("[LiveLayer] onScrollToSelector threw.",
|
|
1887
|
+
} catch (T) {
|
|
1888
|
+
console.warn("[LiveLayer] onScrollToSelector threw.", T);
|
|
1889
1889
|
}
|
|
1890
1890
|
return;
|
|
1891
1891
|
}
|
|
1892
1892
|
if (typeof document < "u") {
|
|
1893
|
-
let
|
|
1893
|
+
let T = null;
|
|
1894
1894
|
try {
|
|
1895
|
-
|
|
1895
|
+
T = document.querySelector(_);
|
|
1896
1896
|
} catch {
|
|
1897
1897
|
console.warn(
|
|
1898
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
1898
|
+
`[LiveLayer] scroll_to: invalid selector "${_}".`
|
|
1899
1899
|
);
|
|
1900
1900
|
return;
|
|
1901
1901
|
}
|
|
1902
|
-
if (!
|
|
1902
|
+
if (!T) {
|
|
1903
1903
|
console.warn(
|
|
1904
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
1904
|
+
`[LiveLayer] scroll_to: no element matched "${_}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
1905
1905
|
);
|
|
1906
1906
|
return;
|
|
1907
1907
|
}
|
|
1908
|
-
|
|
1909
|
-
behavior:
|
|
1908
|
+
T.scrollIntoView({
|
|
1909
|
+
behavior: A,
|
|
1910
1910
|
block: "start"
|
|
1911
1911
|
});
|
|
1912
1912
|
}
|
|
1913
1913
|
return;
|
|
1914
1914
|
}
|
|
1915
1915
|
if (f.type === "request_page_context") {
|
|
1916
|
-
if (!
|
|
1917
|
-
|
|
1916
|
+
if (!ce("read_page")) {
|
|
1917
|
+
se("request_page_context", "read_page");
|
|
1918
1918
|
return;
|
|
1919
1919
|
}
|
|
1920
|
-
const
|
|
1921
|
-
const j =
|
|
1922
|
-
if (
|
|
1920
|
+
const _ = typeof f.requestId == "string" ? f.requestId : void 0, A = (G = te.current) == null ? void 0 : G.call(te), T = (U) => {
|
|
1921
|
+
const j = A, re = j == null ? void 0 : j.localParticipant;
|
|
1922
|
+
if (re != null && re.publishData)
|
|
1923
1923
|
try {
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1926
|
-
} catch (
|
|
1927
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
1924
|
+
const he = _ ? { ...U, requestId: _ } : U, Le = new TextEncoder().encode(JSON.stringify(he));
|
|
1925
|
+
re.publishData(Le, { reliable: !0 });
|
|
1926
|
+
} catch (he) {
|
|
1927
|
+
console.warn("[LiveLayer] publishData failed.", he);
|
|
1928
1928
|
}
|
|
1929
|
-
},
|
|
1929
|
+
}, z = ut.current, B = dt.current;
|
|
1930
1930
|
try {
|
|
1931
|
-
if (
|
|
1932
|
-
const U =
|
|
1931
|
+
if (B) {
|
|
1932
|
+
const U = B(z);
|
|
1933
1933
|
if (U instanceof Promise) {
|
|
1934
|
-
|
|
1934
|
+
T({ type: "page_context_pending" }), U.then((j) => T({ type: "page_context", context: j })).catch((j) => {
|
|
1935
1935
|
console.warn(
|
|
1936
1936
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
1937
1937
|
j
|
|
1938
|
-
),
|
|
1938
|
+
), T({
|
|
1939
1939
|
type: "page_context",
|
|
1940
|
-
context:
|
|
1940
|
+
context: zt(z)
|
|
1941
1941
|
});
|
|
1942
1942
|
});
|
|
1943
1943
|
return;
|
|
1944
1944
|
}
|
|
1945
|
-
|
|
1945
|
+
T({ type: "page_context", context: U });
|
|
1946
1946
|
return;
|
|
1947
1947
|
}
|
|
1948
|
-
|
|
1948
|
+
T({
|
|
1949
1949
|
type: "page_context",
|
|
1950
|
-
context:
|
|
1950
|
+
context: zt(z)
|
|
1951
1951
|
});
|
|
1952
1952
|
} catch (U) {
|
|
1953
1953
|
console.warn(
|
|
1954
1954
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
1955
1955
|
U
|
|
1956
|
-
),
|
|
1956
|
+
), T({
|
|
1957
1957
|
type: "page_context",
|
|
1958
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], extras:
|
|
1958
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: z }
|
|
1959
1959
|
});
|
|
1960
1960
|
}
|
|
1961
1961
|
return;
|
|
1962
1962
|
}
|
|
1963
1963
|
if (f.type === "scroll_page") {
|
|
1964
|
-
if (!
|
|
1965
|
-
|
|
1964
|
+
if (!ce("scroll")) {
|
|
1965
|
+
se("scroll_page", "scroll");
|
|
1966
1966
|
return;
|
|
1967
1967
|
}
|
|
1968
|
-
const
|
|
1969
|
-
if (
|
|
1968
|
+
const _ = f.direction;
|
|
1969
|
+
if (_ !== "up" && _ !== "down" && _ !== "top" && _ !== "bottom") {
|
|
1970
1970
|
console.warn(
|
|
1971
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
1971
|
+
`[LiveLayer] scroll_page: invalid direction "${String(_)}". Expected up | down | top | bottom.`
|
|
1972
1972
|
);
|
|
1973
1973
|
return;
|
|
1974
1974
|
}
|
|
1975
|
-
const
|
|
1976
|
-
if (
|
|
1975
|
+
const A = f.behavior === "instant" ? "instant" : "smooth";
|
|
1976
|
+
if (rt.current) {
|
|
1977
1977
|
try {
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1978
|
+
rt.current(
|
|
1979
|
+
_,
|
|
1980
|
+
A
|
|
1981
1981
|
);
|
|
1982
|
-
} catch (
|
|
1983
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
1982
|
+
} catch (z) {
|
|
1983
|
+
console.warn("[LiveLayer] onScrollPage threw.", z);
|
|
1984
1984
|
}
|
|
1985
1985
|
return;
|
|
1986
1986
|
}
|
|
1987
1987
|
if (typeof window > "u") return;
|
|
1988
|
-
const
|
|
1989
|
-
|
|
1988
|
+
const T = { behavior: A };
|
|
1989
|
+
_ === "up" ? window.scrollBy({ top: -window.innerHeight, ...T }) : _ === "down" ? window.scrollBy({ top: window.innerHeight, ...T }) : _ === "top" ? window.scrollTo({ top: 0, ...T }) : window.scrollTo({ top: document.body.scrollHeight, ...T });
|
|
1990
1990
|
return;
|
|
1991
1991
|
}
|
|
1992
1992
|
if (f.type === "click") {
|
|
1993
|
-
if (!
|
|
1994
|
-
|
|
1993
|
+
if (!ce("click")) {
|
|
1994
|
+
se("click", "click");
|
|
1995
1995
|
return;
|
|
1996
1996
|
}
|
|
1997
|
-
const
|
|
1998
|
-
if (!
|
|
1997
|
+
const _ = typeof f.selector == "string" ? f.selector : null;
|
|
1998
|
+
if (!_) {
|
|
1999
1999
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2000
2000
|
return;
|
|
2001
2001
|
}
|
|
2002
|
-
if (
|
|
2002
|
+
if (it.current) {
|
|
2003
2003
|
try {
|
|
2004
|
-
|
|
2005
|
-
} catch (
|
|
2006
|
-
console.warn("[LiveLayer] onClick threw.",
|
|
2004
|
+
it.current(_);
|
|
2005
|
+
} catch (T) {
|
|
2006
|
+
console.warn("[LiveLayer] onClick threw.", T);
|
|
2007
2007
|
}
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
2010
|
if (typeof document > "u") return;
|
|
2011
|
-
let
|
|
2011
|
+
let A = null;
|
|
2012
2012
|
try {
|
|
2013
|
-
|
|
2013
|
+
A = document.querySelector(_);
|
|
2014
2014
|
} catch {
|
|
2015
2015
|
console.warn(
|
|
2016
|
-
`[LiveLayer] click: invalid selector "${
|
|
2016
|
+
`[LiveLayer] click: invalid selector "${_}".`
|
|
2017
2017
|
);
|
|
2018
2018
|
return;
|
|
2019
2019
|
}
|
|
2020
|
-
if (!
|
|
2020
|
+
if (!A) {
|
|
2021
2021
|
console.warn(
|
|
2022
|
-
`[LiveLayer] click: no element matched "${
|
|
2022
|
+
`[LiveLayer] click: no element matched "${_}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
2023
2023
|
);
|
|
2024
2024
|
return;
|
|
2025
2025
|
}
|
|
2026
|
-
if (
|
|
2026
|
+
if (A.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2027
2027
|
console.warn(
|
|
2028
2028
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
2029
2029
|
);
|
|
2030
2030
|
return;
|
|
2031
2031
|
}
|
|
2032
|
-
(
|
|
2032
|
+
(je = A.click) == null || je.call(A);
|
|
2033
2033
|
return;
|
|
2034
2034
|
}
|
|
2035
2035
|
if (f.type === "fill_form" || f.type === "focus_field") {
|
|
2036
|
-
if (!
|
|
2037
|
-
|
|
2036
|
+
if (!ce("fill_forms")) {
|
|
2037
|
+
se(f.type, "fill_forms");
|
|
2038
2038
|
return;
|
|
2039
2039
|
}
|
|
2040
2040
|
if (typeof document > "u") return;
|
|
2041
|
-
const
|
|
2042
|
-
if (!
|
|
2041
|
+
const _ = typeof f.formId == "string" ? f.formId : null;
|
|
2042
|
+
if (!_) {
|
|
2043
2043
|
console.warn(`[LiveLayer] ${f.type}: missing formId.`);
|
|
2044
2044
|
return;
|
|
2045
2045
|
}
|
|
2046
|
-
const
|
|
2047
|
-
`[data-ll-form="${
|
|
2046
|
+
const A = document.querySelector(
|
|
2047
|
+
`[data-ll-form="${_.replace(/"/g, '\\"')}"]`
|
|
2048
2048
|
);
|
|
2049
|
-
if (!
|
|
2049
|
+
if (!A) {
|
|
2050
2050
|
console.warn(
|
|
2051
|
-
`[LiveLayer] ${f.type}: no form with data-ll-form="${
|
|
2051
|
+
`[LiveLayer] ${f.type}: no form with data-ll-form="${_}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
|
|
2052
2052
|
);
|
|
2053
2053
|
return;
|
|
2054
2054
|
}
|
|
2055
|
-
if (
|
|
2055
|
+
if (A.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2056
2056
|
console.warn(
|
|
2057
2057
|
`[LiveLayer] ${f.type}: refusing to touch a form in a private subtree.`
|
|
2058
2058
|
);
|
|
2059
2059
|
return;
|
|
2060
2060
|
}
|
|
2061
2061
|
if (f.type === "focus_field") {
|
|
2062
|
-
const
|
|
2063
|
-
if (!
|
|
2062
|
+
const z = typeof f.fieldName == "string" ? f.fieldName : null;
|
|
2063
|
+
if (!z) {
|
|
2064
2064
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2065
2065
|
return;
|
|
2066
2066
|
}
|
|
2067
|
-
const
|
|
2068
|
-
if (!
|
|
2067
|
+
const B = A.querySelector(`[data-ll-field="${z.replace(/"/g, '\\"')}"]`);
|
|
2068
|
+
if (!B) {
|
|
2069
2069
|
console.warn(
|
|
2070
|
-
`[LiveLayer] focus_field: no field "${
|
|
2070
|
+
`[LiveLayer] focus_field: no field "${z}" in form "${_}".`
|
|
2071
2071
|
);
|
|
2072
2072
|
return;
|
|
2073
2073
|
}
|
|
2074
|
-
if (!
|
|
2074
|
+
if (!Je(B)) {
|
|
2075
2075
|
console.warn(
|
|
2076
|
-
`[LiveLayer] focus_field: field "${
|
|
2076
|
+
`[LiveLayer] focus_field: field "${z}" is privacy-protected and not focusable.`
|
|
2077
2077
|
);
|
|
2078
2078
|
return;
|
|
2079
2079
|
}
|
|
2080
|
-
|
|
2080
|
+
B.focus();
|
|
2081
2081
|
return;
|
|
2082
2082
|
}
|
|
2083
|
-
const
|
|
2084
|
-
if (!
|
|
2083
|
+
const T = f.values && typeof f.values == "object" ? f.values : null;
|
|
2084
|
+
if (!T) {
|
|
2085
2085
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
2086
2086
|
return;
|
|
2087
2087
|
}
|
|
2088
|
-
for (const [
|
|
2089
|
-
if (typeof
|
|
2090
|
-
const
|
|
2091
|
-
if (!
|
|
2088
|
+
for (const [z, B] of Object.entries(T)) {
|
|
2089
|
+
if (typeof B != "string") continue;
|
|
2090
|
+
const U = A.querySelector(`[data-ll-field="${z.replace(/"/g, '\\"')}"]`);
|
|
2091
|
+
if (!U) {
|
|
2092
2092
|
console.warn(
|
|
2093
|
-
`[LiveLayer] fill_form: no field "${
|
|
2093
|
+
`[LiveLayer] fill_form: no field "${z}" in form "${_}". Skipping.`
|
|
2094
2094
|
);
|
|
2095
2095
|
continue;
|
|
2096
2096
|
}
|
|
2097
|
-
if (!
|
|
2097
|
+
if (!Je(U)) {
|
|
2098
2098
|
console.warn(
|
|
2099
|
-
`[LiveLayer] fill_form: field "${
|
|
2099
|
+
`[LiveLayer] fill_form: field "${z}" is privacy-protected (password / cc-* / private). Skipping.`
|
|
2100
2100
|
);
|
|
2101
2101
|
continue;
|
|
2102
2102
|
}
|
|
2103
2103
|
try {
|
|
2104
|
-
|
|
2105
|
-
} catch (
|
|
2104
|
+
fr(U, B);
|
|
2105
|
+
} catch (j) {
|
|
2106
2106
|
console.warn(
|
|
2107
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2108
|
-
|
|
2107
|
+
`[LiveLayer] fill_form: failed to set "${z}".`,
|
|
2108
|
+
j
|
|
2109
2109
|
);
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
2112
|
return;
|
|
2113
2113
|
}
|
|
2114
2114
|
if (f.type === "submit_form") {
|
|
2115
|
-
if (!
|
|
2116
|
-
|
|
2115
|
+
if (!ce("submit_forms")) {
|
|
2116
|
+
se("submit_form", "submit_forms");
|
|
2117
2117
|
return;
|
|
2118
2118
|
}
|
|
2119
2119
|
if (typeof document > "u") return;
|
|
2120
|
-
const
|
|
2121
|
-
if (!
|
|
2120
|
+
const _ = typeof f.formId == "string" ? f.formId : null;
|
|
2121
|
+
if (!_) {
|
|
2122
2122
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2123
2123
|
return;
|
|
2124
2124
|
}
|
|
2125
|
-
const
|
|
2126
|
-
`[data-ll-form="${
|
|
2125
|
+
const A = document.querySelector(
|
|
2126
|
+
`[data-ll-form="${_.replace(/"/g, '\\"')}"]`
|
|
2127
2127
|
);
|
|
2128
|
-
if (!
|
|
2128
|
+
if (!A) {
|
|
2129
2129
|
console.warn(
|
|
2130
|
-
`[LiveLayer] submit_form: no form with data-ll-form="${
|
|
2130
|
+
`[LiveLayer] submit_form: no form with data-ll-form="${_}".`
|
|
2131
2131
|
);
|
|
2132
2132
|
return;
|
|
2133
2133
|
}
|
|
2134
|
-
if (
|
|
2134
|
+
if (A.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2135
2135
|
console.warn(
|
|
2136
2136
|
"[LiveLayer] submit_form: refusing to submit a form in a private subtree."
|
|
2137
2137
|
);
|
|
2138
2138
|
return;
|
|
2139
2139
|
}
|
|
2140
|
-
const
|
|
2141
|
-
const
|
|
2142
|
-
if (
|
|
2140
|
+
const T = typeof f.requestId == "string" ? f.requestId : void 0, z = (Ve = te.current) == null ? void 0 : Ve.call(te), B = (re) => {
|
|
2141
|
+
const he = z, Le = he == null ? void 0 : he.localParticipant;
|
|
2142
|
+
if (Le != null && Le.publishData)
|
|
2143
2143
|
try {
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2144
|
+
const en = T ? { ...re, requestId: T } : re, tn = new TextEncoder().encode(JSON.stringify(en));
|
|
2145
|
+
Le.publishData(tn, { reliable: !0 });
|
|
2146
2146
|
} catch {
|
|
2147
2147
|
}
|
|
2148
2148
|
};
|
|
2149
2149
|
let U = !1;
|
|
2150
2150
|
const j = () => {
|
|
2151
|
-
U = !0,
|
|
2151
|
+
U = !0, B({ type: "form_submitted", formId: _ });
|
|
2152
2152
|
};
|
|
2153
|
-
|
|
2153
|
+
A.addEventListener("submit", j, { once: !0 });
|
|
2154
2154
|
try {
|
|
2155
|
-
typeof
|
|
2156
|
-
} catch (
|
|
2157
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
2155
|
+
typeof A.requestSubmit == "function" ? A.requestSubmit() : A.submit();
|
|
2156
|
+
} catch (re) {
|
|
2157
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", re), A.removeEventListener("submit", j), B({
|
|
2158
2158
|
type: "form_submit_blocked",
|
|
2159
|
-
formId:
|
|
2159
|
+
formId: _,
|
|
2160
2160
|
reason: "exception"
|
|
2161
2161
|
});
|
|
2162
2162
|
return;
|
|
2163
2163
|
}
|
|
2164
2164
|
setTimeout(() => {
|
|
2165
|
-
U || (
|
|
2165
|
+
U || (A.removeEventListener("submit", j), B({
|
|
2166
2166
|
type: "form_submit_blocked",
|
|
2167
|
-
formId:
|
|
2167
|
+
formId: _,
|
|
2168
2168
|
reason: "validation"
|
|
2169
2169
|
}));
|
|
2170
2170
|
}, 500);
|
|
2171
2171
|
return;
|
|
2172
2172
|
}
|
|
2173
2173
|
if (f.type === "request_routes") {
|
|
2174
|
-
if (!
|
|
2175
|
-
|
|
2174
|
+
if (!ce("read_page")) {
|
|
2175
|
+
se("request_routes", "read_page");
|
|
2176
2176
|
return;
|
|
2177
2177
|
}
|
|
2178
|
-
const
|
|
2179
|
-
if (!(
|
|
2178
|
+
const _ = typeof f.requestId == "string" ? f.requestId : void 0, T = (kt = te.current) == null ? void 0 : kt.call(te), z = T == null ? void 0 : T.localParticipant;
|
|
2179
|
+
if (!(z != null && z.publishData)) return;
|
|
2180
2180
|
try {
|
|
2181
|
-
const
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
} catch (O) {
|
|
2186
|
-
console.warn("[LiveLayer] request_routes: extractRoutes threw.", O);
|
|
2181
|
+
const B = sr(), U = _ ? { type: "routes", routes: B, requestId: _ } : { type: "routes", routes: B }, j = new TextEncoder().encode(JSON.stringify(U));
|
|
2182
|
+
z.publishData(j, { reliable: !0 });
|
|
2183
|
+
} catch (B) {
|
|
2184
|
+
console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
|
|
2187
2185
|
}
|
|
2188
2186
|
return;
|
|
2189
2187
|
}
|
|
2190
|
-
|
|
2188
|
+
pr.has(f.type) || _e == null || _e(f);
|
|
2191
2189
|
}
|
|
2192
2190
|
},
|
|
2193
|
-
[
|
|
2194
|
-
), F =
|
|
2195
|
-
agentId:
|
|
2191
|
+
[_e, we]
|
|
2192
|
+
), F = sn({
|
|
2193
|
+
agentId: q ? "__controlled__" : Me,
|
|
2196
2194
|
baseUrl: i,
|
|
2197
2195
|
apiKey: r,
|
|
2198
2196
|
sessionEndpoint: o,
|
|
2199
2197
|
sessionBody: l,
|
|
2200
|
-
onDataMessage:
|
|
2198
|
+
onDataMessage: q ? void 0 : De
|
|
2201
2199
|
});
|
|
2202
|
-
|
|
2203
|
-
if (
|
|
2204
|
-
return
|
|
2205
|
-
}, [
|
|
2206
|
-
var
|
|
2207
|
-
return (
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2200
|
+
P(() => {
|
|
2201
|
+
if (q != null && q.subscribeToDataMessages)
|
|
2202
|
+
return q.subscribeToDataMessages(De);
|
|
2203
|
+
}, [q, De]), te.current = () => {
|
|
2204
|
+
var m;
|
|
2205
|
+
return (m = F.getRoom) == null ? void 0 : m.call(F);
|
|
2206
|
+
}, P(() => {
|
|
2207
|
+
var G;
|
|
2208
|
+
if (typeof window > "u") return;
|
|
2209
|
+
const m = ((G = window.location) == null ? void 0 : G.hostname) || "";
|
|
2210
|
+
if (m === "localhost" || m === "127.0.0.1" || m === "0.0.0.0" || m.endsWith(".local") || m.endsWith(".test"))
|
|
2211
|
+
return window.__livelayerSimulateCommand = (je) => {
|
|
2212
|
+
try {
|
|
2213
|
+
De(je);
|
|
2214
|
+
} catch (Ve) {
|
|
2215
|
+
console.warn("[LiveLayer] simulate-command threw:", Ve);
|
|
2216
|
+
}
|
|
2217
|
+
}, () => {
|
|
2218
|
+
delete window.__livelayerSimulateCommand;
|
|
2219
|
+
};
|
|
2220
|
+
}, [De]);
|
|
2221
|
+
const b = Ke(() => q ? {
|
|
2222
|
+
connectionState: q.connectionState,
|
|
2223
|
+
agentState: q.agentState,
|
|
2224
|
+
transcript: q.transcript,
|
|
2225
|
+
videoElement: q.videoElement,
|
|
2226
|
+
audioElement: q.audioElement,
|
|
2227
|
+
canResume: q.canResume,
|
|
2228
|
+
error: q.error,
|
|
2217
2229
|
agentConfig: null,
|
|
2218
2230
|
connect: async () => {
|
|
2219
|
-
await
|
|
2231
|
+
await q.onConnect();
|
|
2220
2232
|
},
|
|
2221
|
-
disconnect: () =>
|
|
2233
|
+
disconnect: () => q.onDisconnect(),
|
|
2222
2234
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
2223
2235
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
2224
2236
|
// so we reuse its reference for type consistency.
|
|
@@ -2237,197 +2249,199 @@ function ur(e) {
|
|
|
2237
2249
|
disconnect: F.disconnect,
|
|
2238
2250
|
getRoom: F.getRoom,
|
|
2239
2251
|
isControlled: !1
|
|
2240
|
-
}, [
|
|
2241
|
-
|
|
2242
|
-
const
|
|
2243
|
-
if (!(!
|
|
2244
|
-
return f.appendChild(
|
|
2245
|
-
|
|
2252
|
+
}, [q, F]), ft = M(null);
|
|
2253
|
+
P(() => {
|
|
2254
|
+
const m = b.videoElement, f = ft.current;
|
|
2255
|
+
if (!(!m || !f))
|
|
2256
|
+
return f.appendChild(m), () => {
|
|
2257
|
+
m.parentNode === f && f.removeChild(m);
|
|
2246
2258
|
};
|
|
2247
|
-
}, [b.videoElement]),
|
|
2248
|
-
const
|
|
2249
|
-
if (!
|
|
2250
|
-
|
|
2251
|
-
const f =
|
|
2252
|
-
return f && typeof f.catch == "function" && f.catch((
|
|
2253
|
-
(
|
|
2259
|
+
}, [b.videoElement]), P(() => {
|
|
2260
|
+
const m = b.audioElement;
|
|
2261
|
+
if (!m) return;
|
|
2262
|
+
le.attach(m);
|
|
2263
|
+
const f = m.play();
|
|
2264
|
+
return f && typeof f.catch == "function" && f.catch((G) => {
|
|
2265
|
+
(G == null ? void 0 : G.name) === "NotAllowedError" && ke(!0);
|
|
2254
2266
|
}), () => {
|
|
2255
|
-
|
|
2267
|
+
le.detach();
|
|
2256
2268
|
};
|
|
2257
|
-
}, [b.audioElement]),
|
|
2269
|
+
}, [b.audioElement]), P(() => {
|
|
2258
2270
|
if (b.isControlled || b.connectionState !== "connected") return;
|
|
2259
|
-
const
|
|
2260
|
-
if (
|
|
2261
|
-
return
|
|
2262
|
-
}),
|
|
2263
|
-
|
|
2271
|
+
const m = b.getRoom();
|
|
2272
|
+
if (m)
|
|
2273
|
+
return Y.setupMic(m).catch(() => {
|
|
2274
|
+
}), X.attachRoom(m), ae.attachRoom(m), Re.refresh(), () => {
|
|
2275
|
+
Y.teardownMic(), X.teardown(), ae.teardown();
|
|
2264
2276
|
};
|
|
2265
|
-
}, [b.isControlled, b.connectionState]),
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2268
|
-
}, [b.audioElement,
|
|
2269
|
-
const
|
|
2277
|
+
}, [b.isControlled, b.connectionState]), P(() => {
|
|
2278
|
+
const m = b.audioElement;
|
|
2279
|
+
m && (m.muted = et);
|
|
2280
|
+
}, [b.audioElement, et]);
|
|
2281
|
+
const Ft = x((m) => {
|
|
2270
2282
|
const f = b.getRoom();
|
|
2271
2283
|
if (f)
|
|
2272
2284
|
try {
|
|
2273
|
-
const
|
|
2274
|
-
JSON.stringify({ type: "user_message", text:
|
|
2285
|
+
const G = new TextEncoder().encode(
|
|
2286
|
+
JSON.stringify({ type: "user_message", text: m })
|
|
2275
2287
|
);
|
|
2276
|
-
f.localParticipant.publishData(
|
|
2288
|
+
f.localParticipant.publishData(G, { reliable: !0 });
|
|
2277
2289
|
} catch {
|
|
2278
2290
|
}
|
|
2279
|
-
}, [b]),
|
|
2280
|
-
|
|
2291
|
+
}, [b]), Wt = x(() => {
|
|
2292
|
+
Ut((m) => !m);
|
|
2281
2293
|
}, []);
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
}, [b.connectionState,
|
|
2285
|
-
|
|
2286
|
-
}, [b.transcript,
|
|
2287
|
-
|
|
2288
|
-
}, [b.agentState,
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2291
|
-
b.isControlled || !s ||
|
|
2292
|
-
}, [s, b.connectionState, b,
|
|
2293
|
-
const
|
|
2294
|
-
(
|
|
2295
|
-
const f =
|
|
2296
|
-
f && (
|
|
2294
|
+
P(() => {
|
|
2295
|
+
be == null || be(b.connectionState), b.connectionState === "connected" ? fe == null || fe() : b.connectionState === "disconnected" && (ge == null || ge());
|
|
2296
|
+
}, [b.connectionState, fe, ge, be]), P(() => {
|
|
2297
|
+
ye == null || ye(b.transcript);
|
|
2298
|
+
}, [b.transcript, ye]), P(() => {
|
|
2299
|
+
ve == null || ve(b.agentState);
|
|
2300
|
+
}, [b.agentState, ve]);
|
|
2301
|
+
const pt = M(!1);
|
|
2302
|
+
P(() => {
|
|
2303
|
+
b.isControlled || !s || pt.current || Ie && b.connectionState === "idle" && (pt.current = !0, b.connect());
|
|
2304
|
+
}, [s, b.connectionState, b, Ie]);
|
|
2305
|
+
const jt = x(
|
|
2306
|
+
(m) => {
|
|
2307
|
+
const f = L == null ? void 0 : L.find((G) => G.id === m);
|
|
2308
|
+
f && (W(!1), m !== ee && (Pe(!0), b.disconnect(), ie || xe(m), H == null || H(f)));
|
|
2297
2309
|
},
|
|
2298
2310
|
[
|
|
2299
|
-
|
|
2300
|
-
|
|
2311
|
+
L,
|
|
2312
|
+
ee,
|
|
2301
2313
|
b,
|
|
2302
|
-
|
|
2303
|
-
|
|
2314
|
+
ie,
|
|
2315
|
+
H
|
|
2304
2316
|
]
|
|
2305
2317
|
);
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
}, [b.connectionState,
|
|
2318
|
+
P(() => {
|
|
2319
|
+
Te && b.connectionState === "connected" && Pe(!1);
|
|
2320
|
+
}, [b.connectionState, Te]), P(() => {
|
|
2309
2321
|
if (!h) return;
|
|
2310
|
-
const
|
|
2311
|
-
f.key === "Escape" &&
|
|
2322
|
+
const m = (f) => {
|
|
2323
|
+
f.key === "Escape" && W(!1);
|
|
2312
2324
|
};
|
|
2313
|
-
return window.addEventListener("keydown",
|
|
2325
|
+
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
2314
2326
|
}, [h]);
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2327
|
+
const Vt = !!I || !!(V != null && V.avatarImageUrl) || b.isControlled, $e = gn(Me, i, Vt);
|
|
2328
|
+
Ne === void 0 && ((gt = $e.info) != null && gt.capabilities) && (ot.current = $e.info.capabilities);
|
|
2329
|
+
const lt = (V == null ? void 0 : V.name) ?? D ?? ((yt = b.agentConfig) == null ? void 0 : yt.name) ?? ((vt = $e.info) == null ? void 0 : vt.name) ?? "Live Layer", ht = (V == null ? void 0 : V.avatarImageUrl) ?? I ?? ((bt = b.agentConfig) == null ? void 0 : bt.avatarImageUrl) ?? ((wt = $e.info) == null ? void 0 : wt.avatarImageUrl) ?? null, Yt = R ?? ((_t = b.agentConfig) == null ? void 0 : _t.idleLoopUrl) ?? ((xt = $e.info) == null ? void 0 : xt.idleLoopUrl) ?? null, Gt = $ ?? null, Kt = x(() => K("expanded"), [K]), Xt = x(
|
|
2330
|
+
() => K("minimized"),
|
|
2331
|
+
[K]
|
|
2332
|
+
), mt = x(() => {
|
|
2333
|
+
b.disconnect(), K("hidden");
|
|
2334
|
+
}, [b, K]), Jt = x(() => {
|
|
2335
|
+
const m = b.audioElement;
|
|
2336
|
+
m && m.play().then(() => ke(!1)).catch(() => {
|
|
2323
2337
|
});
|
|
2324
|
-
}, [b.audioElement]),
|
|
2325
|
-
|
|
2326
|
-
}, [b]),
|
|
2327
|
-
...
|
|
2328
|
-
zIndex:
|
|
2338
|
+
}, [b.audioElement]), Qt = x(() => {
|
|
2339
|
+
ke(!1), b.connect();
|
|
2340
|
+
}, [b]), ze = {
|
|
2341
|
+
...Fe,
|
|
2342
|
+
zIndex: We
|
|
2329
2343
|
};
|
|
2330
|
-
|
|
2331
|
-
const
|
|
2344
|
+
g.primaryColor && (ze["--ll-color-primary"] = g.primaryColor), g.accentColor && (ze["--ll-color-accent"] = g.accentColor), g.backgroundColor && (ze["--ll-color-bg"] = g.backgroundColor), g.textColor && (ze["--ll-color-fg"] = g.textColor);
|
|
2345
|
+
const Zt = [
|
|
2332
2346
|
"ll-widget",
|
|
2333
|
-
`ll-widget--${
|
|
2347
|
+
`ll-widget--${oe}`,
|
|
2334
2348
|
`ll-widget--${ne ? "mobile" : "desktop"}`,
|
|
2335
|
-
|
|
2349
|
+
Qe
|
|
2336
2350
|
].filter(Boolean).join(" ");
|
|
2337
|
-
return
|
|
2351
|
+
return Ie ? /* @__PURE__ */ k(
|
|
2338
2352
|
"div",
|
|
2339
2353
|
{
|
|
2340
|
-
className:
|
|
2341
|
-
style:
|
|
2342
|
-
"data-display-mode":
|
|
2354
|
+
className: Zt,
|
|
2355
|
+
style: ze,
|
|
2356
|
+
"data-display-mode": oe,
|
|
2343
2357
|
"data-position": p,
|
|
2344
2358
|
children: [
|
|
2345
|
-
|
|
2346
|
-
|
|
2359
|
+
oe === "hidden" && /* @__PURE__ */ n(
|
|
2360
|
+
qn,
|
|
2347
2361
|
{
|
|
2348
2362
|
position: p,
|
|
2349
2363
|
isMobile: ne,
|
|
2350
2364
|
isSpeaking: b.agentState === "speaking",
|
|
2351
|
-
onExpand: () =>
|
|
2352
|
-
label: `Open ${
|
|
2365
|
+
onExpand: () => K("expanded"),
|
|
2366
|
+
label: `Open ${lt} widget`
|
|
2353
2367
|
}
|
|
2354
2368
|
),
|
|
2355
|
-
|
|
2356
|
-
|
|
2369
|
+
oe === "minimized" && /* @__PURE__ */ n(
|
|
2370
|
+
Un,
|
|
2357
2371
|
{
|
|
2358
2372
|
position: p,
|
|
2359
2373
|
isMobile: ne,
|
|
2360
|
-
agentName:
|
|
2361
|
-
avatarImageUrl:
|
|
2374
|
+
agentName: lt,
|
|
2375
|
+
avatarImageUrl: ht,
|
|
2362
2376
|
agentState: b.agentState,
|
|
2363
|
-
isMuted:
|
|
2364
|
-
audioLevel:
|
|
2365
|
-
onExpand:
|
|
2366
|
-
onToggleMute:
|
|
2367
|
-
onClose:
|
|
2377
|
+
isMuted: Y.isMuted,
|
|
2378
|
+
audioLevel: le,
|
|
2379
|
+
onExpand: Kt,
|
|
2380
|
+
onToggleMute: Y.toggleMute,
|
|
2381
|
+
onClose: mt
|
|
2368
2382
|
}
|
|
2369
2383
|
),
|
|
2370
|
-
|
|
2371
|
-
|
|
2384
|
+
oe === "expanded" && /* @__PURE__ */ n(
|
|
2385
|
+
Wn,
|
|
2372
2386
|
{
|
|
2373
2387
|
position: p,
|
|
2374
2388
|
isMobile: ne,
|
|
2375
|
-
agentName:
|
|
2376
|
-
avatarImageUrl:
|
|
2377
|
-
idleLoopUrl:
|
|
2378
|
-
greeting:
|
|
2379
|
-
branding:
|
|
2380
|
-
teamMembers:
|
|
2381
|
-
currentTeamMemberId:
|
|
2382
|
-
isSwitchingTeamMember:
|
|
2389
|
+
agentName: lt,
|
|
2390
|
+
avatarImageUrl: ht,
|
|
2391
|
+
idleLoopUrl: Yt,
|
|
2392
|
+
greeting: Gt,
|
|
2393
|
+
branding: g,
|
|
2394
|
+
teamMembers: L,
|
|
2395
|
+
currentTeamMemberId: ee,
|
|
2396
|
+
isSwitchingTeamMember: Te,
|
|
2383
2397
|
teamSwitcherOpen: h,
|
|
2384
|
-
onToggleTeamSwitcher: () =>
|
|
2385
|
-
onSelectTeamMember:
|
|
2398
|
+
onToggleTeamSwitcher: () => W((m) => !m),
|
|
2399
|
+
onSelectTeamMember: jt,
|
|
2386
2400
|
connectionState: b.connectionState,
|
|
2387
2401
|
agentState: b.agentState,
|
|
2388
2402
|
transcript: b.transcript,
|
|
2389
|
-
isMuted:
|
|
2390
|
-
micDevices:
|
|
2391
|
-
isCameraEnabled:
|
|
2392
|
-
cameraPreviewEl:
|
|
2393
|
-
cameraDevices:
|
|
2394
|
-
activeCameraId:
|
|
2395
|
-
isScreenShareEnabled:
|
|
2396
|
-
screenPreviewEl:
|
|
2397
|
-
isSpeakerMuted:
|
|
2398
|
-
allowCamera:
|
|
2399
|
-
allowScreenShare:
|
|
2403
|
+
isMuted: Y.isMuted,
|
|
2404
|
+
micDevices: Re.mics,
|
|
2405
|
+
isCameraEnabled: X.isEnabled,
|
|
2406
|
+
cameraPreviewEl: X.previewEl,
|
|
2407
|
+
cameraDevices: Re.cameras,
|
|
2408
|
+
activeCameraId: X.activeDeviceId,
|
|
2409
|
+
isScreenShareEnabled: ae.isEnabled,
|
|
2410
|
+
screenPreviewEl: ae.previewEl,
|
|
2411
|
+
isSpeakerMuted: et,
|
|
2412
|
+
allowCamera: v,
|
|
2413
|
+
allowScreenShare: E,
|
|
2400
2414
|
allowTyping: w,
|
|
2401
|
-
languageMenuOpen:
|
|
2402
|
-
onToggleLanguageMenu: () =>
|
|
2403
|
-
needsUserGesture:
|
|
2415
|
+
languageMenuOpen: st,
|
|
2416
|
+
onToggleLanguageMenu: () => Bt((m) => !m),
|
|
2417
|
+
needsUserGesture: Ze,
|
|
2404
2418
|
canResume: b.canResume,
|
|
2405
|
-
micError:
|
|
2419
|
+
micError: Y.micError,
|
|
2406
2420
|
error: b.error,
|
|
2407
|
-
avatarVideoContainerRef:
|
|
2421
|
+
avatarVideoContainerRef: ft,
|
|
2408
2422
|
onConnect: () => void b.connect(),
|
|
2409
2423
|
onDisconnect: () => b.disconnect(),
|
|
2410
|
-
onRetry:
|
|
2411
|
-
onResumeAudio:
|
|
2412
|
-
onToggleMute:
|
|
2413
|
-
onToggleCamera: () => void
|
|
2414
|
-
onSwitchCameraDevice: (
|
|
2415
|
-
onToggleScreenShare: () => void
|
|
2416
|
-
onToggleSpeaker:
|
|
2417
|
-
onSendMessage:
|
|
2418
|
-
onMinimize:
|
|
2419
|
-
onClose:
|
|
2420
|
-
onClearMicError:
|
|
2424
|
+
onRetry: Qt,
|
|
2425
|
+
onResumeAudio: Jt,
|
|
2426
|
+
onToggleMute: Y.toggleMute,
|
|
2427
|
+
onToggleCamera: () => void X.toggle(),
|
|
2428
|
+
onSwitchCameraDevice: (m) => void X.switchDevice(m),
|
|
2429
|
+
onToggleScreenShare: () => void ae.toggle(),
|
|
2430
|
+
onToggleSpeaker: Wt,
|
|
2431
|
+
onSendMessage: Ft,
|
|
2432
|
+
onMinimize: Xt,
|
|
2433
|
+
onClose: mt,
|
|
2434
|
+
onClearMicError: Y.clearError
|
|
2421
2435
|
}
|
|
2422
2436
|
)
|
|
2423
2437
|
]
|
|
2424
2438
|
}
|
|
2425
2439
|
) : null;
|
|
2426
2440
|
}
|
|
2427
|
-
function
|
|
2428
|
-
return /* @__PURE__ */ n(
|
|
2441
|
+
function wr(e) {
|
|
2442
|
+
return /* @__PURE__ */ n(cn, { children: /* @__PURE__ */ n(hr, { ...e }) });
|
|
2429
2443
|
}
|
|
2430
|
-
const
|
|
2444
|
+
const _r = ({
|
|
2431
2445
|
agentId: e,
|
|
2432
2446
|
baseUrl: t,
|
|
2433
2447
|
apiKey: r,
|
|
@@ -2436,26 +2450,26 @@ const vr = ({
|
|
|
2436
2450
|
className: l,
|
|
2437
2451
|
style: s
|
|
2438
2452
|
}) => {
|
|
2439
|
-
const d =
|
|
2440
|
-
|
|
2441
|
-
const p =
|
|
2442
|
-
var
|
|
2453
|
+
const d = M(null), u = M(null), y = M(o);
|
|
2454
|
+
y.current = o;
|
|
2455
|
+
const p = x((a) => {
|
|
2456
|
+
var S;
|
|
2443
2457
|
const c = a.detail;
|
|
2444
|
-
(
|
|
2458
|
+
(S = y.current) == null || S.call(y, c);
|
|
2445
2459
|
}, []);
|
|
2446
|
-
return
|
|
2460
|
+
return P(() => {
|
|
2447
2461
|
const a = d.current;
|
|
2448
2462
|
if (!a) return;
|
|
2449
2463
|
const c = document.createElement("livelayer-widget");
|
|
2450
2464
|
return c.setAttribute("agent-id", e), t && c.setAttribute("base-url", t), r && c.setAttribute("api-key", r), i && c.setAttribute("mode", i), c.addEventListener("agent-event", p), a.appendChild(c), u.current = c, () => {
|
|
2451
2465
|
c.removeEventListener("agent-event", p), a.removeChild(c), u.current = null;
|
|
2452
2466
|
};
|
|
2453
|
-
}, [e]),
|
|
2467
|
+
}, [e]), P(() => {
|
|
2454
2468
|
u.current && (i ? u.current.setAttribute("mode", i) : u.current.removeAttribute("mode"));
|
|
2455
2469
|
}, [i]), /* @__PURE__ */ n("div", { ref: d, className: l, style: s });
|
|
2456
|
-
},
|
|
2470
|
+
}, xr = at(
|
|
2457
2471
|
function({ id: t, intent: r, as: i = "div", className: o, style: l, children: s }, d) {
|
|
2458
|
-
return
|
|
2472
|
+
return rn(
|
|
2459
2473
|
i,
|
|
2460
2474
|
{
|
|
2461
2475
|
ref: d,
|
|
@@ -2467,7 +2481,7 @@ const vr = ({
|
|
|
2467
2481
|
s
|
|
2468
2482
|
);
|
|
2469
2483
|
}
|
|
2470
|
-
),
|
|
2484
|
+
), kr = at(
|
|
2471
2485
|
function({ id: t, intent: r, children: i, ...o }, l) {
|
|
2472
2486
|
return /* @__PURE__ */ n(
|
|
2473
2487
|
"form",
|
|
@@ -2480,12 +2494,12 @@ const vr = ({
|
|
|
2480
2494
|
}
|
|
2481
2495
|
);
|
|
2482
2496
|
}
|
|
2483
|
-
),
|
|
2497
|
+
), Lr = at(
|
|
2484
2498
|
function(t, r) {
|
|
2485
2499
|
const { name: i, label: o, labelClassName: l } = t, s = { name: i, "data-ll-field": i };
|
|
2486
2500
|
let d;
|
|
2487
2501
|
if ("as" in t && t.as === "textarea") {
|
|
2488
|
-
const { name: u, label:
|
|
2502
|
+
const { name: u, label: y, labelClassName: p, as: a, ...c } = t;
|
|
2489
2503
|
d = /* @__PURE__ */ n(
|
|
2490
2504
|
"textarea",
|
|
2491
2505
|
{
|
|
@@ -2495,18 +2509,18 @@ const vr = ({
|
|
|
2495
2509
|
}
|
|
2496
2510
|
);
|
|
2497
2511
|
} else if ("as" in t && t.as === "select") {
|
|
2498
|
-
const { name: u, label:
|
|
2512
|
+
const { name: u, label: y, labelClassName: p, as: a, children: c, ...S } = t;
|
|
2499
2513
|
d = /* @__PURE__ */ n(
|
|
2500
2514
|
"select",
|
|
2501
2515
|
{
|
|
2502
2516
|
ref: r,
|
|
2503
2517
|
...s,
|
|
2504
|
-
...
|
|
2518
|
+
...S,
|
|
2505
2519
|
children: c
|
|
2506
2520
|
}
|
|
2507
2521
|
);
|
|
2508
2522
|
} else {
|
|
2509
|
-
const { name: u, label:
|
|
2523
|
+
const { name: u, label: y, labelClassName: p, as: a, ...c } = t;
|
|
2510
2524
|
d = /* @__PURE__ */ n(
|
|
2511
2525
|
"input",
|
|
2512
2526
|
{
|
|
@@ -2516,14 +2530,14 @@ const vr = ({
|
|
|
2516
2530
|
}
|
|
2517
2531
|
);
|
|
2518
2532
|
}
|
|
2519
|
-
return o === void 0 ? d : /* @__PURE__ */
|
|
2533
|
+
return o === void 0 ? d : /* @__PURE__ */ k("label", { className: l, children: [
|
|
2520
2534
|
o,
|
|
2521
2535
|
d
|
|
2522
2536
|
] });
|
|
2523
2537
|
}
|
|
2524
2538
|
);
|
|
2525
|
-
function
|
|
2526
|
-
const [e, t] =
|
|
2539
|
+
function Er() {
|
|
2540
|
+
const [e, t] = C([]), r = x((o) => {
|
|
2527
2541
|
t((l) => {
|
|
2528
2542
|
const s = l.findIndex((d) => d.id === o.id);
|
|
2529
2543
|
if (s >= 0) {
|
|
@@ -2532,7 +2546,7 @@ function xr() {
|
|
|
2532
2546
|
}
|
|
2533
2547
|
return [...l, o];
|
|
2534
2548
|
});
|
|
2535
|
-
}, []), i =
|
|
2549
|
+
}, []), i = x(() => t([]), []);
|
|
2536
2550
|
return {
|
|
2537
2551
|
entries: e,
|
|
2538
2552
|
pushSegment: r,
|
|
@@ -2541,31 +2555,31 @@ function xr() {
|
|
|
2541
2555
|
};
|
|
2542
2556
|
}
|
|
2543
2557
|
export {
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2558
|
+
wr as AvatarWidget,
|
|
2559
|
+
cn as ErrorBoundary,
|
|
2560
|
+
Lr as LiveLayerField,
|
|
2561
|
+
kr as LiveLayerForm,
|
|
2562
|
+
xr as LiveLayerRegion,
|
|
2563
|
+
_r as LiveLayerWidget,
|
|
2564
|
+
ir as clearPageContextCache,
|
|
2565
|
+
dr as clearRoutesCache,
|
|
2566
|
+
rr as extractPageContext,
|
|
2567
|
+
ar as extractRoutes,
|
|
2568
|
+
zt as getCachedPageContext,
|
|
2569
|
+
sr as getCachedRoutes,
|
|
2570
|
+
Mn as matchesPattern,
|
|
2571
|
+
Rn as shouldRenderAtPath,
|
|
2572
|
+
gn as useAgentInfo,
|
|
2573
|
+
dn as useAudioLevel,
|
|
2574
|
+
pn as useCameraState,
|
|
2575
|
+
bn as useDisplayMode,
|
|
2576
|
+
xn as useDisplayModePersistence,
|
|
2577
|
+
Ln as useIsMobile,
|
|
2578
|
+
sn as useLiveKitSession,
|
|
2579
|
+
mn as useMediaDevices,
|
|
2580
|
+
un as useMicrophoneState,
|
|
2581
|
+
Cn as usePathname,
|
|
2582
|
+
Tn as useRouteMatch,
|
|
2583
|
+
hn as useScreenShareState,
|
|
2584
|
+
Er as useTranscript
|
|
2571
2585
|
};
|