@livelayer/react 0.9.5 → 0.9.6
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 +16 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +1318 -1284
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as In, useState as
|
|
2
|
+
import { jsxs as v, jsx as n, Fragment as ot } from "react/jsx-runtime";
|
|
3
|
+
import { Component as In, useState as C, useRef as A, useEffect as I, useCallback as E, useMemo as Ue, useLayoutEffect as Mn, forwardRef as lt, useImperativeHandle as Tn, createElement as Dn } from "react";
|
|
4
4
|
import { LiveKitSession as Pn } from "@livelayer/sdk";
|
|
5
5
|
import { createLocalAudioTrack as $n, Track as dn, createLocalVideoTrack as zn } from "livekit-client";
|
|
6
6
|
import { createPortal as On } from "react-dom";
|
|
@@ -14,12 +14,12 @@ class Hn extends In {
|
|
|
14
14
|
return { hasError: !0, error: t };
|
|
15
15
|
}
|
|
16
16
|
componentDidCatch(t, r) {
|
|
17
|
-
var
|
|
18
|
-
(
|
|
17
|
+
var i, o;
|
|
18
|
+
(o = (i = this.props).onError) == null || o.call(i, t, r);
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
21
|
var t;
|
|
22
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
22
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ v("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
23
23
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
24
24
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
25
25
|
/* @__PURE__ */ n(
|
|
@@ -35,25 +35,25 @@ class Hn extends In {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
function Wn(e) {
|
|
38
|
-
const [t, r] =
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
onConnectionStateChange: (
|
|
42
|
-
r(
|
|
38
|
+
const [t, r] = C("idle"), [i, o] = C("idle"), [l, s] = C([]), [a, d] = C(null), [f, _] = C(null), [u, c] = C(null), [R, L] = C(!1), [b, y] = C(null), m = A(null), S = A(e.onDataMessage);
|
|
39
|
+
S.current = e.onDataMessage, I(() => {
|
|
40
|
+
const T = {
|
|
41
|
+
onConnectionStateChange: (q) => {
|
|
42
|
+
r(q), q === "connected" && y(null);
|
|
43
43
|
},
|
|
44
|
-
onAgentStateChange:
|
|
45
|
-
onTranscript: (
|
|
46
|
-
onAgentConfig:
|
|
47
|
-
onAudioTrack: (
|
|
48
|
-
onVideoTrack: (
|
|
49
|
-
onVideoTrackRemoved: () =>
|
|
50
|
-
onError: (
|
|
51
|
-
onDataMessage: (
|
|
52
|
-
var
|
|
53
|
-
(
|
|
44
|
+
onAgentStateChange: o,
|
|
45
|
+
onTranscript: (q) => s([...q]),
|
|
46
|
+
onAgentConfig: d,
|
|
47
|
+
onAudioTrack: (q) => c(q),
|
|
48
|
+
onVideoTrack: (q) => _(q),
|
|
49
|
+
onVideoTrackRemoved: () => _(null),
|
|
50
|
+
onError: (q) => y(q),
|
|
51
|
+
onDataMessage: (q) => {
|
|
52
|
+
var N;
|
|
53
|
+
(N = S.current) == null || N.call(S, q);
|
|
54
54
|
},
|
|
55
|
-
onResumabilityChange:
|
|
56
|
-
},
|
|
55
|
+
onResumabilityChange: L
|
|
56
|
+
}, B = new Pn(
|
|
57
57
|
{
|
|
58
58
|
agentId: e.agentId,
|
|
59
59
|
baseUrl: e.baseUrl,
|
|
@@ -61,11 +61,11 @@ function Wn(e) {
|
|
|
61
61
|
sessionEndpoint: e.sessionEndpoint,
|
|
62
62
|
sessionBody: e.sessionBody
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
T
|
|
65
65
|
);
|
|
66
|
-
return
|
|
67
|
-
var
|
|
68
|
-
(
|
|
66
|
+
return m.current = B, r("idle"), o("idle"), s([]), d(null), _(null), c(null), L(!1), y(null), () => {
|
|
67
|
+
var q;
|
|
68
|
+
(q = B.destroy) == null || q.call(B), m.current = null;
|
|
69
69
|
};
|
|
70
70
|
}, [
|
|
71
71
|
e.agentId,
|
|
@@ -74,65 +74,65 @@ function Wn(e) {
|
|
|
74
74
|
e.sessionEndpoint,
|
|
75
75
|
JSON.stringify(e.sessionBody ?? {})
|
|
76
76
|
]);
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
77
|
+
const D = E(async () => {
|
|
78
|
+
const T = m.current;
|
|
79
|
+
if (T)
|
|
80
80
|
try {
|
|
81
|
-
await
|
|
82
|
-
} catch (
|
|
83
|
-
throw
|
|
81
|
+
await T.connect();
|
|
82
|
+
} catch (B) {
|
|
83
|
+
throw y(B instanceof Error ? B.message : String(B)), B;
|
|
84
84
|
}
|
|
85
|
-
}, []), z =
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
}, []),
|
|
89
|
-
var
|
|
90
|
-
return ((
|
|
85
|
+
}, []), z = E(() => {
|
|
86
|
+
const T = m.current;
|
|
87
|
+
T && T.disconnect();
|
|
88
|
+
}, []), x = E(() => {
|
|
89
|
+
var T;
|
|
90
|
+
return ((T = m.current) == null ? void 0 : T.getRoom()) ?? null;
|
|
91
91
|
}, []);
|
|
92
92
|
return {
|
|
93
93
|
connectionState: t,
|
|
94
|
-
agentState:
|
|
94
|
+
agentState: i,
|
|
95
95
|
transcript: l,
|
|
96
|
-
agentConfig:
|
|
96
|
+
agentConfig: a,
|
|
97
97
|
videoElement: f,
|
|
98
|
-
audioElement:
|
|
99
|
-
canResume:
|
|
100
|
-
error:
|
|
101
|
-
connect:
|
|
98
|
+
audioElement: u,
|
|
99
|
+
canResume: R,
|
|
100
|
+
error: b,
|
|
101
|
+
connect: D,
|
|
102
102
|
disconnect: z,
|
|
103
|
-
getRoom:
|
|
104
|
-
session:
|
|
103
|
+
getRoom: x,
|
|
104
|
+
session: m.current
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
function Bn() {
|
|
108
|
-
const e =
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
111
|
-
|
|
108
|
+
const e = A(null), t = A(null), r = A(null), i = A(null), o = A(/* @__PURE__ */ new Set()), l = A(null), s = E(() => {
|
|
109
|
+
const u = t.current;
|
|
110
|
+
if (!u) {
|
|
111
|
+
i.current = null;
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
(!l.current || l.current.length !==
|
|
115
|
-
new ArrayBuffer(
|
|
114
|
+
(!l.current || l.current.length !== u.frequencyBinCount) && (l.current = new Uint8Array(
|
|
115
|
+
new ArrayBuffer(u.frequencyBinCount)
|
|
116
116
|
));
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
let
|
|
120
|
-
for (let
|
|
121
|
-
const
|
|
122
|
-
for (const
|
|
117
|
+
const c = l.current;
|
|
118
|
+
u.getByteFrequencyData(c);
|
|
119
|
+
let R = 0;
|
|
120
|
+
for (let b = 0; b < c.length; b++) R += c[b];
|
|
121
|
+
const L = R / c.length / 255;
|
|
122
|
+
for (const b of o.current)
|
|
123
123
|
try {
|
|
124
|
-
|
|
125
|
-
} catch (
|
|
126
|
-
console.error("[useAudioLevel] subscriber threw:",
|
|
124
|
+
b(L);
|
|
125
|
+
} catch (y) {
|
|
126
|
+
console.error("[useAudioLevel] subscriber threw:", y);
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
}, []),
|
|
128
|
+
i.current = requestAnimationFrame(s);
|
|
129
|
+
}, []), a = E(() => {
|
|
130
130
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
}, []),
|
|
134
|
-
(
|
|
135
|
-
if (
|
|
131
|
+
const u = new AudioContext(), c = u.createAnalyser();
|
|
132
|
+
c.fftSize = 64, c.connect(u.destination), e.current = u, t.current = c;
|
|
133
|
+
}, []), d = E(
|
|
134
|
+
(u) => {
|
|
135
|
+
if (a(), !(!e.current || !t.current)) {
|
|
136
136
|
if (r.current) {
|
|
137
137
|
try {
|
|
138
138
|
r.current.disconnect();
|
|
@@ -141,28 +141,28 @@ function Bn() {
|
|
|
141
141
|
r.current = null;
|
|
142
142
|
}
|
|
143
143
|
try {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
} catch (
|
|
147
|
-
console.warn("[useAudioLevel] createMediaElementSource failed:",
|
|
144
|
+
const c = e.current.createMediaElementSource(u);
|
|
145
|
+
c.connect(t.current), r.current = c;
|
|
146
|
+
} catch (c) {
|
|
147
|
+
console.warn("[useAudioLevel] createMediaElementSource failed:", c);
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
|
|
150
|
+
i.current === null && (i.current = requestAnimationFrame(s));
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
[
|
|
154
|
-
), f =
|
|
155
|
-
if (
|
|
153
|
+
[a, s]
|
|
154
|
+
), f = E(() => {
|
|
155
|
+
if (i.current !== null && (cancelAnimationFrame(i.current), i.current = null), r.current) {
|
|
156
156
|
try {
|
|
157
157
|
r.current.disconnect();
|
|
158
158
|
} catch {
|
|
159
159
|
}
|
|
160
160
|
r.current = null;
|
|
161
161
|
}
|
|
162
|
-
}, []),
|
|
163
|
-
|
|
162
|
+
}, []), _ = E((u) => (o.current.add(u), () => {
|
|
163
|
+
o.current.delete(u);
|
|
164
164
|
}), []);
|
|
165
|
-
return
|
|
165
|
+
return I(() => () => {
|
|
166
166
|
if (f(), t.current) {
|
|
167
167
|
try {
|
|
168
168
|
t.current.disconnect();
|
|
@@ -177,139 +177,167 @@ function Bn() {
|
|
|
177
177
|
}
|
|
178
178
|
e.current = null;
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
}, [f]), { attach:
|
|
180
|
+
o.current.clear(), l.current = null;
|
|
181
|
+
}, [f]), { attach: d, detach: f, subscribe: _ };
|
|
182
182
|
}
|
|
183
183
|
function qn() {
|
|
184
|
-
const [e, t] =
|
|
185
|
-
|
|
184
|
+
const [e, t] = C(!1), [r, i] = C(""), [o, l] = C(null), s = A(null), a = A(null), d = E(async (L) => {
|
|
185
|
+
var b, y;
|
|
186
|
+
if (s.current && a.current) {
|
|
186
187
|
try {
|
|
187
|
-
await
|
|
188
|
+
await a.current.localParticipant.unpublishTrack(s.current);
|
|
188
189
|
} catch {
|
|
189
190
|
}
|
|
190
|
-
|
|
191
|
+
s.current.stop(), s.current = null;
|
|
191
192
|
}
|
|
192
|
-
|
|
193
|
+
a.current = L, l(null);
|
|
193
194
|
try {
|
|
194
|
-
const
|
|
195
|
+
const m = await $n({
|
|
195
196
|
echoCancellation: !0,
|
|
196
197
|
noiseSuppression: !0
|
|
197
198
|
});
|
|
198
|
-
await
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
await L.localParticipant.publishTrack(m), s.current = m, t(m.isMuted);
|
|
200
|
+
const S = (y = (b = m.mediaStreamTrack) == null ? void 0 : b.getSettings) == null ? void 0 : y.call(b);
|
|
201
|
+
S != null && S.deviceId && i(S.deviceId);
|
|
202
|
+
} catch (m) {
|
|
203
|
+
const S = m instanceof Error && m.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
204
|
+
throw l(S), m;
|
|
202
205
|
}
|
|
203
|
-
}, []),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (h && a) {
|
|
206
|
+
}, []), f = E((L) => {
|
|
207
|
+
a.current = L;
|
|
208
|
+
}, []), _ = E(async (L) => {
|
|
209
|
+
const b = a.current;
|
|
210
|
+
if (b)
|
|
209
211
|
try {
|
|
210
|
-
|
|
212
|
+
await b.switchActiveDevice("audioinput", L), i(L);
|
|
213
|
+
} catch (y) {
|
|
214
|
+
console.warn("[useMicrophoneState] switchDevice failed:", y);
|
|
215
|
+
}
|
|
216
|
+
}, []), u = E(() => {
|
|
217
|
+
const L = s.current, b = a.current;
|
|
218
|
+
if (L) {
|
|
219
|
+
L.isMuted ? (L.unmute(), t(!1)) : (L.mute(), t(!0));
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (b) {
|
|
223
|
+
const y = !e;
|
|
224
|
+
t(y);
|
|
225
|
+
try {
|
|
226
|
+
b.localParticipant.setMicrophoneEnabled(!y);
|
|
227
|
+
} catch (m) {
|
|
228
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", m);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, [e]), c = E(() => {
|
|
232
|
+
const L = s.current, b = a.current;
|
|
233
|
+
if (L && b) {
|
|
234
|
+
try {
|
|
235
|
+
b.localParticipant.unpublishTrack(L);
|
|
211
236
|
} catch {
|
|
212
237
|
}
|
|
213
|
-
|
|
238
|
+
L.stop();
|
|
214
239
|
}
|
|
215
|
-
|
|
216
|
-
}, []),
|
|
240
|
+
s.current = null, a.current = null, t(!1), i("");
|
|
241
|
+
}, []), R = E(() => l(null), []);
|
|
217
242
|
return {
|
|
218
243
|
isMuted: e,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
244
|
+
activeDeviceId: r,
|
|
245
|
+
micError: o,
|
|
246
|
+
toggleMute: u,
|
|
247
|
+
setupMic: d,
|
|
248
|
+
attachRoom: f,
|
|
249
|
+
switchDevice: _,
|
|
222
250
|
teardownMic: c,
|
|
223
|
-
clearError:
|
|
251
|
+
clearError: R
|
|
224
252
|
};
|
|
225
253
|
}
|
|
226
254
|
const Fn = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
227
255
|
function Un() {
|
|
228
|
-
const [e, t] =
|
|
229
|
-
|
|
230
|
-
}, []),
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
256
|
+
const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), [s, a] = C(""), d = A(null), f = A(null), _ = E((m) => {
|
|
257
|
+
d.current = m;
|
|
258
|
+
}, []), u = E(() => {
|
|
259
|
+
const m = d.current, S = f.current;
|
|
260
|
+
if (S && m) {
|
|
261
|
+
const D = m.localParticipant.getTrackPublication(dn.Source.Camera);
|
|
262
|
+
if (D != null && D.track) {
|
|
235
263
|
try {
|
|
236
|
-
|
|
264
|
+
m.localParticipant.unpublishTrack(D.track);
|
|
237
265
|
} catch {
|
|
238
266
|
}
|
|
239
|
-
|
|
267
|
+
D.track.stop();
|
|
240
268
|
} else
|
|
241
|
-
|
|
269
|
+
S.stop();
|
|
242
270
|
}
|
|
243
271
|
f.current = null, l(null), t(!1);
|
|
244
|
-
}, []),
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
247
|
-
|
|
272
|
+
}, []), c = E(async (m) => {
|
|
273
|
+
const S = d.current;
|
|
274
|
+
if (S) {
|
|
275
|
+
i(null);
|
|
248
276
|
try {
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const z = await zn(
|
|
252
|
-
await
|
|
253
|
-
const
|
|
254
|
-
l(
|
|
277
|
+
const D = { ...Fn };
|
|
278
|
+
m && (D.deviceId = m);
|
|
279
|
+
const z = await zn(D);
|
|
280
|
+
await S.localParticipant.publishTrack(z), f.current = z;
|
|
281
|
+
const x = z.attach();
|
|
282
|
+
l(x), t(!0), m && a(m);
|
|
255
283
|
try {
|
|
256
|
-
|
|
284
|
+
S.localParticipant.publishData(
|
|
257
285
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
258
286
|
{ reliable: !0 }
|
|
259
287
|
);
|
|
260
288
|
} catch {
|
|
261
289
|
}
|
|
262
|
-
} catch (
|
|
263
|
-
const z =
|
|
264
|
-
|
|
290
|
+
} catch (D) {
|
|
291
|
+
const z = D instanceof Error && D.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
292
|
+
i(z);
|
|
265
293
|
}
|
|
266
294
|
}
|
|
267
|
-
}, []),
|
|
268
|
-
e ?
|
|
269
|
-
}, [e,
|
|
270
|
-
|
|
271
|
-
}, [
|
|
272
|
-
|
|
273
|
-
}, [
|
|
274
|
-
return
|
|
295
|
+
}, []), R = E(async () => {
|
|
296
|
+
e ? u() : await c(s || void 0);
|
|
297
|
+
}, [e, s, u, c]), L = E(async (m) => {
|
|
298
|
+
u(), await c(m);
|
|
299
|
+
}, [u, c]), b = E(() => {
|
|
300
|
+
u(), d.current = null, i(null), a("");
|
|
301
|
+
}, [u]), y = E(() => i(null), []);
|
|
302
|
+
return I(() => () => {
|
|
275
303
|
f.current && f.current.stop();
|
|
276
304
|
}, []), {
|
|
277
305
|
isEnabled: e,
|
|
278
306
|
error: r,
|
|
279
|
-
previewEl:
|
|
280
|
-
activeDeviceId:
|
|
281
|
-
toggle:
|
|
282
|
-
switchDevice:
|
|
283
|
-
attachRoom:
|
|
284
|
-
teardown:
|
|
285
|
-
clearError:
|
|
307
|
+
previewEl: o,
|
|
308
|
+
activeDeviceId: s,
|
|
309
|
+
toggle: R,
|
|
310
|
+
switchDevice: L,
|
|
311
|
+
attachRoom: _,
|
|
312
|
+
teardown: b,
|
|
313
|
+
clearError: y
|
|
286
314
|
};
|
|
287
315
|
}
|
|
288
316
|
function jn() {
|
|
289
|
-
const [e, t] =
|
|
290
|
-
|
|
291
|
-
}, []),
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
317
|
+
const [e, t] = C(!1), [r, i] = C(null), [o, l] = C(null), s = A(null), a = E((c) => {
|
|
318
|
+
s.current = c;
|
|
319
|
+
}, []), d = E(() => l(null), []), f = E(async () => {
|
|
320
|
+
const c = s.current;
|
|
321
|
+
if (c) {
|
|
294
322
|
if (e) {
|
|
295
323
|
try {
|
|
296
|
-
await
|
|
324
|
+
await c.localParticipant.setScreenShareEnabled(!1);
|
|
297
325
|
} catch {
|
|
298
326
|
}
|
|
299
|
-
|
|
327
|
+
d(), t(!1);
|
|
300
328
|
return;
|
|
301
329
|
}
|
|
302
|
-
|
|
330
|
+
i(null);
|
|
303
331
|
try {
|
|
304
|
-
await
|
|
305
|
-
let
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
310
|
-
l(
|
|
332
|
+
await c.localParticipant.setScreenShareEnabled(!0);
|
|
333
|
+
let R = 0;
|
|
334
|
+
const L = () => {
|
|
335
|
+
const b = c.localParticipant.getTrackPublication(dn.Source.ScreenShare);
|
|
336
|
+
if (b != null && b.track) {
|
|
337
|
+
const y = b.track.attach();
|
|
338
|
+
l(y), t(!0);
|
|
311
339
|
try {
|
|
312
|
-
|
|
340
|
+
c.localParticipant.publishData(
|
|
313
341
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
314
342
|
{ reliable: !0 }
|
|
315
343
|
);
|
|
@@ -317,62 +345,62 @@ function jn() {
|
|
|
317
345
|
}
|
|
318
346
|
return;
|
|
319
347
|
}
|
|
320
|
-
|
|
348
|
+
R++ < 10 ? setTimeout(L, 100) : t(!0);
|
|
321
349
|
};
|
|
322
|
-
|
|
323
|
-
} catch (
|
|
324
|
-
const
|
|
325
|
-
|
|
350
|
+
L();
|
|
351
|
+
} catch (R) {
|
|
352
|
+
const L = R instanceof Error ? R.name : "";
|
|
353
|
+
L !== "NotAllowedError" && L !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
326
354
|
}
|
|
327
355
|
}
|
|
328
|
-
}, [e,
|
|
329
|
-
const
|
|
330
|
-
if (
|
|
356
|
+
}, [e, d]), _ = E(() => {
|
|
357
|
+
const c = s.current;
|
|
358
|
+
if (c && e)
|
|
331
359
|
try {
|
|
332
|
-
|
|
360
|
+
c.localParticipant.setScreenShareEnabled(!1);
|
|
333
361
|
} catch {
|
|
334
362
|
}
|
|
335
|
-
|
|
336
|
-
}, [e,
|
|
337
|
-
return { isEnabled: e, error: r, previewEl:
|
|
363
|
+
d(), t(!1), i(null), s.current = null;
|
|
364
|
+
}, [e, d]), u = E(() => i(null), []);
|
|
365
|
+
return { isEnabled: e, error: r, previewEl: o, toggle: f, attachRoom: a, teardown: _, clearError: u };
|
|
338
366
|
}
|
|
339
367
|
function Vn() {
|
|
340
|
-
const [e, t] =
|
|
368
|
+
const [e, t] = C([]), [r, i] = C([]), o = E(async () => {
|
|
341
369
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
342
370
|
try {
|
|
343
371
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
344
|
-
t(l.filter((
|
|
372
|
+
t(l.filter((s) => s.kind === "audioinput")), i(l.filter((s) => s.kind === "videoinput"));
|
|
345
373
|
} catch {
|
|
346
374
|
}
|
|
347
375
|
}, []);
|
|
348
|
-
return
|
|
349
|
-
if (
|
|
350
|
-
const l = () => void
|
|
376
|
+
return I(() => {
|
|
377
|
+
if (o(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
378
|
+
const l = () => void o();
|
|
351
379
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
352
|
-
}, [
|
|
380
|
+
}, [o]), { mics: e, cameras: r, refresh: o };
|
|
353
381
|
}
|
|
354
382
|
function Yn(e, t, r = !1) {
|
|
355
|
-
const [
|
|
356
|
-
return
|
|
383
|
+
const [i, o] = C(null), [l, s] = C(null), [a, d] = C(!r && !!e);
|
|
384
|
+
return I(() => {
|
|
357
385
|
if (r || !e) {
|
|
358
|
-
|
|
386
|
+
d(!1);
|
|
359
387
|
return;
|
|
360
388
|
}
|
|
361
|
-
const f = new AbortController(),
|
|
362
|
-
return
|
|
389
|
+
const f = new AbortController(), _ = t || "https://app.livelayer.studio";
|
|
390
|
+
return d(!0), s(null), fetch(`${_}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
363
391
|
signal: f.signal
|
|
364
|
-
}).then(async (
|
|
365
|
-
if (!
|
|
366
|
-
const
|
|
367
|
-
throw new Error(
|
|
392
|
+
}).then(async (u) => {
|
|
393
|
+
if (!u.ok) {
|
|
394
|
+
const c = await u.json().catch(() => ({}));
|
|
395
|
+
throw new Error(c.error || `HTTP ${u.status}`);
|
|
368
396
|
}
|
|
369
|
-
return
|
|
370
|
-
}).then((
|
|
371
|
-
f.signal.aborted || (
|
|
372
|
-
}).catch((
|
|
373
|
-
f.signal.aborted || (u
|
|
397
|
+
return u.json();
|
|
398
|
+
}).then((u) => {
|
|
399
|
+
f.signal.aborted || (o(u), d(!1));
|
|
400
|
+
}).catch((u) => {
|
|
401
|
+
f.signal.aborted || (s(u instanceof Error ? u.message : "Agent lookup failed"), d(!1));
|
|
374
402
|
}), () => f.abort();
|
|
375
|
-
}, [e, t, r]), { info:
|
|
403
|
+
}, [e, t, r]), { info: i, error: l, loading: a };
|
|
376
404
|
}
|
|
377
405
|
function Gn(e) {
|
|
378
406
|
if (typeof window > "u") return null;
|
|
@@ -394,13 +422,13 @@ function Kn({
|
|
|
394
422
|
defaultValue: t = "expanded",
|
|
395
423
|
onChange: r
|
|
396
424
|
} = {}) {
|
|
397
|
-
const
|
|
398
|
-
(
|
|
399
|
-
|
|
425
|
+
const i = e !== void 0, [o, l] = C(t), s = i ? e : o, a = E(
|
|
426
|
+
(d) => {
|
|
427
|
+
d !== s && (i || l(d), r == null || r(d));
|
|
400
428
|
},
|
|
401
|
-
[
|
|
429
|
+
[s, i, r]
|
|
402
430
|
);
|
|
403
|
-
return [
|
|
431
|
+
return [s, a];
|
|
404
432
|
}
|
|
405
433
|
const Xn = ["hidden", "minimized", "expanded"];
|
|
406
434
|
function Qn(e) {
|
|
@@ -410,35 +438,35 @@ function Zn({
|
|
|
410
438
|
value: e,
|
|
411
439
|
defaultValue: t = "expanded",
|
|
412
440
|
onChange: r,
|
|
413
|
-
persistKey:
|
|
414
|
-
disablePersistence:
|
|
441
|
+
persistKey: i = "ll-widget",
|
|
442
|
+
disablePersistence: o = !1
|
|
415
443
|
} = {}) {
|
|
416
|
-
const l = `${
|
|
444
|
+
const l = `${i}:display-mode`, s = A(!1), [a, d] = Kn({
|
|
417
445
|
value: e,
|
|
418
446
|
defaultValue: t,
|
|
419
447
|
onChange: (f) => {
|
|
420
|
-
e === void 0 && !
|
|
448
|
+
e === void 0 && !o && Jn(l, f), r == null || r(f);
|
|
421
449
|
}
|
|
422
450
|
});
|
|
423
|
-
return
|
|
424
|
-
if (
|
|
451
|
+
return I(() => {
|
|
452
|
+
if (s.current || (s.current = !0, o || e !== void 0)) return;
|
|
425
453
|
const f = Qn(Gn(l));
|
|
426
|
-
f && f !==
|
|
427
|
-
}, []), [
|
|
454
|
+
f && f !== a && d(f);
|
|
455
|
+
}, []), [a, d];
|
|
428
456
|
}
|
|
429
457
|
const er = 640;
|
|
430
458
|
function tr(e = er) {
|
|
431
|
-
const [t, r] =
|
|
432
|
-
return
|
|
459
|
+
const [t, r] = C(!1);
|
|
460
|
+
return I(() => {
|
|
433
461
|
if (e === !1) {
|
|
434
462
|
r(!1);
|
|
435
463
|
return;
|
|
436
464
|
}
|
|
437
465
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
438
466
|
return;
|
|
439
|
-
const
|
|
440
|
-
return l(), typeof
|
|
441
|
-
|
|
467
|
+
const i = `(max-width: ${e - 1}px)`, o = window.matchMedia(i), l = () => r(o.matches);
|
|
468
|
+
return l(), typeof o.addEventListener == "function" ? (o.addEventListener("change", l), () => o.removeEventListener("change", l)) : (o.addListener(l), () => {
|
|
469
|
+
o.removeListener(l);
|
|
442
470
|
});
|
|
443
471
|
}, [e]), t;
|
|
444
472
|
}
|
|
@@ -447,58 +475,58 @@ function nr() {
|
|
|
447
475
|
if (typeof window > "u" || window.history[jt]) return;
|
|
448
476
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
449
477
|
window.history.pushState = function(...r) {
|
|
450
|
-
const
|
|
451
|
-
return window.dispatchEvent(new Event(gt)),
|
|
478
|
+
const i = e.apply(this, r);
|
|
479
|
+
return window.dispatchEvent(new Event(gt)), i;
|
|
452
480
|
}, window.history.replaceState = function(...r) {
|
|
453
|
-
const
|
|
454
|
-
return window.dispatchEvent(new Event(gt)),
|
|
481
|
+
const i = t.apply(this, r);
|
|
482
|
+
return window.dispatchEvent(new Event(gt)), i;
|
|
455
483
|
}, window.history[jt] = !0;
|
|
456
484
|
}
|
|
457
485
|
function Vt() {
|
|
458
486
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
459
487
|
}
|
|
460
488
|
function rr(e) {
|
|
461
|
-
const [t, r] =
|
|
489
|
+
const [t, r] = C(
|
|
462
490
|
() => e ?? Vt()
|
|
463
491
|
);
|
|
464
|
-
return
|
|
492
|
+
return I(() => {
|
|
465
493
|
if (e !== void 0) return;
|
|
466
494
|
nr();
|
|
467
|
-
const
|
|
468
|
-
return
|
|
469
|
-
window.removeEventListener("popstate",
|
|
495
|
+
const i = () => r(Vt());
|
|
496
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(gt, i), () => {
|
|
497
|
+
window.removeEventListener("popstate", i), window.removeEventListener(gt, i);
|
|
470
498
|
};
|
|
471
499
|
}, [e]), e ?? t;
|
|
472
500
|
}
|
|
473
|
-
const Yt = /* @__PURE__ */ new Map(),
|
|
474
|
-
function
|
|
475
|
-
return e.replace(
|
|
501
|
+
const Yt = /* @__PURE__ */ new Map(), ir = /[\\^$+?.()|{}[\]]/g;
|
|
502
|
+
function or(e) {
|
|
503
|
+
return e.replace(ir, "\\$&");
|
|
476
504
|
}
|
|
477
505
|
function lr(e) {
|
|
478
506
|
const t = Yt.get(e);
|
|
479
507
|
if (t) return t;
|
|
480
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e,
|
|
481
|
-
return Yt.set(e,
|
|
508
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", o = "", l = r.replace(/\*\*/g, i).replace(/\*/g, o), a = or(l).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(o, "g"), "[^/]+"), d = new RegExp(`^${a}\\/?$`);
|
|
509
|
+
return Yt.set(e, d), d;
|
|
482
510
|
}
|
|
483
511
|
function ar(e, t) {
|
|
484
512
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
485
513
|
return lr(e).test(r);
|
|
486
514
|
}
|
|
487
|
-
function
|
|
515
|
+
function cr(e, t) {
|
|
488
516
|
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : ar(e, t);
|
|
489
517
|
}
|
|
490
518
|
function Gt(e, t) {
|
|
491
519
|
if (!e || e.length === 0) return !1;
|
|
492
520
|
for (const r of e)
|
|
493
|
-
if (
|
|
521
|
+
if (cr(r, t)) return !0;
|
|
494
522
|
return !1;
|
|
495
523
|
}
|
|
496
|
-
function
|
|
524
|
+
function sr(e, t, r) {
|
|
497
525
|
return e === void 0 ? !0 : Gt(r, e) ? !1 : t && t.length > 0 ? Gt(t, e) : !0;
|
|
498
526
|
}
|
|
499
527
|
function dr(e, t, r) {
|
|
500
528
|
return Ue(
|
|
501
|
-
() =>
|
|
529
|
+
() => sr(e, t, r),
|
|
502
530
|
[e, t, r]
|
|
503
531
|
);
|
|
504
532
|
}
|
|
@@ -510,64 +538,64 @@ function ur(e) {
|
|
|
510
538
|
};
|
|
511
539
|
}
|
|
512
540
|
function fr(e) {
|
|
513
|
-
const t = Ue(() => ur(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""),
|
|
514
|
-
(
|
|
541
|
+
const t = Ue(() => ur(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = A(null), o = E(
|
|
542
|
+
(d) => {
|
|
515
543
|
try {
|
|
516
|
-
new Audio(`${r}${
|
|
544
|
+
new Audio(`${r}${d}`).play().catch(() => {
|
|
517
545
|
});
|
|
518
546
|
} catch {
|
|
519
547
|
}
|
|
520
548
|
},
|
|
521
549
|
[r]
|
|
522
|
-
), l =
|
|
523
|
-
t.navigate &&
|
|
524
|
-
}, [t.navigate,
|
|
525
|
-
t.action &&
|
|
526
|
-
}, [t.action,
|
|
527
|
-
(
|
|
550
|
+
), l = E(() => {
|
|
551
|
+
t.navigate && o("/audio/page-change-sound.mp3");
|
|
552
|
+
}, [t.navigate, o]), s = E(() => {
|
|
553
|
+
t.action && o("/audio/confirmation-sound.mp3");
|
|
554
|
+
}, [t.action, o]), a = E(
|
|
555
|
+
(d) => {
|
|
528
556
|
if (!t.thinking) {
|
|
529
|
-
if (
|
|
557
|
+
if (i.current) {
|
|
530
558
|
try {
|
|
531
|
-
|
|
559
|
+
i.current.pause();
|
|
532
560
|
} catch {
|
|
533
561
|
}
|
|
534
|
-
|
|
562
|
+
i.current = null;
|
|
535
563
|
}
|
|
536
564
|
return;
|
|
537
565
|
}
|
|
538
|
-
if (
|
|
539
|
-
if (
|
|
566
|
+
if (d) {
|
|
567
|
+
if (i.current) return;
|
|
540
568
|
try {
|
|
541
569
|
const f = new Audio(`${r}/audio/thinking-sound.mp3`);
|
|
542
570
|
f.loop = !0, f.volume = 0.3, f.play().catch(() => {
|
|
543
|
-
|
|
544
|
-
}),
|
|
571
|
+
i.current = null;
|
|
572
|
+
}), i.current = f;
|
|
545
573
|
} catch {
|
|
546
574
|
}
|
|
547
|
-
} else if (
|
|
575
|
+
} else if (i.current) {
|
|
548
576
|
try {
|
|
549
|
-
|
|
577
|
+
i.current.pause();
|
|
550
578
|
} catch {
|
|
551
579
|
}
|
|
552
|
-
|
|
580
|
+
i.current = null;
|
|
553
581
|
}
|
|
554
582
|
},
|
|
555
583
|
[r, t.thinking]
|
|
556
584
|
);
|
|
557
|
-
return
|
|
558
|
-
if (
|
|
585
|
+
return I(() => () => {
|
|
586
|
+
if (i.current) {
|
|
559
587
|
try {
|
|
560
|
-
|
|
588
|
+
i.current.pause();
|
|
561
589
|
} catch {
|
|
562
590
|
}
|
|
563
|
-
|
|
591
|
+
i.current = null;
|
|
564
592
|
}
|
|
565
593
|
}, []), Ue(
|
|
566
|
-
() => ({ playPageChange: l, playConfirmation:
|
|
567
|
-
[l,
|
|
594
|
+
() => ({ playPageChange: l, playConfirmation: s, setThinking: a }),
|
|
595
|
+
[l, s, a]
|
|
568
596
|
);
|
|
569
597
|
}
|
|
570
|
-
const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */
|
|
598
|
+
const Jt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ v(
|
|
571
599
|
"svg",
|
|
572
600
|
{
|
|
573
601
|
className: t,
|
|
@@ -686,113 +714,113 @@ const vr = ({
|
|
|
686
714
|
position: e,
|
|
687
715
|
isMobile: t,
|
|
688
716
|
isSpeaking: r,
|
|
689
|
-
onExpand:
|
|
690
|
-
label:
|
|
717
|
+
onExpand: i,
|
|
718
|
+
label: o = "Open widget",
|
|
691
719
|
avatarImageUrl: l,
|
|
692
|
-
agentName:
|
|
720
|
+
agentName: s
|
|
693
721
|
}) => {
|
|
694
|
-
const
|
|
695
|
-
(
|
|
696
|
-
if (typeof window > "u") return
|
|
697
|
-
const
|
|
698
|
-
return
|
|
722
|
+
const a = mr(e), d = a === "right" ? "left" : "right", f = t ? 80 : 72, _ = !!l, [u, c] = C(null), [R, L] = C(!1), b = A(null), y = A(!1), m = E(
|
|
723
|
+
(N) => {
|
|
724
|
+
if (typeof window > "u") return N;
|
|
725
|
+
const M = f / 2, F = Qt + M, re = window.innerHeight - Qt - M;
|
|
726
|
+
return re < F ? Math.max(F, N) : Math.max(F, Math.min(re, N));
|
|
699
727
|
},
|
|
700
728
|
[f]
|
|
701
729
|
);
|
|
702
|
-
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
|
|
730
|
+
I(() => {
|
|
731
|
+
const N = yr();
|
|
732
|
+
c(m(N ?? window.innerHeight / 2));
|
|
733
|
+
const M = () => {
|
|
734
|
+
c((F) => F === null ? null : m(F));
|
|
707
735
|
};
|
|
708
|
-
return window.addEventListener("resize",
|
|
709
|
-
}, [
|
|
710
|
-
const
|
|
711
|
-
(
|
|
712
|
-
if (!(
|
|
736
|
+
return window.addEventListener("resize", M), () => window.removeEventListener("resize", M);
|
|
737
|
+
}, [m]);
|
|
738
|
+
const S = E(
|
|
739
|
+
(N) => {
|
|
740
|
+
if (!(N.pointerType === "mouse" && N.button !== 0) && u !== null) {
|
|
713
741
|
try {
|
|
714
|
-
|
|
742
|
+
N.currentTarget.setPointerCapture(N.pointerId);
|
|
715
743
|
} catch {
|
|
716
744
|
}
|
|
717
|
-
|
|
718
|
-
startClientY:
|
|
719
|
-
startCenterY:
|
|
745
|
+
b.current = {
|
|
746
|
+
startClientY: N.clientY,
|
|
747
|
+
startCenterY: u,
|
|
720
748
|
moved: !1
|
|
721
749
|
};
|
|
722
750
|
}
|
|
723
751
|
},
|
|
724
|
-
[
|
|
725
|
-
),
|
|
726
|
-
(
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
729
|
-
const F =
|
|
730
|
-
!
|
|
752
|
+
[u]
|
|
753
|
+
), D = E(
|
|
754
|
+
(N) => {
|
|
755
|
+
const M = b.current;
|
|
756
|
+
if (!M) return;
|
|
757
|
+
const F = N.clientY - M.startClientY;
|
|
758
|
+
!M.moved && Math.abs(F) > gr && (M.moved = !0, L(!0)), M.moved && c(m(M.startCenterY + F));
|
|
731
759
|
},
|
|
732
|
-
[
|
|
733
|
-
), z =
|
|
734
|
-
(
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
760
|
+
[m]
|
|
761
|
+
), z = E(
|
|
762
|
+
(N) => {
|
|
763
|
+
const M = b.current;
|
|
764
|
+
if (M) {
|
|
737
765
|
try {
|
|
738
|
-
|
|
766
|
+
N.currentTarget.releasePointerCapture(N.pointerId);
|
|
739
767
|
} catch {
|
|
740
768
|
}
|
|
741
|
-
|
|
769
|
+
b.current = null, M.moved && (L(!1), y.current = !0, c((F) => (F !== null && Zt(F), F)));
|
|
742
770
|
}
|
|
743
771
|
},
|
|
744
772
|
[]
|
|
745
|
-
),
|
|
746
|
-
if (
|
|
747
|
-
|
|
773
|
+
), x = E(() => {
|
|
774
|
+
if (y.current) {
|
|
775
|
+
y.current = !1;
|
|
748
776
|
return;
|
|
749
777
|
}
|
|
750
|
-
|
|
751
|
-
}, [
|
|
752
|
-
(
|
|
753
|
-
if (
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
|
|
778
|
+
i();
|
|
779
|
+
}, [i]), T = E(
|
|
780
|
+
(N) => {
|
|
781
|
+
if (N.key === "ArrowUp" || N.key === "ArrowDown") {
|
|
782
|
+
N.preventDefault();
|
|
783
|
+
const M = N.key === "ArrowUp" ? -8 : 8;
|
|
784
|
+
c((F) => {
|
|
757
785
|
if (F === null) return F;
|
|
758
|
-
const
|
|
759
|
-
return Zt(
|
|
786
|
+
const re = m(F + M);
|
|
787
|
+
return Zt(re), re;
|
|
760
788
|
});
|
|
761
789
|
}
|
|
762
790
|
},
|
|
763
|
-
[
|
|
764
|
-
),
|
|
791
|
+
[m]
|
|
792
|
+
), B = [
|
|
765
793
|
"ll-hidden",
|
|
766
|
-
`ll-hidden--${
|
|
794
|
+
`ll-hidden--${a}`,
|
|
767
795
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
768
796
|
r ? "ll-hidden--speaking" : null,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
].filter(Boolean).join(" "),
|
|
797
|
+
R ? "is-dragging" : null,
|
|
798
|
+
_ ? "ll-hidden--with-avatar" : null
|
|
799
|
+
].filter(Boolean).join(" "), q = u === null ? void 0 : { top: `${u - f / 2}px`, transform: "none" };
|
|
772
800
|
return /* @__PURE__ */ n(
|
|
773
801
|
"button",
|
|
774
802
|
{
|
|
775
803
|
type: "button",
|
|
776
|
-
className:
|
|
777
|
-
onPointerDown:
|
|
778
|
-
onPointerMove:
|
|
804
|
+
className: B,
|
|
805
|
+
onPointerDown: S,
|
|
806
|
+
onPointerMove: D,
|
|
779
807
|
onPointerUp: z,
|
|
780
808
|
onPointerCancel: z,
|
|
781
|
-
onClick:
|
|
782
|
-
onKeyDown:
|
|
783
|
-
"aria-label":
|
|
809
|
+
onClick: x,
|
|
810
|
+
onKeyDown: T,
|
|
811
|
+
"aria-label": o,
|
|
784
812
|
"data-position": e,
|
|
785
|
-
style:
|
|
786
|
-
children:
|
|
813
|
+
style: q,
|
|
814
|
+
children: _ ? (
|
|
787
815
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
788
816
|
// as the click affordance), then the circular avatar photo
|
|
789
817
|
// taking the rest of the tab. Reinforces "this is an
|
|
790
818
|
// avatar-based experience" even when collapsed.
|
|
791
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ v(ot, { children: [
|
|
792
820
|
/* @__PURE__ */ n(
|
|
793
821
|
Xt,
|
|
794
822
|
{
|
|
795
|
-
direction:
|
|
823
|
+
direction: d,
|
|
796
824
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
797
825
|
}
|
|
798
826
|
),
|
|
@@ -800,7 +828,7 @@ const vr = ({
|
|
|
800
828
|
"img",
|
|
801
829
|
{
|
|
802
830
|
src: l,
|
|
803
|
-
alt:
|
|
831
|
+
alt: s ? `${s} avatar` : "Agent avatar",
|
|
804
832
|
className: "ll-hidden__avatar",
|
|
805
833
|
draggable: !1
|
|
806
834
|
}
|
|
@@ -809,7 +837,7 @@ const vr = ({
|
|
|
809
837
|
) : /* @__PURE__ */ n(
|
|
810
838
|
Xt,
|
|
811
839
|
{
|
|
812
|
-
direction:
|
|
840
|
+
direction: d,
|
|
813
841
|
className: "ll-hidden__chevron"
|
|
814
842
|
}
|
|
815
843
|
)
|
|
@@ -819,44 +847,44 @@ const vr = ({
|
|
|
819
847
|
audioLevel: e,
|
|
820
848
|
bars: t = 20,
|
|
821
849
|
maxHeight: r = 20,
|
|
822
|
-
minHeight:
|
|
823
|
-
className:
|
|
850
|
+
minHeight: i = 4,
|
|
851
|
+
className: o,
|
|
824
852
|
barClassName: l
|
|
825
853
|
}) => {
|
|
826
|
-
const
|
|
827
|
-
const
|
|
828
|
-
return Array.from({ length: t }, (
|
|
854
|
+
const s = A(null), a = A([]), d = Ue(() => {
|
|
855
|
+
const _ = (Math.sqrt(5) - 1) / 2;
|
|
856
|
+
return Array.from({ length: t }, (u, c) => 0.5 + c * _ % 1 * 0.5);
|
|
829
857
|
}, [t]);
|
|
830
|
-
|
|
831
|
-
for (let
|
|
832
|
-
const
|
|
833
|
-
if (!
|
|
834
|
-
const
|
|
835
|
-
|
|
858
|
+
I(() => e.subscribe((u) => {
|
|
859
|
+
for (let c = 0; c < t; c++) {
|
|
860
|
+
const R = a.current[c];
|
|
861
|
+
if (!R) continue;
|
|
862
|
+
const L = Math.max(i, u * r * d[c]);
|
|
863
|
+
R.style.height = `${L}px`;
|
|
836
864
|
}
|
|
837
|
-
}), [e, t, r,
|
|
838
|
-
const f = ["ll-waveform",
|
|
839
|
-
return /* @__PURE__ */ n("div", { ref:
|
|
865
|
+
}), [e, t, r, i, d]);
|
|
866
|
+
const f = ["ll-waveform", o].filter(Boolean).join(" ");
|
|
867
|
+
return /* @__PURE__ */ n("div", { ref: s, className: f, "aria-hidden": "true", children: Array.from({ length: t }, (_, u) => /* @__PURE__ */ n(
|
|
840
868
|
"div",
|
|
841
869
|
{
|
|
842
|
-
ref: (
|
|
843
|
-
|
|
870
|
+
ref: (c) => {
|
|
871
|
+
a.current[u] = c;
|
|
844
872
|
},
|
|
845
873
|
className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
|
|
846
|
-
style: { height: `${
|
|
874
|
+
style: { height: `${i}px` }
|
|
847
875
|
},
|
|
848
|
-
|
|
876
|
+
u
|
|
849
877
|
)) });
|
|
850
878
|
}, wr = ({
|
|
851
879
|
position: e,
|
|
852
880
|
isMobile: t,
|
|
853
881
|
agentName: r,
|
|
854
|
-
avatarImageUrl:
|
|
855
|
-
agentState:
|
|
882
|
+
avatarImageUrl: i,
|
|
883
|
+
agentState: o,
|
|
856
884
|
isMuted: l,
|
|
857
|
-
audioLevel:
|
|
858
|
-
onExpand:
|
|
859
|
-
onToggleMute:
|
|
885
|
+
audioLevel: s,
|
|
886
|
+
onExpand: a,
|
|
887
|
+
onToggleMute: d,
|
|
860
888
|
onClose: f
|
|
861
889
|
}) => t ? /* @__PURE__ */ n(
|
|
862
890
|
"div",
|
|
@@ -864,20 +892,20 @@ const vr = ({
|
|
|
864
892
|
className: "ll-minimized ll-minimized--mobile",
|
|
865
893
|
role: "region",
|
|
866
894
|
"aria-label": `${r} widget`,
|
|
867
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ v(
|
|
868
896
|
"button",
|
|
869
897
|
{
|
|
870
898
|
type: "button",
|
|
871
899
|
className: "ll-minimized__surface",
|
|
872
|
-
onClick:
|
|
900
|
+
onClick: a,
|
|
873
901
|
"aria-label": `Expand ${r} widget`,
|
|
874
902
|
children: [
|
|
875
|
-
|
|
903
|
+
i ? (
|
|
876
904
|
// eslint-disable-next-line @next/next/no-img-element
|
|
877
905
|
/* @__PURE__ */ n(
|
|
878
906
|
"img",
|
|
879
907
|
{
|
|
880
|
-
src:
|
|
908
|
+
src: i,
|
|
881
909
|
alt: r,
|
|
882
910
|
className: "ll-minimized__avatar"
|
|
883
911
|
}
|
|
@@ -886,25 +914,25 @@ const vr = ({
|
|
|
886
914
|
/* @__PURE__ */ n(
|
|
887
915
|
br,
|
|
888
916
|
{
|
|
889
|
-
audioLevel:
|
|
917
|
+
audioLevel: s,
|
|
890
918
|
bars: 16,
|
|
891
919
|
maxHeight: 18,
|
|
892
920
|
className: "ll-minimized__waveform"
|
|
893
921
|
}
|
|
894
922
|
),
|
|
895
923
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
896
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ v("div", { className: "ll-minimized__controls", children: [
|
|
897
925
|
/* @__PURE__ */ n(
|
|
898
926
|
"span",
|
|
899
927
|
{
|
|
900
928
|
className: "ll-minimized__btn",
|
|
901
929
|
role: "button",
|
|
902
930
|
tabIndex: 0,
|
|
903
|
-
onClick: (
|
|
904
|
-
|
|
931
|
+
onClick: (_) => {
|
|
932
|
+
_.stopPropagation(), d();
|
|
905
933
|
},
|
|
906
|
-
onKeyDown: (
|
|
907
|
-
(
|
|
934
|
+
onKeyDown: (_) => {
|
|
935
|
+
(_.key === "Enter" || _.key === " ") && (_.stopPropagation(), _.preventDefault(), d());
|
|
908
936
|
},
|
|
909
937
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
910
938
|
children: /* @__PURE__ */ n(Jt, { muted: l, className: "ll-minimized__icon" })
|
|
@@ -923,29 +951,29 @@ const vr = ({
|
|
|
923
951
|
"data-position": e,
|
|
924
952
|
role: "region",
|
|
925
953
|
"aria-label": `${r} widget`,
|
|
926
|
-
children: /* @__PURE__ */
|
|
927
|
-
|
|
954
|
+
children: /* @__PURE__ */ v("div", { className: "ll-minimized__surface", children: [
|
|
955
|
+
i ? (
|
|
928
956
|
// eslint-disable-next-line @next/next/no-img-element
|
|
929
957
|
/* @__PURE__ */ n(
|
|
930
958
|
"img",
|
|
931
959
|
{
|
|
932
|
-
src:
|
|
960
|
+
src: i,
|
|
933
961
|
alt: r,
|
|
934
962
|
className: "ll-minimized__avatar"
|
|
935
963
|
}
|
|
936
964
|
)
|
|
937
965
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
938
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ v("div", { className: "ll-minimized__meta", children: [
|
|
939
967
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
940
|
-
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children:
|
|
968
|
+
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: o === "speaking" ? "Speaking" : o === "thinking" ? "Thinking" : "Listening" })
|
|
941
969
|
] }),
|
|
942
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ v("div", { className: "ll-minimized__controls", children: [
|
|
943
971
|
/* @__PURE__ */ n(
|
|
944
972
|
"button",
|
|
945
973
|
{
|
|
946
974
|
type: "button",
|
|
947
975
|
className: "ll-minimized__btn",
|
|
948
|
-
onClick:
|
|
976
|
+
onClick: d,
|
|
949
977
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
950
978
|
children: /* @__PURE__ */ n(Jt, { muted: l, className: "ll-minimized__icon" })
|
|
951
979
|
}
|
|
@@ -955,7 +983,7 @@ const vr = ({
|
|
|
955
983
|
{
|
|
956
984
|
type: "button",
|
|
957
985
|
className: "ll-minimized__btn",
|
|
958
|
-
onClick:
|
|
986
|
+
onClick: a,
|
|
959
987
|
"aria-label": `Expand ${r} widget`,
|
|
960
988
|
children: /* @__PURE__ */ n(Kt, { className: "ll-minimized__icon" })
|
|
961
989
|
}
|
|
@@ -977,14 +1005,14 @@ const vr = ({
|
|
|
977
1005
|
src: e,
|
|
978
1006
|
alt: t,
|
|
979
1007
|
preCannedPlaying: r = !1,
|
|
980
|
-
className:
|
|
981
|
-
style:
|
|
1008
|
+
className: i,
|
|
1009
|
+
style: o
|
|
982
1010
|
}) => {
|
|
983
|
-
const [l,
|
|
984
|
-
if (
|
|
985
|
-
|
|
1011
|
+
const [l, s] = C(!1), a = A(e);
|
|
1012
|
+
if (I(() => {
|
|
1013
|
+
a.current !== e && (a.current = e, s(!1));
|
|
986
1014
|
}, [e]), !e) return null;
|
|
987
|
-
const
|
|
1015
|
+
const d = {
|
|
988
1016
|
position: "absolute",
|
|
989
1017
|
inset: 0,
|
|
990
1018
|
width: "100%",
|
|
@@ -994,7 +1022,7 @@ const vr = ({
|
|
|
994
1022
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
995
1023
|
transform: r ? "scale(1.02)" : "scale(1)",
|
|
996
1024
|
opacity: l ? 1 : 0,
|
|
997
|
-
...
|
|
1025
|
+
...o
|
|
998
1026
|
};
|
|
999
1027
|
return (
|
|
1000
1028
|
// eslint-disable-next-line @next/next/no-img-element
|
|
@@ -1003,11 +1031,11 @@ const vr = ({
|
|
|
1003
1031
|
{
|
|
1004
1032
|
src: e,
|
|
1005
1033
|
alt: t,
|
|
1006
|
-
className:
|
|
1007
|
-
style:
|
|
1034
|
+
className: i,
|
|
1035
|
+
style: d,
|
|
1008
1036
|
loading: "eager",
|
|
1009
1037
|
fetchPriority: "high",
|
|
1010
|
-
onLoad: () =>
|
|
1038
|
+
onLoad: () => s(!0)
|
|
1011
1039
|
}
|
|
1012
1040
|
)
|
|
1013
1041
|
);
|
|
@@ -1015,42 +1043,42 @@ const vr = ({
|
|
|
1015
1043
|
open: e,
|
|
1016
1044
|
onClose: t,
|
|
1017
1045
|
anchorRef: r,
|
|
1018
|
-
children:
|
|
1046
|
+
children: i
|
|
1019
1047
|
}) => {
|
|
1020
|
-
const
|
|
1021
|
-
return
|
|
1048
|
+
const o = A(null), [l, s] = C(null);
|
|
1049
|
+
return Mn(() => {
|
|
1022
1050
|
if (!e) {
|
|
1023
|
-
|
|
1051
|
+
s(null);
|
|
1024
1052
|
return;
|
|
1025
1053
|
}
|
|
1026
|
-
const
|
|
1027
|
-
if (!
|
|
1028
|
-
const
|
|
1029
|
-
const f =
|
|
1054
|
+
const a = r.current;
|
|
1055
|
+
if (!a) return;
|
|
1056
|
+
const d = () => {
|
|
1057
|
+
const f = a.getBoundingClientRect(), _ = {
|
|
1030
1058
|
top: f.top - xr,
|
|
1031
1059
|
left: f.left + f.width / 2
|
|
1032
|
-
},
|
|
1033
|
-
|
|
1060
|
+
}, u = en + 90, c = window.innerWidth - en - 90;
|
|
1061
|
+
_.left < u && (_.left = u), _.left > c && (_.left = c), s(_);
|
|
1034
1062
|
};
|
|
1035
|
-
return
|
|
1036
|
-
window.removeEventListener("scroll",
|
|
1063
|
+
return d(), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
|
|
1064
|
+
window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
|
|
1037
1065
|
};
|
|
1038
|
-
}, [e, r]),
|
|
1066
|
+
}, [e, r]), I(() => {
|
|
1039
1067
|
if (!e) return;
|
|
1040
|
-
const
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
},
|
|
1068
|
+
const a = (f) => {
|
|
1069
|
+
const _ = f.target, u = o.current, c = r.current;
|
|
1070
|
+
u && u.contains(_) || c && c.contains(_) || t();
|
|
1071
|
+
}, d = (f) => {
|
|
1044
1072
|
f.key === "Escape" && (f.stopPropagation(), t());
|
|
1045
1073
|
};
|
|
1046
|
-
return document.addEventListener("mousedown",
|
|
1047
|
-
document.removeEventListener("mousedown",
|
|
1074
|
+
return document.addEventListener("mousedown", a), document.addEventListener("keydown", d), () => {
|
|
1075
|
+
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", d);
|
|
1048
1076
|
};
|
|
1049
1077
|
}, [e, t, r]), !e || l === null || typeof document > "u" ? null : On(
|
|
1050
1078
|
/* @__PURE__ */ n(
|
|
1051
1079
|
"div",
|
|
1052
1080
|
{
|
|
1053
|
-
ref:
|
|
1081
|
+
ref: o,
|
|
1054
1082
|
className: "ll-overflow-popover",
|
|
1055
1083
|
role: "menu",
|
|
1056
1084
|
style: {
|
|
@@ -1061,7 +1089,7 @@ const vr = ({
|
|
|
1061
1089
|
left: l.left,
|
|
1062
1090
|
transform: "translate(-50%, -100%)"
|
|
1063
1091
|
},
|
|
1064
|
-
children:
|
|
1092
|
+
children: i
|
|
1065
1093
|
}
|
|
1066
1094
|
),
|
|
1067
1095
|
document.body
|
|
@@ -1070,26 +1098,26 @@ const vr = ({
|
|
|
1070
1098
|
isMuted: e,
|
|
1071
1099
|
onToggleMute: t,
|
|
1072
1100
|
isCameraEnabled: r,
|
|
1073
|
-
onToggleCamera:
|
|
1074
|
-
allowCamera:
|
|
1101
|
+
onToggleCamera: i,
|
|
1102
|
+
allowCamera: o,
|
|
1075
1103
|
isScreenShareEnabled: l,
|
|
1076
|
-
onToggleScreenShare:
|
|
1077
|
-
allowScreenShare:
|
|
1078
|
-
isSpeakerMuted:
|
|
1104
|
+
onToggleScreenShare: s,
|
|
1105
|
+
allowScreenShare: a,
|
|
1106
|
+
isSpeakerMuted: d,
|
|
1079
1107
|
onToggleSpeaker: f,
|
|
1080
|
-
allowTyping:
|
|
1081
|
-
isTypingOpen:
|
|
1082
|
-
onToggleTyping:
|
|
1083
|
-
onDisconnect:
|
|
1108
|
+
allowTyping: _,
|
|
1109
|
+
isTypingOpen: u,
|
|
1110
|
+
onToggleTyping: c,
|
|
1111
|
+
onDisconnect: R
|
|
1084
1112
|
}) => {
|
|
1085
|
-
const [
|
|
1086
|
-
return /* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
1113
|
+
const [L, b] = C(!1), y = A(null);
|
|
1114
|
+
return /* @__PURE__ */ v(ot, { children: [
|
|
1115
|
+
/* @__PURE__ */ v(
|
|
1088
1116
|
"div",
|
|
1089
1117
|
{
|
|
1090
1118
|
className: "ll-toolbar ll-toolbar--compact",
|
|
1091
1119
|
"data-testid": "compact-toolbar",
|
|
1092
|
-
onClick: (
|
|
1120
|
+
onClick: (m) => m.stopPropagation(),
|
|
1093
1121
|
children: [
|
|
1094
1122
|
/* @__PURE__ */ n(
|
|
1095
1123
|
"button",
|
|
@@ -1104,13 +1132,13 @@ const vr = ({
|
|
|
1104
1132
|
/* @__PURE__ */ n(
|
|
1105
1133
|
"button",
|
|
1106
1134
|
{
|
|
1107
|
-
ref:
|
|
1135
|
+
ref: y,
|
|
1108
1136
|
type: "button",
|
|
1109
|
-
className: `ll-tool ${
|
|
1110
|
-
onClick: () =>
|
|
1137
|
+
className: `ll-tool ${L ? "is-on" : ""}`,
|
|
1138
|
+
onClick: () => b((m) => !m),
|
|
1111
1139
|
"aria-label": "More controls",
|
|
1112
1140
|
"aria-haspopup": "menu",
|
|
1113
|
-
"aria-expanded":
|
|
1141
|
+
"aria-expanded": L,
|
|
1114
1142
|
children: /* @__PURE__ */ n(Er, {})
|
|
1115
1143
|
}
|
|
1116
1144
|
),
|
|
@@ -1119,7 +1147,7 @@ const vr = ({
|
|
|
1119
1147
|
{
|
|
1120
1148
|
type: "button",
|
|
1121
1149
|
className: "ll-tool ll-tool--danger",
|
|
1122
|
-
onClick:
|
|
1150
|
+
onClick: R,
|
|
1123
1151
|
"aria-label": "End conversation",
|
|
1124
1152
|
children: /* @__PURE__ */ n(gn, {})
|
|
1125
1153
|
}
|
|
@@ -1127,20 +1155,20 @@ const vr = ({
|
|
|
1127
1155
|
]
|
|
1128
1156
|
}
|
|
1129
1157
|
),
|
|
1130
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ v(
|
|
1131
1159
|
kr,
|
|
1132
1160
|
{
|
|
1133
|
-
open:
|
|
1134
|
-
onClose: () =>
|
|
1135
|
-
anchorRef:
|
|
1161
|
+
open: L,
|
|
1162
|
+
onClose: () => b(!1),
|
|
1163
|
+
anchorRef: y,
|
|
1136
1164
|
children: [
|
|
1137
|
-
|
|
1165
|
+
o && /* @__PURE__ */ v(
|
|
1138
1166
|
"button",
|
|
1139
1167
|
{
|
|
1140
1168
|
type: "button",
|
|
1141
1169
|
className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
|
|
1142
1170
|
onClick: () => {
|
|
1143
|
-
|
|
1171
|
+
i(), b(!1);
|
|
1144
1172
|
},
|
|
1145
1173
|
children: [
|
|
1146
1174
|
/* @__PURE__ */ n(pn, {}),
|
|
@@ -1148,13 +1176,13 @@ const vr = ({
|
|
|
1148
1176
|
]
|
|
1149
1177
|
}
|
|
1150
1178
|
),
|
|
1151
|
-
|
|
1179
|
+
a && /* @__PURE__ */ v(
|
|
1152
1180
|
"button",
|
|
1153
1181
|
{
|
|
1154
1182
|
type: "button",
|
|
1155
1183
|
className: `ll-overflow-popover__item ${l ? "is-on" : ""}`,
|
|
1156
1184
|
onClick: () => {
|
|
1157
|
-
|
|
1185
|
+
s(), b(!1);
|
|
1158
1186
|
},
|
|
1159
1187
|
children: [
|
|
1160
1188
|
/* @__PURE__ */ n(fn, {}),
|
|
@@ -1162,35 +1190,35 @@ const vr = ({
|
|
|
1162
1190
|
]
|
|
1163
1191
|
}
|
|
1164
1192
|
),
|
|
1165
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ v(
|
|
1166
1194
|
"button",
|
|
1167
1195
|
{
|
|
1168
1196
|
type: "button",
|
|
1169
|
-
className: `ll-overflow-popover__item ${
|
|
1197
|
+
className: `ll-overflow-popover__item ${d ? "is-on" : ""}`,
|
|
1170
1198
|
onClick: () => {
|
|
1171
|
-
f(),
|
|
1199
|
+
f(), b(!1);
|
|
1172
1200
|
},
|
|
1173
1201
|
children: [
|
|
1174
|
-
/* @__PURE__ */ n(mn, { muted:
|
|
1175
|
-
/* @__PURE__ */ n("span", { children:
|
|
1202
|
+
/* @__PURE__ */ n(mn, { muted: d }),
|
|
1203
|
+
/* @__PURE__ */ n("span", { children: d ? "Unmute speaker" : "Mute speaker" })
|
|
1176
1204
|
]
|
|
1177
1205
|
}
|
|
1178
1206
|
),
|
|
1179
|
-
|
|
1207
|
+
_ && /* @__PURE__ */ v(
|
|
1180
1208
|
"button",
|
|
1181
1209
|
{
|
|
1182
1210
|
type: "button",
|
|
1183
|
-
className: `ll-overflow-popover__item ${
|
|
1211
|
+
className: `ll-overflow-popover__item ${u ? "is-on" : ""}`,
|
|
1184
1212
|
onClick: () => {
|
|
1185
|
-
|
|
1213
|
+
c(), b(!1);
|
|
1186
1214
|
},
|
|
1187
1215
|
children: [
|
|
1188
1216
|
/* @__PURE__ */ n(Cr, {}),
|
|
1189
|
-
/* @__PURE__ */ n("span", { children:
|
|
1217
|
+
/* @__PURE__ */ n("span", { children: u ? "Hide typing" : "Type a message" })
|
|
1190
1218
|
]
|
|
1191
1219
|
}
|
|
1192
1220
|
),
|
|
1193
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ v(
|
|
1194
1222
|
"button",
|
|
1195
1223
|
{
|
|
1196
1224
|
type: "button",
|
|
@@ -1209,7 +1237,7 @@ const vr = ({
|
|
|
1209
1237
|
] });
|
|
1210
1238
|
};
|
|
1211
1239
|
function Er() {
|
|
1212
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ v(
|
|
1213
1241
|
"svg",
|
|
1214
1242
|
{
|
|
1215
1243
|
width: "16",
|
|
@@ -1246,148 +1274,150 @@ const Sr = ({
|
|
|
1246
1274
|
position: e,
|
|
1247
1275
|
isMobile: t,
|
|
1248
1276
|
agentName: r,
|
|
1249
|
-
avatarImageUrl:
|
|
1250
|
-
idleLoopUrl:
|
|
1277
|
+
avatarImageUrl: i,
|
|
1278
|
+
idleLoopUrl: o,
|
|
1251
1279
|
greeting: l,
|
|
1252
|
-
branding:
|
|
1253
|
-
teamMembers:
|
|
1254
|
-
currentTeamMemberId:
|
|
1280
|
+
branding: s,
|
|
1281
|
+
teamMembers: a,
|
|
1282
|
+
currentTeamMemberId: d,
|
|
1255
1283
|
isSwitchingTeamMember: f,
|
|
1256
|
-
teamSwitcherOpen:
|
|
1257
|
-
onToggleTeamSwitcher:
|
|
1258
|
-
onSelectTeamMember:
|
|
1259
|
-
languageMenuOpen:
|
|
1260
|
-
onToggleLanguageMenu:
|
|
1261
|
-
connectionState:
|
|
1262
|
-
agentState:
|
|
1263
|
-
transcript:
|
|
1264
|
-
canResume:
|
|
1265
|
-
needsUserGesture:
|
|
1284
|
+
teamSwitcherOpen: _,
|
|
1285
|
+
onToggleTeamSwitcher: u,
|
|
1286
|
+
onSelectTeamMember: c,
|
|
1287
|
+
languageMenuOpen: R,
|
|
1288
|
+
onToggleLanguageMenu: L,
|
|
1289
|
+
connectionState: b,
|
|
1290
|
+
agentState: y,
|
|
1291
|
+
transcript: m,
|
|
1292
|
+
canResume: S,
|
|
1293
|
+
needsUserGesture: D,
|
|
1266
1294
|
error: z,
|
|
1267
|
-
isMuted:
|
|
1268
|
-
micError:
|
|
1269
|
-
micDevices:
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1295
|
+
isMuted: x,
|
|
1296
|
+
micError: T,
|
|
1297
|
+
micDevices: B,
|
|
1298
|
+
activeMicId: q,
|
|
1299
|
+
isCameraEnabled: N,
|
|
1300
|
+
cameraPreviewEl: M,
|
|
1301
|
+
cameraDevices: F,
|
|
1302
|
+
activeCameraId: re,
|
|
1303
|
+
isScreenShareEnabled: ie,
|
|
1304
|
+
screenPreviewEl: Z,
|
|
1305
|
+
isSpeakerMuted: ae,
|
|
1306
|
+
allowCamera: fe,
|
|
1307
|
+
allowScreenShare: ve,
|
|
1308
|
+
allowTyping: pe,
|
|
1309
|
+
showMinimize: be = !0,
|
|
1310
|
+
chromeless: he = !1,
|
|
1311
|
+
compactControls: ee = !1,
|
|
1283
1312
|
transforming: at,
|
|
1284
1313
|
transformingLabel: je,
|
|
1285
|
-
avatarVideoContainerRef:
|
|
1286
|
-
agentVideoEl:
|
|
1314
|
+
avatarVideoContainerRef: ct,
|
|
1315
|
+
agentVideoEl: oe,
|
|
1287
1316
|
onConnect: Ve,
|
|
1288
1317
|
onDisconnect: Ye,
|
|
1289
|
-
onRetry:
|
|
1290
|
-
onResumeAudio:
|
|
1291
|
-
onToggleMute:
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1318
|
+
onRetry: Ge,
|
|
1319
|
+
onResumeAudio: De,
|
|
1320
|
+
onToggleMute: Ae,
|
|
1321
|
+
onSwitchMicDevice: Pe,
|
|
1322
|
+
onToggleCamera: Re,
|
|
1323
|
+
onSwitchCameraDevice: $e,
|
|
1324
|
+
onToggleScreenShare: Ie,
|
|
1325
|
+
onToggleSpeaker: Me,
|
|
1326
|
+
onSendMessage: $,
|
|
1327
|
+
onMinimize: st,
|
|
1328
|
+
onClose: dt,
|
|
1299
1329
|
onClearMicError: vt
|
|
1300
1330
|
}) => {
|
|
1301
|
-
var
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
if (!
|
|
1305
|
-
|
|
1331
|
+
var Te;
|
|
1332
|
+
const we = ((a == null ? void 0 : a.length) ?? 0) > 1, _e = b === "connecting" || b === "connected", te = b === "connected", bt = b === "idle" || b === "disconnected" || b === "error", [Je, ce] = C(!1);
|
|
1333
|
+
I(() => {
|
|
1334
|
+
if (!oe) {
|
|
1335
|
+
ce(!1);
|
|
1306
1336
|
return;
|
|
1307
1337
|
}
|
|
1308
|
-
if (!
|
|
1309
|
-
|
|
1338
|
+
if (!oe.paused && oe.readyState >= 2) {
|
|
1339
|
+
ce(!0);
|
|
1310
1340
|
return;
|
|
1311
1341
|
}
|
|
1312
|
-
|
|
1313
|
-
const
|
|
1314
|
-
return
|
|
1315
|
-
|
|
1342
|
+
ce(!1);
|
|
1343
|
+
const h = () => ce(!0);
|
|
1344
|
+
return oe.addEventListener("playing", h), oe.addEventListener("loadeddata", h), () => {
|
|
1345
|
+
oe.removeEventListener("playing", h), oe.removeEventListener("loadeddata", h);
|
|
1316
1346
|
};
|
|
1317
|
-
}, [
|
|
1318
|
-
const [
|
|
1319
|
-
|
|
1320
|
-
if (!
|
|
1321
|
-
|
|
1347
|
+
}, [oe]);
|
|
1348
|
+
const [X, Ke] = C(!1);
|
|
1349
|
+
I(() => {
|
|
1350
|
+
if (!te) {
|
|
1351
|
+
Ke(!1);
|
|
1322
1352
|
return;
|
|
1323
1353
|
}
|
|
1324
|
-
if (
|
|
1325
|
-
const
|
|
1326
|
-
return () => clearTimeout(
|
|
1327
|
-
}, [
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1332
|
-
}, [
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
}, [
|
|
1336
|
-
const [
|
|
1337
|
-
|
|
1338
|
-
if (!
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1354
|
+
if (Je) return;
|
|
1355
|
+
const h = setTimeout(() => Ke(!0), 8e3);
|
|
1356
|
+
return () => clearTimeout(h);
|
|
1357
|
+
}, [te, Je]);
|
|
1358
|
+
const ze = b === "connecting" || te && !!i && !Je && !X, xe = A(null), se = A(null);
|
|
1359
|
+
I(() => {
|
|
1360
|
+
const h = xe.current;
|
|
1361
|
+
h && (h.innerHTML = "", M && (M.style.width = "100%", M.style.height = "100%", M.style.objectFit = "cover", M.style.transform = "scaleX(-1)", h.appendChild(M)));
|
|
1362
|
+
}, [M]), I(() => {
|
|
1363
|
+
const h = se.current;
|
|
1364
|
+
h && (h.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", h.appendChild(Z)));
|
|
1365
|
+
}, [Z]);
|
|
1366
|
+
const [me, ke] = C(!1), [G, ne] = C(!1);
|
|
1367
|
+
I(() => {
|
|
1368
|
+
if (!me && !G && !R && !_) return;
|
|
1369
|
+
const h = () => {
|
|
1370
|
+
ke(!1), ne(!1), R && L(), _ && u();
|
|
1341
1371
|
};
|
|
1342
|
-
return document.addEventListener("click",
|
|
1372
|
+
return document.addEventListener("click", h), () => document.removeEventListener("click", h);
|
|
1343
1373
|
}, [
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1374
|
+
me,
|
|
1375
|
+
G,
|
|
1376
|
+
R,
|
|
1377
|
+
_,
|
|
1378
|
+
L,
|
|
1379
|
+
u
|
|
1350
1380
|
]);
|
|
1351
|
-
const [
|
|
1352
|
-
(
|
|
1353
|
-
|
|
1354
|
-
const V =
|
|
1355
|
-
V && (
|
|
1381
|
+
const [Le, Xe] = C(!1), wt = E(() => Xe((h) => !h), []), [Ee, Oe] = C(""), ut = E(
|
|
1382
|
+
(h) => {
|
|
1383
|
+
h.preventDefault();
|
|
1384
|
+
const V = Ee.trim();
|
|
1385
|
+
V && ($(V), Oe(""));
|
|
1356
1386
|
},
|
|
1357
|
-
[
|
|
1358
|
-
), Qe =
|
|
1359
|
-
let
|
|
1360
|
-
for (let
|
|
1361
|
-
const V =
|
|
1362
|
-
if (!
|
|
1387
|
+
[Ee, $]
|
|
1388
|
+
), Qe = s.productName || "Live Layer";
|
|
1389
|
+
let de = null, Ce = null;
|
|
1390
|
+
for (let h = m.length - 1; h >= 0; h--) {
|
|
1391
|
+
const V = m[h];
|
|
1392
|
+
if (!de && V.role === "agent" ? de = V : !Ce && V.role === "user" && (Ce = V), de && Ce) break;
|
|
1363
1393
|
}
|
|
1364
|
-
const
|
|
1394
|
+
const ft = te ? (de == null ? void 0 : de.text) || null : l || null, He = te && (Ce == null ? void 0 : Ce.text) || null, _t = [
|
|
1365
1395
|
"ll-expanded",
|
|
1366
1396
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1367
1397
|
].join(" ");
|
|
1368
|
-
return /* @__PURE__ */
|
|
1398
|
+
return /* @__PURE__ */ v(
|
|
1369
1399
|
"div",
|
|
1370
1400
|
{
|
|
1371
|
-
className:
|
|
1401
|
+
className: _t,
|
|
1372
1402
|
"data-position": e,
|
|
1373
|
-
"data-state":
|
|
1403
|
+
"data-state": te ? "connected" : _e ? "connecting" : "idle",
|
|
1374
1404
|
role: "dialog",
|
|
1375
1405
|
"aria-label": `${r} widget`,
|
|
1376
1406
|
children: [
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
|
|
1407
|
+
/* @__PURE__ */ v("div", { className: "ll-expanded__bg", children: [
|
|
1408
|
+
i ? /* @__PURE__ */ n(
|
|
1379
1409
|
_r,
|
|
1380
1410
|
{
|
|
1381
|
-
src:
|
|
1411
|
+
src: i,
|
|
1382
1412
|
alt: r,
|
|
1383
1413
|
className: "ll-expanded__bg-img"
|
|
1384
1414
|
}
|
|
1385
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1386
|
-
|
|
1415
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Te = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Te.toUpperCase()) || "A" }) }),
|
|
1416
|
+
o && !te && /* @__PURE__ */ n(
|
|
1387
1417
|
"video",
|
|
1388
1418
|
{
|
|
1389
1419
|
className: "ll-expanded__bg-idle",
|
|
1390
|
-
src:
|
|
1420
|
+
src: o,
|
|
1391
1421
|
autoPlay: !0,
|
|
1392
1422
|
loop: !0,
|
|
1393
1423
|
muted: !0,
|
|
@@ -1395,24 +1425,24 @@ const Sr = ({
|
|
|
1395
1425
|
}
|
|
1396
1426
|
)
|
|
1397
1427
|
] }),
|
|
1398
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1399
|
-
|
|
1428
|
+
/* @__PURE__ */ n("div", { ref: ct, className: "ll-expanded__video" }),
|
|
1429
|
+
ze && /* @__PURE__ */ v("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1400
1430
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1401
1431
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: f ? "Switching..." : "Connecting..." })
|
|
1402
1432
|
] }),
|
|
1403
|
-
|
|
1433
|
+
D && te && /* @__PURE__ */ v(
|
|
1404
1434
|
"button",
|
|
1405
1435
|
{
|
|
1406
1436
|
type: "button",
|
|
1407
1437
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1408
|
-
onClick:
|
|
1438
|
+
onClick: De,
|
|
1409
1439
|
children: [
|
|
1410
1440
|
/* @__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" }) }),
|
|
1411
1441
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1412
1442
|
]
|
|
1413
1443
|
}
|
|
1414
1444
|
),
|
|
1415
|
-
at && /* @__PURE__ */
|
|
1445
|
+
at && /* @__PURE__ */ v(
|
|
1416
1446
|
"div",
|
|
1417
1447
|
{
|
|
1418
1448
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
@@ -1425,69 +1455,69 @@ const Sr = ({
|
|
|
1425
1455
|
]
|
|
1426
1456
|
}
|
|
1427
1457
|
),
|
|
1428
|
-
|
|
1429
|
-
!
|
|
1430
|
-
!
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
/* @__PURE__ */
|
|
1458
|
+
_e ? /* @__PURE__ */ v(ot, { children: [
|
|
1459
|
+
!ee && /* @__PURE__ */ v("div", { className: "ll-expanded__topbar", children: [
|
|
1460
|
+
!he && /* @__PURE__ */ v("div", { className: "ll-expanded__topbar-left", children: [
|
|
1461
|
+
/* @__PURE__ */ v("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1462
|
+
/* @__PURE__ */ v(
|
|
1433
1463
|
"button",
|
|
1434
1464
|
{
|
|
1435
1465
|
type: "button",
|
|
1436
1466
|
className: "ll-hpill",
|
|
1437
|
-
onClick: (
|
|
1438
|
-
|
|
1467
|
+
onClick: (h) => {
|
|
1468
|
+
we && (h.stopPropagation(), u());
|
|
1439
1469
|
},
|
|
1440
|
-
"aria-haspopup":
|
|
1441
|
-
"aria-expanded":
|
|
1470
|
+
"aria-haspopup": we ? "listbox" : void 0,
|
|
1471
|
+
"aria-expanded": we ? _ : void 0,
|
|
1442
1472
|
children: [
|
|
1443
1473
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1444
|
-
|
|
1474
|
+
we && /* @__PURE__ */ n(ht, {})
|
|
1445
1475
|
]
|
|
1446
1476
|
}
|
|
1447
1477
|
),
|
|
1448
|
-
|
|
1478
|
+
we && _ && /* @__PURE__ */ n(
|
|
1449
1479
|
"div",
|
|
1450
1480
|
{
|
|
1451
1481
|
className: "ll-hmenu",
|
|
1452
|
-
onClick: (
|
|
1482
|
+
onClick: (h) => h.stopPropagation(),
|
|
1453
1483
|
role: "listbox",
|
|
1454
|
-
children:
|
|
1484
|
+
children: a == null ? void 0 : a.map((h) => /* @__PURE__ */ v(
|
|
1455
1485
|
"button",
|
|
1456
1486
|
{
|
|
1457
1487
|
type: "button",
|
|
1458
|
-
className: `ll-hmenu__item ${
|
|
1459
|
-
onClick: () =>
|
|
1488
|
+
className: `ll-hmenu__item ${h.id === d ? "is-active" : ""}`,
|
|
1489
|
+
onClick: () => c(h.id),
|
|
1460
1490
|
role: "option",
|
|
1461
|
-
"aria-selected":
|
|
1491
|
+
"aria-selected": h.id === d,
|
|
1462
1492
|
children: [
|
|
1463
|
-
|
|
1493
|
+
h.avatarImageUrl && /* @__PURE__ */ n(
|
|
1464
1494
|
"img",
|
|
1465
1495
|
{
|
|
1466
|
-
src:
|
|
1496
|
+
src: h.avatarImageUrl,
|
|
1467
1497
|
alt: "",
|
|
1468
1498
|
className: "ll-hmenu__avatar"
|
|
1469
1499
|
}
|
|
1470
1500
|
),
|
|
1471
|
-
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children:
|
|
1472
|
-
|
|
1501
|
+
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: h.name }),
|
|
1502
|
+
h.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: h.role })
|
|
1473
1503
|
]
|
|
1474
1504
|
},
|
|
1475
|
-
|
|
1505
|
+
h.id
|
|
1476
1506
|
))
|
|
1477
1507
|
}
|
|
1478
1508
|
)
|
|
1479
1509
|
] }),
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ v("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1511
|
+
/* @__PURE__ */ v(
|
|
1482
1512
|
"button",
|
|
1483
1513
|
{
|
|
1484
1514
|
type: "button",
|
|
1485
1515
|
className: "ll-hpill ll-hpill--compact",
|
|
1486
|
-
onClick: (
|
|
1487
|
-
|
|
1516
|
+
onClick: (h) => {
|
|
1517
|
+
h.stopPropagation(), L();
|
|
1488
1518
|
},
|
|
1489
1519
|
"aria-haspopup": "listbox",
|
|
1490
|
-
"aria-expanded":
|
|
1520
|
+
"aria-expanded": R,
|
|
1491
1521
|
"aria-label": "Language: English",
|
|
1492
1522
|
title: "Language: English",
|
|
1493
1523
|
children: [
|
|
@@ -1496,11 +1526,11 @@ const Sr = ({
|
|
|
1496
1526
|
]
|
|
1497
1527
|
}
|
|
1498
1528
|
),
|
|
1499
|
-
|
|
1529
|
+
R && /* @__PURE__ */ n(
|
|
1500
1530
|
"div",
|
|
1501
1531
|
{
|
|
1502
1532
|
className: "ll-hmenu",
|
|
1503
|
-
onClick: (
|
|
1533
|
+
onClick: (h) => h.stopPropagation(),
|
|
1504
1534
|
role: "listbox",
|
|
1505
1535
|
children: /* @__PURE__ */ n(
|
|
1506
1536
|
"button",
|
|
@@ -1518,18 +1548,18 @@ const Sr = ({
|
|
|
1518
1548
|
/* @__PURE__ */ n(
|
|
1519
1549
|
"span",
|
|
1520
1550
|
{
|
|
1521
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1522
|
-
children:
|
|
1551
|
+
className: `ll-expanded__state ll-expanded__state--${y}`,
|
|
1552
|
+
children: y
|
|
1523
1553
|
}
|
|
1524
1554
|
)
|
|
1525
1555
|
] }),
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
|
|
1556
|
+
/* @__PURE__ */ v("div", { className: "ll-expanded__header-actions", children: [
|
|
1557
|
+
be !== !1 && /* @__PURE__ */ n(
|
|
1528
1558
|
"button",
|
|
1529
1559
|
{
|
|
1530
1560
|
type: "button",
|
|
1531
1561
|
className: "ll-hbtn",
|
|
1532
|
-
onClick:
|
|
1562
|
+
onClick: st,
|
|
1533
1563
|
"aria-label": "Minimize widget",
|
|
1534
1564
|
title: "Minimize",
|
|
1535
1565
|
children: /* @__PURE__ */ n(nn, {})
|
|
@@ -1540,7 +1570,7 @@ const Sr = ({
|
|
|
1540
1570
|
{
|
|
1541
1571
|
type: "button",
|
|
1542
1572
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1543
|
-
onClick:
|
|
1573
|
+
onClick: dt,
|
|
1544
1574
|
"aria-label": "End call",
|
|
1545
1575
|
title: "End call",
|
|
1546
1576
|
children: /* @__PURE__ */ n(tn, {})
|
|
@@ -1548,24 +1578,24 @@ const Sr = ({
|
|
|
1548
1578
|
)
|
|
1549
1579
|
] })
|
|
1550
1580
|
] }),
|
|
1551
|
-
|
|
1581
|
+
ee && /* @__PURE__ */ v("div", { className: "ll-compact-status", "data-state": y, children: [
|
|
1552
1582
|
/* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1553
|
-
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children:
|
|
1583
|
+
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: y })
|
|
1554
1584
|
] })
|
|
1555
1585
|
] }) : (
|
|
1556
1586
|
// Idle-state header with Live Layer product name + minimize/close.
|
|
1557
1587
|
// Hidden in compact mode — on a 140×210 docked slot the brand pill
|
|
1558
1588
|
// and 40px buttons crowded out the central "Start video call"
|
|
1559
1589
|
// affordance. The user can dismiss by scrolling past the slot.
|
|
1560
|
-
!
|
|
1590
|
+
!ee && /* @__PURE__ */ v("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1561
1591
|
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Qe }),
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
|
|
1592
|
+
/* @__PURE__ */ v("div", { className: "ll-expanded__header-actions", children: [
|
|
1593
|
+
be !== !1 && /* @__PURE__ */ n(
|
|
1564
1594
|
"button",
|
|
1565
1595
|
{
|
|
1566
1596
|
type: "button",
|
|
1567
1597
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1568
|
-
onClick:
|
|
1598
|
+
onClick: st,
|
|
1569
1599
|
"aria-label": "Minimize widget",
|
|
1570
1600
|
children: /* @__PURE__ */ n(nn, {})
|
|
1571
1601
|
}
|
|
@@ -1575,7 +1605,7 @@ const Sr = ({
|
|
|
1575
1605
|
{
|
|
1576
1606
|
type: "button",
|
|
1577
1607
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1578
|
-
onClick:
|
|
1608
|
+
onClick: dt,
|
|
1579
1609
|
"aria-label": "Close widget",
|
|
1580
1610
|
children: /* @__PURE__ */ n(tn, {})
|
|
1581
1611
|
}
|
|
@@ -1583,23 +1613,23 @@ const Sr = ({
|
|
|
1583
1613
|
] })
|
|
1584
1614
|
] })
|
|
1585
1615
|
),
|
|
1586
|
-
|
|
1587
|
-
const
|
|
1588
|
-
return /* @__PURE__ */
|
|
1589
|
-
!z && /* @__PURE__ */
|
|
1616
|
+
bt && /* @__PURE__ */ (() => {
|
|
1617
|
+
const h = S ? "Resume session" : b === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1618
|
+
return /* @__PURE__ */ v(ot, { children: [
|
|
1619
|
+
!z && /* @__PURE__ */ v(
|
|
1590
1620
|
"button",
|
|
1591
1621
|
{
|
|
1592
1622
|
type: "button",
|
|
1593
1623
|
className: "ll-expanded__play",
|
|
1594
1624
|
onClick: Ve,
|
|
1595
|
-
"aria-label":
|
|
1625
|
+
"aria-label": h,
|
|
1596
1626
|
children: [
|
|
1597
1627
|
/* @__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" }) }) }),
|
|
1598
|
-
|
|
1628
|
+
ee && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: h })
|
|
1599
1629
|
]
|
|
1600
1630
|
}
|
|
1601
1631
|
),
|
|
1602
|
-
!
|
|
1632
|
+
!ee && /* @__PURE__ */ v("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1603
1633
|
l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
|
|
1604
1634
|
/* @__PURE__ */ n(
|
|
1605
1635
|
"button",
|
|
@@ -1607,73 +1637,73 @@ const Sr = ({
|
|
|
1607
1637
|
type: "button",
|
|
1608
1638
|
className: "ll-expanded__cta",
|
|
1609
1639
|
onClick: Ve,
|
|
1610
|
-
"aria-label":
|
|
1611
|
-
children:
|
|
1640
|
+
"aria-label": h,
|
|
1641
|
+
children: h
|
|
1612
1642
|
}
|
|
1613
1643
|
)
|
|
1614
1644
|
] })
|
|
1615
1645
|
] });
|
|
1616
1646
|
})(),
|
|
1617
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ v(
|
|
1618
1648
|
"div",
|
|
1619
1649
|
{
|
|
1620
|
-
className: `ll-expanded__pip ${
|
|
1650
|
+
className: `ll-expanded__pip ${_e && (N || ie) ? "is-visible" : ""}`,
|
|
1621
1651
|
children: [
|
|
1622
1652
|
/* @__PURE__ */ n(
|
|
1623
1653
|
"div",
|
|
1624
1654
|
{
|
|
1625
|
-
ref:
|
|
1626
|
-
className:
|
|
1655
|
+
ref: se,
|
|
1656
|
+
className: ie ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1627
1657
|
}
|
|
1628
1658
|
),
|
|
1629
1659
|
/* @__PURE__ */ n(
|
|
1630
1660
|
"div",
|
|
1631
1661
|
{
|
|
1632
|
-
ref:
|
|
1633
|
-
className: !
|
|
1662
|
+
ref: xe,
|
|
1663
|
+
className: !ie && N ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1634
1664
|
}
|
|
1635
1665
|
)
|
|
1636
1666
|
]
|
|
1637
1667
|
}
|
|
1638
1668
|
),
|
|
1639
|
-
|
|
1640
|
-
!
|
|
1669
|
+
_e ? /* @__PURE__ */ v("div", { className: "ll-expanded__bottom", children: [
|
|
1670
|
+
!ee && ft && /* @__PURE__ */ n(
|
|
1641
1671
|
"div",
|
|
1642
1672
|
{
|
|
1643
1673
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1644
1674
|
"data-role": "agent",
|
|
1645
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1675
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: ft })
|
|
1646
1676
|
}
|
|
1647
1677
|
),
|
|
1648
|
-
!
|
|
1678
|
+
!ee && He && /* @__PURE__ */ n(
|
|
1649
1679
|
"div",
|
|
1650
1680
|
{
|
|
1651
1681
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
1652
1682
|
"data-role": "user",
|
|
1653
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1683
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: He })
|
|
1654
1684
|
}
|
|
1655
1685
|
),
|
|
1656
|
-
!
|
|
1657
|
-
|
|
1686
|
+
!he && !ee && /* @__PURE__ */ v("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
|
|
1687
|
+
ve && /* @__PURE__ */ n(
|
|
1658
1688
|
"button",
|
|
1659
1689
|
{
|
|
1660
1690
|
type: "button",
|
|
1661
|
-
className: `ll-tool ${
|
|
1662
|
-
onClick:
|
|
1663
|
-
"aria-label":
|
|
1664
|
-
title:
|
|
1691
|
+
className: `ll-tool ${ie ? "is-on" : ""}`,
|
|
1692
|
+
onClick: Ie,
|
|
1693
|
+
"aria-label": ie ? "Stop sharing screen" : "Share screen",
|
|
1694
|
+
title: ie ? "Stop sharing" : "Share screen",
|
|
1665
1695
|
children: /* @__PURE__ */ n(fn, {})
|
|
1666
1696
|
}
|
|
1667
1697
|
),
|
|
1668
|
-
|
|
1698
|
+
fe && /* @__PURE__ */ v("div", { className: "ll-tool-split", children: [
|
|
1669
1699
|
/* @__PURE__ */ n(
|
|
1670
1700
|
"button",
|
|
1671
1701
|
{
|
|
1672
1702
|
type: "button",
|
|
1673
|
-
className: `ll-tool ll-tool--left ${
|
|
1674
|
-
onClick:
|
|
1675
|
-
"aria-label":
|
|
1676
|
-
title:
|
|
1703
|
+
className: `ll-tool ll-tool--left ${N ? "is-on" : ""}`,
|
|
1704
|
+
onClick: Re,
|
|
1705
|
+
"aria-label": N ? "Turn off camera" : "Turn on camera",
|
|
1706
|
+
title: N ? "Stop camera" : "Start camera",
|
|
1677
1707
|
children: /* @__PURE__ */ n(pn, {})
|
|
1678
1708
|
}
|
|
1679
1709
|
),
|
|
@@ -1681,61 +1711,63 @@ const Sr = ({
|
|
|
1681
1711
|
"button",
|
|
1682
1712
|
{
|
|
1683
1713
|
type: "button",
|
|
1684
|
-
className: `ll-tool ll-tool--right ${
|
|
1685
|
-
onClick: (
|
|
1686
|
-
|
|
1714
|
+
className: `ll-tool ll-tool--right ${N ? "is-on" : ""}`,
|
|
1715
|
+
onClick: (h) => {
|
|
1716
|
+
h.stopPropagation(), ne((V) => !V), ke(!1);
|
|
1687
1717
|
},
|
|
1688
1718
|
"aria-label": "Camera devices",
|
|
1689
1719
|
"aria-haspopup": "listbox",
|
|
1690
|
-
"aria-expanded":
|
|
1720
|
+
"aria-expanded": G,
|
|
1691
1721
|
children: /* @__PURE__ */ n(ht, {})
|
|
1692
1722
|
}
|
|
1693
1723
|
),
|
|
1694
|
-
|
|
1724
|
+
G && F.length > 0 && /* @__PURE__ */ n(
|
|
1695
1725
|
rn,
|
|
1696
1726
|
{
|
|
1697
1727
|
label: "Camera",
|
|
1698
|
-
devices:
|
|
1699
|
-
activeId:
|
|
1700
|
-
onPick: (
|
|
1701
|
-
|
|
1728
|
+
devices: F,
|
|
1729
|
+
activeId: re,
|
|
1730
|
+
onPick: (h) => {
|
|
1731
|
+
ne(!1), $e(h);
|
|
1702
1732
|
}
|
|
1703
1733
|
}
|
|
1704
1734
|
)
|
|
1705
1735
|
] }),
|
|
1706
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ v("div", { className: "ll-tool-split", children: [
|
|
1707
1737
|
/* @__PURE__ */ n(
|
|
1708
1738
|
"button",
|
|
1709
1739
|
{
|
|
1710
1740
|
type: "button",
|
|
1711
|
-
className: `ll-tool ll-tool--left ${
|
|
1712
|
-
onClick:
|
|
1713
|
-
"aria-label":
|
|
1714
|
-
title:
|
|
1715
|
-
children: /* @__PURE__ */ n(hn, { muted:
|
|
1741
|
+
className: `ll-tool ll-tool--left ${x ? "is-muted" : ""}`,
|
|
1742
|
+
onClick: Ae,
|
|
1743
|
+
"aria-label": x ? "Unmute microphone" : "Mute microphone",
|
|
1744
|
+
title: x ? "Unmute" : "Mute",
|
|
1745
|
+
children: /* @__PURE__ */ n(hn, { muted: x })
|
|
1716
1746
|
}
|
|
1717
1747
|
),
|
|
1718
1748
|
/* @__PURE__ */ n(
|
|
1719
1749
|
"button",
|
|
1720
1750
|
{
|
|
1721
1751
|
type: "button",
|
|
1722
|
-
className: `ll-tool ll-tool--right ${
|
|
1723
|
-
onClick: (
|
|
1724
|
-
|
|
1752
|
+
className: `ll-tool ll-tool--right ${x ? "is-muted" : ""}`,
|
|
1753
|
+
onClick: (h) => {
|
|
1754
|
+
h.stopPropagation(), ke((V) => !V), ne(!1);
|
|
1725
1755
|
},
|
|
1726
1756
|
"aria-label": "Microphone devices",
|
|
1727
1757
|
"aria-haspopup": "listbox",
|
|
1728
|
-
"aria-expanded":
|
|
1758
|
+
"aria-expanded": me,
|
|
1729
1759
|
children: /* @__PURE__ */ n(ht, {})
|
|
1730
1760
|
}
|
|
1731
1761
|
),
|
|
1732
|
-
|
|
1762
|
+
me && B.length > 0 && /* @__PURE__ */ n(
|
|
1733
1763
|
rn,
|
|
1734
1764
|
{
|
|
1735
1765
|
label: "Microphone",
|
|
1736
|
-
devices:
|
|
1737
|
-
activeId:
|
|
1738
|
-
onPick: () =>
|
|
1766
|
+
devices: B,
|
|
1767
|
+
activeId: q,
|
|
1768
|
+
onPick: (h) => {
|
|
1769
|
+
ke(!1), Pe(h);
|
|
1770
|
+
}
|
|
1739
1771
|
}
|
|
1740
1772
|
)
|
|
1741
1773
|
] }),
|
|
@@ -1743,11 +1775,11 @@ const Sr = ({
|
|
|
1743
1775
|
"button",
|
|
1744
1776
|
{
|
|
1745
1777
|
type: "button",
|
|
1746
|
-
className: `ll-tool ${
|
|
1747
|
-
onClick:
|
|
1748
|
-
"aria-label":
|
|
1749
|
-
title:
|
|
1750
|
-
children: /* @__PURE__ */ n(mn, { muted:
|
|
1778
|
+
className: `ll-tool ${ae ? "is-muted" : ""}`,
|
|
1779
|
+
onClick: Me,
|
|
1780
|
+
"aria-label": ae ? "Unmute speaker" : "Mute speaker",
|
|
1781
|
+
title: ae ? "Unmute speaker" : "Mute speaker",
|
|
1782
|
+
children: /* @__PURE__ */ n(mn, { muted: ae })
|
|
1751
1783
|
}
|
|
1752
1784
|
),
|
|
1753
1785
|
/* @__PURE__ */ n(
|
|
@@ -1762,38 +1794,38 @@ const Sr = ({
|
|
|
1762
1794
|
}
|
|
1763
1795
|
)
|
|
1764
1796
|
] }),
|
|
1765
|
-
!
|
|
1797
|
+
!he && ee && /* @__PURE__ */ n(
|
|
1766
1798
|
Lr,
|
|
1767
1799
|
{
|
|
1768
|
-
isMuted:
|
|
1769
|
-
onToggleMute:
|
|
1770
|
-
isCameraEnabled:
|
|
1771
|
-
onToggleCamera:
|
|
1772
|
-
allowCamera:
|
|
1773
|
-
isScreenShareEnabled:
|
|
1774
|
-
onToggleScreenShare:
|
|
1775
|
-
allowScreenShare:
|
|
1776
|
-
isSpeakerMuted:
|
|
1777
|
-
onToggleSpeaker:
|
|
1778
|
-
allowTyping:
|
|
1779
|
-
isTypingOpen:
|
|
1780
|
-
onToggleTyping:
|
|
1800
|
+
isMuted: x,
|
|
1801
|
+
onToggleMute: Ae,
|
|
1802
|
+
isCameraEnabled: N,
|
|
1803
|
+
onToggleCamera: Re,
|
|
1804
|
+
allowCamera: fe,
|
|
1805
|
+
isScreenShareEnabled: ie,
|
|
1806
|
+
onToggleScreenShare: Ie,
|
|
1807
|
+
allowScreenShare: ve,
|
|
1808
|
+
isSpeakerMuted: ae,
|
|
1809
|
+
onToggleSpeaker: Me,
|
|
1810
|
+
allowTyping: pe,
|
|
1811
|
+
isTypingOpen: Le,
|
|
1812
|
+
onToggleTyping: wt,
|
|
1781
1813
|
onDisconnect: Ye
|
|
1782
1814
|
}
|
|
1783
1815
|
),
|
|
1784
|
-
!
|
|
1816
|
+
!he && pe && (ee ? Le : !0) && /* @__PURE__ */ v("form", { className: "ll-message-input", onSubmit: ut, children: [
|
|
1785
1817
|
/* @__PURE__ */ n(
|
|
1786
1818
|
"input",
|
|
1787
1819
|
{
|
|
1788
1820
|
type: "text",
|
|
1789
1821
|
className: "ll-message-input__field",
|
|
1790
1822
|
placeholder: "Message...",
|
|
1791
|
-
value:
|
|
1792
|
-
onChange: (
|
|
1823
|
+
value: Ee,
|
|
1824
|
+
onChange: (h) => Oe(h.target.value),
|
|
1793
1825
|
"aria-label": "Message the agent"
|
|
1794
1826
|
}
|
|
1795
1827
|
),
|
|
1796
|
-
|
|
1828
|
+
Ee.trim() && /* @__PURE__ */ n(
|
|
1797
1829
|
"button",
|
|
1798
1830
|
{
|
|
1799
1831
|
type: "submit",
|
|
@@ -1805,9 +1837,9 @@ const Sr = ({
|
|
|
1805
1837
|
] })
|
|
1806
1838
|
] }) : null,
|
|
1807
1839
|
(() => {
|
|
1808
|
-
if (
|
|
1809
|
-
return /* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */ n("span", { children:
|
|
1840
|
+
if (T && b !== "error")
|
|
1841
|
+
return /* @__PURE__ */ v("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1842
|
+
/* @__PURE__ */ n("span", { children: T }),
|
|
1811
1843
|
/* @__PURE__ */ n(
|
|
1812
1844
|
"button",
|
|
1813
1845
|
{
|
|
@@ -1819,16 +1851,16 @@ const Sr = ({
|
|
|
1819
1851
|
}
|
|
1820
1852
|
)
|
|
1821
1853
|
] });
|
|
1822
|
-
if (!z ||
|
|
1823
|
-
let
|
|
1824
|
-
return z === "MIC_PERMISSION_DENIED" ?
|
|
1825
|
-
/* @__PURE__ */ n("span", { children:
|
|
1854
|
+
if (!z || b !== "error") return null;
|
|
1855
|
+
let h = "Failed to connect", V = "Try again";
|
|
1856
|
+
return z === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : z === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : z === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : z === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : z === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : z.length < 80 && (h = z), /* @__PURE__ */ v("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1857
|
+
/* @__PURE__ */ n("span", { children: h }),
|
|
1826
1858
|
/* @__PURE__ */ n(
|
|
1827
1859
|
"button",
|
|
1828
1860
|
{
|
|
1829
1861
|
type: "button",
|
|
1830
1862
|
className: "ll-expanded__banner-retry",
|
|
1831
|
-
onClick:
|
|
1863
|
+
onClick: Ge,
|
|
1832
1864
|
children: V
|
|
1833
1865
|
}
|
|
1834
1866
|
)
|
|
@@ -1842,7 +1874,7 @@ function ht() {
|
|
|
1842
1874
|
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" }) });
|
|
1843
1875
|
}
|
|
1844
1876
|
function tn() {
|
|
1845
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ v("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1846
1878
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1847
1879
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1848
1880
|
] });
|
|
@@ -1851,20 +1883,20 @@ function nn() {
|
|
|
1851
1883
|
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" }) });
|
|
1852
1884
|
}
|
|
1853
1885
|
function fn() {
|
|
1854
|
-
return /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ v("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: [
|
|
1855
1887
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1856
1888
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1857
1889
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1858
1890
|
] });
|
|
1859
1891
|
}
|
|
1860
1892
|
function pn() {
|
|
1861
|
-
return /* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ v("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: [
|
|
1862
1894
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1863
1895
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1864
1896
|
] });
|
|
1865
1897
|
}
|
|
1866
1898
|
function hn({ muted: e }) {
|
|
1867
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ v("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: [
|
|
1868
1900
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1869
1901
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1870
1902
|
/* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
@@ -1872,16 +1904,16 @@ function hn({ muted: e }) {
|
|
|
1872
1904
|
] });
|
|
1873
1905
|
}
|
|
1874
1906
|
function mn({ muted: e }) {
|
|
1875
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ v("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: [
|
|
1876
1908
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1877
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
1909
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ v(ot, { children: [
|
|
1878
1910
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1879
1911
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1880
1912
|
] })
|
|
1881
1913
|
] });
|
|
1882
1914
|
}
|
|
1883
1915
|
function Nr() {
|
|
1884
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ v("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1885
1917
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1886
1918
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1887
1919
|
] });
|
|
@@ -1895,30 +1927,30 @@ function gn() {
|
|
|
1895
1927
|
}
|
|
1896
1928
|
) });
|
|
1897
1929
|
}
|
|
1898
|
-
const rn = ({ label: e, devices: t, activeId: r, onPick:
|
|
1930
|
+
const rn = ({ label: e, devices: t, activeId: r, onPick: i }) => /* @__PURE__ */ v(
|
|
1899
1931
|
"div",
|
|
1900
1932
|
{
|
|
1901
1933
|
className: "ll-device-menu",
|
|
1902
|
-
onClick: (
|
|
1934
|
+
onClick: (o) => o.stopPropagation(),
|
|
1903
1935
|
role: "listbox",
|
|
1904
1936
|
children: [
|
|
1905
1937
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1906
|
-
t.map((
|
|
1907
|
-
const
|
|
1908
|
-
return /* @__PURE__ */
|
|
1938
|
+
t.map((o, l) => {
|
|
1939
|
+
const s = r === o.deviceId;
|
|
1940
|
+
return /* @__PURE__ */ v(
|
|
1909
1941
|
"button",
|
|
1910
1942
|
{
|
|
1911
1943
|
type: "button",
|
|
1912
|
-
className: `ll-device-menu__item ${
|
|
1913
|
-
onClick: () => o
|
|
1944
|
+
className: `ll-device-menu__item ${s ? "is-active" : ""}`,
|
|
1945
|
+
onClick: () => i(o.deviceId),
|
|
1914
1946
|
role: "option",
|
|
1915
|
-
"aria-selected":
|
|
1947
|
+
"aria-selected": s,
|
|
1916
1948
|
children: [
|
|
1917
|
-
|
|
1918
|
-
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children:
|
|
1949
|
+
s && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
1950
|
+
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: o.label || `${e} ${l + 1}` })
|
|
1919
1951
|
]
|
|
1920
1952
|
},
|
|
1921
|
-
|
|
1953
|
+
o.deviceId || l
|
|
1922
1954
|
);
|
|
1923
1955
|
})
|
|
1924
1956
|
]
|
|
@@ -1945,7 +1977,7 @@ function yt(e) {
|
|
|
1945
1977
|
}
|
|
1946
1978
|
return !0;
|
|
1947
1979
|
}
|
|
1948
|
-
const mt = 4096, Rr = 20, Ir = 20,
|
|
1980
|
+
const mt = 4096, Rr = 20, Ir = 20, Mr = 10, Tr = 10, Dr = 30, Pr = 20, on = 500, $r = [
|
|
1949
1981
|
'[data-ll-private="true"]',
|
|
1950
1982
|
".ll-widget",
|
|
1951
1983
|
"script",
|
|
@@ -1963,12 +1995,12 @@ function rt(e) {
|
|
|
1963
1995
|
}
|
|
1964
1996
|
return !1;
|
|
1965
1997
|
}
|
|
1966
|
-
function
|
|
1998
|
+
function it(e) {
|
|
1967
1999
|
if (typeof window > "u") return !0;
|
|
1968
2000
|
const t = e.getBoundingClientRect();
|
|
1969
2001
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
1970
|
-
const r = window.innerHeight || document.documentElement.clientHeight,
|
|
1971
|
-
return t.bottom > 0 && t.right > 0 && t.top < r && t.left <
|
|
2002
|
+
const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2003
|
+
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
|
|
1972
2004
|
}
|
|
1973
2005
|
function ln(e) {
|
|
1974
2006
|
const t = e.getAttribute("id");
|
|
@@ -1978,10 +2010,10 @@ function ln(e) {
|
|
|
1978
2010
|
}
|
|
1979
2011
|
const r = e.getAttribute("aria-label");
|
|
1980
2012
|
if (r) return r.trim();
|
|
1981
|
-
const
|
|
1982
|
-
if (
|
|
1983
|
-
const
|
|
1984
|
-
return
|
|
2013
|
+
const i = e.getAttribute("placeholder");
|
|
2014
|
+
if (i) return i.trim();
|
|
2015
|
+
const o = e.closest("label");
|
|
2016
|
+
return o != null && o.textContent ? o.textContent.trim() : "";
|
|
1985
2017
|
}
|
|
1986
2018
|
function ye(e, t) {
|
|
1987
2019
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
@@ -2003,114 +2035,114 @@ function zr(e, t = {}) {
|
|
|
2003
2035
|
forms: [],
|
|
2004
2036
|
extras: e
|
|
2005
2037
|
};
|
|
2006
|
-
const
|
|
2038
|
+
const i = typeof window < "u" && window.location.href || "", o = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
|
|
2007
2039
|
r.querySelectorAll("[data-ll-region]")
|
|
2008
|
-
),
|
|
2009
|
-
for (const
|
|
2010
|
-
if (
|
|
2011
|
-
if (rt(
|
|
2012
|
-
const
|
|
2013
|
-
(
|
|
2040
|
+
), a = [];
|
|
2041
|
+
for (const x of s) {
|
|
2042
|
+
if (a.length >= Mr) break;
|
|
2043
|
+
if (rt(x) || !it(x)) continue;
|
|
2044
|
+
const T = x.getAttribute("data-ll-region") ?? "", B = x.getAttribute("data-ll-intent") ?? void 0, q = ye(
|
|
2045
|
+
(x.innerText || x.textContent || "").trim(),
|
|
2014
2046
|
on * 2
|
|
2015
2047
|
);
|
|
2016
|
-
!
|
|
2048
|
+
!T || !q || a.push({ id: T, intent: B, text: q });
|
|
2017
2049
|
}
|
|
2018
|
-
const
|
|
2050
|
+
const d = [], f = ["H1", "H2", "H3", "H4", "H5", "H6"], _ = Array.from(
|
|
2019
2051
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2020
2052
|
);
|
|
2021
|
-
for (const
|
|
2022
|
-
if (rt(
|
|
2023
|
-
const
|
|
2024
|
-
|
|
2053
|
+
for (const x of _) {
|
|
2054
|
+
if (rt(x) || !it(x)) continue;
|
|
2055
|
+
const T = (x.textContent || "").trim();
|
|
2056
|
+
T && d.push(`${x.tagName}: ${ye(T, 200)}`);
|
|
2025
2057
|
}
|
|
2026
|
-
const
|
|
2027
|
-
for (const
|
|
2028
|
-
if (rt(
|
|
2029
|
-
const
|
|
2030
|
-
|
|
2058
|
+
const u = Array.from(r.querySelectorAll("p, li"));
|
|
2059
|
+
for (const x of u) {
|
|
2060
|
+
if (rt(x) || !it(x) || f.includes(x.tagName)) continue;
|
|
2061
|
+
const T = (x.textContent || "").trim();
|
|
2062
|
+
T.length > 10 && d.push(ye(T, on));
|
|
2031
2063
|
}
|
|
2032
|
-
const
|
|
2033
|
-
`),
|
|
2034
|
-
for (const
|
|
2035
|
-
if (
|
|
2036
|
-
if (rt(
|
|
2037
|
-
const
|
|
2038
|
-
!
|
|
2064
|
+
const c = d.join(`
|
|
2065
|
+
`), R = [], L = Array.from(r.querySelectorAll("a[href]"));
|
|
2066
|
+
for (const x of L) {
|
|
2067
|
+
if (R.length >= Rr) break;
|
|
2068
|
+
if (rt(x) || !it(x)) continue;
|
|
2069
|
+
const T = x.getAttribute("href") || "", B = (x.textContent || "").trim();
|
|
2070
|
+
!T || !B || R.push({ href: T, text: ye(B, 100) });
|
|
2039
2071
|
}
|
|
2040
|
-
const
|
|
2072
|
+
const b = [], y = Array.from(
|
|
2041
2073
|
r.querySelectorAll(
|
|
2042
2074
|
"input, textarea, select"
|
|
2043
2075
|
)
|
|
2044
2076
|
);
|
|
2045
|
-
for (const
|
|
2046
|
-
if (
|
|
2047
|
-
if (rt(
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2077
|
+
for (const x of y) {
|
|
2078
|
+
if (b.length >= Ir) break;
|
|
2079
|
+
if (rt(x) || !yt(x) || !it(x)) continue;
|
|
2080
|
+
const T = ln(x), B = x instanceof HTMLInputElement ? x.type : x.tagName.toLowerCase();
|
|
2081
|
+
T && b.push({ label: ye(T, 100), type: B });
|
|
2050
2082
|
}
|
|
2051
|
-
const
|
|
2083
|
+
const m = Array.from(
|
|
2052
2084
|
r.querySelectorAll("[data-ll-form]")
|
|
2053
|
-
),
|
|
2054
|
-
for (const
|
|
2055
|
-
if (
|
|
2056
|
-
if (At(
|
|
2057
|
-
const
|
|
2058
|
-
if (!
|
|
2059
|
-
const
|
|
2060
|
-
|
|
2085
|
+
), S = [];
|
|
2086
|
+
for (const x of m) {
|
|
2087
|
+
if (S.length >= Tr) break;
|
|
2088
|
+
if (At(x)) continue;
|
|
2089
|
+
const T = x.getAttribute("data-ll-form") || "";
|
|
2090
|
+
if (!T) continue;
|
|
2091
|
+
const B = x.getAttribute("data-ll-intent") || void 0, q = Array.from(
|
|
2092
|
+
x.querySelectorAll(
|
|
2061
2093
|
"[data-ll-field]"
|
|
2062
2094
|
)
|
|
2063
|
-
),
|
|
2064
|
-
for (const
|
|
2065
|
-
if (
|
|
2066
|
-
if (!yt(
|
|
2067
|
-
const F =
|
|
2095
|
+
), N = [];
|
|
2096
|
+
for (const M of q) {
|
|
2097
|
+
if (N.length >= Dr) break;
|
|
2098
|
+
if (!yt(M)) continue;
|
|
2099
|
+
const F = M.getAttribute("data-ll-field") || "";
|
|
2068
2100
|
if (!F) continue;
|
|
2069
|
-
const
|
|
2101
|
+
const re = ln(M) || F, ie = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), Z = {
|
|
2070
2102
|
name: F,
|
|
2071
|
-
label: ye(
|
|
2072
|
-
type:
|
|
2103
|
+
label: ye(re, 100),
|
|
2104
|
+
type: ie
|
|
2073
2105
|
};
|
|
2074
|
-
if (
|
|
2075
|
-
const
|
|
2076
|
-
for (let ve = 0; ve <
|
|
2077
|
-
const
|
|
2078
|
-
if (!
|
|
2079
|
-
const
|
|
2080
|
-
!
|
|
2106
|
+
if (M.required === !0 && (Z.required = !0), M instanceof HTMLSelectElement) {
|
|
2107
|
+
const fe = [];
|
|
2108
|
+
for (let ve = 0; ve < M.options.length && !(fe.length >= Pr); ve++) {
|
|
2109
|
+
const pe = M.options[ve];
|
|
2110
|
+
if (!pe || pe.disabled) continue;
|
|
2111
|
+
const be = pe.value || "", he = (pe.textContent || "").trim() || be;
|
|
2112
|
+
!be && !he || fe.push({ value: be, label: ye(he, 60) });
|
|
2081
2113
|
}
|
|
2082
|
-
|
|
2114
|
+
fe.length > 0 && (Z.options = fe);
|
|
2083
2115
|
}
|
|
2084
|
-
const
|
|
2085
|
-
|
|
2116
|
+
const ae = typeof M.validationMessage == "string" ? M.validationMessage : "";
|
|
2117
|
+
ae && (Z.validationMessage = ye(ae, 200)), N.push(Z);
|
|
2086
2118
|
}
|
|
2087
|
-
|
|
2119
|
+
S.push({ id: T, intent: B, fields: N });
|
|
2088
2120
|
}
|
|
2089
|
-
const
|
|
2090
|
-
url:
|
|
2121
|
+
const D = {
|
|
2122
|
+
url: i,
|
|
2091
2123
|
title: l,
|
|
2092
|
-
pathname:
|
|
2093
|
-
regions:
|
|
2094
|
-
visibleText:
|
|
2095
|
-
visibleLinks:
|
|
2096
|
-
visibleFields:
|
|
2097
|
-
forms:
|
|
2124
|
+
pathname: o,
|
|
2125
|
+
regions: a,
|
|
2126
|
+
visibleText: c,
|
|
2127
|
+
visibleLinks: R,
|
|
2128
|
+
visibleFields: b,
|
|
2129
|
+
forms: S,
|
|
2098
2130
|
extras: e
|
|
2099
2131
|
};
|
|
2100
|
-
let z = Be(JSON.stringify(
|
|
2101
|
-
for (; z > mt &&
|
|
2102
|
-
|
|
2103
|
-
for (; z > mt &&
|
|
2104
|
-
|
|
2105
|
-
return Be(
|
|
2132
|
+
let z = Be(JSON.stringify(D.regions)) + Be(D.visibleText) + Be(JSON.stringify(D.visibleLinks)) + Be(JSON.stringify(D.visibleFields));
|
|
2133
|
+
for (; z > mt && D.visibleFields.length > 0; )
|
|
2134
|
+
D.visibleFields.pop(), z = Be(JSON.stringify(D.visibleFields));
|
|
2135
|
+
for (; z > mt && D.visibleLinks.length > 0; )
|
|
2136
|
+
D.visibleLinks.pop(), z -= 80;
|
|
2137
|
+
return Be(D.visibleText) > mt && (D.visibleText = ye(D.visibleText, mt - 100)), D;
|
|
2106
2138
|
}
|
|
2107
2139
|
let qe = null;
|
|
2108
2140
|
function an(e, t = {}) {
|
|
2109
|
-
const r = Date.now(),
|
|
2110
|
-
if (qe && qe.key ===
|
|
2141
|
+
const r = Date.now(), o = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
2142
|
+
if (qe && qe.key === o && r - qe.at < 1e3)
|
|
2111
2143
|
return qe.ctx;
|
|
2112
2144
|
const l = zr(e, t);
|
|
2113
|
-
return qe = { key:
|
|
2145
|
+
return qe = { key: o, at: r, ctx: l }, l;
|
|
2114
2146
|
}
|
|
2115
2147
|
function Or() {
|
|
2116
2148
|
qe = null;
|
|
@@ -2132,27 +2164,27 @@ function Br(e) {
|
|
|
2132
2164
|
function qr(e) {
|
|
2133
2165
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2134
2166
|
if (!t) return [];
|
|
2135
|
-
const r = typeof window < "u" && window.location.origin || "",
|
|
2136
|
-
for (const
|
|
2137
|
-
if (
|
|
2138
|
-
if (At(
|
|
2139
|
-
const
|
|
2140
|
-
if (!Br(
|
|
2141
|
-
let
|
|
2167
|
+
const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), o = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
2168
|
+
for (const s of l) {
|
|
2169
|
+
if (o.length >= Hr) break;
|
|
2170
|
+
if (At(s)) continue;
|
|
2171
|
+
const a = s.getAttribute("href") || "";
|
|
2172
|
+
if (!Br(a)) continue;
|
|
2173
|
+
let d = a, f = !0;
|
|
2142
2174
|
try {
|
|
2143
2175
|
if (typeof window < "u") {
|
|
2144
|
-
const
|
|
2145
|
-
f =
|
|
2176
|
+
const u = new URL(a, r);
|
|
2177
|
+
f = u.origin === r, f && a.startsWith("http") && (d = u.pathname + u.search + u.hash);
|
|
2146
2178
|
}
|
|
2147
2179
|
} catch {
|
|
2148
2180
|
continue;
|
|
2149
2181
|
}
|
|
2150
|
-
if (
|
|
2151
|
-
|
|
2152
|
-
const
|
|
2153
|
-
|
|
2182
|
+
if (i.has(d)) continue;
|
|
2183
|
+
i.add(d);
|
|
2184
|
+
const _ = (s.textContent || "").trim().slice(0, 120);
|
|
2185
|
+
o.push({ href: d, text: _, internal: f });
|
|
2154
2186
|
}
|
|
2155
|
-
return
|
|
2187
|
+
return o;
|
|
2156
2188
|
}
|
|
2157
2189
|
let Fe = null;
|
|
2158
2190
|
const Fr = 5e3;
|
|
@@ -2167,20 +2199,20 @@ function Ur() {
|
|
|
2167
2199
|
Fe = null;
|
|
2168
2200
|
}
|
|
2169
2201
|
function jr(e, t) {
|
|
2170
|
-
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype,
|
|
2171
|
-
|
|
2202
|
+
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;
|
|
2203
|
+
o ? o.call(e, t) : e.value = t;
|
|
2172
2204
|
}
|
|
2173
2205
|
function Vr(e, t, r = {}) {
|
|
2174
|
-
const
|
|
2206
|
+
const i = r.triggerInput ?? !0, o = r.triggerChange ?? !0;
|
|
2175
2207
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2176
2208
|
const l = Object.getOwnPropertyDescriptor(
|
|
2177
2209
|
HTMLInputElement.prototype,
|
|
2178
2210
|
"checked"
|
|
2179
|
-
),
|
|
2180
|
-
|
|
2211
|
+
), s = l == null ? void 0 : l.set, a = t === "true" || t === "1" || t === "on";
|
|
2212
|
+
s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2181
2213
|
return;
|
|
2182
2214
|
}
|
|
2183
|
-
jr(e, t),
|
|
2215
|
+
jr(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), o && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2184
2216
|
}
|
|
2185
2217
|
function Yr() {
|
|
2186
2218
|
if (typeof window > "u" || typeof document > "u")
|
|
@@ -2201,12 +2233,12 @@ function Jr() {
|
|
|
2201
2233
|
document.querySelectorAll("body, body *")
|
|
2202
2234
|
);
|
|
2203
2235
|
let t = null, r = 0;
|
|
2204
|
-
for (const
|
|
2205
|
-
if (!Gr(
|
|
2206
|
-
const
|
|
2207
|
-
if (
|
|
2208
|
-
const l =
|
|
2209
|
-
l > r && (r = l, t =
|
|
2236
|
+
for (const i of e) {
|
|
2237
|
+
if (!Gr(i)) continue;
|
|
2238
|
+
const o = i.getBoundingClientRect();
|
|
2239
|
+
if (o.bottom <= 0 || o.top >= window.innerHeight || o.right <= 0 || o.left >= window.innerWidth || o.width <= 0 || o.height <= 0 || i.closest(".ll-widget")) continue;
|
|
2240
|
+
const l = o.width * o.height;
|
|
2241
|
+
l > r && (r = l, t = i);
|
|
2210
2242
|
}
|
|
2211
2243
|
return t;
|
|
2212
2244
|
}
|
|
@@ -2217,7 +2249,7 @@ function Kr() {
|
|
|
2217
2249
|
const e = Jr();
|
|
2218
2250
|
return e || window;
|
|
2219
2251
|
}
|
|
2220
|
-
function
|
|
2252
|
+
function cn(e) {
|
|
2221
2253
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2222
2254
|
}
|
|
2223
2255
|
function Xr(e) {
|
|
@@ -2253,513 +2285,513 @@ const Qr = /* @__PURE__ */ new Set([
|
|
|
2253
2285
|
function(t, r) {
|
|
2254
2286
|
var Ot, Ht, Wt, Bt, qt, Ft, Ut;
|
|
2255
2287
|
const {
|
|
2256
|
-
agentId:
|
|
2257
|
-
apiKey:
|
|
2288
|
+
agentId: i,
|
|
2289
|
+
apiKey: o,
|
|
2258
2290
|
baseUrl: l = "https://app.livelayer.studio",
|
|
2259
|
-
sessionEndpoint:
|
|
2260
|
-
sessionBody:
|
|
2261
|
-
soundEffects:
|
|
2291
|
+
sessionEndpoint: s,
|
|
2292
|
+
sessionBody: a,
|
|
2293
|
+
soundEffects: d,
|
|
2262
2294
|
experienceMode: f = "WIDGET",
|
|
2263
|
-
autoConnect:
|
|
2264
|
-
displayMode:
|
|
2265
|
-
defaultDisplayMode:
|
|
2266
|
-
onDisplayModeChange:
|
|
2267
|
-
position:
|
|
2268
|
-
mobileBreakpoint:
|
|
2269
|
-
persistKey:
|
|
2270
|
-
disablePersistence:
|
|
2271
|
-
teamMembers:
|
|
2272
|
-
currentTeamMemberId:
|
|
2295
|
+
autoConnect: _ = !1,
|
|
2296
|
+
displayMode: u,
|
|
2297
|
+
defaultDisplayMode: c = "expanded",
|
|
2298
|
+
onDisplayModeChange: R,
|
|
2299
|
+
position: L = "bottom-right",
|
|
2300
|
+
mobileBreakpoint: b = 640,
|
|
2301
|
+
persistKey: y = "ll-widget",
|
|
2302
|
+
disablePersistence: m = !1,
|
|
2303
|
+
teamMembers: S,
|
|
2304
|
+
currentTeamMemberId: D,
|
|
2273
2305
|
onTeamMemberChange: z,
|
|
2274
|
-
idleLoopUrl:
|
|
2275
|
-
greeting:
|
|
2276
|
-
avatarImageUrl:
|
|
2277
|
-
agentName:
|
|
2278
|
-
branding:
|
|
2279
|
-
allowCamera:
|
|
2306
|
+
idleLoopUrl: x,
|
|
2307
|
+
greeting: T,
|
|
2308
|
+
avatarImageUrl: B,
|
|
2309
|
+
agentName: q,
|
|
2310
|
+
branding: N = {},
|
|
2311
|
+
allowCamera: M = !0,
|
|
2280
2312
|
allowScreenShare: F = !0,
|
|
2281
|
-
allowTyping:
|
|
2282
|
-
showMinimize:
|
|
2283
|
-
chromeless:
|
|
2284
|
-
compactControls:
|
|
2285
|
-
transforming:
|
|
2313
|
+
allowTyping: re = !0,
|
|
2314
|
+
showMinimize: ie = !0,
|
|
2315
|
+
chromeless: Z = !1,
|
|
2316
|
+
compactControls: ae = !1,
|
|
2317
|
+
transforming: fe = !1,
|
|
2286
2318
|
transformingLabel: ve = "Transforming…",
|
|
2287
|
-
showOn:
|
|
2288
|
-
hideOn:
|
|
2289
|
-
pathname:
|
|
2290
|
-
onNavigate:
|
|
2291
|
-
onScrollToSelector:
|
|
2292
|
-
getPageContext:
|
|
2293
|
-
pageContextExtras:
|
|
2294
|
-
getRoutes:
|
|
2295
|
-
onScrollPage:
|
|
2296
|
-
onClick:
|
|
2319
|
+
showOn: pe,
|
|
2320
|
+
hideOn: be,
|
|
2321
|
+
pathname: he,
|
|
2322
|
+
onNavigate: ee,
|
|
2323
|
+
onScrollToSelector: at,
|
|
2324
|
+
getPageContext: je,
|
|
2325
|
+
pageContextExtras: ct,
|
|
2326
|
+
getRoutes: oe,
|
|
2327
|
+
onScrollPage: Ve,
|
|
2328
|
+
onClick: Ye,
|
|
2297
2329
|
capabilities: Ge,
|
|
2298
|
-
onConnect:
|
|
2299
|
-
onDisconnect:
|
|
2330
|
+
onConnect: De,
|
|
2331
|
+
onDisconnect: Ae,
|
|
2300
2332
|
onTranscript: Pe,
|
|
2301
|
-
onAgentState:
|
|
2302
|
-
onConnectionStateChange:
|
|
2303
|
-
onAgentEvent:
|
|
2304
|
-
onAgentCommand:
|
|
2333
|
+
onAgentState: Re,
|
|
2334
|
+
onConnectionStateChange: $e,
|
|
2335
|
+
onAgentEvent: Ie,
|
|
2336
|
+
onAgentCommand: Me,
|
|
2305
2337
|
controlledSession: $,
|
|
2306
|
-
className:
|
|
2307
|
-
style:
|
|
2308
|
-
zIndex:
|
|
2309
|
-
} = t,
|
|
2310
|
-
|
|
2338
|
+
className: st,
|
|
2339
|
+
style: dt,
|
|
2340
|
+
zIndex: vt = 2147483647
|
|
2341
|
+
} = t, we = rr(he), _e = dr(we, pe, be);
|
|
2342
|
+
I(() => {
|
|
2311
2343
|
Or(), Ur();
|
|
2312
|
-
}, [
|
|
2313
|
-
const
|
|
2344
|
+
}, [we]);
|
|
2345
|
+
const te = D !== void 0, [bt, Je] = C(() => {
|
|
2314
2346
|
var g;
|
|
2315
|
-
return
|
|
2316
|
-
}),
|
|
2317
|
-
() => (
|
|
2318
|
-
[
|
|
2319
|
-
), Ke = (
|
|
2320
|
-
value:
|
|
2321
|
-
defaultValue:
|
|
2322
|
-
onChange:
|
|
2323
|
-
persistKey:
|
|
2324
|
-
disablePersistence:
|
|
2325
|
-
}),
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2328
|
-
|
|
2329
|
-
function
|
|
2347
|
+
return D ?? ((g = S == null ? void 0 : S[0]) == null ? void 0 : g.id);
|
|
2348
|
+
}), ce = te ? D : bt, X = Ue(
|
|
2349
|
+
() => (S == null ? void 0 : S.find((g) => g.id === ce)) ?? null,
|
|
2350
|
+
[S, ce]
|
|
2351
|
+
), Ke = (X == null ? void 0 : X.agentId) ?? i, ze = f === "EMBEDDED", [xe, se] = Zn({
|
|
2352
|
+
value: ze ? "expanded" : u,
|
|
2353
|
+
defaultValue: ze ? "expanded" : c,
|
|
2354
|
+
onChange: R,
|
|
2355
|
+
persistKey: y,
|
|
2356
|
+
disablePersistence: ze || m
|
|
2357
|
+
}), me = tr(b), ke = Bn(), G = qn(), ne = Un(), Le = jn(), Xe = Vn(), [wt, Ee] = C(!1), [Oe, ut] = C(!1), [Qe, de] = C(!1), [Ce, ft] = C(!1), [He, _t] = C(!1), Te = fr({ baseUrl: l, config: d }), h = A(Te);
|
|
2358
|
+
h.current = Te;
|
|
2359
|
+
const V = A(ee), xt = A(at), kt = A(Ve), Lt = A(Ye), Rt = A(je), It = A(ct), Mt = A(oe), Et = A(Ge), ue = A(null);
|
|
2360
|
+
V.current = ee, xt.current = at, kt.current = Ve, Lt.current = Ye, Rt.current = je, It.current = ct, Mt.current = oe, Et.current = Ge;
|
|
2361
|
+
function Se(g) {
|
|
2330
2362
|
const p = Et.current;
|
|
2331
2363
|
return p ? p.includes(g) : !0;
|
|
2332
2364
|
}
|
|
2333
|
-
function
|
|
2365
|
+
function Ne(g, p) {
|
|
2334
2366
|
console.warn(
|
|
2335
2367
|
`[LiveLayer] Agent command "${g}" blocked — capability "${p}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2336
2368
|
);
|
|
2337
2369
|
}
|
|
2338
|
-
const Ze =
|
|
2370
|
+
const Ze = E(
|
|
2339
2371
|
(g) => {
|
|
2340
|
-
var Y,
|
|
2372
|
+
var Y, le, ge, nt;
|
|
2341
2373
|
const p = g;
|
|
2342
2374
|
if (!(!p.type || typeof p.type != "string")) {
|
|
2343
|
-
if (
|
|
2344
|
-
if (!
|
|
2345
|
-
|
|
2375
|
+
if (Ie == null || Ie({ eventName: p.type, data: g }), p.type === "navigate") {
|
|
2376
|
+
if (!Se("navigate")) {
|
|
2377
|
+
Ne("navigate", "navigate");
|
|
2346
2378
|
return;
|
|
2347
2379
|
}
|
|
2348
|
-
const
|
|
2349
|
-
if (!
|
|
2380
|
+
const k = typeof p.href == "string" ? p.href : null;
|
|
2381
|
+
if (!k) {
|
|
2350
2382
|
console.warn(
|
|
2351
2383
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
2352
2384
|
);
|
|
2353
2385
|
return;
|
|
2354
2386
|
}
|
|
2355
|
-
if (
|
|
2387
|
+
if (h.current.playPageChange(), V.current) {
|
|
2356
2388
|
try {
|
|
2357
|
-
|
|
2358
|
-
} catch (
|
|
2389
|
+
V.current(k);
|
|
2390
|
+
} catch (P) {
|
|
2359
2391
|
console.warn(
|
|
2360
|
-
`[LiveLayer] onNavigate threw for "${
|
|
2361
|
-
|
|
2392
|
+
`[LiveLayer] onNavigate threw for "${k}". Falling back. Error:`,
|
|
2393
|
+
P
|
|
2362
2394
|
);
|
|
2363
2395
|
}
|
|
2364
2396
|
return;
|
|
2365
2397
|
}
|
|
2366
2398
|
if (typeof document < "u") {
|
|
2367
|
-
const
|
|
2368
|
-
`a[href="${
|
|
2399
|
+
const P = document.querySelector(
|
|
2400
|
+
`a[href="${k.replace(/"/g, '\\"')}"]`
|
|
2369
2401
|
);
|
|
2370
|
-
if (
|
|
2371
|
-
|
|
2402
|
+
if (P) {
|
|
2403
|
+
P.click();
|
|
2372
2404
|
return;
|
|
2373
2405
|
}
|
|
2374
2406
|
}
|
|
2375
2407
|
if (typeof window < "u" && typeof history < "u")
|
|
2376
2408
|
try {
|
|
2377
|
-
history.pushState({}, "",
|
|
2378
|
-
} catch (
|
|
2409
|
+
history.pushState({}, "", k), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
2410
|
+
} catch (P) {
|
|
2379
2411
|
console.warn(
|
|
2380
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
2381
|
-
|
|
2412
|
+
`[LiveLayer] history.pushState fallback failed for "${k}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
2413
|
+
P
|
|
2382
2414
|
);
|
|
2383
2415
|
}
|
|
2384
2416
|
return;
|
|
2385
2417
|
}
|
|
2386
2418
|
if (p.type === "scroll_to") {
|
|
2387
|
-
if (!
|
|
2388
|
-
|
|
2419
|
+
if (!Se("scroll")) {
|
|
2420
|
+
Ne("scroll_to", "scroll");
|
|
2389
2421
|
return;
|
|
2390
2422
|
}
|
|
2391
|
-
const
|
|
2392
|
-
if (!
|
|
2393
|
-
const
|
|
2423
|
+
const k = typeof p.selector == "string" ? p.selector : null;
|
|
2424
|
+
if (!k) return;
|
|
2425
|
+
const P = p.behavior === "instant" ? "instant" : "smooth";
|
|
2394
2426
|
if (xt.current) {
|
|
2395
2427
|
try {
|
|
2396
2428
|
xt.current(
|
|
2397
|
-
|
|
2398
|
-
|
|
2429
|
+
k,
|
|
2430
|
+
P
|
|
2399
2431
|
);
|
|
2400
|
-
} catch (
|
|
2401
|
-
console.warn("[LiveLayer] onScrollToSelector threw.",
|
|
2432
|
+
} catch (W) {
|
|
2433
|
+
console.warn("[LiveLayer] onScrollToSelector threw.", W);
|
|
2402
2434
|
}
|
|
2403
2435
|
return;
|
|
2404
2436
|
}
|
|
2405
2437
|
if (typeof document < "u") {
|
|
2406
|
-
let
|
|
2438
|
+
let W = null;
|
|
2407
2439
|
try {
|
|
2408
|
-
|
|
2440
|
+
W = document.querySelector(k);
|
|
2409
2441
|
} catch {
|
|
2410
2442
|
console.warn(
|
|
2411
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
2443
|
+
`[LiveLayer] scroll_to: invalid selector "${k}".`
|
|
2412
2444
|
);
|
|
2413
2445
|
return;
|
|
2414
2446
|
}
|
|
2415
|
-
if (!
|
|
2447
|
+
if (!W) {
|
|
2416
2448
|
console.warn(
|
|
2417
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
2449
|
+
`[LiveLayer] scroll_to: no element matched "${k}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
2418
2450
|
);
|
|
2419
2451
|
return;
|
|
2420
2452
|
}
|
|
2421
|
-
|
|
2422
|
-
behavior:
|
|
2453
|
+
W.scrollIntoView({
|
|
2454
|
+
behavior: P,
|
|
2423
2455
|
block: "start"
|
|
2424
2456
|
});
|
|
2425
2457
|
}
|
|
2426
2458
|
return;
|
|
2427
2459
|
}
|
|
2428
2460
|
if (p.type === "request_page_context") {
|
|
2429
|
-
if (!
|
|
2430
|
-
|
|
2461
|
+
if (!Se("read_page")) {
|
|
2462
|
+
Ne("request_page_context", "read_page");
|
|
2431
2463
|
return;
|
|
2432
2464
|
}
|
|
2433
|
-
const
|
|
2434
|
-
const
|
|
2465
|
+
const k = typeof p.requestId == "string" ? p.requestId : void 0, P = (Y = ue.current) == null ? void 0 : Y.call(ue), W = (j) => {
|
|
2466
|
+
const O = P, K = O == null ? void 0 : O.localParticipant;
|
|
2435
2467
|
if (K != null && K.publishData)
|
|
2436
2468
|
try {
|
|
2437
|
-
const
|
|
2469
|
+
const Q = k ? { ...j, requestId: k } : j, We = new TextEncoder().encode(JSON.stringify(Q));
|
|
2438
2470
|
K.publishData(We, { reliable: !0 });
|
|
2439
|
-
} catch (
|
|
2440
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2471
|
+
} catch (Q) {
|
|
2472
|
+
console.warn("[LiveLayer] publishData failed.", Q);
|
|
2441
2473
|
}
|
|
2442
|
-
},
|
|
2474
|
+
}, H = It.current, U = Rt.current;
|
|
2443
2475
|
try {
|
|
2444
2476
|
if (U) {
|
|
2445
|
-
const j = U(
|
|
2477
|
+
const j = U(H);
|
|
2446
2478
|
if (j instanceof Promise) {
|
|
2447
|
-
|
|
2479
|
+
W({ type: "page_context_pending" }), j.then((O) => W({ type: "page_context", context: O })).catch((O) => {
|
|
2448
2480
|
console.warn(
|
|
2449
2481
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
2450
|
-
|
|
2451
|
-
),
|
|
2482
|
+
O
|
|
2483
|
+
), W({
|
|
2452
2484
|
type: "page_context",
|
|
2453
|
-
context: an(
|
|
2485
|
+
context: an(H)
|
|
2454
2486
|
});
|
|
2455
2487
|
});
|
|
2456
2488
|
return;
|
|
2457
2489
|
}
|
|
2458
|
-
|
|
2490
|
+
W({ type: "page_context", context: j });
|
|
2459
2491
|
return;
|
|
2460
2492
|
}
|
|
2461
|
-
|
|
2493
|
+
W({
|
|
2462
2494
|
type: "page_context",
|
|
2463
|
-
context: an(
|
|
2495
|
+
context: an(H)
|
|
2464
2496
|
});
|
|
2465
2497
|
} catch (j) {
|
|
2466
2498
|
console.warn(
|
|
2467
2499
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
2468
2500
|
j
|
|
2469
|
-
),
|
|
2501
|
+
), W({
|
|
2470
2502
|
type: "page_context",
|
|
2471
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
2503
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: H }
|
|
2472
2504
|
});
|
|
2473
2505
|
}
|
|
2474
2506
|
return;
|
|
2475
2507
|
}
|
|
2476
2508
|
if (p.type === "scroll_page") {
|
|
2477
|
-
if (!
|
|
2478
|
-
|
|
2509
|
+
if (!Se("scroll")) {
|
|
2510
|
+
Ne("scroll_page", "scroll");
|
|
2479
2511
|
return;
|
|
2480
2512
|
}
|
|
2481
|
-
const
|
|
2482
|
-
if (
|
|
2513
|
+
const k = p.direction;
|
|
2514
|
+
if (k !== "up" && k !== "down" && k !== "top" && k !== "bottom") {
|
|
2483
2515
|
console.warn(
|
|
2484
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
2516
|
+
`[LiveLayer] scroll_page: invalid direction "${String(k)}". Expected up | down | top | bottom.`
|
|
2485
2517
|
);
|
|
2486
2518
|
return;
|
|
2487
2519
|
}
|
|
2488
|
-
const
|
|
2520
|
+
const P = p.behavior === "instant" ? "instant" : "smooth";
|
|
2489
2521
|
if (kt.current) {
|
|
2490
2522
|
try {
|
|
2491
2523
|
kt.current(
|
|
2492
|
-
|
|
2493
|
-
|
|
2524
|
+
k,
|
|
2525
|
+
P
|
|
2494
2526
|
);
|
|
2495
|
-
} catch (
|
|
2496
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
2527
|
+
} catch (O) {
|
|
2528
|
+
console.warn("[LiveLayer] onScrollPage threw.", O);
|
|
2497
2529
|
}
|
|
2498
2530
|
return;
|
|
2499
2531
|
}
|
|
2500
2532
|
if (typeof window > "u") return;
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2503
|
-
}, j = (
|
|
2504
|
-
|
|
2533
|
+
const W = { behavior: P }, H = Kr(), U = (O) => {
|
|
2534
|
+
H instanceof Window ? H.scrollBy({ top: O, ...W }) : H.scrollBy({ top: O, ...W });
|
|
2535
|
+
}, j = (O) => {
|
|
2536
|
+
H instanceof Window ? H.scrollTo({ top: O, ...W }) : H.scrollTo({ top: O, ...W });
|
|
2505
2537
|
};
|
|
2506
|
-
|
|
2538
|
+
k === "up" ? U(-cn(H)) : k === "down" ? U(cn(H)) : j(k === "top" ? 0 : Xr(H));
|
|
2507
2539
|
return;
|
|
2508
2540
|
}
|
|
2509
2541
|
if (p.type === "click") {
|
|
2510
|
-
if (!
|
|
2511
|
-
|
|
2542
|
+
if (!Se("click")) {
|
|
2543
|
+
Ne("click", "click");
|
|
2512
2544
|
return;
|
|
2513
2545
|
}
|
|
2514
|
-
const
|
|
2515
|
-
if (!
|
|
2546
|
+
const k = typeof p.selector == "string" ? p.selector : null;
|
|
2547
|
+
if (!k) {
|
|
2516
2548
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2517
2549
|
return;
|
|
2518
2550
|
}
|
|
2519
2551
|
if (Lt.current) {
|
|
2520
2552
|
try {
|
|
2521
|
-
Lt.current(
|
|
2522
|
-
} catch (
|
|
2523
|
-
console.warn("[LiveLayer] onClick threw.",
|
|
2553
|
+
Lt.current(k);
|
|
2554
|
+
} catch (W) {
|
|
2555
|
+
console.warn("[LiveLayer] onClick threw.", W);
|
|
2524
2556
|
}
|
|
2525
2557
|
return;
|
|
2526
2558
|
}
|
|
2527
2559
|
if (typeof document > "u") return;
|
|
2528
|
-
let
|
|
2560
|
+
let P = null;
|
|
2529
2561
|
try {
|
|
2530
|
-
|
|
2562
|
+
P = document.querySelector(k);
|
|
2531
2563
|
} catch {
|
|
2532
2564
|
console.warn(
|
|
2533
|
-
`[LiveLayer] click: invalid selector "${
|
|
2565
|
+
`[LiveLayer] click: invalid selector "${k}".`
|
|
2534
2566
|
);
|
|
2535
2567
|
return;
|
|
2536
2568
|
}
|
|
2537
|
-
if (!
|
|
2569
|
+
if (!P) {
|
|
2538
2570
|
console.warn(
|
|
2539
|
-
`[LiveLayer] click: no element matched "${
|
|
2571
|
+
`[LiveLayer] click: no element matched "${k}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
2540
2572
|
);
|
|
2541
2573
|
return;
|
|
2542
2574
|
}
|
|
2543
|
-
if (
|
|
2575
|
+
if (P.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2544
2576
|
console.warn(
|
|
2545
2577
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
2546
2578
|
);
|
|
2547
2579
|
return;
|
|
2548
2580
|
}
|
|
2549
|
-
(
|
|
2581
|
+
(le = P.click) == null || le.call(P);
|
|
2550
2582
|
return;
|
|
2551
2583
|
}
|
|
2552
2584
|
if (p.type === "fill_form" || p.type === "focus_field") {
|
|
2553
|
-
if (!
|
|
2554
|
-
|
|
2585
|
+
if (!Se("fill_forms")) {
|
|
2586
|
+
Ne(p.type, "fill_forms");
|
|
2555
2587
|
return;
|
|
2556
2588
|
}
|
|
2557
2589
|
if (typeof document > "u") return;
|
|
2558
|
-
p.type === "fill_form" &&
|
|
2559
|
-
const
|
|
2560
|
-
if (!
|
|
2590
|
+
p.type === "fill_form" && h.current.playConfirmation();
|
|
2591
|
+
const k = typeof p.formId == "string" ? p.formId : null;
|
|
2592
|
+
if (!k) {
|
|
2561
2593
|
console.warn(`[LiveLayer] ${p.type}: missing formId.`);
|
|
2562
2594
|
return;
|
|
2563
2595
|
}
|
|
2564
|
-
const
|
|
2565
|
-
`[data-ll-form="${
|
|
2596
|
+
const P = document.querySelector(
|
|
2597
|
+
`[data-ll-form="${k.replace(/"/g, '\\"')}"]`
|
|
2566
2598
|
);
|
|
2567
|
-
if (!
|
|
2599
|
+
if (!P) {
|
|
2568
2600
|
console.warn(
|
|
2569
|
-
`[LiveLayer] ${p.type}: no form with data-ll-form="${
|
|
2601
|
+
`[LiveLayer] ${p.type}: no form with data-ll-form="${k}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
|
|
2570
2602
|
);
|
|
2571
2603
|
return;
|
|
2572
2604
|
}
|
|
2573
|
-
if (
|
|
2605
|
+
if (P.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2574
2606
|
console.warn(
|
|
2575
2607
|
`[LiveLayer] ${p.type}: refusing to touch a form in a private subtree.`
|
|
2576
2608
|
);
|
|
2577
2609
|
return;
|
|
2578
2610
|
}
|
|
2579
2611
|
if (p.type === "focus_field") {
|
|
2580
|
-
const
|
|
2581
|
-
if (!
|
|
2612
|
+
const H = typeof p.fieldName == "string" ? p.fieldName : null;
|
|
2613
|
+
if (!H) {
|
|
2582
2614
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2583
2615
|
return;
|
|
2584
2616
|
}
|
|
2585
|
-
const U =
|
|
2617
|
+
const U = P.querySelector(`[data-ll-field="${H.replace(/"/g, '\\"')}"]`);
|
|
2586
2618
|
if (!U) {
|
|
2587
2619
|
console.warn(
|
|
2588
|
-
`[LiveLayer] focus_field: no field "${
|
|
2620
|
+
`[LiveLayer] focus_field: no field "${H}" in form "${k}".`
|
|
2589
2621
|
);
|
|
2590
2622
|
return;
|
|
2591
2623
|
}
|
|
2592
2624
|
if (!yt(U)) {
|
|
2593
2625
|
console.warn(
|
|
2594
|
-
`[LiveLayer] focus_field: field "${
|
|
2626
|
+
`[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
|
|
2595
2627
|
);
|
|
2596
2628
|
return;
|
|
2597
2629
|
}
|
|
2598
2630
|
U.focus();
|
|
2599
2631
|
return;
|
|
2600
2632
|
}
|
|
2601
|
-
const
|
|
2602
|
-
if (!
|
|
2633
|
+
const W = p.values && typeof p.values == "object" ? p.values : null;
|
|
2634
|
+
if (!W) {
|
|
2603
2635
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
2604
2636
|
return;
|
|
2605
2637
|
}
|
|
2606
|
-
for (const [
|
|
2638
|
+
for (const [H, U] of Object.entries(W)) {
|
|
2607
2639
|
if (typeof U != "string") continue;
|
|
2608
|
-
const j =
|
|
2640
|
+
const j = P.querySelector(`[data-ll-field="${H.replace(/"/g, '\\"')}"]`);
|
|
2609
2641
|
if (!j) {
|
|
2610
2642
|
console.warn(
|
|
2611
|
-
`[LiveLayer] fill_form: no field "${
|
|
2643
|
+
`[LiveLayer] fill_form: no field "${H}" in form "${k}". Skipping.`
|
|
2612
2644
|
);
|
|
2613
2645
|
continue;
|
|
2614
2646
|
}
|
|
2615
2647
|
if (!yt(j)) {
|
|
2616
2648
|
console.warn(
|
|
2617
|
-
`[LiveLayer] fill_form: field "${
|
|
2649
|
+
`[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / private). Skipping.`
|
|
2618
2650
|
);
|
|
2619
2651
|
continue;
|
|
2620
2652
|
}
|
|
2621
2653
|
try {
|
|
2622
2654
|
Vr(j, U);
|
|
2623
|
-
} catch (
|
|
2655
|
+
} catch (O) {
|
|
2624
2656
|
console.warn(
|
|
2625
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2626
|
-
|
|
2657
|
+
`[LiveLayer] fill_form: failed to set "${H}".`,
|
|
2658
|
+
O
|
|
2627
2659
|
);
|
|
2628
2660
|
}
|
|
2629
2661
|
}
|
|
2630
2662
|
return;
|
|
2631
2663
|
}
|
|
2632
2664
|
if (p.type === "submit_form") {
|
|
2633
|
-
if (!
|
|
2634
|
-
|
|
2665
|
+
if (!Se("submit_forms")) {
|
|
2666
|
+
Ne("submit_form", "submit_forms");
|
|
2635
2667
|
return;
|
|
2636
2668
|
}
|
|
2637
2669
|
if (typeof document > "u") return;
|
|
2638
|
-
const
|
|
2639
|
-
if (!
|
|
2670
|
+
const k = typeof p.formId == "string" ? p.formId : null;
|
|
2671
|
+
if (!k) {
|
|
2640
2672
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2641
2673
|
return;
|
|
2642
2674
|
}
|
|
2643
|
-
|
|
2644
|
-
const
|
|
2645
|
-
`[data-ll-form="${
|
|
2675
|
+
h.current.playConfirmation();
|
|
2676
|
+
const P = document.querySelector(
|
|
2677
|
+
`[data-ll-form="${k.replace(/"/g, '\\"')}"]`
|
|
2646
2678
|
);
|
|
2647
|
-
if (!
|
|
2679
|
+
if (!P) {
|
|
2648
2680
|
console.warn(
|
|
2649
|
-
`[LiveLayer] submit_form: no form with data-ll-form="${
|
|
2681
|
+
`[LiveLayer] submit_form: no form with data-ll-form="${k}".`
|
|
2650
2682
|
);
|
|
2651
2683
|
return;
|
|
2652
2684
|
}
|
|
2653
|
-
if (
|
|
2685
|
+
if (P.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2654
2686
|
console.warn(
|
|
2655
2687
|
"[LiveLayer] submit_form: refusing to submit a form in a private subtree."
|
|
2656
2688
|
);
|
|
2657
2689
|
return;
|
|
2658
2690
|
}
|
|
2659
|
-
const
|
|
2660
|
-
const
|
|
2691
|
+
const W = typeof p.requestId == "string" ? p.requestId : void 0, H = (ge = ue.current) == null ? void 0 : ge.call(ue), U = (K) => {
|
|
2692
|
+
const Q = H, We = Q == null ? void 0 : Q.localParticipant;
|
|
2661
2693
|
if (We != null && We.publishData)
|
|
2662
2694
|
try {
|
|
2663
|
-
const An =
|
|
2695
|
+
const An = W ? { ...K, requestId: W } : K, Rn = new TextEncoder().encode(JSON.stringify(An));
|
|
2664
2696
|
We.publishData(Rn, { reliable: !0 });
|
|
2665
2697
|
} catch {
|
|
2666
2698
|
}
|
|
2667
2699
|
};
|
|
2668
2700
|
let j = !1;
|
|
2669
|
-
const
|
|
2670
|
-
j = !0, U({ type: "form_submitted", formId:
|
|
2701
|
+
const O = () => {
|
|
2702
|
+
j = !0, U({ type: "form_submitted", formId: k });
|
|
2671
2703
|
};
|
|
2672
|
-
|
|
2704
|
+
P.addEventListener("submit", O, { once: !0 });
|
|
2673
2705
|
try {
|
|
2674
|
-
typeof
|
|
2706
|
+
typeof P.requestSubmit == "function" ? P.requestSubmit() : P.submit();
|
|
2675
2707
|
} catch (K) {
|
|
2676
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.", K),
|
|
2708
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", K), P.removeEventListener("submit", O), U({
|
|
2677
2709
|
type: "form_submit_blocked",
|
|
2678
|
-
formId:
|
|
2710
|
+
formId: k,
|
|
2679
2711
|
reason: "exception"
|
|
2680
2712
|
});
|
|
2681
2713
|
return;
|
|
2682
2714
|
}
|
|
2683
2715
|
setTimeout(() => {
|
|
2684
|
-
j || (
|
|
2716
|
+
j || (P.removeEventListener("submit", O), U({
|
|
2685
2717
|
type: "form_submit_blocked",
|
|
2686
|
-
formId:
|
|
2718
|
+
formId: k,
|
|
2687
2719
|
reason: "validation"
|
|
2688
2720
|
}));
|
|
2689
2721
|
}, 500);
|
|
2690
2722
|
return;
|
|
2691
2723
|
}
|
|
2692
2724
|
if (p.type === "request_routes") {
|
|
2693
|
-
if (!
|
|
2694
|
-
|
|
2725
|
+
if (!Se("read_page")) {
|
|
2726
|
+
Ne("request_routes", "read_page");
|
|
2695
2727
|
return;
|
|
2696
2728
|
}
|
|
2697
|
-
const
|
|
2698
|
-
if (!(
|
|
2699
|
-
const U = (
|
|
2729
|
+
const k = typeof p.requestId == "string" ? p.requestId : void 0, W = (nt = ue.current) == null ? void 0 : nt.call(ue), H = W == null ? void 0 : W.localParticipant;
|
|
2730
|
+
if (!(H != null && H.publishData)) return;
|
|
2731
|
+
const U = (O) => {
|
|
2700
2732
|
try {
|
|
2701
|
-
const K =
|
|
2702
|
-
|
|
2733
|
+
const K = k ? { type: "routes", routes: O, requestId: k } : { type: "routes", routes: O }, Q = new TextEncoder().encode(JSON.stringify(K));
|
|
2734
|
+
H.publishData(Q, { reliable: !0 });
|
|
2703
2735
|
} catch (K) {
|
|
2704
2736
|
console.warn("[LiveLayer] request_routes: publishData failed.", K);
|
|
2705
2737
|
}
|
|
2706
|
-
}, j =
|
|
2738
|
+
}, j = Mt.current;
|
|
2707
2739
|
if (j) {
|
|
2708
2740
|
try {
|
|
2709
|
-
const
|
|
2710
|
-
if (!Array.isArray(
|
|
2741
|
+
const O = j(), K = (Q) => {
|
|
2742
|
+
if (!Array.isArray(Q)) {
|
|
2711
2743
|
U([]);
|
|
2712
2744
|
return;
|
|
2713
2745
|
}
|
|
2714
|
-
U(
|
|
2746
|
+
U(Q.map(Wr).slice(0, 200));
|
|
2715
2747
|
};
|
|
2716
|
-
|
|
2748
|
+
O instanceof Promise ? O.then(K).catch((Q) => {
|
|
2717
2749
|
console.warn(
|
|
2718
2750
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2719
|
-
|
|
2751
|
+
Q
|
|
2720
2752
|
), U(St());
|
|
2721
|
-
}) : K(
|
|
2722
|
-
} catch (
|
|
2753
|
+
}) : K(O);
|
|
2754
|
+
} catch (O) {
|
|
2723
2755
|
console.warn(
|
|
2724
2756
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2725
|
-
|
|
2757
|
+
O
|
|
2726
2758
|
), U(St());
|
|
2727
2759
|
}
|
|
2728
2760
|
return;
|
|
2729
2761
|
}
|
|
2730
2762
|
try {
|
|
2731
2763
|
U(St());
|
|
2732
|
-
} catch (
|
|
2733
|
-
console.warn("[LiveLayer] request_routes: extractRoutes threw.",
|
|
2764
|
+
} catch (O) {
|
|
2765
|
+
console.warn("[LiveLayer] request_routes: extractRoutes threw.", O);
|
|
2734
2766
|
}
|
|
2735
2767
|
return;
|
|
2736
2768
|
}
|
|
2737
|
-
Qr.has(p.type) ||
|
|
2769
|
+
Qr.has(p.type) || Me == null || Me(p);
|
|
2738
2770
|
}
|
|
2739
2771
|
},
|
|
2740
|
-
[
|
|
2772
|
+
[Me, Ie]
|
|
2741
2773
|
), J = Wn({
|
|
2742
2774
|
agentId: $ ? "__controlled__" : Ke,
|
|
2743
2775
|
baseUrl: l,
|
|
2744
|
-
apiKey:
|
|
2745
|
-
sessionEndpoint:
|
|
2746
|
-
sessionBody:
|
|
2776
|
+
apiKey: o,
|
|
2777
|
+
sessionEndpoint: s,
|
|
2778
|
+
sessionBody: a,
|
|
2747
2779
|
onDataMessage: $ ? void 0 : Ze
|
|
2748
2780
|
});
|
|
2749
|
-
|
|
2781
|
+
I(() => {
|
|
2750
2782
|
if ($ != null && $.subscribeToDataMessages)
|
|
2751
2783
|
return $.subscribeToDataMessages(Ze);
|
|
2752
|
-
}, [$, Ze]),
|
|
2784
|
+
}, [$, Ze]), ue.current = () => {
|
|
2753
2785
|
var g;
|
|
2754
2786
|
return (g = J.getRoom) == null ? void 0 : g.call(J);
|
|
2755
|
-
},
|
|
2787
|
+
}, I(() => {
|
|
2756
2788
|
var Y;
|
|
2757
2789
|
if (typeof window > "u") return;
|
|
2758
2790
|
const g = ((Y = window.location) == null ? void 0 : Y.hostname) || "";
|
|
2759
2791
|
if (g === "localhost" || g === "127.0.0.1" || g === "0.0.0.0" || g.endsWith(".local") || g.endsWith(".test"))
|
|
2760
|
-
return window.__livelayerSimulateCommand = (
|
|
2792
|
+
return window.__livelayerSimulateCommand = (le) => {
|
|
2761
2793
|
try {
|
|
2762
|
-
Ze(
|
|
2794
|
+
Ze(le);
|
|
2763
2795
|
} catch (ge) {
|
|
2764
2796
|
console.warn("[LiveLayer] simulate-command threw:", ge);
|
|
2765
2797
|
}
|
|
@@ -2767,7 +2799,7 @@ const Qr = /* @__PURE__ */ new Set([
|
|
|
2767
2799
|
delete window.__livelayerSimulateCommand;
|
|
2768
2800
|
};
|
|
2769
2801
|
}, [Ze]);
|
|
2770
|
-
const
|
|
2802
|
+
const w = Ue(() => $ ? {
|
|
2771
2803
|
connectionState: $.connectionState,
|
|
2772
2804
|
agentState: $.agentState,
|
|
2773
2805
|
transcript: $.transcript,
|
|
@@ -2798,10 +2830,10 @@ const Qr = /* @__PURE__ */ new Set([
|
|
|
2798
2830
|
disconnect: J.disconnect,
|
|
2799
2831
|
getRoom: J.getRoom,
|
|
2800
2832
|
isControlled: !1
|
|
2801
|
-
}, [$, J]),
|
|
2802
|
-
|
|
2803
|
-
const Dt =
|
|
2804
|
-
Dt.current = $,
|
|
2833
|
+
}, [$, J]), Tt = A(w);
|
|
2834
|
+
Tt.current = w;
|
|
2835
|
+
const Dt = A($);
|
|
2836
|
+
Dt.current = $, Tn(
|
|
2805
2837
|
r,
|
|
2806
2838
|
() => ({
|
|
2807
2839
|
sendData: async (g) => {
|
|
@@ -2810,61 +2842,61 @@ const Qr = /* @__PURE__ */ new Set([
|
|
|
2810
2842
|
if (p != null && p.publishData) {
|
|
2811
2843
|
try {
|
|
2812
2844
|
await p.publishData(g);
|
|
2813
|
-
} catch (
|
|
2814
|
-
console.warn("[AvatarWidget] sendData (controlled) failed:",
|
|
2845
|
+
} catch (k) {
|
|
2846
|
+
console.warn("[AvatarWidget] sendData (controlled) failed:", k);
|
|
2815
2847
|
}
|
|
2816
2848
|
return;
|
|
2817
2849
|
}
|
|
2818
|
-
const Y = (nt = (ge =
|
|
2819
|
-
if (
|
|
2850
|
+
const Y = (nt = (ge = Tt.current) == null ? void 0 : ge.getRoom) == null ? void 0 : nt.call(ge), le = Y == null ? void 0 : Y.localParticipant;
|
|
2851
|
+
if (le != null && le.publishData)
|
|
2820
2852
|
try {
|
|
2821
|
-
const
|
|
2822
|
-
await
|
|
2823
|
-
} catch (
|
|
2824
|
-
console.warn("[AvatarWidget] sendData failed:",
|
|
2853
|
+
const k = new TextEncoder().encode(JSON.stringify(g));
|
|
2854
|
+
await le.publishData(k, { reliable: !0 });
|
|
2855
|
+
} catch (k) {
|
|
2856
|
+
console.warn("[AvatarWidget] sendData failed:", k);
|
|
2825
2857
|
}
|
|
2826
2858
|
}
|
|
2827
2859
|
}),
|
|
2828
2860
|
[]
|
|
2829
2861
|
);
|
|
2830
|
-
const Pt =
|
|
2831
|
-
|
|
2832
|
-
const g =
|
|
2862
|
+
const Pt = A(null);
|
|
2863
|
+
I(() => {
|
|
2864
|
+
const g = w.videoElement, p = Pt.current;
|
|
2833
2865
|
if (!(!g || !p))
|
|
2834
2866
|
return p.appendChild(g), () => {
|
|
2835
2867
|
g.parentNode === p && p.removeChild(g);
|
|
2836
2868
|
};
|
|
2837
|
-
}, [
|
|
2838
|
-
const g =
|
|
2869
|
+
}, [w.videoElement]), I(() => {
|
|
2870
|
+
const g = w.audioElement;
|
|
2839
2871
|
if (!g) return;
|
|
2840
|
-
|
|
2872
|
+
ke.attach(g);
|
|
2841
2873
|
const p = g.play();
|
|
2842
2874
|
return p && typeof p.catch == "function" && p.catch((Y) => {
|
|
2843
|
-
(Y == null ? void 0 : Y.name) === "NotAllowedError" &&
|
|
2875
|
+
(Y == null ? void 0 : Y.name) === "NotAllowedError" && Ee(!0);
|
|
2844
2876
|
}), () => {
|
|
2845
|
-
|
|
2877
|
+
ke.detach();
|
|
2846
2878
|
};
|
|
2847
|
-
}, [
|
|
2848
|
-
if (
|
|
2849
|
-
const g =
|
|
2879
|
+
}, [w.audioElement]), I(() => {
|
|
2880
|
+
if (w.isControlled || w.connectionState !== "connected") return;
|
|
2881
|
+
const g = w.getRoom();
|
|
2850
2882
|
if (g)
|
|
2851
|
-
return
|
|
2883
|
+
return G.setupMic(g).catch(() => {
|
|
2852
2884
|
}), () => {
|
|
2853
|
-
|
|
2885
|
+
G.teardownMic();
|
|
2854
2886
|
};
|
|
2855
|
-
}, [
|
|
2887
|
+
}, [w.isControlled, w.connectionState]), I(() => {
|
|
2856
2888
|
var p;
|
|
2857
|
-
if (
|
|
2858
|
-
const g =
|
|
2889
|
+
if (w.connectionState !== "connected") return;
|
|
2890
|
+
const g = w.isControlled ? (p = $ == null ? void 0 : $.getRoom) == null ? void 0 : p.call($) : w.getRoom();
|
|
2859
2891
|
if (g)
|
|
2860
|
-
return
|
|
2861
|
-
|
|
2892
|
+
return ne.attachRoom(g), Le.attachRoom(g), w.isControlled && G.attachRoom(g), Xe.refresh(), () => {
|
|
2893
|
+
ne.teardown(), Le.teardown();
|
|
2862
2894
|
};
|
|
2863
|
-
}, [
|
|
2864
|
-
const g =
|
|
2895
|
+
}, [w.isControlled, w.connectionState, $]), I(() => {
|
|
2896
|
+
const g = w.audioElement;
|
|
2865
2897
|
g && (g.muted = He);
|
|
2866
|
-
}, [
|
|
2867
|
-
const vn =
|
|
2898
|
+
}, [w.audioElement, He]);
|
|
2899
|
+
const vn = E((g) => {
|
|
2868
2900
|
const p = { type: "user_message", text: g };
|
|
2869
2901
|
if ($ != null && $.publishData) {
|
|
2870
2902
|
try {
|
|
@@ -2873,168 +2905,170 @@ const Qr = /* @__PURE__ */ new Set([
|
|
|
2873
2905
|
}
|
|
2874
2906
|
return;
|
|
2875
2907
|
}
|
|
2876
|
-
const Y =
|
|
2908
|
+
const Y = w.getRoom();
|
|
2877
2909
|
if (Y)
|
|
2878
2910
|
try {
|
|
2879
|
-
const
|
|
2880
|
-
Y.localParticipant.publishData(
|
|
2911
|
+
const le = new TextEncoder().encode(JSON.stringify(p));
|
|
2912
|
+
Y.localParticipant.publishData(le, { reliable: !0 });
|
|
2881
2913
|
} catch {
|
|
2882
2914
|
}
|
|
2883
|
-
}, [
|
|
2884
|
-
|
|
2915
|
+
}, [w, $]), bn = E(() => {
|
|
2916
|
+
_t((g) => !g);
|
|
2885
2917
|
}, []);
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
}, [
|
|
2889
|
-
Pe == null || Pe(
|
|
2890
|
-
}, [
|
|
2891
|
-
|
|
2892
|
-
}, [
|
|
2893
|
-
|
|
2894
|
-
}, [
|
|
2895
|
-
const $t =
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
}, [
|
|
2899
|
-
const wn =
|
|
2918
|
+
I(() => {
|
|
2919
|
+
$e == null || $e(w.connectionState), w.connectionState === "connected" ? De == null || De() : w.connectionState === "disconnected" && (Ae == null || Ae());
|
|
2920
|
+
}, [w.connectionState, De, Ae, $e]), I(() => {
|
|
2921
|
+
Pe == null || Pe(w.transcript);
|
|
2922
|
+
}, [w.transcript, Pe]), I(() => {
|
|
2923
|
+
Re == null || Re(w.agentState);
|
|
2924
|
+
}, [w.agentState, Re]), I(() => {
|
|
2925
|
+
Te.setThinking(w.agentState === "thinking");
|
|
2926
|
+
}, [w.agentState, Te]);
|
|
2927
|
+
const $t = A(!1);
|
|
2928
|
+
I(() => {
|
|
2929
|
+
w.isControlled || !_ || $t.current || _e && w.connectionState === "idle" && ($t.current = !0, w.connect());
|
|
2930
|
+
}, [_, w.connectionState, w, _e]);
|
|
2931
|
+
const wn = E(
|
|
2900
2932
|
(g) => {
|
|
2901
|
-
const p =
|
|
2902
|
-
p && (
|
|
2933
|
+
const p = S == null ? void 0 : S.find((Y) => Y.id === g);
|
|
2934
|
+
p && (de(!1), g !== ce && (ut(!0), w.disconnect(), te || Je(g), z == null || z(p)));
|
|
2903
2935
|
},
|
|
2904
2936
|
[
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2937
|
+
S,
|
|
2938
|
+
ce,
|
|
2939
|
+
w,
|
|
2940
|
+
te,
|
|
2909
2941
|
z
|
|
2910
2942
|
]
|
|
2911
2943
|
);
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
}, [
|
|
2915
|
-
if (!
|
|
2944
|
+
I(() => {
|
|
2945
|
+
Oe && w.connectionState === "connected" && ut(!1);
|
|
2946
|
+
}, [w.connectionState, Oe]), I(() => {
|
|
2947
|
+
if (!Qe) return;
|
|
2916
2948
|
const g = (p) => {
|
|
2917
|
-
p.key === "Escape" &&
|
|
2949
|
+
p.key === "Escape" && de(!1);
|
|
2918
2950
|
};
|
|
2919
2951
|
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
2920
|
-
}, [
|
|
2921
|
-
const _n = !!
|
|
2952
|
+
}, [Qe]);
|
|
2953
|
+
const _n = !!B || !!(X != null && X.avatarImageUrl) || w.isControlled, et = Yn(Ke, l, _n);
|
|
2922
2954
|
Ge === void 0 && ((Ot = et.info) != null && Ot.capabilities) && (Et.current = et.info.capabilities);
|
|
2923
|
-
const pt = (
|
|
2924
|
-
() =>
|
|
2925
|
-
[
|
|
2926
|
-
), zt =
|
|
2927
|
-
|
|
2928
|
-
}, [
|
|
2929
|
-
const g =
|
|
2930
|
-
g && g.play().then(() =>
|
|
2955
|
+
const pt = (X == null ? void 0 : X.name) ?? q ?? ((Ht = w.agentConfig) == null ? void 0 : Ht.name) ?? ((Wt = et.info) == null ? void 0 : Wt.name) ?? "Live Layer", Ct = (X == null ? void 0 : X.avatarImageUrl) ?? B ?? ((Bt = w.agentConfig) == null ? void 0 : Bt.avatarImageUrl) ?? ((qt = et.info) == null ? void 0 : qt.avatarImageUrl) ?? null, xn = x ?? ((Ft = w.agentConfig) == null ? void 0 : Ft.idleLoopUrl) ?? ((Ut = et.info) == null ? void 0 : Ut.idleLoopUrl) ?? null, kn = T ?? null, Ln = E(() => se("expanded"), [se]), En = E(
|
|
2956
|
+
() => se("minimized"),
|
|
2957
|
+
[se]
|
|
2958
|
+
), zt = E(() => {
|
|
2959
|
+
w.disconnect(), se("hidden");
|
|
2960
|
+
}, [w, se]), Cn = E(() => {
|
|
2961
|
+
const g = w.audioElement;
|
|
2962
|
+
g && g.play().then(() => Ee(!1)).catch(() => {
|
|
2931
2963
|
});
|
|
2932
|
-
}, [
|
|
2933
|
-
|
|
2934
|
-
}, [
|
|
2935
|
-
...
|
|
2936
|
-
...
|
|
2964
|
+
}, [w.audioElement]), Sn = E(() => {
|
|
2965
|
+
Ee(!1), w.connect();
|
|
2966
|
+
}, [w]), tt = {
|
|
2967
|
+
...dt,
|
|
2968
|
+
...ze ? {} : { zIndex: vt }
|
|
2937
2969
|
};
|
|
2938
|
-
|
|
2970
|
+
N.primaryColor && (tt["--ll-color-primary"] = N.primaryColor), N.accentColor && (tt["--ll-color-accent"] = N.accentColor), N.backgroundColor && (tt["--ll-color-bg"] = N.backgroundColor), N.textColor && (tt["--ll-color-fg"] = N.textColor);
|
|
2939
2971
|
const Nn = [
|
|
2940
2972
|
"ll-widget",
|
|
2941
|
-
`ll-widget--${
|
|
2942
|
-
`ll-widget--${
|
|
2943
|
-
|
|
2973
|
+
`ll-widget--${xe}`,
|
|
2974
|
+
`ll-widget--${me ? "mobile" : "desktop"}`,
|
|
2975
|
+
st
|
|
2944
2976
|
].filter(Boolean).join(" ");
|
|
2945
|
-
return
|
|
2977
|
+
return _e ? /* @__PURE__ */ v(
|
|
2946
2978
|
"div",
|
|
2947
2979
|
{
|
|
2948
2980
|
className: Nn,
|
|
2949
2981
|
style: tt,
|
|
2950
|
-
"data-display-mode":
|
|
2951
|
-
"data-position":
|
|
2982
|
+
"data-display-mode": xe,
|
|
2983
|
+
"data-position": L,
|
|
2952
2984
|
"data-experience-mode": f === "EMBEDDED" ? "embedded" : "widget",
|
|
2953
2985
|
children: [
|
|
2954
|
-
|
|
2986
|
+
xe === "hidden" && /* @__PURE__ */ n(
|
|
2955
2987
|
vr,
|
|
2956
2988
|
{
|
|
2957
|
-
position:
|
|
2958
|
-
isMobile:
|
|
2959
|
-
isSpeaking:
|
|
2960
|
-
onExpand: () =>
|
|
2989
|
+
position: L,
|
|
2990
|
+
isMobile: me,
|
|
2991
|
+
isSpeaking: w.agentState === "speaking",
|
|
2992
|
+
onExpand: () => se("expanded"),
|
|
2961
2993
|
label: `Open ${pt} widget`,
|
|
2962
2994
|
avatarImageUrl: Ct,
|
|
2963
2995
|
agentName: pt
|
|
2964
2996
|
}
|
|
2965
2997
|
),
|
|
2966
|
-
|
|
2998
|
+
xe === "minimized" && /* @__PURE__ */ n(
|
|
2967
2999
|
wr,
|
|
2968
3000
|
{
|
|
2969
|
-
position:
|
|
2970
|
-
isMobile:
|
|
3001
|
+
position: L,
|
|
3002
|
+
isMobile: me,
|
|
2971
3003
|
agentName: pt,
|
|
2972
3004
|
avatarImageUrl: Ct,
|
|
2973
|
-
agentState:
|
|
2974
|
-
isMuted:
|
|
2975
|
-
audioLevel:
|
|
3005
|
+
agentState: w.agentState,
|
|
3006
|
+
isMuted: G.isMuted,
|
|
3007
|
+
audioLevel: ke,
|
|
2976
3008
|
onExpand: Ln,
|
|
2977
|
-
onToggleMute:
|
|
3009
|
+
onToggleMute: G.toggleMute,
|
|
2978
3010
|
onClose: zt
|
|
2979
3011
|
}
|
|
2980
3012
|
),
|
|
2981
|
-
|
|
3013
|
+
xe === "expanded" && /* @__PURE__ */ n(
|
|
2982
3014
|
Sr,
|
|
2983
3015
|
{
|
|
2984
|
-
position:
|
|
2985
|
-
isMobile:
|
|
3016
|
+
position: L,
|
|
3017
|
+
isMobile: me,
|
|
2986
3018
|
agentName: pt,
|
|
2987
3019
|
avatarImageUrl: Ct,
|
|
2988
3020
|
idleLoopUrl: xn,
|
|
2989
3021
|
greeting: kn,
|
|
2990
|
-
branding:
|
|
2991
|
-
teamMembers:
|
|
2992
|
-
currentTeamMemberId:
|
|
2993
|
-
isSwitchingTeamMember:
|
|
2994
|
-
teamSwitcherOpen:
|
|
2995
|
-
onToggleTeamSwitcher: () =>
|
|
3022
|
+
branding: N,
|
|
3023
|
+
teamMembers: S,
|
|
3024
|
+
currentTeamMemberId: ce,
|
|
3025
|
+
isSwitchingTeamMember: Oe,
|
|
3026
|
+
teamSwitcherOpen: Qe,
|
|
3027
|
+
onToggleTeamSwitcher: () => de((g) => !g),
|
|
2996
3028
|
onSelectTeamMember: wn,
|
|
2997
|
-
connectionState:
|
|
2998
|
-
agentState:
|
|
2999
|
-
transcript:
|
|
3000
|
-
isMuted:
|
|
3001
|
-
micDevices:
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3029
|
+
connectionState: w.connectionState,
|
|
3030
|
+
agentState: w.agentState,
|
|
3031
|
+
transcript: w.transcript,
|
|
3032
|
+
isMuted: G.isMuted,
|
|
3033
|
+
micDevices: Xe.mics,
|
|
3034
|
+
activeMicId: G.activeDeviceId,
|
|
3035
|
+
isCameraEnabled: ne.isEnabled,
|
|
3036
|
+
cameraPreviewEl: ne.previewEl,
|
|
3037
|
+
cameraDevices: Xe.cameras,
|
|
3038
|
+
activeCameraId: ne.activeDeviceId,
|
|
3039
|
+
isScreenShareEnabled: Le.isEnabled,
|
|
3040
|
+
screenPreviewEl: Le.previewEl,
|
|
3008
3041
|
isSpeakerMuted: He,
|
|
3009
|
-
allowCamera:
|
|
3042
|
+
allowCamera: M,
|
|
3010
3043
|
allowScreenShare: F,
|
|
3011
|
-
allowTyping:
|
|
3012
|
-
showMinimize:
|
|
3013
|
-
chromeless:
|
|
3014
|
-
compactControls:
|
|
3015
|
-
transforming:
|
|
3044
|
+
allowTyping: re,
|
|
3045
|
+
showMinimize: ie,
|
|
3046
|
+
chromeless: Z,
|
|
3047
|
+
compactControls: ae,
|
|
3048
|
+
transforming: fe,
|
|
3016
3049
|
transformingLabel: ve,
|
|
3017
|
-
languageMenuOpen:
|
|
3018
|
-
onToggleLanguageMenu: () =>
|
|
3019
|
-
needsUserGesture:
|
|
3020
|
-
canResume:
|
|
3021
|
-
micError:
|
|
3022
|
-
error:
|
|
3050
|
+
languageMenuOpen: Ce,
|
|
3051
|
+
onToggleLanguageMenu: () => ft((g) => !g),
|
|
3052
|
+
needsUserGesture: wt,
|
|
3053
|
+
canResume: w.canResume,
|
|
3054
|
+
micError: G.micError,
|
|
3055
|
+
error: w.error,
|
|
3023
3056
|
avatarVideoContainerRef: Pt,
|
|
3024
|
-
agentVideoEl:
|
|
3025
|
-
onConnect: () => void
|
|
3026
|
-
onDisconnect: () =>
|
|
3057
|
+
agentVideoEl: w.videoElement,
|
|
3058
|
+
onConnect: () => void w.connect(),
|
|
3059
|
+
onDisconnect: () => w.disconnect(),
|
|
3027
3060
|
onRetry: Sn,
|
|
3028
3061
|
onResumeAudio: Cn,
|
|
3029
|
-
onToggleMute:
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3062
|
+
onToggleMute: G.toggleMute,
|
|
3063
|
+
onSwitchMicDevice: (g) => void G.switchDevice(g),
|
|
3064
|
+
onToggleCamera: () => void ne.toggle(),
|
|
3065
|
+
onSwitchCameraDevice: (g) => void ne.switchDevice(g),
|
|
3066
|
+
onToggleScreenShare: () => void Le.toggle(),
|
|
3033
3067
|
onToggleSpeaker: bn,
|
|
3034
3068
|
onSendMessage: vn,
|
|
3035
3069
|
onMinimize: En,
|
|
3036
3070
|
onClose: zt,
|
|
3037
|
-
onClearMicError:
|
|
3071
|
+
onClearMicError: G.clearError
|
|
3038
3072
|
}
|
|
3039
3073
|
)
|
|
3040
3074
|
]
|
|
@@ -3049,169 +3083,169 @@ const Zr = lt(
|
|
|
3049
3083
|
}
|
|
3050
3084
|
);
|
|
3051
3085
|
Zr.displayName = "AvatarWidget";
|
|
3052
|
-
const
|
|
3086
|
+
const ci = ({
|
|
3053
3087
|
agentId: e,
|
|
3054
3088
|
baseUrl: t,
|
|
3055
3089
|
apiKey: r,
|
|
3056
|
-
mode:
|
|
3057
|
-
onAgentEvent:
|
|
3090
|
+
mode: i,
|
|
3091
|
+
onAgentEvent: o,
|
|
3058
3092
|
className: l,
|
|
3059
|
-
style:
|
|
3093
|
+
style: s
|
|
3060
3094
|
}) => {
|
|
3061
|
-
const
|
|
3062
|
-
f.current =
|
|
3063
|
-
const
|
|
3064
|
-
var
|
|
3065
|
-
const
|
|
3066
|
-
(
|
|
3095
|
+
const a = A(null), d = A(null), f = A(o);
|
|
3096
|
+
f.current = o;
|
|
3097
|
+
const _ = E((u) => {
|
|
3098
|
+
var R;
|
|
3099
|
+
const c = u.detail;
|
|
3100
|
+
(R = f.current) == null || R.call(f, c);
|
|
3067
3101
|
}, []);
|
|
3068
|
-
return
|
|
3069
|
-
const
|
|
3070
|
-
if (!
|
|
3071
|
-
const
|
|
3072
|
-
return
|
|
3073
|
-
|
|
3102
|
+
return I(() => {
|
|
3103
|
+
const u = a.current;
|
|
3104
|
+
if (!u) return;
|
|
3105
|
+
const c = document.createElement("livelayer-widget");
|
|
3106
|
+
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", _), u.appendChild(c), d.current = c, () => {
|
|
3107
|
+
c.removeEventListener("agent-event", _), u.removeChild(c), d.current = null;
|
|
3074
3108
|
};
|
|
3075
|
-
}, [e]),
|
|
3076
|
-
|
|
3077
|
-
}, [
|
|
3078
|
-
},
|
|
3079
|
-
function({ id: t, intent: r, as:
|
|
3109
|
+
}, [e]), I(() => {
|
|
3110
|
+
d.current && (i ? d.current.setAttribute("mode", i) : d.current.removeAttribute("mode"));
|
|
3111
|
+
}, [i]), /* @__PURE__ */ n("div", { ref: a, className: l, style: s });
|
|
3112
|
+
}, si = lt(
|
|
3113
|
+
function({ id: t, intent: r, as: i = "div", className: o, style: l, children: s }, a) {
|
|
3080
3114
|
return Dn(
|
|
3081
|
-
|
|
3115
|
+
i,
|
|
3082
3116
|
{
|
|
3083
|
-
ref:
|
|
3117
|
+
ref: a,
|
|
3084
3118
|
"data-ll-region": t,
|
|
3085
3119
|
"data-ll-intent": r,
|
|
3086
|
-
className:
|
|
3120
|
+
className: o,
|
|
3087
3121
|
style: l
|
|
3088
3122
|
},
|
|
3089
|
-
|
|
3123
|
+
s
|
|
3090
3124
|
);
|
|
3091
3125
|
}
|
|
3092
|
-
),
|
|
3093
|
-
function({ id: t, intent: r, children:
|
|
3126
|
+
), di = lt(
|
|
3127
|
+
function({ id: t, intent: r, children: i, ...o }, l) {
|
|
3094
3128
|
return /* @__PURE__ */ n(
|
|
3095
3129
|
"form",
|
|
3096
3130
|
{
|
|
3097
3131
|
ref: l,
|
|
3098
3132
|
"data-ll-form": t,
|
|
3099
3133
|
"data-ll-intent": r,
|
|
3100
|
-
...
|
|
3101
|
-
children:
|
|
3134
|
+
...o,
|
|
3135
|
+
children: i
|
|
3102
3136
|
}
|
|
3103
3137
|
);
|
|
3104
3138
|
}
|
|
3105
|
-
),
|
|
3139
|
+
), ui = lt(
|
|
3106
3140
|
function(t, r) {
|
|
3107
|
-
const { name:
|
|
3108
|
-
let
|
|
3141
|
+
const { name: i, label: o, labelClassName: l } = t, s = { name: i, "data-ll-field": i };
|
|
3142
|
+
let a;
|
|
3109
3143
|
if ("as" in t && t.as === "textarea") {
|
|
3110
|
-
const { name:
|
|
3111
|
-
|
|
3144
|
+
const { name: d, label: f, labelClassName: _, as: u, ...c } = t;
|
|
3145
|
+
a = /* @__PURE__ */ n(
|
|
3112
3146
|
"textarea",
|
|
3113
3147
|
{
|
|
3114
3148
|
ref: r,
|
|
3115
|
-
...
|
|
3116
|
-
...
|
|
3149
|
+
...s,
|
|
3150
|
+
...c
|
|
3117
3151
|
}
|
|
3118
3152
|
);
|
|
3119
3153
|
} else if ("as" in t && t.as === "select") {
|
|
3120
|
-
const { name:
|
|
3121
|
-
|
|
3154
|
+
const { name: d, label: f, labelClassName: _, as: u, children: c, ...R } = t;
|
|
3155
|
+
a = /* @__PURE__ */ n(
|
|
3122
3156
|
"select",
|
|
3123
3157
|
{
|
|
3124
3158
|
ref: r,
|
|
3125
|
-
...
|
|
3126
|
-
...
|
|
3127
|
-
children:
|
|
3159
|
+
...s,
|
|
3160
|
+
...R,
|
|
3161
|
+
children: c
|
|
3128
3162
|
}
|
|
3129
3163
|
);
|
|
3130
3164
|
} else {
|
|
3131
|
-
const { name:
|
|
3132
|
-
|
|
3165
|
+
const { name: d, label: f, labelClassName: _, as: u, ...c } = t;
|
|
3166
|
+
a = /* @__PURE__ */ n(
|
|
3133
3167
|
"input",
|
|
3134
3168
|
{
|
|
3135
3169
|
ref: r,
|
|
3136
|
-
...
|
|
3137
|
-
...
|
|
3170
|
+
...s,
|
|
3171
|
+
...c
|
|
3138
3172
|
}
|
|
3139
3173
|
);
|
|
3140
3174
|
}
|
|
3141
|
-
return
|
|
3142
|
-
|
|
3143
|
-
|
|
3175
|
+
return o === void 0 ? a : /* @__PURE__ */ v("label", { className: l, children: [
|
|
3176
|
+
o,
|
|
3177
|
+
a
|
|
3144
3178
|
] });
|
|
3145
3179
|
}
|
|
3146
3180
|
);
|
|
3147
|
-
let
|
|
3148
|
-
function
|
|
3181
|
+
let sn = 1;
|
|
3182
|
+
function fi({
|
|
3149
3183
|
onMount: e,
|
|
3150
3184
|
defaultOpen: t = !1,
|
|
3151
3185
|
storageKey: r = "ll-debug-open"
|
|
3152
3186
|
}) {
|
|
3153
|
-
const [
|
|
3154
|
-
|
|
3187
|
+
const [i, o] = C(t), [l, s] = C([]), [a, d] = C(""), [f, _] = C(!1), u = A(/* @__PURE__ */ new Set()), c = A([]), R = A(f);
|
|
3188
|
+
R.current = f, I(() => {
|
|
3155
3189
|
try {
|
|
3156
|
-
const
|
|
3157
|
-
|
|
3190
|
+
const y = localStorage.getItem(r);
|
|
3191
|
+
y === "1" && o(!0), y === "0" && o(!1);
|
|
3158
3192
|
} catch {
|
|
3159
3193
|
}
|
|
3160
|
-
}, [r]),
|
|
3194
|
+
}, [r]), I(() => {
|
|
3161
3195
|
try {
|
|
3162
|
-
localStorage.setItem(r,
|
|
3196
|
+
localStorage.setItem(r, i ? "1" : "0");
|
|
3163
3197
|
} catch {
|
|
3164
3198
|
}
|
|
3165
|
-
}, [
|
|
3166
|
-
const
|
|
3167
|
-
(
|
|
3199
|
+
}, [i, r]), I(() => {
|
|
3200
|
+
const y = (m) => {
|
|
3201
|
+
(m.metaKey || m.ctrlKey) && m.shiftKey && m.key.toLowerCase() === "l" && (m.preventDefault(), o((S) => !S));
|
|
3168
3202
|
};
|
|
3169
|
-
return window.addEventListener("keydown",
|
|
3170
|
-
}, []),
|
|
3171
|
-
const
|
|
3172
|
-
if (
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3175
|
-
(
|
|
3203
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3204
|
+
}, []), I(() => {
|
|
3205
|
+
const y = setInterval(() => {
|
|
3206
|
+
if (c.current.length === 0 || R.current) return;
|
|
3207
|
+
const m = c.current.splice(0, c.current.length);
|
|
3208
|
+
s(
|
|
3209
|
+
(S) => [...m.reverse(), ...S].slice(0, 200)
|
|
3176
3210
|
);
|
|
3177
3211
|
}, 100);
|
|
3178
|
-
return () => clearInterval(
|
|
3212
|
+
return () => clearInterval(y);
|
|
3179
3213
|
}, []);
|
|
3180
|
-
const
|
|
3181
|
-
if (
|
|
3182
|
-
!e ||
|
|
3183
|
-
|
|
3184
|
-
id:
|
|
3214
|
+
const L = A(!1);
|
|
3215
|
+
if (I(() => {
|
|
3216
|
+
!e || L.current || (L.current = !0, e((y) => {
|
|
3217
|
+
c.current.push({
|
|
3218
|
+
id: sn++,
|
|
3185
3219
|
ts: Date.now(),
|
|
3186
3220
|
kind: "event",
|
|
3187
|
-
type:
|
|
3188
|
-
data:
|
|
3221
|
+
type: y.eventName,
|
|
3222
|
+
data: y.data
|
|
3189
3223
|
});
|
|
3190
3224
|
}));
|
|
3191
|
-
}, [e]),
|
|
3192
|
-
const
|
|
3225
|
+
}, [e]), I(() => {
|
|
3226
|
+
const y = console.warn, m = console.log, S = (D, z) => function(...x) {
|
|
3193
3227
|
try {
|
|
3194
|
-
const
|
|
3195
|
-
|
|
3196
|
-
id:
|
|
3228
|
+
const T = typeof x[0] == "string" ? x[0] : "";
|
|
3229
|
+
T.startsWith("[LiveLayer]") && c.current.push({
|
|
3230
|
+
id: sn++,
|
|
3197
3231
|
ts: Date.now(),
|
|
3198
|
-
kind:
|
|
3199
|
-
type:
|
|
3200
|
-
data: { args:
|
|
3232
|
+
kind: D,
|
|
3233
|
+
type: T.slice(0, 120),
|
|
3234
|
+
data: { args: x.slice(1).map((B) => ti(B)) }
|
|
3201
3235
|
});
|
|
3202
3236
|
} catch {
|
|
3203
3237
|
}
|
|
3204
|
-
return z.apply(this,
|
|
3238
|
+
return z.apply(this, x);
|
|
3205
3239
|
};
|
|
3206
|
-
return console.warn =
|
|
3207
|
-
console.warn =
|
|
3240
|
+
return console.warn = S("warn", y), console.log = S("log", m), () => {
|
|
3241
|
+
console.warn = y, console.log = m;
|
|
3208
3242
|
};
|
|
3209
|
-
}, []), !
|
|
3243
|
+
}, []), !i)
|
|
3210
3244
|
return /* @__PURE__ */ n(
|
|
3211
3245
|
"button",
|
|
3212
3246
|
{
|
|
3213
3247
|
type: "button",
|
|
3214
|
-
onClick: () =>
|
|
3248
|
+
onClick: () => o(!0),
|
|
3215
3249
|
title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
|
|
3216
3250
|
"aria-label": "Open LiveLayer debug panel",
|
|
3217
3251
|
style: {
|
|
@@ -3233,12 +3267,12 @@ function po({
|
|
|
3233
3267
|
children: "🛰 LL debug"
|
|
3234
3268
|
}
|
|
3235
3269
|
);
|
|
3236
|
-
const
|
|
3237
|
-
if (!
|
|
3238
|
-
const
|
|
3239
|
-
return
|
|
3270
|
+
const b = l.filter((y) => {
|
|
3271
|
+
if (!a) return !0;
|
|
3272
|
+
const m = a.toLowerCase();
|
|
3273
|
+
return y.type.toLowerCase().includes(m) || JSON.stringify(y.data || {}).toLowerCase().includes(m);
|
|
3240
3274
|
});
|
|
3241
|
-
return /* @__PURE__ */
|
|
3275
|
+
return /* @__PURE__ */ v(
|
|
3242
3276
|
"div",
|
|
3243
3277
|
{
|
|
3244
3278
|
style: {
|
|
@@ -3260,7 +3294,7 @@ function po({
|
|
|
3260
3294
|
overflow: "hidden"
|
|
3261
3295
|
},
|
|
3262
3296
|
children: [
|
|
3263
|
-
/* @__PURE__ */
|
|
3297
|
+
/* @__PURE__ */ v(
|
|
3264
3298
|
"div",
|
|
3265
3299
|
{
|
|
3266
3300
|
style: {
|
|
@@ -3273,7 +3307,7 @@ function po({
|
|
|
3273
3307
|
},
|
|
3274
3308
|
children: [
|
|
3275
3309
|
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3276
|
-
/* @__PURE__ */
|
|
3310
|
+
/* @__PURE__ */ v("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3277
3311
|
l.length,
|
|
3278
3312
|
" event",
|
|
3279
3313
|
l.length === 1 ? "" : "s"
|
|
@@ -3283,7 +3317,7 @@ function po({
|
|
|
3283
3317
|
"button",
|
|
3284
3318
|
{
|
|
3285
3319
|
type: "button",
|
|
3286
|
-
onClick: () =>
|
|
3320
|
+
onClick: () => _((y) => !y),
|
|
3287
3321
|
style: Nt(f ? "#f59e0b" : "transparent"),
|
|
3288
3322
|
title: "Pause / resume capture",
|
|
3289
3323
|
children: f ? "▶ resume" : "⏸ pause"
|
|
@@ -3294,7 +3328,7 @@ function po({
|
|
|
3294
3328
|
{
|
|
3295
3329
|
type: "button",
|
|
3296
3330
|
onClick: () => {
|
|
3297
|
-
|
|
3331
|
+
s([]), c.current = [];
|
|
3298
3332
|
},
|
|
3299
3333
|
style: Nt("transparent"),
|
|
3300
3334
|
title: "Clear buffer",
|
|
@@ -3305,7 +3339,7 @@ function po({
|
|
|
3305
3339
|
"button",
|
|
3306
3340
|
{
|
|
3307
3341
|
type: "button",
|
|
3308
|
-
onClick: () =>
|
|
3342
|
+
onClick: () => o(!1),
|
|
3309
3343
|
style: Nt("transparent"),
|
|
3310
3344
|
"aria-label": "Close",
|
|
3311
3345
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
@@ -3319,8 +3353,8 @@ function po({
|
|
|
3319
3353
|
"input",
|
|
3320
3354
|
{
|
|
3321
3355
|
type: "text",
|
|
3322
|
-
value:
|
|
3323
|
-
onChange: (
|
|
3356
|
+
value: a,
|
|
3357
|
+
onChange: (y) => d(y.target.value),
|
|
3324
3358
|
placeholder: "filter by type or data…",
|
|
3325
3359
|
style: {
|
|
3326
3360
|
margin: 8,
|
|
@@ -3342,7 +3376,7 @@ function po({
|
|
|
3342
3376
|
overflowY: "auto",
|
|
3343
3377
|
padding: "0 8px 8px"
|
|
3344
3378
|
},
|
|
3345
|
-
children:
|
|
3379
|
+
children: b.length === 0 ? /* @__PURE__ */ v(
|
|
3346
3380
|
"div",
|
|
3347
3381
|
{
|
|
3348
3382
|
style: {
|
|
@@ -3372,16 +3406,16 @@ function po({
|
|
|
3372
3406
|
)
|
|
3373
3407
|
]
|
|
3374
3408
|
}
|
|
3375
|
-
) :
|
|
3376
|
-
|
|
3409
|
+
) : b.map((y) => /* @__PURE__ */ n(
|
|
3410
|
+
ei,
|
|
3377
3411
|
{
|
|
3378
|
-
entry:
|
|
3379
|
-
expanded:
|
|
3412
|
+
entry: y,
|
|
3413
|
+
expanded: u.current.has(y.id),
|
|
3380
3414
|
onToggle: () => {
|
|
3381
|
-
|
|
3415
|
+
u.current.has(y.id) ? u.current.delete(y.id) : u.current.add(y.id), s((m) => [...m]);
|
|
3382
3416
|
}
|
|
3383
3417
|
},
|
|
3384
|
-
|
|
3418
|
+
y.id
|
|
3385
3419
|
))
|
|
3386
3420
|
}
|
|
3387
3421
|
)
|
|
@@ -3389,15 +3423,15 @@ function po({
|
|
|
3389
3423
|
}
|
|
3390
3424
|
);
|
|
3391
3425
|
}
|
|
3392
|
-
function
|
|
3426
|
+
function ei({
|
|
3393
3427
|
entry: e,
|
|
3394
3428
|
expanded: t,
|
|
3395
3429
|
onToggle: r
|
|
3396
3430
|
}) {
|
|
3397
|
-
const
|
|
3431
|
+
const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", o = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
3398
3432
|
hour12: !1
|
|
3399
3433
|
});
|
|
3400
|
-
return /* @__PURE__ */
|
|
3434
|
+
return /* @__PURE__ */ v(
|
|
3401
3435
|
"button",
|
|
3402
3436
|
{
|
|
3403
3437
|
type: "button",
|
|
@@ -3415,7 +3449,7 @@ function eo({
|
|
|
3415
3449
|
lineHeight: 1.4
|
|
3416
3450
|
},
|
|
3417
3451
|
children: [
|
|
3418
|
-
/* @__PURE__ */
|
|
3452
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
3419
3453
|
/* @__PURE__ */ n(
|
|
3420
3454
|
"span",
|
|
3421
3455
|
{
|
|
@@ -3424,14 +3458,14 @@ function eo({
|
|
|
3424
3458
|
fontVariantNumeric: "tabular-nums",
|
|
3425
3459
|
fontSize: 10
|
|
3426
3460
|
},
|
|
3427
|
-
children:
|
|
3461
|
+
children: o
|
|
3428
3462
|
}
|
|
3429
3463
|
),
|
|
3430
3464
|
/* @__PURE__ */ n(
|
|
3431
3465
|
"span",
|
|
3432
3466
|
{
|
|
3433
3467
|
style: {
|
|
3434
|
-
color:
|
|
3468
|
+
color: i,
|
|
3435
3469
|
fontWeight: 600,
|
|
3436
3470
|
flexShrink: 0
|
|
3437
3471
|
},
|
|
@@ -3470,48 +3504,48 @@ function Nt(e) {
|
|
|
3470
3504
|
cursor: "pointer"
|
|
3471
3505
|
};
|
|
3472
3506
|
}
|
|
3473
|
-
function
|
|
3507
|
+
function ti(e) {
|
|
3474
3508
|
try {
|
|
3475
3509
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3476
3510
|
} catch {
|
|
3477
3511
|
return String(e);
|
|
3478
3512
|
}
|
|
3479
3513
|
}
|
|
3480
|
-
function
|
|
3481
|
-
const [e, t] =
|
|
3514
|
+
function pi() {
|
|
3515
|
+
const [e, t] = C([]), r = E((o) => {
|
|
3482
3516
|
t((l) => {
|
|
3483
|
-
const
|
|
3484
|
-
if (
|
|
3485
|
-
const
|
|
3486
|
-
return
|
|
3517
|
+
const s = l.findIndex((a) => a.id === o.id);
|
|
3518
|
+
if (s >= 0) {
|
|
3519
|
+
const a = l.slice();
|
|
3520
|
+
return a[s] = o, a;
|
|
3487
3521
|
}
|
|
3488
|
-
return [...l,
|
|
3522
|
+
return [...l, o];
|
|
3489
3523
|
});
|
|
3490
|
-
}, []),
|
|
3524
|
+
}, []), i = E(() => t([]), []);
|
|
3491
3525
|
return {
|
|
3492
3526
|
entries: e,
|
|
3493
3527
|
pushSegment: r,
|
|
3494
|
-
clear:
|
|
3528
|
+
clear: i,
|
|
3495
3529
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
3496
3530
|
};
|
|
3497
3531
|
}
|
|
3498
3532
|
export {
|
|
3499
3533
|
Zr as AvatarWidget,
|
|
3500
3534
|
Hn as ErrorBoundary,
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3535
|
+
fi as LiveLayerDebugPanel,
|
|
3536
|
+
ui as LiveLayerField,
|
|
3537
|
+
di as LiveLayerForm,
|
|
3538
|
+
si as LiveLayerRegion,
|
|
3539
|
+
ci as LiveLayerWidget,
|
|
3506
3540
|
Or as clearPageContextCache,
|
|
3507
3541
|
Ur as clearRoutesCache,
|
|
3508
3542
|
zr as extractPageContext,
|
|
3509
3543
|
qr as extractRoutes,
|
|
3510
3544
|
an as getCachedPageContext,
|
|
3511
3545
|
St as getCachedRoutes,
|
|
3512
|
-
|
|
3546
|
+
cr as matchesPattern,
|
|
3513
3547
|
Wr as normalizeRouteInput,
|
|
3514
|
-
|
|
3548
|
+
sr as shouldRenderAtPath,
|
|
3515
3549
|
Yn as useAgentInfo,
|
|
3516
3550
|
Bn as useAudioLevel,
|
|
3517
3551
|
Un as useCameraState,
|
|
@@ -3524,5 +3558,5 @@ export {
|
|
|
3524
3558
|
rr as usePathname,
|
|
3525
3559
|
dr as useRouteMatch,
|
|
3526
3560
|
jn as useScreenShareState,
|
|
3527
|
-
|
|
3561
|
+
pi as useTranscript
|
|
3528
3562
|
};
|