@flowengage/react-chatbot 6.0.26 → 6.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/flowengage-embed.js +18 -17
- package/dist/flowengage-react-chatbot.cjs +12 -11
- package/dist/flowengage-react-chatbot.mjs +171 -204
- package/package.json +1 -1
|
@@ -506,7 +506,7 @@ var k = (e) => {
|
|
|
506
506
|
let l = new ArrayBuffer(t), u = new Uint8Array(l);
|
|
507
507
|
for (r = 0; r < n; r += 4) a = at[e.charCodeAt(r)], o = at[e.charCodeAt(r + 1)], s = at[e.charCodeAt(r + 2)], c = at[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
|
|
508
508
|
return l;
|
|
509
|
-
},
|
|
509
|
+
}, A = typeof ArrayBuffer == "function", ot = (e, t) => {
|
|
510
510
|
if (typeof e != "string") return {
|
|
511
511
|
type: "message",
|
|
512
512
|
data: ct(e, t)
|
|
@@ -519,7 +519,7 @@ var k = (e) => {
|
|
|
519
519
|
type: Je[n],
|
|
520
520
|
data: e.substring(1)
|
|
521
521
|
} : { type: Je[n] } : Ye;
|
|
522
|
-
}, st = (e, t) =>
|
|
522
|
+
}, st = (e, t) => A ? ct(k(e), t) : {
|
|
523
523
|
base64: !0,
|
|
524
524
|
data: e
|
|
525
525
|
}, ct = (e, t) => {
|
|
@@ -537,7 +537,7 @@ var k = (e) => {
|
|
|
537
537
|
}, dt = (e, t) => {
|
|
538
538
|
let n = e.split(lt), r = [];
|
|
539
539
|
for (let e = 0; e < n.length; e++) {
|
|
540
|
-
let i =
|
|
540
|
+
let i = ot(n[e], t);
|
|
541
541
|
if (r.push(i), i.type === "error") break;
|
|
542
542
|
}
|
|
543
543
|
return r;
|
|
@@ -594,7 +594,7 @@ function gt(e, t) {
|
|
|
594
594
|
} else {
|
|
595
595
|
if (mt(n) < i) break;
|
|
596
596
|
let e = ht(n, i);
|
|
597
|
-
s.enqueue(
|
|
597
|
+
s.enqueue(ot(a ? e : pt.decode(e), t)), r = 0;
|
|
598
598
|
}
|
|
599
599
|
if (i === 0 || i > e) {
|
|
600
600
|
s.enqueue(Ye);
|
|
@@ -707,7 +707,7 @@ var jt = class extends Error {
|
|
|
707
707
|
this.readyState = "open", this.writable = !0, super.emitReserved("open");
|
|
708
708
|
}
|
|
709
709
|
onData(e) {
|
|
710
|
-
let t =
|
|
710
|
+
let t = ot(e, this.socket.binaryType);
|
|
711
711
|
this.onPacket(t);
|
|
712
712
|
}
|
|
713
713
|
onPacket(e) {
|
|
@@ -2118,14 +2118,11 @@ function er() {
|
|
|
2118
2118
|
if (window.ng?.getComponent || document.querySelector("[ng-version]")) return "angular";
|
|
2119
2119
|
if (window.__sveltekit_data || document.querySelector("[data-sveltekit-hydrate]")) return "sveltekit";
|
|
2120
2120
|
if (document.querySelector("[data-astro-transition]")) return "astro";
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
if (!(e === "SCRIPT" || e === "NOSCRIPT" || e === "LINK" || e === "STYLE") && (t.querySelector?.("[data-reactroot]") || t._reactRootContainer || t.__vue_app__ || !(Array.from(t.childNodes).filter((e) => e.nodeType === 3).map((e) => e.textContent.trim()).join("").length > 200) && Object.getOwnPropertyNames(t).some((e) => e.startsWith("__reactFiber$") || e.startsWith("__reactContainer$")))) return "generic-spa";
|
|
2127
|
-
}
|
|
2128
|
-
return null;
|
|
2121
|
+
let e = Array.from(document.body.children).filter((e) => {
|
|
2122
|
+
let t = e.tagName?.toUpperCase();
|
|
2123
|
+
return !(t === "SCRIPT" || t === "NOSCRIPT" || t === "LINK" || t === "STYLE" || e.id === "flowengage-root");
|
|
2124
|
+
});
|
|
2125
|
+
return e.length === 1 && e[0].id && (e[0].querySelector("[data-reactroot]") || e[0]._reactRootContainer || e[0].__vue_app__) ? "generic-spa" : null;
|
|
2129
2126
|
}
|
|
2130
2127
|
var tr = "data-fe-swap-css";
|
|
2131
2128
|
function nr() {
|
|
@@ -2839,7 +2836,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2839
2836
|
let i = f(() => e ? {
|
|
2840
2837
|
...t || {},
|
|
2841
2838
|
siteId: e
|
|
2842
|
-
} : t || null, [e, t]), [a, s] = m(0), [l, u] = m("booting"), [d, h] = m(null), [_, v] = m(null), [y, b] = m(""), [x, S] = m([]), [C, w] = m(ve().isOpen), [T, te] = m(ve().activeScreen), [ne, re] = m(ve().isHumanHandled), [E, D] = m(ve().agentName), [se, de] = m(ve().agentHeadshot), [fe, pe] = m(() => be(i?.siteId)), [me, Se] = m(!1), [Ce, we] = m(!1), [Ee, De] = m("idle"), [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, Ne] = m(""), [Fe, Ie] = m(!1), [Le, Re] = m(0), [ze, Be] = m(0), [Ve, He] = m(!1), [O, Ue] = m(null), [qe, Je] = m(null), [Ye, Xe] = m("idle"), [Ze, Qe] = m(null), [$e, et] = m(!1), [tt, nt] = m(""), [rt, it] = m(!1), at = p(null), k = p(null),
|
|
2839
|
+
} : t || null, [e, t]), [a, s] = m(0), [l, u] = m("booting"), [d, h] = m(null), [_, v] = m(null), [y, b] = m(""), [x, S] = m([]), [C, w] = m(ve().isOpen), [T, te] = m(ve().activeScreen), [ne, re] = m(ve().isHumanHandled), [E, D] = m(ve().agentName), [se, de] = m(ve().agentHeadshot), [fe, pe] = m(() => be(i?.siteId)), [me, Se] = m(!1), [Ce, we] = m(!1), [Ee, De] = m("idle"), [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, Ne] = m(""), [Fe, Ie] = m(!1), [Le, Re] = m(0), [ze, Be] = m(0), [Ve, He] = m(!1), [O, Ue] = m(null), [qe, Je] = m(null), [Ye, Xe] = m("idle"), [Ze, Qe] = m(null), [$e, et] = m(!1), [tt, nt] = m(""), [rt, it] = m(!1), at = p(null), k = p(null), A = p(""), ot = p(!1), st = p(null), ct = p(null), lt = p(null), ut = p(null), dt = p(null), ft = p(null), pt = p([]), mt = p(null), ht = p(null), gt = p(null), j = p(!1), _t = p(!1), vt = p(""), yt = p(null), bt = p(null), xt = p([]), St = p(0), Ct = p(E), wt = p([]), Tt = p(!1), Et = p(!1), Dt = p(i), Ot = p({
|
|
2843
2840
|
notifyRouteChange: () => {},
|
|
2844
2841
|
cleanup: () => {}
|
|
2845
2842
|
}), kt = o((e = {}) => {
|
|
@@ -2904,7 +2901,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2904
2901
|
if (!(!t?.connected || !n || j.current)) {
|
|
2905
2902
|
j.current = !0, t.emit("call:connected", {
|
|
2906
2903
|
callId: n,
|
|
2907
|
-
chatId:
|
|
2904
|
+
chatId: A.current,
|
|
2908
2905
|
connectedAt: e
|
|
2909
2906
|
});
|
|
2910
2907
|
try {
|
|
@@ -2971,7 +2968,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2971
2968
|
if (!t || !n?.connected || !r || !e.callId) {
|
|
2972
2969
|
console.log("[FlowEngageProvider] deferring remote offer until peer/socket ready", {
|
|
2973
2970
|
callId: e.callId,
|
|
2974
|
-
chatId:
|
|
2971
|
+
chatId: A.current,
|
|
2975
2972
|
hasPeerConnection: !!t,
|
|
2976
2973
|
socketConnected: !!n?.connected,
|
|
2977
2974
|
hasOffer: !!r
|
|
@@ -2984,7 +2981,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2984
2981
|
})), pt.current.length > 0) {
|
|
2985
2982
|
console.log("[FlowEngageProvider] flushing queued agent ICE candidates after remote offer", {
|
|
2986
2983
|
callId: e.callId,
|
|
2987
|
-
chatId:
|
|
2984
|
+
chatId: A.current,
|
|
2988
2985
|
queuedCount: pt.current.length
|
|
2989
2986
|
});
|
|
2990
2987
|
for (let e of pt.current) await t.addIceCandidate(new RTCIceCandidate(e));
|
|
@@ -2994,7 +2991,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2994
2991
|
await t.setLocalDescription(i), n.emit("call:answer", {
|
|
2995
2992
|
callId: e.callId,
|
|
2996
2993
|
sdpAnswer: i.sdp,
|
|
2997
|
-
chatId:
|
|
2994
|
+
chatId: A.current
|
|
2998
2995
|
});
|
|
2999
2996
|
};
|
|
3000
2997
|
c(() => {
|
|
@@ -3020,8 +3017,8 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3020
3017
|
if (!e) return;
|
|
3021
3018
|
let a = t.siteId, o = he(a), s = Te(a), c = "";
|
|
3022
3019
|
try {
|
|
3023
|
-
let e =
|
|
3024
|
-
if (
|
|
3020
|
+
let e = ot.current, r = st.current;
|
|
3021
|
+
if (ot.current = !1, st.current = null, c = (await We({
|
|
3025
3022
|
apiBaseUrl: t.apiBaseUrl,
|
|
3026
3023
|
userId: n.userId,
|
|
3027
3024
|
siteId: a,
|
|
@@ -3034,7 +3031,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3034
3031
|
} catch (e) {
|
|
3035
3032
|
console.warn("[FlowEngageProvider] resolve-session failed, reusing persisted or ephemeral chat id", e?.message || e), c = o || ue(), _e(a, c);
|
|
3036
3033
|
}
|
|
3037
|
-
|
|
3034
|
+
A.current = c;
|
|
3038
3035
|
let l = Ke({
|
|
3039
3036
|
apiBaseUrl: t.apiBaseUrl,
|
|
3040
3037
|
userId: n.userId,
|
|
@@ -3180,7 +3177,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3180
3177
|
if (!lt.current || !lt.current.remoteDescription) {
|
|
3181
3178
|
console.log("[FlowEngageProvider] queueing agent ICE candidate until peer/remote description is ready", {
|
|
3182
3179
|
callId: e.callId,
|
|
3183
|
-
chatId: e.chatId ||
|
|
3180
|
+
chatId: e.chatId || A.current,
|
|
3184
3181
|
queueSize: pt.current.length + 1
|
|
3185
3182
|
}), pt.current.push(t);
|
|
3186
3183
|
return;
|
|
@@ -3255,7 +3252,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3255
3252
|
a
|
|
3256
3253
|
]), c(() => () => {
|
|
3257
3254
|
if (Fe && !Tt.current && wt.current.length > 0) {
|
|
3258
|
-
let e =
|
|
3255
|
+
let e = A.current, t = wt.current, n = k.current;
|
|
3259
3256
|
n && e && t.length > 0 && (console.log("[FlowEngageProvider] safety-net: syncing voice transcript on unmount"), n.beaconSyncVoice(e, t) || n.syncVoice(e, t).catch(() => {}), Tt.current = !0);
|
|
3260
3257
|
}
|
|
3261
3258
|
}, [Fe, _]);
|
|
@@ -3265,7 +3262,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3265
3262
|
!e || !y || zt.current !== C && (C && zt.current !== null ? (e.updateChatStatus(y, "open").catch(() => {}), Bt.current = !0) : zt.current === !0 && e.updateChatStatus(y, "widget_closed").catch(() => {}), zt.current = C);
|
|
3266
3263
|
}, [C, y]), c(() => {
|
|
3267
3264
|
let e = () => {
|
|
3268
|
-
let e =
|
|
3265
|
+
let e = A.current, t = k.current;
|
|
3269
3266
|
!e || !t || typeof navigator > "u" || t.beaconWidgetClosed?.(e) || t.updateChatStatus(e, "widget_closed").catch(() => {});
|
|
3270
3267
|
};
|
|
3271
3268
|
return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
|
|
@@ -3448,10 +3445,10 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3448
3445
|
}
|
|
3449
3446
|
}, qt = async (e) => {
|
|
3450
3447
|
let t = Nt(e);
|
|
3451
|
-
if (!t || !k.current || !
|
|
3448
|
+
if (!t || !k.current || !A.current) return t;
|
|
3452
3449
|
try {
|
|
3453
3450
|
await k.current.trackVisitor({
|
|
3454
|
-
chatId:
|
|
3451
|
+
chatId: A.current,
|
|
3455
3452
|
currentPagePath: typeof window < "u" && window.location.pathname || "/",
|
|
3456
3453
|
email: t
|
|
3457
3454
|
});
|
|
@@ -3611,7 +3608,7 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3611
3608
|
At
|
|
3612
3609
|
]), c(() => {
|
|
3613
3610
|
let e = () => {
|
|
3614
|
-
let e =
|
|
3611
|
+
let e = A.current, t = k.current;
|
|
3615
3612
|
if (!t || !e) return;
|
|
3616
3613
|
if (Et.current && wt.current.length > 0 && Pe(), !Tt.current && wt.current.length > 0 && (t.beaconSyncVoice(e, wt.current) || t.syncVoice(e, wt.current).catch(() => {}), Tt.current = !0), mt.current) {
|
|
3617
3614
|
t.beaconEndWebRTCCall(mt.current, e);
|
|
@@ -3626,9 +3623,9 @@ function Rr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3626
3623
|
}, []);
|
|
3627
3624
|
let nn = o(() => {
|
|
3628
3625
|
let e = i?.siteId;
|
|
3629
|
-
ge(e),
|
|
3626
|
+
ge(e), ot.current = !0, st.current = null, at.current?.disconnect(), S([]), b(""), A.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
|
|
3630
3627
|
}, [i?.siteId]), rn = o((e) => {
|
|
3631
|
-
i?.siteId,
|
|
3628
|
+
i?.siteId, ot.current = !1, st.current = e, at.current?.disconnect(), S([]), b(""), A.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
|
|
3632
3629
|
}, [i?.siteId]), an = f(() => ({
|
|
3633
3630
|
status: l,
|
|
3634
3631
|
error: d,
|
|
@@ -29268,12 +29265,7 @@ function vk(e) {
|
|
|
29268
29265
|
let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
|
|
29269
29266
|
return t == null ? null : String(t).trim() || null;
|
|
29270
29267
|
}
|
|
29271
|
-
function yk(e) {
|
|
29272
|
-
if (!e || typeof e != "object") return null;
|
|
29273
|
-
let t = e.query ?? e.q ?? e.search ?? e.text ?? e.keywords;
|
|
29274
|
-
return t == null ? null : String(t).trim() || null;
|
|
29275
|
-
}
|
|
29276
|
-
function bk(e, t, n) {
|
|
29268
|
+
function yk(e, t, n) {
|
|
29277
29269
|
if (!n?.skipScroll) try {
|
|
29278
29270
|
e.scrollIntoView({
|
|
29279
29271
|
block: "center",
|
|
@@ -29328,7 +29320,7 @@ function bk(e, t, n) {
|
|
|
29328
29320
|
} catch {}
|
|
29329
29321
|
return !0;
|
|
29330
29322
|
}
|
|
29331
|
-
function
|
|
29323
|
+
function bk() {
|
|
29332
29324
|
let e = {};
|
|
29333
29325
|
document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
|
|
29334
29326
|
if (t.id) return;
|
|
@@ -29343,11 +29335,11 @@ function xk() {
|
|
|
29343
29335
|
e[r] = !0, t.id = r;
|
|
29344
29336
|
});
|
|
29345
29337
|
}
|
|
29346
|
-
function
|
|
29338
|
+
function xk() {
|
|
29347
29339
|
let e = document.querySelector("main, [role='main'], article") || document.body;
|
|
29348
29340
|
return Array.from(e.querySelectorAll("h1, h2, h3")).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root")).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200).slice(0, 12);
|
|
29349
29341
|
}
|
|
29350
|
-
function
|
|
29342
|
+
function Sk(e) {
|
|
29351
29343
|
let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
|
|
29352
29344
|
flowengage_navigate: async (n) => {
|
|
29353
29345
|
$("flowengage_navigate ▶ raw parameters:", n);
|
|
@@ -29378,7 +29370,7 @@ function Ck(e) {
|
|
|
29378
29370
|
siteId: t,
|
|
29379
29371
|
apiBaseUrl: e.apiBaseUrl
|
|
29380
29372
|
})) {
|
|
29381
|
-
let e = `Page "${a}" could not be verified.
|
|
29373
|
+
let e = `Page "${a}" could not be verified. Try a different URL from your known site pages, or ask the visitor to clarify which page they want.`;
|
|
29382
29374
|
return $("flowengage_navigate ✖ blocked", e), e;
|
|
29383
29375
|
}
|
|
29384
29376
|
try {
|
|
@@ -29406,10 +29398,10 @@ function Ck(e) {
|
|
|
29406
29398
|
let n = typeof window < "u" ? window.location.pathname : e, r = typeof window < "u" ? window.location.href : a, i = n === e, o = (n.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home";
|
|
29407
29399
|
$("flowengage_navigate → SPA nav complete. target:", e, "actual:", n);
|
|
29408
29400
|
let s = [], c = Date.now() + 8e3;
|
|
29409
|
-
for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s =
|
|
29410
|
-
|
|
29411
|
-
let l = s.length ? s.join(" | ") : "none", u = s.length ? "
|
|
29412
|
-
return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. ${u}
|
|
29401
|
+
for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s = xk(), !(s.length >= 1)););
|
|
29402
|
+
bk(), $("flowengage_navigate → page headings collected:", s);
|
|
29403
|
+
let l = s.length ? s.join(" | ") : "none", u = s.length ? "Use ONLY these exact heading strings for flowengage_highlight." : "No headings were collected from the live DOM — use your knowledge base heading strings for this page to call flowengage_highlight. Follow RULE 1: call each highlight BEFORE describing its section (transition → highlight → content).";
|
|
29404
|
+
return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. ${u} MANDATORY: call flowengage_highlight for EVERY section before describing it — never give a plain summary. Do NOT say "I have navigated you" or "I've taken you to" — start the highlighted walkthrough immediately.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. ${u} MANDATORY: call flowengage_highlight for EVERY section before describing it — never give a plain summary. Describe THIS page only — do not mention the page you tried to navigate to.`);
|
|
29413
29405
|
} catch {}
|
|
29414
29406
|
return "OK_NAVIGATE_RELOADING. Navigating to the page now; the voice session will resume automatically on the new page. When the session resumes, immediately introduce the new page and continue guiding the visitor — do not wait for the user to speak first.";
|
|
29415
29407
|
} catch (e) {
|
|
@@ -29431,15 +29423,15 @@ function Ck(e) {
|
|
|
29431
29423
|
if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
|
|
29432
29424
|
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 flowengage_highlight 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.`;
|
|
29433
29425
|
}
|
|
29434
|
-
|
|
29426
|
+
bk();
|
|
29435
29427
|
let i = hr(n || null, r || null);
|
|
29436
29428
|
if (!i && r) {
|
|
29437
29429
|
let e = Date.now() + 600;
|
|
29438
|
-
for (; !i && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)),
|
|
29430
|
+
for (; !i && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), bk(), i = hr(null, r);
|
|
29439
29431
|
}
|
|
29440
29432
|
if (!i) {
|
|
29441
29433
|
$("flowengage_highlight ✖ no element for:", r || n);
|
|
29442
|
-
let e =
|
|
29434
|
+
let e = xk(), t = e.length ? `Page headings: ${e.join(" | ")}. Use one of these exact strings for section_text.` : "No headings found — skip highlight and continue.";
|
|
29443
29435
|
return `HIGHLIGHT_NOT_FOUND: "${r || n}" on the current page. ${t}`;
|
|
29444
29436
|
}
|
|
29445
29437
|
return xD(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}". WALKTHROUGH: continue immediately to the next section — do NOT pause between sections.`;
|
|
@@ -29467,38 +29459,6 @@ function Ck(e) {
|
|
|
29467
29459
|
return $("flowengage_read_content ✖", e.message), `Could not read page content: ${e.message}`;
|
|
29468
29460
|
}
|
|
29469
29461
|
},
|
|
29470
|
-
flowengage_search: async (e) => {
|
|
29471
|
-
$("flowengage_search ▶", e);
|
|
29472
|
-
let r = yk(mk(e));
|
|
29473
|
-
if ($("flowengage_search · query:", r, "siteId:", t, "apiBase:", n || "(empty)"), !r) return $("flowengage_search ✖ missing query"), "Missing query parameter.";
|
|
29474
|
-
if (!t) return $("flowengage_search ✖ no siteId"), "Site is not configured for search.";
|
|
29475
|
-
if (!n) return $("flowengage_search ✖ no api base"), "API base URL is missing; cannot search.";
|
|
29476
|
-
CO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
|
|
29477
|
-
try {
|
|
29478
|
-
let e = `${n}/api/site-tools/search`;
|
|
29479
|
-
$("flowengage_search → POST", e);
|
|
29480
|
-
let i = await fetch(e, {
|
|
29481
|
-
method: "POST",
|
|
29482
|
-
headers: { "Content-Type": "application/json" },
|
|
29483
|
-
body: JSON.stringify({
|
|
29484
|
-
siteId: t,
|
|
29485
|
-
query: r,
|
|
29486
|
-
currentUrl: typeof window < "u" ? window.location.href : ""
|
|
29487
|
-
})
|
|
29488
|
-
}), a = await i.json();
|
|
29489
|
-
if ($("flowengage_search · HTTP", i.status, "success:", a.success), !a.success) {
|
|
29490
|
-
let e = a.error || "Search failed.";
|
|
29491
|
-
return $("flowengage_search ✖", e), e;
|
|
29492
|
-
}
|
|
29493
|
-
let o = a.results || [];
|
|
29494
|
-
return $("flowengage_search ✓", `${o.length} result(s)`, o.slice(0, 3).map((e) => e?.url || e)), JSON.stringify(o);
|
|
29495
|
-
} catch (e) {
|
|
29496
|
-
let t = `Search error: ${e.message || "network"}`;
|
|
29497
|
-
return $("flowengage_search ✖", t), t;
|
|
29498
|
-
} finally {
|
|
29499
|
-
wO(600);
|
|
29500
|
-
}
|
|
29501
|
-
},
|
|
29502
29462
|
flowengage_page_content: async (e) => {
|
|
29503
29463
|
$("flowengage_page_content ▶", e);
|
|
29504
29464
|
let r = mk(e), i = r?.url || r?.page_url || "";
|
|
@@ -29534,12 +29494,12 @@ function Ck(e) {
|
|
|
29534
29494
|
flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
|
|
29535
29495
|
flowengage_get_current_page: async () => {
|
|
29536
29496
|
if ($("flowengage_get_current_page ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
|
|
29537
|
-
let e = window.location.href, t = window.location.pathname, n = document.title || "", r =
|
|
29497
|
+
let e = window.location.href, t = window.location.pathname, n = document.title || "", r = xk(), i = r.length ? r.join(" | ") : "none";
|
|
29538
29498
|
return $("flowengage_get_current_page ✓", {
|
|
29539
29499
|
url: e,
|
|
29540
29500
|
path: t,
|
|
29541
29501
|
title: n
|
|
29542
|
-
}), $("flowengage_get_current_page → page headings collected:", r), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n} | Section headings: ${i}.
|
|
29502
|
+
}), $("flowengage_get_current_page → page headings collected:", r), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n} | Section headings: ${i}. Use ONLY these exact heading strings for flowengage_highlight — never invent or abbreviate section names.`;
|
|
29543
29503
|
},
|
|
29544
29504
|
flowengage_list_forms: async () => {
|
|
29545
29505
|
let e = XO(), t = ZO();
|
|
@@ -29565,12 +29525,12 @@ function Ck(e) {
|
|
|
29565
29525
|
CO(`Filling ${String(t)}...`, { spinner: !0 });
|
|
29566
29526
|
let a = YO(), o = ck(a, String(t), r);
|
|
29567
29527
|
if (o.length) {
|
|
29568
|
-
for (let [e, t] of o.entries()) jO(t), await LO(t),
|
|
29528
|
+
for (let [e, t] of o.entries()) jO(t), await LO(t), yk(t, r, { skipScroll: e > 0 }), MO(t), await HO(120);
|
|
29569
29529
|
i = o, n.push(String(t));
|
|
29570
29530
|
continue;
|
|
29571
29531
|
}
|
|
29572
29532
|
let s = dk(a, String(t));
|
|
29573
|
-
s ||= nk(a, String(t)), s ||= rk(a, String(t), r), s && (jO(s), await LO(s),
|
|
29533
|
+
s ||= nk(a, String(t)), s ||= rk(a, String(t), r), s && (jO(s), await LO(s), yk(s, r), MO(s), await HO(120), i = [s], n.push(String(t)));
|
|
29574
29534
|
}
|
|
29575
29535
|
if (!n.length) return $("flowengage_fill_form ✖ no matches"), "Could not match any fields. Call flowengage_list_forms and use field_key values that match placeholder, label, name, or id (e.g. Enter Website URL). Ensure the form is on the page, not the chat panel.";
|
|
29576
29536
|
let a = `OK_FILLED: ${n.join(", ")}`;
|
|
@@ -29627,7 +29587,6 @@ function Ck(e) {
|
|
|
29627
29587
|
return {
|
|
29628
29588
|
...a,
|
|
29629
29589
|
highlightOnPage: a.flowengage_highlight,
|
|
29630
|
-
searchSiteContent: a.flowengage_search,
|
|
29631
29590
|
getPageContent: a.flowengage_page_content,
|
|
29632
29591
|
endVoiceSession: a.flowengage_end_session,
|
|
29633
29592
|
listPageForms: a.flowengage_list_forms,
|
|
@@ -29637,7 +29596,7 @@ function Ck(e) {
|
|
|
29637
29596
|
}
|
|
29638
29597
|
//#endregion
|
|
29639
29598
|
//#region src/utils/wrapVoiceToolsForLogging.js
|
|
29640
|
-
function
|
|
29599
|
+
function Ck(e) {
|
|
29641
29600
|
return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
|
|
29642
29601
|
let r = Rn();
|
|
29643
29602
|
r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
|
|
@@ -29654,7 +29613,7 @@ function wk(e) {
|
|
|
29654
29613
|
}
|
|
29655
29614
|
//#endregion
|
|
29656
29615
|
//#region src/components/FlowEngageWidget.jsx
|
|
29657
|
-
var
|
|
29616
|
+
var wk = {
|
|
29658
29617
|
blue: "#135bd8",
|
|
29659
29618
|
red: "#ef334b",
|
|
29660
29619
|
yellow: "#ffbd2e",
|
|
@@ -29662,7 +29621,7 @@ var Tk = {
|
|
|
29662
29621
|
highlight: "rgba(255,255,255,0.9)",
|
|
29663
29622
|
green: "#10b981"
|
|
29664
29623
|
};
|
|
29665
|
-
function
|
|
29624
|
+
function Tk(e) {
|
|
29666
29625
|
if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
|
|
29667
29626
|
let [t, n, r] = e;
|
|
29668
29627
|
return e.length >= 3 && r ? [
|
|
@@ -29676,12 +29635,12 @@ function Ek(e) {
|
|
|
29676
29635
|
"#f7f8fa"
|
|
29677
29636
|
].join(", ");
|
|
29678
29637
|
}
|
|
29679
|
-
function
|
|
29638
|
+
function Ek(e) {
|
|
29680
29639
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
29681
29640
|
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;
|
|
29682
29641
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
29683
29642
|
}
|
|
29684
|
-
function
|
|
29643
|
+
function Dk(t) {
|
|
29685
29644
|
let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
|
|
29686
29645
|
return e.useEffect(() => {
|
|
29687
29646
|
if (!i) {
|
|
@@ -29699,8 +29658,8 @@ function Ok(t) {
|
|
|
29699
29658
|
};
|
|
29700
29659
|
}, [i]), n;
|
|
29701
29660
|
}
|
|
29702
|
-
function
|
|
29703
|
-
let r =
|
|
29661
|
+
function Ok({ logo: t, style: n }) {
|
|
29662
|
+
let r = Dk(typeof t == "string" ? t : null);
|
|
29704
29663
|
if (!t) return null;
|
|
29705
29664
|
if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
|
|
29706
29665
|
src: r,
|
|
@@ -29725,7 +29684,7 @@ function kk({ logo: t, style: n }) {
|
|
|
29725
29684
|
children: i
|
|
29726
29685
|
}) : null;
|
|
29727
29686
|
}
|
|
29728
|
-
function
|
|
29687
|
+
function kk({ title: e }) {
|
|
29729
29688
|
return /* @__PURE__ */ g("div", {
|
|
29730
29689
|
style: {
|
|
29731
29690
|
width: "100%",
|
|
@@ -29743,18 +29702,18 @@ function Ak({ title: e }) {
|
|
|
29743
29702
|
children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
|
|
29744
29703
|
});
|
|
29745
29704
|
}
|
|
29746
|
-
function
|
|
29705
|
+
function Ak(e, t) {
|
|
29747
29706
|
let n = (t || "").trim();
|
|
29748
29707
|
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) || /\b(that'?s all|we'?re done)\b/i.test(n) || e === "bot" && (/\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)) || /^(goodbye|bye|that'?s all|we'?re done|hang up|disconnect)\b/i.test(n)) : !1;
|
|
29749
29708
|
}
|
|
29750
|
-
function
|
|
29709
|
+
function jk({ orbColors: e, ...t }) {
|
|
29751
29710
|
return /* @__PURE__ */ g(lO, {
|
|
29752
29711
|
colors: e,
|
|
29753
29712
|
...t
|
|
29754
29713
|
});
|
|
29755
29714
|
}
|
|
29756
|
-
function
|
|
29757
|
-
let s = n ||
|
|
29715
|
+
function Mk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
|
|
29716
|
+
let s = n || wk.green, c = Ek(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
|
|
29758
29717
|
style: {
|
|
29759
29718
|
display: "flex",
|
|
29760
29719
|
alignItems: a ? "flex-end" : "center",
|
|
@@ -29875,7 +29834,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
29875
29834
|
delay: 0
|
|
29876
29835
|
},
|
|
29877
29836
|
style: { flexShrink: 0 },
|
|
29878
|
-
children: /* @__PURE__ */ g(
|
|
29837
|
+
children: /* @__PURE__ */ g(jk, {
|
|
29879
29838
|
size: l,
|
|
29880
29839
|
orbColors: t
|
|
29881
29840
|
})
|
|
@@ -29907,8 +29866,8 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
29907
29866
|
children: u
|
|
29908
29867
|
})] });
|
|
29909
29868
|
}
|
|
29910
|
-
function
|
|
29911
|
-
let c = n ||
|
|
29869
|
+
function Nk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
|
|
29870
|
+
let c = n || wk.green, l = Ek(c);
|
|
29912
29871
|
return /* @__PURE__ */ _(Dm.div, {
|
|
29913
29872
|
initial: {
|
|
29914
29873
|
scale: 50 / 350,
|
|
@@ -29979,7 +29938,7 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
29979
29938
|
children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
|
|
29980
29939
|
})
|
|
29981
29940
|
}),
|
|
29982
|
-
/* @__PURE__ */ g(
|
|
29941
|
+
/* @__PURE__ */ g(jk, {
|
|
29983
29942
|
size: 72,
|
|
29984
29943
|
orbColors: t
|
|
29985
29944
|
}),
|
|
@@ -30048,9 +30007,13 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
30048
30007
|
]
|
|
30049
30008
|
});
|
|
30050
30009
|
}
|
|
30051
|
-
function
|
|
30010
|
+
function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, voiceEndCounter: d }) {
|
|
30011
|
+
c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
|
|
30052
30012
|
let [f, h] = m("idle"), [v, y] = m(!1), [b, x] = m(!1), S = p(null), C = p(""), w = p(async () => {}), T = p(!1), ee = p(!1), te = p(!1), ne = p(!1), re = p("minimized"), E = p(null), ie = p(null), ae = p(null), oe = p(0), D = p(!1), se = p("idle"), ce = p(!1), le = p(null), ue = p(null), de = p(!1), fe = o((e = "minimized") => {
|
|
30053
|
-
|
|
30013
|
+
console.warn("[FlowEngage:VoiceDebug] 🛑 requestSessionShutdown called", {
|
|
30014
|
+
destination: e,
|
|
30015
|
+
stack: (/* @__PURE__ */ Error()).stack?.split("\n").slice(1, 4).join(" | ")
|
|
30016
|
+
}), re.current = e, ne.current = !0, queueMicrotask(() => {
|
|
30054
30017
|
T.current || (T.current = !0, w.current?.());
|
|
30055
30018
|
});
|
|
30056
30019
|
}, [l]), pe = o(async (e) => {
|
|
@@ -30126,7 +30089,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30126
30089
|
}
|
|
30127
30090
|
Pe();
|
|
30128
30091
|
} });
|
|
30129
|
-
let t =
|
|
30092
|
+
let t = Ck(Sk({
|
|
30130
30093
|
siteId: i || null,
|
|
30131
30094
|
apiBaseUrl: a || null,
|
|
30132
30095
|
getLastUserVoiceText: () => C.current,
|
|
@@ -30157,7 +30120,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30157
30120
|
m && m.includes("|") && (x = m.split("|").map((e) => e.trim()).filter(Boolean).reduce((e, t) => e.length <= t.length ? e : t));
|
|
30158
30121
|
let w = x || b || "this page";
|
|
30159
30122
|
_ ? f ? (v.overrides = { agent: { firstMessage: `I've navigated you to the ${w} page. Let me walk you through what's here.` } }, console.log(`[FlowEngage] 🔄 Agent-nav resume: firstMessage set for "${w}" (${p})`)) : u ? v.overrides = { agent: { firstMessage: "I'm still here. Go ahead!" } } : g || (v.overrides = { agent: { firstMessage: `Hi! I see you are currently on the ${w} page. Are you looking for something specific here?` } }, console.log(`[FlowEngage] 🏠 Page-context override: "${w}" for ${p}`)) : u && (v.overrides = { agent: { firstMessage: "" } });
|
|
30160
|
-
let ae = !1, pe = f ? `NAVIGATION RESUME —
|
|
30123
|
+
let ae = !1, pe = f ? `NAVIGATION RESUME — You have just navigated to a new page. Speak 2-3 sentences about this page from your knowledge, then STOP and wait for the visitor to respond. Do NOT auto-highlight or walkthrough. Prior conversation context:\n${(i ? je(i) : null)?.transcript || ""}\n\n` : null, me = await vD.startSession({
|
|
30161
30124
|
...v,
|
|
30162
30125
|
onConnect: ({ conversationId: e }) => {
|
|
30163
30126
|
E.current = e, ie.current = Date.now(), console.log("[FlowEngage] 🎙️ AI chat session connected:", e);
|
|
@@ -30200,7 +30163,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30200
30163
|
let e = vO(l.current);
|
|
30201
30164
|
e && Ae(i, e);
|
|
30202
30165
|
} catch {}
|
|
30203
|
-
if (
|
|
30166
|
+
if (Ak(n, r)) {
|
|
30204
30167
|
fe("minimized");
|
|
30205
30168
|
return;
|
|
30206
30169
|
}
|
|
@@ -30241,14 +30204,14 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30241
30204
|
}
|
|
30242
30205
|
});
|
|
30243
30206
|
if (e) {
|
|
30244
|
-
me.endSession().catch(() => {});
|
|
30207
|
+
console.warn("[FlowEngage:VoiceDebug] ❌ cancelled=true after startSession resolved — killing session immediately"), me.endSession().catch(() => {});
|
|
30245
30208
|
return;
|
|
30246
30209
|
}
|
|
30247
30210
|
o = me, S.current = me, h("listening");
|
|
30248
30211
|
try {
|
|
30249
30212
|
let e = typeof window < "u" ? window.location.href : "", r = "[]";
|
|
30250
30213
|
try {
|
|
30251
|
-
r = await t.
|
|
30214
|
+
r = await t.flowengage_list_forms();
|
|
30252
30215
|
} catch {}
|
|
30253
30216
|
let a = u && !f ? `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` : "";
|
|
30254
30217
|
me.sendContextualUpdate(`${a}Page: ${e}. SiteId: ${i || "unknown"}. Forms: ${r}. Voice: call end_voice_session or say you are ending the session to stop.`);
|
|
@@ -30293,7 +30256,11 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30293
30256
|
}, 0)));
|
|
30294
30257
|
}
|
|
30295
30258
|
})(), () => {
|
|
30296
|
-
|
|
30259
|
+
console.warn("[FlowEngage:VoiceDebug] ⚠️ useEffect CLEANUP fired — session will be killed", {
|
|
30260
|
+
agentId: r,
|
|
30261
|
+
siteId: i,
|
|
30262
|
+
apiBaseUrl: a
|
|
30263
|
+
}), e = !0, ne.current = !0;
|
|
30297
30264
|
try {
|
|
30298
30265
|
SD();
|
|
30299
30266
|
} catch {}
|
|
@@ -30301,15 +30268,15 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30301
30268
|
He(i);
|
|
30302
30269
|
} catch {}
|
|
30303
30270
|
typeof window < "u" && (window.__fe_user_nav_during_speech = null), Ar(), le.current &&= (clearTimeout(le.current), null), ue.current &&= (clearTimeout(ue.current), null), ce.current = !1, de.current = !1, se.current = "idle", c && typeof window < "u" && (window.history.pushState = c), d && typeof window < "u" && window.removeEventListener("popstate", d);
|
|
30304
|
-
let t = o || S.current, n = E.current,
|
|
30271
|
+
let t = o || S.current, n = E.current, f = ie.current;
|
|
30305
30272
|
if (t?.endSession?.().catch(() => {}), n && s && a) {
|
|
30306
|
-
let e =
|
|
30273
|
+
let e = f ? Math.round((Date.now() - f) / 1e3) : 0, t = JSON.stringify({
|
|
30307
30274
|
chatId: s,
|
|
30308
30275
|
elevenLabsConversationId: n,
|
|
30309
30276
|
duration: e,
|
|
30310
30277
|
siteId: i
|
|
30311
|
-
}),
|
|
30312
|
-
typeof navigator < "u" && navigator.sendBeacon && navigator.sendBeacon(
|
|
30278
|
+
}), r = `${a}/api/voice/save-chat-recording`;
|
|
30279
|
+
typeof navigator < "u" && navigator.sendBeacon && navigator.sendBeacon(r, new Blob([t], { type: "application/json" })) || fetch(r, {
|
|
30313
30280
|
method: "POST",
|
|
30314
30281
|
headers: { "Content-Type": "application/json" },
|
|
30315
30282
|
body: t,
|
|
@@ -30376,7 +30343,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30376
30343
|
},
|
|
30377
30344
|
children: "Muted"
|
|
30378
30345
|
}),
|
|
30379
|
-
/* @__PURE__ */ g(
|
|
30346
|
+
/* @__PURE__ */ g(jk, {
|
|
30380
30347
|
size: 72,
|
|
30381
30348
|
voiceState: f,
|
|
30382
30349
|
isMuted: v,
|
|
@@ -30614,7 +30581,7 @@ function Fk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30614
30581
|
]
|
|
30615
30582
|
});
|
|
30616
30583
|
}
|
|
30617
|
-
function
|
|
30584
|
+
function Fk({ orbColors: e }) {
|
|
30618
30585
|
return /* @__PURE__ */ g("div", {
|
|
30619
30586
|
style: {
|
|
30620
30587
|
flexShrink: 0,
|
|
@@ -30624,13 +30591,13 @@ function Ik({ orbColors: e }) {
|
|
|
30624
30591
|
alignItems: "center",
|
|
30625
30592
|
justifyContent: "center"
|
|
30626
30593
|
},
|
|
30627
|
-
children: /* @__PURE__ */ g(
|
|
30594
|
+
children: /* @__PURE__ */ g(jk, {
|
|
30628
30595
|
size: 36,
|
|
30629
30596
|
orbColors: e
|
|
30630
30597
|
})
|
|
30631
30598
|
});
|
|
30632
30599
|
}
|
|
30633
|
-
var
|
|
30600
|
+
var Ik = () => /* @__PURE__ */ g("div", {
|
|
30634
30601
|
style: {
|
|
30635
30602
|
display: "flex",
|
|
30636
30603
|
marginBottom: "12px",
|
|
@@ -30660,7 +30627,7 @@ var Lk = () => /* @__PURE__ */ g("div", {
|
|
|
30660
30627
|
} }, e))
|
|
30661
30628
|
})
|
|
30662
30629
|
});
|
|
30663
|
-
function
|
|
30630
|
+
function Lk({ 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: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, showPoweredBy: De, getVisitorChatHistory: Oe, resumeChat: ke, isSessionRestoring: Ae, isClosing: je }) {
|
|
30664
30631
|
let Me = l.length > 0, Ne = T || ee || w, Pe = !!ge, [Fe, Ie] = m(!1), [Le, Re] = m(!1), [ze, Be] = m([]), [Ve, He] = m(!1), O = p(null), [Ue, We] = m(() => typeof window < "u" ? window.visualViewport?.height ?? window.innerHeight : 600), [Ge, Ke] = m(0);
|
|
30665
30632
|
c(() => {
|
|
30666
30633
|
if (!s) return;
|
|
@@ -30796,7 +30763,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30796
30763
|
justifyContent: "center",
|
|
30797
30764
|
height: "40px"
|
|
30798
30765
|
},
|
|
30799
|
-
children: i ? /* @__PURE__ */ g(
|
|
30766
|
+
children: i ? /* @__PURE__ */ g(Ok, {
|
|
30800
30767
|
logo: i,
|
|
30801
30768
|
style: {
|
|
30802
30769
|
height: "34px",
|
|
@@ -30809,7 +30776,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30809
30776
|
height: "40px",
|
|
30810
30777
|
flexShrink: 0
|
|
30811
30778
|
},
|
|
30812
|
-
children: /* @__PURE__ */ g(
|
|
30779
|
+
children: /* @__PURE__ */ g(kk, { title: e.chatTitle })
|
|
30813
30780
|
})
|
|
30814
30781
|
}), /* @__PURE__ */ g("div", {
|
|
30815
30782
|
style: {
|
|
@@ -31239,11 +31206,11 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31239
31206
|
isLoading: T,
|
|
31240
31207
|
isAgentTyping: d,
|
|
31241
31208
|
setReplyContext: de,
|
|
31242
|
-
TypingDots:
|
|
31209
|
+
TypingDots: Ik,
|
|
31243
31210
|
primaryColor: n,
|
|
31244
31211
|
agentHeadshot: y,
|
|
31245
31212
|
agentDisplayName: v || b,
|
|
31246
|
-
botAvatarNode: /* @__PURE__ */ g(
|
|
31213
|
+
botAvatarNode: /* @__PURE__ */ g(Fk, { orbColors: t })
|
|
31247
31214
|
}) : Ae ? /* @__PURE__ */ _("div", {
|
|
31248
31215
|
style: {
|
|
31249
31216
|
flex: 1,
|
|
@@ -31284,7 +31251,7 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31284
31251
|
padding: "28px 24px"
|
|
31285
31252
|
},
|
|
31286
31253
|
children: [
|
|
31287
|
-
/* @__PURE__ */ g(
|
|
31254
|
+
/* @__PURE__ */ g(jk, {
|
|
31288
31255
|
size: 94,
|
|
31289
31256
|
orbColors: t
|
|
31290
31257
|
}),
|
|
@@ -31426,14 +31393,14 @@ function Rk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31426
31393
|
]
|
|
31427
31394
|
});
|
|
31428
31395
|
}
|
|
31429
|
-
function
|
|
31396
|
+
function Rk() {
|
|
31430
31397
|
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: ee, callConnectedAt: te, isCallMuted: ne, webRTCError: re, language: E, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: me, acceptCall: he, rejectCall: ge, endWebRTCCall: _e, toggleCallMute: ve, dismissCallError: ye, startTyping: be, stopTyping: xe, updateTypingDraft: Se, getVisitorChatHistory: Ce, resumeChat: we, isSessionRestoring: Te, openToChatCounter: Ee, voiceEndCounter: De } = Ln();
|
|
31431
31398
|
c(() => {
|
|
31432
31399
|
try {
|
|
31433
31400
|
pr();
|
|
31434
31401
|
} catch {}
|
|
31435
31402
|
}, []), c(() => {
|
|
31436
|
-
Ee && A !== "text_chat" && A !== "call_screen" && (ue?.(!1),
|
|
31403
|
+
Ee && A !== "voice_mode" && A !== "text_chat" && A !== "call_screen" && (ue?.(!1), ot("text_chat"));
|
|
31437
31404
|
}, [Ee]);
|
|
31438
31405
|
let Oe = t?.widgetSettings || {}, ke = n?.widgetSettings || {}, Ae = {
|
|
31439
31406
|
...Oe.branding || {},
|
|
@@ -31448,7 +31415,7 @@ function zk() {
|
|
|
31448
31415
|
small: 50,
|
|
31449
31416
|
medium: 64,
|
|
31450
31417
|
large: 80
|
|
31451
|
-
}, Ve = Be[Ne.orbSize] || Be.small, He = Ne.position || "bottom-right", O = Ae.fallbackAgentName || "Agent", Ue =
|
|
31418
|
+
}, Ve = Be[Ne.orbSize] || Be.small, He = Ne.position || "bottom-right", O = Ae.fallbackAgentName || "Agent", Ue = Tk(Le ?? Ne.chatBgColors), We = Ae.logo || Ae.logoUrl || null, Ge = E || "en", Ke = Oe.recommendations?.[Ge] || [], qe = (ke.recommendations?.[Ge] ?? Ke).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
31452
31419
|
id: e.key || `qr-${t}`,
|
|
31453
31420
|
label: e.label,
|
|
31454
31421
|
message: e.label,
|
|
@@ -31471,11 +31438,11 @@ function zk() {
|
|
|
31471
31438
|
]), rt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, it = r.some((e) => e.sender === "user"), at = f(() => {
|
|
31472
31439
|
let e = r.findIndex((e) => e.sender === "user");
|
|
31473
31440
|
return e === -1 ? !1 : r.slice(e + 1).some((e) => e.sender === "bot" || e.sender === "ai" || e.sender === "agent");
|
|
31474
|
-
}, [r]), k =
|
|
31441
|
+
}, [r]), k = !!(ke._dashboardLivePreview || Oe._dashboardLivePreview), [A, ot] = m(() => k ? "text_chat" : "entry_prompt"), [st, ct] = m(""), [lt, ut] = m(null), [dt, ft] = m(h || ""), [pt, mt] = m(""), [ht, gt] = m(!1), [j, _t] = m(0), [vt, yt] = m(null), [bt, xt] = m(null), [St, Ct] = m(""), [wt, Tt] = m(!1), [Et, Dt] = m(!1), [Ot, kt] = m(!1), At = p(null), jt = p(!1), Mt = !h && it && at && A !== "voice_mode";
|
|
31475
31442
|
d(() => {
|
|
31476
|
-
if (e !== "ready" ||
|
|
31477
|
-
if (
|
|
31478
|
-
|
|
31443
|
+
if (e !== "ready" || jt.current) return;
|
|
31444
|
+
if (jt.current = !0, !Ie) {
|
|
31445
|
+
ot("minimized_orb");
|
|
31479
31446
|
return;
|
|
31480
31447
|
}
|
|
31481
31448
|
let t = !1;
|
|
@@ -31484,22 +31451,22 @@ function zk() {
|
|
|
31484
31451
|
} catch {}
|
|
31485
31452
|
let n = Fe(), r = et ? je(et) : null, i = n || !!r?.transcript;
|
|
31486
31453
|
if (t) {
|
|
31487
|
-
ce?.({ notifyChatInitiated: !0 }), ue?.(!0),
|
|
31454
|
+
ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
|
|
31488
31455
|
return;
|
|
31489
31456
|
}
|
|
31490
31457
|
if (Re()) {
|
|
31491
|
-
ce?.({ notifyChatInitiated: !1 }),
|
|
31458
|
+
ce?.({ notifyChatInitiated: !1 }), ot("text_chat");
|
|
31492
31459
|
return;
|
|
31493
31460
|
}
|
|
31494
|
-
if (et) try {
|
|
31495
|
-
Me(et);
|
|
31496
|
-
} catch {}
|
|
31497
31461
|
if (i) {
|
|
31498
|
-
|
|
31462
|
+
ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
|
|
31499
31463
|
return;
|
|
31500
31464
|
}
|
|
31465
|
+
if (et) try {
|
|
31466
|
+
Me(et);
|
|
31467
|
+
} catch {}
|
|
31501
31468
|
if (fe(et)) {
|
|
31502
|
-
|
|
31469
|
+
ot("minimized_orb");
|
|
31503
31470
|
return;
|
|
31504
31471
|
}
|
|
31505
31472
|
}, [e, r]);
|
|
@@ -31508,55 +31475,55 @@ function zk() {
|
|
|
31508
31475
|
let e = window.matchMedia("(max-width: 640px)"), t = (e) => Pt(e.matches);
|
|
31509
31476
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
31510
31477
|
}, []), c(() => {
|
|
31511
|
-
|
|
31478
|
+
ft(h || ""), h && mt("");
|
|
31512
31479
|
}, [h]);
|
|
31513
31480
|
let Ft = o(() => {
|
|
31514
|
-
|
|
31481
|
+
xt(null), Ct("");
|
|
31515
31482
|
}, []), It = o((e) => {
|
|
31516
31483
|
let t = qD(e);
|
|
31517
31484
|
if (t) {
|
|
31518
|
-
|
|
31485
|
+
xt(null), Ct(t);
|
|
31519
31486
|
return;
|
|
31520
31487
|
}
|
|
31521
|
-
|
|
31488
|
+
xt(e), Ct("");
|
|
31522
31489
|
}, []);
|
|
31523
31490
|
c(() => {
|
|
31524
31491
|
if (!te || ee !== "connected") {
|
|
31525
|
-
|
|
31492
|
+
_t(0);
|
|
31526
31493
|
return;
|
|
31527
31494
|
}
|
|
31528
31495
|
let e = () => {
|
|
31529
31496
|
let e = new Date(te).getTime();
|
|
31530
|
-
isNaN(e) ||
|
|
31497
|
+
isNaN(e) || _t(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
|
|
31531
31498
|
};
|
|
31532
31499
|
e();
|
|
31533
31500
|
let t = window.setInterval(e, 1e3);
|
|
31534
31501
|
return () => window.clearInterval(t);
|
|
31535
31502
|
}, [te, ee]);
|
|
31536
31503
|
let Lt = o(() => {
|
|
31537
|
-
|
|
31504
|
+
ot("call_screen"), Dt(!1);
|
|
31538
31505
|
}, []), Rt = o(() => {
|
|
31539
|
-
|
|
31506
|
+
ot("text_chat"), Dt(!0);
|
|
31540
31507
|
}, []);
|
|
31541
31508
|
c(() => {
|
|
31542
31509
|
let e = w?.callId || T || null;
|
|
31543
31510
|
if (!e) {
|
|
31544
|
-
|
|
31511
|
+
At.current = null;
|
|
31545
31512
|
return;
|
|
31546
31513
|
}
|
|
31547
31514
|
if (w?.callId || ee === "connecting" || ee === "connected") {
|
|
31548
|
-
if (A === "minimized_orb" &&
|
|
31549
|
-
|
|
31515
|
+
if (A === "minimized_orb" && Et && T && !w?.callId) {
|
|
31516
|
+
At.current = e;
|
|
31550
31517
|
return;
|
|
31551
31518
|
}
|
|
31552
|
-
!(!i || A === "minimized_orb" || A === "voice_mode") &&
|
|
31519
|
+
!(!i || A === "minimized_orb" || A === "voice_mode") && At.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
|
|
31553
31520
|
forcedKey: e,
|
|
31554
31521
|
isOpen: i,
|
|
31555
31522
|
surface: A,
|
|
31556
31523
|
hasIncomingCall: !!w?.callId,
|
|
31557
31524
|
activeCallId: T,
|
|
31558
31525
|
callConnectionState: ee
|
|
31559
|
-
}),
|
|
31526
|
+
}), At.current = e, A === "voice_mode" && ue?.(!1), ce?.(), Lt());
|
|
31560
31527
|
}
|
|
31561
31528
|
}, [
|
|
31562
31529
|
T,
|
|
@@ -31568,31 +31535,31 @@ function zk() {
|
|
|
31568
31535
|
ue,
|
|
31569
31536
|
A
|
|
31570
31537
|
]), c(() => {
|
|
31571
|
-
!w && !T && A === "call_screen" &&
|
|
31538
|
+
!w && !T && A === "call_screen" && ot("text_chat");
|
|
31572
31539
|
}, [
|
|
31573
31540
|
w,
|
|
31574
31541
|
T,
|
|
31575
31542
|
A
|
|
31576
31543
|
]), c(() => {
|
|
31577
|
-
!T &&
|
|
31578
|
-
}, [T,
|
|
31544
|
+
!T && Et && Dt(!1);
|
|
31545
|
+
}, [T, Et]), c(() => {
|
|
31579
31546
|
if (!s || C) {
|
|
31580
31547
|
Se?.(""), xe?.();
|
|
31581
31548
|
return;
|
|
31582
31549
|
}
|
|
31583
|
-
if (!
|
|
31550
|
+
if (!st.trim() || bt) {
|
|
31584
31551
|
Se?.("");
|
|
31585
31552
|
let e = window.setTimeout(() => xe?.(), 100);
|
|
31586
31553
|
return () => window.clearTimeout(e);
|
|
31587
31554
|
}
|
|
31588
31555
|
be?.();
|
|
31589
|
-
let e = window.setTimeout(() => Se?.(
|
|
31556
|
+
let e = window.setTimeout(() => Se?.(st), 120), t = window.setTimeout(() => xe?.(), 1200);
|
|
31590
31557
|
return () => {
|
|
31591
31558
|
window.clearTimeout(e), window.clearTimeout(t);
|
|
31592
31559
|
};
|
|
31593
31560
|
}, [
|
|
31594
|
-
|
|
31595
|
-
|
|
31561
|
+
st,
|
|
31562
|
+
bt,
|
|
31596
31563
|
s,
|
|
31597
31564
|
C,
|
|
31598
31565
|
be,
|
|
@@ -31605,39 +31572,39 @@ function zk() {
|
|
|
31605
31572
|
replyToSender: e.sender || null
|
|
31606
31573
|
} : null, Bt = async (e) => {
|
|
31607
31574
|
if (e.preventDefault(), C) return;
|
|
31608
|
-
if (
|
|
31609
|
-
let e =
|
|
31575
|
+
if (Mt) {
|
|
31576
|
+
let e = dt.trim().toLowerCase();
|
|
31610
31577
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
31611
|
-
|
|
31578
|
+
mt("Please enter a valid email so we can continue helping you.");
|
|
31612
31579
|
return;
|
|
31613
31580
|
}
|
|
31614
|
-
await le(e),
|
|
31581
|
+
await le(e), mt(""), gt(!0), setTimeout(() => gt(!1), 3e3);
|
|
31615
31582
|
return;
|
|
31616
31583
|
}
|
|
31617
|
-
let t = zt(
|
|
31618
|
-
if (!
|
|
31619
|
-
if (
|
|
31584
|
+
let t = zt(lt);
|
|
31585
|
+
if (!st.trim() && !bt) return;
|
|
31586
|
+
if (bt) {
|
|
31620
31587
|
try {
|
|
31621
|
-
|
|
31622
|
-
let e = await se(
|
|
31623
|
-
|
|
31588
|
+
Tt(!0), Ct("");
|
|
31589
|
+
let e = await se(bt), n = e?.data || e, r = st.trim() || `Shared file: ${YD(bt)}`;
|
|
31590
|
+
ct(""), ut(null), Ft(), await D(r, "", t, {
|
|
31624
31591
|
type: "file",
|
|
31625
31592
|
metadata: {
|
|
31626
31593
|
fileUrl: n?.fileUrl,
|
|
31627
|
-
fileName: n?.fileName ||
|
|
31628
|
-
fileType: n?.fileType ||
|
|
31629
|
-
fileSize: n?.fileSize ||
|
|
31594
|
+
fileName: n?.fileName || bt.name,
|
|
31595
|
+
fileType: n?.fileType || bt.type,
|
|
31596
|
+
fileSize: n?.fileSize || bt.size
|
|
31630
31597
|
}
|
|
31631
31598
|
});
|
|
31632
31599
|
} catch (e) {
|
|
31633
|
-
|
|
31600
|
+
Ct(e?.message || "Failed to upload the selected file.");
|
|
31634
31601
|
} finally {
|
|
31635
|
-
|
|
31602
|
+
Tt(!1);
|
|
31636
31603
|
}
|
|
31637
31604
|
return;
|
|
31638
31605
|
}
|
|
31639
|
-
let n =
|
|
31640
|
-
|
|
31606
|
+
let n = st.trim();
|
|
31607
|
+
ct(""), ut(null), await D(n, "", t);
|
|
31641
31608
|
}, Vt = o(() => {
|
|
31642
31609
|
r.length !== 0 && me?.();
|
|
31643
31610
|
}, [r.length, me]), Ht = (e) => {
|
|
@@ -31685,10 +31652,10 @@ function zk() {
|
|
|
31685
31652
|
right: "1.5rem",
|
|
31686
31653
|
bottom: "1.5rem"
|
|
31687
31654
|
}, Gt = o(() => {
|
|
31688
|
-
A !== "minimized_orb" && (
|
|
31689
|
-
|
|
31655
|
+
A !== "minimized_orb" && (kt(!0), setTimeout(() => {
|
|
31656
|
+
ot("minimized_orb"), kt(!1), T && Dt(!0);
|
|
31690
31657
|
}, 280));
|
|
31691
|
-
}, [T, A]), Kt = () =>
|
|
31658
|
+
}, [T, A]), Kt = () => ot("connection_modal"), qt = () => {
|
|
31692
31659
|
try {
|
|
31693
31660
|
let e = window.AudioContext || window.webkitAudioContext;
|
|
31694
31661
|
if (e) {
|
|
@@ -31696,9 +31663,9 @@ function zk() {
|
|
|
31696
31663
|
t.resume().catch(() => {}), setTimeout(() => t.close().catch(() => {}), 3e3);
|
|
31697
31664
|
}
|
|
31698
31665
|
} catch {}
|
|
31699
|
-
ce({ notifyChatInitiated: !0 }), ue?.(!0),
|
|
31666
|
+
ce({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
|
|
31700
31667
|
}, Jt = () => {
|
|
31701
|
-
ce({ notifyChatInitiated: !0 }), ue?.(!1),
|
|
31668
|
+
ce({ notifyChatInitiated: !0 }), ue?.(!1), ot("text_chat");
|
|
31702
31669
|
}, Yt = () => {
|
|
31703
31670
|
ue?.(!1), Gt();
|
|
31704
31671
|
};
|
|
@@ -31712,7 +31679,7 @@ function zk() {
|
|
|
31712
31679
|
onWheel: (e) => e.stopPropagation(),
|
|
31713
31680
|
onTouchMove: (e) => e.stopPropagation(),
|
|
31714
31681
|
children: [
|
|
31715
|
-
A === "entry_prompt" && /* @__PURE__ */ g(
|
|
31682
|
+
A === "entry_prompt" && /* @__PURE__ */ g(Mk, {
|
|
31716
31683
|
copy: Qe,
|
|
31717
31684
|
orbColors: Le,
|
|
31718
31685
|
primaryColor: ze,
|
|
@@ -31723,7 +31690,7 @@ function zk() {
|
|
|
31723
31690
|
pe(et), Gt();
|
|
31724
31691
|
},
|
|
31725
31692
|
isMobile: Nt,
|
|
31726
|
-
isClosing:
|
|
31693
|
+
isClosing: Ot
|
|
31727
31694
|
}),
|
|
31728
31695
|
A === "minimized_orb" && /* @__PURE__ */ _(Dm.div, {
|
|
31729
31696
|
layoutId: "fe-main-orb",
|
|
@@ -31792,16 +31759,16 @@ function zk() {
|
|
|
31792
31759
|
marginTop: "2px",
|
|
31793
31760
|
whiteSpace: "nowrap"
|
|
31794
31761
|
},
|
|
31795
|
-
children: ee === "connected" ? `${Ht(
|
|
31762
|
+
children: ee === "connected" ? `${Ht(j)} with ${nt}` : `Tap to return to ${nt}`
|
|
31796
31763
|
})]
|
|
31797
31764
|
})]
|
|
31798
|
-
}), /* @__PURE__ */ g(
|
|
31765
|
+
}), /* @__PURE__ */ g(jk, {
|
|
31799
31766
|
size: Ve,
|
|
31800
31767
|
orbColors: Le,
|
|
31801
31768
|
onClick: T ? Lt : Ie ? Kt : Jt
|
|
31802
31769
|
})]
|
|
31803
31770
|
}),
|
|
31804
|
-
A === "connection_modal" && /* @__PURE__ */ g(
|
|
31771
|
+
A === "connection_modal" && /* @__PURE__ */ g(Nk, {
|
|
31805
31772
|
copy: Qe,
|
|
31806
31773
|
orbColors: Le,
|
|
31807
31774
|
primaryColor: ze,
|
|
@@ -31809,9 +31776,9 @@ function zk() {
|
|
|
31809
31776
|
onText: Jt,
|
|
31810
31777
|
onClose: Gt,
|
|
31811
31778
|
isMobile: Nt,
|
|
31812
|
-
isClosing:
|
|
31779
|
+
isClosing: Ot
|
|
31813
31780
|
}),
|
|
31814
|
-
A === "voice_mode" && /* @__PURE__ */ g(
|
|
31781
|
+
A === "voice_mode" && /* @__PURE__ */ g(Pk, {
|
|
31815
31782
|
orbColors: Le,
|
|
31816
31783
|
onEnterChat: Jt,
|
|
31817
31784
|
onEndChat: Yt,
|
|
@@ -31827,7 +31794,7 @@ function zk() {
|
|
|
31827
31794
|
incomingCall: w,
|
|
31828
31795
|
activeCallId: T,
|
|
31829
31796
|
callConnectionState: ee,
|
|
31830
|
-
callDurationSeconds:
|
|
31797
|
+
callDurationSeconds: j,
|
|
31831
31798
|
isCallMuted: ne,
|
|
31832
31799
|
agentName: nt,
|
|
31833
31800
|
agentHeadshot: rt,
|
|
@@ -31842,8 +31809,8 @@ function zk() {
|
|
|
31842
31809
|
orbColors: Le,
|
|
31843
31810
|
chatHistory: r
|
|
31844
31811
|
}),
|
|
31845
|
-
A === "text_chat" && /* @__PURE__ */ g(
|
|
31846
|
-
isClosing:
|
|
31812
|
+
A === "text_chat" && /* @__PURE__ */ g(Lk, {
|
|
31813
|
+
isClosing: Ot,
|
|
31847
31814
|
copy: Qe,
|
|
31848
31815
|
orbColors: Le,
|
|
31849
31816
|
primaryColor: ze,
|
|
@@ -31859,35 +31826,35 @@ function zk() {
|
|
|
31859
31826
|
agentName: nt,
|
|
31860
31827
|
agentHeadshot: rt,
|
|
31861
31828
|
fallbackAgentName: O,
|
|
31862
|
-
input:
|
|
31863
|
-
setInput:
|
|
31829
|
+
input: st,
|
|
31830
|
+
setInput: ct,
|
|
31864
31831
|
onSubmit: Bt,
|
|
31865
31832
|
isConversationEnded: C,
|
|
31866
31833
|
isLoading: b,
|
|
31867
31834
|
isRateLimited: x,
|
|
31868
31835
|
rateLimitMessage: S,
|
|
31869
|
-
selectedFile:
|
|
31836
|
+
selectedFile: bt,
|
|
31870
31837
|
onFileSelect: It,
|
|
31871
31838
|
onRemoveSelectedFile: Ft,
|
|
31872
|
-
attachmentError:
|
|
31873
|
-
isUploadingAttachment:
|
|
31874
|
-
requiresEmail:
|
|
31875
|
-
emailInput:
|
|
31876
|
-
setEmailInput:
|
|
31877
|
-
emailError:
|
|
31878
|
-
emailCaptureSuccess:
|
|
31879
|
-
replyContext:
|
|
31880
|
-
setReplyContext:
|
|
31839
|
+
attachmentError: St,
|
|
31840
|
+
isUploadingAttachment: wt,
|
|
31841
|
+
requiresEmail: Mt,
|
|
31842
|
+
emailInput: dt,
|
|
31843
|
+
setEmailInput: ft,
|
|
31844
|
+
emailError: pt,
|
|
31845
|
+
emailCaptureSuccess: ht,
|
|
31846
|
+
replyContext: lt,
|
|
31847
|
+
setReplyContext: ut,
|
|
31881
31848
|
webRTCError: re,
|
|
31882
|
-
micError:
|
|
31883
|
-
setMicError:
|
|
31849
|
+
micError: vt,
|
|
31850
|
+
setMicError: yt,
|
|
31884
31851
|
dismissCallError: ye,
|
|
31885
31852
|
activeCallId: T,
|
|
31886
31853
|
isCallMuted: ne,
|
|
31887
31854
|
toggleCallMute: ve,
|
|
31888
31855
|
endWebRTCCall: _e,
|
|
31889
31856
|
formatCallDuration: Ht,
|
|
31890
|
-
callDurationSeconds:
|
|
31857
|
+
callDurationSeconds: j,
|
|
31891
31858
|
onCollapse: Gt,
|
|
31892
31859
|
onStartVoice: qt,
|
|
31893
31860
|
onNewChat: Vt,
|
|
@@ -31905,7 +31872,7 @@ function zk() {
|
|
|
31905
31872
|
}
|
|
31906
31873
|
//#endregion
|
|
31907
31874
|
//#region src/components/ErrorBoundary.jsx
|
|
31908
|
-
var
|
|
31875
|
+
var zk = class extends e.Component {
|
|
31909
31876
|
constructor(e) {
|
|
31910
31877
|
super(e), this.state = { hasError: !1 };
|
|
31911
31878
|
}
|
|
@@ -31920,4 +31887,4 @@ var Bk = class extends e.Component {
|
|
|
31920
31887
|
}
|
|
31921
31888
|
};
|
|
31922
31889
|
//#endregion
|
|
31923
|
-
export { lO as AnimatedOrb,
|
|
31890
|
+
export { lO as AnimatedOrb, zk as ErrorBoundary, Rr as FlowEngageProvider, Rk as FlowEngageWidget, Ln as useFlowEngage };
|