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