@livelayer/react 0.22.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +943 -937
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as br, useState as M, useRef as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { jsxs as S, jsx as r, Fragment as We } from "react/jsx-runtime";
|
|
3
|
+
import { Component as br, useState as M, useRef as T, useEffect as I, useCallback as C, useMemo as it, useLayoutEffect as Un, forwardRef as Qt, useImperativeHandle as wr, createElement as _r } from "react";
|
|
4
|
+
import { createPortal as en } from "react-dom";
|
|
5
5
|
import { LiveKitSession as xr, registerFields as Lr } from "@livelayer/sdk";
|
|
6
6
|
import { clearFieldRegistry as Do, getRegisteredFields as Po, registerFields as zo, setFieldValue as $o } from "@livelayer/sdk";
|
|
7
|
-
import { createLocalAudioTrack as Cr, Track as
|
|
7
|
+
import { createLocalAudioTrack as Cr, Track as jn, createLocalVideoTrack as kr } from "livekit-client";
|
|
8
8
|
class Sr extends br {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
@@ -20,7 +20,7 @@ class Sr extends br {
|
|
|
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__ */ S("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
24
24
|
/* @__PURE__ */ r("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
25
25
|
/* @__PURE__ */ r("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
26
26
|
/* @__PURE__ */ r(
|
|
@@ -36,11 +36,11 @@ class Sr extends br {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function Er(e) {
|
|
39
|
-
const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [u, m] = M(null), [p, h] = M(null), [D,
|
|
40
|
-
|
|
41
|
-
const
|
|
39
|
+
const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [u, m] = M(null), [p, h] = M(null), [D, _] = M(!1), [k, g] = M(null), w = T(null), R = T(e.onDataMessage);
|
|
40
|
+
R.current = e.onDataMessage, I(() => {
|
|
41
|
+
const y = {
|
|
42
42
|
onConnectionStateChange: (B) => {
|
|
43
|
-
n(B), B === "connected" &&
|
|
43
|
+
n(B), B === "connected" && g(null);
|
|
44
44
|
},
|
|
45
45
|
onAgentStateChange: l,
|
|
46
46
|
onTranscript: (B) => s([...B]),
|
|
@@ -48,12 +48,12 @@ function Er(e) {
|
|
|
48
48
|
onAudioTrack: (B) => h(B),
|
|
49
49
|
onVideoTrack: (B) => m(B),
|
|
50
50
|
onVideoTrackRemoved: () => m(null),
|
|
51
|
-
onError: (B) =>
|
|
51
|
+
onError: (B) => g(B),
|
|
52
52
|
onDataMessage: (B) => {
|
|
53
53
|
var K;
|
|
54
|
-
(K =
|
|
54
|
+
(K = R.current) == null || K.call(R, B);
|
|
55
55
|
},
|
|
56
|
-
onResumabilityChange:
|
|
56
|
+
onResumabilityChange: _
|
|
57
57
|
}, z = new xr(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
@@ -62,9 +62,9 @@ function Er(e) {
|
|
|
62
62
|
sessionEndpoint: e.sessionEndpoint,
|
|
63
63
|
sessionBody: e.sessionBody
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
y
|
|
66
66
|
);
|
|
67
|
-
return w.current = z, n("idle"), l("idle"), s([]), c(null), m(null), h(null),
|
|
67
|
+
return w.current = z, n("idle"), l("idle"), s([]), c(null), m(null), h(null), _(!1), g(null), () => {
|
|
68
68
|
var B;
|
|
69
69
|
(B = z.destroy) == null || B.call(z), w.current = null;
|
|
70
70
|
};
|
|
@@ -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 E = C(async () => {
|
|
79
|
+
const y = w.current;
|
|
80
|
+
if (y)
|
|
81
81
|
try {
|
|
82
|
-
await
|
|
82
|
+
await y.connect();
|
|
83
83
|
} catch (z) {
|
|
84
|
-
throw
|
|
84
|
+
throw g(z instanceof Error ? z.message : String(z)), z;
|
|
85
85
|
}
|
|
86
86
|
}, []), v = C(() => {
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const y = w.current;
|
|
88
|
+
y && y.disconnect();
|
|
89
89
|
}, []), O = C(() => {
|
|
90
|
-
var
|
|
91
|
-
return ((
|
|
90
|
+
var y;
|
|
91
|
+
return ((y = w.current) == null ? void 0 : y.getRoom()) ?? null;
|
|
92
92
|
}, []);
|
|
93
93
|
return {
|
|
94
94
|
connectionState: t,
|
|
@@ -98,81 +98,81 @@ function Er(e) {
|
|
|
98
98
|
videoElement: u,
|
|
99
99
|
audioElement: p,
|
|
100
100
|
canResume: D,
|
|
101
|
-
error:
|
|
102
|
-
connect:
|
|
101
|
+
error: k,
|
|
102
|
+
connect: E,
|
|
103
103
|
disconnect: v,
|
|
104
104
|
getRoom: O,
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
function Ar() {
|
|
109
|
-
const e =
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
109
|
+
const e = T(null), t = T(/* @__PURE__ */ new Map()), n = T(null), i = T(/* @__PURE__ */ new Set()), l = C(() => {
|
|
110
|
+
const _ = t.current;
|
|
111
|
+
if (_.size === 0) {
|
|
112
112
|
n.current = null;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
let
|
|
116
|
-
for (const { analyser:
|
|
117
|
-
|
|
118
|
-
let
|
|
119
|
-
for (let v = 0; v < w.length; v++)
|
|
120
|
-
const
|
|
121
|
-
|
|
115
|
+
let k = 0;
|
|
116
|
+
for (const { analyser: g, buffer: w } of _.values()) {
|
|
117
|
+
g.getByteFrequencyData(w);
|
|
118
|
+
let R = 0;
|
|
119
|
+
for (let v = 0; v < w.length; v++) R += w[v];
|
|
120
|
+
const E = R / w.length / 255;
|
|
121
|
+
E > k && (k = E);
|
|
122
122
|
}
|
|
123
|
-
for (const
|
|
123
|
+
for (const g of i.current)
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
g(k);
|
|
126
126
|
} catch (w) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", w);
|
|
128
128
|
}
|
|
129
129
|
n.current = requestAnimationFrame(l);
|
|
130
130
|
}, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = C(() => {
|
|
131
131
|
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(l));
|
|
132
|
-
}, [l]), a = C((
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
132
|
+
}, [l]), a = C((_) => {
|
|
133
|
+
const k = t.current.get(_);
|
|
134
|
+
if (k) {
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
k.node.disconnect();
|
|
137
137
|
} catch {
|
|
138
138
|
}
|
|
139
139
|
try {
|
|
140
|
-
|
|
140
|
+
k.analyser.disconnect();
|
|
141
141
|
} catch {
|
|
142
142
|
}
|
|
143
|
-
t.current.delete(
|
|
143
|
+
t.current.delete(_);
|
|
144
144
|
}
|
|
145
145
|
}, []), c = C(
|
|
146
|
-
(
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
149
|
-
a(
|
|
150
|
-
const w =
|
|
146
|
+
(_, k) => {
|
|
147
|
+
const g = o();
|
|
148
|
+
if (!g) return;
|
|
149
|
+
a(_);
|
|
150
|
+
const w = k(g);
|
|
151
151
|
if (!w) return;
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const R = g.createAnalyser();
|
|
153
|
+
R.fftSize = 64;
|
|
154
154
|
try {
|
|
155
|
-
w.connect(
|
|
156
|
-
} catch (
|
|
157
|
-
console.warn("[useAudioLevel] connect failed for slot",
|
|
155
|
+
w.connect(R);
|
|
156
|
+
} catch (E) {
|
|
157
|
+
console.warn("[useAudioLevel] connect failed for slot", _, E);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
t.current.set(
|
|
161
|
-
analyser:
|
|
160
|
+
t.current.set(_, {
|
|
161
|
+
analyser: R,
|
|
162
162
|
node: w,
|
|
163
|
-
buffer: new Uint8Array(new ArrayBuffer(
|
|
163
|
+
buffer: new Uint8Array(new ArrayBuffer(R.frequencyBinCount))
|
|
164
164
|
}), s();
|
|
165
165
|
},
|
|
166
166
|
[a, o, s]
|
|
167
167
|
), u = C(
|
|
168
|
-
(
|
|
169
|
-
c(
|
|
168
|
+
(_, k = "agent") => {
|
|
169
|
+
c(k, (g) => {
|
|
170
170
|
try {
|
|
171
|
-
return
|
|
171
|
+
return g.createMediaElementSource(_);
|
|
172
172
|
} catch (w) {
|
|
173
173
|
return console.warn(
|
|
174
174
|
"[useAudioLevel] createMediaElementSource failed for slot",
|
|
175
|
-
|
|
175
|
+
k,
|
|
176
176
|
w
|
|
177
177
|
), null;
|
|
178
178
|
}
|
|
@@ -180,14 +180,14 @@ function Ar() {
|
|
|
180
180
|
},
|
|
181
181
|
[c]
|
|
182
182
|
), m = C(
|
|
183
|
-
(
|
|
184
|
-
c(
|
|
183
|
+
(_, k = "mic") => {
|
|
184
|
+
c(k, (g) => {
|
|
185
185
|
try {
|
|
186
|
-
return
|
|
186
|
+
return g.createMediaStreamSource(_);
|
|
187
187
|
} catch (w) {
|
|
188
188
|
return console.warn(
|
|
189
189
|
"[useAudioLevel] createMediaStreamSource failed for slot",
|
|
190
|
-
|
|
190
|
+
k,
|
|
191
191
|
w
|
|
192
192
|
), null;
|
|
193
193
|
}
|
|
@@ -195,18 +195,18 @@ function Ar() {
|
|
|
195
195
|
},
|
|
196
196
|
[c]
|
|
197
197
|
), p = C(
|
|
198
|
-
(
|
|
199
|
-
a(
|
|
198
|
+
(_) => {
|
|
199
|
+
a(_), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
200
200
|
},
|
|
201
201
|
[a]
|
|
202
202
|
), h = C(() => {
|
|
203
203
|
n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
204
|
-
for (const
|
|
205
|
-
a(
|
|
206
|
-
}, [a]), D = C((
|
|
207
|
-
i.current.delete(
|
|
204
|
+
for (const _ of Array.from(t.current.keys()))
|
|
205
|
+
a(_);
|
|
206
|
+
}, [a]), D = C((_) => (i.current.add(_), () => {
|
|
207
|
+
i.current.delete(_);
|
|
208
208
|
}), []);
|
|
209
|
-
return
|
|
209
|
+
return I(() => () => {
|
|
210
210
|
if (h(), e.current) {
|
|
211
211
|
try {
|
|
212
212
|
e.current.close();
|
|
@@ -222,10 +222,10 @@ function Nr(e) {
|
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
224
|
function Mr(e = {}) {
|
|
225
|
-
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), u =
|
|
225
|
+
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), u = T(null), m = T(null), p = T({
|
|
226
226
|
active: t,
|
|
227
227
|
lastAutoIntent: null
|
|
228
|
-
}), h = C(async (
|
|
228
|
+
}), h = C(async (E) => {
|
|
229
229
|
var v, O;
|
|
230
230
|
if (u.current && m.current) {
|
|
231
231
|
try {
|
|
@@ -234,121 +234,121 @@ function Mr(e = {}) {
|
|
|
234
234
|
}
|
|
235
235
|
u.current.stop(), u.current = null;
|
|
236
236
|
}
|
|
237
|
-
m.current =
|
|
237
|
+
m.current = E, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const
|
|
239
|
+
const y = await Cr({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
243
|
-
await
|
|
244
|
-
const z = (O = (v =
|
|
243
|
+
await E.localParticipant.publishTrack(y), u.current = y, p.current.active ? (await E.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, l(!0)) : l(y.isMuted);
|
|
244
|
+
const z = (O = (v = y.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
|
|
245
245
|
z != null && z.deviceId && s(z.deviceId);
|
|
246
|
-
} catch (
|
|
247
|
-
const z =
|
|
248
|
-
throw c(z),
|
|
246
|
+
} catch (y) {
|
|
247
|
+
const z = y instanceof Error && y.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
248
|
+
throw c(z), y;
|
|
249
249
|
}
|
|
250
|
-
}, []), D = C((
|
|
251
|
-
m.current =
|
|
252
|
-
}, []),
|
|
250
|
+
}, []), D = C((E) => {
|
|
251
|
+
m.current = E;
|
|
252
|
+
}, []), _ = C(async (E) => {
|
|
253
253
|
const v = m.current;
|
|
254
254
|
if (v)
|
|
255
255
|
try {
|
|
256
|
-
await v.switchActiveDevice("audioinput",
|
|
256
|
+
await v.switchActiveDevice("audioinput", E), s(E);
|
|
257
257
|
} catch (O) {
|
|
258
258
|
console.warn("[useMicrophoneState] switchDevice failed:", O);
|
|
259
259
|
}
|
|
260
|
-
}, []),
|
|
261
|
-
const
|
|
262
|
-
if (l(v), p.current.active = !1, !!
|
|
260
|
+
}, []), k = C(async () => {
|
|
261
|
+
const E = m.current, v = !i;
|
|
262
|
+
if (l(v), p.current.active = !1, !!E)
|
|
263
263
|
try {
|
|
264
|
-
await
|
|
264
|
+
await E.localParticipant.setMicrophoneEnabled(!v);
|
|
265
265
|
} catch (O) {
|
|
266
266
|
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!v);
|
|
267
267
|
}
|
|
268
268
|
}, [i]);
|
|
269
|
-
|
|
269
|
+
I(() => {
|
|
270
270
|
if (!p.current.active || n !== "listening") return;
|
|
271
|
-
const
|
|
271
|
+
const E = m.current, v = E == null ? void 0 : E.localParticipant;
|
|
272
272
|
if (!v) {
|
|
273
273
|
p.current.active = !1;
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, l(!1)), p.current.active = !1;
|
|
277
277
|
}, [n]);
|
|
278
|
-
const
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
278
|
+
const g = C(() => {
|
|
279
|
+
const E = u.current, v = m.current;
|
|
280
|
+
if (E && v) {
|
|
281
281
|
try {
|
|
282
|
-
v.localParticipant.unpublishTrack(
|
|
282
|
+
v.localParticipant.unpublishTrack(E);
|
|
283
283
|
} catch {
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
E.stop();
|
|
286
286
|
}
|
|
287
287
|
u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
|
|
288
|
-
}, [t]), w = C(() => c(null), []),
|
|
288
|
+
}, [t]), w = C(() => c(null), []), R = C(() => Nr(u.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
291
|
activeDeviceId: o,
|
|
292
292
|
micError: a,
|
|
293
|
-
toggleMute:
|
|
293
|
+
toggleMute: k,
|
|
294
294
|
setupMic: h,
|
|
295
295
|
attachRoom: D,
|
|
296
|
-
switchDevice:
|
|
297
|
-
teardownMic:
|
|
296
|
+
switchDevice: _,
|
|
297
|
+
teardownMic: g,
|
|
298
298
|
clearError: w,
|
|
299
|
-
getMicStream:
|
|
299
|
+
getMicStream: R
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
const Ir = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
303
|
function Tr() {
|
|
304
|
-
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c =
|
|
304
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = T(null), u = T(null), m = C((w) => {
|
|
305
305
|
c.current = w;
|
|
306
306
|
}, []), p = C(() => {
|
|
307
|
-
var
|
|
308
|
-
const w = c.current,
|
|
309
|
-
if (
|
|
310
|
-
const v = w.localParticipant.getTrackPublication(
|
|
307
|
+
var E;
|
|
308
|
+
const w = c.current, R = u.current;
|
|
309
|
+
if (R && w) {
|
|
310
|
+
const v = w.localParticipant.getTrackPublication(jn.Source.Camera), y = (v == null ? void 0 : v.track) ?? R;
|
|
311
311
|
try {
|
|
312
|
-
w.localParticipant.unpublishTrack(
|
|
312
|
+
w.localParticipant.unpublishTrack(y);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
try {
|
|
316
|
-
(
|
|
316
|
+
(E = y.stop) == null || E.call(y);
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
u.current = null, o(null), t(!1);
|
|
321
321
|
}, []), h = C(async (w) => {
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
322
|
+
const R = c.current;
|
|
323
|
+
if (R) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const
|
|
327
|
-
w && (
|
|
328
|
-
const v = await kr(
|
|
329
|
-
await
|
|
326
|
+
const E = { ...Ir };
|
|
327
|
+
w && (E.deviceId = w);
|
|
328
|
+
const v = await kr(E);
|
|
329
|
+
await R.localParticipant.publishTrack(v), u.current = v;
|
|
330
330
|
const O = v.attach();
|
|
331
331
|
o(O), t(!0), w && a(w);
|
|
332
332
|
try {
|
|
333
|
-
|
|
333
|
+
R.localParticipant.publishData(
|
|
334
334
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
335
335
|
{ reliable: !0 }
|
|
336
336
|
);
|
|
337
337
|
} catch {
|
|
338
338
|
}
|
|
339
|
-
} catch (
|
|
340
|
-
const v =
|
|
339
|
+
} catch (E) {
|
|
340
|
+
const v = E instanceof Error && E.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
341
341
|
i(v);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}, []), D = C(async () => {
|
|
345
345
|
e ? p() : await h(s || void 0);
|
|
346
|
-
}, [e, s, p, h]),
|
|
346
|
+
}, [e, s, p, h]), _ = C(async (w) => {
|
|
347
347
|
p(), await h(w);
|
|
348
|
-
}, [p, h]),
|
|
348
|
+
}, [p, h]), k = C(() => {
|
|
349
349
|
p(), c.current = null, i(null), a("");
|
|
350
|
-
}, [p]),
|
|
351
|
-
return
|
|
350
|
+
}, [p]), g = C(() => i(null), []);
|
|
351
|
+
return I(() => () => {
|
|
352
352
|
u.current && u.current.stop();
|
|
353
353
|
}, []), {
|
|
354
354
|
isEnabled: e,
|
|
@@ -356,14 +356,14 @@ function Tr() {
|
|
|
356
356
|
previewEl: l,
|
|
357
357
|
activeDeviceId: s,
|
|
358
358
|
toggle: D,
|
|
359
|
-
switchDevice:
|
|
359
|
+
switchDevice: _,
|
|
360
360
|
attachRoom: m,
|
|
361
|
-
teardown:
|
|
362
|
-
clearError:
|
|
361
|
+
teardown: k,
|
|
362
|
+
clearError: g
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
365
|
function Rr() {
|
|
366
|
-
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s =
|
|
366
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = T(null), a = C((h) => {
|
|
367
367
|
s.current = h;
|
|
368
368
|
}, []), c = C(() => o(null), []), u = C(async () => {
|
|
369
369
|
const h = s.current;
|
|
@@ -380,11 +380,11 @@ function Rr() {
|
|
|
380
380
|
try {
|
|
381
381
|
await h.localParticipant.setScreenShareEnabled(!0);
|
|
382
382
|
let D = 0;
|
|
383
|
-
const
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const
|
|
387
|
-
o(
|
|
383
|
+
const _ = () => {
|
|
384
|
+
const k = h.localParticipant.getTrackPublication(jn.Source.ScreenShare);
|
|
385
|
+
if (k != null && k.track) {
|
|
386
|
+
const g = k.track.attach();
|
|
387
|
+
o(g), t(!0);
|
|
388
388
|
try {
|
|
389
389
|
h.localParticipant.publishData(
|
|
390
390
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -394,12 +394,12 @@ function Rr() {
|
|
|
394
394
|
}
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
D++ < 10 ? setTimeout(
|
|
397
|
+
D++ < 10 ? setTimeout(_, 100) : t(!0);
|
|
398
398
|
};
|
|
399
|
-
|
|
399
|
+
_();
|
|
400
400
|
} catch (D) {
|
|
401
|
-
const
|
|
402
|
-
|
|
401
|
+
const _ = D instanceof Error ? D.name : "";
|
|
402
|
+
_ !== "NotAllowedError" && _ !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
}, [e, c]), m = C(() => {
|
|
@@ -422,7 +422,7 @@ function Dr() {
|
|
|
422
422
|
} catch {
|
|
423
423
|
}
|
|
424
424
|
}, []);
|
|
425
|
-
return
|
|
425
|
+
return I(() => {
|
|
426
426
|
if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
427
427
|
const o = () => void l();
|
|
428
428
|
return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
|
|
@@ -430,7 +430,7 @@ function Dr() {
|
|
|
430
430
|
}
|
|
431
431
|
function Pr(e, t, n = !1) {
|
|
432
432
|
const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
|
|
433
|
-
return
|
|
433
|
+
return I(() => {
|
|
434
434
|
if (n || !e) {
|
|
435
435
|
c(!1);
|
|
436
436
|
return;
|
|
@@ -451,7 +451,7 @@ function Pr(e, t, n = !1) {
|
|
|
451
451
|
}), () => u.abort();
|
|
452
452
|
}, [e, t, n]), { info: i, error: o, loading: a };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Vn(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,7 +459,7 @@ function Un(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Yn(e, t) {
|
|
463
463
|
if (!(typeof window > "u"))
|
|
464
464
|
try {
|
|
465
465
|
window.localStorage.setItem(e, t);
|
|
@@ -497,23 +497,23 @@ function Fr({
|
|
|
497
497
|
persistKey: i = "ll-widget",
|
|
498
498
|
disablePersistence: l = !1
|
|
499
499
|
} = {}) {
|
|
500
|
-
const o = `${i}:display-mode`, s =
|
|
500
|
+
const o = `${i}:display-mode`, s = T(!1), [a, c] = $r({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
503
|
onChange: (u) => {
|
|
504
|
-
e === void 0 && !l &&
|
|
504
|
+
e === void 0 && !l && Yn(o, u), n == null || n(u);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
|
-
return
|
|
507
|
+
return I(() => {
|
|
508
508
|
if (s.current || (s.current = !0, l || e !== void 0)) return;
|
|
509
|
-
const u = Or(
|
|
509
|
+
const u = Or(Vn(o));
|
|
510
510
|
u && u !== a && c(u);
|
|
511
511
|
}, []), [a, c];
|
|
512
512
|
}
|
|
513
513
|
const Br = 640;
|
|
514
514
|
function Wr(e = Br) {
|
|
515
515
|
const [t, n] = M(!1);
|
|
516
|
-
return
|
|
516
|
+
return I(() => {
|
|
517
517
|
if (e === !1) {
|
|
518
518
|
n(!1);
|
|
519
519
|
return;
|
|
@@ -527,7 +527,7 @@ function Wr(e = Br) {
|
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
529
|
const qr = 280, Ur = 380, jr = 8, Vr = 4;
|
|
530
|
-
function
|
|
530
|
+
function jt(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
533
|
function Yr(e) {
|
|
@@ -542,17 +542,17 @@ function Yr(e) {
|
|
|
542
542
|
const n = t, { top: i, left: l, width: o, height: s } = n;
|
|
543
543
|
return typeof i != "number" || typeof l != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(l) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: l, width: o, height: s };
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function It() {
|
|
546
546
|
return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Vt(e, t, n) {
|
|
549
549
|
const { minWidth: i, minHeight: l, edgeMargin: o, vw: s, vh: a } = n, c = Math.max(i, s - o * 2), u = Math.max(l, a - o * 2);
|
|
550
550
|
return {
|
|
551
551
|
width: Math.max(i, Math.min(c, e)),
|
|
552
552
|
height: Math.max(l, Math.min(u, t))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function Yt(e, t, n, i, l) {
|
|
556
556
|
const { edgeMargin: o, vw: s, vh: a } = l, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, a - i - o);
|
|
557
557
|
return {
|
|
558
558
|
top: Math.max(u, Math.min(p, e)),
|
|
@@ -568,43 +568,43 @@ function Gr(e) {
|
|
|
568
568
|
minWidth: o = qr,
|
|
569
569
|
minHeight: s = Ur,
|
|
570
570
|
edgeMargin: a = jr
|
|
571
|
-
} = e, [c, u] = M(null), [m, p] = M(!1), [h, D] = M(!1),
|
|
571
|
+
} = e, [c, u] = M(null), [m, p] = M(!1), [h, D] = M(!1), _ = T(null), k = T(null), g = T(!1), w = T(null);
|
|
572
572
|
w.current = c;
|
|
573
|
-
const
|
|
573
|
+
const R = C(
|
|
574
574
|
(f) => {
|
|
575
|
-
l || (f === null ? zr(
|
|
575
|
+
l || (f === null ? zr(jt(i)) : Yn(jt(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
577
|
[l, i]
|
|
578
578
|
);
|
|
579
|
-
|
|
580
|
-
if (
|
|
581
|
-
const f = Yr(
|
|
579
|
+
I(() => {
|
|
580
|
+
if (g.current || (g.current = !0, l)) return;
|
|
581
|
+
const f = Yr(Vn(jt(i)));
|
|
582
582
|
if (!f) return;
|
|
583
|
-
const { vw: A, vh: $ } =
|
|
583
|
+
const { vw: A, vh: $ } = It(), q = Vt(f.width, f.height, {
|
|
584
584
|
minWidth: o,
|
|
585
585
|
minHeight: s,
|
|
586
586
|
edgeMargin: a,
|
|
587
587
|
vw: A,
|
|
588
588
|
vh: $
|
|
589
|
-
}), X =
|
|
589
|
+
}), X = Yt(f.top, f.left, q.width, q.height, {
|
|
590
590
|
edgeMargin: a,
|
|
591
591
|
vw: A,
|
|
592
592
|
vh: $
|
|
593
593
|
});
|
|
594
594
|
u({ ...X, ...q });
|
|
595
|
-
}, []),
|
|
595
|
+
}, []), I(() => {
|
|
596
596
|
if (typeof window > "u") return;
|
|
597
597
|
const f = () => {
|
|
598
598
|
u((A) => {
|
|
599
599
|
if (A === null) return null;
|
|
600
|
-
const { vw: $, vh: q } =
|
|
600
|
+
const { vw: $, vh: q } = It(), X = Vt(A.width, A.height, {
|
|
601
601
|
minWidth: o,
|
|
602
602
|
minHeight: s,
|
|
603
603
|
edgeMargin: a,
|
|
604
604
|
vw: $,
|
|
605
605
|
vh: q
|
|
606
606
|
});
|
|
607
|
-
return { ...
|
|
607
|
+
return { ...Yt(A.top, A.left, X.width, X.height, {
|
|
608
608
|
edgeMargin: a,
|
|
609
609
|
vw: $,
|
|
610
610
|
vh: q
|
|
@@ -613,7 +613,7 @@ function Gr(e) {
|
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
615
615
|
}, [o, s, a]);
|
|
616
|
-
const
|
|
616
|
+
const E = C(
|
|
617
617
|
(f) => {
|
|
618
618
|
if (!t || f.pointerType === "mouse" && f.button !== 0) return;
|
|
619
619
|
const A = f.target;
|
|
@@ -632,7 +632,7 @@ function Gr(e) {
|
|
|
632
632
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
633
633
|
} catch {
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
_.current = {
|
|
636
636
|
startClientX: f.clientX,
|
|
637
637
|
startClientY: f.clientY,
|
|
638
638
|
startTop: $,
|
|
@@ -645,11 +645,11 @@ function Gr(e) {
|
|
|
645
645
|
[t]
|
|
646
646
|
), v = C(
|
|
647
647
|
(f) => {
|
|
648
|
-
const A =
|
|
648
|
+
const A = _.current;
|
|
649
649
|
if (!A) return;
|
|
650
650
|
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY;
|
|
651
651
|
if (!A.moved && Math.abs($) + Math.abs(q) > Vr && (A.moved = !0, p(!0)), !A.moved) return;
|
|
652
|
-
const { vw: X, vh: ee } =
|
|
652
|
+
const { vw: X, vh: ee } = It(), V = Yt(
|
|
653
653
|
A.startTop + q,
|
|
654
654
|
A.startLeft + $,
|
|
655
655
|
A.width,
|
|
@@ -661,19 +661,19 @@ function Gr(e) {
|
|
|
661
661
|
[a]
|
|
662
662
|
), O = C(
|
|
663
663
|
(f) => {
|
|
664
|
-
const A =
|
|
664
|
+
const A = _.current;
|
|
665
665
|
if (A) {
|
|
666
666
|
try {
|
|
667
667
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
668
668
|
} catch {
|
|
669
669
|
}
|
|
670
|
-
|
|
670
|
+
_.current = null, A.moved && (p(!1), u(($) => ($ && R($), $)));
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
|
-
[
|
|
674
|
-
),
|
|
675
|
-
|
|
676
|
-
}, [
|
|
673
|
+
[R]
|
|
674
|
+
), y = C(() => {
|
|
675
|
+
_.current = null, k.current = null, p(!1), D(!1), u(null), R(null);
|
|
676
|
+
}, [R]), z = C(
|
|
677
677
|
(f) => {
|
|
678
678
|
if (!n || f.pointerType === "mouse" && f.button !== 0) return;
|
|
679
679
|
f.stopPropagation();
|
|
@@ -690,7 +690,7 @@ function Gr(e) {
|
|
|
690
690
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
691
691
|
} catch {
|
|
692
692
|
}
|
|
693
|
-
|
|
693
|
+
k.current = {
|
|
694
694
|
startClientX: f.clientX,
|
|
695
695
|
startClientY: f.clientY,
|
|
696
696
|
startWidth: q,
|
|
@@ -702,9 +702,9 @@ function Gr(e) {
|
|
|
702
702
|
[n]
|
|
703
703
|
), B = C(
|
|
704
704
|
(f) => {
|
|
705
|
-
const A =
|
|
705
|
+
const A = k.current;
|
|
706
706
|
if (!A) return;
|
|
707
|
-
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh: ee } =
|
|
707
|
+
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh: ee } = It(), V = X - A.left - a, te = ee - A.top - a, oe = Vt(A.startWidth + $, A.startHeight + q, {
|
|
708
708
|
minWidth: o,
|
|
709
709
|
minHeight: s,
|
|
710
710
|
edgeMargin: a,
|
|
@@ -718,15 +718,15 @@ function Gr(e) {
|
|
|
718
718
|
[a, o, s]
|
|
719
719
|
), K = C(
|
|
720
720
|
(f) => {
|
|
721
|
-
if (
|
|
721
|
+
if (k.current) {
|
|
722
722
|
try {
|
|
723
723
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
724
724
|
} catch {
|
|
725
725
|
}
|
|
726
|
-
|
|
726
|
+
k.current = null, D(!1), u(($) => ($ && R($), $));
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
|
-
[
|
|
729
|
+
[R]
|
|
730
730
|
);
|
|
731
731
|
return {
|
|
732
732
|
style: c === null ? {} : {
|
|
@@ -742,11 +742,11 @@ function Gr(e) {
|
|
|
742
742
|
isDragging: m,
|
|
743
743
|
isResizing: h,
|
|
744
744
|
dragHandleProps: {
|
|
745
|
-
onPointerDown:
|
|
745
|
+
onPointerDown: E,
|
|
746
746
|
onPointerMove: v,
|
|
747
747
|
onPointerUp: O,
|
|
748
748
|
onPointerCancel: O,
|
|
749
|
-
onDoubleClick:
|
|
749
|
+
onDoubleClick: y,
|
|
750
750
|
"data-ll-drag-handle": t ? "" : void 0
|
|
751
751
|
},
|
|
752
752
|
resizeHandleProps: {
|
|
@@ -756,46 +756,46 @@ function Gr(e) {
|
|
|
756
756
|
onPointerCancel: K,
|
|
757
757
|
"data-ll-resize-handle": n ? "" : void 0
|
|
758
758
|
},
|
|
759
|
-
reset:
|
|
759
|
+
reset: y
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
762
|
+
const wn = "__llHistoryPatched", Dt = "ll:pathname";
|
|
763
763
|
function Xr() {
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
764
|
+
if (typeof window > "u" || window.history[wn]) return;
|
|
765
765
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
766
766
|
window.history.pushState = function(...n) {
|
|
767
767
|
const i = e.apply(this, n);
|
|
768
|
-
return window.dispatchEvent(new Event(
|
|
768
|
+
return window.dispatchEvent(new Event(Dt)), i;
|
|
769
769
|
}, window.history.replaceState = function(...n) {
|
|
770
770
|
const i = t.apply(this, n);
|
|
771
|
-
return window.dispatchEvent(new Event(
|
|
772
|
-
}, window.history[
|
|
771
|
+
return window.dispatchEvent(new Event(Dt)), i;
|
|
772
|
+
}, window.history[wn] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function _n() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
777
|
function Kr(e) {
|
|
778
778
|
const [t, n] = M(
|
|
779
|
-
() => e ??
|
|
779
|
+
() => e ?? _n()
|
|
780
780
|
);
|
|
781
|
-
return
|
|
781
|
+
return I(() => {
|
|
782
782
|
if (e !== void 0) return;
|
|
783
783
|
Xr();
|
|
784
|
-
const i = () => n(
|
|
785
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
786
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
784
|
+
const i = () => n(_n());
|
|
785
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(Dt, i), () => {
|
|
786
|
+
window.removeEventListener("popstate", i), window.removeEventListener(Dt, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
790
|
+
const xn = /* @__PURE__ */ new Map(), Jr = /[\\^$+?.()|{}[\]]/g;
|
|
791
791
|
function Zr(e) {
|
|
792
792
|
return e.replace(Jr, "\\$&");
|
|
793
793
|
}
|
|
794
794
|
function Qr(e) {
|
|
795
|
-
const t =
|
|
795
|
+
const t = xn.get(e);
|
|
796
796
|
if (t) return t;
|
|
797
797
|
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a = Zr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
|
|
798
|
-
return
|
|
798
|
+
return xn.set(e, c), c;
|
|
799
799
|
}
|
|
800
800
|
function ei(e, t) {
|
|
801
801
|
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
@@ -804,17 +804,17 @@ function ei(e, t) {
|
|
|
804
804
|
function ti(e, t) {
|
|
805
805
|
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : ei(e, t);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function Ln(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
809
|
for (const n of e)
|
|
810
810
|
if (ti(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
813
|
function ni(e, t, n) {
|
|
814
|
-
return e === void 0 ? !0 :
|
|
814
|
+
return e === void 0 ? !0 : Ln(n, e) ? !1 : t && t.length > 0 ? Ln(t, e) : !0;
|
|
815
815
|
}
|
|
816
816
|
function ri(e, t, n) {
|
|
817
|
-
return
|
|
817
|
+
return it(
|
|
818
818
|
() => ni(e, t, n),
|
|
819
819
|
[e, t, n]
|
|
820
820
|
);
|
|
@@ -827,7 +827,7 @@ function ii(e) {
|
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
829
|
function oi(e) {
|
|
830
|
-
const t =
|
|
830
|
+
const t = it(() => ii(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = T(null), l = C(
|
|
831
831
|
(c) => {
|
|
832
832
|
try {
|
|
833
833
|
new Audio(`${n}${c}`).play().catch(() => {
|
|
@@ -871,7 +871,7 @@ function oi(e) {
|
|
|
871
871
|
},
|
|
872
872
|
[n, t.thinking]
|
|
873
873
|
);
|
|
874
|
-
return
|
|
874
|
+
return I(() => () => {
|
|
875
875
|
if (i.current) {
|
|
876
876
|
try {
|
|
877
877
|
i.current.pause();
|
|
@@ -879,12 +879,12 @@ function oi(e) {
|
|
|
879
879
|
}
|
|
880
880
|
i.current = null;
|
|
881
881
|
}
|
|
882
|
-
}, []),
|
|
882
|
+
}, []), it(
|
|
883
883
|
() => ({ playPageChange: o, playConfirmation: s, setThinking: a }),
|
|
884
884
|
[o, s, a]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const Cn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -930,7 +930,7 @@ const xn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
}
|
|
933
|
-
),
|
|
933
|
+
), kn = ({ className: e }) => /* @__PURE__ */ r(
|
|
934
934
|
"svg",
|
|
935
935
|
{
|
|
936
936
|
className: e,
|
|
@@ -964,7 +964,7 @@ const xn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, Sn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
|
|
968
968
|
"svg",
|
|
969
969
|
{
|
|
970
970
|
className: t,
|
|
@@ -980,11 +980,11 @@ const xn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
980
980
|
function si(e) {
|
|
981
981
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
982
982
|
}
|
|
983
|
-
const
|
|
983
|
+
const Gn = "ll-hidden-tab-center-y", ci = 5, En = 16;
|
|
984
984
|
function ui() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(Gn);
|
|
988
988
|
if (!e) return null;
|
|
989
989
|
const t = Number.parseFloat(e);
|
|
990
990
|
return Number.isFinite(t) ? t : null;
|
|
@@ -992,10 +992,10 @@ function ui() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function An(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(Gn, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
@@ -1009,26 +1009,26 @@ const di = ({
|
|
|
1009
1009
|
agentName: s,
|
|
1010
1010
|
containerEl: a
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const c = si(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!a, [D,
|
|
1012
|
+
const c = si(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!a, [D, _] = M(null), [k, g] = M(!1), w = T(null), R = T(!1), E = C(
|
|
1013
1013
|
(H) => {
|
|
1014
1014
|
if (typeof window > "u") return H;
|
|
1015
|
-
const G = m / 2, f =
|
|
1015
|
+
const G = m / 2, f = En + G, A = window.innerHeight - En - G;
|
|
1016
1016
|
return A < f ? Math.max(f, H) : Math.max(f, Math.min(A, H));
|
|
1017
1017
|
},
|
|
1018
1018
|
[m]
|
|
1019
1019
|
);
|
|
1020
|
-
|
|
1020
|
+
I(() => {
|
|
1021
1021
|
if (h) {
|
|
1022
|
-
|
|
1022
|
+
_(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
1025
|
const H = ui();
|
|
1026
|
-
|
|
1026
|
+
_(E(H ?? window.innerHeight / 2));
|
|
1027
1027
|
const G = () => {
|
|
1028
|
-
|
|
1028
|
+
_((f) => f === null ? null : E(f));
|
|
1029
1029
|
};
|
|
1030
1030
|
return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
|
|
1031
|
-
}, [
|
|
1031
|
+
}, [E, h]);
|
|
1032
1032
|
const v = C(
|
|
1033
1033
|
(H) => {
|
|
1034
1034
|
if (!h && !(H.pointerType === "mouse" && H.button !== 0) && D !== null) {
|
|
@@ -1049,10 +1049,10 @@ const di = ({
|
|
|
1049
1049
|
const G = w.current;
|
|
1050
1050
|
if (!G) return;
|
|
1051
1051
|
const f = H.clientY - G.startClientY;
|
|
1052
|
-
!G.moved && Math.abs(f) > ci && (G.moved = !0,
|
|
1052
|
+
!G.moved && Math.abs(f) > ci && (G.moved = !0, g(!0)), G.moved && _(E(G.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
|
-
[
|
|
1055
|
-
),
|
|
1054
|
+
[E]
|
|
1055
|
+
), y = C(
|
|
1056
1056
|
(H) => {
|
|
1057
1057
|
const G = w.current;
|
|
1058
1058
|
if (G) {
|
|
@@ -1060,13 +1060,13 @@ const di = ({
|
|
|
1060
1060
|
H.currentTarget.releasePointerCapture(H.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null, G.moved && (
|
|
1063
|
+
w.current = null, G.moved && (g(!1), R.current = !0, _((f) => (f !== null && An(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
1067
1067
|
), z = C(() => {
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1068
|
+
if (R.current) {
|
|
1069
|
+
R.current = !1;
|
|
1070
1070
|
return;
|
|
1071
1071
|
}
|
|
1072
1072
|
i();
|
|
@@ -1075,23 +1075,23 @@ const di = ({
|
|
|
1075
1075
|
if (H.key === "ArrowUp" || H.key === "ArrowDown") {
|
|
1076
1076
|
H.preventDefault();
|
|
1077
1077
|
const G = H.key === "ArrowUp" ? -8 : 8;
|
|
1078
|
-
|
|
1078
|
+
_((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
|
-
const A =
|
|
1081
|
-
return
|
|
1080
|
+
const A = E(f + G);
|
|
1081
|
+
return An(A), A;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
1085
|
-
[
|
|
1085
|
+
[E]
|
|
1086
1086
|
), K = [
|
|
1087
1087
|
"ll-hidden",
|
|
1088
1088
|
`ll-hidden--${c}`,
|
|
1089
1089
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
1090
1090
|
n ? "ll-hidden--speaking" : null,
|
|
1091
|
-
|
|
1091
|
+
k ? "is-dragging" : null,
|
|
1092
1092
|
p ? "ll-hidden--with-avatar" : null,
|
|
1093
1093
|
h ? "ll-hidden--scoped" : null
|
|
1094
|
-
].filter(Boolean).join(" "),
|
|
1094
|
+
].filter(Boolean).join(" "), le = D === null ? void 0 : { top: `${D - m / 2}px`, transform: "none" };
|
|
1095
1095
|
return /* @__PURE__ */ r(
|
|
1096
1096
|
"button",
|
|
1097
1097
|
{
|
|
@@ -1099,21 +1099,21 @@ const di = ({
|
|
|
1099
1099
|
className: K,
|
|
1100
1100
|
onPointerDown: v,
|
|
1101
1101
|
onPointerMove: O,
|
|
1102
|
-
onPointerUp:
|
|
1103
|
-
onPointerCancel:
|
|
1102
|
+
onPointerUp: y,
|
|
1103
|
+
onPointerCancel: y,
|
|
1104
1104
|
onClick: z,
|
|
1105
1105
|
onKeyDown: B,
|
|
1106
1106
|
"aria-label": l,
|
|
1107
1107
|
"data-position": e,
|
|
1108
|
-
style:
|
|
1108
|
+
style: le,
|
|
1109
1109
|
children: p ? (
|
|
1110
1110
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
1111
1111
|
// as the click affordance), then the circular avatar photo
|
|
1112
1112
|
// taking the rest of the tab. Reinforces "this is an
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ S(We, { children: [
|
|
1115
1115
|
/* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
Sn,
|
|
1117
1117
|
{
|
|
1118
1118
|
direction: u,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -1130,7 +1130,7 @@ const di = ({
|
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
1132
|
) : /* @__PURE__ */ r(
|
|
1133
|
-
|
|
1133
|
+
Sn,
|
|
1134
1134
|
{
|
|
1135
1135
|
direction: u,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
@@ -1146,16 +1146,16 @@ const di = ({
|
|
|
1146
1146
|
className: l,
|
|
1147
1147
|
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const s =
|
|
1149
|
+
const s = T(null), a = T([]), c = it(() => {
|
|
1150
1150
|
const m = (Math.sqrt(5) - 1) / 2;
|
|
1151
1151
|
return Array.from({ length: t }, (p, h) => 0.5 + h * m % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
1153
|
-
|
|
1153
|
+
I(() => e.subscribe((p) => {
|
|
1154
1154
|
for (let h = 0; h < t; h++) {
|
|
1155
1155
|
const D = a.current[h];
|
|
1156
1156
|
if (!D) continue;
|
|
1157
|
-
const
|
|
1158
|
-
D.style.height = `${
|
|
1157
|
+
const _ = Math.max(i, p * n * c[h]);
|
|
1158
|
+
D.style.height = `${_}px`;
|
|
1159
1159
|
}
|
|
1160
1160
|
}), [e, t, n, i, c]);
|
|
1161
1161
|
const u = ["ll-waveform", l].filter(Boolean).join(" ");
|
|
@@ -1187,7 +1187,7 @@ const di = ({
|
|
|
1187
1187
|
className: "ll-minimized ll-minimized--mobile",
|
|
1188
1188
|
role: "region",
|
|
1189
1189
|
"aria-label": `${n} widget`,
|
|
1190
|
-
children: /* @__PURE__ */
|
|
1190
|
+
children: /* @__PURE__ */ S(
|
|
1191
1191
|
"button",
|
|
1192
1192
|
{
|
|
1193
1193
|
type: "button",
|
|
@@ -1216,7 +1216,7 @@ const di = ({
|
|
|
1216
1216
|
}
|
|
1217
1217
|
),
|
|
1218
1218
|
/* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
|
|
1219
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ S("div", { className: "ll-minimized__controls", children: [
|
|
1220
1220
|
/* @__PURE__ */ r(
|
|
1221
1221
|
"span",
|
|
1222
1222
|
{
|
|
@@ -1230,10 +1230,10 @@ const di = ({
|
|
|
1230
1230
|
(m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), c());
|
|
1231
1231
|
},
|
|
1232
1232
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1233
|
-
children: /* @__PURE__ */ r(
|
|
1233
|
+
children: /* @__PURE__ */ r(Cn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
/* @__PURE__ */ r(
|
|
1236
|
+
/* @__PURE__ */ r(kn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
1237
1237
|
] })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
@@ -1246,7 +1246,7 @@ const di = ({
|
|
|
1246
1246
|
"data-position": e,
|
|
1247
1247
|
role: "region",
|
|
1248
1248
|
"aria-label": `${n} widget`,
|
|
1249
|
-
children: /* @__PURE__ */
|
|
1249
|
+
children: /* @__PURE__ */ S("div", { className: "ll-minimized__surface", children: [
|
|
1250
1250
|
i ? (
|
|
1251
1251
|
// eslint-disable-next-line @next/next/no-img-element
|
|
1252
1252
|
/* @__PURE__ */ r(
|
|
@@ -1258,11 +1258,11 @@ const di = ({
|
|
|
1258
1258
|
}
|
|
1259
1259
|
)
|
|
1260
1260
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1261
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ S("div", { className: "ll-minimized__meta", children: [
|
|
1262
1262
|
/* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
|
|
1263
1263
|
/* @__PURE__ */ r("span", { className: "ll-minimized__state", children: l === "speaking" ? "Speaking" : l === "thinking" ? "Thinking" : "Listening" })
|
|
1264
1264
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ S("div", { className: "ll-minimized__controls", children: [
|
|
1266
1266
|
/* @__PURE__ */ r(
|
|
1267
1267
|
"button",
|
|
1268
1268
|
{
|
|
@@ -1270,7 +1270,7 @@ const di = ({
|
|
|
1270
1270
|
className: "ll-minimized__btn",
|
|
1271
1271
|
onClick: c,
|
|
1272
1272
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1273
|
-
children: /* @__PURE__ */ r(
|
|
1273
|
+
children: /* @__PURE__ */ r(Cn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ r(
|
|
@@ -1280,7 +1280,7 @@ const di = ({
|
|
|
1280
1280
|
className: "ll-minimized__btn",
|
|
1281
1281
|
onClick: a,
|
|
1282
1282
|
"aria-label": `Expand ${n} widget`,
|
|
1283
|
-
children: /* @__PURE__ */ r(
|
|
1283
|
+
children: /* @__PURE__ */ r(kn, { className: "ll-minimized__icon" })
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ r(
|
|
@@ -1303,8 +1303,8 @@ const di = ({
|
|
|
1303
1303
|
className: i,
|
|
1304
1304
|
style: l
|
|
1305
1305
|
}) => {
|
|
1306
|
-
const [o, s] = M(!1), a =
|
|
1307
|
-
if (
|
|
1306
|
+
const [o, s] = M(!1), a = T(e);
|
|
1307
|
+
if (I(() => {
|
|
1308
1308
|
a.current !== e && (a.current = e, s(!1));
|
|
1309
1309
|
}, [e]), !e) return null;
|
|
1310
1310
|
const c = {
|
|
@@ -1340,7 +1340,7 @@ function gi({
|
|
|
1340
1340
|
className: t,
|
|
1341
1341
|
fill: n = mi
|
|
1342
1342
|
}) {
|
|
1343
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ S(
|
|
1344
1344
|
"svg",
|
|
1345
1345
|
{
|
|
1346
1346
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1376,14 +1376,14 @@ function gi({
|
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const yi = 8,
|
|
1379
|
+
const yi = 8, Nn = 8, vi = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
1382
|
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
|
-
const l =
|
|
1386
|
-
return
|
|
1385
|
+
const l = T(null), [o, s] = M(null);
|
|
1386
|
+
return Un(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
1388
|
s(null);
|
|
1389
1389
|
return;
|
|
@@ -1394,13 +1394,13 @@ const yi = 8, En = 8, vi = ({
|
|
|
1394
1394
|
const u = a.getBoundingClientRect(), m = {
|
|
1395
1395
|
top: u.top - yi,
|
|
1396
1396
|
left: u.left + u.width / 2
|
|
1397
|
-
}, p =
|
|
1397
|
+
}, p = Nn + 90, h = window.innerWidth - Nn - 90;
|
|
1398
1398
|
m.left < p && (m.left = p), m.left > h && (m.left = h), s(m);
|
|
1399
1399
|
};
|
|
1400
1400
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1401
1401
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1402
1402
|
};
|
|
1403
|
-
}, [e, n]),
|
|
1403
|
+
}, [e, n]), I(() => {
|
|
1404
1404
|
if (!e) return;
|
|
1405
1405
|
const a = (u) => {
|
|
1406
1406
|
const m = u.target, p = l.current, h = n.current;
|
|
@@ -1411,7 +1411,7 @@ const yi = 8, En = 8, vi = ({
|
|
|
1411
1411
|
return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
|
|
1412
1412
|
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
|
|
1413
1413
|
};
|
|
1414
|
-
}, [e, t, n]), !e || o === null || typeof document > "u" ? null :
|
|
1414
|
+
}, [e, t, n]), !e || o === null || typeof document > "u" ? null : en(
|
|
1415
1415
|
/* @__PURE__ */ r(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
@@ -1447,9 +1447,9 @@ const yi = 8, En = 8, vi = ({
|
|
|
1447
1447
|
onToggleTyping: h,
|
|
1448
1448
|
onDisconnect: D
|
|
1449
1449
|
}) => {
|
|
1450
|
-
const [
|
|
1451
|
-
return /* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1450
|
+
const [_, k] = M(!1), g = T(null);
|
|
1451
|
+
return /* @__PURE__ */ S(We, { children: [
|
|
1452
|
+
/* @__PURE__ */ S(
|
|
1453
1453
|
"div",
|
|
1454
1454
|
{
|
|
1455
1455
|
className: "ll-toolbar ll-toolbar--compact",
|
|
@@ -1463,19 +1463,19 @@ const yi = 8, En = 8, vi = ({
|
|
|
1463
1463
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1464
1464
|
onClick: t,
|
|
1465
1465
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1466
|
-
children: /* @__PURE__ */ r(
|
|
1466
|
+
children: /* @__PURE__ */ r(Jn, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
1469
|
/* @__PURE__ */ r(
|
|
1470
1470
|
"button",
|
|
1471
1471
|
{
|
|
1472
|
-
ref:
|
|
1472
|
+
ref: g,
|
|
1473
1473
|
type: "button",
|
|
1474
|
-
className: `ll-tool ${
|
|
1475
|
-
onClick: () =>
|
|
1474
|
+
className: `ll-tool ${_ ? "is-on" : ""}`,
|
|
1475
|
+
onClick: () => k((w) => !w),
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
|
-
"aria-expanded":
|
|
1478
|
+
"aria-expanded": _,
|
|
1479
1479
|
children: /* @__PURE__ */ r(wi, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
@@ -1486,68 +1486,68 @@ const yi = 8, En = 8, vi = ({
|
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
1487
|
onClick: D,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(Qn, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ S(
|
|
1496
1496
|
vi,
|
|
1497
1497
|
{
|
|
1498
|
-
open:
|
|
1499
|
-
onClose: () =>
|
|
1500
|
-
anchorRef:
|
|
1498
|
+
open: _,
|
|
1499
|
+
onClose: () => k(!1),
|
|
1500
|
+
anchorRef: g,
|
|
1501
1501
|
children: [
|
|
1502
|
-
l && /* @__PURE__ */
|
|
1502
|
+
l && /* @__PURE__ */ S(
|
|
1503
1503
|
"button",
|
|
1504
1504
|
{
|
|
1505
1505
|
type: "button",
|
|
1506
1506
|
className: `ll-overflow-popover__item ${n ? "is-on" : ""}`,
|
|
1507
1507
|
onClick: () => {
|
|
1508
|
-
i(),
|
|
1508
|
+
i(), k(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ r(
|
|
1511
|
+
/* @__PURE__ */ r(Kn, {}),
|
|
1512
1512
|
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
1515
1515
|
),
|
|
1516
|
-
a && /* @__PURE__ */
|
|
1516
|
+
a && /* @__PURE__ */ S(
|
|
1517
1517
|
"button",
|
|
1518
1518
|
{
|
|
1519
1519
|
type: "button",
|
|
1520
1520
|
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1521
1521
|
onClick: () => {
|
|
1522
|
-
s(),
|
|
1522
|
+
s(), k(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */ r(
|
|
1525
|
+
/* @__PURE__ */ r(Xn, {}),
|
|
1526
1526
|
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
1530
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ S(
|
|
1531
1531
|
"button",
|
|
1532
1532
|
{
|
|
1533
1533
|
type: "button",
|
|
1534
1534
|
className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
|
|
1535
1535
|
onClick: () => {
|
|
1536
|
-
u(),
|
|
1536
|
+
u(), k(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ r(
|
|
1539
|
+
/* @__PURE__ */ r(Zn, { muted: c }),
|
|
1540
1540
|
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
m && /* @__PURE__ */
|
|
1544
|
+
m && /* @__PURE__ */ S(
|
|
1545
1545
|
"button",
|
|
1546
1546
|
{
|
|
1547
1547
|
type: "button",
|
|
1548
1548
|
className: `ll-overflow-popover__item ${p ? "is-on" : ""}`,
|
|
1549
1549
|
onClick: () => {
|
|
1550
|
-
h(),
|
|
1550
|
+
h(), k(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
1553
|
/* @__PURE__ */ r(_i, {}),
|
|
@@ -1555,7 +1555,7 @@ const yi = 8, En = 8, vi = ({
|
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
1557
1557
|
),
|
|
1558
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ S(
|
|
1559
1559
|
"button",
|
|
1560
1560
|
{
|
|
1561
1561
|
type: "button",
|
|
@@ -1574,7 +1574,7 @@ const yi = 8, En = 8, vi = ({
|
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
1576
|
function wi() {
|
|
1577
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ S(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
1580
1580
|
width: "16",
|
|
@@ -1622,19 +1622,19 @@ const xi = ({
|
|
|
1622
1622
|
onToggleTeamSwitcher: p,
|
|
1623
1623
|
onSelectTeamMember: h,
|
|
1624
1624
|
languageMenuOpen: D,
|
|
1625
|
-
onToggleLanguageMenu:
|
|
1626
|
-
connectionState:
|
|
1627
|
-
agentState:
|
|
1625
|
+
onToggleLanguageMenu: _,
|
|
1626
|
+
connectionState: k,
|
|
1627
|
+
agentState: g,
|
|
1628
1628
|
transcript: w,
|
|
1629
|
-
canResume:
|
|
1630
|
-
needsUserGesture:
|
|
1629
|
+
canResume: R,
|
|
1630
|
+
needsUserGesture: E,
|
|
1631
1631
|
error: v,
|
|
1632
1632
|
isMuted: O,
|
|
1633
|
-
micError:
|
|
1633
|
+
micError: y,
|
|
1634
1634
|
micDevices: z,
|
|
1635
1635
|
activeMicId: B,
|
|
1636
1636
|
isCameraEnabled: K,
|
|
1637
|
-
cameraPreviewEl:
|
|
1637
|
+
cameraPreviewEl: le,
|
|
1638
1638
|
cameraDevices: H,
|
|
1639
1639
|
activeCameraId: G,
|
|
1640
1640
|
isScreenShareEnabled: f,
|
|
@@ -1651,100 +1651,106 @@ const xi = ({
|
|
|
1651
1651
|
transformingLabel: Q,
|
|
1652
1652
|
avatarVideoContainerRef: _e,
|
|
1653
1653
|
agentVideoEl: ne,
|
|
1654
|
-
onConnect:
|
|
1655
|
-
onDisconnect:
|
|
1656
|
-
onRetry:
|
|
1657
|
-
onResumeAudio:
|
|
1658
|
-
onToggleMute:
|
|
1659
|
-
onSwitchMicDevice:
|
|
1654
|
+
onConnect: ot,
|
|
1655
|
+
onDisconnect: lt,
|
|
1656
|
+
onRetry: vt,
|
|
1657
|
+
onResumeAudio: bt,
|
|
1658
|
+
onToggleMute: at,
|
|
1659
|
+
onSwitchMicDevice: wt,
|
|
1660
1660
|
onToggleCamera: qe,
|
|
1661
1661
|
onSwitchCameraDevice: Ue,
|
|
1662
|
-
onToggleScreenShare:
|
|
1663
|
-
onToggleSpeaker:
|
|
1664
|
-
onSendMessage:
|
|
1665
|
-
onMinimize:
|
|
1666
|
-
onClose:
|
|
1662
|
+
onToggleScreenShare: De,
|
|
1663
|
+
onToggleSpeaker: Pe,
|
|
1664
|
+
onSendMessage: ze,
|
|
1665
|
+
onMinimize: $e,
|
|
1666
|
+
onClose: He,
|
|
1667
1667
|
onClearMicError: je,
|
|
1668
|
-
dragHandleProps:
|
|
1668
|
+
dragHandleProps: Oe,
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
|
-
var
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1671
|
+
var St;
|
|
1672
|
+
const Fe = ((a == null ? void 0 : a.length) ?? 0) > 1, Ve = k === "connecting" || k === "connected", xe = k === "connected", _t = k === "idle" || k === "disconnected" || k === "error", [st, Me] = M(!1);
|
|
1673
|
+
I(() => {
|
|
1674
1674
|
if (!ne) {
|
|
1675
|
-
|
|
1675
|
+
Me(!1);
|
|
1676
1676
|
return;
|
|
1677
1677
|
}
|
|
1678
1678
|
if (!ne.paused && ne.readyState >= 2) {
|
|
1679
|
-
|
|
1679
|
+
Me(!0);
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
|
-
|
|
1683
|
-
const
|
|
1684
|
-
return ne.addEventListener("playing",
|
|
1685
|
-
ne.removeEventListener("playing",
|
|
1682
|
+
Me(!1);
|
|
1683
|
+
const x = () => Me(!0);
|
|
1684
|
+
return ne.addEventListener("playing", x), ne.addEventListener("loadeddata", x), () => {
|
|
1685
|
+
ne.removeEventListener("playing", x), ne.removeEventListener("loadeddata", x);
|
|
1686
1686
|
};
|
|
1687
1687
|
}, [ne]);
|
|
1688
|
-
const [
|
|
1689
|
-
|
|
1688
|
+
const [zt, xt] = M(!1);
|
|
1689
|
+
I(() => {
|
|
1690
|
+
g === "speaking" && xt(!0);
|
|
1691
|
+
}, [g]), I(() => {
|
|
1692
|
+
(k === "disconnected" || k === "idle") && xt(!1);
|
|
1693
|
+
}, [k]);
|
|
1694
|
+
const Ae = zt && st, [de, ct] = M(!1);
|
|
1695
|
+
I(() => {
|
|
1690
1696
|
if (!xe) {
|
|
1691
|
-
|
|
1697
|
+
ct(!1);
|
|
1692
1698
|
return;
|
|
1693
1699
|
}
|
|
1694
|
-
if (
|
|
1695
|
-
const
|
|
1696
|
-
return () => clearTimeout(
|
|
1697
|
-
}, [xe,
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1702
|
-
}, [
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1700
|
+
if (Ae) return;
|
|
1701
|
+
const x = setTimeout(() => ct(!0), 12e3);
|
|
1702
|
+
return () => clearTimeout(x);
|
|
1703
|
+
}, [xe, Ae]);
|
|
1704
|
+
const fe = k === "connecting" || xe && !Ae && !de, ge = T(null), Lt = T(null);
|
|
1705
|
+
I(() => {
|
|
1706
|
+
const x = ge.current;
|
|
1707
|
+
x && (x.innerHTML = "", le && (le.style.width = "100%", le.style.height = "100%", le.style.objectFit = "cover", le.style.transform = "scaleX(-1)", x.appendChild(le)));
|
|
1708
|
+
}, [le]), I(() => {
|
|
1709
|
+
const x = Lt.current;
|
|
1710
|
+
x && (x.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", x.appendChild(A)));
|
|
1705
1711
|
}, [A]);
|
|
1706
|
-
const [
|
|
1707
|
-
|
|
1708
|
-
if (!
|
|
1709
|
-
const
|
|
1710
|
-
pe(!1), Ge(!1), D &&
|
|
1712
|
+
const [Ye, pe] = M(!1), [ye, Ge] = M(!1), Ct = T(null), kt = T(null);
|
|
1713
|
+
I(() => {
|
|
1714
|
+
if (!Ye && !ye && !D && !m) return;
|
|
1715
|
+
const x = () => {
|
|
1716
|
+
pe(!1), Ge(!1), D && _(), m && p();
|
|
1711
1717
|
};
|
|
1712
|
-
return document.addEventListener("click",
|
|
1718
|
+
return document.addEventListener("click", x), () => document.removeEventListener("click", x);
|
|
1713
1719
|
}, [
|
|
1714
|
-
le,
|
|
1715
1720
|
Ye,
|
|
1721
|
+
ye,
|
|
1716
1722
|
D,
|
|
1717
1723
|
m,
|
|
1718
|
-
|
|
1724
|
+
_,
|
|
1719
1725
|
p
|
|
1720
1726
|
]);
|
|
1721
|
-
const [
|
|
1722
|
-
(
|
|
1723
|
-
|
|
1724
|
-
const re =
|
|
1725
|
-
re && (
|
|
1727
|
+
const [$t, tn] = M(!1), Ie = C(() => tn((x) => !x), []), [Le, Ce] = M(""), Be = C(
|
|
1728
|
+
(x) => {
|
|
1729
|
+
x.preventDefault();
|
|
1730
|
+
const re = Le.trim();
|
|
1731
|
+
re && (ze(re), Ce(""));
|
|
1726
1732
|
},
|
|
1727
|
-
[
|
|
1728
|
-
),
|
|
1729
|
-
let
|
|
1730
|
-
for (let
|
|
1731
|
-
const re = w[
|
|
1732
|
-
if (!
|
|
1733
|
+
[Le, ze]
|
|
1734
|
+
), Xe = s.productName || "Live Layer", Ht = !s.productName;
|
|
1735
|
+
let ke = null, Se = null;
|
|
1736
|
+
for (let x = w.length - 1; x >= 0; x--) {
|
|
1737
|
+
const re = w[x];
|
|
1738
|
+
if (!ke && re.role === "agent" ? ke = re : !Se && re.role === "user" && (Se = re), ke && Se) break;
|
|
1733
1739
|
}
|
|
1734
|
-
const
|
|
1740
|
+
const ut = xe ? (ke == null ? void 0 : ke.text) || null : o || null, Ke = xe && (Se == null ? void 0 : Se.text) || null, dt = [
|
|
1735
1741
|
"ll-expanded",
|
|
1736
1742
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1737
1743
|
].join(" ");
|
|
1738
|
-
return /* @__PURE__ */
|
|
1744
|
+
return /* @__PURE__ */ S(
|
|
1739
1745
|
"div",
|
|
1740
1746
|
{
|
|
1741
|
-
className:
|
|
1747
|
+
className: dt,
|
|
1742
1748
|
"data-position": e,
|
|
1743
1749
|
"data-state": xe ? "connected" : Ve ? "connecting" : "idle",
|
|
1744
1750
|
role: "dialog",
|
|
1745
1751
|
"aria-label": `${n} widget`,
|
|
1746
1752
|
children: [
|
|
1747
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__bg", children: [
|
|
1748
1754
|
i ? /* @__PURE__ */ r(
|
|
1749
1755
|
hi,
|
|
1750
1756
|
{
|
|
@@ -1752,7 +1758,7 @@ const xi = ({
|
|
|
1752
1758
|
alt: n,
|
|
1753
1759
|
className: "ll-expanded__bg-img"
|
|
1754
1760
|
}
|
|
1755
|
-
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1761
|
+
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((St = n == null ? void 0 : n.charAt(0)) == null ? void 0 : St.toUpperCase()) || "A" }) }),
|
|
1756
1762
|
l && !xe && /* @__PURE__ */ r(
|
|
1757
1763
|
"video",
|
|
1758
1764
|
{
|
|
@@ -1766,23 +1772,23 @@ const xi = ({
|
|
|
1766
1772
|
)
|
|
1767
1773
|
] }),
|
|
1768
1774
|
/* @__PURE__ */ r("div", { ref: _e, className: "ll-expanded__video" }),
|
|
1769
|
-
|
|
1775
|
+
fe && /* @__PURE__ */ S("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1770
1776
|
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1771
1777
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
|
|
1772
1778
|
] }),
|
|
1773
|
-
|
|
1779
|
+
E && xe && /* @__PURE__ */ S(
|
|
1774
1780
|
"button",
|
|
1775
1781
|
{
|
|
1776
1782
|
type: "button",
|
|
1777
1783
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1778
|
-
onClick:
|
|
1784
|
+
onClick: bt,
|
|
1779
1785
|
children: [
|
|
1780
1786
|
/* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1781
1787
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1782
1788
|
]
|
|
1783
1789
|
}
|
|
1784
1790
|
),
|
|
1785
|
-
me && /* @__PURE__ */
|
|
1791
|
+
me && /* @__PURE__ */ S(
|
|
1786
1792
|
"div",
|
|
1787
1793
|
{
|
|
1788
1794
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
@@ -1795,66 +1801,66 @@ const xi = ({
|
|
|
1795
1801
|
]
|
|
1796
1802
|
}
|
|
1797
1803
|
),
|
|
1798
|
-
Ve ? /* @__PURE__ */
|
|
1799
|
-
!U && /* @__PURE__ */
|
|
1800
|
-
!oe && /* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1802
|
-
/* @__PURE__ */
|
|
1804
|
+
Ve ? /* @__PURE__ */ S(We, { children: [
|
|
1805
|
+
!U && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar", ...Oe, children: [
|
|
1806
|
+
!oe && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar-left", children: [
|
|
1807
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1808
|
+
/* @__PURE__ */ S(
|
|
1803
1809
|
"button",
|
|
1804
1810
|
{
|
|
1805
1811
|
type: "button",
|
|
1806
1812
|
className: "ll-hpill",
|
|
1807
|
-
onClick: (
|
|
1808
|
-
|
|
1813
|
+
onClick: (x) => {
|
|
1814
|
+
Fe && (x.stopPropagation(), p());
|
|
1809
1815
|
},
|
|
1810
|
-
"aria-haspopup":
|
|
1811
|
-
"aria-expanded":
|
|
1816
|
+
"aria-haspopup": Fe ? "listbox" : void 0,
|
|
1817
|
+
"aria-expanded": Fe ? m : void 0,
|
|
1812
1818
|
children: [
|
|
1813
1819
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
|
|
1814
|
-
|
|
1820
|
+
Fe && /* @__PURE__ */ r(Tt, {})
|
|
1815
1821
|
]
|
|
1816
1822
|
}
|
|
1817
1823
|
),
|
|
1818
|
-
|
|
1824
|
+
Fe && m && /* @__PURE__ */ r(
|
|
1819
1825
|
"div",
|
|
1820
1826
|
{
|
|
1821
1827
|
className: "ll-hmenu",
|
|
1822
|
-
onClick: (
|
|
1828
|
+
onClick: (x) => x.stopPropagation(),
|
|
1823
1829
|
role: "listbox",
|
|
1824
|
-
children: a == null ? void 0 : a.map((
|
|
1830
|
+
children: a == null ? void 0 : a.map((x) => /* @__PURE__ */ S(
|
|
1825
1831
|
"button",
|
|
1826
1832
|
{
|
|
1827
1833
|
type: "button",
|
|
1828
|
-
className: `ll-hmenu__item ${
|
|
1829
|
-
onClick: () => h(
|
|
1834
|
+
className: `ll-hmenu__item ${x.id === c ? "is-active" : ""}`,
|
|
1835
|
+
onClick: () => h(x.id),
|
|
1830
1836
|
role: "option",
|
|
1831
|
-
"aria-selected":
|
|
1837
|
+
"aria-selected": x.id === c,
|
|
1832
1838
|
children: [
|
|
1833
|
-
|
|
1839
|
+
x.avatarImageUrl && /* @__PURE__ */ r(
|
|
1834
1840
|
"img",
|
|
1835
1841
|
{
|
|
1836
|
-
src:
|
|
1842
|
+
src: x.avatarImageUrl,
|
|
1837
1843
|
alt: "",
|
|
1838
1844
|
className: "ll-hmenu__avatar"
|
|
1839
1845
|
}
|
|
1840
1846
|
),
|
|
1841
|
-
/* @__PURE__ */ r("span", { className: "ll-hmenu__name", children:
|
|
1842
|
-
|
|
1847
|
+
/* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: x.name }),
|
|
1848
|
+
x.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: x.role })
|
|
1843
1849
|
]
|
|
1844
1850
|
},
|
|
1845
|
-
|
|
1851
|
+
x.id
|
|
1846
1852
|
))
|
|
1847
1853
|
}
|
|
1848
1854
|
)
|
|
1849
1855
|
] }),
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1857
|
+
/* @__PURE__ */ S(
|
|
1852
1858
|
"button",
|
|
1853
1859
|
{
|
|
1854
1860
|
type: "button",
|
|
1855
1861
|
className: "ll-hpill ll-hpill--compact",
|
|
1856
|
-
onClick: (
|
|
1857
|
-
|
|
1862
|
+
onClick: (x) => {
|
|
1863
|
+
x.stopPropagation(), _();
|
|
1858
1864
|
},
|
|
1859
1865
|
"aria-haspopup": "listbox",
|
|
1860
1866
|
"aria-expanded": D,
|
|
@@ -1862,7 +1868,7 @@ const xi = ({
|
|
|
1862
1868
|
title: "Language: English",
|
|
1863
1869
|
children: [
|
|
1864
1870
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1865
|
-
/* @__PURE__ */ r(
|
|
1871
|
+
/* @__PURE__ */ r(Tt, {})
|
|
1866
1872
|
]
|
|
1867
1873
|
}
|
|
1868
1874
|
),
|
|
@@ -1870,7 +1876,7 @@ const xi = ({
|
|
|
1870
1876
|
"div",
|
|
1871
1877
|
{
|
|
1872
1878
|
className: "ll-hmenu",
|
|
1873
|
-
onClick: (
|
|
1879
|
+
onClick: (x) => x.stopPropagation(),
|
|
1874
1880
|
role: "listbox",
|
|
1875
1881
|
children: /* @__PURE__ */ r(
|
|
1876
1882
|
"button",
|
|
@@ -1888,21 +1894,21 @@ const xi = ({
|
|
|
1888
1894
|
/* @__PURE__ */ r(
|
|
1889
1895
|
"span",
|
|
1890
1896
|
{
|
|
1891
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1892
|
-
children:
|
|
1897
|
+
className: `ll-expanded__state ll-expanded__state--${g}`,
|
|
1898
|
+
children: g
|
|
1893
1899
|
}
|
|
1894
1900
|
)
|
|
1895
1901
|
] }),
|
|
1896
|
-
/* @__PURE__ */
|
|
1902
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__header-actions", children: [
|
|
1897
1903
|
V !== !1 && /* @__PURE__ */ r(
|
|
1898
1904
|
"button",
|
|
1899
1905
|
{
|
|
1900
1906
|
type: "button",
|
|
1901
1907
|
className: "ll-hbtn",
|
|
1902
|
-
onClick:
|
|
1908
|
+
onClick: $e,
|
|
1903
1909
|
"aria-label": "Minimize widget",
|
|
1904
1910
|
title: "Minimize",
|
|
1905
|
-
children: /* @__PURE__ */ r(
|
|
1911
|
+
children: /* @__PURE__ */ r(In, {})
|
|
1906
1912
|
}
|
|
1907
1913
|
),
|
|
1908
1914
|
te !== !1 && /* @__PURE__ */ r(
|
|
@@ -1910,17 +1916,17 @@ const xi = ({
|
|
|
1910
1916
|
{
|
|
1911
1917
|
type: "button",
|
|
1912
1918
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1913
|
-
onClick:
|
|
1919
|
+
onClick: He,
|
|
1914
1920
|
"aria-label": "End call",
|
|
1915
1921
|
title: "End call",
|
|
1916
|
-
children: /* @__PURE__ */ r(
|
|
1922
|
+
children: /* @__PURE__ */ r(Mn, {})
|
|
1917
1923
|
}
|
|
1918
1924
|
)
|
|
1919
1925
|
] })
|
|
1920
1926
|
] }),
|
|
1921
|
-
U && /* @__PURE__ */
|
|
1927
|
+
U && /* @__PURE__ */ S("div", { className: "ll-compact-status", "data-state": g, children: [
|
|
1922
1928
|
/* @__PURE__ */ r("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1923
|
-
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children:
|
|
1929
|
+
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: g })
|
|
1924
1930
|
] })
|
|
1925
1931
|
] }) : (
|
|
1926
1932
|
// Idle-state header. In compactControls mode (mobile WIDGET +
|
|
@@ -1931,8 +1937,8 @@ const xi = ({
|
|
|
1931
1937
|
// can always dismiss; making the whole header disappear (the
|
|
1932
1938
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1933
1939
|
// the page itself.
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
!U && (
|
|
1940
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__header ll-expanded__header--idle", ...Oe, children: [
|
|
1941
|
+
!U && (Ht ? /* @__PURE__ */ S(
|
|
1936
1942
|
"a",
|
|
1937
1943
|
{
|
|
1938
1944
|
className: "ll-expanded__brand ll-expanded__brand--link",
|
|
@@ -1943,19 +1949,19 @@ const xi = ({
|
|
|
1943
1949
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1944
1950
|
children: [
|
|
1945
1951
|
/* @__PURE__ */ r(gi, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1946
|
-
/* @__PURE__ */ r("span", { children:
|
|
1952
|
+
/* @__PURE__ */ r("span", { children: Xe })
|
|
1947
1953
|
]
|
|
1948
1954
|
}
|
|
1949
|
-
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children:
|
|
1950
|
-
/* @__PURE__ */
|
|
1955
|
+
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: Xe })),
|
|
1956
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__header-actions", children: [
|
|
1951
1957
|
!U && V !== !1 && /* @__PURE__ */ r(
|
|
1952
1958
|
"button",
|
|
1953
1959
|
{
|
|
1954
1960
|
type: "button",
|
|
1955
1961
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1956
|
-
onClick:
|
|
1962
|
+
onClick: $e,
|
|
1957
1963
|
"aria-label": "Minimize widget",
|
|
1958
|
-
children: /* @__PURE__ */ r(
|
|
1964
|
+
children: /* @__PURE__ */ r(In, {})
|
|
1959
1965
|
}
|
|
1960
1966
|
),
|
|
1961
1967
|
te !== !1 && /* @__PURE__ */ r(
|
|
@@ -1963,46 +1969,46 @@ const xi = ({
|
|
|
1963
1969
|
{
|
|
1964
1970
|
type: "button",
|
|
1965
1971
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1966
|
-
onClick:
|
|
1972
|
+
onClick: He,
|
|
1967
1973
|
"aria-label": "Close widget",
|
|
1968
|
-
children: /* @__PURE__ */ r(
|
|
1974
|
+
children: /* @__PURE__ */ r(Mn, {})
|
|
1969
1975
|
}
|
|
1970
1976
|
)
|
|
1971
1977
|
] })
|
|
1972
1978
|
] })
|
|
1973
1979
|
),
|
|
1974
|
-
|
|
1975
|
-
const
|
|
1976
|
-
return /* @__PURE__ */
|
|
1977
|
-
!v && /* @__PURE__ */
|
|
1980
|
+
_t && /* @__PURE__ */ (() => {
|
|
1981
|
+
const x = R ? "Resume session" : k === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1982
|
+
return /* @__PURE__ */ S(We, { children: [
|
|
1983
|
+
!v && /* @__PURE__ */ S(
|
|
1978
1984
|
"button",
|
|
1979
1985
|
{
|
|
1980
1986
|
type: "button",
|
|
1981
1987
|
className: "ll-expanded__play",
|
|
1982
|
-
onClick:
|
|
1983
|
-
"aria-label":
|
|
1988
|
+
onClick: ot,
|
|
1989
|
+
"aria-label": x,
|
|
1984
1990
|
children: [
|
|
1985
1991
|
/* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
1986
|
-
U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children:
|
|
1992
|
+
U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: x })
|
|
1987
1993
|
]
|
|
1988
1994
|
}
|
|
1989
1995
|
),
|
|
1990
|
-
!U && /* @__PURE__ */
|
|
1996
|
+
!U && /* @__PURE__ */ S("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1991
1997
|
o && /* @__PURE__ */ r("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: o }) }),
|
|
1992
1998
|
/* @__PURE__ */ r(
|
|
1993
1999
|
"button",
|
|
1994
2000
|
{
|
|
1995
2001
|
type: "button",
|
|
1996
2002
|
className: "ll-expanded__cta",
|
|
1997
|
-
onClick:
|
|
1998
|
-
"aria-label":
|
|
1999
|
-
children:
|
|
2003
|
+
onClick: ot,
|
|
2004
|
+
"aria-label": x,
|
|
2005
|
+
children: x
|
|
2000
2006
|
}
|
|
2001
2007
|
)
|
|
2002
2008
|
] })
|
|
2003
2009
|
] });
|
|
2004
2010
|
})(),
|
|
2005
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ S(
|
|
2006
2012
|
"div",
|
|
2007
2013
|
{
|
|
2008
2014
|
className: `ll-expanded__pip ${Ve && (K || f) ? "is-visible" : ""}`,
|
|
@@ -2010,50 +2016,50 @@ const xi = ({
|
|
|
2010
2016
|
/* @__PURE__ */ r(
|
|
2011
2017
|
"div",
|
|
2012
2018
|
{
|
|
2013
|
-
ref:
|
|
2019
|
+
ref: Lt,
|
|
2014
2020
|
className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2015
2021
|
}
|
|
2016
2022
|
),
|
|
2017
2023
|
/* @__PURE__ */ r(
|
|
2018
2024
|
"div",
|
|
2019
2025
|
{
|
|
2020
|
-
ref:
|
|
2026
|
+
ref: ge,
|
|
2021
2027
|
className: !f && K ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2022
2028
|
}
|
|
2023
2029
|
)
|
|
2024
2030
|
]
|
|
2025
2031
|
}
|
|
2026
2032
|
),
|
|
2027
|
-
Ve ? /* @__PURE__ */
|
|
2028
|
-
!U &&
|
|
2033
|
+
Ve ? /* @__PURE__ */ S("div", { className: "ll-expanded__bottom", children: [
|
|
2034
|
+
!U && ut && /* @__PURE__ */ r(
|
|
2029
2035
|
"div",
|
|
2030
2036
|
{
|
|
2031
2037
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
2032
2038
|
"data-role": "agent",
|
|
2033
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2039
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: ut })
|
|
2034
2040
|
}
|
|
2035
2041
|
),
|
|
2036
|
-
!U &&
|
|
2042
|
+
!U && Ke && /* @__PURE__ */ r(
|
|
2037
2043
|
"div",
|
|
2038
2044
|
{
|
|
2039
2045
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
2040
2046
|
"data-role": "user",
|
|
2041
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2047
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Ke })
|
|
2042
2048
|
}
|
|
2043
2049
|
),
|
|
2044
|
-
!oe && !U && /* @__PURE__ */
|
|
2050
|
+
!oe && !U && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (x) => x.stopPropagation(), children: [
|
|
2045
2051
|
X && /* @__PURE__ */ r(
|
|
2046
2052
|
"button",
|
|
2047
2053
|
{
|
|
2048
2054
|
type: "button",
|
|
2049
2055
|
className: `ll-tool ${f ? "is-on" : ""}`,
|
|
2050
|
-
onClick:
|
|
2056
|
+
onClick: De,
|
|
2051
2057
|
"aria-label": f ? "Stop sharing screen" : "Share screen",
|
|
2052
2058
|
title: f ? "Stop sharing" : "Share screen",
|
|
2053
|
-
children: /* @__PURE__ */ r(
|
|
2059
|
+
children: /* @__PURE__ */ r(Xn, {})
|
|
2054
2060
|
}
|
|
2055
2061
|
),
|
|
2056
|
-
q && /* @__PURE__ */
|
|
2062
|
+
q && /* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
|
|
2057
2063
|
/* @__PURE__ */ r(
|
|
2058
2064
|
"button",
|
|
2059
2065
|
{
|
|
@@ -2062,73 +2068,73 @@ const xi = ({
|
|
|
2062
2068
|
onClick: qe,
|
|
2063
2069
|
"aria-label": K ? "Turn off camera" : "Turn on camera",
|
|
2064
2070
|
title: K ? "Stop camera" : "Start camera",
|
|
2065
|
-
children: /* @__PURE__ */ r(
|
|
2071
|
+
children: /* @__PURE__ */ r(Kn, {})
|
|
2066
2072
|
}
|
|
2067
2073
|
),
|
|
2068
2074
|
/* @__PURE__ */ r(
|
|
2069
2075
|
"button",
|
|
2070
2076
|
{
|
|
2071
|
-
ref:
|
|
2077
|
+
ref: kt,
|
|
2072
2078
|
type: "button",
|
|
2073
2079
|
className: `ll-tool ll-tool--right ${K ? "is-on" : ""}`,
|
|
2074
|
-
onClick: (
|
|
2075
|
-
|
|
2080
|
+
onClick: (x) => {
|
|
2081
|
+
x.stopPropagation(), Ge((re) => !re), pe(!1);
|
|
2076
2082
|
},
|
|
2077
2083
|
"aria-label": "Camera devices",
|
|
2078
2084
|
"aria-haspopup": "listbox",
|
|
2079
|
-
"aria-expanded":
|
|
2080
|
-
children: /* @__PURE__ */ r(
|
|
2085
|
+
"aria-expanded": ye,
|
|
2086
|
+
children: /* @__PURE__ */ r(Tt, {})
|
|
2081
2087
|
}
|
|
2082
2088
|
),
|
|
2083
|
-
|
|
2084
|
-
|
|
2089
|
+
ye && H.length > 0 && /* @__PURE__ */ r(
|
|
2090
|
+
Tn,
|
|
2085
2091
|
{
|
|
2086
2092
|
label: "Camera",
|
|
2087
2093
|
devices: H,
|
|
2088
2094
|
activeId: G,
|
|
2089
|
-
anchorRef:
|
|
2090
|
-
onPick: (
|
|
2091
|
-
Ge(!1), Ue(
|
|
2095
|
+
anchorRef: kt,
|
|
2096
|
+
onPick: (x) => {
|
|
2097
|
+
Ge(!1), Ue(x);
|
|
2092
2098
|
}
|
|
2093
2099
|
}
|
|
2094
2100
|
)
|
|
2095
2101
|
] }),
|
|
2096
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
|
|
2097
2103
|
/* @__PURE__ */ r(
|
|
2098
2104
|
"button",
|
|
2099
2105
|
{
|
|
2100
2106
|
type: "button",
|
|
2101
2107
|
className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
|
|
2102
|
-
onClick:
|
|
2108
|
+
onClick: at,
|
|
2103
2109
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2104
2110
|
title: O ? "Unmute" : "Mute",
|
|
2105
|
-
children: /* @__PURE__ */ r(
|
|
2111
|
+
children: /* @__PURE__ */ r(Jn, { muted: O })
|
|
2106
2112
|
}
|
|
2107
2113
|
),
|
|
2108
2114
|
/* @__PURE__ */ r(
|
|
2109
2115
|
"button",
|
|
2110
2116
|
{
|
|
2111
|
-
ref:
|
|
2117
|
+
ref: Ct,
|
|
2112
2118
|
type: "button",
|
|
2113
2119
|
className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
|
|
2114
|
-
onClick: (
|
|
2115
|
-
|
|
2120
|
+
onClick: (x) => {
|
|
2121
|
+
x.stopPropagation(), pe((re) => !re), Ge(!1);
|
|
2116
2122
|
},
|
|
2117
2123
|
"aria-label": "Microphone devices",
|
|
2118
2124
|
"aria-haspopup": "listbox",
|
|
2119
|
-
"aria-expanded":
|
|
2120
|
-
children: /* @__PURE__ */ r(
|
|
2125
|
+
"aria-expanded": Ye,
|
|
2126
|
+
children: /* @__PURE__ */ r(Tt, {})
|
|
2121
2127
|
}
|
|
2122
2128
|
),
|
|
2123
|
-
|
|
2124
|
-
|
|
2129
|
+
Ye && z.length > 0 && /* @__PURE__ */ r(
|
|
2130
|
+
Tn,
|
|
2125
2131
|
{
|
|
2126
2132
|
label: "Microphone",
|
|
2127
2133
|
devices: z,
|
|
2128
2134
|
activeId: B,
|
|
2129
|
-
anchorRef:
|
|
2130
|
-
onPick: (
|
|
2131
|
-
pe(!1),
|
|
2135
|
+
anchorRef: Ct,
|
|
2136
|
+
onPick: (x) => {
|
|
2137
|
+
pe(!1), wt(x);
|
|
2132
2138
|
}
|
|
2133
2139
|
}
|
|
2134
2140
|
)
|
|
@@ -2138,10 +2144,10 @@ const xi = ({
|
|
|
2138
2144
|
{
|
|
2139
2145
|
type: "button",
|
|
2140
2146
|
className: `ll-tool ${$ ? "is-muted" : ""}`,
|
|
2141
|
-
onClick:
|
|
2147
|
+
onClick: Pe,
|
|
2142
2148
|
"aria-label": $ ? "Unmute speaker" : "Mute speaker",
|
|
2143
2149
|
title: $ ? "Unmute speaker" : "Mute speaker",
|
|
2144
|
-
children: /* @__PURE__ */ r(
|
|
2150
|
+
children: /* @__PURE__ */ r(Zn, { muted: $ })
|
|
2145
2151
|
}
|
|
2146
2152
|
),
|
|
2147
2153
|
/* @__PURE__ */ r(
|
|
@@ -2149,10 +2155,10 @@ const xi = ({
|
|
|
2149
2155
|
{
|
|
2150
2156
|
type: "button",
|
|
2151
2157
|
className: "ll-tool ll-tool--danger",
|
|
2152
|
-
onClick:
|
|
2158
|
+
onClick: lt,
|
|
2153
2159
|
"aria-label": "End conversation",
|
|
2154
2160
|
title: "End conversation",
|
|
2155
|
-
children: /* @__PURE__ */ r(
|
|
2161
|
+
children: /* @__PURE__ */ r(Qn, {})
|
|
2156
2162
|
}
|
|
2157
2163
|
)
|
|
2158
2164
|
] }),
|
|
@@ -2160,34 +2166,34 @@ const xi = ({
|
|
|
2160
2166
|
bi,
|
|
2161
2167
|
{
|
|
2162
2168
|
isMuted: O,
|
|
2163
|
-
onToggleMute:
|
|
2169
|
+
onToggleMute: at,
|
|
2164
2170
|
isCameraEnabled: K,
|
|
2165
2171
|
onToggleCamera: qe,
|
|
2166
2172
|
allowCamera: q,
|
|
2167
2173
|
isScreenShareEnabled: f,
|
|
2168
|
-
onToggleScreenShare:
|
|
2174
|
+
onToggleScreenShare: De,
|
|
2169
2175
|
allowScreenShare: X,
|
|
2170
2176
|
isSpeakerMuted: $,
|
|
2171
|
-
onToggleSpeaker:
|
|
2177
|
+
onToggleSpeaker: Pe,
|
|
2172
2178
|
allowTyping: ee,
|
|
2173
|
-
isTypingOpen:
|
|
2174
|
-
onToggleTyping:
|
|
2175
|
-
onDisconnect:
|
|
2179
|
+
isTypingOpen: $t,
|
|
2180
|
+
onToggleTyping: Ie,
|
|
2181
|
+
onDisconnect: lt
|
|
2176
2182
|
}
|
|
2177
2183
|
),
|
|
2178
|
-
!oe && ee && (U ?
|
|
2184
|
+
!oe && ee && (U ? $t : !0) && /* @__PURE__ */ S("form", { className: "ll-message-input", onSubmit: Be, children: [
|
|
2179
2185
|
/* @__PURE__ */ r(
|
|
2180
2186
|
"input",
|
|
2181
2187
|
{
|
|
2182
2188
|
type: "text",
|
|
2183
2189
|
className: "ll-message-input__field",
|
|
2184
2190
|
placeholder: "Message...",
|
|
2185
|
-
value:
|
|
2186
|
-
onChange: (
|
|
2191
|
+
value: Le,
|
|
2192
|
+
onChange: (x) => Ce(x.target.value),
|
|
2187
2193
|
"aria-label": "Message the agent"
|
|
2188
2194
|
}
|
|
2189
2195
|
),
|
|
2190
|
-
|
|
2196
|
+
Le.trim() && /* @__PURE__ */ r(
|
|
2191
2197
|
"button",
|
|
2192
2198
|
{
|
|
2193
2199
|
type: "submit",
|
|
@@ -2199,9 +2205,9 @@ const xi = ({
|
|
|
2199
2205
|
] })
|
|
2200
2206
|
] }) : null,
|
|
2201
2207
|
(() => {
|
|
2202
|
-
if (
|
|
2203
|
-
return /* @__PURE__ */
|
|
2204
|
-
/* @__PURE__ */ r("span", { children:
|
|
2208
|
+
if (y && k !== "error")
|
|
2209
|
+
return /* @__PURE__ */ S("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
2210
|
+
/* @__PURE__ */ r("span", { children: y }),
|
|
2205
2211
|
/* @__PURE__ */ r(
|
|
2206
2212
|
"button",
|
|
2207
2213
|
{
|
|
@@ -2213,16 +2219,16 @@ const xi = ({
|
|
|
2213
2219
|
}
|
|
2214
2220
|
)
|
|
2215
2221
|
] });
|
|
2216
|
-
if (!v ||
|
|
2217
|
-
let
|
|
2218
|
-
return v === "MIC_PERMISSION_DENIED" ?
|
|
2219
|
-
/* @__PURE__ */ r("span", { children:
|
|
2222
|
+
if (!v || k !== "error") return null;
|
|
2223
|
+
let x = "Failed to connect", re = "Try again";
|
|
2224
|
+
return v === "MIC_PERMISSION_DENIED" ? x = "Microphone blocked. Allow access to talk." : v === "MIC_NOT_FOUND" ? x = "No microphone found. Plug one in + retry." : v === "MIC_UNAVAILABLE" ? x = "Mic unavailable. Check other apps using it." : v === "AGENT_TIMEOUT" ? x = "Agent didn't pick up. Try again." : v === "CONNECT_FAILED" ? x = "Connection failed. Check your network." : v.length < 80 && (x = v), /* @__PURE__ */ S("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
2225
|
+
/* @__PURE__ */ r("span", { children: x }),
|
|
2220
2226
|
/* @__PURE__ */ r(
|
|
2221
2227
|
"button",
|
|
2222
2228
|
{
|
|
2223
2229
|
type: "button",
|
|
2224
2230
|
className: "ll-expanded__banner-retry",
|
|
2225
|
-
onClick:
|
|
2231
|
+
onClick: vt,
|
|
2226
2232
|
children: re
|
|
2227
2233
|
}
|
|
2228
2234
|
)
|
|
@@ -2234,7 +2240,7 @@ const xi = ({
|
|
|
2234
2240
|
className: "ll-expanded__resize-grip",
|
|
2235
2241
|
...F,
|
|
2236
2242
|
"aria-hidden": !0,
|
|
2237
|
-
children: /* @__PURE__ */
|
|
2243
|
+
children: /* @__PURE__ */ S("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
|
|
2238
2244
|
/* @__PURE__ */ r("line", { x1: "11", y1: "4", x2: "4", y2: "11" }),
|
|
2239
2245
|
/* @__PURE__ */ r("line", { x1: "11", y1: "8", x2: "8", y2: "11" })
|
|
2240
2246
|
] })
|
|
@@ -2244,55 +2250,55 @@ const xi = ({
|
|
|
2244
2250
|
}
|
|
2245
2251
|
);
|
|
2246
2252
|
};
|
|
2247
|
-
function
|
|
2253
|
+
function Tt() {
|
|
2248
2254
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
|
|
2249
2255
|
}
|
|
2250
|
-
function
|
|
2251
|
-
return /* @__PURE__ */
|
|
2256
|
+
function Mn() {
|
|
2257
|
+
return /* @__PURE__ */ S("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
2252
2258
|
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2253
2259
|
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2254
2260
|
] });
|
|
2255
2261
|
}
|
|
2256
|
-
function
|
|
2262
|
+
function In() {
|
|
2257
2263
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
2258
2264
|
}
|
|
2259
|
-
function
|
|
2260
|
-
return /* @__PURE__ */
|
|
2265
|
+
function Xn() {
|
|
2266
|
+
return /* @__PURE__ */ S("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2261
2267
|
/* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
2262
2268
|
/* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2263
2269
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
2264
2270
|
] });
|
|
2265
2271
|
}
|
|
2266
|
-
function
|
|
2267
|
-
return /* @__PURE__ */
|
|
2272
|
+
function Kn() {
|
|
2273
|
+
return /* @__PURE__ */ S("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2268
2274
|
/* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2269
2275
|
/* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2270
2276
|
] });
|
|
2271
2277
|
}
|
|
2272
|
-
function
|
|
2273
|
-
return /* @__PURE__ */
|
|
2278
|
+
function Jn({ muted: e }) {
|
|
2279
|
+
return /* @__PURE__ */ S("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2274
2280
|
/* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2275
2281
|
/* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
2276
2282
|
/* @__PURE__ */ r("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
2277
2283
|
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2278
2284
|
] });
|
|
2279
2285
|
}
|
|
2280
|
-
function
|
|
2281
|
-
return /* @__PURE__ */
|
|
2286
|
+
function Zn({ muted: e }) {
|
|
2287
|
+
return /* @__PURE__ */ S("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2282
2288
|
/* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2283
|
-
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
2289
|
+
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(We, { children: [
|
|
2284
2290
|
/* @__PURE__ */ r("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
2285
2291
|
/* @__PURE__ */ r("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
2286
2292
|
] })
|
|
2287
2293
|
] });
|
|
2288
2294
|
}
|
|
2289
2295
|
function Li() {
|
|
2290
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ S("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2291
2297
|
/* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2292
2298
|
/* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
|
|
2293
2299
|
] });
|
|
2294
2300
|
}
|
|
2295
|
-
function
|
|
2301
|
+
function Qn() {
|
|
2296
2302
|
return /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ r(
|
|
2297
2303
|
"path",
|
|
2298
2304
|
{
|
|
@@ -2301,7 +2307,7 @@ function Jn() {
|
|
|
2301
2307
|
}
|
|
2302
2308
|
) });
|
|
2303
2309
|
}
|
|
2304
|
-
const
|
|
2310
|
+
const Tn = ({
|
|
2305
2311
|
label: e,
|
|
2306
2312
|
devices: t,
|
|
2307
2313
|
activeId: n,
|
|
@@ -2309,7 +2315,7 @@ const Mn = ({
|
|
|
2309
2315
|
anchorRef: l
|
|
2310
2316
|
}) => {
|
|
2311
2317
|
const [o, s] = M(null);
|
|
2312
|
-
return
|
|
2318
|
+
return Un(() => {
|
|
2313
2319
|
const a = () => {
|
|
2314
2320
|
const c = l.current;
|
|
2315
2321
|
if (!c) return;
|
|
@@ -2322,8 +2328,8 @@ const Mn = ({
|
|
|
2322
2328
|
return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
2323
2329
|
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
2324
2330
|
};
|
|
2325
|
-
}, [l]), o === null || typeof document > "u" ? null :
|
|
2326
|
-
/* @__PURE__ */
|
|
2331
|
+
}, [l]), o === null || typeof document > "u" ? null : en(
|
|
2332
|
+
/* @__PURE__ */ S(
|
|
2327
2333
|
"div",
|
|
2328
2334
|
{
|
|
2329
2335
|
className: "ll-device-menu ll-device-menu--floating",
|
|
@@ -2340,7 +2346,7 @@ const Mn = ({
|
|
|
2340
2346
|
/* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
|
|
2341
2347
|
t.map((a, c) => {
|
|
2342
2348
|
const u = n === a.deviceId;
|
|
2343
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ S(
|
|
2344
2350
|
"button",
|
|
2345
2351
|
{
|
|
2346
2352
|
type: "button",
|
|
@@ -2369,7 +2375,7 @@ const Mn = ({
|
|
|
2369
2375
|
"[data-ll-skip]",
|
|
2370
2376
|
".ll-widget"
|
|
2371
2377
|
];
|
|
2372
|
-
function
|
|
2378
|
+
function Pt(e) {
|
|
2373
2379
|
let t = e;
|
|
2374
2380
|
for (; t; ) {
|
|
2375
2381
|
for (const n of Ci)
|
|
@@ -2378,8 +2384,8 @@ function Tt(e) {
|
|
|
2378
2384
|
}
|
|
2379
2385
|
return !1;
|
|
2380
2386
|
}
|
|
2381
|
-
function
|
|
2382
|
-
if (
|
|
2387
|
+
function Jt(e) {
|
|
2388
|
+
if (Pt(e)) return !1;
|
|
2383
2389
|
if (e instanceof HTMLInputElement) {
|
|
2384
2390
|
if (e.type === "password") return !1;
|
|
2385
2391
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2387,13 +2393,13 @@ function Kt(e) {
|
|
|
2387
2393
|
}
|
|
2388
2394
|
return !0;
|
|
2389
2395
|
}
|
|
2390
|
-
const ki = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i,
|
|
2391
|
-
function
|
|
2392
|
-
const t =
|
|
2396
|
+
const ki = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, Rn = /\b(back|previous|prev|go\s*back)\b|←|‹/i, Si = /\b(submit|finish|done|complete|send)\b/i, yt = /* @__PURE__ */ new Map();
|
|
2397
|
+
function Dn(e) {
|
|
2398
|
+
const t = yt.get(e);
|
|
2393
2399
|
return t && t.isConnected ? t : null;
|
|
2394
2400
|
}
|
|
2395
|
-
function
|
|
2396
|
-
if (
|
|
2401
|
+
function tt(e) {
|
|
2402
|
+
if (Pt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
|
|
2397
2403
|
const t = typeof window < "u" && window.getComputedStyle ? window.getComputedStyle(e) : null;
|
|
2398
2404
|
return !!(t && (t.display === "none" || t.visibility === "hidden"));
|
|
2399
2405
|
}
|
|
@@ -2405,24 +2411,24 @@ function Ai(e) {
|
|
|
2405
2411
|
}
|
|
2406
2412
|
function Ni(e) {
|
|
2407
2413
|
return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
|
|
2408
|
-
(n) => !
|
|
2414
|
+
(n) => !tt(n) && !Ei(n)
|
|
2409
2415
|
);
|
|
2410
2416
|
}
|
|
2411
|
-
function
|
|
2412
|
-
|
|
2417
|
+
function er(e) {
|
|
2418
|
+
yt.clear();
|
|
2413
2419
|
const t = Ni(e);
|
|
2414
2420
|
let n, i, l;
|
|
2415
2421
|
for (const a of t) {
|
|
2416
2422
|
const c = Ai(a);
|
|
2417
2423
|
if (!c || c.length > 40) continue;
|
|
2418
2424
|
const u = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
|
|
2419
|
-
!n && ki.test(c) && !
|
|
2425
|
+
!n && ki.test(c) && !Rn.test(c) ? (n = { id: "ll-advance", label: c }, yt.set("ll-advance", a)) : !i && Rn.test(c) ? (i = { id: "ll-back", label: c }, yt.set("ll-back", a)) : !l && (Si.test(c) || u) && (l = { id: "ll-submit", label: c }, yt.set("ll-submit", a));
|
|
2420
2426
|
}
|
|
2421
2427
|
const o = zi(e);
|
|
2422
2428
|
return { kind: n || o.totalSteps ? "multi-step" : "single-page", advance: n, back: i, submit: l, ...o };
|
|
2423
2429
|
}
|
|
2424
2430
|
const Mi = 60;
|
|
2425
|
-
function
|
|
2431
|
+
function tr(e) {
|
|
2426
2432
|
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Mi);
|
|
2427
2433
|
}
|
|
2428
2434
|
function Ii(e) {
|
|
@@ -2433,7 +2439,7 @@ const Ti = /stepper|wizard|ant-steps|step-indicator/;
|
|
|
2433
2439
|
function Ri(e) {
|
|
2434
2440
|
return Ti.test(Ii(e));
|
|
2435
2441
|
}
|
|
2436
|
-
function
|
|
2442
|
+
function Pn(e) {
|
|
2437
2443
|
const t = e.getAttribute("aria-current");
|
|
2438
2444
|
return t === "step" || t === "true" ? !0 : Array.from(e.classList).some(
|
|
2439
2445
|
(n) => /(^|[-_])(active|current|selected)([-_]|$)/i.test(n)
|
|
@@ -2441,12 +2447,12 @@ function Rn(e) {
|
|
|
2441
2447
|
}
|
|
2442
2448
|
const Di = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
|
|
2443
2449
|
function Pi(e) {
|
|
2444
|
-
return
|
|
2445
|
-
|
|
2450
|
+
return Pn(e) ? !0 : Array.from(e.querySelectorAll(Di)).some(
|
|
2451
|
+
Pn
|
|
2446
2452
|
);
|
|
2447
2453
|
}
|
|
2448
|
-
function
|
|
2449
|
-
const n =
|
|
2454
|
+
function zn(e, t) {
|
|
2455
|
+
const n = tr(
|
|
2450
2456
|
e[t].innerText || e[t].textContent || ""
|
|
2451
2457
|
);
|
|
2452
2458
|
return {
|
|
@@ -2457,21 +2463,21 @@ function Dn(e, t) {
|
|
|
2457
2463
|
}
|
|
2458
2464
|
function zi(e) {
|
|
2459
2465
|
const t = e.querySelector('[aria-current="step"]');
|
|
2460
|
-
if (t && t.parentElement && !
|
|
2466
|
+
if (t && t.parentElement && !tt(t)) {
|
|
2461
2467
|
const l = Array.from(t.parentElement.children).filter(
|
|
2462
|
-
(s) => s.tagName === t.tagName && !
|
|
2468
|
+
(s) => s.tagName === t.tagName && !tt(s)
|
|
2463
2469
|
), o = l.indexOf(t);
|
|
2464
|
-
if (o >= 0 && l.length >= 2) return
|
|
2470
|
+
if (o >= 0 && l.length >= 2) return zn(l, o);
|
|
2465
2471
|
}
|
|
2466
2472
|
const n = e.querySelector('[role="progressbar"]');
|
|
2467
|
-
if (n && !
|
|
2473
|
+
if (n && !tt(n)) {
|
|
2468
2474
|
const l = Number(n.getAttribute("aria-valuenow")), o = Number(n.getAttribute("aria-valuemax"));
|
|
2469
2475
|
if (Number.isFinite(l) && Number.isFinite(o) && o >= 2) {
|
|
2470
2476
|
const s = (n.getAttribute("aria-valuetext") || "").trim();
|
|
2471
2477
|
return {
|
|
2472
2478
|
totalSteps: o,
|
|
2473
2479
|
currentStep: l,
|
|
2474
|
-
...s ? { stepLabel:
|
|
2480
|
+
...s ? { stepLabel: tr(s) } : {}
|
|
2475
2481
|
};
|
|
2476
2482
|
}
|
|
2477
2483
|
}
|
|
@@ -2479,19 +2485,19 @@ function zi(e) {
|
|
|
2479
2485
|
e.querySelectorAll(
|
|
2480
2486
|
'[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
|
|
2481
2487
|
)
|
|
2482
|
-
).filter((l) => !
|
|
2488
|
+
).filter((l) => !tt(l) && Ri(l));
|
|
2483
2489
|
for (const l of i) {
|
|
2484
2490
|
const o = Array.from(l.children).filter(
|
|
2485
|
-
(a) => !
|
|
2491
|
+
(a) => !tt(a) && (a.textContent || "").trim().length > 0
|
|
2486
2492
|
);
|
|
2487
2493
|
if (o.length < 2 || o.length > 12) continue;
|
|
2488
2494
|
const s = o.findIndex(Pi);
|
|
2489
2495
|
if (!(s < 0))
|
|
2490
|
-
return
|
|
2496
|
+
return zn(o, s);
|
|
2491
2497
|
}
|
|
2492
2498
|
return {};
|
|
2493
2499
|
}
|
|
2494
|
-
const
|
|
2500
|
+
const Rt = 4096, $i = 20, Hi = 20, Oi = 10, Fi = 10, Bi = 30, Wi = 20, $n = 500, qi = [
|
|
2495
2501
|
'[data-ll-private="true"]',
|
|
2496
2502
|
".ll-widget",
|
|
2497
2503
|
"script",
|
|
@@ -2499,7 +2505,7 @@ const Mt = 4096, $i = 20, Hi = 20, Oi = 10, Fi = 10, Bi = 30, Wi = 20, Pn = 500,
|
|
|
2499
2505
|
"noscript",
|
|
2500
2506
|
"iframe"
|
|
2501
2507
|
];
|
|
2502
|
-
function
|
|
2508
|
+
function mt(e) {
|
|
2503
2509
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2504
2510
|
let t = e;
|
|
2505
2511
|
for (; t; ) {
|
|
@@ -2509,14 +2515,14 @@ function ht(e) {
|
|
|
2509
2515
|
}
|
|
2510
2516
|
return !1;
|
|
2511
2517
|
}
|
|
2512
|
-
function
|
|
2518
|
+
function gt(e) {
|
|
2513
2519
|
if (typeof window > "u") return !0;
|
|
2514
2520
|
const t = e.getBoundingClientRect();
|
|
2515
2521
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2516
2522
|
const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2517
2523
|
return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
|
|
2518
2524
|
}
|
|
2519
|
-
function
|
|
2525
|
+
function Hn(e) {
|
|
2520
2526
|
const t = e.getAttribute("id");
|
|
2521
2527
|
if (t) {
|
|
2522
2528
|
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
@@ -2543,7 +2549,7 @@ function zn(e) {
|
|
|
2543
2549
|
const l = e.getAttribute("placeholder");
|
|
2544
2550
|
return l ? l.trim() : "";
|
|
2545
2551
|
}
|
|
2546
|
-
function
|
|
2552
|
+
function ue(e, t) {
|
|
2547
2553
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2548
2554
|
}
|
|
2549
2555
|
function Ui(e) {
|
|
@@ -2575,7 +2581,7 @@ function ji(e) {
|
|
|
2575
2581
|
}
|
|
2576
2582
|
return null;
|
|
2577
2583
|
}
|
|
2578
|
-
function
|
|
2584
|
+
function et(e) {
|
|
2579
2585
|
return e.length;
|
|
2580
2586
|
}
|
|
2581
2587
|
function Vi(e, t = {}) {
|
|
@@ -2595,63 +2601,63 @@ function Vi(e, t = {}) {
|
|
|
2595
2601
|
const i = typeof window < "u" && window.location.href || "", l = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
|
|
2596
2602
|
n.querySelectorAll("[data-ll-region]")
|
|
2597
2603
|
), a = [];
|
|
2598
|
-
for (const
|
|
2604
|
+
for (const y of s) {
|
|
2599
2605
|
if (a.length >= Oi) break;
|
|
2600
|
-
if (
|
|
2601
|
-
const z =
|
|
2602
|
-
(
|
|
2603
|
-
|
|
2606
|
+
if (mt(y) || !gt(y)) continue;
|
|
2607
|
+
const z = y.getAttribute("data-ll-region") ?? "", B = y.getAttribute("data-ll-intent") ?? void 0, K = ue(
|
|
2608
|
+
(y.innerText || y.textContent || "").trim(),
|
|
2609
|
+
$n * 2
|
|
2604
2610
|
);
|
|
2605
2611
|
!z || !K || a.push({ id: z, intent: B, text: K });
|
|
2606
2612
|
}
|
|
2607
2613
|
const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
|
|
2608
2614
|
n.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2609
2615
|
);
|
|
2610
|
-
for (const
|
|
2611
|
-
if (
|
|
2612
|
-
const z = (
|
|
2613
|
-
z && c.push(`${
|
|
2616
|
+
for (const y of m) {
|
|
2617
|
+
if (mt(y) || !gt(y)) continue;
|
|
2618
|
+
const z = (y.textContent || "").trim();
|
|
2619
|
+
z && c.push(`${y.tagName}: ${ue(z, 200)}`);
|
|
2614
2620
|
}
|
|
2615
2621
|
const p = Array.from(n.querySelectorAll("p, li"));
|
|
2616
|
-
for (const
|
|
2617
|
-
if (
|
|
2618
|
-
const z = (
|
|
2619
|
-
z.length > 10 && c.push(
|
|
2622
|
+
for (const y of p) {
|
|
2623
|
+
if (mt(y) || !gt(y) || u.includes(y.tagName)) continue;
|
|
2624
|
+
const z = (y.textContent || "").trim();
|
|
2625
|
+
z.length > 10 && c.push(ue(z, $n));
|
|
2620
2626
|
}
|
|
2621
2627
|
const h = c.join(`
|
|
2622
|
-
`), D = [],
|
|
2623
|
-
for (const
|
|
2628
|
+
`), D = [], _ = Array.from(n.querySelectorAll("a[href]"));
|
|
2629
|
+
for (const y of _) {
|
|
2624
2630
|
if (D.length >= $i) break;
|
|
2625
|
-
if (
|
|
2626
|
-
const z =
|
|
2627
|
-
!z || !B || D.push({ href: z, text:
|
|
2631
|
+
if (mt(y) || !gt(y)) continue;
|
|
2632
|
+
const z = y.getAttribute("href") || "", B = (y.textContent || "").trim();
|
|
2633
|
+
!z || !B || D.push({ href: z, text: ue(B, 100) });
|
|
2628
2634
|
}
|
|
2629
|
-
const
|
|
2635
|
+
const k = [], g = Array.from(
|
|
2630
2636
|
n.querySelectorAll(
|
|
2631
2637
|
"input, textarea, select"
|
|
2632
2638
|
)
|
|
2633
2639
|
);
|
|
2634
|
-
for (const
|
|
2635
|
-
if (
|
|
2636
|
-
if (
|
|
2637
|
-
const z =
|
|
2638
|
-
z &&
|
|
2640
|
+
for (const y of g) {
|
|
2641
|
+
if (k.length >= Hi) break;
|
|
2642
|
+
if (mt(y) || !Jt(y) || !gt(y)) continue;
|
|
2643
|
+
const z = Hn(y), B = y instanceof HTMLInputElement ? y.type : y.tagName.toLowerCase();
|
|
2644
|
+
z && k.push({ label: ue(z, 100), type: B });
|
|
2639
2645
|
}
|
|
2640
|
-
const w = Array.from(n.querySelectorAll("form")),
|
|
2641
|
-
let
|
|
2642
|
-
for (const
|
|
2643
|
-
if (
|
|
2644
|
-
if (
|
|
2645
|
-
const z =
|
|
2646
|
-
|
|
2646
|
+
const w = Array.from(n.querySelectorAll("form")), R = [];
|
|
2647
|
+
let E = 0;
|
|
2648
|
+
for (const y of w) {
|
|
2649
|
+
if (R.length >= Fi) break;
|
|
2650
|
+
if (Pt(y) || y.matches(".ll-widget *, .ll-widget")) continue;
|
|
2651
|
+
const z = y.getAttribute("id") || y.getAttribute("name") || Ui(y.getAttribute("data-ll-intent")) || `form_${E++}`, B = y.getAttribute("data-ll-intent") || ji(y) || void 0, K = Array.from(
|
|
2652
|
+
y.querySelectorAll(
|
|
2647
2653
|
"input, textarea, select"
|
|
2648
2654
|
)
|
|
2649
|
-
),
|
|
2655
|
+
), le = [];
|
|
2650
2656
|
let H = 0;
|
|
2651
2657
|
const G = /* @__PURE__ */ new Set();
|
|
2652
2658
|
for (const f of K) {
|
|
2653
|
-
if (
|
|
2654
|
-
if (!
|
|
2659
|
+
if (le.length >= Bi) break;
|
|
2660
|
+
if (!Jt(f)) continue;
|
|
2655
2661
|
if (f instanceof HTMLInputElement) {
|
|
2656
2662
|
const U = f.type;
|
|
2657
2663
|
if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
|
|
@@ -2659,14 +2665,14 @@ function Vi(e, t = {}) {
|
|
|
2659
2665
|
const A = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
|
|
2660
2666
|
let q = A || $ || `field_${H}`;
|
|
2661
2667
|
G.has(q) && (q = `${q}__${H}`), G.add(q), H++;
|
|
2662
|
-
const X =
|
|
2668
|
+
const X = Hn(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
|
|
2663
2669
|
name: q,
|
|
2664
|
-
label:
|
|
2670
|
+
label: ue(X, 100),
|
|
2665
2671
|
type: ee
|
|
2666
2672
|
};
|
|
2667
2673
|
f.required === !0 && (V.required = !0);
|
|
2668
2674
|
const te = f.getAttribute("placeholder");
|
|
2669
|
-
if (te && (V.placeholder =
|
|
2675
|
+
if (te && (V.placeholder = ue(te.trim(), 100)), f instanceof HTMLInputElement || f instanceof HTMLTextAreaElement) {
|
|
2670
2676
|
const U = f.getAttribute("minlength");
|
|
2671
2677
|
if (U !== null) {
|
|
2672
2678
|
const Q = parseInt(U, 10);
|
|
@@ -2680,15 +2686,15 @@ function Vi(e, t = {}) {
|
|
|
2680
2686
|
}
|
|
2681
2687
|
if (f instanceof HTMLInputElement) {
|
|
2682
2688
|
const U = f.getAttribute("min");
|
|
2683
|
-
U !== null && (V.min =
|
|
2689
|
+
U !== null && (V.min = ue(U, 50));
|
|
2684
2690
|
const me = f.getAttribute("max");
|
|
2685
|
-
me !== null && (V.max =
|
|
2691
|
+
me !== null && (V.max = ue(me, 50));
|
|
2686
2692
|
const Q = f.getAttribute("step");
|
|
2687
|
-
Q !== null && (V.step =
|
|
2693
|
+
Q !== null && (V.step = ue(Q, 20));
|
|
2688
2694
|
const _e = f.getAttribute("pattern");
|
|
2689
|
-
_e !== null && (V.pattern =
|
|
2695
|
+
_e !== null && (V.pattern = ue(_e, 200));
|
|
2690
2696
|
const ne = (f.getAttribute("autocomplete") || "").toLowerCase();
|
|
2691
|
-
ne && ne !== "off" && !ne.startsWith("cc-") && (V.autocomplete =
|
|
2697
|
+
ne && ne !== "off" && !ne.startsWith("cc-") && (V.autocomplete = ue(ne, 50));
|
|
2692
2698
|
}
|
|
2693
2699
|
if (f instanceof HTMLSelectElement) {
|
|
2694
2700
|
const U = [];
|
|
@@ -2696,14 +2702,14 @@ function Vi(e, t = {}) {
|
|
|
2696
2702
|
const Q = f.options[me];
|
|
2697
2703
|
if (!Q || Q.disabled) continue;
|
|
2698
2704
|
const _e = Q.value || "", ne = (Q.textContent || "").trim() || _e;
|
|
2699
|
-
!_e && !ne || U.push({ value: _e, label:
|
|
2705
|
+
!_e && !ne || U.push({ value: _e, label: ue(ne, 60) });
|
|
2700
2706
|
}
|
|
2701
2707
|
U.length > 0 && (V.options = U);
|
|
2702
2708
|
}
|
|
2703
2709
|
const oe = typeof f.validationMessage == "string" ? f.validationMessage : "";
|
|
2704
|
-
oe && (V.validationMessage =
|
|
2710
|
+
oe && (V.validationMessage = ue(oe, 200)), le.push(V);
|
|
2705
2711
|
}
|
|
2706
|
-
|
|
2712
|
+
R.push({ id: z, intent: B, fields: le });
|
|
2707
2713
|
}
|
|
2708
2714
|
const v = {
|
|
2709
2715
|
url: i,
|
|
@@ -2712,19 +2718,19 @@ function Vi(e, t = {}) {
|
|
|
2712
2718
|
regions: a,
|
|
2713
2719
|
visibleText: h,
|
|
2714
2720
|
visibleLinks: D,
|
|
2715
|
-
visibleFields:
|
|
2716
|
-
forms:
|
|
2717
|
-
flow:
|
|
2721
|
+
visibleFields: k,
|
|
2722
|
+
forms: R,
|
|
2723
|
+
flow: er(n),
|
|
2718
2724
|
extras: e
|
|
2719
2725
|
};
|
|
2720
|
-
let O =
|
|
2721
|
-
for (; O >
|
|
2722
|
-
v.visibleFields.pop(), O =
|
|
2723
|
-
for (; O >
|
|
2726
|
+
let O = et(JSON.stringify(v.regions)) + et(v.visibleText) + et(JSON.stringify(v.visibleLinks)) + et(JSON.stringify(v.visibleFields));
|
|
2727
|
+
for (; O > Rt && v.visibleFields.length > 0; )
|
|
2728
|
+
v.visibleFields.pop(), O = et(JSON.stringify(v.visibleFields));
|
|
2729
|
+
for (; O > Rt && v.visibleLinks.length > 0; )
|
|
2724
2730
|
v.visibleLinks.pop(), O -= 80;
|
|
2725
|
-
return
|
|
2731
|
+
return et(v.visibleText) > Rt && (v.visibleText = ue(v.visibleText, Rt - 100)), v;
|
|
2726
2732
|
}
|
|
2727
|
-
let
|
|
2733
|
+
let nt = null;
|
|
2728
2734
|
function Yi(e) {
|
|
2729
2735
|
const t = e.querySelectorAll("form");
|
|
2730
2736
|
let n = `f${t.length}`;
|
|
@@ -2732,15 +2738,15 @@ function Yi(e) {
|
|
|
2732
2738
|
n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
|
|
2733
2739
|
}), n;
|
|
2734
2740
|
}
|
|
2735
|
-
function
|
|
2741
|
+
function On(e, t = {}) {
|
|
2736
2742
|
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ? Yi(i) : ""}`;
|
|
2737
|
-
if (
|
|
2738
|
-
return
|
|
2743
|
+
if (nt && nt.key === s && n - nt.at < 1e3)
|
|
2744
|
+
return nt.ctx;
|
|
2739
2745
|
const a = Vi(e, t);
|
|
2740
|
-
return
|
|
2746
|
+
return nt = { key: s, at: n, ctx: a }, a;
|
|
2741
2747
|
}
|
|
2742
2748
|
function Gi() {
|
|
2743
|
-
|
|
2749
|
+
nt = null;
|
|
2744
2750
|
}
|
|
2745
2751
|
const Xi = 200;
|
|
2746
2752
|
function Ki(e) {
|
|
@@ -2762,7 +2768,7 @@ function Zi(e) {
|
|
|
2762
2768
|
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), l = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2763
2769
|
for (const s of o) {
|
|
2764
2770
|
if (l.length >= Xi) break;
|
|
2765
|
-
if (
|
|
2771
|
+
if (Pt(s)) continue;
|
|
2766
2772
|
const a = s.getAttribute("href") || "";
|
|
2767
2773
|
if (!Ji(a)) continue;
|
|
2768
2774
|
let c = a, u = !0;
|
|
@@ -2781,19 +2787,19 @@ function Zi(e) {
|
|
|
2781
2787
|
}
|
|
2782
2788
|
return l;
|
|
2783
2789
|
}
|
|
2784
|
-
let
|
|
2790
|
+
let rt = null;
|
|
2785
2791
|
const Qi = 5e3;
|
|
2786
|
-
function
|
|
2792
|
+
function Gt() {
|
|
2787
2793
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2788
|
-
if (
|
|
2789
|
-
return
|
|
2794
|
+
if (rt && rt.pathname === t && e - rt.at < Qi)
|
|
2795
|
+
return rt.routes;
|
|
2790
2796
|
const n = Zi();
|
|
2791
|
-
return
|
|
2797
|
+
return rt = { at: e, pathname: t, routes: n }, n;
|
|
2792
2798
|
}
|
|
2793
2799
|
function eo() {
|
|
2794
|
-
|
|
2800
|
+
rt = null;
|
|
2795
2801
|
}
|
|
2796
|
-
function
|
|
2802
|
+
function Zt(e) {
|
|
2797
2803
|
if (e instanceof HTMLInputElement) {
|
|
2798
2804
|
const t = e.type;
|
|
2799
2805
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2804,10 +2810,10 @@ function Jt(e) {
|
|
|
2804
2810
|
function to(e, t) {
|
|
2805
2811
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2806
2812
|
}
|
|
2807
|
-
function
|
|
2813
|
+
function Re(e) {
|
|
2808
2814
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2809
2815
|
}
|
|
2810
|
-
function
|
|
2816
|
+
function Xt(e) {
|
|
2811
2817
|
const t = e.lastIndexOf(".");
|
|
2812
2818
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
2813
2819
|
}
|
|
@@ -2826,24 +2832,24 @@ function no(e) {
|
|
|
2826
2832
|
return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
|
|
2827
2833
|
}
|
|
2828
2834
|
function ro(e, t) {
|
|
2829
|
-
const n =
|
|
2835
|
+
const n = Re(t);
|
|
2830
2836
|
if (n.length < 2) return null;
|
|
2831
2837
|
let i = null, l = 0;
|
|
2832
2838
|
for (const o of Array.from(
|
|
2833
2839
|
e.querySelectorAll("input, textarea, select")
|
|
2834
2840
|
)) {
|
|
2835
|
-
if (!
|
|
2841
|
+
if (!Zt(o)) continue;
|
|
2836
2842
|
const s = o.getAttribute("name") || "", a = o.getAttribute("id") || "", c = [
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2843
|
+
Re(Xt(s)),
|
|
2844
|
+
Re(Xt(a)),
|
|
2845
|
+
Re(s),
|
|
2846
|
+
Re(a)
|
|
2841
2847
|
];
|
|
2842
2848
|
let u = 0;
|
|
2843
2849
|
c.some((m) => m.length >= 2 && m === n) ? u = 4 : [
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2850
|
+
Re(s),
|
|
2851
|
+
Re(Xt(s)),
|
|
2852
|
+
Re(no(o))
|
|
2847
2853
|
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > l && (l = u, i = o);
|
|
2848
2854
|
}
|
|
2849
2855
|
return l >= 2 ? i : null;
|
|
@@ -2854,7 +2860,7 @@ function io(e, t) {
|
|
|
2854
2860
|
const o = e.querySelector(
|
|
2855
2861
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2856
2862
|
);
|
|
2857
|
-
if (o &&
|
|
2863
|
+
if (o && Zt(o)) return o;
|
|
2858
2864
|
} catch {
|
|
2859
2865
|
}
|
|
2860
2866
|
const n = Array.from(
|
|
@@ -2863,7 +2869,7 @@ function io(e, t) {
|
|
|
2863
2869
|
let i = 0;
|
|
2864
2870
|
const l = /* @__PURE__ */ new Map();
|
|
2865
2871
|
for (const o of n) {
|
|
2866
|
-
if (!
|
|
2872
|
+
if (!Zt(o)) continue;
|
|
2867
2873
|
const s = to(o, i);
|
|
2868
2874
|
let a = s;
|
|
2869
2875
|
if (l.has(s) && (a = `${s}__${i}`), a === t) return o;
|
|
@@ -2871,9 +2877,9 @@ function io(e, t) {
|
|
|
2871
2877
|
}
|
|
2872
2878
|
return ro(e, t);
|
|
2873
2879
|
}
|
|
2874
|
-
function
|
|
2880
|
+
function Fn(e, t) {
|
|
2875
2881
|
const n = io(e, t);
|
|
2876
|
-
return n ?
|
|
2882
|
+
return n ? Jt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2877
2883
|
}
|
|
2878
2884
|
function oo(e, t) {
|
|
2879
2885
|
const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), l = i == null ? void 0 : i.set;
|
|
@@ -2891,7 +2897,7 @@ function lo(e, t, n = {}) {
|
|
|
2891
2897
|
}
|
|
2892
2898
|
oo(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2893
2899
|
}
|
|
2894
|
-
function
|
|
2900
|
+
function Bn(e, t) {
|
|
2895
2901
|
if (!t) return null;
|
|
2896
2902
|
const n = t.replace(/"/g, '\\"'), i = (a) => a.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
|
|
2897
2903
|
try {
|
|
@@ -2965,7 +2971,7 @@ function fo() {
|
|
|
2965
2971
|
const e = uo();
|
|
2966
2972
|
return e || window;
|
|
2967
2973
|
}
|
|
2968
|
-
function
|
|
2974
|
+
function Wn(e) {
|
|
2969
2975
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2970
2976
|
}
|
|
2971
2977
|
function po(e) {
|
|
@@ -3010,9 +3016,9 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3010
3016
|
// to onAgentCommand.
|
|
3011
3017
|
"task_field_updated",
|
|
3012
3018
|
"task_completed"
|
|
3013
|
-
]),
|
|
3019
|
+
]), nr = Qt(
|
|
3014
3020
|
function(t, n) {
|
|
3015
|
-
var
|
|
3021
|
+
var pn, hn, mn, gn, yn, vn, bn;
|
|
3016
3022
|
const {
|
|
3017
3023
|
agentId: i,
|
|
3018
3024
|
apiKey: l,
|
|
@@ -3032,19 +3038,19 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3032
3038
|
// .ll-expanded--mobile in styles.css.
|
|
3033
3039
|
defaultDisplayMode: h = "expanded",
|
|
3034
3040
|
onDisplayModeChange: D,
|
|
3035
|
-
position:
|
|
3036
|
-
mobileBreakpoint:
|
|
3037
|
-
draggable:
|
|
3041
|
+
position: _ = "bottom-right",
|
|
3042
|
+
mobileBreakpoint: k = 640,
|
|
3043
|
+
draggable: g,
|
|
3038
3044
|
resizable: w,
|
|
3039
|
-
persistKey:
|
|
3040
|
-
disablePersistence:
|
|
3045
|
+
persistKey: R = "ll-widget",
|
|
3046
|
+
disablePersistence: E = !1,
|
|
3041
3047
|
teamMembers: v,
|
|
3042
3048
|
currentTeamMemberId: O,
|
|
3043
|
-
onTeamMemberChange:
|
|
3049
|
+
onTeamMemberChange: y,
|
|
3044
3050
|
idleLoopUrl: z,
|
|
3045
3051
|
greeting: B,
|
|
3046
3052
|
avatarImageUrl: K,
|
|
3047
|
-
agentName:
|
|
3053
|
+
agentName: le,
|
|
3048
3054
|
branding: H = {},
|
|
3049
3055
|
allowCamera: G = !0,
|
|
3050
3056
|
allowScreenShare: f = !0,
|
|
@@ -3061,53 +3067,53 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3061
3067
|
hideOn: Q,
|
|
3062
3068
|
pathname: _e,
|
|
3063
3069
|
onNavigate: ne,
|
|
3064
|
-
onScrollToSelector:
|
|
3065
|
-
getPageContext:
|
|
3066
|
-
pageContextExtras:
|
|
3067
|
-
getRoutes:
|
|
3068
|
-
onScrollPage:
|
|
3069
|
-
onClick:
|
|
3070
|
+
onScrollToSelector: ot,
|
|
3071
|
+
getPageContext: lt,
|
|
3072
|
+
pageContextExtras: vt,
|
|
3073
|
+
getRoutes: bt,
|
|
3074
|
+
onScrollPage: at,
|
|
3075
|
+
onClick: wt,
|
|
3070
3076
|
capabilities: qe,
|
|
3071
3077
|
onConnect: Ue,
|
|
3072
|
-
onDisconnect:
|
|
3073
|
-
onTranscript:
|
|
3074
|
-
onAgentState:
|
|
3075
|
-
onConnectionStateChange:
|
|
3076
|
-
onAgentEvent:
|
|
3078
|
+
onDisconnect: De,
|
|
3079
|
+
onTranscript: Pe,
|
|
3080
|
+
onAgentState: ze,
|
|
3081
|
+
onConnectionStateChange: $e,
|
|
3082
|
+
onAgentEvent: He,
|
|
3077
3083
|
onAgentCommand: je,
|
|
3078
|
-
onCollect:
|
|
3084
|
+
onCollect: Oe,
|
|
3079
3085
|
controlledSession: F,
|
|
3080
|
-
className:
|
|
3086
|
+
className: Fe,
|
|
3081
3087
|
style: Ve,
|
|
3082
3088
|
zIndex: xe = 2147483647
|
|
3083
|
-
} = t,
|
|
3084
|
-
|
|
3089
|
+
} = t, _t = Kr(_e), st = ri(_t, me, Q);
|
|
3090
|
+
I(() => {
|
|
3085
3091
|
Gi(), eo();
|
|
3086
|
-
}, [
|
|
3087
|
-
const
|
|
3092
|
+
}, [_t]);
|
|
3093
|
+
const Me = O !== void 0, [zt, xt] = M(() => {
|
|
3088
3094
|
var b;
|
|
3089
3095
|
return O ?? ((b = v == null ? void 0 : v[0]) == null ? void 0 : b.id);
|
|
3090
|
-
}),
|
|
3091
|
-
() => (v == null ? void 0 : v.find((b) => b.id ===
|
|
3092
|
-
[v,
|
|
3093
|
-
),
|
|
3096
|
+
}), Ae = Me ? O : zt, de = it(
|
|
3097
|
+
() => (v == null ? void 0 : v.find((b) => b.id === Ae)) ?? null,
|
|
3098
|
+
[v, Ae]
|
|
3099
|
+
), ct = (de == null ? void 0 : de.agentId) ?? i, fe = u === "EMBEDDED", ge = Wr(k), [Lt, Ye] = Fr({
|
|
3094
3100
|
value: p,
|
|
3095
3101
|
defaultValue: h,
|
|
3096
3102
|
onChange: D,
|
|
3097
|
-
persistKey:
|
|
3098
|
-
disablePersistence:
|
|
3099
|
-
}),
|
|
3100
|
-
} :
|
|
3101
|
-
draggable: !
|
|
3102
|
-
resizable: !
|
|
3103
|
-
persistKey:
|
|
3104
|
-
disablePersistence:
|
|
3105
|
-
}),
|
|
3106
|
-
|
|
3107
|
-
const
|
|
3108
|
-
|
|
3103
|
+
persistKey: R,
|
|
3104
|
+
disablePersistence: fe || E
|
|
3105
|
+
}), pe = fe ? "expanded" : Lt, ye = fe ? () => {
|
|
3106
|
+
} : Ye, Ge = q ?? !fe, Ct = X ?? !fe, kt = te || !fe && ge, Ie = Gr({
|
|
3107
|
+
draggable: !fe && (g ?? !ge),
|
|
3108
|
+
resizable: !fe && (w ?? !ge),
|
|
3109
|
+
persistKey: R,
|
|
3110
|
+
disablePersistence: fe || E
|
|
3111
|
+
}), Le = Ar(), Ce = Tr(), Be = Rr(), Xe = Dr(), [Ht, ke] = M(!1), [Se, ut] = M(!1), [Ke, dt] = M(!1), [St, x] = M(!1), [re, rr] = M(!1), Et = oi({ baseUrl: o, config: c }), At = T(Et);
|
|
3112
|
+
At.current = Et;
|
|
3113
|
+
const Ot = T(ne), Ft = T(ot), Bt = T(at), Wt = T(wt), nn = T(lt), rn = T(vt), on = T(bt), qt = T(qe), Ee = T(null);
|
|
3114
|
+
Ot.current = ne, Ft.current = ot, Bt.current = at, Wt.current = wt, nn.current = lt, rn.current = vt, on.current = bt, qt.current = qe;
|
|
3109
3115
|
function be(b) {
|
|
3110
|
-
const d =
|
|
3116
|
+
const d = qt.current;
|
|
3111
3117
|
return d ? d.includes(b) : !0;
|
|
3112
3118
|
}
|
|
3113
3119
|
function we(b, d) {
|
|
@@ -3115,12 +3121,12 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3115
3121
|
`[LiveLayer] Agent command "${b}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
3116
3122
|
);
|
|
3117
3123
|
}
|
|
3118
|
-
const
|
|
3124
|
+
const ft = C(
|
|
3119
3125
|
(b) => {
|
|
3120
|
-
var ie,
|
|
3126
|
+
var ie, ce, Ne, ht, Te;
|
|
3121
3127
|
const d = b;
|
|
3122
3128
|
if (!(!d.type || typeof d.type != "string")) {
|
|
3123
|
-
if (
|
|
3129
|
+
if (He == null || He({ eventName: d.type, data: b }), d.type === "navigate") {
|
|
3124
3130
|
if (!be("navigate")) {
|
|
3125
3131
|
we("navigate", "navigate");
|
|
3126
3132
|
return;
|
|
@@ -3132,9 +3138,9 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3132
3138
|
);
|
|
3133
3139
|
return;
|
|
3134
3140
|
}
|
|
3135
|
-
if (
|
|
3141
|
+
if (At.current.playPageChange(), Ot.current) {
|
|
3136
3142
|
try {
|
|
3137
|
-
|
|
3143
|
+
Ot.current(N);
|
|
3138
3144
|
} catch (P) {
|
|
3139
3145
|
console.warn(
|
|
3140
3146
|
`[LiveLayer] onNavigate threw for "${N}". Falling back. Error:`,
|
|
@@ -3171,9 +3177,9 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3171
3177
|
const N = typeof d.selector == "string" ? d.selector : null;
|
|
3172
3178
|
if (!N) return;
|
|
3173
3179
|
const P = d.behavior === "instant" ? "instant" : "smooth";
|
|
3174
|
-
if (
|
|
3180
|
+
if (Ft.current) {
|
|
3175
3181
|
try {
|
|
3176
|
-
|
|
3182
|
+
Ft.current(
|
|
3177
3183
|
N,
|
|
3178
3184
|
P
|
|
3179
3185
|
);
|
|
@@ -3210,16 +3216,16 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3210
3216
|
we("request_page_context", "read_page");
|
|
3211
3217
|
return;
|
|
3212
3218
|
}
|
|
3213
|
-
const N = typeof d.requestId == "string" ? d.requestId : void 0, P = (ie =
|
|
3214
|
-
const W = P,
|
|
3215
|
-
if (
|
|
3219
|
+
const N = typeof d.requestId == "string" ? d.requestId : void 0, P = (ie = Ee.current) == null ? void 0 : ie.call(Ee), Y = (Z) => {
|
|
3220
|
+
const W = P, se = W == null ? void 0 : W.localParticipant;
|
|
3221
|
+
if (se != null && se.publishData)
|
|
3216
3222
|
try {
|
|
3217
|
-
const he = N ? { ...Z, requestId: N } : Z,
|
|
3218
|
-
|
|
3223
|
+
const he = N ? { ...Z, requestId: N } : Z, Qe = new TextEncoder().encode(JSON.stringify(he));
|
|
3224
|
+
se.publishData(Qe, { reliable: !0 });
|
|
3219
3225
|
} catch (he) {
|
|
3220
3226
|
console.warn("[LiveLayer] publishData failed.", he);
|
|
3221
3227
|
}
|
|
3222
|
-
}, j =
|
|
3228
|
+
}, j = rn.current, J = nn.current;
|
|
3223
3229
|
try {
|
|
3224
3230
|
if (J) {
|
|
3225
3231
|
const Z = J(j);
|
|
@@ -3230,7 +3236,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3230
3236
|
W
|
|
3231
3237
|
), Y({
|
|
3232
3238
|
type: "page_context",
|
|
3233
|
-
context:
|
|
3239
|
+
context: On(j)
|
|
3234
3240
|
});
|
|
3235
3241
|
});
|
|
3236
3242
|
return;
|
|
@@ -3240,7 +3246,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3240
3246
|
}
|
|
3241
3247
|
Y({
|
|
3242
3248
|
type: "page_context",
|
|
3243
|
-
context:
|
|
3249
|
+
context: On(j)
|
|
3244
3250
|
});
|
|
3245
3251
|
} catch (Z) {
|
|
3246
3252
|
console.warn(
|
|
@@ -3266,9 +3272,9 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3266
3272
|
return;
|
|
3267
3273
|
}
|
|
3268
3274
|
const P = d.behavior === "instant" ? "instant" : "smooth";
|
|
3269
|
-
if (
|
|
3275
|
+
if (Bt.current) {
|
|
3270
3276
|
try {
|
|
3271
|
-
|
|
3277
|
+
Bt.current(
|
|
3272
3278
|
N,
|
|
3273
3279
|
P
|
|
3274
3280
|
);
|
|
@@ -3283,7 +3289,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3283
3289
|
}, Z = (W) => {
|
|
3284
3290
|
j instanceof Window ? j.scrollTo({ top: W, ...Y }) : j.scrollTo({ top: W, ...Y });
|
|
3285
3291
|
};
|
|
3286
|
-
N === "up" ? J(-
|
|
3292
|
+
N === "up" ? J(-Wn(j)) : N === "down" ? J(Wn(j)) : Z(N === "top" ? 0 : po(j));
|
|
3287
3293
|
return;
|
|
3288
3294
|
}
|
|
3289
3295
|
if (d.type === "click") {
|
|
@@ -3296,9 +3302,9 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3296
3302
|
console.warn("[LiveLayer] click: missing selector.");
|
|
3297
3303
|
return;
|
|
3298
3304
|
}
|
|
3299
|
-
if (
|
|
3305
|
+
if (Wt.current) {
|
|
3300
3306
|
try {
|
|
3301
|
-
|
|
3307
|
+
Wt.current(N);
|
|
3302
3308
|
} catch (Y) {
|
|
3303
3309
|
console.warn("[LiveLayer] onClick threw.", Y);
|
|
3304
3310
|
}
|
|
@@ -3326,7 +3332,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3326
3332
|
);
|
|
3327
3333
|
return;
|
|
3328
3334
|
}
|
|
3329
|
-
(
|
|
3335
|
+
(ce = P.click) == null || ce.call(P);
|
|
3330
3336
|
return;
|
|
3331
3337
|
}
|
|
3332
3338
|
if (d.type === "advance_step" || d.type === "go_back" || d.type === "submit_flow") {
|
|
@@ -3336,12 +3342,12 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3336
3342
|
}
|
|
3337
3343
|
if (typeof document > "u") return;
|
|
3338
3344
|
const N = d.type === "advance_step" ? "ll-advance" : d.type === "go_back" ? "ll-back" : "ll-submit";
|
|
3339
|
-
let P =
|
|
3340
|
-
if (P || (
|
|
3345
|
+
let P = Dn(N);
|
|
3346
|
+
if (P || (er(document), P = Dn(N)), !P) {
|
|
3341
3347
|
console.warn(`[LiveLayer] ${d.type}: no "${N}" control found.`);
|
|
3342
3348
|
return;
|
|
3343
3349
|
}
|
|
3344
|
-
(
|
|
3350
|
+
(Ne = P.click) == null || Ne.call(P);
|
|
3345
3351
|
return;
|
|
3346
3352
|
}
|
|
3347
3353
|
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
@@ -3350,13 +3356,13 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3350
3356
|
return;
|
|
3351
3357
|
}
|
|
3352
3358
|
if (typeof document > "u") return;
|
|
3353
|
-
d.type === "fill_form" &&
|
|
3359
|
+
d.type === "fill_form" && At.current.playConfirmation();
|
|
3354
3360
|
const N = typeof d.formId == "string" ? d.formId : null;
|
|
3355
3361
|
if (!N) {
|
|
3356
3362
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
3357
3363
|
return;
|
|
3358
3364
|
}
|
|
3359
|
-
const P =
|
|
3365
|
+
const P = Bn(document, N);
|
|
3360
3366
|
if (!P) {
|
|
3361
3367
|
console.warn(
|
|
3362
3368
|
`[LiveLayer] ${d.type}: no <form> matched id="${N}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
|
|
@@ -3375,7 +3381,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3375
3381
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3376
3382
|
return;
|
|
3377
3383
|
}
|
|
3378
|
-
const J =
|
|
3384
|
+
const J = Fn(P, j);
|
|
3379
3385
|
if (J.el === null) {
|
|
3380
3386
|
J.reason === "private" ? console.warn(
|
|
3381
3387
|
`[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
|
|
@@ -3394,7 +3400,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3394
3400
|
}
|
|
3395
3401
|
for (const [j, J] of Object.entries(Y)) {
|
|
3396
3402
|
if (typeof J != "string") continue;
|
|
3397
|
-
const Z =
|
|
3403
|
+
const Z = Fn(P, j);
|
|
3398
3404
|
if (Z.el === null) {
|
|
3399
3405
|
Z.reason === "private" ? console.warn(
|
|
3400
3406
|
`[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
@@ -3425,8 +3431,8 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3425
3431
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
3426
3432
|
return;
|
|
3427
3433
|
}
|
|
3428
|
-
|
|
3429
|
-
const P =
|
|
3434
|
+
At.current.playConfirmation();
|
|
3435
|
+
const P = Bn(document, N);
|
|
3430
3436
|
if (!P) {
|
|
3431
3437
|
console.warn(
|
|
3432
3438
|
`[LiveLayer] submit_form: no <form> matched id="${N}" (or matching name / data-ll-intent slug).`
|
|
@@ -3439,12 +3445,12 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3439
3445
|
);
|
|
3440
3446
|
return;
|
|
3441
3447
|
}
|
|
3442
|
-
const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (
|
|
3443
|
-
const he = j,
|
|
3444
|
-
if (
|
|
3448
|
+
const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (ht = Ee.current) == null ? void 0 : ht.call(Ee), J = (se) => {
|
|
3449
|
+
const he = j, Qe = he == null ? void 0 : he.localParticipant;
|
|
3450
|
+
if (Qe != null && Qe.publishData)
|
|
3445
3451
|
try {
|
|
3446
|
-
const yr = Y ? { ...
|
|
3447
|
-
|
|
3452
|
+
const yr = Y ? { ...se, requestId: Y } : se, vr = new TextEncoder().encode(JSON.stringify(yr));
|
|
3453
|
+
Qe.publishData(vr, { reliable: !0 });
|
|
3448
3454
|
} catch {
|
|
3449
3455
|
}
|
|
3450
3456
|
};
|
|
@@ -3455,8 +3461,8 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3455
3461
|
P.addEventListener("submit", W, { once: !0 });
|
|
3456
3462
|
try {
|
|
3457
3463
|
typeof P.requestSubmit == "function" ? P.requestSubmit() : P.submit();
|
|
3458
|
-
} catch (
|
|
3459
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
3464
|
+
} catch (se) {
|
|
3465
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", se), P.removeEventListener("submit", W), J({
|
|
3460
3466
|
type: "form_submit_blocked",
|
|
3461
3467
|
formId: N,
|
|
3462
3468
|
reason: "exception"
|
|
@@ -3477,41 +3483,41 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3477
3483
|
we("request_routes", "read_page");
|
|
3478
3484
|
return;
|
|
3479
3485
|
}
|
|
3480
|
-
const N = typeof d.requestId == "string" ? d.requestId : void 0, Y = (
|
|
3486
|
+
const N = typeof d.requestId == "string" ? d.requestId : void 0, Y = (Te = Ee.current) == null ? void 0 : Te.call(Ee), j = Y == null ? void 0 : Y.localParticipant;
|
|
3481
3487
|
if (!(j != null && j.publishData)) return;
|
|
3482
3488
|
const J = (W) => {
|
|
3483
3489
|
try {
|
|
3484
|
-
const
|
|
3490
|
+
const se = N ? { type: "routes", routes: W, requestId: N } : { type: "routes", routes: W }, he = new TextEncoder().encode(JSON.stringify(se));
|
|
3485
3491
|
j.publishData(he, { reliable: !0 });
|
|
3486
|
-
} catch (
|
|
3487
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
3492
|
+
} catch (se) {
|
|
3493
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", se);
|
|
3488
3494
|
}
|
|
3489
|
-
}, Z =
|
|
3495
|
+
}, Z = on.current;
|
|
3490
3496
|
if (Z) {
|
|
3491
3497
|
try {
|
|
3492
|
-
const W = Z(),
|
|
3498
|
+
const W = Z(), se = (he) => {
|
|
3493
3499
|
if (!Array.isArray(he)) {
|
|
3494
3500
|
J([]);
|
|
3495
3501
|
return;
|
|
3496
3502
|
}
|
|
3497
3503
|
J(he.map(Ki).slice(0, 200));
|
|
3498
3504
|
};
|
|
3499
|
-
W instanceof Promise ? W.then(
|
|
3505
|
+
W instanceof Promise ? W.then(se).catch((he) => {
|
|
3500
3506
|
console.warn(
|
|
3501
3507
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3502
3508
|
he
|
|
3503
|
-
), J(
|
|
3504
|
-
}) :
|
|
3509
|
+
), J(Gt());
|
|
3510
|
+
}) : se(W);
|
|
3505
3511
|
} catch (W) {
|
|
3506
3512
|
console.warn(
|
|
3507
3513
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3508
3514
|
W
|
|
3509
|
-
), J(
|
|
3515
|
+
), J(Gt());
|
|
3510
3516
|
}
|
|
3511
3517
|
return;
|
|
3512
3518
|
}
|
|
3513
3519
|
try {
|
|
3514
|
-
J(
|
|
3520
|
+
J(Gt());
|
|
3515
3521
|
} catch (W) {
|
|
3516
3522
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", W);
|
|
3517
3523
|
}
|
|
@@ -3563,7 +3569,7 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3563
3569
|
} catch {
|
|
3564
3570
|
}
|
|
3565
3571
|
try {
|
|
3566
|
-
|
|
3572
|
+
Oe == null || Oe(
|
|
3567
3573
|
N
|
|
3568
3574
|
);
|
|
3569
3575
|
} catch (P) {
|
|
@@ -3574,37 +3580,37 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3574
3580
|
ho.has(d.type) || je == null || je(d);
|
|
3575
3581
|
}
|
|
3576
3582
|
},
|
|
3577
|
-
[je,
|
|
3578
|
-
),
|
|
3579
|
-
agentId: F ? "__controlled__" :
|
|
3583
|
+
[je, He, Oe]
|
|
3584
|
+
), ae = Er({
|
|
3585
|
+
agentId: F ? "__controlled__" : ct,
|
|
3580
3586
|
baseUrl: o,
|
|
3581
3587
|
apiKey: l,
|
|
3582
3588
|
sessionEndpoint: s,
|
|
3583
3589
|
sessionBody: a,
|
|
3584
|
-
onDataMessage: F ? void 0 :
|
|
3590
|
+
onDataMessage: F ? void 0 : ft
|
|
3585
3591
|
});
|
|
3586
|
-
|
|
3592
|
+
I(() => {
|
|
3587
3593
|
if (F != null && F.subscribeToDataMessages)
|
|
3588
|
-
return F.subscribeToDataMessages(
|
|
3589
|
-
}, [F,
|
|
3594
|
+
return F.subscribeToDataMessages(ft);
|
|
3595
|
+
}, [F, ft]), Ee.current = () => {
|
|
3590
3596
|
var b;
|
|
3591
|
-
return (b =
|
|
3592
|
-
},
|
|
3597
|
+
return (b = ae.getRoom) == null ? void 0 : b.call(ae);
|
|
3598
|
+
}, I(() => {
|
|
3593
3599
|
var ie;
|
|
3594
3600
|
if (typeof window > "u") return;
|
|
3595
3601
|
const b = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
|
|
3596
3602
|
if (b === "localhost" || b === "127.0.0.1" || b === "0.0.0.0" || b.endsWith(".local") || b.endsWith(".test"))
|
|
3597
|
-
return window.__livelayerSimulateCommand = (
|
|
3603
|
+
return window.__livelayerSimulateCommand = (ce) => {
|
|
3598
3604
|
try {
|
|
3599
|
-
|
|
3600
|
-
} catch (
|
|
3601
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
3605
|
+
ft(ce);
|
|
3606
|
+
} catch (Ne) {
|
|
3607
|
+
console.warn("[LiveLayer] simulate-command threw:", Ne);
|
|
3602
3608
|
}
|
|
3603
3609
|
}, () => {
|
|
3604
3610
|
delete window.__livelayerSimulateCommand;
|
|
3605
3611
|
};
|
|
3606
|
-
}, [
|
|
3607
|
-
const L =
|
|
3612
|
+
}, [ft]);
|
|
3613
|
+
const L = it(() => F ? {
|
|
3608
3614
|
connectionState: F.connectionState,
|
|
3609
3615
|
agentState: F.agentState,
|
|
3610
3616
|
transcript: F.transcript,
|
|
@@ -3620,121 +3626,121 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3620
3626
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
3621
3627
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
3622
3628
|
// so we reuse its reference for type consistency.
|
|
3623
|
-
getRoom:
|
|
3629
|
+
getRoom: ae.getRoom,
|
|
3624
3630
|
isControlled: !0
|
|
3625
3631
|
} : {
|
|
3626
|
-
connectionState:
|
|
3627
|
-
agentState:
|
|
3628
|
-
transcript:
|
|
3629
|
-
videoElement:
|
|
3630
|
-
audioElement:
|
|
3631
|
-
canResume:
|
|
3632
|
-
error:
|
|
3633
|
-
agentConfig:
|
|
3634
|
-
connect:
|
|
3635
|
-
disconnect:
|
|
3636
|
-
getRoom:
|
|
3632
|
+
connectionState: ae.connectionState,
|
|
3633
|
+
agentState: ae.agentState,
|
|
3634
|
+
transcript: ae.transcript,
|
|
3635
|
+
videoElement: ae.videoElement,
|
|
3636
|
+
audioElement: ae.audioElement,
|
|
3637
|
+
canResume: ae.canResume,
|
|
3638
|
+
error: ae.error,
|
|
3639
|
+
agentConfig: ae.agentConfig,
|
|
3640
|
+
connect: ae.connect,
|
|
3641
|
+
disconnect: ae.disconnect,
|
|
3642
|
+
getRoom: ae.getRoom,
|
|
3637
3643
|
isControlled: !1
|
|
3638
|
-
}, [F,
|
|
3639
|
-
|
|
3640
|
-
const
|
|
3641
|
-
|
|
3644
|
+
}, [F, ae]), ln = T(L);
|
|
3645
|
+
ln.current = L;
|
|
3646
|
+
const an = T(F);
|
|
3647
|
+
an.current = F, wr(
|
|
3642
3648
|
n,
|
|
3643
3649
|
() => ({
|
|
3644
3650
|
sendData: async (b) => {
|
|
3645
|
-
var
|
|
3646
|
-
const d =
|
|
3651
|
+
var Ne, ht;
|
|
3652
|
+
const d = an.current;
|
|
3647
3653
|
if (d != null && d.publishData) {
|
|
3648
3654
|
try {
|
|
3649
3655
|
await d.publishData(b);
|
|
3650
|
-
} catch (
|
|
3651
|
-
console.warn("[AvatarWidget] sendData (controlled) failed:",
|
|
3656
|
+
} catch (Te) {
|
|
3657
|
+
console.warn("[AvatarWidget] sendData (controlled) failed:", Te);
|
|
3652
3658
|
}
|
|
3653
3659
|
return;
|
|
3654
3660
|
}
|
|
3655
|
-
const ie = (
|
|
3656
|
-
if (
|
|
3661
|
+
const ie = (ht = (Ne = ln.current) == null ? void 0 : Ne.getRoom) == null ? void 0 : ht.call(Ne), ce = ie == null ? void 0 : ie.localParticipant;
|
|
3662
|
+
if (ce != null && ce.publishData)
|
|
3657
3663
|
try {
|
|
3658
|
-
const
|
|
3659
|
-
await
|
|
3660
|
-
} catch (
|
|
3661
|
-
console.warn("[AvatarWidget] sendData failed:",
|
|
3664
|
+
const Te = new TextEncoder().encode(JSON.stringify(b));
|
|
3665
|
+
await ce.publishData(Te, { reliable: !0 });
|
|
3666
|
+
} catch (Te) {
|
|
3667
|
+
console.warn("[AvatarWidget] sendData failed:", Te);
|
|
3662
3668
|
}
|
|
3663
3669
|
}
|
|
3664
3670
|
}),
|
|
3665
3671
|
[]
|
|
3666
3672
|
);
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3669
|
-
const b = L.videoElement, d =
|
|
3673
|
+
const sn = T(null);
|
|
3674
|
+
I(() => {
|
|
3675
|
+
const b = L.videoElement, d = sn.current;
|
|
3670
3676
|
if (!(!b || !d))
|
|
3671
3677
|
return d.appendChild(b), () => {
|
|
3672
3678
|
b.parentNode === d && d.removeChild(b);
|
|
3673
3679
|
};
|
|
3674
3680
|
}, [L.videoElement]);
|
|
3675
|
-
const [
|
|
3676
|
-
|
|
3681
|
+
const [Je, Nt] = M(!1);
|
|
3682
|
+
I(() => {
|
|
3677
3683
|
if (!$) {
|
|
3678
|
-
|
|
3684
|
+
Nt(!0);
|
|
3679
3685
|
return;
|
|
3680
3686
|
}
|
|
3681
|
-
L.agentState === "speaking" && !
|
|
3682
|
-
}, [$, L.agentState,
|
|
3687
|
+
L.agentState === "speaking" && !Je && Nt(!0);
|
|
3688
|
+
}, [$, L.agentState, Je]), I(() => {
|
|
3683
3689
|
if (!$) return;
|
|
3684
3690
|
const b = L.connectionState;
|
|
3685
|
-
(b === "disconnected" || b === "idle") &&
|
|
3686
|
-
}, [$, L.connectionState]),
|
|
3687
|
-
if (!$ || !L.videoElement ||
|
|
3688
|
-
const b = setTimeout(() =>
|
|
3691
|
+
(b === "disconnected" || b === "idle") && Nt(!1);
|
|
3692
|
+
}, [$, L.connectionState]), I(() => {
|
|
3693
|
+
if (!$ || !L.videoElement || Je) return;
|
|
3694
|
+
const b = setTimeout(() => Nt(!0), 5e3);
|
|
3689
3695
|
return () => clearTimeout(b);
|
|
3690
|
-
}, [$, L.videoElement,
|
|
3696
|
+
}, [$, L.videoElement, Je]), I(() => {
|
|
3691
3697
|
const b = L.videoElement;
|
|
3692
3698
|
if (b) {
|
|
3693
3699
|
if (!$) {
|
|
3694
3700
|
b.style.filter = "";
|
|
3695
3701
|
return;
|
|
3696
3702
|
}
|
|
3697
|
-
b.style.transition = "filter 500ms ease-out", b.style.filter =
|
|
3703
|
+
b.style.transition = "filter 500ms ease-out", b.style.filter = Je ? "" : "blur(8px)";
|
|
3698
3704
|
}
|
|
3699
|
-
}, [$, L.videoElement,
|
|
3705
|
+
}, [$, L.videoElement, Je]), I(() => {
|
|
3700
3706
|
const b = L.audioElement;
|
|
3701
3707
|
if (!b) return;
|
|
3702
3708
|
const d = document.createElement("div");
|
|
3703
|
-
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d),
|
|
3709
|
+
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d), Le.attach(b);
|
|
3704
3710
|
const ie = b.play();
|
|
3705
|
-
return ie && typeof ie.catch == "function" && ie.catch((
|
|
3706
|
-
(
|
|
3711
|
+
return ie && typeof ie.catch == "function" && ie.catch((ce) => {
|
|
3712
|
+
(ce == null ? void 0 : ce.name) === "NotAllowedError" && ke(!0);
|
|
3707
3713
|
}), () => {
|
|
3708
|
-
|
|
3714
|
+
Le.detach(), b.parentNode === d && d.removeChild(b), d.parentNode === document.body && document.body.removeChild(d);
|
|
3709
3715
|
};
|
|
3710
3716
|
}, [L.audioElement]);
|
|
3711
3717
|
const ve = Mr({
|
|
3712
3718
|
gateUntilAgentReady: !0,
|
|
3713
3719
|
agentState: L.agentState
|
|
3714
3720
|
});
|
|
3715
|
-
|
|
3721
|
+
I(() => {
|
|
3716
3722
|
if (L.isControlled || L.connectionState !== "connected") return;
|
|
3717
3723
|
const b = L.getRoom();
|
|
3718
3724
|
if (b)
|
|
3719
3725
|
return ve.setupMic(b).then(() => {
|
|
3720
3726
|
const d = ve.getMicStream();
|
|
3721
|
-
d &&
|
|
3727
|
+
d && Le.attachStream(d, "mic");
|
|
3722
3728
|
}).catch(() => {
|
|
3723
3729
|
}), () => {
|
|
3724
|
-
|
|
3730
|
+
Le.detachSlot("mic"), ve.teardownMic();
|
|
3725
3731
|
};
|
|
3726
|
-
}, [L.isControlled, L.connectionState]),
|
|
3732
|
+
}, [L.isControlled, L.connectionState]), I(() => {
|
|
3727
3733
|
var d;
|
|
3728
3734
|
if (L.connectionState !== "connected") return;
|
|
3729
3735
|
const b = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
|
|
3730
3736
|
if (b)
|
|
3731
|
-
return
|
|
3732
|
-
|
|
3737
|
+
return Ce.attachRoom(b), Be.attachRoom(b), L.isControlled && ve.attachRoom(b), Xe.refresh(), () => {
|
|
3738
|
+
Ce.teardown(), Be.teardown();
|
|
3733
3739
|
};
|
|
3734
|
-
}, [L.isControlled, L.connectionState, F]),
|
|
3740
|
+
}, [L.isControlled, L.connectionState, F]), I(() => {
|
|
3735
3741
|
const b = L.audioElement;
|
|
3736
|
-
b && (b.muted =
|
|
3737
|
-
}, [L.audioElement,
|
|
3742
|
+
b && (b.muted = re);
|
|
3743
|
+
}, [L.audioElement, re]);
|
|
3738
3744
|
const ir = C((b) => {
|
|
3739
3745
|
const d = { type: "user_message", text: b };
|
|
3740
3746
|
if (F != null && F.publishData) {
|
|
@@ -3747,132 +3753,132 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3747
3753
|
const ie = L.getRoom();
|
|
3748
3754
|
if (ie)
|
|
3749
3755
|
try {
|
|
3750
|
-
const
|
|
3751
|
-
ie.localParticipant.publishData(
|
|
3756
|
+
const ce = new TextEncoder().encode(JSON.stringify(d));
|
|
3757
|
+
ie.localParticipant.publishData(ce, { reliable: !0 });
|
|
3752
3758
|
} catch {
|
|
3753
3759
|
}
|
|
3754
3760
|
}, [L, F]), or = C(() => {
|
|
3755
3761
|
rr((b) => !b);
|
|
3756
3762
|
}, []);
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
}, [L.connectionState, Ue,
|
|
3760
|
-
|
|
3761
|
-
}, [L.transcript,
|
|
3762
|
-
|
|
3763
|
-
}, [L.agentState,
|
|
3764
|
-
|
|
3765
|
-
}, [L.agentState,
|
|
3766
|
-
const
|
|
3767
|
-
|
|
3768
|
-
!m ||
|
|
3769
|
-
}, [m, L.connectionState, L,
|
|
3763
|
+
I(() => {
|
|
3764
|
+
$e == null || $e(L.connectionState), L.connectionState === "connected" ? Ue == null || Ue() : L.connectionState === "disconnected" && (De == null || De());
|
|
3765
|
+
}, [L.connectionState, Ue, De, $e]), I(() => {
|
|
3766
|
+
Pe == null || Pe(L.transcript);
|
|
3767
|
+
}, [L.transcript, Pe]), I(() => {
|
|
3768
|
+
ze == null || ze(L.agentState);
|
|
3769
|
+
}, [L.agentState, ze]), I(() => {
|
|
3770
|
+
Et.setThinking(L.agentState === "thinking");
|
|
3771
|
+
}, [L.agentState, Et]);
|
|
3772
|
+
const cn = T(!1);
|
|
3773
|
+
I(() => {
|
|
3774
|
+
!m || cn.current || st && L.connectionState === "idle" && (cn.current = !0, L.connect());
|
|
3775
|
+
}, [m, L.connectionState, L, st]);
|
|
3770
3776
|
const lr = C(
|
|
3771
3777
|
(b) => {
|
|
3772
3778
|
const d = v == null ? void 0 : v.find((ie) => ie.id === b);
|
|
3773
|
-
d && (
|
|
3779
|
+
d && (dt(!1), b !== Ae && (ut(!0), L.disconnect(), Me || xt(b), y == null || y(d)));
|
|
3774
3780
|
},
|
|
3775
3781
|
[
|
|
3776
3782
|
v,
|
|
3777
|
-
Be,
|
|
3778
|
-
L,
|
|
3779
3783
|
Ae,
|
|
3780
|
-
|
|
3784
|
+
L,
|
|
3785
|
+
Me,
|
|
3786
|
+
y
|
|
3781
3787
|
]
|
|
3782
3788
|
);
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
}, [L.connectionState,
|
|
3786
|
-
if (!
|
|
3789
|
+
I(() => {
|
|
3790
|
+
Se && L.connectionState === "connected" && ut(!1);
|
|
3791
|
+
}, [L.connectionState, Se]), I(() => {
|
|
3792
|
+
if (!Ke) return;
|
|
3787
3793
|
const b = (d) => {
|
|
3788
|
-
d.key === "Escape" &&
|
|
3794
|
+
d.key === "Escape" && dt(!1);
|
|
3789
3795
|
};
|
|
3790
3796
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3791
|
-
}, [
|
|
3792
|
-
const ar = !!K || !!(
|
|
3793
|
-
qe === void 0 && ((
|
|
3794
|
-
const
|
|
3795
|
-
() =>
|
|
3796
|
-
[
|
|
3797
|
-
),
|
|
3798
|
-
L.disconnect(),
|
|
3799
|
-
}, [L,
|
|
3797
|
+
}, [Ke]);
|
|
3798
|
+
const ar = !!K || !!(de != null && de.avatarImageUrl) || L.isControlled, pt = Pr(ct, o, ar);
|
|
3799
|
+
qe === void 0 && ((pn = pt.info) != null && pn.capabilities) && (qt.current = pt.info.capabilities);
|
|
3800
|
+
const Mt = (de == null ? void 0 : de.name) ?? le ?? ((hn = L.agentConfig) == null ? void 0 : hn.name) ?? ((mn = pt.info) == null ? void 0 : mn.name) ?? "Live Layer", Ut = (de == null ? void 0 : de.avatarImageUrl) ?? K ?? ((gn = L.agentConfig) == null ? void 0 : gn.avatarImageUrl) ?? ((yn = pt.info) == null ? void 0 : yn.avatarImageUrl) ?? null, sr = z ?? ((vn = L.agentConfig) == null ? void 0 : vn.idleLoopUrl) ?? ((bn = pt.info) == null ? void 0 : bn.idleLoopUrl) ?? null, cr = B ?? null, ur = C(() => ye("expanded"), [ye]), dr = C(
|
|
3801
|
+
() => ye("minimized"),
|
|
3802
|
+
[ye]
|
|
3803
|
+
), un = C(() => {
|
|
3804
|
+
L.disconnect(), ye("hidden");
|
|
3805
|
+
}, [L, ye]), fr = C(() => {
|
|
3800
3806
|
const b = L.audioElement;
|
|
3801
|
-
b && b.play().then(() =>
|
|
3807
|
+
b && b.play().then(() => ke(!1)).catch(() => {
|
|
3802
3808
|
});
|
|
3803
3809
|
}, [L.audioElement]), pr = C(() => {
|
|
3804
|
-
|
|
3805
|
-
}, [L]),
|
|
3810
|
+
ke(!1), L.connect();
|
|
3811
|
+
}, [L]), Ze = {
|
|
3806
3812
|
...Ve,
|
|
3807
|
-
...
|
|
3813
|
+
...fe ? {} : { zIndex: xe }
|
|
3808
3814
|
};
|
|
3809
|
-
H.primaryColor && (
|
|
3815
|
+
H.primaryColor && (Ze["--ll-color-primary"] = H.primaryColor), H.accentColor && (Ze["--ll-color-accent"] = H.accentColor), H.backgroundColor && (Ze["--ll-color-bg"] = H.backgroundColor), H.textColor && (Ze["--ll-color-fg"] = H.textColor);
|
|
3810
3816
|
const hr = {
|
|
3811
|
-
...
|
|
3812
|
-
...
|
|
3817
|
+
...Ze,
|
|
3818
|
+
...Ie.style
|
|
3813
3819
|
}, mr = [
|
|
3814
3820
|
"ll-widget",
|
|
3815
|
-
`ll-widget--${
|
|
3816
|
-
`ll-widget--${
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
+
`ll-widget--${pe}`,
|
|
3822
|
+
`ll-widget--${ge ? "mobile" : "desktop"}`,
|
|
3823
|
+
Ie.hasGeometry ? "ll-widget--has-geometry" : null,
|
|
3824
|
+
Ie.isDragging ? "is-dragging" : null,
|
|
3825
|
+
Ie.isResizing ? "is-resizing" : null,
|
|
3826
|
+
Fe
|
|
3821
3827
|
].filter(Boolean).join(" ");
|
|
3822
|
-
if (!
|
|
3828
|
+
if (!st) return null;
|
|
3823
3829
|
const gr = /* @__PURE__ */ r(
|
|
3824
3830
|
"div",
|
|
3825
3831
|
{
|
|
3826
3832
|
className: mr,
|
|
3827
3833
|
style: hr,
|
|
3828
|
-
"data-display-mode":
|
|
3829
|
-
"data-position":
|
|
3834
|
+
"data-display-mode": pe,
|
|
3835
|
+
"data-position": _,
|
|
3830
3836
|
"data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
|
|
3831
|
-
children:
|
|
3837
|
+
children: pe === "expanded" && /* @__PURE__ */ r(
|
|
3832
3838
|
xi,
|
|
3833
3839
|
{
|
|
3834
|
-
position:
|
|
3835
|
-
isMobile:
|
|
3836
|
-
agentName:
|
|
3837
|
-
avatarImageUrl:
|
|
3840
|
+
position: _,
|
|
3841
|
+
isMobile: ge,
|
|
3842
|
+
agentName: Mt,
|
|
3843
|
+
avatarImageUrl: Ut,
|
|
3838
3844
|
idleLoopUrl: sr,
|
|
3839
3845
|
greeting: cr,
|
|
3840
3846
|
branding: H,
|
|
3841
3847
|
teamMembers: v,
|
|
3842
|
-
currentTeamMemberId:
|
|
3843
|
-
isSwitchingTeamMember:
|
|
3844
|
-
teamSwitcherOpen:
|
|
3845
|
-
onToggleTeamSwitcher: () =>
|
|
3848
|
+
currentTeamMemberId: Ae,
|
|
3849
|
+
isSwitchingTeamMember: Se,
|
|
3850
|
+
teamSwitcherOpen: Ke,
|
|
3851
|
+
onToggleTeamSwitcher: () => dt((b) => !b),
|
|
3846
3852
|
onSelectTeamMember: lr,
|
|
3847
3853
|
connectionState: L.connectionState,
|
|
3848
3854
|
agentState: L.agentState,
|
|
3849
3855
|
transcript: L.transcript,
|
|
3850
3856
|
isMuted: ve.isMuted,
|
|
3851
|
-
micDevices:
|
|
3857
|
+
micDevices: Xe.mics,
|
|
3852
3858
|
activeMicId: ve.activeDeviceId,
|
|
3853
|
-
isCameraEnabled:
|
|
3854
|
-
cameraPreviewEl:
|
|
3855
|
-
cameraDevices:
|
|
3856
|
-
activeCameraId:
|
|
3857
|
-
isScreenShareEnabled:
|
|
3858
|
-
screenPreviewEl:
|
|
3859
|
-
isSpeakerMuted:
|
|
3859
|
+
isCameraEnabled: Ce.isEnabled,
|
|
3860
|
+
cameraPreviewEl: Ce.previewEl,
|
|
3861
|
+
cameraDevices: Xe.cameras,
|
|
3862
|
+
activeCameraId: Ce.activeDeviceId,
|
|
3863
|
+
isScreenShareEnabled: Be.isEnabled,
|
|
3864
|
+
screenPreviewEl: Be.previewEl,
|
|
3865
|
+
isSpeakerMuted: re,
|
|
3860
3866
|
allowCamera: G,
|
|
3861
3867
|
allowScreenShare: f,
|
|
3862
3868
|
allowTyping: A,
|
|
3863
|
-
showMinimize:
|
|
3864
|
-
showClose:
|
|
3869
|
+
showMinimize: ge && !fe ? !1 : Ge,
|
|
3870
|
+
showClose: Ct,
|
|
3865
3871
|
chromeless: ee,
|
|
3866
|
-
compactControls:
|
|
3872
|
+
compactControls: kt,
|
|
3867
3873
|
transforming: oe,
|
|
3868
3874
|
transformingLabel: U,
|
|
3869
|
-
languageMenuOpen:
|
|
3870
|
-
onToggleLanguageMenu: () =>
|
|
3871
|
-
needsUserGesture:
|
|
3875
|
+
languageMenuOpen: St,
|
|
3876
|
+
onToggleLanguageMenu: () => x((b) => !b),
|
|
3877
|
+
needsUserGesture: Ht,
|
|
3872
3878
|
canResume: L.canResume,
|
|
3873
3879
|
micError: ve.micError,
|
|
3874
3880
|
error: L.error,
|
|
3875
|
-
avatarVideoContainerRef:
|
|
3881
|
+
avatarVideoContainerRef: sn,
|
|
3876
3882
|
agentVideoEl: L.videoElement,
|
|
3877
3883
|
onConnect: () => void L.connect(),
|
|
3878
3884
|
onDisconnect: () => L.disconnect(),
|
|
@@ -3880,73 +3886,73 @@ const ho = /* @__PURE__ */ new Set([
|
|
|
3880
3886
|
onResumeAudio: fr,
|
|
3881
3887
|
onToggleMute: ve.toggleMute,
|
|
3882
3888
|
onSwitchMicDevice: (b) => void ve.switchDevice(b),
|
|
3883
|
-
onToggleCamera: () => void
|
|
3884
|
-
onSwitchCameraDevice: (b) => void
|
|
3885
|
-
onToggleScreenShare: () => void
|
|
3889
|
+
onToggleCamera: () => void Ce.toggle(),
|
|
3890
|
+
onSwitchCameraDevice: (b) => void Ce.switchDevice(b),
|
|
3891
|
+
onToggleScreenShare: () => void Be.toggle(),
|
|
3886
3892
|
onToggleSpeaker: or,
|
|
3887
3893
|
onSendMessage: ir,
|
|
3888
3894
|
onMinimize: dr,
|
|
3889
|
-
onClose:
|
|
3895
|
+
onClose: un,
|
|
3890
3896
|
onClearMicError: ve.clearError,
|
|
3891
|
-
dragHandleProps:
|
|
3892
|
-
resizeHandleProps:
|
|
3897
|
+
dragHandleProps: Ie.dragHandleProps,
|
|
3898
|
+
resizeHandleProps: Ie.resizeHandleProps
|
|
3893
3899
|
}
|
|
3894
3900
|
)
|
|
3895
3901
|
}
|
|
3896
|
-
),
|
|
3902
|
+
), dn = !fe && (pe === "hidden" || pe === "minimized") ? /* @__PURE__ */ S(
|
|
3897
3903
|
"div",
|
|
3898
3904
|
{
|
|
3899
3905
|
className: [
|
|
3900
3906
|
"ll-widget",
|
|
3901
3907
|
"ll-widget--floating",
|
|
3902
|
-
`ll-widget--${
|
|
3903
|
-
`ll-widget--${
|
|
3908
|
+
`ll-widget--${pe}`,
|
|
3909
|
+
`ll-widget--${ge ? "mobile" : "desktop"}`
|
|
3904
3910
|
].join(" "),
|
|
3905
|
-
style:
|
|
3906
|
-
"data-display-mode":
|
|
3907
|
-
"data-position":
|
|
3911
|
+
style: Ze,
|
|
3912
|
+
"data-display-mode": pe,
|
|
3913
|
+
"data-position": _,
|
|
3908
3914
|
children: [
|
|
3909
|
-
|
|
3915
|
+
pe === "hidden" && /* @__PURE__ */ r(
|
|
3910
3916
|
di,
|
|
3911
3917
|
{
|
|
3912
|
-
position:
|
|
3913
|
-
isMobile:
|
|
3918
|
+
position: _,
|
|
3919
|
+
isMobile: ge,
|
|
3914
3920
|
isSpeaking: L.agentState === "speaking",
|
|
3915
|
-
onExpand: () =>
|
|
3916
|
-
label: `Open ${
|
|
3917
|
-
avatarImageUrl:
|
|
3918
|
-
agentName:
|
|
3921
|
+
onExpand: () => ye("expanded"),
|
|
3922
|
+
label: `Open ${Mt} widget`,
|
|
3923
|
+
avatarImageUrl: Ut,
|
|
3924
|
+
agentName: Mt,
|
|
3919
3925
|
containerEl: V
|
|
3920
3926
|
}
|
|
3921
3927
|
),
|
|
3922
|
-
|
|
3928
|
+
pe === "minimized" && /* @__PURE__ */ r(
|
|
3923
3929
|
pi,
|
|
3924
3930
|
{
|
|
3925
|
-
position:
|
|
3926
|
-
isMobile:
|
|
3927
|
-
agentName:
|
|
3928
|
-
avatarImageUrl:
|
|
3931
|
+
position: _,
|
|
3932
|
+
isMobile: ge,
|
|
3933
|
+
agentName: Mt,
|
|
3934
|
+
avatarImageUrl: Ut,
|
|
3929
3935
|
agentState: L.agentState,
|
|
3930
3936
|
isMuted: ve.isMuted,
|
|
3931
|
-
audioLevel:
|
|
3937
|
+
audioLevel: Le,
|
|
3932
3938
|
onExpand: ur,
|
|
3933
3939
|
onToggleMute: ve.toggleMute,
|
|
3934
|
-
onClose:
|
|
3940
|
+
onClose: un
|
|
3935
3941
|
}
|
|
3936
3942
|
)
|
|
3937
3943
|
]
|
|
3938
3944
|
}
|
|
3939
|
-
) : null,
|
|
3940
|
-
return /* @__PURE__ */
|
|
3945
|
+
) : null, fn = V ?? (typeof document < "u" ? document.body : null);
|
|
3946
|
+
return /* @__PURE__ */ S(We, { children: [
|
|
3941
3947
|
gr,
|
|
3942
|
-
|
|
3948
|
+
dn && fn && en(dn, fn)
|
|
3943
3949
|
] });
|
|
3944
3950
|
}
|
|
3945
3951
|
);
|
|
3946
|
-
|
|
3947
|
-
const mo =
|
|
3952
|
+
nr.displayName = "AvatarWidgetInner";
|
|
3953
|
+
const mo = Qt(
|
|
3948
3954
|
function(t, n) {
|
|
3949
|
-
return /* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ r(
|
|
3955
|
+
return /* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ r(nr, { ...t, ref: n }) });
|
|
3950
3956
|
}
|
|
3951
3957
|
);
|
|
3952
3958
|
mo.displayName = "AvatarWidget";
|
|
@@ -3959,24 +3965,24 @@ const So = ({
|
|
|
3959
3965
|
className: o,
|
|
3960
3966
|
style: s
|
|
3961
3967
|
}) => {
|
|
3962
|
-
const a =
|
|
3968
|
+
const a = T(null), c = T(null), u = T(l);
|
|
3963
3969
|
u.current = l;
|
|
3964
3970
|
const m = C((p) => {
|
|
3965
3971
|
var D;
|
|
3966
3972
|
const h = p.detail;
|
|
3967
3973
|
(D = u.current) == null || D.call(u, h);
|
|
3968
3974
|
}, []);
|
|
3969
|
-
return
|
|
3975
|
+
return I(() => {
|
|
3970
3976
|
const p = a.current;
|
|
3971
3977
|
if (!p) return;
|
|
3972
3978
|
const h = document.createElement("livelayer-widget");
|
|
3973
3979
|
return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event", m), p.appendChild(h), c.current = h, () => {
|
|
3974
3980
|
h.removeEventListener("agent-event", m), p.removeChild(h), c.current = null;
|
|
3975
3981
|
};
|
|
3976
|
-
}, [e]),
|
|
3982
|
+
}, [e]), I(() => {
|
|
3977
3983
|
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
3978
3984
|
}, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
|
|
3979
|
-
}, Eo =
|
|
3985
|
+
}, Eo = Qt(
|
|
3980
3986
|
function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
|
|
3981
3987
|
return _r(
|
|
3982
3988
|
i,
|
|
@@ -3992,109 +3998,109 @@ const So = ({
|
|
|
3992
3998
|
}
|
|
3993
3999
|
);
|
|
3994
4000
|
function Ao(e = {}) {
|
|
3995
|
-
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, u] = M(null), m =
|
|
3996
|
-
|
|
4001
|
+
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, u] = M(null), m = T(t), p = T(n), h = T(i);
|
|
4002
|
+
I(() => {
|
|
3997
4003
|
m.current = t, p.current = n, h.current = i;
|
|
3998
4004
|
}, [t, n, i]);
|
|
3999
4005
|
const D = C(() => {
|
|
4000
4006
|
o({}), a(!1);
|
|
4001
4007
|
}, []);
|
|
4002
|
-
return
|
|
4008
|
+
return I(() => {
|
|
4003
4009
|
if (typeof window > "u") return;
|
|
4004
|
-
const
|
|
4005
|
-
var w,
|
|
4006
|
-
const
|
|
4007
|
-
if (
|
|
4008
|
-
if (
|
|
4009
|
-
if (h.current !== "all" &&
|
|
4010
|
+
const _ = (k) => {
|
|
4011
|
+
var w, R;
|
|
4012
|
+
const g = k.detail;
|
|
4013
|
+
if (g) {
|
|
4014
|
+
if (g.phase === "field") {
|
|
4015
|
+
if (h.current !== "all" && g.source !== h.current)
|
|
4010
4016
|
return;
|
|
4011
4017
|
a(!0), o(
|
|
4012
|
-
(
|
|
4018
|
+
(E) => E[g.fieldName] === g.value ? E : { ...E, [g.fieldName]: g.value }
|
|
4013
4019
|
);
|
|
4014
4020
|
try {
|
|
4015
|
-
(w = m.current) == null || w.call(m,
|
|
4016
|
-
} catch (
|
|
4017
|
-
console.warn("[LiveLayer] useCollect onFieldUpdate threw.",
|
|
4021
|
+
(w = m.current) == null || w.call(m, g);
|
|
4022
|
+
} catch (E) {
|
|
4023
|
+
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", E);
|
|
4018
4024
|
}
|
|
4019
4025
|
return;
|
|
4020
4026
|
}
|
|
4021
|
-
if (
|
|
4022
|
-
const
|
|
4023
|
-
if (h.current !== "all" &&
|
|
4027
|
+
if (g.phase === "complete") {
|
|
4028
|
+
const E = g.result;
|
|
4029
|
+
if (h.current !== "all" && E.source !== h.current)
|
|
4024
4030
|
return;
|
|
4025
|
-
u(
|
|
4031
|
+
u(E), a(!1);
|
|
4026
4032
|
try {
|
|
4027
|
-
(
|
|
4033
|
+
(R = p.current) == null || R.call(p, E);
|
|
4028
4034
|
} catch (v) {
|
|
4029
4035
|
console.warn("[LiveLayer] useCollect onComplete threw.", v);
|
|
4030
4036
|
}
|
|
4031
4037
|
}
|
|
4032
4038
|
}
|
|
4033
4039
|
};
|
|
4034
|
-
return document.addEventListener("ll-collected",
|
|
4040
|
+
return document.addEventListener("ll-collected", _), () => document.removeEventListener("ll-collected", _);
|
|
4035
4041
|
}, []), { fields: l, isCollecting: s, lastResult: c, reset: D };
|
|
4036
4042
|
}
|
|
4037
|
-
let
|
|
4043
|
+
let qn = 1;
|
|
4038
4044
|
function No({
|
|
4039
4045
|
onMount: e,
|
|
4040
4046
|
defaultOpen: t = !1,
|
|
4041
4047
|
storageKey: n = "ll-debug-open"
|
|
4042
4048
|
}) {
|
|
4043
|
-
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [u, m] = M(!1), p =
|
|
4044
|
-
D.current = u,
|
|
4049
|
+
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [u, m] = M(!1), p = T(/* @__PURE__ */ new Set()), h = T([]), D = T(u);
|
|
4050
|
+
D.current = u, I(() => {
|
|
4045
4051
|
try {
|
|
4046
|
-
const
|
|
4047
|
-
|
|
4052
|
+
const g = localStorage.getItem(n);
|
|
4053
|
+
g === "1" && l(!0), g === "0" && l(!1);
|
|
4048
4054
|
} catch {
|
|
4049
4055
|
}
|
|
4050
|
-
}, [n]),
|
|
4056
|
+
}, [n]), I(() => {
|
|
4051
4057
|
try {
|
|
4052
4058
|
localStorage.setItem(n, i ? "1" : "0");
|
|
4053
4059
|
} catch {
|
|
4054
4060
|
}
|
|
4055
|
-
}, [i, n]),
|
|
4056
|
-
const
|
|
4057
|
-
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((
|
|
4061
|
+
}, [i, n]), I(() => {
|
|
4062
|
+
const g = (w) => {
|
|
4063
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((R) => !R));
|
|
4058
4064
|
};
|
|
4059
|
-
return window.addEventListener("keydown",
|
|
4060
|
-
}, []),
|
|
4061
|
-
const
|
|
4065
|
+
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
4066
|
+
}, []), I(() => {
|
|
4067
|
+
const g = setInterval(() => {
|
|
4062
4068
|
if (h.current.length === 0 || D.current) return;
|
|
4063
4069
|
const w = h.current.splice(0, h.current.length);
|
|
4064
4070
|
s(
|
|
4065
|
-
(
|
|
4071
|
+
(R) => [...w.reverse(), ...R].slice(0, 200)
|
|
4066
4072
|
);
|
|
4067
4073
|
}, 100);
|
|
4068
|
-
return () => clearInterval(
|
|
4074
|
+
return () => clearInterval(g);
|
|
4069
4075
|
}, []);
|
|
4070
|
-
const
|
|
4071
|
-
if (
|
|
4072
|
-
!e ||
|
|
4076
|
+
const _ = T(!1);
|
|
4077
|
+
if (I(() => {
|
|
4078
|
+
!e || _.current || (_.current = !0, e((g) => {
|
|
4073
4079
|
h.current.push({
|
|
4074
|
-
id:
|
|
4080
|
+
id: qn++,
|
|
4075
4081
|
ts: Date.now(),
|
|
4076
4082
|
kind: "event",
|
|
4077
|
-
type:
|
|
4078
|
-
data:
|
|
4083
|
+
type: g.eventName,
|
|
4084
|
+
data: g.data
|
|
4079
4085
|
});
|
|
4080
4086
|
}));
|
|
4081
|
-
}, [e]),
|
|
4082
|
-
const
|
|
4087
|
+
}, [e]), I(() => {
|
|
4088
|
+
const g = console.warn, w = console.log, R = (E, v) => function(...O) {
|
|
4083
4089
|
try {
|
|
4084
|
-
const
|
|
4085
|
-
|
|
4086
|
-
id:
|
|
4090
|
+
const y = typeof O[0] == "string" ? O[0] : "";
|
|
4091
|
+
y.startsWith("[LiveLayer]") && h.current.push({
|
|
4092
|
+
id: qn++,
|
|
4087
4093
|
ts: Date.now(),
|
|
4088
|
-
kind:
|
|
4089
|
-
type:
|
|
4094
|
+
kind: E,
|
|
4095
|
+
type: y.slice(0, 120),
|
|
4090
4096
|
data: { args: O.slice(1).map((z) => yo(z)) }
|
|
4091
4097
|
});
|
|
4092
4098
|
} catch {
|
|
4093
4099
|
}
|
|
4094
4100
|
return v.apply(this, O);
|
|
4095
4101
|
};
|
|
4096
|
-
return console.warn =
|
|
4097
|
-
console.warn =
|
|
4102
|
+
return console.warn = R("warn", g), console.log = R("log", w), () => {
|
|
4103
|
+
console.warn = g, console.log = w;
|
|
4098
4104
|
};
|
|
4099
4105
|
}, []), !i)
|
|
4100
4106
|
return /* @__PURE__ */ r(
|
|
@@ -4123,12 +4129,12 @@ function No({
|
|
|
4123
4129
|
children: "🛰 LL debug"
|
|
4124
4130
|
}
|
|
4125
4131
|
);
|
|
4126
|
-
const
|
|
4132
|
+
const k = o.filter((g) => {
|
|
4127
4133
|
if (!a) return !0;
|
|
4128
4134
|
const w = a.toLowerCase();
|
|
4129
|
-
return
|
|
4135
|
+
return g.type.toLowerCase().includes(w) || JSON.stringify(g.data || {}).toLowerCase().includes(w);
|
|
4130
4136
|
});
|
|
4131
|
-
return /* @__PURE__ */
|
|
4137
|
+
return /* @__PURE__ */ S(
|
|
4132
4138
|
"div",
|
|
4133
4139
|
{
|
|
4134
4140
|
style: {
|
|
@@ -4150,7 +4156,7 @@ function No({
|
|
|
4150
4156
|
overflow: "hidden"
|
|
4151
4157
|
},
|
|
4152
4158
|
children: [
|
|
4153
|
-
/* @__PURE__ */
|
|
4159
|
+
/* @__PURE__ */ S(
|
|
4154
4160
|
"div",
|
|
4155
4161
|
{
|
|
4156
4162
|
style: {
|
|
@@ -4163,7 +4169,7 @@ function No({
|
|
|
4163
4169
|
},
|
|
4164
4170
|
children: [
|
|
4165
4171
|
/* @__PURE__ */ r("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
4166
|
-
/* @__PURE__ */
|
|
4172
|
+
/* @__PURE__ */ S("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
4167
4173
|
o.length,
|
|
4168
4174
|
" event",
|
|
4169
4175
|
o.length === 1 ? "" : "s"
|
|
@@ -4173,8 +4179,8 @@ function No({
|
|
|
4173
4179
|
"button",
|
|
4174
4180
|
{
|
|
4175
4181
|
type: "button",
|
|
4176
|
-
onClick: () => m((
|
|
4177
|
-
style:
|
|
4182
|
+
onClick: () => m((g) => !g),
|
|
4183
|
+
style: Kt(u ? "#f59e0b" : "transparent"),
|
|
4178
4184
|
title: "Pause / resume capture",
|
|
4179
4185
|
children: u ? "▶ resume" : "⏸ pause"
|
|
4180
4186
|
}
|
|
@@ -4186,7 +4192,7 @@ function No({
|
|
|
4186
4192
|
onClick: () => {
|
|
4187
4193
|
s([]), h.current = [];
|
|
4188
4194
|
},
|
|
4189
|
-
style:
|
|
4195
|
+
style: Kt("transparent"),
|
|
4190
4196
|
title: "Clear buffer",
|
|
4191
4197
|
children: "clear"
|
|
4192
4198
|
}
|
|
@@ -4196,7 +4202,7 @@ function No({
|
|
|
4196
4202
|
{
|
|
4197
4203
|
type: "button",
|
|
4198
4204
|
onClick: () => l(!1),
|
|
4199
|
-
style:
|
|
4205
|
+
style: Kt("transparent"),
|
|
4200
4206
|
"aria-label": "Close",
|
|
4201
4207
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
4202
4208
|
children: "✕"
|
|
@@ -4210,7 +4216,7 @@ function No({
|
|
|
4210
4216
|
{
|
|
4211
4217
|
type: "text",
|
|
4212
4218
|
value: a,
|
|
4213
|
-
onChange: (
|
|
4219
|
+
onChange: (g) => c(g.target.value),
|
|
4214
4220
|
placeholder: "filter by type or data…",
|
|
4215
4221
|
style: {
|
|
4216
4222
|
margin: 8,
|
|
@@ -4232,7 +4238,7 @@ function No({
|
|
|
4232
4238
|
overflowY: "auto",
|
|
4233
4239
|
padding: "0 8px 8px"
|
|
4234
4240
|
},
|
|
4235
|
-
children:
|
|
4241
|
+
children: k.length === 0 ? /* @__PURE__ */ S(
|
|
4236
4242
|
"div",
|
|
4237
4243
|
{
|
|
4238
4244
|
style: {
|
|
@@ -4262,16 +4268,16 @@ function No({
|
|
|
4262
4268
|
)
|
|
4263
4269
|
]
|
|
4264
4270
|
}
|
|
4265
|
-
) :
|
|
4271
|
+
) : k.map((g) => /* @__PURE__ */ r(
|
|
4266
4272
|
go,
|
|
4267
4273
|
{
|
|
4268
|
-
entry:
|
|
4269
|
-
expanded: p.current.has(
|
|
4274
|
+
entry: g,
|
|
4275
|
+
expanded: p.current.has(g.id),
|
|
4270
4276
|
onToggle: () => {
|
|
4271
|
-
p.current.has(
|
|
4277
|
+
p.current.has(g.id) ? p.current.delete(g.id) : p.current.add(g.id), s((w) => [...w]);
|
|
4272
4278
|
}
|
|
4273
4279
|
},
|
|
4274
|
-
|
|
4280
|
+
g.id
|
|
4275
4281
|
))
|
|
4276
4282
|
}
|
|
4277
4283
|
)
|
|
@@ -4287,7 +4293,7 @@ function go({
|
|
|
4287
4293
|
const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", l = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
4288
4294
|
hour12: !1
|
|
4289
4295
|
});
|
|
4290
|
-
return /* @__PURE__ */
|
|
4296
|
+
return /* @__PURE__ */ S(
|
|
4291
4297
|
"button",
|
|
4292
4298
|
{
|
|
4293
4299
|
type: "button",
|
|
@@ -4305,7 +4311,7 @@ function go({
|
|
|
4305
4311
|
lineHeight: 1.4
|
|
4306
4312
|
},
|
|
4307
4313
|
children: [
|
|
4308
|
-
/* @__PURE__ */
|
|
4314
|
+
/* @__PURE__ */ S("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
4309
4315
|
/* @__PURE__ */ r(
|
|
4310
4316
|
"span",
|
|
4311
4317
|
{
|
|
@@ -4349,7 +4355,7 @@ function go({
|
|
|
4349
4355
|
}
|
|
4350
4356
|
);
|
|
4351
4357
|
}
|
|
4352
|
-
function
|
|
4358
|
+
function Kt(e) {
|
|
4353
4359
|
return {
|
|
4354
4360
|
background: e,
|
|
4355
4361
|
color: "#fff",
|
|
@@ -4369,7 +4375,7 @@ function yo(e) {
|
|
|
4369
4375
|
}
|
|
4370
4376
|
function vo(e) {
|
|
4371
4377
|
const t = JSON.stringify(e);
|
|
4372
|
-
|
|
4378
|
+
I(() => Lr(e), [t]);
|
|
4373
4379
|
}
|
|
4374
4380
|
function Mo({ fields: e, children: t }) {
|
|
4375
4381
|
return vo(e), /* @__PURE__ */ r(We, { children: t });
|
|
@@ -4404,8 +4410,8 @@ export {
|
|
|
4404
4410
|
eo as clearRoutesCache,
|
|
4405
4411
|
Vi as extractPageContext,
|
|
4406
4412
|
Zi as extractRoutes,
|
|
4407
|
-
|
|
4408
|
-
|
|
4413
|
+
On as getCachedPageContext,
|
|
4414
|
+
Gt as getCachedRoutes,
|
|
4409
4415
|
Po as getRegisteredFields,
|
|
4410
4416
|
ti as matchesPattern,
|
|
4411
4417
|
Ki as normalizeRouteInput,
|