@flowengage/react-chatbot 8.0.109 → 8.0.110
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.
|
@@ -42,35 +42,35 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
|
|
|
42
42
|
if (j) try {
|
|
43
43
|
window.localStorage.removeItem(A.chatId);
|
|
44
44
|
} catch {}
|
|
45
|
-
},
|
|
45
|
+
}, ae = () => j ? typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}` : "server-chat-id", N = (e) => e ? `flowengage.entrySeen.${e}` : null, oe = (e) => {
|
|
46
46
|
if (!j || !e) return !1;
|
|
47
47
|
try {
|
|
48
|
-
let t =
|
|
48
|
+
let t = N(e);
|
|
49
49
|
return t ? window.localStorage.getItem(t) === "1" : !1;
|
|
50
50
|
} catch {
|
|
51
51
|
return !1;
|
|
52
52
|
}
|
|
53
|
-
},
|
|
53
|
+
}, se = (e) => {
|
|
54
54
|
if (!(!j || !e)) try {
|
|
55
|
-
let t =
|
|
55
|
+
let t = N(e);
|
|
56
56
|
t && window.localStorage.setItem(t, "1");
|
|
57
57
|
} catch {}
|
|
58
|
-
},
|
|
58
|
+
}, P = (e) => e ? `flowengage.persistedChatId.${e}` : null, ce = (e) => {
|
|
59
59
|
if (!j || !e) return null;
|
|
60
60
|
try {
|
|
61
|
-
let t =
|
|
61
|
+
let t = P(e), n = t ? window.localStorage.getItem(t) : null;
|
|
62
62
|
return n && String(n).trim() ? String(n).trim() : null;
|
|
63
63
|
} catch {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
66
|
}, le = (e) => {
|
|
67
67
|
if (!(!j || !e)) try {
|
|
68
|
-
let t =
|
|
68
|
+
let t = P(e);
|
|
69
69
|
t && window.localStorage.removeItem(t);
|
|
70
70
|
} catch {}
|
|
71
71
|
}, ue = (e, t) => {
|
|
72
72
|
if (!(!j || !e || !t)) try {
|
|
73
|
-
let n =
|
|
73
|
+
let n = P(e);
|
|
74
74
|
n && window.localStorage.setItem(n, String(t).trim());
|
|
75
75
|
} catch {}
|
|
76
76
|
}, de = () => j ? {
|
|
@@ -3296,7 +3296,7 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3296
3296
|
message: "Looks like you're already on this page!",
|
|
3297
3297
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3298
3298
|
}]);
|
|
3299
|
-
}, []), [D, O] = m(de().isOpen), [k, A] = m(de().activeScreen), [j, M] = m(de().isHumanHandled), [
|
|
3299
|
+
}, []), [D, O] = m(de().isOpen), [k, A] = m(de().activeScreen), [j, M] = m(de().isHumanHandled), [N, oe] = m(de().agentName), [se, P] = m(de().agentHeadshot), [he, ge] = m(() => pe(i?.siteId)), [F, ve] = m(!1), [ye, I] = m(!1), [be, L] = m("idle"), [xe, Se] = m(!1), [R, we] = m(!1), [Te, Ee] = m(""), [De, Oe] = m(!1), [ke, Ae] = m(0), [je, Me] = m(0), [z, B] = m(!1), [V, Ie] = m(null), [Le, Re] = m(null), [ze, Be] = m("idle"), [Ve, He] = m(null), [Ue, We] = m(!1), [Ge, Ke] = m(""), [qe, Je] = m(!1), H = p(null), U = p(null), Ye = p(""), Xe = p(!1), Ze = p(null), Qe = p(null), W = p(null), $e = p(null), et = p(null), tt = p(null), nt = p(null), G = p(!1), rt = p({
|
|
3300
3300
|
url: null,
|
|
3301
3301
|
at: 0
|
|
3302
3302
|
}), it = o((e, t) => {
|
|
@@ -3313,12 +3313,12 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3313
3313
|
url: n,
|
|
3314
3314
|
at: Date.now()
|
|
3315
3315
|
}, wr(e, t));
|
|
3316
|
-
}, []), at = p([]), ot = p(null), st = p(null), ct = p(null), lt = p(!1), ut = p(!1), dt = p(""), ft = p(null), pt = p(null), mt = p([]), ht = p(0), gt = p(
|
|
3316
|
+
}, []), at = p([]), ot = p(null), st = p(null), ct = p(null), lt = p(!1), ut = p(!1), dt = p(""), ft = p(null), pt = p(null), mt = p([]), ht = p(0), gt = p(N), _t = p([]), vt = p(!1), yt = p(!1), bt = p(i), xt = p({
|
|
3317
3317
|
notifyRouteChange: () => {},
|
|
3318
3318
|
cleanup: () => {}
|
|
3319
3319
|
}), St = o((e = {}) => {
|
|
3320
3320
|
let t = !!e.is_human_handled;
|
|
3321
|
-
return M(t), t ? (A("agent"), e.agent_info?.name &&
|
|
3321
|
+
return M(t), t ? (A("agent"), e.agent_info?.name && oe(e.agent_info.name), e.agent_info?.headshot && P(e.agent_info.headshot), t) : (A("ai"), t);
|
|
3322
3322
|
}, []), Ct = f(() => {
|
|
3323
3323
|
let e = _?.widgetSettings?.call?.maxDurationSeconds ?? i?.widgetSettings?.call?.maxDurationSeconds ?? i?.callMaxDurationSeconds, t = Number(e);
|
|
3324
3324
|
return Number.isFinite(t) && t > 0 ? t : te;
|
|
@@ -3326,8 +3326,8 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3326
3326
|
c(() => {
|
|
3327
3327
|
Qe.current = V;
|
|
3328
3328
|
}, [V]), c(() => {
|
|
3329
|
-
gt.current =
|
|
3330
|
-
}, [
|
|
3329
|
+
gt.current = N;
|
|
3330
|
+
}, [N]), c(() => {
|
|
3331
3331
|
yt.current = De;
|
|
3332
3332
|
}, [De]), c(() => {
|
|
3333
3333
|
bt.current = i;
|
|
@@ -3482,15 +3482,15 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3482
3482
|
isOpen: D,
|
|
3483
3483
|
activeScreen: k,
|
|
3484
3484
|
isHumanHandled: j,
|
|
3485
|
-
agentName:
|
|
3486
|
-
agentHeadshot:
|
|
3485
|
+
agentName: N,
|
|
3486
|
+
agentHeadshot: se
|
|
3487
3487
|
});
|
|
3488
3488
|
}, [
|
|
3489
3489
|
D,
|
|
3490
3490
|
k,
|
|
3491
3491
|
j,
|
|
3492
|
-
|
|
3493
|
-
|
|
3492
|
+
N,
|
|
3493
|
+
se
|
|
3494
3494
|
]), c(() => {
|
|
3495
3495
|
let e = !0;
|
|
3496
3496
|
return (async () => {
|
|
@@ -3512,7 +3512,7 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3512
3512
|
}))?.data?.chatId, !c) throw Error("resolve-session returned no chatId");
|
|
3513
3513
|
ie(), ue(a, c);
|
|
3514
3514
|
} catch (e) {
|
|
3515
|
-
console.warn("[FlowEngageProvider] resolve-session failed, reusing persisted or ephemeral chat id", e?.message || e), c = o ||
|
|
3515
|
+
console.warn("[FlowEngageProvider] resolve-session failed, reusing persisted or ephemeral chat id", e?.message || e), c = o || ae(), ue(a, c);
|
|
3516
3516
|
}
|
|
3517
3517
|
Ye.current = c;
|
|
3518
3518
|
let l = Fe({
|
|
@@ -3578,11 +3578,11 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3578
3578
|
...n,
|
|
3579
3579
|
isPending: !1,
|
|
3580
3580
|
id: n.messageId || `${n.sender}-${Date.now()}-${Math.random()}`
|
|
3581
|
-
}]), (n.sender === "agent" || n.agent_name) && (M(!0), A("agent"),
|
|
3581
|
+
}]), (n.sender === "agent" || n.agent_name) && (M(!0), A("agent"), oe(di([
|
|
3582
3582
|
n.agent_name,
|
|
3583
3583
|
n.agentName,
|
|
3584
3584
|
n.metadata?.agentName
|
|
3585
|
-
], d)), n.sender_headshot &&
|
|
3585
|
+
], d)), n.sender_headshot && P(n.sender_headshot), O(!0), Ae((e) => e + 1)));
|
|
3586
3586
|
});
|
|
3587
3587
|
let p = (e = {}) => {
|
|
3588
3588
|
let t = di([
|
|
@@ -3591,7 +3591,7 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3591
3591
|
e.agent_name,
|
|
3592
3592
|
gt.current
|
|
3593
3593
|
], d);
|
|
3594
|
-
M(!0), A("agent"),
|
|
3594
|
+
M(!0), A("agent"), oe(t), P(e.agent?.headshot || null), O(!0), Ae((e) => e + 1), S((e) => fi(e, {
|
|
3595
3595
|
id: `agent-joined-${Date.now()}`,
|
|
3596
3596
|
sender: "system",
|
|
3597
3597
|
message: `${t} has joined the chat.`,
|
|
@@ -3646,7 +3646,7 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3646
3646
|
from: e.from || "owner",
|
|
3647
3647
|
agentId: e.agentId || null,
|
|
3648
3648
|
agentName: t
|
|
3649
|
-
}),
|
|
3649
|
+
}), oe((e) => di([t, e], "Agent")), Be("incoming"), He(null), O(!0);
|
|
3650
3650
|
}), f.on("call:offer", async (e = {}) => {
|
|
3651
3651
|
tt.current = e;
|
|
3652
3652
|
try {
|
|
@@ -4197,9 +4197,9 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
4197
4197
|
}, []);
|
|
4198
4198
|
let Yt = o(() => {
|
|
4199
4199
|
let e = i?.siteId;
|
|
4200
|
-
le(e), Xe.current = !0, Ze.current = null, H.current?.disconnect(), S([]), b(""), Ye.current = "", B(!1), M(!1),
|
|
4200
|
+
le(e), Xe.current = !0, Ze.current = null, H.current?.disconnect(), S([]), b(""), Ye.current = "", B(!1), M(!1), oe(null), P(null), Je(!0), s((e) => e + 1);
|
|
4201
4201
|
}, [i?.siteId]), Xt = o((e) => {
|
|
4202
|
-
i?.siteId, Xe.current = !1, Ze.current = e, H.current?.disconnect(), S([]), b(""), Ye.current = "", B(!1), M(!1),
|
|
4202
|
+
i?.siteId, Xe.current = !1, Ze.current = e, H.current?.disconnect(), S([]), b(""), Ye.current = "", B(!1), M(!1), oe(null), P(null), Je(!0), s((e) => e + 1);
|
|
4203
4203
|
}, [i?.siteId]), Zt = f(() => ({
|
|
4204
4204
|
status: l,
|
|
4205
4205
|
error: d,
|
|
@@ -4210,8 +4210,8 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
4210
4210
|
isOpen: D,
|
|
4211
4211
|
activeScreen: k,
|
|
4212
4212
|
isHumanHandled: j,
|
|
4213
|
-
agentName:
|
|
4214
|
-
agentHeadshot:
|
|
4213
|
+
agentName: N,
|
|
4214
|
+
agentHeadshot: se,
|
|
4215
4215
|
visitorEmail: he,
|
|
4216
4216
|
isAgentTyping: F,
|
|
4217
4217
|
isAiTyping: ye,
|
|
@@ -4271,8 +4271,8 @@ function pi({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
4271
4271
|
D,
|
|
4272
4272
|
k,
|
|
4273
4273
|
j,
|
|
4274
|
-
|
|
4275
|
-
|
|
4274
|
+
N,
|
|
4275
|
+
se,
|
|
4276
4276
|
he,
|
|
4277
4277
|
F,
|
|
4278
4278
|
ye,
|
|
@@ -9228,13 +9228,13 @@ var Qm = {
|
|
|
9228
9228
|
...Qm,
|
|
9229
9229
|
...Lm,
|
|
9230
9230
|
...$m
|
|
9231
|
-
}, Xp), th = 24e3, nh = 2048, rh = 1200, ih = .
|
|
9232
|
-
function
|
|
9231
|
+
}, Xp), th = 24e3, nh = 2048, rh = 1200, ih = .03, ah = 2, oh = 11;
|
|
9232
|
+
function sh(e) {
|
|
9233
9233
|
let t = 0;
|
|
9234
9234
|
for (let n = 0; n < e.length; n++) t += e[n] * e[n];
|
|
9235
9235
|
return Math.sqrt(t / e.length);
|
|
9236
9236
|
}
|
|
9237
|
-
function
|
|
9237
|
+
function ch(e) {
|
|
9238
9238
|
let t = new Int16Array(e.length);
|
|
9239
9239
|
for (let n = 0; n < e.length; n++) {
|
|
9240
9240
|
let r = Math.max(-1, Math.min(1, e[n]));
|
|
@@ -9242,16 +9242,16 @@ function uh(e) {
|
|
|
9242
9242
|
}
|
|
9243
9243
|
return t;
|
|
9244
9244
|
}
|
|
9245
|
-
function
|
|
9245
|
+
function lh(e) {
|
|
9246
9246
|
let t = new Float32Array(e.length);
|
|
9247
9247
|
for (let n = 0; n < e.length; n++) t[n] = e[n] / 32768;
|
|
9248
9248
|
return t;
|
|
9249
9249
|
}
|
|
9250
|
-
var
|
|
9251
|
-
function
|
|
9252
|
-
return typeof window > "u" || window.MediaRecorder === void 0 ? null :
|
|
9250
|
+
var uh = .13, dh = ["audio/webm", "audio/mp4"];
|
|
9251
|
+
function fh() {
|
|
9252
|
+
return typeof window > "u" || window.MediaRecorder === void 0 ? null : dh.find((e) => window.MediaRecorder.isTypeSupported(e)) || null;
|
|
9253
9253
|
}
|
|
9254
|
-
function
|
|
9254
|
+
function ph(e, t, n, r, i) {
|
|
9255
9255
|
if (!r.length || !n || !e) return;
|
|
9256
9256
|
let a = new Blob(r, { type: i }), o = new FormData();
|
|
9257
9257
|
o.append("audio", a, `aichat-${n}.webm`), o.append("voiceSessionId", n), o.append("siteId", t || ""), fetch(`${e}/api/voice/upload-chat-recording`, {
|
|
@@ -9261,25 +9261,25 @@ function hh(e, t, n, r, i) {
|
|
|
9261
9261
|
if (!e.ok) throw Error(`HTTP ${e.status}`);
|
|
9262
9262
|
}).catch((e) => console.warn("[FlowEngage] voice recording upload failed:", e.message));
|
|
9263
9263
|
}
|
|
9264
|
-
var
|
|
9265
|
-
function
|
|
9264
|
+
var mh = .02;
|
|
9265
|
+
function hh(e, t, n) {
|
|
9266
9266
|
let r = 0, i = 0, a = [], o = () => {
|
|
9267
9267
|
let t = e.currentTime;
|
|
9268
9268
|
a.forEach(({ source: e, gain: n }) => {
|
|
9269
9269
|
try {
|
|
9270
|
-
n.gain.cancelScheduledValues(t), n.gain.setValueAtTime(n.gain.value, t), n.gain.linearRampToValueAtTime(0, t +
|
|
9270
|
+
n.gain.cancelScheduledValues(t), n.gain.setValueAtTime(n.gain.value, t), n.gain.linearRampToValueAtTime(0, t + mh), e.stop(t + mh);
|
|
9271
9271
|
} catch {}
|
|
9272
9272
|
}), a = [], r = 0, i = 0;
|
|
9273
9273
|
}, s = () => r > e.currentTime;
|
|
9274
9274
|
return {
|
|
9275
9275
|
enqueue: (o) => {
|
|
9276
|
-
let c =
|
|
9276
|
+
let c = lh(o), l = e.createBuffer(1, c.length, th);
|
|
9277
9277
|
l.copyToChannel(c, 0);
|
|
9278
9278
|
let u = e.createBufferSource();
|
|
9279
9279
|
u.buffer = l;
|
|
9280
9280
|
let d = e.createGain();
|
|
9281
9281
|
u.connect(d), d.connect(e.destination), n && d.connect(n);
|
|
9282
|
-
let f = s() ? r : e.currentTime +
|
|
9282
|
+
let f = s() ? r : e.currentTime + uh;
|
|
9283
9283
|
i ||= f, u.start(f), r = f + l.duration;
|
|
9284
9284
|
let p = {
|
|
9285
9285
|
source: u,
|
|
@@ -9294,7 +9294,7 @@ function _h(e, t, n) {
|
|
|
9294
9294
|
playedMs: () => Math.max(0, (e.currentTime - i) * 1e3)
|
|
9295
9295
|
};
|
|
9296
9296
|
}
|
|
9297
|
-
async function
|
|
9297
|
+
async function gh(e, t, n) {
|
|
9298
9298
|
let r = new URLSearchParams({ siteId: t || "" });
|
|
9299
9299
|
n && r.set("chatId", n);
|
|
9300
9300
|
let i = Fr();
|
|
@@ -9312,8 +9312,8 @@ async function vh(e, t, n) {
|
|
|
9312
9312
|
if (!o?.success || !o.wsUrl) throw Error(o?.error || "Voice session was refused.");
|
|
9313
9313
|
return o;
|
|
9314
9314
|
}
|
|
9315
|
-
async function
|
|
9316
|
-
let { apiBaseUrl: t, siteId: n, chatId: r, clientTools: i = {}, onConnect: a, onDisconnect: o, onMessage: s, onModeChange: c, onError: l, onUnhandledClientToolCall: u, onAgentTurnEnd: d, onSessionInfo: f, onSessionEnding: p } = e, m = await
|
|
9315
|
+
async function _h(e) {
|
|
9316
|
+
let { apiBaseUrl: t, siteId: n, chatId: r, clientTools: i = {}, onConnect: a, onDisconnect: o, onMessage: s, onModeChange: c, onError: l, onUnhandledClientToolCall: u, onAgentTurnEnd: d, onSessionInfo: f, onSessionEnding: p } = e, m = await gh(t, n, r);
|
|
9317
9317
|
f?.({ emailOnFile: !!m.emailOnFile });
|
|
9318
9318
|
let h = { type: "Start" };
|
|
9319
9319
|
e.greeting !== void 0 && (h.greeting = e.greeting || null);
|
|
@@ -9324,7 +9324,7 @@ async function yh(e) {
|
|
|
9324
9324
|
autoGainControl: !0
|
|
9325
9325
|
} }), _ = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: th });
|
|
9326
9326
|
_.state === "suspended" && await _.resume();
|
|
9327
|
-
let v = _.createMediaStreamDestination(), y =
|
|
9327
|
+
let v = _.createMediaStreamDestination(), y = fh(), b = [], x = null, S = r || n || null;
|
|
9328
9328
|
y && (x = new window.MediaRecorder(v.stream, { mimeType: y }), x.ondataavailable = (e) => {
|
|
9329
9329
|
e.data && e.data.size > 0 && b.push(e.data);
|
|
9330
9330
|
}, x.start());
|
|
@@ -9354,70 +9354,59 @@ async function yh(e) {
|
|
|
9354
9354
|
}
|
|
9355
9355
|
}, O = (e, t, n) => {
|
|
9356
9356
|
t && (T.role && T.role !== e && D(), T.role = e, T.text = T.text ? `${T.text} ${t}`.replace(/\s+/g, " ") : t, n && (T.debug = n), T.timer && clearTimeout(T.timer), T.timer = setTimeout(D, rh));
|
|
9357
|
-
}, k = !1, A = !1, ee = !1, te = !1, ne = !0, j =
|
|
9358
|
-
|
|
9357
|
+
}, k = !1, A = !1, ee = !1, te = !1, ne = !0, j = !1, M = null, re = !1, ie = !1, ae = () => {
|
|
9358
|
+
M && clearTimeout(M);
|
|
9359
9359
|
let e = () => {
|
|
9360
9360
|
if (!k) {
|
|
9361
|
-
if (
|
|
9362
|
-
|
|
9361
|
+
if (N.isPlaying()) {
|
|
9362
|
+
M = setTimeout(e, 150);
|
|
9363
9363
|
return;
|
|
9364
9364
|
}
|
|
9365
|
-
if (
|
|
9365
|
+
if (M = null, re) {
|
|
9366
9366
|
p?.();
|
|
9367
9367
|
return;
|
|
9368
9368
|
}
|
|
9369
|
-
!k && C.readyState === WebSocket.OPEN && C.send(JSON.stringify({ type: "PlaybackDrained" })),
|
|
9369
|
+
!k && C.readyState === WebSocket.OPEN && C.send(JSON.stringify({ type: "PlaybackDrained" })), ie && (ie = !1, d?.());
|
|
9370
9370
|
}
|
|
9371
9371
|
};
|
|
9372
|
-
|
|
9373
|
-
},
|
|
9372
|
+
M = setTimeout(e, 150);
|
|
9373
|
+
}, N = hh(_, () => {
|
|
9374
9374
|
te && (te = !1, c?.({ mode: "listening" }));
|
|
9375
9375
|
}, v);
|
|
9376
|
-
typeof window < "u" && (window.__fe_agentAudioPlaying = () =>
|
|
9377
|
-
let
|
|
9378
|
-
|
|
9379
|
-
let
|
|
9380
|
-
|
|
9376
|
+
typeof window < "u" && (window.__fe_agentAudioPlaying = () => N.isPlaying());
|
|
9377
|
+
let oe = _.createMediaStreamSource(g);
|
|
9378
|
+
oe.connect(v);
|
|
9379
|
+
let se = _.createScriptProcessor(nh, 1, 1), P = !1, ce = 0, le = 0;
|
|
9380
|
+
se.onaudioprocess = (e) => {
|
|
9381
9381
|
if (k || C.readyState !== WebSocket.OPEN) return;
|
|
9382
9382
|
let t = e.inputBuffer.getChannelData(0), n = () => C.send(new Int16Array(t.length).buffer);
|
|
9383
9383
|
if (A) {
|
|
9384
|
-
ee || (ee = !0, console.debug("[FlowEngage] mic held — streaming silence to keep socket alive")),
|
|
9384
|
+
ee || (ee = !0, console.debug("[FlowEngage] mic held — streaming silence to keep socket alive")), P = !1, ce = 0, le = 0, n();
|
|
9385
9385
|
return;
|
|
9386
9386
|
}
|
|
9387
|
-
let r =
|
|
9388
|
-
|
|
9387
|
+
let r = sh(t);
|
|
9388
|
+
N.isPlaying() || j ? (P = !1, ce = 0, le = 0) : r >= ih ? (le = 0, ce += 1, !P && ce >= ah && (P = !0, c?.({ mode: "user-speaking" }))) : (ce = 0, P && ++le >= oh && (P = !1, le = 0, c?.({
|
|
9389
9389
|
mode: "thinking",
|
|
9390
9390
|
tentative: !0
|
|
9391
|
-
}))),
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
M = !0, j = 0;
|
|
9395
|
-
let e = ce.playedMs();
|
|
9396
|
-
ce.stop(), ne = !1, re = !1, P && !ae && (clearTimeout(P), P = null), oe = !1, C.send(JSON.stringify({
|
|
9397
|
-
type: "VisitorInterrupted",
|
|
9398
|
-
played_ms: Math.round(e)
|
|
9399
|
-
})), console.debug("[FlowEngage] barge-in — visitor spoke over the agent");
|
|
9400
|
-
}
|
|
9401
|
-
}
|
|
9402
|
-
C.send(uh(t).buffer);
|
|
9403
|
-
}, le.connect(ue), ue.connect(_.destination);
|
|
9404
|
-
let me = () => {
|
|
9391
|
+
}))), C.send(ch(t).buffer);
|
|
9392
|
+
}, oe.connect(se), se.connect(_.destination);
|
|
9393
|
+
let ue = () => {
|
|
9405
9394
|
if (!k) {
|
|
9406
|
-
k = !0,
|
|
9395
|
+
k = !0, M &&= (clearTimeout(M), null), D(), N.stop(), typeof window < "u" && delete window.__fe_agentAudioPlaying;
|
|
9407
9396
|
try {
|
|
9408
|
-
|
|
9397
|
+
se.disconnect(), oe.disconnect();
|
|
9409
9398
|
} catch {}
|
|
9410
9399
|
if (g.getTracks().forEach((e) => e.stop()), x && x.state !== "inactive") {
|
|
9411
|
-
x.onstop = () =>
|
|
9400
|
+
x.onstop = () => ph(t, n, S, b, y);
|
|
9412
9401
|
try {
|
|
9413
9402
|
x.stop();
|
|
9414
9403
|
} catch {
|
|
9415
9404
|
x.onstop = null;
|
|
9416
9405
|
}
|
|
9417
|
-
} else b.length &&
|
|
9406
|
+
} else b.length && ph(t, n, S, b, y);
|
|
9418
9407
|
_.close().catch(() => {}), (C.readyState === WebSocket.OPEN || C.readyState === WebSocket.CONNECTING) && C.close();
|
|
9419
9408
|
}
|
|
9420
|
-
},
|
|
9409
|
+
}, de = async (e) => {
|
|
9421
9410
|
let t = i[e.name];
|
|
9422
9411
|
if (!t) return u?.({ tool_name: e.name }), { error: `Unknown tool ${e.name}` };
|
|
9423
9412
|
let n = {};
|
|
@@ -9429,10 +9418,10 @@ async function yh(e) {
|
|
|
9429
9418
|
} catch (e) {
|
|
9430
9419
|
return { error: e?.message || "Tool execution failed" };
|
|
9431
9420
|
}
|
|
9432
|
-
},
|
|
9421
|
+
}, fe = async (e) => {
|
|
9433
9422
|
for (let t of e.functions || []) {
|
|
9434
9423
|
if (!t.client_side) continue;
|
|
9435
|
-
let e = await
|
|
9424
|
+
let e = await de(t);
|
|
9436
9425
|
if (k || C.readyState !== WebSocket.OPEN) return;
|
|
9437
9426
|
C.send(JSON.stringify({
|
|
9438
9427
|
type: "FunctionCallResponse",
|
|
@@ -9441,10 +9430,10 @@ async function yh(e) {
|
|
|
9441
9430
|
content: typeof e == "string" ? e : JSON.stringify(e ?? {})
|
|
9442
9431
|
}));
|
|
9443
9432
|
}
|
|
9444
|
-
},
|
|
9433
|
+
}, pe = (e) => {
|
|
9445
9434
|
switch (e.type) {
|
|
9446
9435
|
case "Welcome":
|
|
9447
|
-
Number.isFinite(e.barge_in_rms) && e.barge_in_rms > 0 &&
|
|
9436
|
+
Number.isFinite(e.barge_in_rms) && e.barge_in_rms > 0 && e.barge_in_rms, Number.isFinite(e.barge_in_frames) && e.barge_in_frames > 0 && e.barge_in_frames, S = e.session_id || r || n || null, a?.({ conversationId: S });
|
|
9448
9437
|
break;
|
|
9449
9438
|
case "ConversationText": {
|
|
9450
9439
|
let t = String(e.content || "");
|
|
@@ -9463,25 +9452,25 @@ async function yh(e) {
|
|
|
9463
9452
|
break;
|
|
9464
9453
|
}
|
|
9465
9454
|
case "UserStartedSpeaking":
|
|
9466
|
-
D(),
|
|
9455
|
+
D(), N.stop(), j = !1, ne = !1, te = !1, M && !re && (clearTimeout(M), M = null), ie = !1, c?.({ mode: "listening" });
|
|
9467
9456
|
break;
|
|
9468
9457
|
case "AgentStartedSpeaking":
|
|
9469
|
-
ne = !0, te = !0,
|
|
9458
|
+
ne = !0, te = !0, c?.({ mode: "speaking" });
|
|
9470
9459
|
break;
|
|
9471
9460
|
case "AgentAudioDone":
|
|
9472
|
-
|
|
9461
|
+
j = !1, D(), ae(), N.isPlaying() || (te = !1, c?.({ mode: "listening" }));
|
|
9473
9462
|
break;
|
|
9474
9463
|
case "FunctionCallRequest":
|
|
9475
|
-
|
|
9464
|
+
fe(e);
|
|
9476
9465
|
break;
|
|
9477
9466
|
case "AgentPreparing":
|
|
9478
|
-
|
|
9467
|
+
j = !0;
|
|
9479
9468
|
break;
|
|
9480
9469
|
case "AgentTurnComplete":
|
|
9481
|
-
|
|
9470
|
+
ie = !0, ae();
|
|
9482
9471
|
break;
|
|
9483
9472
|
case "SessionEnding":
|
|
9484
|
-
console.debug("[FlowEngage] server is ending the session:", e.reason || "unspecified"),
|
|
9473
|
+
console.debug("[FlowEngage] server is ending the session:", e.reason || "unspecified"), re = !0;
|
|
9485
9474
|
break;
|
|
9486
9475
|
case "AgentThinking":
|
|
9487
9476
|
c?.({ mode: "thinking" });
|
|
@@ -9498,16 +9487,16 @@ async function yh(e) {
|
|
|
9498
9487
|
};
|
|
9499
9488
|
return C.onopen = () => C.send(JSON.stringify(h)), C.onmessage = (e) => {
|
|
9500
9489
|
if (e.data instanceof ArrayBuffer) {
|
|
9501
|
-
ne &&
|
|
9490
|
+
ne && N.enqueue(new Int16Array(e.data));
|
|
9502
9491
|
return;
|
|
9503
9492
|
}
|
|
9504
9493
|
try {
|
|
9505
|
-
|
|
9494
|
+
pe(JSON.parse(e.data));
|
|
9506
9495
|
} catch {}
|
|
9507
9496
|
}, C.onerror = () => l?.(/* @__PURE__ */ Error("Voice connection failed")), C.onclose = () => {
|
|
9508
|
-
|
|
9497
|
+
ue(), o?.();
|
|
9509
9498
|
}, {
|
|
9510
|
-
endSession: async () =>
|
|
9499
|
+
endSession: async () => ue(),
|
|
9511
9500
|
sendContextualUpdate: (e) => {
|
|
9512
9501
|
k || C.readyState !== WebSocket.OPEN || !e || C.send(JSON.stringify({
|
|
9513
9502
|
type: "UpdatePrompt",
|
|
@@ -9545,7 +9534,7 @@ async function yh(e) {
|
|
|
9545
9534
|
}
|
|
9546
9535
|
};
|
|
9547
9536
|
}
|
|
9548
|
-
var
|
|
9537
|
+
var vh = { startSession: _h }, yh = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9549
9538
|
width: e,
|
|
9550
9539
|
height: e,
|
|
9551
9540
|
viewBox: "0 0 24 24",
|
|
@@ -9561,7 +9550,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9561
9550
|
strokeLinecap: "round",
|
|
9562
9551
|
strokeLinejoin: "round"
|
|
9563
9552
|
})]
|
|
9564
|
-
}),
|
|
9553
|
+
}), bh = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
|
|
9565
9554
|
width: e,
|
|
9566
9555
|
height: e,
|
|
9567
9556
|
viewBox: "0 0 24 24",
|
|
@@ -9576,7 +9565,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9576
9565
|
x2: "1",
|
|
9577
9566
|
y2: "23"
|
|
9578
9567
|
})]
|
|
9579
|
-
}),
|
|
9568
|
+
}), xh = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
|
|
9580
9569
|
width: e,
|
|
9581
9570
|
height: e,
|
|
9582
9571
|
viewBox: "0 0 24 24",
|
|
@@ -9591,7 +9580,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9591
9580
|
x2: "12",
|
|
9592
9581
|
y2: "5"
|
|
9593
9582
|
}), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
|
|
9594
|
-
}),
|
|
9583
|
+
}), Sh = () => /* @__PURE__ */ _("svg", {
|
|
9595
9584
|
width: "14",
|
|
9596
9585
|
height: "14",
|
|
9597
9586
|
viewBox: "0 0 24 24",
|
|
@@ -9601,7 +9590,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9601
9590
|
strokeLinecap: "round",
|
|
9602
9591
|
strokeLinejoin: "round",
|
|
9603
9592
|
children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
|
|
9604
|
-
}),
|
|
9593
|
+
}), Ch = () => /* @__PURE__ */ g("svg", {
|
|
9605
9594
|
width: "18",
|
|
9606
9595
|
height: "18",
|
|
9607
9596
|
viewBox: "0 0 24 24",
|
|
@@ -9611,7 +9600,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9611
9600
|
strokeLinecap: "round",
|
|
9612
9601
|
strokeLinejoin: "round",
|
|
9613
9602
|
children: /* @__PURE__ */ g("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6.12-6.11A19.79 19.79 0 012 4.11 2 2 0 014.11 2h3a2 2 0 012 1.72c.13.96.37 1.91.71 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.9.34 1.85.58 2.81.71A2 2 0 0122 16.92z" })
|
|
9614
|
-
}),
|
|
9603
|
+
}), wh = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
|
|
9615
9604
|
className: e,
|
|
9616
9605
|
width: "14",
|
|
9617
9606
|
height: "14",
|
|
@@ -9640,7 +9629,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9640
9629
|
y2: "16"
|
|
9641
9630
|
})
|
|
9642
9631
|
]
|
|
9643
|
-
}),
|
|
9632
|
+
}), Th = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
|
|
9644
9633
|
width: e,
|
|
9645
9634
|
height: e,
|
|
9646
9635
|
viewBox: "0 0 24 24",
|
|
@@ -9663,7 +9652,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9663
9652
|
/* @__PURE__ */ g("path", { d: "M15 13v2" }),
|
|
9664
9653
|
/* @__PURE__ */ g("path", { d: "M9 13v2" })
|
|
9665
9654
|
]
|
|
9666
|
-
}),
|
|
9655
|
+
}), Eh = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9667
9656
|
width: e,
|
|
9668
9657
|
height: e,
|
|
9669
9658
|
viewBox: "0 0 24 24",
|
|
@@ -9683,7 +9672,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9683
9672
|
x2: "19",
|
|
9684
9673
|
y2: "12"
|
|
9685
9674
|
})]
|
|
9686
|
-
}),
|
|
9675
|
+
}), Dh = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9687
9676
|
width: e,
|
|
9688
9677
|
height: e,
|
|
9689
9678
|
viewBox: "0 0 24 24",
|
|
@@ -9709,7 +9698,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9709
9698
|
fill: t
|
|
9710
9699
|
})
|
|
9711
9700
|
]
|
|
9712
|
-
}),
|
|
9701
|
+
}), Oh = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9713
9702
|
width: "24",
|
|
9714
9703
|
height: "24",
|
|
9715
9704
|
viewBox: "0 0 24 24",
|
|
@@ -9727,7 +9716,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9727
9716
|
"stroke-linecap": "round",
|
|
9728
9717
|
"stroke-linejoin": "round"
|
|
9729
9718
|
})]
|
|
9730
|
-
}),
|
|
9719
|
+
}), kh = () => /* @__PURE__ */ g("svg", {
|
|
9731
9720
|
width: "24",
|
|
9732
9721
|
height: "24",
|
|
9733
9722
|
viewBox: "0 0 24 24",
|
|
@@ -9739,7 +9728,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9739
9728
|
"stroke-width": "1.5",
|
|
9740
9729
|
"stroke-linejoin": "round"
|
|
9741
9730
|
})
|
|
9742
|
-
}),
|
|
9731
|
+
}), Ah = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
|
|
9743
9732
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9744
9733
|
width: e,
|
|
9745
9734
|
height: e,
|
|
@@ -9757,7 +9746,7 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9757
9746
|
/* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
|
|
9758
9747
|
/* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
|
|
9759
9748
|
]
|
|
9760
|
-
}),
|
|
9749
|
+
}), jh = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), Mh = (e = "") => String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), Nh = new Set([
|
|
9761
9750
|
"p",
|
|
9762
9751
|
"br",
|
|
9763
9752
|
"ul",
|
|
@@ -9768,30 +9757,30 @@ var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9768
9757
|
"b",
|
|
9769
9758
|
"i",
|
|
9770
9759
|
"a"
|
|
9771
|
-
]),
|
|
9772
|
-
function
|
|
9760
|
+
]), Ph = /^https?:\/\//i;
|
|
9761
|
+
function Fh(e) {
|
|
9773
9762
|
let t = Array.from(e.childNodes);
|
|
9774
9763
|
for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
|
|
9775
9764
|
let t = n.tagName.toLowerCase();
|
|
9776
|
-
if (!
|
|
9765
|
+
if (!Nh.has(t)) {
|
|
9777
9766
|
e.replaceChild(document.createTextNode(n.textContent), n);
|
|
9778
9767
|
continue;
|
|
9779
9768
|
}
|
|
9780
9769
|
let r = {};
|
|
9781
9770
|
if (t === "a") {
|
|
9782
9771
|
let e = n.getAttribute("href") || "";
|
|
9783
|
-
|
|
9772
|
+
Ph.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
|
|
9784
9773
|
}
|
|
9785
9774
|
for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
|
|
9786
9775
|
for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
|
|
9787
|
-
|
|
9776
|
+
Fh(n);
|
|
9788
9777
|
} else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
|
|
9789
9778
|
}
|
|
9790
|
-
function
|
|
9779
|
+
function Ih(e) {
|
|
9791
9780
|
let t = document.createElement("div");
|
|
9792
|
-
return t.innerHTML = e,
|
|
9781
|
+
return t.innerHTML = e, Fh(t), t.innerHTML;
|
|
9793
9782
|
}
|
|
9794
|
-
function
|
|
9783
|
+
function Lh(e) {
|
|
9795
9784
|
let t = String(e || "").trim();
|
|
9796
9785
|
if (!t) return t;
|
|
9797
9786
|
let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
|
|
@@ -9803,33 +9792,33 @@ function zh(e) {
|
|
|
9803
9792
|
}
|
|
9804
9793
|
return e;
|
|
9805
9794
|
}
|
|
9806
|
-
var
|
|
9795
|
+
var Rh = (e = "") => {
|
|
9807
9796
|
let t = String(e || "").trim();
|
|
9808
9797
|
if (!t) return "";
|
|
9809
|
-
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return
|
|
9810
|
-
let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) =>
|
|
9811
|
-
return
|
|
9798
|
+
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return Lh(Ih(t));
|
|
9799
|
+
let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) => Mh(e).replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*\n]+)\*/g, "<em>$1</em>");
|
|
9800
|
+
return Lh(n.map((e) => {
|
|
9812
9801
|
let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
|
|
9813
9802
|
if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
|
|
9814
9803
|
let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
|
|
9815
9804
|
return i.length >= 2 && i.every((e) => /^[-*]\s+/.test(e)) ? `<ul>${i.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>` : `<p>${r(e).replace(/\n/g, "<br />")}</p>`;
|
|
9816
9805
|
}).join(""));
|
|
9817
|
-
},
|
|
9806
|
+
}, zh = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Bh = new Set([
|
|
9818
9807
|
".pdf",
|
|
9819
9808
|
".docx",
|
|
9820
9809
|
".png",
|
|
9821
9810
|
".jpg",
|
|
9822
9811
|
".jpeg"
|
|
9823
|
-
]),
|
|
9824
|
-
function
|
|
9812
|
+
]), Vh = "image/png,image/jpeg,.pdf,.docx";
|
|
9813
|
+
function Hh(e) {
|
|
9825
9814
|
if (!e) return !1;
|
|
9826
9815
|
let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
|
|
9827
|
-
return r === "image/png" || r === "image/jpeg" ||
|
|
9816
|
+
return r === "image/png" || r === "image/jpeg" || zh.has(r) || Bh.has(n);
|
|
9828
9817
|
}
|
|
9829
|
-
function
|
|
9830
|
-
return e ?
|
|
9818
|
+
function Uh(e) {
|
|
9819
|
+
return e ? Hh(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
|
|
9831
9820
|
}
|
|
9832
|
-
function
|
|
9821
|
+
function Wh(e = 0) {
|
|
9833
9822
|
if (!Number.isFinite(e) || e <= 0) return "";
|
|
9834
9823
|
let t = [
|
|
9835
9824
|
"B",
|
|
@@ -9841,12 +9830,12 @@ function Kh(e = 0) {
|
|
|
9841
9830
|
let i = n >= 10 || r === 0 ? 0 : 1;
|
|
9842
9831
|
return `${n.toFixed(i)} ${t[r]}`;
|
|
9843
9832
|
}
|
|
9844
|
-
function
|
|
9833
|
+
function Gh(e) {
|
|
9845
9834
|
return e ? e.name || "Attachment" : "";
|
|
9846
9835
|
}
|
|
9847
9836
|
//#endregion
|
|
9848
9837
|
//#region src/utils/avatarHelpers.js
|
|
9849
|
-
function
|
|
9838
|
+
function Kh(e) {
|
|
9850
9839
|
if (!e || typeof e != "string") return "?";
|
|
9851
9840
|
let t = e.trim();
|
|
9852
9841
|
if (!t) return "?";
|
|
@@ -9855,7 +9844,7 @@ function Jh(e) {
|
|
|
9855
9844
|
}
|
|
9856
9845
|
//#endregion
|
|
9857
9846
|
//#region src/components/AvatarImageOrInitials.jsx
|
|
9858
|
-
function
|
|
9847
|
+
function qh({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
9859
9848
|
let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
|
|
9860
9849
|
return c(() => {
|
|
9861
9850
|
if (!o) {
|
|
@@ -9878,12 +9867,12 @@ function Yh({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
|
9878
9867
|
onError: () => a(null)
|
|
9879
9868
|
}) : /* @__PURE__ */ g("span", {
|
|
9880
9869
|
style: r,
|
|
9881
|
-
children:
|
|
9870
|
+
children: Kh(t)
|
|
9882
9871
|
});
|
|
9883
9872
|
}
|
|
9884
9873
|
//#endregion
|
|
9885
9874
|
//#region src/components/MessageList.jsx
|
|
9886
|
-
function
|
|
9875
|
+
function Jh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
|
|
9887
9876
|
let { resolvedConfig: d } = Cn(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
|
|
9888
9877
|
let t = e.target.closest("a[href]");
|
|
9889
9878
|
if (!t) return;
|
|
@@ -9938,7 +9927,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
9938
9927
|
children: [
|
|
9939
9928
|
e.map((e) => {
|
|
9940
9929
|
if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
|
|
9941
|
-
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m =
|
|
9930
|
+
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m = jh(e.replyToContent || e.replyContext?.message || ""), v = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
|
|
9942
9931
|
return t ? /* @__PURE__ */ g("div", {
|
|
9943
9932
|
style: {
|
|
9944
9933
|
display: "flex",
|
|
@@ -9983,7 +9972,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
9983
9972
|
fontWeight: 800,
|
|
9984
9973
|
marginTop: !c && (r || o) ? "22px" : "0px"
|
|
9985
9974
|
},
|
|
9986
|
-
children: r ? u || /* @__PURE__ */ g(
|
|
9975
|
+
children: r ? u || /* @__PURE__ */ g(Th, { size: 16 }) : /* @__PURE__ */ g(qh, {
|
|
9987
9976
|
src: p || "",
|
|
9988
9977
|
name: f,
|
|
9989
9978
|
imgStyle: {
|
|
@@ -10025,7 +10014,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10025
10014
|
onMouseLeave: (e) => {
|
|
10026
10015
|
e.currentTarget.style.color = "#9ca3af";
|
|
10027
10016
|
},
|
|
10028
|
-
children: [/* @__PURE__ */ g(
|
|
10017
|
+
children: [/* @__PURE__ */ g(Sh, {}), "Reply"]
|
|
10029
10018
|
}),
|
|
10030
10019
|
/* @__PURE__ */ _("div", {
|
|
10031
10020
|
style: {
|
|
@@ -10069,7 +10058,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10069
10058
|
children: m
|
|
10070
10059
|
})]
|
|
10071
10060
|
}), d ? (() => {
|
|
10072
|
-
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i =
|
|
10061
|
+
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = Wh(e.metadata.fileSize), a = t.startsWith("image/"), o = `shared file: ${r}`.toLowerCase(), s = (e.message || "").trim(), c = s && s.toLowerCase() !== o && !s.toLowerCase().startsWith("shared file:"), l = t === "application/pdf" ? {
|
|
10073
10062
|
color: "#ef4444",
|
|
10074
10063
|
label: "PDF"
|
|
10075
10064
|
} : t.includes("word") || t.includes("docx") ? {
|
|
@@ -10250,7 +10239,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10250
10239
|
});
|
|
10251
10240
|
})() : r ? /* @__PURE__ */ g("div", {
|
|
10252
10241
|
className: "flowengage-message-content fe-bot-message",
|
|
10253
|
-
dangerouslySetInnerHTML: { __html:
|
|
10242
|
+
dangerouslySetInnerHTML: { __html: Rh(e.message) },
|
|
10254
10243
|
onClick: T
|
|
10255
10244
|
}) : /* @__PURE__ */ g("div", {
|
|
10256
10245
|
style: { whiteSpace: "pre-wrap" },
|
|
@@ -10315,7 +10304,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10315
10304
|
boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
|
|
10316
10305
|
overflow: "hidden"
|
|
10317
10306
|
},
|
|
10318
|
-
children: u || /* @__PURE__ */ g(
|
|
10307
|
+
children: u || /* @__PURE__ */ g(Th, { size: 16 })
|
|
10319
10308
|
}), /* @__PURE__ */ _("div", {
|
|
10320
10309
|
style: {
|
|
10321
10310
|
display: "flex",
|
|
@@ -10357,7 +10346,7 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10357
10346
|
borderRadius: "50%",
|
|
10358
10347
|
overflow: "hidden"
|
|
10359
10348
|
},
|
|
10360
|
-
children: /* @__PURE__ */ g(
|
|
10349
|
+
children: /* @__PURE__ */ g(qh, {
|
|
10361
10350
|
src: s || "",
|
|
10362
10351
|
name: l,
|
|
10363
10352
|
imgStyle: {
|
|
@@ -10451,22 +10440,22 @@ function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10451
10440
|
}
|
|
10452
10441
|
//#endregion
|
|
10453
10442
|
//#region src/components/ChatInput.jsx
|
|
10454
|
-
var
|
|
10455
|
-
function
|
|
10443
|
+
var Yh = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
|
|
10444
|
+
function Xh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
|
|
10456
10445
|
let D = p(null), O = p(null), k = (e) => {
|
|
10457
10446
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
|
|
10458
10447
|
};
|
|
10459
10448
|
c(() => {
|
|
10460
10449
|
d || k(O.current);
|
|
10461
10450
|
}, [e, d]), c(() => {
|
|
10462
|
-
d ||
|
|
10451
|
+
d || Yh || e || s || O.current?.focus();
|
|
10463
10452
|
}, [
|
|
10464
10453
|
e,
|
|
10465
10454
|
d,
|
|
10466
10455
|
s
|
|
10467
10456
|
]);
|
|
10468
10457
|
let A = (e) => {
|
|
10469
|
-
e.key === "Enter" && (
|
|
10458
|
+
e.key === "Enter" && (Yh || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
|
|
10470
10459
|
}, ee = l?.sender === "user" ? "You" : l?.sender === "agent" ? "Agent" : "AI Assistant", te = d ? !!f?.trim() : !!e?.trim() || !!S, ne = s || T || !te, j = !d && b && y;
|
|
10471
10460
|
return /* @__PURE__ */ _("div", {
|
|
10472
10461
|
style: {
|
|
@@ -10561,7 +10550,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10561
10550
|
background: "rgba(59,130,246,0.08)",
|
|
10562
10551
|
color: "var(--flowengage-primary)"
|
|
10563
10552
|
},
|
|
10564
|
-
children: /* @__PURE__ */ g(
|
|
10553
|
+
children: /* @__PURE__ */ g(Th, { size: 13 })
|
|
10565
10554
|
}), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
|
|
10566
10555
|
})
|
|
10567
10556
|
}),
|
|
@@ -10601,7 +10590,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10601
10590
|
overflow: "hidden",
|
|
10602
10591
|
textOverflow: "ellipsis"
|
|
10603
10592
|
},
|
|
10604
|
-
children:
|
|
10593
|
+
children: Gh(S)
|
|
10605
10594
|
}),
|
|
10606
10595
|
/* @__PURE__ */ g("div", {
|
|
10607
10596
|
style: {
|
|
@@ -10609,7 +10598,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10609
10598
|
color: "#6b7280",
|
|
10610
10599
|
marginTop: "2px"
|
|
10611
10600
|
},
|
|
10612
|
-
children:
|
|
10601
|
+
children: Wh(S.size)
|
|
10613
10602
|
})
|
|
10614
10603
|
]
|
|
10615
10604
|
}), /* @__PURE__ */ g("button", {
|
|
@@ -10654,7 +10643,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10654
10643
|
j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
|
|
10655
10644
|
ref: D,
|
|
10656
10645
|
type: "file",
|
|
10657
|
-
accept:
|
|
10646
|
+
accept: Vh,
|
|
10658
10647
|
style: { display: "none" },
|
|
10659
10648
|
onChange: (e) => {
|
|
10660
10649
|
let t = e.target.files?.[0];
|
|
@@ -10686,7 +10675,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10686
10675
|
onMouseLeave: (e) => {
|
|
10687
10676
|
e.currentTarget.style.opacity = "1";
|
|
10688
10677
|
},
|
|
10689
|
-
children: /* @__PURE__ */ g(
|
|
10678
|
+
children: /* @__PURE__ */ g(Eh, {
|
|
10690
10679
|
size: 16,
|
|
10691
10680
|
color: "currentColor"
|
|
10692
10681
|
})
|
|
@@ -10767,7 +10756,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10767
10756
|
onMouseLeave: (e) => {
|
|
10768
10757
|
e.currentTarget.style.opacity = "1";
|
|
10769
10758
|
},
|
|
10770
|
-
children: /* @__PURE__ */ g(
|
|
10759
|
+
children: /* @__PURE__ */ g(xh, { size: 16 })
|
|
10771
10760
|
})
|
|
10772
10761
|
]
|
|
10773
10762
|
}),
|
|
@@ -10830,7 +10819,7 @@ function Qh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10830
10819
|
}
|
|
10831
10820
|
//#endregion
|
|
10832
10821
|
//#region src/components/StatusBanners.jsx
|
|
10833
|
-
function
|
|
10822
|
+
function Zh({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
|
|
10834
10823
|
return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
|
|
10835
10824
|
style: {
|
|
10836
10825
|
margin: "0 20px 10px",
|
|
@@ -10843,7 +10832,7 @@ function $h({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
10843
10832
|
gap: "10px"
|
|
10844
10833
|
},
|
|
10845
10834
|
children: [
|
|
10846
|
-
/* @__PURE__ */ g(
|
|
10835
|
+
/* @__PURE__ */ g(wh, { className: "" }),
|
|
10847
10836
|
/* @__PURE__ */ g("span", {
|
|
10848
10837
|
style: {
|
|
10849
10838
|
fontSize: "12px",
|
|
@@ -10889,13 +10878,13 @@ function $h({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
10889
10878
|
}
|
|
10890
10879
|
//#endregion
|
|
10891
10880
|
//#region src/components/AnimatedOrb.jsx
|
|
10892
|
-
var
|
|
10881
|
+
var Qh = [
|
|
10893
10882
|
"#135bd8",
|
|
10894
10883
|
"#ef334b",
|
|
10895
10884
|
"#ffbd2e"
|
|
10896
10885
|
];
|
|
10897
|
-
function
|
|
10898
|
-
return !Array.isArray(e) || e.length === 0 ?
|
|
10886
|
+
function $h(e) {
|
|
10887
|
+
return !Array.isArray(e) || e.length === 0 ? Qh : e.length === 1 ? [
|
|
10899
10888
|
e[0],
|
|
10900
10889
|
e[0],
|
|
10901
10890
|
e[0]
|
|
@@ -10909,7 +10898,7 @@ function tg(e) {
|
|
|
10909
10898
|
e[2]
|
|
10910
10899
|
];
|
|
10911
10900
|
}
|
|
10912
|
-
var
|
|
10901
|
+
var eg = {
|
|
10913
10902
|
idle: 3,
|
|
10914
10903
|
listening: .75,
|
|
10915
10904
|
thinking: 1,
|
|
@@ -10917,7 +10906,7 @@ var ng = {
|
|
|
10917
10906
|
muted: .75,
|
|
10918
10907
|
error: .08
|
|
10919
10908
|
};
|
|
10920
|
-
function
|
|
10909
|
+
function tg(e) {
|
|
10921
10910
|
if (!e || typeof e != "string") return [
|
|
10922
10911
|
0,
|
|
10923
10912
|
0,
|
|
@@ -10930,14 +10919,14 @@ function rg(e) {
|
|
|
10930
10919
|
parseInt(n.slice(4, 6), 16) / 255
|
|
10931
10920
|
];
|
|
10932
10921
|
}
|
|
10933
|
-
function
|
|
10922
|
+
function ng(e, t) {
|
|
10934
10923
|
if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
|
|
10935
10924
|
if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
|
|
10936
10925
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
10937
10926
|
return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
|
|
10938
10927
|
}
|
|
10939
|
-
var
|
|
10940
|
-
function
|
|
10928
|
+
var rg = "\n attribute vec2 a_pos;\n varying vec2 v_uv;\n void main() {\n v_uv = a_pos * 0.5 + 0.5;\n gl_Position = vec4(a_pos, 0.0, 1.0);\n }\n", ig = "\n precision highp float;\n\n varying vec2 v_uv;\n uniform float u_time;\n uniform float u_speed;\n uniform vec3 u_c1;\n uniform vec3 u_c2;\n uniform vec3 u_c3;\n\n // ── Gradient noise ─────────────────────────────────────────────────────────\n vec2 hash2(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n }\n float gnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*f*(f*(f*6.0-15.0)+10.0);\n return mix(\n mix(dot(hash2(i), f),\n dot(hash2(i+vec2(1,0)), f-vec2(1,0)), u.x),\n mix(dot(hash2(i+vec2(0,1)), f-vec2(0,1)),\n dot(hash2(i+vec2(1,1)), f-vec2(1,1)), u.x),\n u.y\n ) * 0.5 + 0.5;\n }\n\n // ── 3-octave FBM normalised to [0,1] — fewer octaves → larger, softer blobs\n float fbm(vec2 p) {\n float v = 0.0, a = 0.5;\n for (int i = 0; i < 3; i++) {\n v += a * gnoise(p);\n p = p * 2.1 + vec2(100.0);\n a *= 0.5;\n }\n return v / 0.875;\n }\n\n // ── Scalar hash for grain ──────────────────────────────────────────────────\n float hash1(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n }\n\n void main() {\n vec2 uv = v_uv;\n float t = u_time * u_speed + 47.3;\n\n // ── ① Two-level domain warp — deep organic folding and swirling ───────────\n // First pass: large-scale sweep\n vec2 q = vec2(\n fbm(uv * 1.8 + vec2( t * 0.13, t * 0.11)) * 2.0 - 1.0,\n fbm(uv * 1.8 + vec2( t * 0.11 + 3.7, -t * 0.14 + 1.1)) * 2.0 - 1.0\n );\n // Second pass: warp the warp — creates curling, folding sub-currents\n vec2 r = vec2(\n fbm(uv * 1.8 + q * 0.55 + vec2( t * 0.09, t * 0.07)) * 2.0 - 1.0,\n fbm(uv * 1.8 + q * 0.55 + vec2(-t * 0.07 + 5.1, t * 0.10 + 2.3)) * 2.0 - 1.0\n );\n vec2 wp = uv + r * 0.38;\n\n // ── ② Three independent fields — each drifts inward from its source edge ──\n // Asymmetric velocities: dominant axis matches the inflow direction so the\n // noise texture visually streams inward (left→right, right→left, bottom→top).\n float f1 = fbm(wp * 0.85 + vec2(-t * 0.18, t * 0.04)); // LEFT → right\n float f2 = fbm(wp * 0.85 + vec2( t * 0.18 + 5.3, t * 0.04 + 1.7)); // RIGHT → left\n float f3 = fbm(wp * 0.85 + vec2( t * 0.04 - 3.2, -t * 0.18 + 6.4)); // BOTTOM → up\n\n // ── ③ Breathing blobs — sin pulse makes each field expand and contract ────\n float p1 = 0.88 + 0.12 * sin(t * 0.61);\n float p2 = 0.88 + 0.12 * sin(t * 0.47 + 2.09);\n float p3 = 0.88 + 0.12 * sin(t * 0.53 + 4.19);\n\n // Wide smoothstep (0.26 → 0.70) → soft, diffused blob edges that dissolve\n // gradually into each other, like dye spreading through water.\n float b1 = smoothstep(0.26, 0.70, f1 * p1);\n float b2 = smoothstep(0.26, 0.70, f2 * p2);\n float b3 = smoothstep(0.26, 0.70, f3 * p3);\n\n // ── ④ Directional origin gradients.\n // Each color owns its home edge (value = 1.0) and smoothly fades to zero\n // before reaching the opposite side. The transition windows are offset so\n // they overlap only in the center third — that overlap zone is where the\n // three colors meet and blend, while the edges stay uncontaminated.\n float d1 = 1.0 - smoothstep(0.20, 0.74, uv.x); // c1: LEFT → full at x<0.20, zero by x=0.74\n float d2 = 1.0 - smoothstep(0.20, 0.74, 1.0 - uv.x); // c2: RIGHT → full at x>0.80, zero by x=0.26\n float d3 = 1.0 - smoothstep(0.18, 0.68, uv.y); // c3: BOTTOM → full at y<0.18, zero by y=0.68\n\n float w1 = b1 * d1;\n float w2 = b2 * d2;\n float w3 = b3 * d3;\n\n // ── ⑤ Dye-mixing colour blend ──────────────────────────────────────────────\n // dyeColor is the weighted average of all active colours — exactly how dyes\n // mix in water: overlapping streams blend smoothly, no hard edges.\n float total = w1 + w2 + w3;\n vec3 dyeColor = (u_c1 * w1 + u_c2 * w2 + u_c3 * w3) / max(total, 0.001);\n\n // Boost brightness of the dye to make colors pop and seem less dull\n dyeColor *= 1.65;\n\n // Exponential coverage: cores are rich and opaque; edges dissolve into the\n // near-white base. White only shows through where dye concentration is thin.\n float coverage = 1.0 - exp(-total * 5.0);\n vec3 col = mix(vec3(1.0, 1.0, 1.0), dyeColor, coverage);\n col = clamp(col, 0.0, 1.0);\n\n // ── ⑥ Sphere shading — subtle edge vignette only, no specular ─────────────\n vec2 uvc = v_uv * 2.0 - 1.0;\n\n // ── ⑦ Subtle grain — breaks gradient banding, adds filmic texture ──────────\n float grain = hash1(v_uv * 437.3 + fract(t)) * 2.0 - 1.0;\n col += grain * 0.018;\n\n gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n }\n";
|
|
10929
|
+
function ag(e, t, n) {
|
|
10941
10930
|
let r = (t, n) => {
|
|
10942
10931
|
let r = e.createShader(t);
|
|
10943
10932
|
return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
|
|
@@ -10946,10 +10935,10 @@ function sg(e, t, n) {
|
|
|
10946
10935
|
let o = e.createProgram();
|
|
10947
10936
|
return e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.getProgramParameter(o, e.LINK_STATUS) ? o : (console.error("[AnimatedOrb link]", e.getProgramInfoLog(o)), null);
|
|
10948
10937
|
}
|
|
10949
|
-
function
|
|
10950
|
-
let [s, l, u] =
|
|
10938
|
+
function og({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
|
|
10939
|
+
let [s, l, u] = $h(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(eg[t] ?? .35);
|
|
10951
10940
|
c(() => {
|
|
10952
|
-
h.current =
|
|
10941
|
+
h.current = eg[t] ?? .35;
|
|
10953
10942
|
}, [t]), c(() => {
|
|
10954
10943
|
let t = m.current;
|
|
10955
10944
|
if (!t) return;
|
|
@@ -10966,7 +10955,7 @@ function cg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
10966
10955
|
console.warn("[AnimatedOrb] WebGL unavailable.");
|
|
10967
10956
|
return;
|
|
10968
10957
|
}
|
|
10969
|
-
let i =
|
|
10958
|
+
let i = ag(r, rg, ig);
|
|
10970
10959
|
if (!i) {
|
|
10971
10960
|
console.error("[AnimatedOrb] WebGL program failed to compile/link");
|
|
10972
10961
|
return;
|
|
@@ -10996,7 +10985,7 @@ function cg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
10996
10985
|
c2: r.getUniformLocation(i, "u_c2"),
|
|
10997
10986
|
c3: r.getUniformLocation(i, "u_c3")
|
|
10998
10987
|
};
|
|
10999
|
-
r.uniform3fv(c.c1,
|
|
10988
|
+
r.uniform3fv(c.c1, tg(s)), r.uniform3fv(c.c2, tg(l)), r.uniform3fv(c.c3, tg(u)), r.viewport(0, 0, t.width, t.height);
|
|
11000
10989
|
let d = performance.now(), f, p = (e) => {
|
|
11001
10990
|
r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
|
|
11002
10991
|
};
|
|
@@ -11027,7 +11016,7 @@ function cg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
11027
11016
|
position: "absolute",
|
|
11028
11017
|
inset: -10,
|
|
11029
11018
|
borderRadius: "50%",
|
|
11030
|
-
background: `radial-gradient(circle, ${
|
|
11019
|
+
background: `radial-gradient(circle, ${ng(s, .18)} 0%, transparent 70%)`,
|
|
11031
11020
|
pointerEvents: "none"
|
|
11032
11021
|
},
|
|
11033
11022
|
animate: { opacity: [.3, .75] },
|
|
@@ -11105,17 +11094,17 @@ function cg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
11105
11094
|
}
|
|
11106
11095
|
//#endregion
|
|
11107
11096
|
//#region src/components/CallScreen.jsx
|
|
11108
|
-
var
|
|
11109
|
-
function
|
|
11097
|
+
var sg = "\n @keyframes fe-call-ring-pulse {\n 0% { transform: scale(1); opacity: 0.55; }\n 70% { transform: scale(1.85); opacity: 0; }\n 100% { transform: scale(1.85); opacity: 0; }\n }\n @keyframes fe-call-spin {\n to { transform: rotate(360deg); }\n }\n @keyframes fe-call-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes fe-call-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes fe-call-bar-slide-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n @keyframes fe-call-dot-blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.35; }\n }\n @keyframes fe-call-avatar-breathe {\n 0%, 100% { opacity: 0.5; transform: scale(1); }\n 50% { opacity: 0.9; transform: scale(1.12); }\n }\n";
|
|
11098
|
+
function cg(e) {
|
|
11110
11099
|
let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
11111
11100
|
return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
|
|
11112
11101
|
}
|
|
11113
|
-
function
|
|
11102
|
+
function lg(e) {
|
|
11114
11103
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
11115
11104
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
11116
11105
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
11117
11106
|
}
|
|
11118
|
-
function
|
|
11107
|
+
function ug(e, t) {
|
|
11119
11108
|
let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
|
|
11120
11109
|
return n.length === 1 ? [
|
|
11121
11110
|
`radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
|
|
@@ -11132,8 +11121,8 @@ function fg(e, t) {
|
|
|
11132
11121
|
"#f7f8fa"
|
|
11133
11122
|
].join(", ");
|
|
11134
11123
|
}
|
|
11135
|
-
function
|
|
11136
|
-
let i = (t || "A")[0].toUpperCase(), a =
|
|
11124
|
+
function dg({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
|
|
11125
|
+
let i = (t || "A")[0].toUpperCase(), a = lg(r), o = n > 48 ? {
|
|
11137
11126
|
boxShadow: `0 0 0 3px ${r}44`,
|
|
11138
11127
|
border: "3px solid rgba(255,255,255,0.15)"
|
|
11139
11128
|
} : { border: `1.5px solid ${r}55` };
|
|
@@ -11170,7 +11159,7 @@ function pg({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
|
|
|
11170
11159
|
children: i
|
|
11171
11160
|
});
|
|
11172
11161
|
}
|
|
11173
|
-
function
|
|
11162
|
+
function fg(e) {
|
|
11174
11163
|
let t = p(null), n = o(() => {
|
|
11175
11164
|
if (!t.current) return;
|
|
11176
11165
|
let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
|
|
@@ -11217,8 +11206,8 @@ function mg(e) {
|
|
|
11217
11206
|
n
|
|
11218
11207
|
]), c(() => () => n(), [n]), n;
|
|
11219
11208
|
}
|
|
11220
|
-
function
|
|
11221
|
-
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x =
|
|
11209
|
+
function pg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDurationSeconds: r, isCallMuted: i, agentName: a, agentHeadshot: o, fallbackAgentName: s, acceptCall: c, rejectCall: l, endWebRTCCall: u, toggleCallMute: d, formatCallDuration: f, onMinimize: p, primaryColor: m = "#3B82F6", orbColors: h, chatHistory: v = [] }) {
|
|
11210
|
+
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = fg(!!e), S = async () => {
|
|
11222
11211
|
x(), await c();
|
|
11223
11212
|
}, C = async () => {
|
|
11224
11213
|
x(), await l();
|
|
@@ -11230,14 +11219,14 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11230
11219
|
flexDirection: "column",
|
|
11231
11220
|
borderRadius: "inherit",
|
|
11232
11221
|
overflow: "hidden",
|
|
11233
|
-
background:
|
|
11222
|
+
background: ug(h, m),
|
|
11234
11223
|
animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
|
|
11235
11224
|
};
|
|
11236
11225
|
if (b === "incoming") {
|
|
11237
11226
|
let e = Array.isArray(h) && h.length > 0 ? h : [m];
|
|
11238
11227
|
return /* @__PURE__ */ _("div", {
|
|
11239
11228
|
style: E,
|
|
11240
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
11229
|
+
children: [/* @__PURE__ */ g("style", { children: sg }), /* @__PURE__ */ _("div", {
|
|
11241
11230
|
style: {
|
|
11242
11231
|
flex: 1,
|
|
11243
11232
|
display: "flex",
|
|
@@ -11268,7 +11257,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11268
11257
|
width: "96px",
|
|
11269
11258
|
height: "96px",
|
|
11270
11259
|
borderRadius: "50%",
|
|
11271
|
-
background: `radial-gradient(circle, rgba(${
|
|
11260
|
+
background: `radial-gradient(circle, rgba(${cg(e[0])},0.2) 0%, transparent 70%)`,
|
|
11272
11261
|
filter: "blur(10px)",
|
|
11273
11262
|
zIndex: 0
|
|
11274
11263
|
} }),
|
|
@@ -11285,7 +11274,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11285
11274
|
animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
|
|
11286
11275
|
zIndex: 1
|
|
11287
11276
|
} }, n)),
|
|
11288
|
-
/* @__PURE__ */ g(
|
|
11277
|
+
/* @__PURE__ */ g(dg, {
|
|
11289
11278
|
headshot: o,
|
|
11290
11279
|
name: y,
|
|
11291
11280
|
size: 82,
|
|
@@ -11365,7 +11354,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11365
11354
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
|
|
11366
11355
|
},
|
|
11367
11356
|
"aria-label": "Decline call",
|
|
11368
|
-
children: /* @__PURE__ */ g(
|
|
11357
|
+
children: /* @__PURE__ */ g(bh, { size: 26 })
|
|
11369
11358
|
}), /* @__PURE__ */ g("span", {
|
|
11370
11359
|
style: {
|
|
11371
11360
|
fontSize: "12px",
|
|
@@ -11406,7 +11395,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11406
11395
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
|
|
11407
11396
|
},
|
|
11408
11397
|
"aria-label": "Accept call",
|
|
11409
|
-
children: /* @__PURE__ */ g(
|
|
11398
|
+
children: /* @__PURE__ */ g(Ch, {})
|
|
11410
11399
|
}), /* @__PURE__ */ g("span", {
|
|
11411
11400
|
style: {
|
|
11412
11401
|
fontSize: "12px",
|
|
@@ -11423,7 +11412,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11423
11412
|
}
|
|
11424
11413
|
return b === "connecting" ? /* @__PURE__ */ _("div", {
|
|
11425
11414
|
style: E,
|
|
11426
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
11415
|
+
children: [/* @__PURE__ */ g("style", { children: sg }), /* @__PURE__ */ _("div", {
|
|
11427
11416
|
style: {
|
|
11428
11417
|
flex: 1,
|
|
11429
11418
|
display: "flex",
|
|
@@ -11433,7 +11422,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11433
11422
|
gap: "24px"
|
|
11434
11423
|
},
|
|
11435
11424
|
children: [
|
|
11436
|
-
/* @__PURE__ */ g(
|
|
11425
|
+
/* @__PURE__ */ g(dg, {
|
|
11437
11426
|
headshot: o,
|
|
11438
11427
|
name: y,
|
|
11439
11428
|
size: 64,
|
|
@@ -11460,7 +11449,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11460
11449
|
}) : /* @__PURE__ */ _("div", {
|
|
11461
11450
|
style: E,
|
|
11462
11451
|
children: [
|
|
11463
|
-
/* @__PURE__ */ g("style", { children:
|
|
11452
|
+
/* @__PURE__ */ g("style", { children: sg }),
|
|
11464
11453
|
/* @__PURE__ */ _("div", {
|
|
11465
11454
|
style: {
|
|
11466
11455
|
display: "flex",
|
|
@@ -11506,7 +11495,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11506
11495
|
children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
|
|
11507
11496
|
})
|
|
11508
11497
|
}),
|
|
11509
|
-
/* @__PURE__ */ g(
|
|
11498
|
+
/* @__PURE__ */ g(og, {
|
|
11510
11499
|
colors: h,
|
|
11511
11500
|
size: 36,
|
|
11512
11501
|
voiceState: w
|
|
@@ -11557,7 +11546,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11557
11546
|
gap: "16px",
|
|
11558
11547
|
padding: "0 24px 16px"
|
|
11559
11548
|
},
|
|
11560
|
-
children: [/* @__PURE__ */ g(
|
|
11549
|
+
children: [/* @__PURE__ */ g(dg, {
|
|
11561
11550
|
headshot: o,
|
|
11562
11551
|
name: y,
|
|
11563
11552
|
size: 116,
|
|
@@ -11612,7 +11601,7 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11612
11601
|
transition: "all 0.2s ease"
|
|
11613
11602
|
},
|
|
11614
11603
|
"aria-label": i ? "Unmute" : "Mute",
|
|
11615
|
-
children: [g(i ?
|
|
11604
|
+
children: [g(i ? Ah : yh, { size: 18 }), i ? "Unmute" : "Mute"]
|
|
11616
11605
|
}), /* @__PURE__ */ _("button", {
|
|
11617
11606
|
type: "button",
|
|
11618
11607
|
onClick: u,
|
|
@@ -11640,15 +11629,15 @@ function hg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11640
11629
|
e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
|
|
11641
11630
|
},
|
|
11642
11631
|
"aria-label": "End call",
|
|
11643
|
-
children: [/* @__PURE__ */ g(
|
|
11632
|
+
children: [/* @__PURE__ */ g(bh, { size: 18 }), "End Call"]
|
|
11644
11633
|
})]
|
|
11645
11634
|
})
|
|
11646
11635
|
]
|
|
11647
11636
|
});
|
|
11648
11637
|
}
|
|
11649
|
-
function
|
|
11638
|
+
function mg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
|
|
11650
11639
|
let u = e || n || "Agent";
|
|
11651
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children:
|
|
11640
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: sg }), /* @__PURE__ */ _("div", {
|
|
11652
11641
|
role: "button",
|
|
11653
11642
|
tabIndex: 0,
|
|
11654
11643
|
onClick: c,
|
|
@@ -11705,7 +11694,7 @@ function gg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11705
11694
|
borderRadius: "50%",
|
|
11706
11695
|
border: `1.5px solid ${l}55`
|
|
11707
11696
|
} }),
|
|
11708
|
-
/* @__PURE__ */ g(
|
|
11697
|
+
/* @__PURE__ */ g(dg, {
|
|
11709
11698
|
headshot: t,
|
|
11710
11699
|
name: u,
|
|
11711
11700
|
size: 38,
|
|
@@ -11789,7 +11778,7 @@ function gg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11789
11778
|
boxShadow: i ? `0 0 0 3px ${l}12` : "none"
|
|
11790
11779
|
},
|
|
11791
11780
|
"aria-label": i ? "Unmute" : "Mute",
|
|
11792
|
-
children: g(i ?
|
|
11781
|
+
children: g(i ? Ah : yh, { size: 15 })
|
|
11793
11782
|
}), /* @__PURE__ */ g("button", {
|
|
11794
11783
|
type: "button",
|
|
11795
11784
|
onClick: (e) => {
|
|
@@ -11817,7 +11806,7 @@ function gg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11817
11806
|
transition: "all 0.18s ease"
|
|
11818
11807
|
},
|
|
11819
11808
|
"aria-label": "End call",
|
|
11820
|
-
children: /* @__PURE__ */ g(
|
|
11809
|
+
children: /* @__PURE__ */ g(bh, { size: 16 })
|
|
11821
11810
|
})]
|
|
11822
11811
|
})
|
|
11823
11812
|
]
|
|
@@ -11825,7 +11814,7 @@ function gg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11825
11814
|
}
|
|
11826
11815
|
//#endregion
|
|
11827
11816
|
//#region src/utils/voicePriorContext.js
|
|
11828
|
-
function
|
|
11817
|
+
function hg(e, t = {}) {
|
|
11829
11818
|
let n = t.maxChars ?? 4500;
|
|
11830
11819
|
if (!Array.isArray(e) || e.length === 0) return "";
|
|
11831
11820
|
let r = [];
|
|
@@ -11843,7 +11832,7 @@ function _g(e, t = {}) {
|
|
|
11843
11832
|
//#endregion
|
|
11844
11833
|
//#region src/utils/voiceActionVisuals.js
|
|
11845
11834
|
var Q = "fe-vv";
|
|
11846
|
-
function
|
|
11835
|
+
function gg() {
|
|
11847
11836
|
if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
|
|
11848
11837
|
let e = `
|
|
11849
11838
|
/* ── Action toast ───────────────────────────────────────────────────────────── */
|
|
@@ -11988,14 +11977,14 @@ function vg() {
|
|
|
11988
11977
|
`, t = document.createElement("style");
|
|
11989
11978
|
t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
|
|
11990
11979
|
}
|
|
11991
|
-
var
|
|
11992
|
-
function
|
|
11993
|
-
return (!
|
|
11980
|
+
var _g = null, vg = null;
|
|
11981
|
+
function yg() {
|
|
11982
|
+
return (!_g || !_g.isConnected) && (_g = document.createElement("div"), _g.id = `${Q}-toast`, document.body.appendChild(_g)), _g;
|
|
11994
11983
|
}
|
|
11995
|
-
function
|
|
11984
|
+
function bg(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
11996
11985
|
if (typeof document > "u") return;
|
|
11997
|
-
|
|
11998
|
-
let i =
|
|
11986
|
+
gg(), vg &&= (clearTimeout(vg), null);
|
|
11987
|
+
let i = yg();
|
|
11999
11988
|
if (i.innerHTML = "", n) {
|
|
12000
11989
|
let e = document.createElement("span");
|
|
12001
11990
|
e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
|
|
@@ -12004,71 +11993,71 @@ function Sg(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
|
12004
11993
|
e.className = `${Q}-spin`, i.appendChild(e);
|
|
12005
11994
|
}
|
|
12006
11995
|
let a = document.createElement("span");
|
|
12007
|
-
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (
|
|
11996
|
+
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (vg = setTimeout(() => xg(), r));
|
|
12008
11997
|
}
|
|
12009
|
-
function
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
}, e) :
|
|
11998
|
+
function xg(e = 0) {
|
|
11999
|
+
_g && (e > 0 ? vg = setTimeout(() => {
|
|
12000
|
+
_g && _g.classList.remove(`${Q}-show`);
|
|
12001
|
+
}, e) : _g && _g.classList.remove(`${Q}-show`));
|
|
12013
12002
|
}
|
|
12014
|
-
var
|
|
12015
|
-
function
|
|
12016
|
-
return (!
|
|
12003
|
+
var Sg = null, Cg = [];
|
|
12004
|
+
function wg() {
|
|
12005
|
+
return (!Sg || !Sg.isConnected) && (Sg = document.createElement("div"), Sg.id = `${Q}-bar`, document.body.appendChild(Sg)), Sg;
|
|
12017
12006
|
}
|
|
12018
|
-
function
|
|
12007
|
+
function Tg() {
|
|
12019
12008
|
if (typeof document > "u") return;
|
|
12020
|
-
|
|
12021
|
-
let e =
|
|
12009
|
+
gg(), Cg.forEach(clearTimeout), Cg = [];
|
|
12010
|
+
let e = wg();
|
|
12022
12011
|
e.style.transition = "none", e.style.width = "0%", e.classList.add(`${Q}-bar-active`), e.offsetHeight, e.style.transition = "width 0.35s ease, opacity 0.25s ease";
|
|
12023
12012
|
let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
|
|
12024
12013
|
for (let [e, r] of t) {
|
|
12025
12014
|
let t = n, i = e, a = r;
|
|
12026
|
-
|
|
12027
|
-
|
|
12015
|
+
Cg.push(setTimeout(() => {
|
|
12016
|
+
Sg && (Sg.style.transition = a, Sg.style.width = `${i}%`);
|
|
12028
12017
|
}, t)), n += 800;
|
|
12029
12018
|
}
|
|
12030
12019
|
}
|
|
12031
|
-
function
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12020
|
+
function Eg() {
|
|
12021
|
+
Sg && (Cg.forEach(clearTimeout), Cg = [], Sg.style.transition = "width 0.2s ease", Sg.style.width = "100%", Cg.push(setTimeout(() => {
|
|
12022
|
+
Sg && (Sg.style.transition = "opacity 0.35s ease", Sg.style.opacity = "0", Cg.push(setTimeout(() => {
|
|
12023
|
+
Sg && (Sg.style.width = "0%", Sg.classList.remove(`${Q}-bar-active`));
|
|
12035
12024
|
}, 380)));
|
|
12036
12025
|
}, 220)));
|
|
12037
12026
|
}
|
|
12038
|
-
var
|
|
12027
|
+
var Dg = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
|
|
12039
12028
|
<filter id="${Q}-csh">
|
|
12040
12029
|
<feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
|
|
12041
12030
|
</filter>
|
|
12042
12031
|
<path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
|
|
12043
12032
|
fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
|
|
12044
12033
|
filter="url(#${Q}-csh)"/>
|
|
12045
|
-
</svg>`,
|
|
12046
|
-
function
|
|
12047
|
-
return (!
|
|
12034
|
+
</svg>`, Og = null, kg = !1;
|
|
12035
|
+
function Ag() {
|
|
12036
|
+
return (!Og || !Og.isConnected) && (Og = document.createElement("div"), Og.id = `${Q}-cursor`, Og.innerHTML = Dg, document.body.appendChild(Og), kg = !1), Og;
|
|
12048
12037
|
}
|
|
12049
|
-
async function
|
|
12038
|
+
async function jg(e) {
|
|
12050
12039
|
if (typeof document > "u" || !e) return;
|
|
12051
|
-
|
|
12040
|
+
gg();
|
|
12052
12041
|
let t;
|
|
12053
12042
|
try {
|
|
12054
12043
|
t = e.getBoundingClientRect();
|
|
12055
12044
|
} catch {
|
|
12056
12045
|
return;
|
|
12057
12046
|
}
|
|
12058
|
-
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i =
|
|
12059
|
-
|
|
12047
|
+
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = Ag();
|
|
12048
|
+
kg ||= (i.style.transition = "none", i.style.left = `${window.innerWidth / 2}px`, i.style.top = `${window.innerHeight * .4}px`, i.classList.add(`${Q}-cursor-visible`), i.offsetHeight, i.style.transition = "left 0.32s cubic-bezier(0.25,0.46,0.45,0.94), top 0.32s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.2s ease", !0), i.style.left = `${n}px`, i.style.top = `${r}px`, await Fg(360);
|
|
12060
12049
|
}
|
|
12061
|
-
function
|
|
12062
|
-
|
|
12063
|
-
|
|
12050
|
+
function Mg(e = !1) {
|
|
12051
|
+
Og && (e ? (Og.classList.remove(`${Q}-cursor-visible`), kg = !1) : (Og.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
|
|
12052
|
+
kg = !1;
|
|
12064
12053
|
}, 250)));
|
|
12065
12054
|
}
|
|
12066
|
-
async function
|
|
12067
|
-
|
|
12055
|
+
async function Ng(e) {
|
|
12056
|
+
Og && (Og.classList.add(`${Q}-cursor-click`), await Fg(280), Og.classList.remove(`${Q}-cursor-click`));
|
|
12068
12057
|
}
|
|
12069
|
-
function
|
|
12058
|
+
function Pg(e) {
|
|
12070
12059
|
if (!e || typeof document > "u") return;
|
|
12071
|
-
|
|
12060
|
+
gg();
|
|
12072
12061
|
let t;
|
|
12073
12062
|
try {
|
|
12074
12063
|
t = e.getBoundingClientRect();
|
|
@@ -12094,29 +12083,29 @@ function Ig(e) {
|
|
|
12094
12083
|
a.remove(), e.style.position = n, e.style.overflow = r;
|
|
12095
12084
|
}, 650);
|
|
12096
12085
|
}
|
|
12097
|
-
function
|
|
12086
|
+
function Fg(e) {
|
|
12098
12087
|
return new Promise((t) => setTimeout(t, e));
|
|
12099
12088
|
}
|
|
12100
12089
|
//#endregion
|
|
12101
12090
|
//#region src/utils/voiceClientTools.js
|
|
12102
|
-
var
|
|
12103
|
-
function
|
|
12104
|
-
return String(e || "").replace(
|
|
12091
|
+
var Ig = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
|
|
12092
|
+
function Lg(e) {
|
|
12093
|
+
return String(e || "").replace(Ig, "").replace(/\/+$/, "").toLowerCase() || "/";
|
|
12105
12094
|
}
|
|
12106
|
-
function
|
|
12107
|
-
return
|
|
12095
|
+
function Rg(e, t) {
|
|
12096
|
+
return Lg(e) === Lg(t);
|
|
12108
12097
|
}
|
|
12109
12098
|
function $(...e) {
|
|
12110
12099
|
wn() && console.log("[FlowEngage:voice-tools]", ...e);
|
|
12111
12100
|
}
|
|
12112
|
-
function
|
|
12101
|
+
function zg(e) {
|
|
12113
12102
|
try {
|
|
12114
12103
|
let t = e.ownerDocument?.defaultView;
|
|
12115
12104
|
if (t) return t.getComputedStyle(e);
|
|
12116
12105
|
} catch {}
|
|
12117
12106
|
return window.getComputedStyle(e);
|
|
12118
12107
|
}
|
|
12119
|
-
function
|
|
12108
|
+
function Bg(e) {
|
|
12120
12109
|
let t = /* @__PURE__ */ new Set();
|
|
12121
12110
|
function n(r) {
|
|
12122
12111
|
if (!r || t.has(r)) return;
|
|
@@ -12129,10 +12118,10 @@ function Hg(e) {
|
|
|
12129
12118
|
}
|
|
12130
12119
|
typeof document < "u" && n(document);
|
|
12131
12120
|
}
|
|
12132
|
-
function
|
|
12121
|
+
function Vg(e) {
|
|
12133
12122
|
return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
|
|
12134
12123
|
}
|
|
12135
|
-
function
|
|
12124
|
+
function Hg(e) {
|
|
12136
12125
|
let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
|
|
12137
12126
|
if (n) {
|
|
12138
12127
|
let e = n.trim().split(/\s+/).filter(Boolean), r = [];
|
|
@@ -12140,40 +12129,40 @@ function Wg(e) {
|
|
|
12140
12129
|
let e = t.getElementById(n);
|
|
12141
12130
|
e?.textContent && r.push(e.textContent.trim());
|
|
12142
12131
|
} catch {}
|
|
12143
|
-
if (r.length) return
|
|
12132
|
+
if (r.length) return Vg(r.join(" "));
|
|
12144
12133
|
}
|
|
12145
|
-
if (e.labels && e.labels.length) return
|
|
12134
|
+
if (e.labels && e.labels.length) return Vg(e.labels[0].textContent);
|
|
12146
12135
|
let r = e.id;
|
|
12147
12136
|
if (r) try {
|
|
12148
12137
|
let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
|
|
12149
|
-
if (e) return
|
|
12138
|
+
if (e) return Vg(e.textContent);
|
|
12150
12139
|
} catch {
|
|
12151
12140
|
let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
|
|
12152
|
-
if (e) return
|
|
12141
|
+
if (e) return Vg(e.textContent);
|
|
12153
12142
|
}
|
|
12154
12143
|
let i = e.previousElementSibling;
|
|
12155
12144
|
for (let e = 0; e < 6 && i; e += 1) {
|
|
12156
|
-
if (i.tagName === "LABEL") return
|
|
12145
|
+
if (i.tagName === "LABEL") return Vg(i.textContent);
|
|
12157
12146
|
let e = (i.className || "").toString().toLowerCase();
|
|
12158
12147
|
if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
|
|
12159
|
-
let e =
|
|
12148
|
+
let e = Vg(i.textContent);
|
|
12160
12149
|
if (e) return e;
|
|
12161
12150
|
}
|
|
12162
12151
|
i = i.previousElementSibling;
|
|
12163
12152
|
}
|
|
12164
12153
|
let a = e.parentElement;
|
|
12165
12154
|
for (let e = 0; e < 5 && a; e += 1) {
|
|
12166
|
-
if (a.tagName === "LABEL") return
|
|
12155
|
+
if (a.tagName === "LABEL") return Vg(a.textContent);
|
|
12167
12156
|
let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
|
|
12168
|
-
if (e?.textContent) return
|
|
12157
|
+
if (e?.textContent) return Vg(e.textContent);
|
|
12169
12158
|
a = a.parentElement;
|
|
12170
12159
|
}
|
|
12171
12160
|
let o = e.getAttribute("aria-label");
|
|
12172
|
-
return o ?
|
|
12161
|
+
return o ? Vg(o) : null;
|
|
12173
12162
|
}
|
|
12174
|
-
function
|
|
12163
|
+
function Ug() {
|
|
12175
12164
|
let e = [];
|
|
12176
|
-
return
|
|
12165
|
+
return Bg((t) => {
|
|
12177
12166
|
e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
|
|
12178
12167
|
if (An(e)) return !1;
|
|
12179
12168
|
let t = (e.type || "").toLowerCase();
|
|
@@ -12184,15 +12173,15 @@ function Gg() {
|
|
|
12184
12173
|
"image"
|
|
12185
12174
|
].includes(t) || e.disabled || e.readOnly) return !1;
|
|
12186
12175
|
try {
|
|
12187
|
-
let t =
|
|
12176
|
+
let t = zg(e);
|
|
12188
12177
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
12189
12178
|
} catch {}
|
|
12190
12179
|
return !0;
|
|
12191
12180
|
}));
|
|
12192
12181
|
}), e;
|
|
12193
12182
|
}
|
|
12194
|
-
function
|
|
12195
|
-
return
|
|
12183
|
+
function Wg() {
|
|
12184
|
+
return Ug().map((e, t) => {
|
|
12196
12185
|
let n = {
|
|
12197
12186
|
formIndex: 0,
|
|
12198
12187
|
fieldIndex: t,
|
|
@@ -12200,7 +12189,7 @@ function Kg() {
|
|
|
12200
12189
|
type: e.type || "text",
|
|
12201
12190
|
name: e.name || null,
|
|
12202
12191
|
id: e.id || null,
|
|
12203
|
-
label:
|
|
12192
|
+
label: Hg(e),
|
|
12204
12193
|
placeholder: e.placeholder || null
|
|
12205
12194
|
};
|
|
12206
12195
|
return e.tagName === "SELECT" && (n.options = Array.from(e.options).filter((e) => e.value !== "" && !e.disabled).map((e) => ({
|
|
@@ -12209,13 +12198,13 @@ function Kg() {
|
|
|
12209
12198
|
})), n.currentValue = e.value || null), n;
|
|
12210
12199
|
});
|
|
12211
12200
|
}
|
|
12212
|
-
function
|
|
12201
|
+
function Gg() {
|
|
12213
12202
|
let e = [];
|
|
12214
|
-
return
|
|
12203
|
+
return Bg((t) => {
|
|
12215
12204
|
e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
|
|
12216
12205
|
if (An(e) || e.disabled) return !1;
|
|
12217
12206
|
try {
|
|
12218
|
-
let t =
|
|
12207
|
+
let t = zg(e);
|
|
12219
12208
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
12220
12209
|
} catch {}
|
|
12221
12210
|
return !0;
|
|
@@ -12227,7 +12216,7 @@ function qg() {
|
|
|
12227
12216
|
type: e.type || e.tagName
|
|
12228
12217
|
}));
|
|
12229
12218
|
}
|
|
12230
|
-
function
|
|
12219
|
+
function Kg(e, t) {
|
|
12231
12220
|
try {
|
|
12232
12221
|
if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
|
|
12233
12222
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
@@ -12242,7 +12231,7 @@ function Jg(e, t) {
|
|
|
12242
12231
|
return Infinity;
|
|
12243
12232
|
}
|
|
12244
12233
|
}
|
|
12245
|
-
function
|
|
12234
|
+
function qg(e, t) {
|
|
12246
12235
|
let n = String(t || "").toLowerCase().trim();
|
|
12247
12236
|
if (!n) return 0;
|
|
12248
12237
|
let r = (e.innerText || e.textContent || "").replace(/\s+/g, " ").trim(), i = [
|
|
@@ -12260,21 +12249,21 @@ function Yg(e, t) {
|
|
|
12260
12249
|
for (let e of a) i.includes(e) && (o += 1);
|
|
12261
12250
|
return o / a.length * 92;
|
|
12262
12251
|
}
|
|
12263
|
-
function
|
|
12252
|
+
function Jg(e, t, n = 6) {
|
|
12264
12253
|
let r = String(t || "").toLowerCase().trim();
|
|
12265
12254
|
if (!r) return !1;
|
|
12266
12255
|
let i = e;
|
|
12267
12256
|
for (let e = 0; e < n && i && (i = i.parentElement, i); e++) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return !0;
|
|
12268
12257
|
return !1;
|
|
12269
12258
|
}
|
|
12270
|
-
function
|
|
12259
|
+
function Yg(e, t, n) {
|
|
12271
12260
|
let r = [];
|
|
12272
|
-
|
|
12261
|
+
Bg((e) => {
|
|
12273
12262
|
let t = Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"], a[href]"));
|
|
12274
12263
|
r.push(...t.filter((e) => {
|
|
12275
12264
|
if (An(e) || e.disabled) return !1;
|
|
12276
12265
|
try {
|
|
12277
|
-
let t =
|
|
12266
|
+
let t = zg(e);
|
|
12278
12267
|
if (t.display === "none" || t.visibility === "hidden" || t.opacity === "0") return !1;
|
|
12279
12268
|
} catch {}
|
|
12280
12269
|
return !0;
|
|
@@ -12282,14 +12271,14 @@ function Zg(e, t, n) {
|
|
|
12282
12271
|
});
|
|
12283
12272
|
let i = 0, a = r.map((t) => ({
|
|
12284
12273
|
el: t,
|
|
12285
|
-
s:
|
|
12274
|
+
s: qg(t, e)
|
|
12286
12275
|
}));
|
|
12287
12276
|
for (let { s: e } of a) e > i && (i = e);
|
|
12288
12277
|
if (i < 28) return null;
|
|
12289
12278
|
let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
|
|
12290
12279
|
if (o.length === 1) return o[0];
|
|
12291
12280
|
if (n) {
|
|
12292
|
-
let e = o.filter((e) =>
|
|
12281
|
+
let e = o.filter((e) => Jg(e, n));
|
|
12293
12282
|
if (e.length === 1) return e[0];
|
|
12294
12283
|
e.length > 1 && (o = e);
|
|
12295
12284
|
}
|
|
@@ -12297,14 +12286,14 @@ function Zg(e, t, n) {
|
|
|
12297
12286
|
if (s.length) {
|
|
12298
12287
|
let e = o[0], t = Infinity;
|
|
12299
12288
|
for (let n of o) for (let r of s) {
|
|
12300
|
-
let i =
|
|
12289
|
+
let i = Kg(n, r);
|
|
12301
12290
|
i < t && (t = i, e = n);
|
|
12302
12291
|
}
|
|
12303
12292
|
return e;
|
|
12304
12293
|
}
|
|
12305
12294
|
return o[0];
|
|
12306
12295
|
}
|
|
12307
|
-
function
|
|
12296
|
+
function Xg(e) {
|
|
12308
12297
|
if (e == null) return {};
|
|
12309
12298
|
if (typeof e == "string") {
|
|
12310
12299
|
let t = e.trim();
|
|
@@ -12317,12 +12306,12 @@ function Qg(e) {
|
|
|
12317
12306
|
}
|
|
12318
12307
|
return e;
|
|
12319
12308
|
}
|
|
12320
|
-
function
|
|
12309
|
+
function Zg(e) {
|
|
12321
12310
|
if (!e || typeof e != "object") return null;
|
|
12322
12311
|
let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
|
|
12323
12312
|
return t == null ? null : String(t).trim() || null;
|
|
12324
12313
|
}
|
|
12325
|
-
function
|
|
12314
|
+
function Qg() {
|
|
12326
12315
|
let e = {};
|
|
12327
12316
|
document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
|
|
12328
12317
|
if (t.id) return;
|
|
@@ -12337,7 +12326,7 @@ function e_() {
|
|
|
12337
12326
|
e[r] = !0, t.id = r;
|
|
12338
12327
|
});
|
|
12339
12328
|
}
|
|
12340
|
-
function
|
|
12329
|
+
function $g() {
|
|
12341
12330
|
let e = (e) => {
|
|
12342
12331
|
let t = Array.from(e).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root") && !e.closest("nav, footer, header, aside, .nav, .footer, .header, .sidebar")), n = [], r = 0;
|
|
12343
12332
|
for (; r < t.length;) {
|
|
@@ -12392,7 +12381,7 @@ function t_() {
|
|
|
12392
12381
|
containerHeadings: o
|
|
12393
12382
|
};
|
|
12394
12383
|
}
|
|
12395
|
-
function
|
|
12384
|
+
function e_(e) {
|
|
12396
12385
|
if (!e || typeof document > "u") return "";
|
|
12397
12386
|
let t = new Set([
|
|
12398
12387
|
"script",
|
|
@@ -12478,11 +12467,11 @@ function n_(e) {
|
|
|
12478
12467
|
return d.has(t) ? !1 : (d.add(t), !0);
|
|
12479
12468
|
}).join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
12480
12469
|
}
|
|
12481
|
-
function
|
|
12470
|
+
function t_(e) {
|
|
12482
12471
|
let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
|
|
12483
12472
|
"fwh-navigate-mvp": async (n) => {
|
|
12484
12473
|
if ($("fwh-navigate-mvp ▶ raw parameters:", n), e?.isWalkthroughActive?.()) return $("fwh-navigate-mvp ✖ blocked — walkthrough in progress"), "NAVIGATION_BLOCKED_DURING_WALKTHROUGH. A walkthrough of the current page is in progress, so navigation is not allowed. Do NOT tell the visitor you navigated or offer to. Describe the requested section using the CURRENT page's own content (fwh-read-content-mvp), then stop.";
|
|
12485
|
-
let i =
|
|
12474
|
+
let i = Xg(n), a = Zg(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
|
|
12486
12475
|
if ($("fwh-navigate-mvp · coerced:", {
|
|
12487
12476
|
url: a,
|
|
12488
12477
|
sectionText: o,
|
|
@@ -12522,11 +12511,11 @@ function r_(e) {
|
|
|
12522
12511
|
correctedUrl: l
|
|
12523
12512
|
}), a = l);
|
|
12524
12513
|
try {
|
|
12525
|
-
|
|
12514
|
+
bg(`Navigating to ${a}...`, { spinner: !0 }), Tg(), On();
|
|
12526
12515
|
try {
|
|
12527
12516
|
let e = r ? r() : "";
|
|
12528
12517
|
if (e && t) {
|
|
12529
|
-
let n =
|
|
12518
|
+
let n = hg([{
|
|
12530
12519
|
sender: "user",
|
|
12531
12520
|
message: e
|
|
12532
12521
|
}]);
|
|
@@ -12561,8 +12550,8 @@ function r_(e) {
|
|
|
12561
12550
|
typeof window < "u" && window.scrollTo(0, 0);
|
|
12562
12551
|
} catch {}
|
|
12563
12552
|
let o = [], s = null, c = "", l = Date.now() + 12e3;
|
|
12564
|
-
for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: o, pageTitleHeading: s, introText: c} =
|
|
12565
|
-
|
|
12553
|
+
for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: o, pageTitleHeading: s, introText: c} = $g(), !(o.length >= 1)););
|
|
12554
|
+
Qg(), $("fwh-navigate-mvp → page headings collected:", o, "titleHeading:", s);
|
|
12566
12555
|
let u = o.length ? o.join(" | ") : "none", d = o.length ? "Use ONLY these exact heading strings for fwh-highlight-mvp — never invent or abbreviate." : "No headings collected yet — call fwh-get-current-page-mvp immediately (no speech) to get the live headings before speaking or highlighting.", f = s ? ` "${s}" is the PAGE TITLE, not a content section — do not fwh-highlight-mvp it separately; if doing a walkthrough, just fold this intro into your opening line: "${c || "(no intro text found)"}"` : c ? ` No separate page-title heading detected, but this intro text precedes the first section — mention it briefly before covering sections: "${c}"` : "", p = "";
|
|
12567
12556
|
try {
|
|
12568
12557
|
if (o.length > 0) {
|
|
@@ -12570,7 +12559,7 @@ function r_(e) {
|
|
|
12570
12559
|
for (let n of e) {
|
|
12571
12560
|
let e = cr(null, n);
|
|
12572
12561
|
if (e) {
|
|
12573
|
-
let r =
|
|
12562
|
+
let r = e_(e).substring(0, 800);
|
|
12574
12563
|
r && t.push(`[Section: ${n}] ${r}`);
|
|
12575
12564
|
}
|
|
12576
12565
|
}
|
|
@@ -12579,57 +12568,57 @@ function r_(e) {
|
|
|
12579
12568
|
} catch {}
|
|
12580
12569
|
if (yr()) return _r(), $("fwh-navigate-mvp ✖ landed on a not-found/404 page:", i), `NAVIGATION_PAGE_NOT_FOUND. The page at ${i} does not exist — it shows a "not found"/404 error, not real content. Do NOT offer a page overview, do NOT describe or highlight any sections, do NOT claim the navigation succeeded. Tell the visitor EXACTLY: "It looks like that page doesn't exist — I couldn't find it. Would you like me to take you somewhere else?" Then STOP and wait for their reply.`;
|
|
12581
12570
|
let m = Date.now() + 4e3, h = typeof window < "u" ? window.location.pathname : r;
|
|
12582
|
-
for (; Date.now() < m && !
|
|
12571
|
+
for (; Date.now() < m && !Rg(h, e) && Rg(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
|
|
12583
12572
|
$("fwh-navigate-mvp route settle:", {
|
|
12584
12573
|
startPath: t,
|
|
12585
12574
|
targetPath: e,
|
|
12586
12575
|
settledPath: h
|
|
12587
12576
|
});
|
|
12588
|
-
let g = typeof window < "u" ? window.location.href : i, _ = (h.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home", v =
|
|
12577
|
+
let g = typeof window < "u" ? window.location.href : i, _ = (h.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home", v = Rg(h, e), y = !Rg(h, t), b = v || y;
|
|
12589
12578
|
return $("fwh-navigate-mvp settled:", h, "target:", e, "match:", b), b ? (_r(), `OK_NAVIGATE_SPA. Visitor is now on: ${g} (page: "${_}") | Section headings: ${u}.${f} ${d}${p} Now confirm the arrival in ONE short sentence phrased for what the visitor actually asked for — mention the page by name and what it lets them do (e.g. for a contact request: "I've taken you to the Contact Us page — filling in this form sends your query straight to our team."). Do NOT use a fixed template. Then, in the same breath, offer either a specific section or a full overview. Then STOP — wait for their reply.`) : (_r(), `NAVIGATION_DID_NOT_HAPPEN. The visitor is STILL on ${g} (page: "${_}") — the navigation did not go through. Do NOT say "I have navigated you". Do NOT claim success. Tell the visitor EXACTLY: "Sorry, I couldn't open that page just now. Would you like me to try again, or is there something else I can help with?" Then STOP and wait for their reply.`);
|
|
12590
12579
|
} catch {}
|
|
12591
12580
|
return "OK_NAVIGATE_RELOADING. The page is reloading now and this session is ending. Say NOTHING further — do not confirm the navigation, do not describe the page. The arrival greeting is spoken automatically on the new page; you resume from the visitor's next reply.";
|
|
12592
12581
|
} catch (e) {
|
|
12593
12582
|
let t = `Navigation error: ${e?.message || String(e)}`;
|
|
12594
|
-
return $("fwh-navigate-mvp ✖", t),
|
|
12583
|
+
return $("fwh-navigate-mvp ✖", t), bg("Navigation failed", {
|
|
12595
12584
|
spinner: !1,
|
|
12596
12585
|
icon: "⚠️",
|
|
12597
12586
|
duration: 1800
|
|
12598
12587
|
}), t;
|
|
12599
12588
|
} finally {
|
|
12600
|
-
|
|
12589
|
+
Eg(), xg(900);
|
|
12601
12590
|
}
|
|
12602
12591
|
},
|
|
12603
12592
|
"fwh-highlight-mvp": async (e) => {
|
|
12604
12593
|
$("fwh-highlight-mvp ▶", e);
|
|
12605
|
-
let t =
|
|
12594
|
+
let t = Xg(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
|
|
12606
12595
|
if (Rn(3e3), typeof window < "u" && window.__fe_user_nav_during_speech) {
|
|
12607
12596
|
let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
|
|
12608
12597
|
if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
|
|
12609
12598
|
else return $("flowengage_highlight ✖ blocked — user navigated during speech", e), `NAV_CHANGED: The visitor navigated from "${e.fromPageName}" to "${e.toPageName}" (current path: ${t}) while you were speaking. STOP the current walkthrough immediately. DO NOT call fwh-highlight-mvp again. Say out loud: "I see you've navigated to the ${e.toPageName} page — do you want me to continue what I was explaining, or shall I guide you through this page?" Wait for the visitor's answer before doing anything else.`;
|
|
12610
12599
|
}
|
|
12611
|
-
|
|
12600
|
+
Qg();
|
|
12612
12601
|
let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = cr(n || null, i || null);
|
|
12613
12602
|
if (!a && i) {
|
|
12614
12603
|
let e = Date.now() + 600;
|
|
12615
|
-
for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)),
|
|
12604
|
+
for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), Qg(), a = cr(null, i);
|
|
12616
12605
|
}
|
|
12617
12606
|
if (!a) {
|
|
12618
12607
|
$("fwh-highlight-mvp ✖ no element for:", i || n);
|
|
12619
|
-
let { headings: e } =
|
|
12608
|
+
let { headings: e } = $g(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
|
|
12620
12609
|
return `HIGHLIGHT_NOT_FOUND: "${i || n}" on the current page. ${t}`;
|
|
12621
12610
|
}
|
|
12622
12611
|
return Dn(a), $("fwh-highlight-mvp ✓", i || n), `OK_HIGHLIGHT: "${i || n}". Your NEXT response must be speech only (no tool call) describing THIS section — "${i || n}" — using its own content. Do not ask whether to continue.`;
|
|
12623
12612
|
},
|
|
12624
12613
|
"fwh-read-content-mvp": async (e) => {
|
|
12625
12614
|
$("fwh-read-content-mvp ▶", e);
|
|
12626
|
-
let t =
|
|
12615
|
+
let t = Xg(e), n = t?.section_text || t?.sectionText || "";
|
|
12627
12616
|
try {
|
|
12628
12617
|
let e = "";
|
|
12629
12618
|
if (n) {
|
|
12630
12619
|
let t = cr(null, n);
|
|
12631
12620
|
if (!t) return `Could not find section "${n}" on the page.`;
|
|
12632
|
-
e =
|
|
12621
|
+
e = e_(t);
|
|
12633
12622
|
} else {
|
|
12634
12623
|
let t = (document.querySelector("main") || document.querySelector("article") || document.querySelector("[role=\"main\"]") || document.querySelector("#content") || document.querySelector(".content") || document.body).cloneNode(!0);
|
|
12635
12624
|
t.querySelectorAll("nav, footer, header, aside, script, style, noscript, .nav, .footer, .header, .sidebar, #flowengage-root, .flowengage-shell, .flowengage-widget-root").forEach((e) => e.remove()), e = t.textContent.replace(/\s+/g, " ").trim();
|
|
@@ -12641,7 +12630,7 @@ function r_(e) {
|
|
|
12641
12630
|
},
|
|
12642
12631
|
"fwh-page-content-mvp": async (e) => {
|
|
12643
12632
|
$("fwh-page-content-mvp ▶", e);
|
|
12644
|
-
let r =
|
|
12633
|
+
let r = Xg(e), i = r?.url || r?.page_url || "";
|
|
12645
12634
|
if ($("fwh-page-content-mvp · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("fwh-page-content-mvp ✖ missing url"), "Missing url parameter.";
|
|
12646
12635
|
if (!t) return $("fwh-page-content-mvp ✖ no siteId"), "Site is not configured.";
|
|
12647
12636
|
if (!n) return $("fwh-page-content-mvp ✖ no api base"), "API base URL is missing; cannot fetch page content.";
|
|
@@ -12673,7 +12662,7 @@ function r_(e) {
|
|
|
12673
12662
|
},
|
|
12674
12663
|
"fwh-search-mvp": async (e) => {
|
|
12675
12664
|
$("fwh-search-mvp ▶", e);
|
|
12676
|
-
let r =
|
|
12665
|
+
let r = Xg(e).query;
|
|
12677
12666
|
if (!r) return $("fwh-search-mvp ✖ missing query"), "Missing query parameter.";
|
|
12678
12667
|
if (!t) return $("fwh-search-mvp ✖ no siteId"), "Search unavailable (no siteId configured).";
|
|
12679
12668
|
if (!n) return $("fwh-search-mvp ✖ no api base"), "Search unavailable (no API base URL).";
|
|
@@ -12711,7 +12700,7 @@ function r_(e) {
|
|
|
12711
12700
|
"[class*='menu'] a",
|
|
12712
12701
|
"[class*='header'] a"
|
|
12713
12702
|
];
|
|
12714
|
-
if (
|
|
12703
|
+
if (Bg((t) => {
|
|
12715
12704
|
for (let r of n) try {
|
|
12716
12705
|
t.querySelectorAll(r).forEach((t) => {
|
|
12717
12706
|
if (An(t)) return;
|
|
@@ -12719,7 +12708,7 @@ function r_(e) {
|
|
|
12719
12708
|
if (!r || !n || n === "#" || n.startsWith("javascript:")) return;
|
|
12720
12709
|
try {
|
|
12721
12710
|
let e = t.parentElement;
|
|
12722
|
-
if (e &&
|
|
12711
|
+
if (e && zg(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
|
|
12723
12712
|
} catch {}
|
|
12724
12713
|
let i = r.toLowerCase() + "|" + n;
|
|
12725
12714
|
e.has(i) || e.set(i, {
|
|
@@ -12730,7 +12719,7 @@ function r_(e) {
|
|
|
12730
12719
|
} catch {}
|
|
12731
12720
|
t.querySelectorAll("select").forEach((t) => {
|
|
12732
12721
|
if (An(t)) return;
|
|
12733
|
-
let n =
|
|
12722
|
+
let n = Hg(t);
|
|
12734
12723
|
/nav|menu|page|section|go to/i.test(n || t.name || t.id || "") && Array.from(t.options).forEach((r) => {
|
|
12735
12724
|
if (!r.value || r.disabled) return;
|
|
12736
12725
|
let i = r.text.trim();
|
|
@@ -12754,7 +12743,7 @@ function r_(e) {
|
|
|
12754
12743
|
if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
|
|
12755
12744
|
let e = window.location.href, t = window.location.pathname, n = document.title || "";
|
|
12756
12745
|
if (yr()) return $("fwh-get-current-page-mvp ✓ 404 detected", { url: e }), `CURRENT_PAGE_NOT_FOUND. The visitor is currently on a 404 / page-not-found error page (${e}). There is no real content here. Do NOT describe this page, do NOT list sections, do NOT offer a walkthrough, and do NOT describe it from your own knowledge. Tell the visitor plainly that the page they are on doesn't exist, and offer to take them somewhere that does.`;
|
|
12757
|
-
let { headings: r, pageTitleHeading: i, introText: a } =
|
|
12746
|
+
let { headings: r, pageTitleHeading: i, introText: a } = $g();
|
|
12758
12747
|
$("fwh-get-current-page-mvp ✓", {
|
|
12759
12748
|
url: e,
|
|
12760
12749
|
path: t,
|
|
@@ -12766,7 +12755,7 @@ function r_(e) {
|
|
|
12766
12755
|
return `CURRENT_PAGE. URL: ${e} | Title: ${n} | Page sections (${r.length} total): ${s}.${o} *** WALKTHROUGH: do NOT drive it yourself. Do not call fwh-highlight-mvp and do not decide the order — highlighting and section order are handled for you. You will be told which section to describe, one at a time. When told, describe ONLY that section in 3-4 sentences and then stop; never announce another section, never ask whether to continue. ***`;
|
|
12767
12756
|
},
|
|
12768
12757
|
"fwh-list-forms-mvp": async () => {
|
|
12769
|
-
let e =
|
|
12758
|
+
let e = Wg(), t = Gg();
|
|
12770
12759
|
$("fwh-list-forms-mvp ✓", `${e.length} field(s)`, `${t.length} button(s)`);
|
|
12771
12760
|
let n = e.map((e) => ({
|
|
12772
12761
|
...e,
|
|
@@ -12780,12 +12769,12 @@ function r_(e) {
|
|
|
12780
12769
|
},
|
|
12781
12770
|
"fwh-fill-form-mvp": async () => "FORM_FILLING_DISABLED: Form filling is not available at this time. Tell the visitor what fields are present (use fwh-list-forms-mvp) and ask them to fill the form themselves.",
|
|
12782
12771
|
"fwh-click-button-mvp": async (e) => {
|
|
12783
|
-
let t =
|
|
12772
|
+
let t = Xg(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
|
|
12784
12773
|
if ($("fwh-click-button-mvp ▶", n, r ? `(card_context: ${r})` : ""), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
|
|
12785
|
-
let a =
|
|
12774
|
+
let a = Yg(n, i, r);
|
|
12786
12775
|
if (!a) return $("fwh-click-button-mvp ✖ no match"), `Could not find a button matching "${n}". Call fwh-list-forms-mvp to see button texts.`;
|
|
12787
12776
|
try {
|
|
12788
|
-
|
|
12777
|
+
bg(`Clicking ${n}...`, { spinner: !0 });
|
|
12789
12778
|
try {
|
|
12790
12779
|
a.scrollIntoView({
|
|
12791
12780
|
block: "center",
|
|
@@ -12794,22 +12783,22 @@ function r_(e) {
|
|
|
12794
12783
|
} catch {
|
|
12795
12784
|
a.scrollIntoView(!0);
|
|
12796
12785
|
}
|
|
12797
|
-
await
|
|
12786
|
+
await jg(a), a.focus?.(), await Ng(a), Pg(a), a.click();
|
|
12798
12787
|
let e = (a.textContent || a.value || a.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
|
|
12799
|
-
return $("fwh-click-button-mvp ✓", t),
|
|
12788
|
+
return $("fwh-click-button-mvp ✓", t), bg(`Clicked ${e}`, {
|
|
12800
12789
|
spinner: !1,
|
|
12801
12790
|
icon: "✅",
|
|
12802
12791
|
duration: 1200
|
|
12803
12792
|
}), t;
|
|
12804
12793
|
} catch (e) {
|
|
12805
12794
|
let t = `Click failed: ${e?.message || String(e)}`;
|
|
12806
|
-
return $("fwh-click-button-mvp ✖", t),
|
|
12795
|
+
return $("fwh-click-button-mvp ✖", t), bg("Click failed", {
|
|
12807
12796
|
spinner: !1,
|
|
12808
12797
|
icon: "⚠️",
|
|
12809
12798
|
duration: 1800
|
|
12810
12799
|
}), t;
|
|
12811
12800
|
} finally {
|
|
12812
|
-
|
|
12801
|
+
Mg(), xg(700);
|
|
12813
12802
|
}
|
|
12814
12803
|
},
|
|
12815
12804
|
"fwh-cart-get-mvp": async () => {
|
|
@@ -12922,10 +12911,10 @@ function r_(e) {
|
|
|
12922
12911
|
clickPageButton: a["fwh-click-button-mvp"]
|
|
12923
12912
|
};
|
|
12924
12913
|
}
|
|
12925
|
-
var
|
|
12926
|
-
function
|
|
12914
|
+
var n_ = /^(get in touch|contact us|let'?s (talk|connect)|subscribe|newsletter|follow us|quick links|company|solutions|what we do|resources|legal|sitemap|share this)/i;
|
|
12915
|
+
function r_() {
|
|
12927
12916
|
try {
|
|
12928
|
-
let { headings: e, pageTitleHeading: t, containerHeadings: n } =
|
|
12917
|
+
let { headings: e, pageTitleHeading: t, containerHeadings: n } = $g(), r = new Set((n || []).map((e) => e.trim())), i = (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !n_.test(e.trim())), a = i.filter((e) => !r.has(e.trim()));
|
|
12929
12918
|
return a.length ? a : i;
|
|
12930
12919
|
} catch {
|
|
12931
12920
|
return [];
|
|
@@ -12933,7 +12922,7 @@ function a_() {
|
|
|
12933
12922
|
}
|
|
12934
12923
|
//#endregion
|
|
12935
12924
|
//#region src/utils/wrapVoiceToolsForLogging.js
|
|
12936
|
-
function
|
|
12925
|
+
function i_(e) {
|
|
12937
12926
|
return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
|
|
12938
12927
|
let r = wn();
|
|
12939
12928
|
r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
|
|
@@ -12950,11 +12939,11 @@ function o_(e) {
|
|
|
12950
12939
|
}
|
|
12951
12940
|
//#endregion
|
|
12952
12941
|
//#region src/components/FlowEngageWidget.jsx
|
|
12953
|
-
var
|
|
12954
|
-
function
|
|
12955
|
-
return `${
|
|
12942
|
+
var a_ = "[PAGE_CONTEXT]";
|
|
12943
|
+
function o_(e, t, n) {
|
|
12944
|
+
return `${a_} SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${t || ""}. ${n ? `Forms: ${n}. ` : ""}The visitor is ALREADY on this page — do NOT offer to navigate there.`;
|
|
12956
12945
|
}
|
|
12957
|
-
var
|
|
12946
|
+
var s_ = {
|
|
12958
12947
|
blue: "#135bd8",
|
|
12959
12948
|
red: "#ef334b",
|
|
12960
12949
|
yellow: "#ffbd2e",
|
|
@@ -12962,7 +12951,7 @@ var l_ = {
|
|
|
12962
12951
|
highlight: "rgba(255,255,255,0.9)",
|
|
12963
12952
|
green: "#10b981"
|
|
12964
12953
|
};
|
|
12965
|
-
function
|
|
12954
|
+
function c_(e) {
|
|
12966
12955
|
if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
|
|
12967
12956
|
let [t, n, r] = e;
|
|
12968
12957
|
return e.length >= 3 && r ? [
|
|
@@ -12976,12 +12965,12 @@ function u_(e) {
|
|
|
12976
12965
|
"#f7f8fa"
|
|
12977
12966
|
].join(", ");
|
|
12978
12967
|
}
|
|
12979
|
-
function
|
|
12968
|
+
function l_(e) {
|
|
12980
12969
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
12981
12970
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
12982
12971
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
12983
12972
|
}
|
|
12984
|
-
function
|
|
12973
|
+
function u_(t) {
|
|
12985
12974
|
let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
|
|
12986
12975
|
return e.useEffect(() => {
|
|
12987
12976
|
if (!i) {
|
|
@@ -12999,8 +12988,8 @@ function f_(t) {
|
|
|
12999
12988
|
};
|
|
13000
12989
|
}, [i]), n;
|
|
13001
12990
|
}
|
|
13002
|
-
function
|
|
13003
|
-
let r =
|
|
12991
|
+
function d_({ logo: t, style: n }) {
|
|
12992
|
+
let r = u_(typeof t == "string" ? t : null);
|
|
13004
12993
|
if (!t) return null;
|
|
13005
12994
|
if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
|
|
13006
12995
|
src: r,
|
|
@@ -13025,7 +13014,7 @@ function p_({ logo: t, style: n }) {
|
|
|
13025
13014
|
children: i
|
|
13026
13015
|
}) : null;
|
|
13027
13016
|
}
|
|
13028
|
-
function
|
|
13017
|
+
function f_({ title: e }) {
|
|
13029
13018
|
return /* @__PURE__ */ g("div", {
|
|
13030
13019
|
style: {
|
|
13031
13020
|
width: "100%",
|
|
@@ -13043,18 +13032,18 @@ function m_({ title: e }) {
|
|
|
13043
13032
|
children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
|
|
13044
13033
|
});
|
|
13045
13034
|
}
|
|
13046
|
-
function
|
|
13035
|
+
function p_(e, t) {
|
|
13047
13036
|
let n = (t || "").trim();
|
|
13048
13037
|
return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || e === "bot" && (/\b(that'?s all|we'?re done)\b/i.test(n) || /\b(goodbye|bye)\b/i.test(n) || /\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n))) : !1;
|
|
13049
13038
|
}
|
|
13050
|
-
function
|
|
13051
|
-
return /* @__PURE__ */ g(
|
|
13039
|
+
function m_({ orbColors: e, ...t }) {
|
|
13040
|
+
return /* @__PURE__ */ g(og, {
|
|
13052
13041
|
colors: e,
|
|
13053
13042
|
...t
|
|
13054
13043
|
});
|
|
13055
13044
|
}
|
|
13056
|
-
function
|
|
13057
|
-
let s = n ||
|
|
13045
|
+
function h_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
|
|
13046
|
+
let s = n || s_.green, c = l_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
|
|
13058
13047
|
style: {
|
|
13059
13048
|
display: "flex",
|
|
13060
13049
|
alignItems: a ? "flex-end" : "center",
|
|
@@ -13180,7 +13169,7 @@ function __({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
13180
13169
|
delay: 0
|
|
13181
13170
|
},
|
|
13182
13171
|
style: { flexShrink: 0 },
|
|
13183
|
-
children: /* @__PURE__ */ g(
|
|
13172
|
+
children: /* @__PURE__ */ g(m_, {
|
|
13184
13173
|
size: l,
|
|
13185
13174
|
orbColors: t
|
|
13186
13175
|
})
|
|
@@ -13212,8 +13201,8 @@ function __({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
13212
13201
|
children: u
|
|
13213
13202
|
})] });
|
|
13214
13203
|
}
|
|
13215
|
-
function
|
|
13216
|
-
let c = n ||
|
|
13204
|
+
function g_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
|
|
13205
|
+
let c = n || s_.green, l = l_(c);
|
|
13217
13206
|
return /* @__PURE__ */ _(eh.div, {
|
|
13218
13207
|
initial: {
|
|
13219
13208
|
scale: 50 / 350,
|
|
@@ -13284,7 +13273,7 @@ function v_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
13284
13273
|
children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
|
|
13285
13274
|
})
|
|
13286
13275
|
}),
|
|
13287
|
-
/* @__PURE__ */ g(
|
|
13276
|
+
/* @__PURE__ */ g(m_, {
|
|
13288
13277
|
size: 72,
|
|
13289
13278
|
orbColors: t
|
|
13290
13279
|
}),
|
|
@@ -13364,9 +13353,9 @@ function v_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
13364
13353
|
]
|
|
13365
13354
|
});
|
|
13366
13355
|
}
|
|
13367
|
-
function
|
|
13356
|
+
function __({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, voiceEndCounter: d, websiteName: f, voiceFirstMessage: h, captureVisitorEmail: v, emailRequired: y, emailCaptureEnabled: b = !0, listeningLabel: x = "Listening...", thinkingLabel: S = "Thinking...", enterChatModeLabel: C = "Enter Chat Mode", endConversationLabel: w = "End Conversation" }) {
|
|
13368
13357
|
c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
|
|
13369
|
-
let [T, E] = m("idle"), [D, O] = m(!1), [k, A] = m(!1), [ee, te] = m(!1), [ne, j] = m(""), [M, re] = m(""), ie = p(!1),
|
|
13358
|
+
let [T, E] = m("idle"), [D, O] = m(!1), [k, A] = m(!1), [ee, te] = m(!1), [ne, j] = m(""), [M, re] = m(""), ie = p(!1), ae = p(!1), N = p(null), oe = p(0), se = p(""), P = p(!1), ce = p(0), le = p(!1), ue = p(!1), de = p(!1), fe = p([]), pe = p(null), me = p(null), he = (e) => {
|
|
13370
13359
|
le.current = e, e || (ue.current = !1), F.current?.setWalkthroughActive?.(e);
|
|
13371
13360
|
};
|
|
13372
13361
|
me.current = async () => {
|
|
@@ -13413,24 +13402,24 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13413
13402
|
I.current || (I.current = !0, ye.current?.());
|
|
13414
13403
|
});
|
|
13415
13404
|
}, [l]), V = o(() => {
|
|
13416
|
-
|
|
13405
|
+
N.current &&= (clearTimeout(N.current), null);
|
|
13417
13406
|
}, []);
|
|
13418
13407
|
c(() => {
|
|
13419
13408
|
if (y) {
|
|
13420
13409
|
ie.current = !1;
|
|
13421
13410
|
return;
|
|
13422
13411
|
}
|
|
13423
|
-
if (ie.current = !0,
|
|
13424
|
-
|
|
13425
|
-
let e =
|
|
13426
|
-
|
|
13412
|
+
if (ie.current = !0, ae.current = !1, te(!1), V(), P.current) {
|
|
13413
|
+
P.current = !1, F.current?.setMicMuted?.(!1);
|
|
13414
|
+
let e = se.current;
|
|
13415
|
+
se.current = "", F.current?.injectAgentSpeech?.("Thanks — I already have your email on file.", "interrupt"), e && F.current?.sendUserMessage?.(`The visitor's email is already on file — do not ask for it. Answer their question now: "${e}"`);
|
|
13427
13416
|
}
|
|
13428
13417
|
F.current?.sendContextualUpdate?.("EMAIL REQUIREMENT SATISFIED — the visitor's email is already on file. All earlier instructions about requiring or asking for an email are VOID. Never ask for it again.");
|
|
13429
13418
|
}, [y, V]);
|
|
13430
13419
|
let Ie = /(walk\s*(me\s*)?through|walkthrough|take me through|(complete|full|detailed) (overview|understanding|walkthrough|picture|breakdown|explanation)|give me (a|an|the) (overview|tour|walk)|tell me about (each|all)|go through (it|them|each|all)|overview of|one by one|tell me everything|explain (me )?(this|the) (whole |entire |full )?page|everything (about|on) this page|show me (each|all|around))/i, Le = /(that covers everything|that was all|covered everything|that(?:'|’)?s everything)/i, Re = /^((uh+|um+|so|well|okay|ok|yeah)[,.\s]+)*(yes|yeah|yep|yup|sure|ok(ay)?|please|continue|go on|next|keep going|carry on|go ahead|resume|back to the tour)[\s.!,]*$/i, ze = /^((uh+|um+|oh|ah|so|well)[,.\s]+)*(cool|nice|great|awesome|wow|lovely|perfect|got it|gotcha|i see|understood|makes sense|interesting|right|alright|sounds good|mm+-?hmm+|hmm+|k)[\s.!,]*$/i, Be = (e) => String(e || "").replace(/[\s.,!?]*((uh+|um+|er+|hmm+|mm+)[\s.,!?]*)+$/i, "").trim(), Ve = o(() => {
|
|
13431
|
-
V(),
|
|
13432
|
-
if (!(!
|
|
13433
|
-
|
|
13420
|
+
V(), N.current = setTimeout(() => {
|
|
13421
|
+
if (!(!ae.current || ie.current)) if (oe.current < 3) {
|
|
13422
|
+
oe.current += 1;
|
|
13434
13423
|
try {
|
|
13435
13424
|
F.current?.injectAgentSpeech?.("I still need your email in the box below to continue — could you enter it, please?", "queue");
|
|
13436
13425
|
} catch {}
|
|
@@ -13439,7 +13428,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13439
13428
|
try {
|
|
13440
13429
|
F.current?.injectAgentSpeech?.("Since I haven't received your email, I'll close this session for now. Feel free to come back anytime — take care!", "queue");
|
|
13441
13430
|
} catch {}
|
|
13442
|
-
|
|
13431
|
+
ae.current = !1, te(!1), V(), Me.current = !0;
|
|
13443
13432
|
}
|
|
13444
13433
|
}, 1e4);
|
|
13445
13434
|
}, [V]), He = o(async (e) => {
|
|
@@ -13493,7 +13482,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13493
13482
|
if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
|
|
13494
13483
|
l.current = [], ve.current = "", I.current = !1, R.current = !1, we.current = !1, Te.current = "minimized", Dr({ onBeforeNavigate: () => {
|
|
13495
13484
|
if (i && l.current.length > 0) try {
|
|
13496
|
-
let e =
|
|
13485
|
+
let e = hg(l.current);
|
|
13497
13486
|
e && L(i, e);
|
|
13498
13487
|
} catch {}
|
|
13499
13488
|
if (!qn()) {
|
|
@@ -13515,7 +13504,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13515
13504
|
}
|
|
13516
13505
|
Ce();
|
|
13517
13506
|
} });
|
|
13518
|
-
let t =
|
|
13507
|
+
let t = i_(t_({
|
|
13519
13508
|
siteId: i || null,
|
|
13520
13509
|
apiBaseUrl: a || null,
|
|
13521
13510
|
chatId: s || null,
|
|
@@ -13525,7 +13514,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13525
13514
|
Me.current = !0;
|
|
13526
13515
|
},
|
|
13527
13516
|
requestEmailCollection: () => {
|
|
13528
|
-
b && (ie.current ||
|
|
13517
|
+
b && (ie.current || ae.current || (ae.current = !0, oe.current = 0, te(!0), Ve()));
|
|
13529
13518
|
}
|
|
13530
13519
|
})), n = i ? xe(i) : null, r = !!n?.transcript, u = i ? je(i) : null, p = !!u, m = typeof window < "u" ? window.location.pathname : "/", g = typeof document < "u" ? document.title : "", _ = m.replace(/^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i, "") || "/", v = _ === "/" || _ === "", x = {
|
|
13531
13520
|
apiBaseUrl: a,
|
|
@@ -13560,17 +13549,17 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13560
13549
|
let e = f || "";
|
|
13561
13550
|
x.greeting = h || (v ? e ? `Hi, welcome to ${e}! How may I help you?` : "Hi, welcome! How may I help you?" : `Welcome to ${T}! How may I help you?`), v || console.log(`[FlowEngage] 🏠 Page-context greeting: "${w}" for ${m}`);
|
|
13562
13551
|
}
|
|
13563
|
-
let A = !1, ee = p ? `NAVIGATION COMPLETE — The exact phrase "I have navigated you to the [page] page. Do you want to know about any specific section or want a complete overview?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until the visitor responds. When they reply: if they name a specific section → call fwh-get-current-page-mvp then answer immediately; if they say "overview" or anything non-specific → call fwh-get-current-page-mvp (zero speech) then do a full highlighted walkthrough.` : null, ne = !1, j = !p && !r ? "Your greeting has been spoken. Wait for the visitor to ask a question or tell you what they need. Do NOT auto-start a walkthrough or highlight any sections — let the visitor lead." : null, M = r && !p, re = !1,
|
|
13552
|
+
let A = !1, ee = p ? `NAVIGATION COMPLETE — The exact phrase "I have navigated you to the [page] page. Do you want to know about any specific section or want a complete overview?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until the visitor responds. When they reply: if they name a specific section → call fwh-get-current-page-mvp then answer immediately; if they say "overview" or anything non-specific → call fwh-get-current-page-mvp (zero speech) then do a full highlighted walkthrough.` : null, ne = !1, j = !p && !r ? "Your greeting has been spoken. Wait for the visitor to ask a question or tell you what they need. Do NOT auto-start a walkthrough or highlight any sections — let the visitor lead." : null, M = r && !p, re = !1, N = M ? `The question "Would you like me to continue what I was explaining before, or would you like to know about this page instead?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript, or the visitor navigated before saying much)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until they respond. When they reply: if they want you to CONTINUE the previous topic → resume verbally from the prior transcript above, do NOT call fwh-get-current-page-mvp or describe the new page unless they ask. If they want to know about THIS page → call fwh-get-current-page-mvp (zero speech) then proceed as a normal fresh-page walkthrough/description. If their reply is ambiguous, ask them to clarify which they'd prefer rather than guessing.` : null, ye = !1, Se = !1, ke = b && !!y && !de.current, He = await vh.startSession({
|
|
13564
13553
|
...x,
|
|
13565
13554
|
onConnect: ({ conversationId: e }) => {
|
|
13566
13555
|
Ee.current = e, De.current = Date.now(), console.log("[FlowEngage] 🎙️ AI chat session connected:", e);
|
|
13567
13556
|
},
|
|
13568
13557
|
onUnhandledClientToolCall: (e) => console.error("[FlowEngage] Unhandled tool:", e?.tool_name),
|
|
13569
13558
|
onSessionInfo: ({ emailOnFile: e }) => {
|
|
13570
|
-
de.current = !!e, e && (ie.current = !0,
|
|
13559
|
+
de.current = !!e, e && (ie.current = !0, ae.current = !1, te(!1), V(), console.log("[FlowEngage] email already on file per server — gate disabled"));
|
|
13571
13560
|
},
|
|
13572
13561
|
onAgentTurnEnd: () => {
|
|
13573
|
-
e || le.current && (ue.current ||
|
|
13562
|
+
e || le.current && (ue.current || P.current || setTimeout(() => me.current?.(), 250));
|
|
13574
13563
|
},
|
|
13575
13564
|
onSessionEnding: () => {
|
|
13576
13565
|
e || B("minimized");
|
|
@@ -13582,7 +13571,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13582
13571
|
return;
|
|
13583
13572
|
}
|
|
13584
13573
|
if (t === "user-speaking") {
|
|
13585
|
-
if (
|
|
13574
|
+
if (ae.current && !ie.current && Ve(), Fe.current &&= (clearTimeout(Fe.current), null), z.current === "speaking") return;
|
|
13586
13575
|
try {
|
|
13587
13576
|
On();
|
|
13588
13577
|
} catch {}
|
|
@@ -13612,10 +13601,10 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13612
13601
|
F.current?.sendContextualUpdate?.(ee);
|
|
13613
13602
|
} catch {}
|
|
13614
13603
|
}
|
|
13615
|
-
if (
|
|
13604
|
+
if (N && !re) {
|
|
13616
13605
|
re = !0;
|
|
13617
13606
|
try {
|
|
13618
|
-
F.current?.sendContextualUpdate?.(
|
|
13607
|
+
F.current?.sendContextualUpdate?.(N);
|
|
13619
13608
|
} catch {}
|
|
13620
13609
|
}
|
|
13621
13610
|
if (j && !ne) {
|
|
@@ -13630,9 +13619,9 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13630
13619
|
}
|
|
13631
13620
|
},
|
|
13632
13621
|
onMessage: (t) => {
|
|
13633
|
-
if (e ||
|
|
13622
|
+
if (e || P.current && t.role !== "user" && !/email/i.test(String(t.message || ""))) return;
|
|
13634
13623
|
let n = t.role === "user" && /^(Describe the section titled "|\[SYSTEM:|Give the visitor a complete spoken overview|That was the last section)/.test(String(t.message || "").trim()), r = /\b(?:this|that|the)\s+(?:case\s*stud(?:y|ies)|product|article|blog|post|item|service)\b/i.test(String(t.message || ""));
|
|
13635
|
-
if (!n && !r && t.role === "user" && Ie.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), he(!0), ue.current = !1, ce.current = 0, ge.current = -1, fe.current =
|
|
13624
|
+
if (!n && !r && t.role === "user" && Ie.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), he(!0), ue.current = !1, ce.current = 0, ge.current = -1, fe.current = r_(), pe.current = typeof window < "u" ? window.location.pathname : null, setTimeout(() => me.current?.(), 400), console.log(`[FlowEngage] walkthrough armed — ${fe.current.length} sections on this page`);
|
|
13636
13625
|
else if (!n && t.role === "user" && le.current) {
|
|
13637
13626
|
let e = String(t.message || "").trim(), n = Be(e), r = (e) => !!e && (Re.test(e) || ze.test(e));
|
|
13638
13627
|
!n || r(e) || r(n) ? ue.current && (ue.current = !1, console.debug("[FlowEngage] walkthrough resumed by visitor"), setTimeout(() => me.current?.(), 300)) : (console.log("[FlowEngage] walkthrough ended — visitor moved to a new topic"), pe.current = null, fe.current = [], he(!1));
|
|
@@ -13643,16 +13632,16 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13643
13632
|
}
|
|
13644
13633
|
let a = t.role === "user" ? "user" : "bot", o = t.message || t.text || t.content || "";
|
|
13645
13634
|
if (o) {
|
|
13646
|
-
if (a === "user" && (ve.current = o, typeof window < "u" && (window.__fe_user_nav_during_speech = null), Pe.current = !0, Ne.current &&= (clearTimeout(Ne.current), null), z.current !== "speaking" && (E("thinking"), z.current = "thinking"), ke && !ye && !ie.current && !de.current && (ye = !0,
|
|
13635
|
+
if (a === "user" && (ve.current = o, typeof window < "u" && (window.__fe_user_nav_during_speech = null), Pe.current = !0, Ne.current &&= (clearTimeout(Ne.current), null), z.current !== "speaking" && (E("thinking"), z.current = "thinking"), ke && !ye && !ie.current && !de.current && (ye = !0, se.current = o, P.current = !0, F.current?.injectAgentSpeech?.("Before I answer that, could you please enter your email in the text box below?", "interrupt"), F.current?.setMicMuted?.(!0), ae.current || (ae.current = !0, oe.current = 0, te(!0), Ve()))), l.current = [...l.current, {
|
|
13647
13636
|
sender: a,
|
|
13648
13637
|
message: o,
|
|
13649
13638
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13650
13639
|
debug: t.debug
|
|
13651
13640
|
}], i) try {
|
|
13652
|
-
let e =
|
|
13641
|
+
let e = hg(l.current);
|
|
13653
13642
|
e && L(i, e);
|
|
13654
13643
|
} catch {}
|
|
13655
|
-
if (
|
|
13644
|
+
if (p_(a, o)) {
|
|
13656
13645
|
Me.current = !0;
|
|
13657
13646
|
return;
|
|
13658
13647
|
}
|
|
@@ -13712,7 +13701,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13712
13701
|
n.length || (n = Array.from(document.body.querySelectorAll("h1, h2, h3")).filter((t) => !t.closest(e)).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200)), n.length && (o = [...new Set(n)].slice(0, 15).join(" | "));
|
|
13713
13702
|
} catch {}
|
|
13714
13703
|
let s = r && !p ? `RESUMING PRIOR SESSION — DO NOT GREET. The visitor is continuing the same conversation after a page reload. Do not introduce yourself or re-state your capabilities. Wait silently until the visitor speaks; if you must speak first, briefly acknowledge where you left off in one short sentence.\nPrior transcript:\n${n?.transcript || ""}\n\n` : "";
|
|
13715
|
-
He.sendContextualUpdate(`${s}SiteId: ${i || "unknown"}. ${y ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`), He.sendContextualUpdate(
|
|
13704
|
+
He.sendContextualUpdate(`${s}SiteId: ${i || "unknown"}. ${y ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`), He.sendContextualUpdate(o_(e, o, a));
|
|
13716
13705
|
} catch {}
|
|
13717
13706
|
if (typeof window < "u") {
|
|
13718
13707
|
let t = window.location.pathname, n = Date.now(), r = (e) => {
|
|
@@ -13748,7 +13737,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13748
13737
|
F.current?.sendUserMessage?.(`[SYSTEM: YOU just navigated the visitor to the "${m}" page (${c}) at their request — this was YOUR action, not theirs. Page title: "${l}". Sections: ${JSON.stringify(u)}. Say: "Here we are on the ${m} page." Then introduce this page in 2-3 sentences, and finish by asking: "Would you like me to walk you through it section by section?" NEVER say "I see you've navigated" — the visitor did not navigate, you did. Do NOT call fwh-navigate-mvp again. Wait for their answer before describing sections.]`, { suppressQuestion: !0 });
|
|
13749
13738
|
} catch {}
|
|
13750
13739
|
try {
|
|
13751
|
-
F.current?.sendContextualUpdate?.(
|
|
13740
|
+
F.current?.sendContextualUpdate?.(o_(c, d));
|
|
13752
13741
|
} catch {}
|
|
13753
13742
|
return;
|
|
13754
13743
|
}
|
|
@@ -13763,7 +13752,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13763
13752
|
F.current?.sendUserMessage?.(`[SYSTEM: I navigated away mid-walkthrough — I am now on the "${m}" page (${c}). Page title: "${l}". Sections: ${JSON.stringify(u)}. STOP everything. Do NOT describe the new page. Say EXACTLY: "I see you've navigated to the ${m} page — would you like me to continue what I was explaining, or shall I walk you through this page?" Then wait for my answer. IF I say continue/yes/carry on: resume speaking verbally from where you left off — do NOT call fwh-navigate-mvp, do NOT call fwh-highlight-mvp, the visitor will navigate themselves if needed. IF I want to hear about this page: call fwh-highlight-mvp for sections of "${m}" only.]`);
|
|
13764
13753
|
} catch {}
|
|
13765
13754
|
try {
|
|
13766
|
-
F.current?.sendContextualUpdate?.(
|
|
13755
|
+
F.current?.sendContextualUpdate?.(o_(c, d));
|
|
13767
13756
|
} catch {}
|
|
13768
13757
|
};
|
|
13769
13758
|
c = window.history.pushState.bind(window.history), window.history.pushState = (...e) => {
|
|
@@ -13787,7 +13776,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13787
13776
|
if (i) try {
|
|
13788
13777
|
je(i);
|
|
13789
13778
|
} catch {}
|
|
13790
|
-
typeof window < "u" && (window.__fe_user_nav_during_speech = null), Or(), Ne.current &&= (clearTimeout(Ne.current), null), Fe.current &&= (clearTimeout(Fe.current), null),
|
|
13779
|
+
typeof window < "u" && (window.__fe_user_nav_during_speech = null), Or(), Ne.current &&= (clearTimeout(Ne.current), null), Fe.current &&= (clearTimeout(Fe.current), null), N.current &&= (clearTimeout(N.current), null), Pe.current = !1, z.current = "idle", c && typeof window < "u" && (window.history.pushState = c), d && typeof window < "u" && window.removeEventListener("popstate", d);
|
|
13791
13780
|
let t = o || F.current, n = Ee.current, f = De.current;
|
|
13792
13781
|
if (t?.endSession?.().catch(() => {}), n && s && a) {
|
|
13793
13782
|
let e = f ? Math.round((Date.now() - f) / 1e3) : 0, t = JSON.stringify({
|
|
@@ -13839,13 +13828,13 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13839
13828
|
re("Please enter a valid email address.");
|
|
13840
13829
|
return;
|
|
13841
13830
|
}
|
|
13842
|
-
re(""), ie.current = !0,
|
|
13831
|
+
re(""), ie.current = !0, ae.current = !1, V(), te(!1), j(""), P.current = !1;
|
|
13843
13832
|
try {
|
|
13844
13833
|
typeof v == "function" && await v(t);
|
|
13845
13834
|
} catch {}
|
|
13846
13835
|
F.current?.setMicMuted?.(!1);
|
|
13847
|
-
let n =
|
|
13848
|
-
|
|
13836
|
+
let n = se.current;
|
|
13837
|
+
se.current = "";
|
|
13849
13838
|
try {
|
|
13850
13839
|
F.current?.injectAgentSpeech?.("Thank you for submitting your email."), F.current?.sendUserMessage?.(n || "The visitor's email is on file. Carry on helping them and never ask for it again.");
|
|
13851
13840
|
} catch {}
|
|
@@ -13975,7 +13964,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13975
13964
|
},
|
|
13976
13965
|
children: "Muted"
|
|
13977
13966
|
}),
|
|
13978
|
-
/* @__PURE__ */ g(
|
|
13967
|
+
/* @__PURE__ */ g(m_, {
|
|
13979
13968
|
size: 72,
|
|
13980
13969
|
voiceState: T,
|
|
13981
13970
|
isMuted: D,
|
|
@@ -14047,7 +14036,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14047
14036
|
y2: "23"
|
|
14048
14037
|
})
|
|
14049
14038
|
]
|
|
14050
|
-
}) : /* @__PURE__ */ g(
|
|
14039
|
+
}) : /* @__PURE__ */ g(yh, {
|
|
14051
14040
|
size: 16,
|
|
14052
14041
|
color: "currentColor"
|
|
14053
14042
|
})
|
|
@@ -14069,7 +14058,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14069
14058
|
padding: 0,
|
|
14070
14059
|
flexShrink: 0
|
|
14071
14060
|
},
|
|
14072
|
-
children: /* @__PURE__ */ g(
|
|
14061
|
+
children: /* @__PURE__ */ g(Dh, {
|
|
14073
14062
|
size: 16,
|
|
14074
14063
|
color: "currentColor"
|
|
14075
14064
|
})
|
|
@@ -14118,7 +14107,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14118
14107
|
onMouseLeave: (e) => {
|
|
14119
14108
|
e.currentTarget.style.background = "none";
|
|
14120
14109
|
},
|
|
14121
|
-
children: [/* @__PURE__ */ g(
|
|
14110
|
+
children: [/* @__PURE__ */ g(Oh, {}), C]
|
|
14122
14111
|
}),
|
|
14123
14112
|
/* @__PURE__ */ _("button", {
|
|
14124
14113
|
onClick: () => {
|
|
@@ -14147,7 +14136,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14147
14136
|
onMouseLeave: (e) => {
|
|
14148
14137
|
e.currentTarget.style.background = "none";
|
|
14149
14138
|
},
|
|
14150
|
-
children: [/* @__PURE__ */ g(
|
|
14139
|
+
children: [/* @__PURE__ */ g(kh, {}), w]
|
|
14151
14140
|
}),
|
|
14152
14141
|
/* @__PURE__ */ g("button", {
|
|
14153
14142
|
onClick: () => A(!1),
|
|
@@ -14199,7 +14188,7 @@ function y_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14199
14188
|
]
|
|
14200
14189
|
});
|
|
14201
14190
|
}
|
|
14202
|
-
function
|
|
14191
|
+
function v_({ orbColors: e }) {
|
|
14203
14192
|
let t = Array.isArray(e) && e.length > 0 ? e : [
|
|
14204
14193
|
"#135bd8",
|
|
14205
14194
|
"#ef334b",
|
|
@@ -14218,7 +14207,7 @@ function b_({ orbColors: e }) {
|
|
|
14218
14207
|
`.replace(/\s+/g, " ").trim()
|
|
14219
14208
|
} });
|
|
14220
14209
|
}
|
|
14221
|
-
var
|
|
14210
|
+
var y_ = () => /* @__PURE__ */ g("div", {
|
|
14222
14211
|
style: {
|
|
14223
14212
|
display: "flex",
|
|
14224
14213
|
marginBottom: "12px",
|
|
@@ -14248,7 +14237,7 @@ var x_ = () => /* @__PURE__ */ g("div", {
|
|
|
14248
14237
|
} }, e))
|
|
14249
14238
|
})
|
|
14250
14239
|
});
|
|
14251
|
-
function
|
|
14240
|
+
function b_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: D, selectedFile: O, onFileSelect: k, onRemoveSelectedFile: A, attachmentError: ee, isUploadingAttachment: te, requiresEmail: ne, emailInput: j, setEmailInput: M, emailError: re, emailCaptureSuccess: ie, replyContext: ae, setReplyContext: N, webRTCError: oe, micError: se, setMicError: P, dismissCallError: ce, activeCallId: le, isCallMuted: ue, toggleCallMute: de, endWebRTCCall: fe, formatCallDuration: pe, callDurationSeconds: me, isCallMinimized: he, onExpand: ge, onCollapse: F, onStartVoice: _e, voiceEnabled: ve, headerBgColor: ye, onNewChat: I, showPoweredBy: be, privacyPolicyUrl: L, getVisitorChatHistory: xe, resumeChat: Se, isSessionRestoring: R, isClosing: Ce }) {
|
|
14252
14241
|
let we = l.length > 0, Te = T || E || w, Ee = !!le, [De, Oe] = m(!1), [ke, Ae] = m(!1), [je, Me] = m([]), [z, Ne] = m(!1), Pe = p(null), [Fe, B] = m(() => typeof window < "u" ? window.visualViewport?.height ?? window.innerHeight : 600), [V, Ie] = m(0);
|
|
14253
14242
|
c(() => {
|
|
14254
14243
|
if (!s) return;
|
|
@@ -14388,7 +14377,7 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14388
14377
|
justifyContent: "center",
|
|
14389
14378
|
height: "40px"
|
|
14390
14379
|
},
|
|
14391
|
-
children: i ? /* @__PURE__ */ g(
|
|
14380
|
+
children: i ? /* @__PURE__ */ g(d_, {
|
|
14392
14381
|
logo: i,
|
|
14393
14382
|
style: {
|
|
14394
14383
|
height: "34px",
|
|
@@ -14401,7 +14390,7 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14401
14390
|
height: "40px",
|
|
14402
14391
|
flexShrink: 0
|
|
14403
14392
|
},
|
|
14404
|
-
children: /* @__PURE__ */ g(
|
|
14393
|
+
children: /* @__PURE__ */ g(f_, { title: e.chatTitle })
|
|
14405
14394
|
})
|
|
14406
14395
|
}), o && /* @__PURE__ */ g("div", {
|
|
14407
14396
|
style: {
|
|
@@ -14684,15 +14673,15 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14684
14673
|
})
|
|
14685
14674
|
]
|
|
14686
14675
|
}),
|
|
14687
|
-
/* @__PURE__ */ g(
|
|
14688
|
-
webRTCError:
|
|
14689
|
-
micError:
|
|
14690
|
-
setMicError:
|
|
14676
|
+
/* @__PURE__ */ g(Zh, {
|
|
14677
|
+
webRTCError: oe,
|
|
14678
|
+
micError: se,
|
|
14679
|
+
setMicError: P,
|
|
14691
14680
|
dismissCallError: ce,
|
|
14692
14681
|
isRateLimited: E,
|
|
14693
14682
|
rateLimitMessage: D
|
|
14694
14683
|
}),
|
|
14695
|
-
he && /* @__PURE__ */ g(
|
|
14684
|
+
he && /* @__PURE__ */ g(mg, {
|
|
14696
14685
|
agentName: v,
|
|
14697
14686
|
agentHeadshot: y,
|
|
14698
14687
|
fallbackAgentName: b,
|
|
@@ -14826,17 +14815,17 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14826
14815
|
children: "No previous chats found."
|
|
14827
14816
|
})
|
|
14828
14817
|
})]
|
|
14829
|
-
}) : null, we ? /* @__PURE__ */ g(
|
|
14818
|
+
}) : null, we ? /* @__PURE__ */ g(Jh, {
|
|
14830
14819
|
chatHistory: l,
|
|
14831
14820
|
isAiTyping: u,
|
|
14832
14821
|
isLoading: T,
|
|
14833
14822
|
isAgentTyping: d,
|
|
14834
|
-
setReplyContext:
|
|
14835
|
-
TypingDots:
|
|
14823
|
+
setReplyContext: N,
|
|
14824
|
+
TypingDots: y_,
|
|
14836
14825
|
primaryColor: n,
|
|
14837
14826
|
agentHeadshot: y,
|
|
14838
14827
|
agentDisplayName: v || b,
|
|
14839
|
-
botAvatarNode: /* @__PURE__ */ g(
|
|
14828
|
+
botAvatarNode: /* @__PURE__ */ g(v_, { orbColors: t })
|
|
14840
14829
|
}) : R ? /* @__PURE__ */ _("div", {
|
|
14841
14830
|
style: {
|
|
14842
14831
|
flex: 1,
|
|
@@ -14877,7 +14866,7 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14877
14866
|
padding: "28px 24px"
|
|
14878
14867
|
},
|
|
14879
14868
|
children: [
|
|
14880
|
-
/* @__PURE__ */ g(
|
|
14869
|
+
/* @__PURE__ */ g(m_, {
|
|
14881
14870
|
size: 94,
|
|
14882
14871
|
orbColors: t
|
|
14883
14872
|
}),
|
|
@@ -14968,7 +14957,7 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14968
14957
|
zIndex: 1,
|
|
14969
14958
|
padding: ne ? "6px 0 0" : "12px 0 0"
|
|
14970
14959
|
},
|
|
14971
|
-
children: /* @__PURE__ */ g(
|
|
14960
|
+
children: /* @__PURE__ */ g(Xh, {
|
|
14972
14961
|
input: x,
|
|
14973
14962
|
setInput: S,
|
|
14974
14963
|
onSubmit: C,
|
|
@@ -14978,8 +14967,8 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14978
14967
|
showVoiceToggle: f === "agent",
|
|
14979
14968
|
activeScreen: f,
|
|
14980
14969
|
inputDisabled: Te,
|
|
14981
|
-
replyContext:
|
|
14982
|
-
clearReplyContext: () =>
|
|
14970
|
+
replyContext: ae,
|
|
14971
|
+
clearReplyContext: () => N(null),
|
|
14983
14972
|
onFileSelect: k,
|
|
14984
14973
|
selectedFile: O,
|
|
14985
14974
|
onRemoveSelectedFile: A,
|
|
@@ -15042,14 +15031,14 @@ function S_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
15042
15031
|
]
|
|
15043
15032
|
});
|
|
15044
15033
|
}
|
|
15045
|
-
function
|
|
15046
|
-
let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: E, callConnectedAt: D, isCallMuted: O, webRTCError: k, language: A, chatId: ee, historyRef: te, onMessageSync: ne, sendMessage: j, uploadChatFile: M, openWidget: re, captureVisitorEmail: ie, setVoiceMode:
|
|
15034
|
+
function x_() {
|
|
15035
|
+
let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: E, callConnectedAt: D, isCallMuted: O, webRTCError: k, language: A, chatId: ee, historyRef: te, onMessageSync: ne, sendMessage: j, uploadChatFile: M, openWidget: re, captureVisitorEmail: ie, setVoiceMode: ae, endConversation: N, startNewChat: P, acceptCall: ce, rejectCall: le, endWebRTCCall: ue, toggleCallMute: de, dismissCallError: fe, startTyping: pe, stopTyping: me, updateTypingDraft: he, getVisitorChatHistory: ge, resumeChat: F, isSessionRestoring: _e, openToChatCounter: ve, voiceEndCounter: ye } = Cn();
|
|
15047
15036
|
c(() => {
|
|
15048
15037
|
try {
|
|
15049
15038
|
or();
|
|
15050
15039
|
} catch {}
|
|
15051
15040
|
}, []), c(() => {
|
|
15052
|
-
ve && W !== "voice_mode" && W !== "text_chat" && W !== "call_screen" && (
|
|
15041
|
+
ve && W !== "voice_mode" && W !== "text_chat" && W !== "call_screen" && (ae?.(!1), $e("text_chat"));
|
|
15053
15042
|
}, [ve]);
|
|
15054
15043
|
let I = t?.widgetSettings || {}, be = n?.widgetSettings || {}, L = {
|
|
15055
15044
|
...I.branding || {},
|
|
@@ -15064,7 +15053,7 @@ function C_() {
|
|
|
15064
15053
|
small: 50,
|
|
15065
15054
|
medium: 64,
|
|
15066
15055
|
large: 80
|
|
15067
|
-
}, Ae = ke[R.orbSize] || ke.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", z =
|
|
15056
|
+
}, Ae = ke[R.orbSize] || ke.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", z = c_(Ee ?? R.chatBgColors), Ne = L.logo || L.logoUrl || null, Pe = A || "en", Fe = I.recommendations?.[Pe] || [], B = (be.recommendations?.[Pe] ?? Fe).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
15068
15057
|
id: e.key || `qr-${t}`,
|
|
15069
15058
|
label: e.label,
|
|
15070
15059
|
message: e.label,
|
|
@@ -15122,7 +15111,7 @@ function C_() {
|
|
|
15122
15111
|
} catch {}
|
|
15123
15112
|
let n = we(), r = Je ? xe(Je) : null, i = n || !!r?.transcript;
|
|
15124
15113
|
if (t) {
|
|
15125
|
-
re?.({ notifyChatInitiated: !0 }),
|
|
15114
|
+
re?.({ notifyChatInitiated: !0 }), ae?.(!0), $e("voice_mode");
|
|
15126
15115
|
return;
|
|
15127
15116
|
}
|
|
15128
15117
|
if (De()) {
|
|
@@ -15134,13 +15123,13 @@ function C_() {
|
|
|
15134
15123
|
$e("minimized_orb");
|
|
15135
15124
|
return;
|
|
15136
15125
|
}
|
|
15137
|
-
re?.({ notifyChatInitiated: !0 }),
|
|
15126
|
+
re?.({ notifyChatInitiated: !0 }), ae?.(!0), $e("voice_mode");
|
|
15138
15127
|
return;
|
|
15139
15128
|
}
|
|
15140
15129
|
if (Je) try {
|
|
15141
15130
|
Se(Je);
|
|
15142
15131
|
} catch {}
|
|
15143
|
-
if (
|
|
15132
|
+
if (oe(Je)) {
|
|
15144
15133
|
$e("minimized_orb");
|
|
15145
15134
|
return;
|
|
15146
15135
|
}
|
|
@@ -15155,7 +15144,7 @@ function C_() {
|
|
|
15155
15144
|
let Ot = o(() => {
|
|
15156
15145
|
mt(null), gt("");
|
|
15157
15146
|
}, []), kt = o((e) => {
|
|
15158
|
-
let t =
|
|
15147
|
+
let t = Uh(e);
|
|
15159
15148
|
if (t) {
|
|
15160
15149
|
mt(null), gt(t);
|
|
15161
15150
|
return;
|
|
@@ -15198,7 +15187,7 @@ function C_() {
|
|
|
15198
15187
|
hasIncomingCall: !!w?.callId,
|
|
15199
15188
|
activeCallId: T,
|
|
15200
15189
|
callConnectionState: E
|
|
15201
|
-
}), Ct.current = e, W === "voice_mode" &&
|
|
15190
|
+
}), Ct.current = e, W === "voice_mode" && ae?.(!1), re?.(), At());
|
|
15202
15191
|
}
|
|
15203
15192
|
}, [
|
|
15204
15193
|
T,
|
|
@@ -15207,7 +15196,7 @@ function C_() {
|
|
|
15207
15196
|
w?.callId,
|
|
15208
15197
|
i,
|
|
15209
15198
|
re,
|
|
15210
|
-
|
|
15199
|
+
ae,
|
|
15211
15200
|
W
|
|
15212
15201
|
]), c(() => {
|
|
15213
15202
|
!w && !T && W === "call_screen" && $e("text_chat");
|
|
@@ -15261,7 +15250,7 @@ function C_() {
|
|
|
15261
15250
|
if (pt) {
|
|
15262
15251
|
try {
|
|
15263
15252
|
vt(!0), gt("");
|
|
15264
|
-
let e = await M(pt), n = e?.data || e, r = et.trim() || `Shared file: ${
|
|
15253
|
+
let e = await M(pt), n = e?.data || e, r = et.trim() || `Shared file: ${Gh(pt)}`;
|
|
15265
15254
|
tt(""), G(null), Ot(), await j(r, "", t, {
|
|
15266
15255
|
type: "file",
|
|
15267
15256
|
metadata: {
|
|
@@ -15281,8 +15270,8 @@ function C_() {
|
|
|
15281
15270
|
let n = et.trim();
|
|
15282
15271
|
tt(""), G(null), await j(n, "", t);
|
|
15283
15272
|
}, Pt = o(() => {
|
|
15284
|
-
r.length !== 0 &&
|
|
15285
|
-
}, [r.length,
|
|
15273
|
+
r.length !== 0 && P?.();
|
|
15274
|
+
}, [r.length, P]), Ft = (e) => {
|
|
15286
15275
|
let t = Math.floor(e / 60);
|
|
15287
15276
|
return `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
|
|
15288
15277
|
}, It = o(async (e) => {
|
|
@@ -15338,11 +15327,11 @@ function C_() {
|
|
|
15338
15327
|
t.resume().catch(() => {}), setTimeout(() => t.close().catch(() => {}), 3e3);
|
|
15339
15328
|
}
|
|
15340
15329
|
} catch {}
|
|
15341
|
-
re({ notifyChatInitiated: !0 }),
|
|
15330
|
+
re({ notifyChatInitiated: !0 }), ae?.(!0), $e("voice_mode");
|
|
15342
15331
|
}, Vt = () => {
|
|
15343
|
-
re({ notifyChatInitiated: !0 }),
|
|
15332
|
+
re({ notifyChatInitiated: !0 }), ae?.(!1), $e("text_chat");
|
|
15344
15333
|
}, Ht = () => {
|
|
15345
|
-
|
|
15334
|
+
ae?.(!1), Rt();
|
|
15346
15335
|
};
|
|
15347
15336
|
return e !== "ready" || !Be || Ce.chat === !1 || !We ? null : /* @__PURE__ */ _("div", {
|
|
15348
15337
|
className: "flowengage-widget-root",
|
|
@@ -15354,15 +15343,15 @@ function C_() {
|
|
|
15354
15343
|
onWheel: (e) => e.stopPropagation(),
|
|
15355
15344
|
onTouchMove: (e) => e.stopPropagation(),
|
|
15356
15345
|
children: [
|
|
15357
|
-
W === "entry_prompt" && /* @__PURE__ */ g(
|
|
15346
|
+
W === "entry_prompt" && /* @__PURE__ */ g(h_, {
|
|
15358
15347
|
copy: Ke,
|
|
15359
15348
|
orbColors: Ee,
|
|
15360
15349
|
primaryColor: Oe,
|
|
15361
15350
|
onYes: () => {
|
|
15362
|
-
|
|
15351
|
+
se(Je), Bt();
|
|
15363
15352
|
},
|
|
15364
15353
|
onLater: () => {
|
|
15365
|
-
|
|
15354
|
+
se(Je), Rt();
|
|
15366
15355
|
},
|
|
15367
15356
|
isMobile: Et,
|
|
15368
15357
|
isClosing: xt
|
|
@@ -15437,13 +15426,13 @@ function C_() {
|
|
|
15437
15426
|
children: E === "connected" ? `${Ft(lt)} with ${U}` : `Tap to return to ${U}`
|
|
15438
15427
|
})]
|
|
15439
15428
|
})]
|
|
15440
|
-
}), /* @__PURE__ */ g(
|
|
15429
|
+
}), /* @__PURE__ */ g(m_, {
|
|
15441
15430
|
size: Ae,
|
|
15442
15431
|
orbColors: Ee,
|
|
15443
15432
|
onClick: T ? At : Te ? zt : Vt
|
|
15444
15433
|
})]
|
|
15445
15434
|
}),
|
|
15446
|
-
W === "connection_modal" && /* @__PURE__ */ g(
|
|
15435
|
+
W === "connection_modal" && /* @__PURE__ */ g(g_, {
|
|
15447
15436
|
copy: Ke,
|
|
15448
15437
|
orbColors: Ee,
|
|
15449
15438
|
primaryColor: Oe,
|
|
@@ -15453,7 +15442,7 @@ function C_() {
|
|
|
15453
15442
|
isMobile: Et,
|
|
15454
15443
|
isClosing: xt
|
|
15455
15444
|
}),
|
|
15456
|
-
W === "voice_mode" && /* @__PURE__ */ g(
|
|
15445
|
+
W === "voice_mode" && /* @__PURE__ */ g(__, {
|
|
15457
15446
|
orbColors: Ee,
|
|
15458
15447
|
onEnterChat: Vt,
|
|
15459
15448
|
onEndChat: Ht,
|
|
@@ -15474,7 +15463,7 @@ function C_() {
|
|
|
15474
15463
|
enterChatModeLabel: L.voiceEnterChatLabel || "Enter Chat Mode",
|
|
15475
15464
|
endConversationLabel: L.voiceEndConversationLabel || "End Conversation"
|
|
15476
15465
|
}, "voice"),
|
|
15477
|
-
W === "call_screen" && /* @__PURE__ */ g(
|
|
15466
|
+
W === "call_screen" && /* @__PURE__ */ g(pg, {
|
|
15478
15467
|
incomingCall: w,
|
|
15479
15468
|
activeCallId: T,
|
|
15480
15469
|
callConnectionState: E,
|
|
@@ -15493,7 +15482,7 @@ function C_() {
|
|
|
15493
15482
|
orbColors: Ee,
|
|
15494
15483
|
chatHistory: r
|
|
15495
15484
|
}),
|
|
15496
|
-
W === "text_chat" && /* @__PURE__ */ g(
|
|
15485
|
+
W === "text_chat" && /* @__PURE__ */ g(b_, {
|
|
15497
15486
|
isClosing: xt,
|
|
15498
15487
|
copy: Ke,
|
|
15499
15488
|
orbColors: Ee,
|
|
@@ -15559,7 +15548,7 @@ function C_() {
|
|
|
15559
15548
|
}
|
|
15560
15549
|
//#endregion
|
|
15561
15550
|
//#region src/components/ErrorBoundary.jsx
|
|
15562
|
-
var
|
|
15551
|
+
var S_ = class extends e.Component {
|
|
15563
15552
|
constructor(e) {
|
|
15564
15553
|
super(e), this.state = { hasError: !1 };
|
|
15565
15554
|
}
|
|
@@ -15574,4 +15563,4 @@ var w_ = class extends e.Component {
|
|
|
15574
15563
|
}
|
|
15575
15564
|
};
|
|
15576
15565
|
//#endregion
|
|
15577
|
-
export {
|
|
15566
|
+
export { og as AnimatedOrb, S_ as ErrorBoundary, pi as FlowEngageProvider, x_ as FlowEngageWidget, Cn as useFlowEngage };
|