@flowengage/react-chatbot 4.0.3 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flowengage-embed.js +16 -16
- package/dist/flowengage-react-chatbot.cjs +12 -12
- package/dist/flowengage-react-chatbot.mjs +620 -683
- package/package.json +1 -1
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import e, { Component as t, Fragment as n, createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useId as l, useInsertionEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
3
3
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
5
|
-
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.getOwnPropertyNames, x = Object.prototype.hasOwnProperty, S = (e, t) => () => (e && (t = e(e = 0)), t),
|
|
5
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.getOwnPropertyNames, x = Object.prototype.hasOwnProperty, S = (e, t) => () => (e && (t = e(e = 0)), t), C = (e, t) => {
|
|
6
6
|
let n = {};
|
|
7
7
|
for (var r in e) v(n, r, {
|
|
8
8
|
get: e[r],
|
|
9
9
|
enumerable: !0
|
|
10
10
|
});
|
|
11
11
|
return t || v(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
12
|
-
},
|
|
12
|
+
}, w = (e, t, n, r) => {
|
|
13
13
|
if (t && typeof t == "object" || typeof t == "function") for (var i = b(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !x.call(e, s) && s !== n && v(e, s, {
|
|
14
14
|
get: ((e) => t[e]).bind(null, s),
|
|
15
15
|
enumerable: !(r = y(t, s)) || r.enumerable
|
|
16
16
|
});
|
|
17
17
|
return e;
|
|
18
|
-
},
|
|
18
|
+
}, T = (e) => x.call(e, "module.exports") ? e["module.exports"] : w(v({}, "__esModule", { value: !0 }), e), ee = (e) => {
|
|
19
19
|
if (!e || typeof e != "object") throw Error("FlowEngage config is required");
|
|
20
20
|
if (!e.siteId || typeof e.siteId != "string") throw Error("[FlowEngage] config.siteId is required. Pass it as <FlowEngageProvider siteId=\"your-site-id\" /> or config={{ siteId: 'your-site-id' }}.");
|
|
21
21
|
let t = (e.apiBaseUrl || "https://be-flowengage-stage.oslabs.app").replace(/\/+$/, "");
|
|
@@ -23,10 +23,10 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
|
|
|
23
23
|
siteId: e.siteId.trim(),
|
|
24
24
|
apiBaseUrl: t
|
|
25
25
|
};
|
|
26
|
-
},
|
|
26
|
+
}, te = (e, t) => {
|
|
27
27
|
let n = Number.parseInt(String(e ?? ""), 10);
|
|
28
28
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
29
|
-
}, ne =
|
|
29
|
+
}, ne = te(void 0, 1e4), re = te(void 0, 15e3), E = {
|
|
30
30
|
chatId: "flowengage.chatId",
|
|
31
31
|
isOpen: "flowengage.isOpen",
|
|
32
32
|
activeScreen: "flowengage.activeScreen",
|
|
@@ -344,16 +344,6 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
|
|
|
344
344
|
async getVisitorChatThread(e) {
|
|
345
345
|
return a(`/api/visitors/my-chats/${e}`, { method: "GET" });
|
|
346
346
|
},
|
|
347
|
-
async submitFeedback(e, t, n = "") {
|
|
348
|
-
return a("/api/chat/feedback", {
|
|
349
|
-
method: "POST",
|
|
350
|
-
body: JSON.stringify({
|
|
351
|
-
chatId: e,
|
|
352
|
-
rating: t,
|
|
353
|
-
comment: n
|
|
354
|
-
})
|
|
355
|
-
});
|
|
356
|
-
},
|
|
357
347
|
async getSignedVoiceUrl(e) {
|
|
358
348
|
return a(`/api/voice/signed-url?chatId=${encodeURIComponent(e)}`, { method: "GET" });
|
|
359
349
|
},
|
|
@@ -471,7 +461,7 @@ var Qe = (e) => {
|
|
|
471
461
|
}, $e = typeof ArrayBuffer == "function", et = (e, t) => {
|
|
472
462
|
if (typeof e != "string") return {
|
|
473
463
|
type: "message",
|
|
474
|
-
data:
|
|
464
|
+
data: O(e, t)
|
|
475
465
|
};
|
|
476
466
|
let n = e.charAt(0);
|
|
477
467
|
return n === "b" ? {
|
|
@@ -481,30 +471,30 @@ var Qe = (e) => {
|
|
|
481
471
|
type: Be[n],
|
|
482
472
|
data: e.substring(1)
|
|
483
473
|
} : { type: Be[n] } : Ve;
|
|
484
|
-
}, tt = (e, t) => $e ?
|
|
474
|
+
}, tt = (e, t) => $e ? O(Qe(e), t) : {
|
|
485
475
|
base64: !0,
|
|
486
476
|
data: e
|
|
487
|
-
},
|
|
477
|
+
}, O = (e, t) => {
|
|
488
478
|
switch (t) {
|
|
489
479
|
case "blob": return e instanceof Blob ? e : new Blob([e]);
|
|
490
480
|
default: return e instanceof ArrayBuffer ? e : e.buffer;
|
|
491
481
|
}
|
|
492
|
-
},
|
|
482
|
+
}, nt = "", rt = (e, t) => {
|
|
493
483
|
let n = e.length, r = Array(n), i = 0;
|
|
494
484
|
e.forEach((e, a) => {
|
|
495
485
|
Ge(e, !1, (e) => {
|
|
496
|
-
r[a] = e, ++i === n && t(r.join(
|
|
486
|
+
r[a] = e, ++i === n && t(r.join(nt));
|
|
497
487
|
});
|
|
498
488
|
});
|
|
499
|
-
},
|
|
500
|
-
let n = e.split(
|
|
489
|
+
}, it = (e, t) => {
|
|
490
|
+
let n = e.split(nt), r = [];
|
|
501
491
|
for (let e = 0; e < n.length; e++) {
|
|
502
492
|
let i = et(n[e], t);
|
|
503
493
|
if (r.push(i), i.type === "error") break;
|
|
504
494
|
}
|
|
505
495
|
return r;
|
|
506
496
|
};
|
|
507
|
-
function
|
|
497
|
+
function at() {
|
|
508
498
|
return new TransformStream({ transform(e, t) {
|
|
509
499
|
Ye(e, (n) => {
|
|
510
500
|
let r = n.length, i;
|
|
@@ -721,7 +711,7 @@ var wt = class extends Error {
|
|
|
721
711
|
this._polling = !0, this.doPoll(), this.emitReserved("poll");
|
|
722
712
|
}
|
|
723
713
|
onData(e) {
|
|
724
|
-
|
|
714
|
+
it(e, this.socket.binaryType).forEach((e) => {
|
|
725
715
|
if (this.readyState === "opening" && e.type === "open" && this.onOpen(), e.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
|
|
726
716
|
this.onPacket(e);
|
|
727
717
|
}), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
@@ -733,7 +723,7 @@ var wt = class extends Error {
|
|
|
733
723
|
this.readyState === "open" ? e() : this.once("open", e);
|
|
734
724
|
}
|
|
735
725
|
write(e) {
|
|
736
|
-
this.writable = !1,
|
|
726
|
+
this.writable = !1, rt(e, (e) => {
|
|
737
727
|
this.doWrite(e, () => {
|
|
738
728
|
this.writable = !0, this.emitReserved("drain");
|
|
739
729
|
});
|
|
@@ -931,7 +921,7 @@ var It = typeof navigator < "u" && typeof navigator.product == "string" && navig
|
|
|
931
921
|
this.onError("webtransport error", e);
|
|
932
922
|
}), this._transport.ready.then(() => {
|
|
933
923
|
this._transport.createBidirectionalStream().then((e) => {
|
|
934
|
-
let t = lt(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r =
|
|
924
|
+
let t = lt(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = at();
|
|
935
925
|
r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
|
|
936
926
|
let i = () => {
|
|
937
927
|
n.read().then(({ done: e, value: t }) => {
|
|
@@ -1289,7 +1279,7 @@ function cn(e, t) {
|
|
|
1289
1279
|
}
|
|
1290
1280
|
//#endregion
|
|
1291
1281
|
//#region node_modules/socket.io-parser/build/esm/index.js
|
|
1292
|
-
var ln = /* @__PURE__ */
|
|
1282
|
+
var ln = /* @__PURE__ */ C({
|
|
1293
1283
|
Decoder: () => fn,
|
|
1294
1284
|
Encoder: () => dn,
|
|
1295
1285
|
PacketType: () => A,
|
|
@@ -2759,26 +2749,26 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2759
2749
|
let i = f(() => e ? {
|
|
2760
2750
|
...t || {},
|
|
2761
2751
|
siteId: e
|
|
2762
|
-
} : 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([]), [
|
|
2752
|
+
} : 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(""), [Pe, Fe] = m(!1), [ze, Be] = m(!1), [Ve, He] = m(null), [Ue, We] = m(null), [Ge, Ke] = m("idle"), [qe, Je] = m(null), [Ye, Xe] = m(!1), [Ze, Qe] = m(""), [$e, et] = m(!1), tt = p(null), O = p(null), nt = p(""), rt = p(!1), it = p(null), at = p(null), ot = p(null), st = p(null), ct = p(null), lt = p(null), k = p([]), ut = p(null), dt = p(null), ft = p(null), pt = p(!1), mt = p(!1), ht = p(""), gt = p(null), _t = p(null), vt = p([]), yt = p(0), bt = p(E), xt = p([]), St = p(!1), Ct = p({
|
|
2763
2753
|
notifyRouteChange: () => {},
|
|
2764
2754
|
cleanup: () => {}
|
|
2765
|
-
}),
|
|
2755
|
+
}), wt = o((e = {}) => {
|
|
2766
2756
|
let t = !!e.is_human_handled;
|
|
2767
|
-
return re(t), t ? (
|
|
2768
|
-
}, []),
|
|
2757
|
+
return re(t), t ? (te("agent"), e.agent_info?.name && D(e.agent_info.name), e.agent_info?.headshot && de(e.agent_info.headshot), t) : (te("ai"), t);
|
|
2758
|
+
}, []), Tt = f(() => {
|
|
2769
2759
|
let e = _?.widgetSettings?.call?.maxDurationSeconds ?? i?.widgetSettings?.call?.maxDurationSeconds ?? i?.callMaxDurationSeconds, t = Number(e);
|
|
2770
2760
|
return Number.isFinite(t) && t > 0 ? t : ae;
|
|
2771
2761
|
}, [i, _]);
|
|
2772
2762
|
c(() => {
|
|
2773
|
-
|
|
2774
|
-
}, [
|
|
2775
|
-
|
|
2763
|
+
at.current = Ve;
|
|
2764
|
+
}, [Ve]), c(() => {
|
|
2765
|
+
bt.current = E;
|
|
2776
2766
|
}, [E]);
|
|
2777
|
-
let
|
|
2778
|
-
|
|
2779
|
-
},
|
|
2780
|
-
|
|
2781
|
-
}, []),
|
|
2767
|
+
let Et = () => {
|
|
2768
|
+
Qe("");
|
|
2769
|
+
}, Dt = o(() => {
|
|
2770
|
+
ft.current &&= (window.clearTimeout(ft.current), null);
|
|
2771
|
+
}, []), Ot = (e) => {
|
|
2782
2772
|
let t = typeof e == "string" ? e.trim().toLowerCase() : "";
|
|
2783
2773
|
return pe(t), xe(t, i?.siteId), t;
|
|
2784
2774
|
};
|
|
@@ -2786,12 +2776,12 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2786
2776
|
let e = i?.siteId;
|
|
2787
2777
|
e && pe(be(e));
|
|
2788
2778
|
}, [i?.siteId]);
|
|
2789
|
-
let
|
|
2790
|
-
let t =
|
|
2791
|
-
if (
|
|
2779
|
+
let kt = (e = "unspecified") => {
|
|
2780
|
+
let t = ut.current || lt.current?.callId, n = yt.current, r = gt.current;
|
|
2781
|
+
if (gt.current = null, yt.current = 0, r && r.state !== "inactive") {
|
|
2792
2782
|
r.onstop = () => {
|
|
2793
|
-
let e =
|
|
2794
|
-
if (
|
|
2783
|
+
let e = vt.current;
|
|
2784
|
+
if (vt.current = [], e.length > 0 && t && O.current) {
|
|
2795
2785
|
let r = new Blob(e, { type: e[0].type }), i = n > 0 ? Math.round((Date.now() - n) / 1e3) : 0;
|
|
2796
2786
|
O.current.uploadRecording(t, r, i).then((e) => console.log("[FlowEngageCall] recording upload success", e)).catch((e) => console.warn("[FlowEngageCall] recording upload failed", e));
|
|
2797
2787
|
}
|
|
@@ -2799,121 +2789,121 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2799
2789
|
try {
|
|
2800
2790
|
r.stop();
|
|
2801
2791
|
} catch {
|
|
2802
|
-
r.onstop = null,
|
|
2792
|
+
r.onstop = null, vt.current = [];
|
|
2803
2793
|
}
|
|
2804
2794
|
} else if (r && r.state === "inactive") {
|
|
2805
|
-
let e =
|
|
2806
|
-
if (
|
|
2795
|
+
let e = vt.current;
|
|
2796
|
+
if (vt.current = [], e.length > 0 && t && O.current) {
|
|
2807
2797
|
let r = new Blob(e, { type: e[0].type }), i = n > 0 ? Math.round((Date.now() - n) / 1e3) : 0;
|
|
2808
2798
|
O.current.uploadRecording(t, r, i).then((e) => console.log("[FlowEngageCall] recording upload success", e)).catch((e) => console.warn("[FlowEngageCall] recording upload failed", e));
|
|
2809
2799
|
}
|
|
2810
|
-
} else
|
|
2811
|
-
if (
|
|
2800
|
+
} else vt.current = [];
|
|
2801
|
+
if (_t.current) {
|
|
2812
2802
|
try {
|
|
2813
|
-
|
|
2803
|
+
_t.current.close();
|
|
2814
2804
|
} catch {}
|
|
2815
|
-
|
|
2805
|
+
_t.current = null;
|
|
2816
2806
|
}
|
|
2817
|
-
|
|
2818
|
-
},
|
|
2819
|
-
let t =
|
|
2820
|
-
if (!(!t?.connected || !n ||
|
|
2821
|
-
|
|
2807
|
+
ot.current &&= (ot.current.close(), null), st.current &&= (st.current.getTracks().forEach((e) => e.stop()), null), ct.current &&= (ct.current.srcObject = null, ct.current.remove(), null), Dt(), lt.current = null, k.current = [], ut.current = null, dt.current = null, pt.current = !1, Xe(!1), He(null), We(null), Ke("idle"), Je(null);
|
|
2808
|
+
}, At = (e = (/* @__PURE__ */ new Date()).toISOString()) => {
|
|
2809
|
+
let t = tt.current, n = ut.current || lt.current?.callId;
|
|
2810
|
+
if (!(!t?.connected || !n || pt.current)) {
|
|
2811
|
+
pt.current = !0, t.emit("call:connected", {
|
|
2822
2812
|
callId: n,
|
|
2823
|
-
chatId:
|
|
2813
|
+
chatId: nt.current,
|
|
2824
2814
|
connectedAt: e
|
|
2825
2815
|
});
|
|
2826
2816
|
try {
|
|
2827
|
-
let e =
|
|
2828
|
-
if (e && t && !
|
|
2829
|
-
|
|
2817
|
+
let e = st.current, t = ct.current?.srcObject;
|
|
2818
|
+
if (e && t && !gt.current) {
|
|
2819
|
+
vt.current = [];
|
|
2830
2820
|
let n = new (window.AudioContext || window.webkitAudioContext)();
|
|
2831
|
-
|
|
2821
|
+
_t.current = n;
|
|
2832
2822
|
let r = n.createMediaStreamDestination();
|
|
2833
2823
|
n.createMediaStreamSource(e).connect(r), n.createMediaStreamSource(t).connect(r);
|
|
2834
2824
|
let i = window.MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : "audio/mp4", a = new window.MediaRecorder(r.stream, { mimeType: i });
|
|
2835
2825
|
a.ondataavailable = (e) => {
|
|
2836
|
-
e.data && e.data.size > 0 &&
|
|
2837
|
-
},
|
|
2826
|
+
e.data && e.data.size > 0 && vt.current.push(e.data);
|
|
2827
|
+
}, gt.current = a, yt.current = Date.now(), a.start(1e3);
|
|
2838
2828
|
}
|
|
2839
2829
|
} catch {}
|
|
2840
2830
|
}
|
|
2841
|
-
},
|
|
2831
|
+
}, jt = (e = {}) => {
|
|
2842
2832
|
if (!e.callId) return;
|
|
2843
|
-
let t =
|
|
2833
|
+
let t = dt.current === e.callId, n = ut.current === e.callId, r = at.current?.callId === e.callId;
|
|
2844
2834
|
if (!(!t && !n && !r)) {
|
|
2845
|
-
if (
|
|
2846
|
-
|
|
2835
|
+
if (Dt(), He(null), t || n) {
|
|
2836
|
+
ut.current = e.callId, We(e.callId), Ke((e) => e === "connected" ? e : "connecting"), w(!0);
|
|
2847
2837
|
return;
|
|
2848
2838
|
}
|
|
2849
|
-
|
|
2839
|
+
Ke("idle");
|
|
2850
2840
|
}
|
|
2851
|
-
},
|
|
2841
|
+
}, Mt = (e = {}) => {
|
|
2852
2842
|
if (!e.callId) return;
|
|
2853
|
-
let t =
|
|
2843
|
+
let t = dt.current === e.callId, n = ut.current === e.callId, r = at.current?.callId === e.callId;
|
|
2854
2844
|
if (!(!t && !n && !r)) {
|
|
2855
|
-
if (
|
|
2856
|
-
|
|
2845
|
+
if (Dt(), n) {
|
|
2846
|
+
kt();
|
|
2857
2847
|
return;
|
|
2858
2848
|
}
|
|
2859
|
-
|
|
2849
|
+
dt.current = null, lt.current = null, k.current = [], He(null), Ke("idle");
|
|
2860
2850
|
}
|
|
2861
|
-
},
|
|
2862
|
-
let t =
|
|
2851
|
+
}, Nt = async (e = {}) => {
|
|
2852
|
+
let t = ot.current, n = tt.current, r = e.sdpOffer || e.offer?.sdp;
|
|
2863
2853
|
if (!t || !n?.connected || !r || !e.callId) {
|
|
2864
2854
|
console.log("[FlowEngageProvider] deferring remote offer until peer/socket ready", {
|
|
2865
2855
|
callId: e.callId,
|
|
2866
|
-
chatId:
|
|
2856
|
+
chatId: nt.current,
|
|
2867
2857
|
hasPeerConnection: !!t,
|
|
2868
2858
|
socketConnected: !!n?.connected,
|
|
2869
2859
|
hasOffer: !!r
|
|
2870
|
-
}),
|
|
2860
|
+
}), lt.current = e;
|
|
2871
2861
|
return;
|
|
2872
2862
|
}
|
|
2873
2863
|
if (await t.setRemoteDescription(new RTCSessionDescription({
|
|
2874
2864
|
type: "offer",
|
|
2875
2865
|
sdp: r
|
|
2876
|
-
})),
|
|
2866
|
+
})), k.current.length > 0) {
|
|
2877
2867
|
console.log("[FlowEngageProvider] flushing queued agent ICE candidates after remote offer", {
|
|
2878
2868
|
callId: e.callId,
|
|
2879
|
-
chatId:
|
|
2880
|
-
queuedCount:
|
|
2869
|
+
chatId: nt.current,
|
|
2870
|
+
queuedCount: k.current.length
|
|
2881
2871
|
});
|
|
2882
|
-
for (let e of
|
|
2883
|
-
|
|
2872
|
+
for (let e of k.current) await t.addIceCandidate(new RTCIceCandidate(e));
|
|
2873
|
+
k.current = [];
|
|
2884
2874
|
}
|
|
2885
2875
|
let i = await t.createAnswer();
|
|
2886
2876
|
await t.setLocalDescription(i), n.emit("call:answer", {
|
|
2887
2877
|
callId: e.callId,
|
|
2888
2878
|
sdpAnswer: i.sdp,
|
|
2889
|
-
chatId:
|
|
2879
|
+
chatId: nt.current
|
|
2890
2880
|
});
|
|
2891
2881
|
};
|
|
2892
2882
|
c(() => {
|
|
2893
2883
|
ye({
|
|
2894
|
-
isOpen:
|
|
2895
|
-
activeScreen:
|
|
2884
|
+
isOpen: C,
|
|
2885
|
+
activeScreen: T,
|
|
2896
2886
|
isHumanHandled: ne,
|
|
2897
2887
|
agentName: E,
|
|
2898
2888
|
agentHeadshot: se
|
|
2899
2889
|
});
|
|
2900
2890
|
}, [
|
|
2901
|
-
|
|
2902
|
-
|
|
2891
|
+
C,
|
|
2892
|
+
T,
|
|
2903
2893
|
ne,
|
|
2904
2894
|
E,
|
|
2905
2895
|
se
|
|
2906
2896
|
]), c(() => {
|
|
2907
2897
|
let e = !0;
|
|
2908
2898
|
return (async () => {
|
|
2909
|
-
|
|
2899
|
+
et(!0);
|
|
2910
2900
|
try {
|
|
2911
|
-
let t =
|
|
2901
|
+
let t = ee(i), n = await Le(t);
|
|
2912
2902
|
if (!e) return;
|
|
2913
2903
|
let a = t.siteId, o = he(a), s = Te(a), c = "";
|
|
2914
2904
|
try {
|
|
2915
|
-
let e =
|
|
2916
|
-
if (
|
|
2905
|
+
let e = rt.current, r = it.current;
|
|
2906
|
+
if (rt.current = !1, it.current = null, c = (await Ie({
|
|
2917
2907
|
apiBaseUrl: t.apiBaseUrl,
|
|
2918
2908
|
userId: n.userId,
|
|
2919
2909
|
siteId: a,
|
|
@@ -2926,7 +2916,7 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2926
2916
|
} catch (e) {
|
|
2927
2917
|
console.warn("[FlowEngageProvider] resolve-session failed, reusing persisted or ephemeral chat id", e?.message || e), c = o || ue(), _e(a, c);
|
|
2928
2918
|
}
|
|
2929
|
-
|
|
2919
|
+
nt.current = c;
|
|
2930
2920
|
let l = Re({
|
|
2931
2921
|
apiBaseUrl: t.apiBaseUrl,
|
|
2932
2922
|
userId: n.userId,
|
|
@@ -2943,7 +2933,7 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2943
2933
|
chatId: c,
|
|
2944
2934
|
siteId: t.siteId
|
|
2945
2935
|
});
|
|
2946
|
-
|
|
2936
|
+
tt.current = f, f.on("connect", () => {
|
|
2947
2937
|
De("connected");
|
|
2948
2938
|
}), f.on("disconnect", () => {
|
|
2949
2939
|
De("disconnected");
|
|
@@ -2986,20 +2976,20 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
2986
2976
|
...n,
|
|
2987
2977
|
isPending: !1,
|
|
2988
2978
|
id: n.messageId || `${n.sender}-${Date.now()}-${Math.random()}`
|
|
2989
|
-
}]), (n.sender === "agent" || n.agent_name) && (re(!0),
|
|
2979
|
+
}]), (n.sender === "agent" || n.agent_name) && (re(!0), te("agent"), D(xr([
|
|
2990
2980
|
n.agent_name,
|
|
2991
2981
|
n.agentName,
|
|
2992
2982
|
n.metadata?.agentName
|
|
2993
|
-
], d)), n.sender_headshot && de(n.sender_headshot),
|
|
2983
|
+
], d)), n.sender_headshot && de(n.sender_headshot), w(!0));
|
|
2994
2984
|
});
|
|
2995
2985
|
let p = (e = {}) => {
|
|
2996
2986
|
let t = xr([
|
|
2997
2987
|
e.agent?.name,
|
|
2998
2988
|
e.agentName,
|
|
2999
2989
|
e.agent_name,
|
|
3000
|
-
|
|
2990
|
+
bt.current
|
|
3001
2991
|
], d);
|
|
3002
|
-
re(!0),
|
|
2992
|
+
re(!0), te("agent"), D(t), de(e.agent?.headshot || null), w(!0), S((e) => Sr(e, {
|
|
3003
2993
|
id: `agent-joined-${Date.now()}`,
|
|
3004
2994
|
sender: "system",
|
|
3005
2995
|
message: `${t} has joined the chat.`,
|
|
@@ -3011,9 +3001,9 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3011
3001
|
e.agent?.name,
|
|
3012
3002
|
e.agentName,
|
|
3013
3003
|
e.agent_name,
|
|
3014
|
-
|
|
3004
|
+
bt.current
|
|
3015
3005
|
], d);
|
|
3016
|
-
re(!1),
|
|
3006
|
+
re(!1), te("ai"), S((e) => Sr(e, {
|
|
3017
3007
|
id: `agent-left-${Date.now()}`,
|
|
3018
3008
|
sender: "system",
|
|
3019
3009
|
message: `${t} has left the chat.`,
|
|
@@ -3033,11 +3023,9 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3033
3023
|
}]);
|
|
3034
3024
|
}), f.on("chat:history_update", (e) => {
|
|
3035
3025
|
let t = _r(e.chat_history || []);
|
|
3036
|
-
S(t), t.length === 0 && (Be(!1), re(!1),
|
|
3026
|
+
S(t), t.length === 0 && (Be(!1), re(!1), te("ai"), we(!1), Se(!1));
|
|
3037
3027
|
}), f.on("conversation:reset", () => {
|
|
3038
|
-
S([]), Be(!1), re(!1),
|
|
3039
|
-
}), f.on("conversation:feedback_requested", () => {
|
|
3040
|
-
He(!0);
|
|
3028
|
+
S([]), Be(!1), re(!1), te("ai"), we(!1), Se(!1);
|
|
3041
3029
|
}), f.on("typing:start", (e) => {
|
|
3042
3030
|
e.sender === "agent" && Se(!0);
|
|
3043
3031
|
}), f.on("typing:stop", (e) => {
|
|
@@ -3047,18 +3035,18 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3047
3035
|
e.agentName,
|
|
3048
3036
|
e.ownerName,
|
|
3049
3037
|
e.agent?.name,
|
|
3050
|
-
|
|
3038
|
+
bt.current
|
|
3051
3039
|
], "Agent");
|
|
3052
|
-
|
|
3040
|
+
Et(), Dt(), pt.current = !1, He({
|
|
3053
3041
|
callId: e.callId,
|
|
3054
3042
|
from: e.from || "owner",
|
|
3055
3043
|
agentId: e.agentId || null,
|
|
3056
3044
|
agentName: t
|
|
3057
|
-
}), D((e) => xr([t, e], "Agent")),
|
|
3045
|
+
}), D((e) => xr([t, e], "Agent")), Ke("incoming"), Je(null), w(!0);
|
|
3058
3046
|
}), f.on("call:offer", async (e = {}) => {
|
|
3059
|
-
|
|
3047
|
+
lt.current = e;
|
|
3060
3048
|
try {
|
|
3061
|
-
await
|
|
3049
|
+
await Nt(e);
|
|
3062
3050
|
} catch (e) {
|
|
3063
3051
|
console.error("[FlowEngageProvider] failed to apply remote offer", e);
|
|
3064
3052
|
}
|
|
@@ -3069,42 +3057,42 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3069
3057
|
console.warn("[FlowEngageProvider] ignoring invalid ICE candidate payload", e);
|
|
3070
3058
|
return;
|
|
3071
3059
|
}
|
|
3072
|
-
if (!
|
|
3060
|
+
if (!ot.current || !ot.current.remoteDescription) {
|
|
3073
3061
|
console.log("[FlowEngageProvider] queueing agent ICE candidate until peer/remote description is ready", {
|
|
3074
3062
|
callId: e.callId,
|
|
3075
|
-
chatId: e.chatId ||
|
|
3076
|
-
queueSize:
|
|
3077
|
-
}),
|
|
3063
|
+
chatId: e.chatId || nt.current,
|
|
3064
|
+
queueSize: k.current.length + 1
|
|
3065
|
+
}), k.current.push(t);
|
|
3078
3066
|
return;
|
|
3079
3067
|
}
|
|
3080
|
-
await
|
|
3068
|
+
await ot.current.addIceCandidate(new RTCIceCandidate(t));
|
|
3081
3069
|
} catch (e) {
|
|
3082
3070
|
console.error("[FlowEngageProvider] failed to add ICE candidate", e);
|
|
3083
3071
|
}
|
|
3084
3072
|
}), f.on("call:ended", () => {
|
|
3085
|
-
|
|
3073
|
+
Et(), kt("socket:call_ended");
|
|
3086
3074
|
}), f.on("call:accepted", (e = {}) => {
|
|
3087
|
-
|
|
3075
|
+
jt(e);
|
|
3088
3076
|
}), f.on("call:accepted_by_other", (e = {}) => {
|
|
3089
|
-
|
|
3077
|
+
jt(e);
|
|
3090
3078
|
}), f.on("call:rejected", (e = {}) => {
|
|
3091
|
-
|
|
3079
|
+
Mt(e);
|
|
3092
3080
|
}), f.on("call:missed", (e = {}) => {
|
|
3093
|
-
|
|
3081
|
+
Mt(e);
|
|
3094
3082
|
}), f.on("call:failed", (e = {}) => {
|
|
3095
|
-
|
|
3083
|
+
Mt(e);
|
|
3096
3084
|
}), f.on("call:connected", (e = {}) => {
|
|
3097
3085
|
if (!e.callId) return;
|
|
3098
|
-
let t =
|
|
3086
|
+
let t = dt.current === e.callId, n = ut.current === e.callId, r = lt.current?.callId === e.callId, i = at.current?.callId === e.callId;
|
|
3099
3087
|
if (!t && !n && !r) {
|
|
3100
|
-
i && (
|
|
3088
|
+
i && (He(null), Ke("idle"));
|
|
3101
3089
|
return;
|
|
3102
3090
|
}
|
|
3103
|
-
|
|
3091
|
+
pt.current = !0, dt.current = null, ut.current = e.callId, We(e.callId), He(null), Ke("connected"), Je(e.connectedAt || (/* @__PURE__ */ new Date()).toISOString()), w(!0);
|
|
3104
3092
|
}), f.on("call:unavailable", (e = {}) => {
|
|
3105
|
-
|
|
3093
|
+
kt("socket:call_unavailable"), Qe(yr(e, "This visitor is not available for a call right now.")), w(!0);
|
|
3106
3094
|
}), f.on("call:error", (e = {}) => {
|
|
3107
|
-
|
|
3095
|
+
kt("socket:call_error"), Qe(yr(e, "We couldn't connect the call right now.")), w(!0);
|
|
3108
3096
|
}), f.on("visitor:navigate", async ({ url: e, section: n, highlight: r } = {}) => {
|
|
3109
3097
|
e && await ur(e, {
|
|
3110
3098
|
siteId: t.siteId,
|
|
@@ -3122,54 +3110,54 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3122
3110
|
n && or(n);
|
|
3123
3111
|
}), f.on("visitor:clear_highlight", () => {
|
|
3124
3112
|
sr();
|
|
3125
|
-
}),
|
|
3113
|
+
}), Ct.current = On({
|
|
3126
3114
|
socket: f,
|
|
3127
3115
|
chatId: c
|
|
3128
3116
|
});
|
|
3129
3117
|
let h = await l.loadHistory(c, r);
|
|
3130
3118
|
if (!e) return;
|
|
3131
|
-
S(_r(h.chat_history || [])), re(!!h.is_human_handled),
|
|
3119
|
+
S(_r(h.chat_history || [])), re(!!h.is_human_handled), te(h.is_human_handled ? "agent" : T);
|
|
3132
3120
|
let g = h?.visitor_email || h?.visitorEmail;
|
|
3133
|
-
if (g && String(g).trim() &&
|
|
3121
|
+
if (g && String(g).trim() && Ot(String(g).trim()), await new Promise((e) => setTimeout(e, 500)), !e) return;
|
|
3134
3122
|
u("ready");
|
|
3135
3123
|
} catch (t) {
|
|
3136
3124
|
if (!e) return;
|
|
3137
3125
|
h(t), u("error");
|
|
3138
3126
|
} finally {
|
|
3139
|
-
e &&
|
|
3127
|
+
e && et(!1);
|
|
3140
3128
|
}
|
|
3141
3129
|
})(), () => {
|
|
3142
|
-
e = !1,
|
|
3130
|
+
e = !1, Ct.current?.cleanup?.(), kt(), tt.current?.disconnect();
|
|
3143
3131
|
};
|
|
3144
3132
|
}, [
|
|
3145
3133
|
i,
|
|
3146
3134
|
r,
|
|
3147
3135
|
a
|
|
3148
3136
|
]), c(() => () => {
|
|
3149
|
-
if (Pe && !
|
|
3150
|
-
let e =
|
|
3151
|
-
n && e && t.length > 0 && (console.log("[FlowEngageProvider] safety-net: syncing voice transcript on unmount"), n.beaconSyncVoice(e, t) || n.syncVoice(e, t).catch(() => {}),
|
|
3137
|
+
if (Pe && !St.current && xt.current.length > 0) {
|
|
3138
|
+
let e = nt.current, t = xt.current, n = O.current;
|
|
3139
|
+
n && e && t.length > 0 && (console.log("[FlowEngageProvider] safety-net: syncing voice transcript on unmount"), n.beaconSyncVoice(e, t) || n.syncVoice(e, t).catch(() => {}), St.current = !0);
|
|
3152
3140
|
}
|
|
3153
3141
|
}, [Pe, _]), c(() => {
|
|
3154
3142
|
if (!O.current || !y || l !== "ready") return;
|
|
3155
3143
|
let e = window.setInterval(async () => {
|
|
3156
3144
|
try {
|
|
3157
3145
|
let e = await O.current.checkHumanHandled(y);
|
|
3158
|
-
re(!!e.is_human_handled), e.is_human_handled && (
|
|
3146
|
+
re(!!e.is_human_handled), e.is_human_handled && (te("agent"), e.agent_info?.name && D(xr([e.agent_info.name], "Agent")), e.agent_info?.headshot && de(e.agent_info.headshot)), wt(e);
|
|
3159
3147
|
} catch {}
|
|
3160
3148
|
}, 1e4);
|
|
3161
3149
|
return () => window.clearInterval(e);
|
|
3162
3150
|
}, [
|
|
3163
3151
|
y,
|
|
3164
3152
|
l,
|
|
3165
|
-
|
|
3153
|
+
wt
|
|
3166
3154
|
]);
|
|
3167
|
-
let
|
|
3168
|
-
if (!(!
|
|
3169
|
-
|
|
3155
|
+
let Pt = async () => {
|
|
3156
|
+
if (!(!Ve?.callId || !O.current || !tt.current || !y)) {
|
|
3157
|
+
Et(), dt.current = Ve.callId, Dt();
|
|
3170
3158
|
try {
|
|
3171
3159
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
3172
|
-
|
|
3160
|
+
st.current = e;
|
|
3173
3161
|
let t = [{ urls: "stun:stun.l.google.com:19302" }];
|
|
3174
3162
|
try {
|
|
3175
3163
|
let e = await O.current.getIceServersConfig();
|
|
@@ -3178,35 +3166,35 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3178
3166
|
console.warn("[FlowEngageProvider] ice-config fetch failed, using STUN default", e);
|
|
3179
3167
|
}
|
|
3180
3168
|
let n = new RTCPeerConnection({ iceServers: t });
|
|
3181
|
-
|
|
3169
|
+
ot.current = n, n.onconnectionstatechange = () => {
|
|
3182
3170
|
let e = n.connectionState;
|
|
3183
3171
|
if (e === "connected") {
|
|
3184
3172
|
let e = (/* @__PURE__ */ new Date()).toISOString();
|
|
3185
|
-
|
|
3173
|
+
Ke("connected"), Je((t) => t || e), At(e);
|
|
3186
3174
|
return;
|
|
3187
3175
|
}
|
|
3188
3176
|
if (e === "connecting") {
|
|
3189
|
-
|
|
3177
|
+
Ke((e) => e === "connected" ? e : "connecting");
|
|
3190
3178
|
return;
|
|
3191
3179
|
}
|
|
3192
3180
|
}, n.oniceconnectionstatechange = () => {
|
|
3193
3181
|
let e = n.iceConnectionState;
|
|
3194
3182
|
if (e === "connected" || e === "completed") {
|
|
3195
3183
|
let e = (/* @__PURE__ */ new Date()).toISOString();
|
|
3196
|
-
|
|
3184
|
+
Ke("connected"), Je((t) => t || e), At(e);
|
|
3197
3185
|
return;
|
|
3198
3186
|
}
|
|
3199
3187
|
if (e === "checking" || e === "new") {
|
|
3200
|
-
|
|
3188
|
+
Ke((e) => e === "connected" ? e : "connecting");
|
|
3201
3189
|
return;
|
|
3202
3190
|
}
|
|
3203
3191
|
}, n.onsignalingstatechange = () => {}, n.onicegatheringstatechange = () => {}, e.getTracks().forEach((t) => {
|
|
3204
3192
|
n.addTrack(t, e);
|
|
3205
3193
|
}), n.onicecandidate = (e) => {
|
|
3206
|
-
if (!e.candidate || !
|
|
3194
|
+
if (!e.candidate || !tt.current?.connected) return;
|
|
3207
3195
|
let t = e.candidate;
|
|
3208
|
-
|
|
3209
|
-
callId:
|
|
3196
|
+
tt.current.emit("call:ice-candidate", {
|
|
3197
|
+
callId: Ve.callId,
|
|
3210
3198
|
candidate: t.candidate,
|
|
3211
3199
|
sdpMid: t.sdpMid,
|
|
3212
3200
|
sdpMLineIndex: t.sdpMLineIndex,
|
|
@@ -3215,98 +3203,98 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3215
3203
|
});
|
|
3216
3204
|
}, n.ontrack = (e) => {
|
|
3217
3205
|
let [t] = e.streams || [], [n] = t?.getAudioTracks?.() || [];
|
|
3218
|
-
if (!
|
|
3206
|
+
if (!ct.current) {
|
|
3219
3207
|
let e = document.createElement("audio");
|
|
3220
|
-
e.id = "flowengage-remote-audio", e.autoplay = !0, e.playsInline = !0, e.onplay = () => {}, e.onpause = () => {}, e.onended = () => {}, e.onerror = (e) => {},
|
|
3208
|
+
e.id = "flowengage-remote-audio", e.autoplay = !0, e.playsInline = !0, e.onplay = () => {}, e.onpause = () => {}, e.onended = () => {}, e.onerror = (e) => {}, ct.current = e, document.body.appendChild(e);
|
|
3221
3209
|
}
|
|
3222
|
-
|
|
3223
|
-
let r =
|
|
3224
|
-
if (!
|
|
3210
|
+
ct.current.srcObject = e.streams[0];
|
|
3211
|
+
let r = Ve?.callId, i = r && (dt.current === r || ut.current === r);
|
|
3212
|
+
if (!pt.current && i) {
|
|
3225
3213
|
let e = (/* @__PURE__ */ new Date()).toISOString();
|
|
3226
|
-
|
|
3214
|
+
Ke("connected"), Je((t) => t || e), ut.current = r, We(r), At(e);
|
|
3227
3215
|
}
|
|
3228
|
-
|
|
3229
|
-
let a =
|
|
3216
|
+
ct.current.srcObject = t || null;
|
|
3217
|
+
let a = ct.current.play?.();
|
|
3230
3218
|
a?.catch && a.catch((e) => {});
|
|
3231
3219
|
};
|
|
3232
|
-
let r =
|
|
3220
|
+
let r = lt.current;
|
|
3233
3221
|
r && (console.log("[FlowEngageProvider] found pending remote offer during accept", {
|
|
3234
|
-
callId: r.callId ||
|
|
3222
|
+
callId: r.callId || Ve.callId,
|
|
3235
3223
|
chatId: y
|
|
3236
|
-
}), await
|
|
3224
|
+
}), await Nt({
|
|
3237
3225
|
...r,
|
|
3238
|
-
callId: r.callId ||
|
|
3239
|
-
})), await O.current.acceptCall(
|
|
3226
|
+
callId: r.callId || Ve.callId
|
|
3227
|
+
})), await O.current.acceptCall(Ve.callId, y), ut.current = Ve.callId, We(Ve.callId), Ke((e) => e === "connected" || pt.current ? "connected" : "connecting"), He(null), w(!0);
|
|
3240
3228
|
} catch (e) {
|
|
3241
|
-
if (
|
|
3242
|
-
|
|
3229
|
+
if (dt.current = null, kt("accept_call_failed"), e?.status === 404 || e?.status === 409 || e?.status === 422) {
|
|
3230
|
+
Qe(yr(e, "This visitor call is no longer available."));
|
|
3243
3231
|
return;
|
|
3244
3232
|
}
|
|
3245
3233
|
if (e?.name === "NotAllowedError" || e?.name === "PermissionDeniedError") {
|
|
3246
3234
|
try {
|
|
3247
|
-
await O.current.rejectCall(
|
|
3235
|
+
await O.current.rejectCall(Ve.callId, y);
|
|
3248
3236
|
} catch (e) {
|
|
3249
3237
|
console.error("[FlowEngageProvider] failed to reject call after microphone denial", e);
|
|
3250
3238
|
}
|
|
3251
|
-
|
|
3239
|
+
Qe("Microphone access was denied. Please allow microphone access to accept the call.");
|
|
3252
3240
|
return;
|
|
3253
3241
|
}
|
|
3254
|
-
|
|
3242
|
+
Qe("We couldn't connect the call right now. Please try again.");
|
|
3255
3243
|
}
|
|
3256
3244
|
}
|
|
3257
|
-
},
|
|
3258
|
-
if (!
|
|
3259
|
-
|
|
3245
|
+
}, Ft = async () => {
|
|
3246
|
+
if (!Ve?.callId || !O.current || !y) {
|
|
3247
|
+
kt("reject_call_without_server_context");
|
|
3260
3248
|
return;
|
|
3261
3249
|
}
|
|
3262
|
-
|
|
3250
|
+
Dt(), Et();
|
|
3263
3251
|
try {
|
|
3264
|
-
await O.current.rejectCall(
|
|
3252
|
+
await O.current.rejectCall(Ve.callId, y);
|
|
3265
3253
|
} catch (e) {
|
|
3266
|
-
|
|
3254
|
+
Qe(yr(e, "We couldn't decline the call cleanly."));
|
|
3267
3255
|
} finally {
|
|
3268
|
-
|
|
3256
|
+
kt("reject_call_finally");
|
|
3269
3257
|
}
|
|
3270
|
-
},
|
|
3271
|
-
|
|
3272
|
-
if (!
|
|
3273
|
-
|
|
3258
|
+
}, It = p(Ft);
|
|
3259
|
+
It.current = Ft, c(() => {
|
|
3260
|
+
if (!Ve?.callId || Ue) {
|
|
3261
|
+
Dt();
|
|
3274
3262
|
return;
|
|
3275
3263
|
}
|
|
3276
|
-
let e =
|
|
3277
|
-
return
|
|
3278
|
-
|
|
3264
|
+
let e = Ve.callId;
|
|
3265
|
+
return Dt(), ft.current = window.setTimeout(() => {
|
|
3266
|
+
at.current?.callId === e && dt.current !== e && ut.current !== e && It.current();
|
|
3279
3267
|
}, oe), () => {
|
|
3280
|
-
|
|
3268
|
+
ft.current &&= (window.clearTimeout(ft.current), null);
|
|
3281
3269
|
};
|
|
3282
3270
|
}, [
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3271
|
+
Ue,
|
|
3272
|
+
Dt,
|
|
3273
|
+
Ve?.callId
|
|
3286
3274
|
]);
|
|
3287
|
-
let
|
|
3288
|
-
if (!
|
|
3289
|
-
|
|
3275
|
+
let Lt = async () => {
|
|
3276
|
+
if (!Ue || !O.current || !y) {
|
|
3277
|
+
kt("end_call_without_server_context");
|
|
3290
3278
|
return;
|
|
3291
3279
|
}
|
|
3292
|
-
|
|
3280
|
+
Et();
|
|
3293
3281
|
try {
|
|
3294
|
-
await O.current.endWebRTCCall(
|
|
3282
|
+
await O.current.endWebRTCCall(Ue, y);
|
|
3295
3283
|
} catch (e) {
|
|
3296
|
-
|
|
3284
|
+
Qe(yr(e, "The call ended locally, but the server could not be updated."));
|
|
3297
3285
|
} finally {
|
|
3298
|
-
|
|
3286
|
+
kt("end_call_finally");
|
|
3299
3287
|
}
|
|
3300
|
-
},
|
|
3301
|
-
let e =
|
|
3288
|
+
}, Rt = () => {
|
|
3289
|
+
let e = st.current?.getAudioTracks?.() || [], t = ot.current?.getSenders?.().map((e) => e.track).filter((e) => e?.kind === "audio") || [], n = [...e, ...t].filter(Boolean);
|
|
3302
3290
|
if (n.length === 0) return;
|
|
3303
|
-
let r =
|
|
3291
|
+
let r = !Ye;
|
|
3304
3292
|
n.forEach((e) => {
|
|
3305
3293
|
e.enabled = !r;
|
|
3306
|
-
}),
|
|
3307
|
-
},
|
|
3294
|
+
}), Xe(r);
|
|
3295
|
+
}, zt = async (e = {}) => {
|
|
3308
3296
|
let t = e.notifyChatInitiated === !0;
|
|
3309
|
-
if (
|
|
3297
|
+
if (w(!0), !(!t || !O.current || !y || typeof window > "u")) {
|
|
3310
3298
|
try {
|
|
3311
3299
|
await O.current.trackVisitor({
|
|
3312
3300
|
chatId: y,
|
|
@@ -3317,12 +3305,12 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3317
3305
|
await O.current.updateChatStatus(y, "open");
|
|
3318
3306
|
} catch {}
|
|
3319
3307
|
}
|
|
3320
|
-
},
|
|
3321
|
-
let t =
|
|
3322
|
-
if (!t || !O.current || !
|
|
3308
|
+
}, Bt = async (e) => {
|
|
3309
|
+
let t = Ot(e);
|
|
3310
|
+
if (!t || !O.current || !nt.current) return t;
|
|
3323
3311
|
try {
|
|
3324
3312
|
await O.current.trackVisitor({
|
|
3325
|
-
chatId:
|
|
3313
|
+
chatId: nt.current,
|
|
3326
3314
|
currentPagePath: typeof window < "u" && window.location.pathname || "/",
|
|
3327
3315
|
email: t
|
|
3328
3316
|
});
|
|
@@ -3330,26 +3318,26 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3330
3318
|
console.error("[FlowEngageProvider] failed to persist visitor email", e);
|
|
3331
3319
|
}
|
|
3332
3320
|
return t;
|
|
3333
|
-
},
|
|
3334
|
-
!y || !
|
|
3321
|
+
}, Vt = () => {
|
|
3322
|
+
!y || !tt.current?.connected || mt.current || (mt.current = !0, tt.current.emit("typing:start", {
|
|
3335
3323
|
chatId: y,
|
|
3336
3324
|
sender: "user"
|
|
3337
3325
|
}));
|
|
3338
|
-
},
|
|
3339
|
-
!y || !
|
|
3326
|
+
}, Ht = () => {
|
|
3327
|
+
!y || !tt.current?.connected || !mt.current || (mt.current = !1, tt.current.emit("typing:stop", {
|
|
3340
3328
|
chatId: y,
|
|
3341
3329
|
sender: "user"
|
|
3342
3330
|
}));
|
|
3343
|
-
},
|
|
3331
|
+
}, Ut = (e = "") => {
|
|
3344
3332
|
let t = typeof e == "string" ? e : "";
|
|
3345
|
-
!y || !
|
|
3333
|
+
!y || !tt.current?.connected || t !== "" && ht.current === t || (ht.current = t, tt.current.emit("typing:update", {
|
|
3346
3334
|
chatId: y,
|
|
3347
3335
|
sender: "user",
|
|
3348
3336
|
text: t
|
|
3349
3337
|
}));
|
|
3350
|
-
},
|
|
3338
|
+
}, Wt = async (e, t = "", n = null, a = {}) => {
|
|
3351
3339
|
if (!(typeof e == "string" && e.trim()) || !O.current || !y || l !== "ready" || ze) return;
|
|
3352
|
-
|
|
3340
|
+
Ht();
|
|
3353
3341
|
let o = `pending-user-${Date.now()}`, s = {
|
|
3354
3342
|
id: o,
|
|
3355
3343
|
sender: "user",
|
|
@@ -3363,10 +3351,10 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3363
3351
|
S((e) => [...e, s]);
|
|
3364
3352
|
let c = ne;
|
|
3365
3353
|
if (c) try {
|
|
3366
|
-
c =
|
|
3354
|
+
c = wt(await O.current.checkHumanHandled(y));
|
|
3367
3355
|
} catch {}
|
|
3368
|
-
if (c &&
|
|
3369
|
-
|
|
3356
|
+
if (c && tt.current?.connected) {
|
|
3357
|
+
tt.current.emit("customer:message", {
|
|
3370
3358
|
chatId: y,
|
|
3371
3359
|
content: e,
|
|
3372
3360
|
sender: "user",
|
|
@@ -3402,26 +3390,26 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3402
3390
|
});
|
|
3403
3391
|
});
|
|
3404
3392
|
}
|
|
3405
|
-
S(_r(s)), re(!!o.is_human_handled),
|
|
3393
|
+
S(_r(s)), re(!!o.is_human_handled), te(o.is_human_handled ? "agent" : "ai"), we(!1), ke(!1), await O.current.updateChatStatus(y, "messageSent");
|
|
3406
3394
|
} catch (e) {
|
|
3407
3395
|
S((e) => e.filter((e) => e.id !== o)), we(!1), ke(!1), e.status === 429 ? (je(!0), Ne(e.message), window.setTimeout(() => {
|
|
3408
3396
|
je(!1), Ne("");
|
|
3409
3397
|
}, ie)) : h(e);
|
|
3410
3398
|
}
|
|
3411
|
-
},
|
|
3399
|
+
}, Gt = async (e) => {
|
|
3412
3400
|
if (!O.current || !e) throw Error("Upload is unavailable right now.");
|
|
3413
3401
|
return O.current.uploadChatFile(e);
|
|
3414
|
-
},
|
|
3402
|
+
}, Kt = async (e) => {
|
|
3415
3403
|
if (!(!O.current || !y)) {
|
|
3416
3404
|
try {
|
|
3417
3405
|
let t = e ? "voice" : "text";
|
|
3418
3406
|
await O.current.setChatMode(y, t);
|
|
3419
3407
|
} catch {}
|
|
3420
|
-
Fe(e), e && (
|
|
3408
|
+
Fe(e), e && (St.current = !1);
|
|
3421
3409
|
}
|
|
3422
|
-
},
|
|
3423
|
-
if (
|
|
3424
|
-
if (
|
|
3410
|
+
}, qt = async (e) => {
|
|
3411
|
+
if (St.current) return;
|
|
3412
|
+
if (St.current = !0, !O.current || !y || !e?.length) {
|
|
3425
3413
|
Fe(!1);
|
|
3426
3414
|
return;
|
|
3427
3415
|
}
|
|
@@ -3448,9 +3436,9 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3448
3436
|
} finally {
|
|
3449
3437
|
Fe(!1);
|
|
3450
3438
|
}
|
|
3451
|
-
},
|
|
3439
|
+
}, Jt = async () => {
|
|
3452
3440
|
if (!(!O.current || !y)) {
|
|
3453
|
-
Pe && !
|
|
3441
|
+
Pe && !St.current && xt.current.length > 0 && await qt(xt.current);
|
|
3454
3442
|
try {
|
|
3455
3443
|
await O.current.endConversation(y);
|
|
3456
3444
|
} catch {
|
|
@@ -3468,47 +3456,47 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3468
3456
|
}
|
|
3469
3457
|
};
|
|
3470
3458
|
c(() => {
|
|
3471
|
-
if (
|
|
3472
|
-
let e = new Date(
|
|
3473
|
-
|
|
3459
|
+
if (Ge !== "connected" || !Ue || !y || !qe || !Tt) return;
|
|
3460
|
+
let e = new Date(qe).getTime(), t = Number.isFinite(e) ? Date.now() - e : 0, n = Math.max(0, Tt * 1e3 - t), r = window.setTimeout(() => {
|
|
3461
|
+
Qe("The call ended because it reached the time limit."), Lt();
|
|
3474
3462
|
}, n);
|
|
3475
3463
|
return () => window.clearTimeout(r);
|
|
3476
3464
|
}, [
|
|
3465
|
+
Ue,
|
|
3477
3466
|
qe,
|
|
3478
|
-
|
|
3479
|
-
Ye,
|
|
3467
|
+
Ge,
|
|
3480
3468
|
y,
|
|
3481
|
-
|
|
3482
|
-
|
|
3469
|
+
Lt,
|
|
3470
|
+
Tt
|
|
3483
3471
|
]), c(() => {
|
|
3484
3472
|
let e = () => {
|
|
3485
|
-
let e =
|
|
3473
|
+
let e = nt.current, t = O.current;
|
|
3486
3474
|
if (!t || !e) return;
|
|
3487
|
-
if (!
|
|
3488
|
-
t.beaconEndWebRTCCall(
|
|
3475
|
+
if (!St.current && xt.current.length > 0 && (t.beaconSyncVoice(e, xt.current) || t.syncVoice(e, xt.current).catch(() => {}), St.current = !0), ut.current) {
|
|
3476
|
+
t.beaconEndWebRTCCall(ut.current, e);
|
|
3489
3477
|
return;
|
|
3490
3478
|
}
|
|
3491
|
-
let n =
|
|
3479
|
+
let n = dt.current || at.current?.callId;
|
|
3492
3480
|
n && t.beaconCustomerUnavailable(n, e);
|
|
3493
3481
|
};
|
|
3494
3482
|
return window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), () => {
|
|
3495
3483
|
window.removeEventListener("pagehide", e), window.removeEventListener("beforeunload", e);
|
|
3496
3484
|
};
|
|
3497
3485
|
}, []);
|
|
3498
|
-
let
|
|
3486
|
+
let Yt = o(() => {
|
|
3499
3487
|
let e = i?.siteId;
|
|
3500
|
-
ge(e),
|
|
3501
|
-
}, [i?.siteId]),
|
|
3502
|
-
i?.siteId,
|
|
3503
|
-
}, [i?.siteId]),
|
|
3488
|
+
ge(e), rt.current = !0, it.current = null, tt.current?.disconnect(), S([]), b(""), nt.current = "", Be(!1), re(!1), D(null), de(null), et(!0), s((e) => e + 1);
|
|
3489
|
+
}, [i?.siteId]), Xt = o((e) => {
|
|
3490
|
+
i?.siteId, rt.current = !1, it.current = e, tt.current?.disconnect(), S([]), b(""), nt.current = "", Be(!1), re(!1), D(null), de(null), et(!0), s((e) => e + 1);
|
|
3491
|
+
}, [i?.siteId]), Zt = f(() => ({
|
|
3504
3492
|
status: l,
|
|
3505
3493
|
error: d,
|
|
3506
3494
|
runtimeConfig: _,
|
|
3507
3495
|
resolvedConfig: i,
|
|
3508
3496
|
chatId: y,
|
|
3509
3497
|
chatHistory: x,
|
|
3510
|
-
isOpen:
|
|
3511
|
-
activeScreen:
|
|
3498
|
+
isOpen: C,
|
|
3499
|
+
activeScreen: T,
|
|
3512
3500
|
isHumanHandled: ne,
|
|
3513
3501
|
agentName: E,
|
|
3514
3502
|
agentHeadshot: se,
|
|
@@ -3521,54 +3509,44 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3521
3509
|
isRateLimited: Ae,
|
|
3522
3510
|
rateLimitMessage: Me,
|
|
3523
3511
|
isConversationEnded: ze,
|
|
3524
|
-
isSessionRestoring:
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
console.error("[FlowEngage] Failed to submit feedback:", e);
|
|
3532
|
-
}
|
|
3533
|
-
},
|
|
3534
|
-
dismissFeedback: () => He(!1),
|
|
3535
|
-
incomingCall: Ge,
|
|
3536
|
-
activeCallId: qe,
|
|
3537
|
-
callConnectionState: Ye,
|
|
3538
|
-
callConnectedAt: Ze,
|
|
3539
|
-
isCallMuted: $e,
|
|
3540
|
-
webRTCError: tt,
|
|
3512
|
+
isSessionRestoring: $e,
|
|
3513
|
+
incomingCall: Ve,
|
|
3514
|
+
activeCallId: Ue,
|
|
3515
|
+
callConnectionState: Ge,
|
|
3516
|
+
callConnectedAt: qe,
|
|
3517
|
+
isCallMuted: Ye,
|
|
3518
|
+
webRTCError: Ze,
|
|
3541
3519
|
language: r,
|
|
3542
|
-
historyRef:
|
|
3543
|
-
hasSyncedRef:
|
|
3544
|
-
dismissCallError:
|
|
3545
|
-
captureVisitorEmail:
|
|
3546
|
-
startTyping:
|
|
3547
|
-
stopTyping:
|
|
3548
|
-
updateTypingDraft:
|
|
3549
|
-
notifyRouteChange: () =>
|
|
3550
|
-
openWidget:
|
|
3551
|
-
closeWidget: () =>
|
|
3520
|
+
historyRef: xt,
|
|
3521
|
+
hasSyncedRef: St,
|
|
3522
|
+
dismissCallError: Et,
|
|
3523
|
+
captureVisitorEmail: Bt,
|
|
3524
|
+
startTyping: Vt,
|
|
3525
|
+
stopTyping: Ht,
|
|
3526
|
+
updateTypingDraft: Ut,
|
|
3527
|
+
notifyRouteChange: () => Ct.current?.notifyRouteChange?.(),
|
|
3528
|
+
openWidget: zt,
|
|
3529
|
+
closeWidget: () => w(!1),
|
|
3552
3530
|
toggleWidget: () => {
|
|
3553
|
-
if (
|
|
3554
|
-
|
|
3531
|
+
if (C) {
|
|
3532
|
+
w(!1);
|
|
3555
3533
|
return;
|
|
3556
3534
|
}
|
|
3557
|
-
|
|
3535
|
+
zt({ notifyChatInitiated: !0 });
|
|
3558
3536
|
},
|
|
3559
|
-
sendMessage:
|
|
3560
|
-
uploadChatFile:
|
|
3561
|
-
setVoiceMode:
|
|
3562
|
-
onMessageSync:
|
|
3563
|
-
endConversation:
|
|
3564
|
-
startNewChat:
|
|
3565
|
-
resumeChat:
|
|
3537
|
+
sendMessage: Wt,
|
|
3538
|
+
uploadChatFile: Gt,
|
|
3539
|
+
setVoiceMode: Kt,
|
|
3540
|
+
onMessageSync: qt,
|
|
3541
|
+
endConversation: Jt,
|
|
3542
|
+
startNewChat: Yt,
|
|
3543
|
+
resumeChat: Xt,
|
|
3566
3544
|
getVisitorChatHistory: () => O.current?.getVisitorChatHistory?.(),
|
|
3567
3545
|
getVisitorChatThread: (e) => O.current?.getVisitorChatThread?.(e),
|
|
3568
|
-
acceptCall:
|
|
3569
|
-
rejectCall:
|
|
3570
|
-
endWebRTCCall:
|
|
3571
|
-
toggleCallMute:
|
|
3546
|
+
acceptCall: Pt,
|
|
3547
|
+
rejectCall: Ft,
|
|
3548
|
+
endWebRTCCall: Lt,
|
|
3549
|
+
toggleCallMute: Rt
|
|
3572
3550
|
}), [
|
|
3573
3551
|
l,
|
|
3574
3552
|
d,
|
|
@@ -3576,8 +3554,8 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3576
3554
|
i,
|
|
3577
3555
|
y,
|
|
3578
3556
|
x,
|
|
3579
|
-
|
|
3580
|
-
|
|
3557
|
+
C,
|
|
3558
|
+
T,
|
|
3581
3559
|
ne,
|
|
3582
3560
|
E,
|
|
3583
3561
|
se,
|
|
@@ -3590,35 +3568,33 @@ function Cr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3590
3568
|
Ae,
|
|
3591
3569
|
Me,
|
|
3592
3570
|
ze,
|
|
3593
|
-
|
|
3571
|
+
$e,
|
|
3594
3572
|
Ve,
|
|
3595
3573
|
Ue,
|
|
3596
3574
|
Ge,
|
|
3597
3575
|
qe,
|
|
3598
3576
|
Ye,
|
|
3599
3577
|
Ze,
|
|
3600
|
-
$e,
|
|
3601
|
-
tt,
|
|
3602
3578
|
r,
|
|
3579
|
+
Bt,
|
|
3580
|
+
Vt,
|
|
3581
|
+
Ht,
|
|
3582
|
+
Ut,
|
|
3583
|
+
Pt,
|
|
3584
|
+
Ft,
|
|
3585
|
+
Lt,
|
|
3586
|
+
Rt,
|
|
3587
|
+
zt,
|
|
3603
3588
|
Wt,
|
|
3604
3589
|
Gt,
|
|
3605
3590
|
Kt,
|
|
3606
3591
|
qt,
|
|
3607
|
-
Rt,
|
|
3608
|
-
zt,
|
|
3609
|
-
Vt,
|
|
3610
|
-
Ht,
|
|
3611
|
-
Ut,
|
|
3612
3592
|
Jt,
|
|
3613
3593
|
Yt,
|
|
3614
|
-
|
|
3615
|
-
Zt,
|
|
3616
|
-
Qt,
|
|
3617
|
-
$t,
|
|
3618
|
-
At
|
|
3594
|
+
Et
|
|
3619
3595
|
]);
|
|
3620
3596
|
return /* @__PURE__ */ g(kn.Provider, {
|
|
3621
|
-
value:
|
|
3597
|
+
value: Zt,
|
|
3622
3598
|
children: n
|
|
3623
3599
|
});
|
|
3624
3600
|
}
|
|
@@ -4202,8 +4178,8 @@ function Qa(e = Ha.visualDuration, t = Ha.bounce) {
|
|
|
4202
4178
|
velocity: -/* @__PURE__ */ Gr(n.velocity || 0)
|
|
4203
4179
|
}), m = f || 0, h = l / (2 * Math.sqrt(c * u)), g = o - a, _ = /* @__PURE__ */ Gr(Math.sqrt(c / u)), v = Math.abs(g) < 5;
|
|
4204
4180
|
r ||= v ? Ha.restSpeed.granular : Ha.restSpeed.default, i ||= v ? Ha.restDelta.granular : Ha.restDelta.default;
|
|
4205
|
-
let y, b, x, S,
|
|
4206
|
-
if (h < 1) x = Ua(_, h), S = (m + h * _ * g) / x, y = (e) => o - Math.exp(-h * _ * e) * (S * Math.sin(x * e) + g * Math.cos(x * e)),
|
|
4181
|
+
let y, b, x, S, C, w;
|
|
4182
|
+
if (h < 1) x = Ua(_, h), S = (m + h * _ * g) / x, y = (e) => o - Math.exp(-h * _ * e) * (S * Math.sin(x * e) + g * Math.cos(x * e)), C = h * _ * S + g * x, w = h * _ * g - S * x, b = (e) => Math.exp(-h * _ * e) * (C * Math.sin(x * e) + w * Math.cos(x * e));
|
|
4207
4183
|
else if (h === 1) {
|
|
4208
4184
|
y = (e) => o - Math.exp(-_ * e) * (g + (m + _ * g) * e);
|
|
4209
4185
|
let e = m + _ * g;
|
|
@@ -4220,12 +4196,12 @@ function Qa(e = Ha.visualDuration, t = Ha.bounce) {
|
|
|
4220
4196
|
return i * (n * Math.sinh(a) + r * Math.cosh(a));
|
|
4221
4197
|
};
|
|
4222
4198
|
}
|
|
4223
|
-
let
|
|
4199
|
+
let T = {
|
|
4224
4200
|
calculatedDuration: p && d || null,
|
|
4225
4201
|
velocity: (e) => /* @__PURE__ */ Wr(b(e)),
|
|
4226
4202
|
next: (e) => {
|
|
4227
4203
|
if (!p && h < 1) {
|
|
4228
|
-
let t = Math.exp(-h * _ * e), n = Math.sin(x * e), a = Math.cos(x * e), c = o - t * (S * n + g * a), l = /* @__PURE__ */ Wr(t * (
|
|
4204
|
+
let t = Math.exp(-h * _ * e), n = Math.sin(x * e), a = Math.cos(x * e), c = o - t * (S * n + g * a), l = /* @__PURE__ */ Wr(t * (C * n + w * a));
|
|
4229
4205
|
return s.done = Math.abs(l) <= r && Math.abs(o - c) <= i, s.value = s.done ? o : c, s;
|
|
4230
4206
|
}
|
|
4231
4207
|
let t = y(e);
|
|
@@ -4237,12 +4213,12 @@ function Qa(e = Ha.visualDuration, t = Ha.bounce) {
|
|
|
4237
4213
|
return s.value = s.done ? o : t, s;
|
|
4238
4214
|
},
|
|
4239
4215
|
toString: () => {
|
|
4240
|
-
let e = Math.min(Ba(
|
|
4216
|
+
let e = Math.min(Ba(T), za), t = Ra((t) => T.next(e * t).value, e, 30);
|
|
4241
4217
|
return e + "ms " + t;
|
|
4242
4218
|
},
|
|
4243
4219
|
toTransition: () => {}
|
|
4244
4220
|
};
|
|
4245
|
-
return
|
|
4221
|
+
return T;
|
|
4246
4222
|
}
|
|
4247
4223
|
Qa.applyToOptions = (e) => {
|
|
4248
4224
|
let t = Va(e, 100, Qa);
|
|
@@ -4266,7 +4242,7 @@ function to({ keyframes: e, velocity: t = 0, power: n = .8, timeConstant: r = 32
|
|
|
4266
4242
|
let v = (e) => -h * Math.exp(-e / r), y = (e) => _ + v(e), b = (e) => {
|
|
4267
4243
|
let t = v(e), n = y(e);
|
|
4268
4244
|
f.done = Math.abs(t) <= l, f.value = f.done ? _ : n;
|
|
4269
|
-
}, x, S,
|
|
4245
|
+
}, x, S, C = (e) => {
|
|
4270
4246
|
p(f.value) && (x = e, S = Qa({
|
|
4271
4247
|
keyframes: [f.value, m(f.value)],
|
|
4272
4248
|
velocity: eo(y, e, f.value),
|
|
@@ -4276,11 +4252,11 @@ function to({ keyframes: e, velocity: t = 0, power: n = .8, timeConstant: r = 32
|
|
|
4276
4252
|
restSpeed: u
|
|
4277
4253
|
}));
|
|
4278
4254
|
};
|
|
4279
|
-
return
|
|
4255
|
+
return C(0), {
|
|
4280
4256
|
calculatedDuration: null,
|
|
4281
4257
|
next: (e) => {
|
|
4282
4258
|
let t = !1;
|
|
4283
|
-
return !S && x === void 0 && (t = !0, b(e),
|
|
4259
|
+
return !S && x === void 0 && (t = !0, b(e), C(e)), x !== void 0 && e >= x ? S.next(e - x) : (!t && b(e), f);
|
|
4284
4260
|
}
|
|
4285
4261
|
};
|
|
4286
4262
|
}
|
|
@@ -6507,30 +6483,30 @@ function Mu(e) {
|
|
|
6507
6483
|
});
|
|
6508
6484
|
continue;
|
|
6509
6485
|
}
|
|
6510
|
-
let y = Nu(m.prevProp, h), b = y || p === o && m.isActive && !v && g || t > f && g, x = !1, S = Array.isArray(h) ? h : [h],
|
|
6511
|
-
_ === !1 && (
|
|
6512
|
-
let { prevResolvedValues:
|
|
6513
|
-
...
|
|
6514
|
-
...
|
|
6515
|
-
},
|
|
6486
|
+
let y = Nu(m.prevProp, h), b = y || p === o && m.isActive && !v && g || t > f && g, x = !1, S = Array.isArray(h) ? h : [h], C = S.reduce(a(p), {});
|
|
6487
|
+
_ === !1 && (C = {});
|
|
6488
|
+
let { prevResolvedValues: w = {} } = m, T = {
|
|
6489
|
+
...w,
|
|
6490
|
+
...C
|
|
6491
|
+
}, ee = (t) => {
|
|
6516
6492
|
b = !0, u.has(t) && (x = !0, u.delete(t)), m.needsAnimating[t] = !0;
|
|
6517
6493
|
let n = e.getValue(t);
|
|
6518
6494
|
n && (n.liveStyle = !1);
|
|
6519
6495
|
};
|
|
6520
|
-
for (let e in
|
|
6521
|
-
let t =
|
|
6496
|
+
for (let e in T) {
|
|
6497
|
+
let t = C[e], n = w[e];
|
|
6522
6498
|
if (d.hasOwnProperty(e)) continue;
|
|
6523
6499
|
let r = !1;
|
|
6524
|
-
r = Gs(t) && Gs(n) ? !Ou(t, n) : t !== n, r ? t == null ? u.add(e) :
|
|
6500
|
+
r = Gs(t) && Gs(n) ? !Ou(t, n) : t !== n, r ? t == null ? u.add(e) : ee(e) : t !== void 0 && u.has(e) ? ee(e) : m.protectedKeys[e] = !0;
|
|
6525
6501
|
}
|
|
6526
|
-
m.prevProp = h, m.prevResolvedValues =
|
|
6502
|
+
m.prevProp = h, m.prevResolvedValues = C, m.isActive && (d = {
|
|
6527
6503
|
...d,
|
|
6528
|
-
...
|
|
6504
|
+
...C
|
|
6529
6505
|
}), (r || i) && e.blockInitialAnimation && (b = !1);
|
|
6530
|
-
let
|
|
6531
|
-
b && (!
|
|
6506
|
+
let te = v && y;
|
|
6507
|
+
b && (!te || x) && l.push(...S.map((t) => {
|
|
6532
6508
|
let n = { type: p };
|
|
6533
|
-
if (typeof t == "string" && (r || i) && !
|
|
6509
|
+
if (typeof t == "string" && (r || i) && !te && e.manuallyAnimateOnMount && e.parent) {
|
|
6534
6510
|
let { parent: r } = e, i = Rs(r, t);
|
|
6535
6511
|
if (r.enteringChildren && i) {
|
|
6536
6512
|
let { delayChildren: t } = i.transition || {};
|
|
@@ -7484,14 +7460,14 @@ function wf(e) {
|
|
|
7484
7460
|
}
|
|
7485
7461
|
//#endregion
|
|
7486
7462
|
//#region __vite-optional-peer-dep:@emotion/is-prop-valid:framer-motion
|
|
7487
|
-
var Tf = /* @__PURE__ */
|
|
7463
|
+
var Tf = /* @__PURE__ */ C({ default: () => Ef }), Ef, Df = S((() => {
|
|
7488
7464
|
throw Ef = {}, Error("Could not resolve \"@emotion/is-prop-valid\" imported by \"framer-motion\". Is it installed?");
|
|
7489
7465
|
})), Of = (e) => !wf(e);
|
|
7490
7466
|
function kf(e) {
|
|
7491
7467
|
typeof e == "function" && (Of = (t) => t.startsWith("on") ? !wf(t) : e(t));
|
|
7492
7468
|
}
|
|
7493
7469
|
try {
|
|
7494
|
-
kf((Df(),
|
|
7470
|
+
kf((Df(), T(Tf)).default);
|
|
7495
7471
|
} catch {}
|
|
7496
7472
|
function Af(e, t, n) {
|
|
7497
7473
|
let r = {};
|
|
@@ -27231,8 +27207,8 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27231
27207
|
}
|
|
27232
27208
|
//#endregion
|
|
27233
27209
|
//#region src/components/ChatInput.jsx
|
|
27234
|
-
function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: c, clearReplyContext: l, requiresEmail: u, emailInput: d, setEmailInput: f, emailError: m, showVoiceToggle: v = !1, voiceEnabled: y = !0, onFileSelect: b, selectedFile: x = null, onRemoveSelectedFile: S, attachmentError:
|
|
27235
|
-
let
|
|
27210
|
+
function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: c, clearReplyContext: l, requiresEmail: u, emailInput: d, setEmailInput: f, emailError: m, showVoiceToggle: v = !1, voiceEnabled: y = !0, onFileSelect: b, selectedFile: x = null, onRemoveSelectedFile: S, attachmentError: C = "", isUploadingAttachment: w = !1, inputPlaceholder: T = "Type your message" }) {
|
|
27211
|
+
let ee = p(null), te = c?.sender === "user" ? "You" : c?.sender === "agent" ? "Agent" : "AI Assistant", ne = u ? !!d?.trim() : !!e?.trim() || !!x, re = s || w || !ne, E = !u && y && v;
|
|
27236
27212
|
return /* @__PURE__ */ _("div", {
|
|
27237
27213
|
style: {
|
|
27238
27214
|
padding: "0 16px",
|
|
@@ -27265,7 +27241,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27265
27241
|
fontWeight: 600,
|
|
27266
27242
|
color: "var(--flowengage-primary)"
|
|
27267
27243
|
},
|
|
27268
|
-
children: ["Replying to ",
|
|
27244
|
+
children: ["Replying to ", te]
|
|
27269
27245
|
}), /* @__PURE__ */ g("div", {
|
|
27270
27246
|
style: {
|
|
27271
27247
|
overflow: "hidden",
|
|
@@ -27417,7 +27393,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27417
27393
|
onSubmit: n,
|
|
27418
27394
|
children: [
|
|
27419
27395
|
E ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
|
|
27420
|
-
ref:
|
|
27396
|
+
ref: ee,
|
|
27421
27397
|
type: "file",
|
|
27422
27398
|
accept: BD,
|
|
27423
27399
|
style: { display: "none" },
|
|
@@ -27441,10 +27417,10 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27441
27417
|
cursor: "pointer",
|
|
27442
27418
|
flexShrink: 0
|
|
27443
27419
|
},
|
|
27444
|
-
onClick: () =>
|
|
27420
|
+
onClick: () => ee.current?.click(),
|
|
27445
27421
|
title: "Attach file",
|
|
27446
27422
|
"aria-label": "Attach file",
|
|
27447
|
-
disabled:
|
|
27423
|
+
disabled: w,
|
|
27448
27424
|
onMouseEnter: (e) => {
|
|
27449
27425
|
e.currentTarget.style.opacity = "0.8";
|
|
27450
27426
|
},
|
|
@@ -27478,7 +27454,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27478
27454
|
}
|
|
27479
27455
|
t(e.target.value);
|
|
27480
27456
|
},
|
|
27481
|
-
placeholder: u ? "Enter your Email" : o === "agent" ? "Message the agent…" :
|
|
27457
|
+
placeholder: u ? "Enter your Email" : o === "agent" ? "Message the agent…" : T,
|
|
27482
27458
|
disabled: s,
|
|
27483
27459
|
type: u ? "email" : "text",
|
|
27484
27460
|
autoComplete: u ? "email" : "off"
|
|
@@ -27511,7 +27487,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27511
27487
|
})
|
|
27512
27488
|
]
|
|
27513
27489
|
}),
|
|
27514
|
-
!u &&
|
|
27490
|
+
!u && C && /* @__PURE__ */ _("div", {
|
|
27515
27491
|
style: {
|
|
27516
27492
|
display: "flex",
|
|
27517
27493
|
alignItems: "center",
|
|
@@ -27553,7 +27529,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27553
27529
|
color: "#dc2626",
|
|
27554
27530
|
fontWeight: 500
|
|
27555
27531
|
},
|
|
27556
|
-
children:
|
|
27532
|
+
children: C
|
|
27557
27533
|
})]
|
|
27558
27534
|
}),
|
|
27559
27535
|
u && m && /* @__PURE__ */ g("div", {
|
|
@@ -27959,9 +27935,9 @@ function uO(e) {
|
|
|
27959
27935
|
function dO({ 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 = [] }) {
|
|
27960
27936
|
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = uO(!!e), S = async () => {
|
|
27961
27937
|
x(), await c();
|
|
27962
|
-
},
|
|
27938
|
+
}, C = async () => {
|
|
27963
27939
|
x(), await l();
|
|
27964
|
-
},
|
|
27940
|
+
}, w = i ? "muted" : n === "connecting" ? "idle" : "listening", T = b === "ongoing", ee = {
|
|
27965
27941
|
position: "absolute",
|
|
27966
27942
|
inset: 0,
|
|
27967
27943
|
zIndex: 10,
|
|
@@ -27970,12 +27946,12 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27970
27946
|
borderRadius: "inherit",
|
|
27971
27947
|
overflow: "hidden",
|
|
27972
27948
|
background: cO(h, m),
|
|
27973
|
-
animation:
|
|
27949
|
+
animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
|
|
27974
27950
|
};
|
|
27975
27951
|
if (b === "incoming") {
|
|
27976
27952
|
let e = Array.isArray(h) && h.length > 0 ? h : [m];
|
|
27977
27953
|
return /* @__PURE__ */ _("div", {
|
|
27978
|
-
style:
|
|
27954
|
+
style: ee,
|
|
27979
27955
|
children: [/* @__PURE__ */ g("style", { children: aO }), /* @__PURE__ */ _("div", {
|
|
27980
27956
|
style: {
|
|
27981
27957
|
flex: 1,
|
|
@@ -28082,7 +28058,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28082
28058
|
},
|
|
28083
28059
|
children: [/* @__PURE__ */ g("button", {
|
|
28084
28060
|
type: "button",
|
|
28085
|
-
onClick:
|
|
28061
|
+
onClick: C,
|
|
28086
28062
|
style: {
|
|
28087
28063
|
width: "68px",
|
|
28088
28064
|
height: "68px",
|
|
@@ -28161,7 +28137,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28161
28137
|
});
|
|
28162
28138
|
}
|
|
28163
28139
|
return b === "connecting" ? /* @__PURE__ */ _("div", {
|
|
28164
|
-
style:
|
|
28140
|
+
style: ee,
|
|
28165
28141
|
children: [/* @__PURE__ */ g("style", { children: aO }), /* @__PURE__ */ _("div", {
|
|
28166
28142
|
style: {
|
|
28167
28143
|
flex: 1,
|
|
@@ -28197,7 +28173,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28197
28173
|
]
|
|
28198
28174
|
})]
|
|
28199
28175
|
}) : /* @__PURE__ */ _("div", {
|
|
28200
|
-
style:
|
|
28176
|
+
style: ee,
|
|
28201
28177
|
children: [
|
|
28202
28178
|
/* @__PURE__ */ g("style", { children: aO }),
|
|
28203
28179
|
/* @__PURE__ */ _("div", {
|
|
@@ -28248,7 +28224,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28248
28224
|
/* @__PURE__ */ g(iO, {
|
|
28249
28225
|
colors: h,
|
|
28250
28226
|
size: 36,
|
|
28251
|
-
voiceState:
|
|
28227
|
+
voiceState: w
|
|
28252
28228
|
}),
|
|
28253
28229
|
/* @__PURE__ */ g("div", {
|
|
28254
28230
|
style: {
|
|
@@ -29648,27 +29624,6 @@ function Tk(e) {
|
|
|
29648
29624
|
}
|
|
29649
29625
|
},
|
|
29650
29626
|
flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
|
|
29651
|
-
flowengage_submit_feedback: async (r) => {
|
|
29652
|
-
let i = _k(r), a = Number(i.rating ?? i.score ?? 0), o = (i.comment ?? i.feedback ?? "").toString().trim();
|
|
29653
|
-
if ($("flowengage_submit_feedback ▶", {
|
|
29654
|
-
rating: a,
|
|
29655
|
-
comment: o
|
|
29656
|
-
}), !a || a < 1 || a > 5) return "Invalid rating. Please provide a number between 1 and 5.";
|
|
29657
|
-
try {
|
|
29658
|
-
return (await fetch(`${n}/api/chat/feedback`, {
|
|
29659
|
-
method: "POST",
|
|
29660
|
-
headers: { "Content-Type": "application/json" },
|
|
29661
|
-
body: JSON.stringify({
|
|
29662
|
-
chatId: e.chatId || null,
|
|
29663
|
-
rating: a,
|
|
29664
|
-
comment: o,
|
|
29665
|
-
siteId: t
|
|
29666
|
-
})
|
|
29667
|
-
})).ok ? ($("flowengage_submit_feedback ✓ rating:", a), `Thank you! Your rating of ${a}/5 has been recorded.`) : "Feedback could not be saved right now. Thank you anyway!";
|
|
29668
|
-
} catch (e) {
|
|
29669
|
-
return $("flowengage_submit_feedback ✖", e.message), "Thank you for your feedback!";
|
|
29670
|
-
}
|
|
29671
|
-
},
|
|
29672
29627
|
flowengage_list_forms: async () => {
|
|
29673
29628
|
let e = $O(), t = ek();
|
|
29674
29629
|
return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
|
|
@@ -29758,7 +29713,6 @@ function Tk(e) {
|
|
|
29758
29713
|
searchSiteContent: a.flowengage_search,
|
|
29759
29714
|
getPageContent: a.flowengage_page_content,
|
|
29760
29715
|
endVoiceSession: a.flowengage_end_session,
|
|
29761
|
-
submitFeedback: a.flowengage_submit_feedback,
|
|
29762
29716
|
listPageForms: a.flowengage_list_forms,
|
|
29763
29717
|
fillFormFields: a.flowengage_fill_form,
|
|
29764
29718
|
clickPageButton: a.flowengage_click_button
|
|
@@ -30158,149 +30112,133 @@ function Fk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
30158
30112
|
]
|
|
30159
30113
|
});
|
|
30160
30114
|
}
|
|
30161
|
-
function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a,
|
|
30162
|
-
let [
|
|
30163
|
-
|
|
30164
|
-
C.current || (C.current = !0,
|
|
30115
|
+
function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, historyRef: s, onMessageSync: l }) {
|
|
30116
|
+
let [u, d] = m("idle"), [f, h] = m(!1), [v, y] = m(!1), b = p(null), x = p(""), S = p(async () => {}), C = p(!1), w = p(!1), T = p(!1), ee = p(!1), te = p("minimized"), ne = p(null), re = o((e = "minimized") => {
|
|
30117
|
+
te.current = e, ee.current = !0, queueMicrotask(() => {
|
|
30118
|
+
C.current || (C.current = !0, S.current?.());
|
|
30165
30119
|
});
|
|
30166
|
-
}, [
|
|
30167
|
-
|
|
30120
|
+
}, [s]), E = o(async (e) => {
|
|
30121
|
+
ee.current = !0;
|
|
30168
30122
|
try {
|
|
30169
|
-
await
|
|
30123
|
+
await b.current?.endSession?.();
|
|
30170
30124
|
} catch {}
|
|
30171
|
-
if (
|
|
30125
|
+
if (b.current = null, d("idle"), h(!1), C.current = !1, i) try {
|
|
30172
30126
|
Ae(i);
|
|
30173
30127
|
} catch {}
|
|
30174
|
-
typeof
|
|
30128
|
+
typeof l == "function" && await l(s.current), e?.();
|
|
30175
30129
|
}, [
|
|
30130
|
+
s,
|
|
30176
30131
|
l,
|
|
30177
|
-
u,
|
|
30178
30132
|
i
|
|
30179
30133
|
]);
|
|
30180
|
-
return
|
|
30181
|
-
|
|
30182
|
-
}, [
|
|
30134
|
+
return S.current = () => E(te.current === "chat" ? t : n), c(() => {
|
|
30135
|
+
w.current = f;
|
|
30136
|
+
}, [f]), c(() => {
|
|
30183
30137
|
let e = !1, n = null;
|
|
30184
30138
|
return (async () => {
|
|
30185
30139
|
if (!r) {
|
|
30186
|
-
|
|
30140
|
+
d("error");
|
|
30187
30141
|
return;
|
|
30188
30142
|
}
|
|
30189
30143
|
try {
|
|
30190
30144
|
if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
|
|
30191
|
-
|
|
30145
|
+
s.current = [], x.current = "", C.current = !1, T.current = !1, ee.current = !1, te.current = "minimized";
|
|
30192
30146
|
let t = Ek(Tk({
|
|
30193
30147
|
siteId: i || null,
|
|
30194
30148
|
apiBaseUrl: a || null,
|
|
30195
|
-
|
|
30196
|
-
getLastUserVoiceText: () => S.current,
|
|
30149
|
+
getLastUserVoiceText: () => x.current,
|
|
30197
30150
|
requestEndSession: () => {
|
|
30198
|
-
|
|
30151
|
+
re();
|
|
30199
30152
|
}
|
|
30200
|
-
})), o = i ? ke(i) : null, c = !!o?.transcript,
|
|
30153
|
+
})), o = i ? ke(i) : null, c = !!o?.transcript, l = {
|
|
30154
|
+
agentId: r,
|
|
30201
30155
|
clientTools: t,
|
|
30202
30156
|
connectionType: "websocket"
|
|
30203
30157
|
};
|
|
30204
|
-
|
|
30205
|
-
|
|
30206
|
-
|
|
30207
|
-
headers: { "Content-Type": "application/json" }
|
|
30208
|
-
});
|
|
30209
|
-
if (e.ok) {
|
|
30210
|
-
let t = await e.json();
|
|
30211
|
-
t?.signedUrl && (u.signedUrl = t.signedUrl, console.log("[FlowEngage] ✅ Using signed ElevenLabs URL"));
|
|
30212
|
-
}
|
|
30213
|
-
} catch (e) {
|
|
30214
|
-
console.warn("[FlowEngage] Signed URL fetch failed, falling back to agentId:", e.message);
|
|
30215
|
-
}
|
|
30216
|
-
if (!u.signedUrl && r && (u.agentId = r), c) u.overrides = { agent: { firstMessage: "" } };
|
|
30217
|
-
else {
|
|
30218
|
-
let e = typeof window < "u" ? window.location.pathname : "", t = typeof window < "u" ? document.title : "";
|
|
30219
|
-
!e || e === "/" || e === "/home" || e === "/index" || (u.overrides = { agent: { firstMessage: `Hi! I see you've landed on the ${t || e.replace(/^\//, "").replace(/[-_]/g, " ").replace(/\//g, " › ") || "this page"} page. Are you looking for something specific here?` } }, console.log(`[FlowEngage] 🏠 Page-context voice greeting injected for path: ${e}`));
|
|
30220
|
-
}
|
|
30221
|
-
let d = await xD.startSession({
|
|
30222
|
-
...u,
|
|
30158
|
+
c && (l.overrides = { agent: { firstMessage: "" } });
|
|
30159
|
+
let u = await xD.startSession({
|
|
30160
|
+
...l,
|
|
30223
30161
|
onUnhandledClientToolCall: (e) => console.error("[FlowEngage] Unhandled tool:", e?.tool_name),
|
|
30224
30162
|
onModeChange: ({ mode: t }) => {
|
|
30225
|
-
e ||
|
|
30163
|
+
e || d(t === "speaking" ? "speaking" : "listening");
|
|
30226
30164
|
},
|
|
30227
30165
|
onMessage: (t) => {
|
|
30228
30166
|
if (e) return;
|
|
30229
30167
|
let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
|
|
30230
30168
|
if (r) {
|
|
30231
|
-
if (n === "user" && (
|
|
30169
|
+
if (n === "user" && (x.current = r), s.current = [...s.current, {
|
|
30232
30170
|
sender: n,
|
|
30233
30171
|
message: r,
|
|
30234
30172
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
30235
30173
|
}], i) try {
|
|
30236
|
-
let e = pO(
|
|
30174
|
+
let e = pO(s.current);
|
|
30237
30175
|
e && Oe(i, e);
|
|
30238
30176
|
} catch {}
|
|
30239
|
-
Mk(n, r) &&
|
|
30177
|
+
Mk(n, r) && re("minimized");
|
|
30240
30178
|
}
|
|
30241
30179
|
},
|
|
30242
30180
|
onError: (t) => {
|
|
30243
|
-
if (!e && !
|
|
30244
|
-
|
|
30181
|
+
if (!e && !ee.current && !T.current) {
|
|
30182
|
+
T.current = !0, console.error("[FlowEngageVoiceCall] session:error", {
|
|
30245
30183
|
message: t?.message,
|
|
30246
30184
|
name: t?.name,
|
|
30247
30185
|
raw: t
|
|
30248
30186
|
});
|
|
30249
30187
|
try {
|
|
30250
|
-
|
|
30188
|
+
b.current?.setMicMuted?.(!0);
|
|
30251
30189
|
} catch {}
|
|
30252
|
-
|
|
30190
|
+
h(!0), d("error"), re("chat");
|
|
30253
30191
|
}
|
|
30254
30192
|
},
|
|
30255
30193
|
onDisconnect: () => {
|
|
30256
|
-
if (!e && !
|
|
30257
|
-
|
|
30258
|
-
historyCount:
|
|
30259
|
-
lastUserText:
|
|
30260
|
-
wasMuted:
|
|
30194
|
+
if (!e && !ee.current && !T.current) {
|
|
30195
|
+
T.current = !0, console.warn("[FlowEngageVoiceCall] session:disconnected", {
|
|
30196
|
+
historyCount: s.current?.length || 0,
|
|
30197
|
+
lastUserText: x.current || "",
|
|
30198
|
+
wasMuted: w.current
|
|
30261
30199
|
});
|
|
30262
30200
|
try {
|
|
30263
|
-
|
|
30201
|
+
b.current?.setMicMuted?.(!0);
|
|
30264
30202
|
} catch {}
|
|
30265
|
-
|
|
30203
|
+
h(!0), re("chat");
|
|
30266
30204
|
}
|
|
30267
30205
|
}
|
|
30268
30206
|
});
|
|
30269
30207
|
if (e) {
|
|
30270
|
-
|
|
30208
|
+
u.endSession().catch(() => {});
|
|
30271
30209
|
return;
|
|
30272
30210
|
}
|
|
30273
|
-
n =
|
|
30211
|
+
n = u, b.current = u, d("listening");
|
|
30274
30212
|
try {
|
|
30275
30213
|
let e = typeof window < "u" ? window.location.href : "", n = "[]";
|
|
30276
30214
|
try {
|
|
30277
30215
|
n = await t.list_page_forms();
|
|
30278
30216
|
} catch {}
|
|
30279
30217
|
let r = c ? `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${o.transcript}\n\n` : "";
|
|
30280
|
-
|
|
30218
|
+
u.sendContextualUpdate(`${r}Page: ${e}. SiteId: ${i || "unknown"}. Forms: ${n}. Voice: call end_voice_session or say you are ending the session to stop.`);
|
|
30281
30219
|
} catch {}
|
|
30282
30220
|
} catch (n) {
|
|
30283
|
-
e || (console.error("[FlowEngage] startSession failed", n),
|
|
30221
|
+
e || (console.error("[FlowEngage] startSession failed", n), d("error"), te.current = "chat", window.setTimeout(() => {
|
|
30284
30222
|
e || t?.();
|
|
30285
30223
|
}, 0));
|
|
30286
30224
|
}
|
|
30287
30225
|
})(), () => {
|
|
30288
|
-
e = !0,
|
|
30226
|
+
e = !0, ee.current = !0, (n || b.current)?.endSession?.().catch(() => {});
|
|
30289
30227
|
};
|
|
30290
30228
|
}, [
|
|
30291
30229
|
r,
|
|
30292
30230
|
i,
|
|
30293
30231
|
a,
|
|
30294
|
-
|
|
30232
|
+
re
|
|
30295
30233
|
]), c(() => {
|
|
30296
|
-
if (!
|
|
30234
|
+
if (!v) return;
|
|
30297
30235
|
let e = (e) => {
|
|
30298
30236
|
let t = e.composedPath?.()?.[0] || e.target;
|
|
30299
|
-
|
|
30237
|
+
ne.current && !ne.current.contains(t) && y(!1);
|
|
30300
30238
|
};
|
|
30301
30239
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
30302
|
-
}, [
|
|
30303
|
-
ref:
|
|
30240
|
+
}, [v]), /* @__PURE__ */ _("div", {
|
|
30241
|
+
ref: ne,
|
|
30304
30242
|
style: {
|
|
30305
30243
|
position: "relative",
|
|
30306
30244
|
display: "flex",
|
|
@@ -30312,7 +30250,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30312
30250
|
children: [
|
|
30313
30251
|
/* @__PURE__ */ _("div", {
|
|
30314
30252
|
style: { position: "relative" },
|
|
30315
|
-
children: [
|
|
30253
|
+
children: [u === "listening" && /* @__PURE__ */ g("span", {
|
|
30316
30254
|
style: {
|
|
30317
30255
|
position: "absolute",
|
|
30318
30256
|
right: "100%",
|
|
@@ -30329,12 +30267,12 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30329
30267
|
children: "Listening..."
|
|
30330
30268
|
}), /* @__PURE__ */ g(Nk, {
|
|
30331
30269
|
size: 72,
|
|
30332
|
-
voiceState:
|
|
30333
|
-
isMuted:
|
|
30270
|
+
voiceState: u,
|
|
30271
|
+
isMuted: f,
|
|
30334
30272
|
orbColors: e
|
|
30335
30273
|
})]
|
|
30336
30274
|
}),
|
|
30337
|
-
|
|
30275
|
+
u === "error" && /* @__PURE__ */ g("span", {
|
|
30338
30276
|
style: {
|
|
30339
30277
|
color: "#f87171",
|
|
30340
30278
|
fontSize: "13px",
|
|
@@ -30350,28 +30288,28 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30350
30288
|
},
|
|
30351
30289
|
children: [/* @__PURE__ */ g("button", {
|
|
30352
30290
|
onClick: async () => {
|
|
30353
|
-
if (
|
|
30354
|
-
|
|
30291
|
+
if (b.current) try {
|
|
30292
|
+
f ? (await b.current.setMicMuted?.(!1), h(!1)) : (await b.current.setMicMuted?.(!0), h(!0));
|
|
30355
30293
|
} catch {}
|
|
30356
30294
|
},
|
|
30357
|
-
title:
|
|
30295
|
+
title: f ? "Unmute" : "Mute",
|
|
30358
30296
|
style: {
|
|
30359
30297
|
width: "24px",
|
|
30360
30298
|
height: "24px",
|
|
30361
30299
|
borderRadius: "50%",
|
|
30362
|
-
background:
|
|
30363
|
-
border:
|
|
30300
|
+
background: f ? "#7f1d1d" : "#1f2937",
|
|
30301
|
+
border: f ? "1.5px solid #ef4444" : "1.5px solid #4b5563",
|
|
30364
30302
|
display: "flex",
|
|
30365
30303
|
alignItems: "center",
|
|
30366
30304
|
justifyContent: "center",
|
|
30367
30305
|
cursor: "pointer",
|
|
30368
|
-
color:
|
|
30306
|
+
color: f ? "#f87171" : "white",
|
|
30369
30307
|
transition: "all 0.2s ease",
|
|
30370
30308
|
boxShadow: "0 2px 8px rgba(0,0,0,0.4)",
|
|
30371
30309
|
padding: 0,
|
|
30372
30310
|
flexShrink: 0
|
|
30373
30311
|
},
|
|
30374
|
-
children:
|
|
30312
|
+
children: f ? /* @__PURE__ */ _("svg", {
|
|
30375
30313
|
width: "16",
|
|
30376
30314
|
height: "16",
|
|
30377
30315
|
viewBox: "0 0 24 24",
|
|
@@ -30407,7 +30345,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30407
30345
|
color: "currentColor"
|
|
30408
30346
|
})
|
|
30409
30347
|
}), /* @__PURE__ */ g("button", {
|
|
30410
|
-
onClick: () =>
|
|
30348
|
+
onClick: () => y((e) => !e),
|
|
30411
30349
|
style: {
|
|
30412
30350
|
width: "24px",
|
|
30413
30351
|
height: "24px",
|
|
@@ -30430,7 +30368,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30430
30368
|
})
|
|
30431
30369
|
})]
|
|
30432
30370
|
}),
|
|
30433
|
-
|
|
30371
|
+
v && /* @__PURE__ */ _("div", {
|
|
30434
30372
|
style: {
|
|
30435
30373
|
position: "absolute",
|
|
30436
30374
|
bottom: 0,
|
|
@@ -30448,7 +30386,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30448
30386
|
children: [
|
|
30449
30387
|
/* @__PURE__ */ _("button", {
|
|
30450
30388
|
onClick: () => {
|
|
30451
|
-
|
|
30389
|
+
y(!1), te.current = "chat", E(t);
|
|
30452
30390
|
},
|
|
30453
30391
|
style: {
|
|
30454
30392
|
display: "flex",
|
|
@@ -30477,7 +30415,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30477
30415
|
}),
|
|
30478
30416
|
/* @__PURE__ */ _("button", {
|
|
30479
30417
|
onClick: () => {
|
|
30480
|
-
|
|
30418
|
+
y(!1), te.current = "minimized", E(n);
|
|
30481
30419
|
},
|
|
30482
30420
|
style: {
|
|
30483
30421
|
display: "flex",
|
|
@@ -30505,7 +30443,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
30505
30443
|
children: [/* @__PURE__ */ g(MD, {}), "End Conversation"]
|
|
30506
30444
|
}),
|
|
30507
30445
|
/* @__PURE__ */ g("button", {
|
|
30508
|
-
onClick: () =>
|
|
30446
|
+
onClick: () => y(!1),
|
|
30509
30447
|
style: {
|
|
30510
30448
|
position: "absolute",
|
|
30511
30449
|
bottom: "8px",
|
|
@@ -30600,8 +30538,8 @@ var Rk = () => /* @__PURE__ */ g("div", {
|
|
|
30600
30538
|
} }, e))
|
|
30601
30539
|
})
|
|
30602
30540
|
});
|
|
30603
|
-
function zk({ 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:
|
|
30604
|
-
let Ne = l.length > 0, Pe =
|
|
30541
|
+
function zk({ 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, replyContext: le, setReplyContext: ue, webRTCError: de, micError: fe, setMicError: pe, dismissCallError: me, activeCallId: he, isCallMuted: ge, toggleCallMute: _e, endWebRTCCall: ve, formatCallDuration: ye, callDurationSeconds: be, isCallMinimized: xe, onExpand: Se, onCollapse: Ce, onStartVoice: we, onNewChat: Te, onEndConversation: Ee, showPoweredBy: De, getVisitorChatHistory: Oe, getVisitorChatThread: ke, resumeChat: Ae, isSessionRestoring: je, isClosing: Me }) {
|
|
30542
|
+
let Ne = l.length > 0, Pe = T || ee || w, Fe = !!he, [Ie, Le] = m(!1), [Re, ze] = m(!1), [Be, Ve] = m([]), [He, Ue] = m(!1), [We, Ge] = m(null), [Ke, qe] = m([]), Je = p(null), Ye = async () => {
|
|
30605
30543
|
Le(!1), ze(!0), Ue(!0), Ge(null);
|
|
30606
30544
|
try {
|
|
30607
30545
|
let e = await Oe();
|
|
@@ -31023,8 +30961,8 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31023
30961
|
micError: fe,
|
|
31024
30962
|
setMicError: pe,
|
|
31025
30963
|
dismissCallError: me,
|
|
31026
|
-
isRateLimited:
|
|
31027
|
-
rateLimitMessage:
|
|
30964
|
+
isRateLimited: ee,
|
|
30965
|
+
rateLimitMessage: te
|
|
31028
30966
|
}),
|
|
31029
30967
|
xe && /* @__PURE__ */ g(fO, {
|
|
31030
30968
|
agentName: v,
|
|
@@ -31221,7 +31159,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31221
31159
|
}) : null, Ne ? /* @__PURE__ */ g(qD, {
|
|
31222
31160
|
chatHistory: l,
|
|
31223
31161
|
isAiTyping: u,
|
|
31224
|
-
isLoading:
|
|
31162
|
+
isLoading: T,
|
|
31225
31163
|
isAgentTyping: d,
|
|
31226
31164
|
setReplyContext: ue,
|
|
31227
31165
|
TypingDots: Rk,
|
|
@@ -31330,8 +31268,8 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31330
31268
|
children: /* @__PURE__ */ g(JD, {
|
|
31331
31269
|
input: x,
|
|
31332
31270
|
setInput: S,
|
|
31333
|
-
onSubmit:
|
|
31334
|
-
isConversationEnded:
|
|
31271
|
+
onSubmit: C,
|
|
31272
|
+
isConversationEnded: w,
|
|
31335
31273
|
callUiActive: Fe,
|
|
31336
31274
|
handleToggleVoice: we,
|
|
31337
31275
|
showVoiceToggle: f === "agent",
|
|
@@ -31378,275 +31316,275 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31378
31316
|
});
|
|
31379
31317
|
}
|
|
31380
31318
|
function Bk() {
|
|
31381
|
-
let { status: e, runtimeConfig: t, resolvedConfig: n,
|
|
31319
|
+
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, historyRef: ie, onMessageSync: ae, sendMessage: oe, uploadChatFile: D, openWidget: se, captureVisitorEmail: ce, setVoiceMode: le, endConversation: ue, startNewChat: de, acceptCall: me, rejectCall: he, endWebRTCCall: ge, toggleCallMute: _e, dismissCallError: ve, startTyping: ye, stopTyping: be, updateTypingDraft: xe, getVisitorChatHistory: Se, getVisitorChatThread: Ce, resumeChat: we, isSessionRestoring: Te } = An();
|
|
31382
31320
|
c(() => {
|
|
31383
31321
|
try {
|
|
31384
31322
|
rr();
|
|
31385
31323
|
} catch {}
|
|
31386
31324
|
}, []);
|
|
31387
|
-
let
|
|
31388
|
-
...
|
|
31389
|
-
...
|
|
31325
|
+
let Ee = t?.widgetSettings || {}, De = n?.widgetSettings || {}, Oe = {
|
|
31326
|
+
...Ee.branding || {},
|
|
31327
|
+
...De.branding || {}
|
|
31328
|
+
}, ke = {
|
|
31329
|
+
...Ee.theme || {},
|
|
31330
|
+
...De.theme || {}
|
|
31390
31331
|
}, Ae = {
|
|
31391
|
-
...
|
|
31392
|
-
...
|
|
31393
|
-
}, je = {
|
|
31394
|
-
...De.features || {},
|
|
31395
|
-
...Oe.features || {}
|
|
31396
|
-
}, Me = je.voice !== !1, Pe = Array.isArray(Ae.orbColors) && Ae.orbColors.length > 0 ? Ae.orbColors : null, Fe = Ae.buttonColor || Ae.primaryColor || Pe?.[0] || "#3B82F6", Ie = Ae.position || "bottom-right", Le = ke.fallbackAgentName || "Agent", Re = Ok(Pe ?? Ae.chatBgColors), ze = ke.logo || ke.logoUrl || null, Be = ie || "en", Ve = De.recommendations?.[Be] || [], He = (Oe.recommendations?.[Be] ?? Ve).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
31332
|
+
...Ee.features || {},
|
|
31333
|
+
...De.features || {}
|
|
31334
|
+
}, je = Ae.voice !== !1, Me = Array.isArray(ke.orbColors) && ke.orbColors.length > 0 ? ke.orbColors : null, Pe = ke.buttonColor || ke.primaryColor || Me?.[0] || "#3B82F6", Fe = ke.position || "bottom-right", Ie = Oe.fallbackAgentName || "Agent", Le = Ok(Me ?? ke.chatBgColors), Re = Oe.logo || Oe.logoUrl || null, ze = E || "en", Be = Ee.recommendations?.[ze] || [], Ve = (De.recommendations?.[ze] ?? Be).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
31397
31335
|
id: e.key || `qr-${t}`,
|
|
31398
31336
|
label: e.label,
|
|
31399
31337
|
message: e.label,
|
|
31400
31338
|
text: e.label
|
|
31401
|
-
})),
|
|
31402
|
-
entryPrompt:
|
|
31403
|
-
yesLabel:
|
|
31404
|
-
laterLabel:
|
|
31405
|
-
connectionTitle:
|
|
31406
|
-
voiceLabel:
|
|
31407
|
-
textLabel:
|
|
31408
|
-
chatTitle:
|
|
31409
|
-
introGreeting:
|
|
31410
|
-
inputPlaceholder:
|
|
31411
|
-
analysingLabel:
|
|
31412
|
-
},
|
|
31413
|
-
|
|
31339
|
+
})), He = Array.isArray(Oe.quickChatOptions) && Oe.quickChatOptions.length > 0 ? Oe.quickChatOptions : Ve, Ue = Oe.hideWatermark === !0 ? !1 : Oe.showPoweredBy !== !1, We = Oe.chatbotEnabled !== !1 && ke.chatbotEnabled !== !1, Ge = Ee.greetings?.[E] || De.greetings?.[E] || Oe.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Ke = {
|
|
31340
|
+
entryPrompt: Oe.entryPrompt || "Do you want to explore in a new way?",
|
|
31341
|
+
yesLabel: Oe.yesLabel || "Yes",
|
|
31342
|
+
laterLabel: Oe.laterLabel || "Later",
|
|
31343
|
+
connectionTitle: Oe.connectionTitle || "How would you like to connect?",
|
|
31344
|
+
voiceLabel: Oe.voiceLabel || "Voice",
|
|
31345
|
+
textLabel: Oe.textLabel || "Text",
|
|
31346
|
+
chatTitle: Oe.headerName || "Chat with FlowEngage",
|
|
31347
|
+
introGreeting: Ge,
|
|
31348
|
+
inputPlaceholder: Oe.inputPlaceholder || "Type your message",
|
|
31349
|
+
analysingLabel: Oe.analysingLabel || "analysing..."
|
|
31350
|
+
}, qe = De.elevenLabsAgentId || t?.elevenLabsAgentId || null, Je = t?.siteId || n?.siteId || null, Ye = t?.apiBaseUrl || "", Xe = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
|
|
31351
|
+
l,
|
|
31414
31352
|
t?.ownerName,
|
|
31415
31353
|
t?.websiteName
|
|
31416
|
-
]),
|
|
31417
|
-
let e =
|
|
31418
|
-
return e === -1 ? !1 :
|
|
31419
|
-
}, [
|
|
31354
|
+
]), Ze = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, Qe = r.some((e) => e.sender === "user"), $e = f(() => {
|
|
31355
|
+
let e = r.findIndex((e) => e.sender === "user");
|
|
31356
|
+
return e === -1 ? !1 : r.slice(e + 1).some((e) => e.sender === "bot" || e.sender === "ai" || e.sender === "agent");
|
|
31357
|
+
}, [r]), et = !h && Qe && $e, tt = !!(De._dashboardLivePreview || Ee._dashboardLivePreview), [O, nt] = m(() => tt ? "text_chat" : "entry_prompt"), [rt, it] = m(""), [at, ot] = m(null), [st, ct] = m(h || ""), [lt, k] = m(""), [ut, dt] = m(0), [ft, pt] = m(null), [mt, ht] = m(null), [gt, _t] = m(""), [vt, yt] = m(!1), [bt, xt] = m(!1), [St, Ct] = m(!1), wt = p(null), Tt = p(!1);
|
|
31420
31358
|
d(() => {
|
|
31421
|
-
if (!(e !== "ready" ||
|
|
31422
|
-
if (
|
|
31423
|
-
|
|
31359
|
+
if (!(e !== "ready" || Tt.current)) {
|
|
31360
|
+
if (Tt.current = !0, je && Ne()) {
|
|
31361
|
+
se?.({ notifyChatInitiated: !0 }), le?.(!0), nt("voice_mode");
|
|
31424
31362
|
return;
|
|
31425
31363
|
}
|
|
31426
|
-
if (fe(
|
|
31427
|
-
|
|
31364
|
+
if (fe(Je) || !je) {
|
|
31365
|
+
nt("minimized_orb");
|
|
31428
31366
|
return;
|
|
31429
31367
|
}
|
|
31430
31368
|
try {
|
|
31431
31369
|
let { shouldResumeVoice: e } = mr();
|
|
31432
|
-
e &&
|
|
31370
|
+
e && nt("connection_modal");
|
|
31433
31371
|
} catch {}
|
|
31434
31372
|
}
|
|
31435
|
-
}, [e,
|
|
31436
|
-
let [
|
|
31373
|
+
}, [e, r]);
|
|
31374
|
+
let [Et, Dt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
|
|
31437
31375
|
c(() => {
|
|
31438
|
-
let e = window.matchMedia("(max-width: 640px)"), t = (e) =>
|
|
31376
|
+
let e = window.matchMedia("(max-width: 640px)"), t = (e) => Dt(e.matches);
|
|
31439
31377
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
31440
31378
|
}, []), c(() => {
|
|
31441
|
-
|
|
31442
|
-
}, [
|
|
31443
|
-
let
|
|
31444
|
-
|
|
31445
|
-
}, []),
|
|
31379
|
+
ct(h || ""), h && k("");
|
|
31380
|
+
}, [h]);
|
|
31381
|
+
let Ot = o(() => {
|
|
31382
|
+
ht(null), _t("");
|
|
31383
|
+
}, []), kt = o((e) => {
|
|
31446
31384
|
let t = HD(e);
|
|
31447
31385
|
if (t) {
|
|
31448
|
-
|
|
31386
|
+
ht(null), _t(t);
|
|
31449
31387
|
return;
|
|
31450
31388
|
}
|
|
31451
|
-
|
|
31389
|
+
ht(e), _t("");
|
|
31452
31390
|
}, []);
|
|
31453
31391
|
c(() => {
|
|
31454
|
-
if (!
|
|
31455
|
-
|
|
31392
|
+
if (!te || ee !== "connected") {
|
|
31393
|
+
dt(0);
|
|
31456
31394
|
return;
|
|
31457
31395
|
}
|
|
31458
31396
|
let e = () => {
|
|
31459
|
-
let e = new Date(
|
|
31460
|
-
isNaN(e) ||
|
|
31397
|
+
let e = new Date(te).getTime();
|
|
31398
|
+
isNaN(e) || dt(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
|
|
31461
31399
|
};
|
|
31462
31400
|
e();
|
|
31463
31401
|
let t = window.setInterval(e, 1e3);
|
|
31464
31402
|
return () => window.clearInterval(t);
|
|
31465
|
-
}, [
|
|
31466
|
-
let
|
|
31467
|
-
|
|
31468
|
-
}, []),
|
|
31469
|
-
|
|
31403
|
+
}, [te, ee]);
|
|
31404
|
+
let At = o(() => {
|
|
31405
|
+
nt("call_screen"), xt(!1);
|
|
31406
|
+
}, []), jt = o(() => {
|
|
31407
|
+
nt("text_chat"), xt(!0);
|
|
31470
31408
|
}, []);
|
|
31471
31409
|
c(() => {
|
|
31472
|
-
let e =
|
|
31410
|
+
let e = w?.callId || T || null;
|
|
31473
31411
|
if (!e) {
|
|
31474
|
-
|
|
31412
|
+
wt.current = null;
|
|
31475
31413
|
return;
|
|
31476
31414
|
}
|
|
31477
|
-
if (
|
|
31478
|
-
if (
|
|
31479
|
-
|
|
31415
|
+
if (w?.callId || ee === "connecting" || ee === "connected") {
|
|
31416
|
+
if (O === "minimized_orb" && bt && T && !w?.callId) {
|
|
31417
|
+
wt.current = e;
|
|
31480
31418
|
return;
|
|
31481
31419
|
}
|
|
31482
|
-
!(!
|
|
31420
|
+
!(!i || O === "minimized_orb" || O === "voice_mode") && wt.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
|
|
31483
31421
|
forcedKey: e,
|
|
31484
|
-
isOpen:
|
|
31485
|
-
surface:
|
|
31486
|
-
hasIncomingCall: !!
|
|
31487
|
-
activeCallId:
|
|
31488
|
-
callConnectionState:
|
|
31489
|
-
}),
|
|
31422
|
+
isOpen: i,
|
|
31423
|
+
surface: O,
|
|
31424
|
+
hasIncomingCall: !!w?.callId,
|
|
31425
|
+
activeCallId: T,
|
|
31426
|
+
callConnectionState: ee
|
|
31427
|
+
}), wt.current = e, O === "voice_mode" && le?.(!1), se?.(), At());
|
|
31490
31428
|
}
|
|
31491
31429
|
}, [
|
|
31492
|
-
w,
|
|
31493
31430
|
T,
|
|
31494
|
-
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
31499
|
-
|
|
31431
|
+
ee,
|
|
31432
|
+
At,
|
|
31433
|
+
w?.callId,
|
|
31434
|
+
i,
|
|
31435
|
+
se,
|
|
31436
|
+
le,
|
|
31437
|
+
O
|
|
31500
31438
|
]), c(() => {
|
|
31501
|
-
!
|
|
31439
|
+
!w && !T && O === "call_screen" && nt("text_chat");
|
|
31502
31440
|
}, [
|
|
31503
|
-
te,
|
|
31504
31441
|
w,
|
|
31505
|
-
|
|
31442
|
+
T,
|
|
31443
|
+
O
|
|
31506
31444
|
]), c(() => {
|
|
31507
|
-
!
|
|
31508
|
-
}, [
|
|
31509
|
-
if (!
|
|
31510
|
-
|
|
31445
|
+
!T && bt && xt(!1);
|
|
31446
|
+
}, [T, bt]), c(() => {
|
|
31447
|
+
if (!s || C) {
|
|
31448
|
+
xe?.(""), be?.();
|
|
31511
31449
|
return;
|
|
31512
31450
|
}
|
|
31513
|
-
if (!
|
|
31514
|
-
|
|
31515
|
-
let e = window.setTimeout(() =>
|
|
31451
|
+
if (!rt.trim() || mt) {
|
|
31452
|
+
xe?.("");
|
|
31453
|
+
let e = window.setTimeout(() => be?.(), 100);
|
|
31516
31454
|
return () => window.clearTimeout(e);
|
|
31517
31455
|
}
|
|
31518
|
-
|
|
31519
|
-
let e = window.setTimeout(() =>
|
|
31456
|
+
ye?.();
|
|
31457
|
+
let e = window.setTimeout(() => xe?.(rt), 120), t = window.setTimeout(() => be?.(), 1200);
|
|
31520
31458
|
return () => {
|
|
31521
31459
|
window.clearTimeout(e), window.clearTimeout(t);
|
|
31522
31460
|
};
|
|
31523
31461
|
}, [
|
|
31524
|
-
|
|
31525
|
-
|
|
31526
|
-
|
|
31462
|
+
rt,
|
|
31463
|
+
mt,
|
|
31464
|
+
s,
|
|
31527
31465
|
C,
|
|
31466
|
+
ye,
|
|
31528
31467
|
be,
|
|
31529
|
-
xe
|
|
31530
|
-
Se
|
|
31468
|
+
xe
|
|
31531
31469
|
]);
|
|
31532
|
-
let
|
|
31470
|
+
let Mt = (e) => e ? {
|
|
31533
31471
|
replyTo: e.messageId || e.id || null,
|
|
31534
31472
|
replyToContent: (e.replyToContent || e.message || "").replace(/<[^>]+>/g, "").trim().slice(0, 200),
|
|
31535
31473
|
replyToSender: e.sender || null
|
|
31536
|
-
} : null,
|
|
31474
|
+
} : null, Nt = async (e) => {
|
|
31537
31475
|
if (e.preventDefault(), C) return;
|
|
31538
|
-
if (
|
|
31539
|
-
let e =
|
|
31476
|
+
if (et) {
|
|
31477
|
+
let e = st.trim().toLowerCase();
|
|
31540
31478
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
31541
|
-
|
|
31479
|
+
k("Please enter a valid email so we can continue helping you.");
|
|
31542
31480
|
return;
|
|
31543
31481
|
}
|
|
31544
|
-
await
|
|
31482
|
+
await ce(e), k("");
|
|
31545
31483
|
return;
|
|
31546
31484
|
}
|
|
31547
|
-
let t =
|
|
31548
|
-
if (!
|
|
31549
|
-
if (
|
|
31485
|
+
let t = Mt(at);
|
|
31486
|
+
if (!rt.trim() && !mt) return;
|
|
31487
|
+
if (mt) {
|
|
31550
31488
|
try {
|
|
31551
|
-
|
|
31552
|
-
let e = await
|
|
31553
|
-
|
|
31489
|
+
yt(!0), _t("");
|
|
31490
|
+
let e = await D(mt), n = e?.data || e, r = rt.trim() || `Shared file: ${WD(mt)}`;
|
|
31491
|
+
it(""), ot(null), Ot(), await oe(r, "", t, {
|
|
31554
31492
|
type: "file",
|
|
31555
31493
|
metadata: {
|
|
31556
31494
|
fileUrl: n?.fileUrl,
|
|
31557
|
-
fileName: n?.fileName ||
|
|
31558
|
-
fileType: n?.fileType ||
|
|
31559
|
-
fileSize: n?.fileSize ||
|
|
31495
|
+
fileName: n?.fileName || mt.name,
|
|
31496
|
+
fileType: n?.fileType || mt.type,
|
|
31497
|
+
fileSize: n?.fileSize || mt.size
|
|
31560
31498
|
}
|
|
31561
31499
|
});
|
|
31562
31500
|
} catch (e) {
|
|
31563
|
-
|
|
31501
|
+
_t(e?.message || "Failed to upload the selected file.");
|
|
31564
31502
|
} finally {
|
|
31565
|
-
|
|
31503
|
+
yt(!1);
|
|
31566
31504
|
}
|
|
31567
31505
|
return;
|
|
31568
31506
|
}
|
|
31569
|
-
let n =
|
|
31570
|
-
|
|
31571
|
-
},
|
|
31507
|
+
let n = rt.trim();
|
|
31508
|
+
it(""), ot(null), await oe(n, "", t);
|
|
31509
|
+
}, Pt = (e) => {
|
|
31572
31510
|
let t = Math.floor(e / 60);
|
|
31573
31511
|
return `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
|
|
31574
|
-
},
|
|
31575
|
-
if (C ||
|
|
31512
|
+
}, Ft = o(async (e) => {
|
|
31513
|
+
if (C || b) return;
|
|
31576
31514
|
let t = e.message || e.label || e.text || "";
|
|
31577
|
-
t.trim() && await
|
|
31515
|
+
t.trim() && await oe(t.trim(), "");
|
|
31578
31516
|
}, [
|
|
31579
31517
|
C,
|
|
31580
|
-
|
|
31581
|
-
|
|
31582
|
-
]),
|
|
31518
|
+
b,
|
|
31519
|
+
oe
|
|
31520
|
+
]), It = Et && O === "entry_prompt" ? { inset: 0 } : Et && O === "text_chat" ? {
|
|
31583
31521
|
left: 0,
|
|
31584
31522
|
right: 0,
|
|
31585
31523
|
bottom: 0
|
|
31586
|
-
} :
|
|
31524
|
+
} : Et && O === "call_screen" ? {
|
|
31587
31525
|
left: 0,
|
|
31588
31526
|
right: 0,
|
|
31589
31527
|
bottom: 0,
|
|
31590
31528
|
height: "90dvh",
|
|
31591
31529
|
overflow: "hidden",
|
|
31592
31530
|
borderRadius: "16px 16px 0 0"
|
|
31593
|
-
} :
|
|
31531
|
+
} : Et && O === "connection_modal" ? {
|
|
31594
31532
|
left: "28px",
|
|
31595
31533
|
right: "12px",
|
|
31596
31534
|
bottom: "12px"
|
|
31597
|
-
} :
|
|
31535
|
+
} : O === "call_screen" ? {
|
|
31598
31536
|
width: "min(350px, calc(100vw - 40px))",
|
|
31599
31537
|
height: "min(640px, calc(100vh - 120px))",
|
|
31600
31538
|
borderRadius: "22px",
|
|
31601
31539
|
overflow: "hidden",
|
|
31602
|
-
...
|
|
31540
|
+
...Fe === "bottom-left" ? {
|
|
31603
31541
|
left: "1.5rem",
|
|
31604
31542
|
bottom: "1.5rem"
|
|
31605
31543
|
} : {
|
|
31606
31544
|
right: "1.5rem",
|
|
31607
31545
|
bottom: "1.5rem"
|
|
31608
31546
|
}
|
|
31609
|
-
} :
|
|
31547
|
+
} : Fe === "bottom-left" ? {
|
|
31610
31548
|
left: "1.5rem",
|
|
31611
31549
|
bottom: "1.5rem"
|
|
31612
31550
|
} : {
|
|
31613
31551
|
right: "1.5rem",
|
|
31614
31552
|
bottom: "1.5rem"
|
|
31615
|
-
},
|
|
31616
|
-
|
|
31617
|
-
|
|
31553
|
+
}, Lt = o(() => {
|
|
31554
|
+
O !== "minimized_orb" && (Ct(!0), setTimeout(() => {
|
|
31555
|
+
nt("minimized_orb"), Ct(!1);
|
|
31618
31556
|
}, 280));
|
|
31619
|
-
}, [
|
|
31620
|
-
|
|
31557
|
+
}, [O]), Rt = () => nt("connection_modal"), zt = () => {
|
|
31558
|
+
se({ notifyChatInitiated: !0 }), le?.(!0), nt("voice_mode");
|
|
31559
|
+
}, Bt = () => {
|
|
31560
|
+
se({ notifyChatInitiated: !0 }), le?.(!1), nt("text_chat");
|
|
31621
31561
|
}, Vt = () => {
|
|
31622
|
-
|
|
31623
|
-
}, Ht = () => {
|
|
31624
|
-
ue?.(!1), Rt();
|
|
31562
|
+
le?.(!1), Lt();
|
|
31625
31563
|
};
|
|
31626
|
-
return e !== "ready" || !
|
|
31564
|
+
return e !== "ready" || !We || Ae.chat === !1 ? null : /* @__PURE__ */ _("div", {
|
|
31627
31565
|
className: "flowengage-widget-root",
|
|
31628
31566
|
style: {
|
|
31629
31567
|
position: "fixed",
|
|
31630
31568
|
zIndex: 999999,
|
|
31631
|
-
...
|
|
31569
|
+
...It
|
|
31632
31570
|
},
|
|
31633
31571
|
onWheel: (e) => e.stopPropagation(),
|
|
31634
31572
|
onTouchMove: (e) => e.stopPropagation(),
|
|
31635
31573
|
children: [
|
|
31636
|
-
|
|
31637
|
-
copy:
|
|
31638
|
-
orbColors:
|
|
31639
|
-
primaryColor:
|
|
31574
|
+
O === "entry_prompt" && /* @__PURE__ */ g(Pk, {
|
|
31575
|
+
copy: Ke,
|
|
31576
|
+
orbColors: Me,
|
|
31577
|
+
primaryColor: Pe,
|
|
31640
31578
|
onYes: () => {
|
|
31641
|
-
pe(
|
|
31579
|
+
pe(Je), zt();
|
|
31642
31580
|
},
|
|
31643
31581
|
onLater: () => {
|
|
31644
|
-
pe(
|
|
31582
|
+
pe(Je), Lt();
|
|
31645
31583
|
},
|
|
31646
|
-
isMobile:
|
|
31647
|
-
isClosing:
|
|
31584
|
+
isMobile: Et,
|
|
31585
|
+
isClosing: St
|
|
31648
31586
|
}),
|
|
31649
|
-
|
|
31587
|
+
O === "minimized_orb" && /* @__PURE__ */ _(fm.div, {
|
|
31650
31588
|
layoutId: "fe-main-orb",
|
|
31651
31589
|
initial: {
|
|
31652
31590
|
scale: .4,
|
|
@@ -31665,14 +31603,14 @@ function Bk() {
|
|
|
31665
31603
|
transformOrigin: "bottom right",
|
|
31666
31604
|
display: "inline-flex",
|
|
31667
31605
|
flexDirection: "column",
|
|
31668
|
-
alignItems:
|
|
31606
|
+
alignItems: Fe === "bottom-left" ? "flex-start" : "flex-end",
|
|
31669
31607
|
gap: "10px"
|
|
31670
31608
|
},
|
|
31671
|
-
children: [
|
|
31609
|
+
children: [T && bt && /* @__PURE__ */ _("button", {
|
|
31672
31610
|
type: "button",
|
|
31673
|
-
onClick:
|
|
31611
|
+
onClick: At,
|
|
31674
31612
|
style: {
|
|
31675
|
-
maxWidth:
|
|
31613
|
+
maxWidth: Et ? "220px" : "240px",
|
|
31676
31614
|
padding: "10px 14px",
|
|
31677
31615
|
borderRadius: "18px",
|
|
31678
31616
|
border: "1px solid rgba(255,255,255,0.7)",
|
|
@@ -31703,7 +31641,7 @@ function Bk() {
|
|
|
31703
31641
|
color: "#111827",
|
|
31704
31642
|
lineHeight: 1.2
|
|
31705
31643
|
},
|
|
31706
|
-
children:
|
|
31644
|
+
children: ee === "connected" ? "Call in progress" : "Call is active"
|
|
31707
31645
|
}), /* @__PURE__ */ g("span", {
|
|
31708
31646
|
style: {
|
|
31709
31647
|
display: "block",
|
|
@@ -31713,112 +31651,111 @@ function Bk() {
|
|
|
31713
31651
|
marginTop: "2px",
|
|
31714
31652
|
whiteSpace: "nowrap"
|
|
31715
31653
|
},
|
|
31716
|
-
children:
|
|
31654
|
+
children: ee === "connected" ? `${Pt(ut)} with ${Xe}` : `Tap to return to ${Xe}`
|
|
31717
31655
|
})]
|
|
31718
31656
|
})]
|
|
31719
31657
|
}), /* @__PURE__ */ g(Nk, {
|
|
31720
31658
|
size: 50,
|
|
31721
|
-
orbColors:
|
|
31722
|
-
onClick:
|
|
31659
|
+
orbColors: Me,
|
|
31660
|
+
onClick: T && bt ? At : je ? Rt : Bt
|
|
31723
31661
|
})]
|
|
31724
31662
|
}),
|
|
31725
|
-
|
|
31726
|
-
copy:
|
|
31727
|
-
orbColors:
|
|
31728
|
-
primaryColor:
|
|
31729
|
-
onVoice:
|
|
31730
|
-
onText:
|
|
31731
|
-
onClose:
|
|
31732
|
-
isMobile:
|
|
31733
|
-
isClosing:
|
|
31663
|
+
O === "connection_modal" && /* @__PURE__ */ g(Fk, {
|
|
31664
|
+
copy: Ke,
|
|
31665
|
+
orbColors: Me,
|
|
31666
|
+
primaryColor: Pe,
|
|
31667
|
+
onVoice: zt,
|
|
31668
|
+
onText: Bt,
|
|
31669
|
+
onClose: Lt,
|
|
31670
|
+
isMobile: Et,
|
|
31671
|
+
isClosing: St
|
|
31734
31672
|
}),
|
|
31735
|
-
|
|
31736
|
-
orbColors:
|
|
31737
|
-
onEnterChat:
|
|
31738
|
-
onEndChat:
|
|
31739
|
-
agentId:
|
|
31740
|
-
siteId:
|
|
31741
|
-
apiBaseUrl:
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
onMessageSync: oe
|
|
31673
|
+
O === "voice_mode" && /* @__PURE__ */ g(Ik, {
|
|
31674
|
+
orbColors: Me,
|
|
31675
|
+
onEnterChat: Bt,
|
|
31676
|
+
onEndChat: Vt,
|
|
31677
|
+
agentId: qe,
|
|
31678
|
+
siteId: Je,
|
|
31679
|
+
apiBaseUrl: Ye,
|
|
31680
|
+
historyRef: ie,
|
|
31681
|
+
onMessageSync: ae
|
|
31745
31682
|
}, "voice"),
|
|
31746
|
-
|
|
31747
|
-
incomingCall:
|
|
31748
|
-
activeCallId:
|
|
31749
|
-
callConnectionState:
|
|
31750
|
-
callDurationSeconds:
|
|
31751
|
-
isCallMuted:
|
|
31752
|
-
agentName:
|
|
31753
|
-
agentHeadshot:
|
|
31754
|
-
fallbackAgentName:
|
|
31755
|
-
acceptCall:
|
|
31756
|
-
rejectCall:
|
|
31757
|
-
endWebRTCCall:
|
|
31758
|
-
toggleCallMute:
|
|
31759
|
-
formatCallDuration:
|
|
31760
|
-
onMinimize:
|
|
31761
|
-
primaryColor:
|
|
31762
|
-
orbColors:
|
|
31763
|
-
chatHistory:
|
|
31683
|
+
O === "call_screen" && /* @__PURE__ */ g(dO, {
|
|
31684
|
+
incomingCall: w,
|
|
31685
|
+
activeCallId: T,
|
|
31686
|
+
callConnectionState: ee,
|
|
31687
|
+
callDurationSeconds: ut,
|
|
31688
|
+
isCallMuted: ne,
|
|
31689
|
+
agentName: Xe,
|
|
31690
|
+
agentHeadshot: Ze,
|
|
31691
|
+
fallbackAgentName: Ie,
|
|
31692
|
+
acceptCall: me,
|
|
31693
|
+
rejectCall: he,
|
|
31694
|
+
endWebRTCCall: ge,
|
|
31695
|
+
toggleCallMute: _e,
|
|
31696
|
+
formatCallDuration: Pt,
|
|
31697
|
+
onMinimize: jt,
|
|
31698
|
+
primaryColor: Pe,
|
|
31699
|
+
orbColors: Me,
|
|
31700
|
+
chatHistory: r
|
|
31764
31701
|
}),
|
|
31765
|
-
|
|
31766
|
-
isClosing:
|
|
31767
|
-
copy:
|
|
31768
|
-
orbColors:
|
|
31769
|
-
primaryColor:
|
|
31770
|
-
chatBgGradient:
|
|
31771
|
-
logo:
|
|
31772
|
-
quickChatOptions:
|
|
31773
|
-
onQuickChatSelect:
|
|
31774
|
-
isMobile:
|
|
31775
|
-
chatHistory:
|
|
31776
|
-
isAiTyping:
|
|
31777
|
-
isAgentTyping:
|
|
31778
|
-
activeScreen:
|
|
31779
|
-
agentName:
|
|
31780
|
-
agentHeadshot:
|
|
31781
|
-
fallbackAgentName:
|
|
31782
|
-
input:
|
|
31783
|
-
setInput:
|
|
31784
|
-
onSubmit:
|
|
31702
|
+
O === "text_chat" && /* @__PURE__ */ g(zk, {
|
|
31703
|
+
isClosing: St,
|
|
31704
|
+
copy: Ke,
|
|
31705
|
+
orbColors: Me,
|
|
31706
|
+
primaryColor: Pe,
|
|
31707
|
+
chatBgGradient: Le,
|
|
31708
|
+
logo: Re,
|
|
31709
|
+
quickChatOptions: He,
|
|
31710
|
+
onQuickChatSelect: Ft,
|
|
31711
|
+
isMobile: Et,
|
|
31712
|
+
chatHistory: r,
|
|
31713
|
+
isAiTyping: y,
|
|
31714
|
+
isAgentTyping: v,
|
|
31715
|
+
activeScreen: a,
|
|
31716
|
+
agentName: Xe,
|
|
31717
|
+
agentHeadshot: Ze,
|
|
31718
|
+
fallbackAgentName: Ie,
|
|
31719
|
+
input: rt,
|
|
31720
|
+
setInput: it,
|
|
31721
|
+
onSubmit: Nt,
|
|
31785
31722
|
isConversationEnded: C,
|
|
31786
|
-
isLoading:
|
|
31787
|
-
isRateLimited:
|
|
31788
|
-
rateLimitMessage:
|
|
31789
|
-
selectedFile:
|
|
31790
|
-
onFileSelect:
|
|
31791
|
-
onRemoveSelectedFile:
|
|
31792
|
-
attachmentError:
|
|
31793
|
-
isUploadingAttachment:
|
|
31794
|
-
requiresEmail:
|
|
31795
|
-
emailInput:
|
|
31796
|
-
setEmailInput:
|
|
31797
|
-
emailError:
|
|
31798
|
-
replyContext:
|
|
31799
|
-
setReplyContext:
|
|
31800
|
-
webRTCError:
|
|
31801
|
-
micError:
|
|
31802
|
-
setMicError:
|
|
31803
|
-
dismissCallError:
|
|
31804
|
-
activeCallId:
|
|
31805
|
-
isCallMuted:
|
|
31806
|
-
toggleCallMute:
|
|
31807
|
-
endWebRTCCall:
|
|
31808
|
-
formatCallDuration:
|
|
31809
|
-
callDurationSeconds:
|
|
31810
|
-
onCollapse:
|
|
31811
|
-
onStartVoice:
|
|
31812
|
-
onNewChat:
|
|
31813
|
-
onEndConversation:
|
|
31814
|
-
onMinimize:
|
|
31815
|
-
onExpand:
|
|
31816
|
-
isCallMinimized:
|
|
31817
|
-
showPoweredBy:
|
|
31818
|
-
getVisitorChatHistory:
|
|
31819
|
-
getVisitorChatThread:
|
|
31820
|
-
resumeChat:
|
|
31821
|
-
isSessionRestoring:
|
|
31723
|
+
isLoading: b,
|
|
31724
|
+
isRateLimited: x,
|
|
31725
|
+
rateLimitMessage: S,
|
|
31726
|
+
selectedFile: mt,
|
|
31727
|
+
onFileSelect: kt,
|
|
31728
|
+
onRemoveSelectedFile: Ot,
|
|
31729
|
+
attachmentError: gt,
|
|
31730
|
+
isUploadingAttachment: vt,
|
|
31731
|
+
requiresEmail: et,
|
|
31732
|
+
emailInput: st,
|
|
31733
|
+
setEmailInput: ct,
|
|
31734
|
+
emailError: lt,
|
|
31735
|
+
replyContext: at,
|
|
31736
|
+
setReplyContext: ot,
|
|
31737
|
+
webRTCError: re,
|
|
31738
|
+
micError: ft,
|
|
31739
|
+
setMicError: pt,
|
|
31740
|
+
dismissCallError: ve,
|
|
31741
|
+
activeCallId: T,
|
|
31742
|
+
isCallMuted: ne,
|
|
31743
|
+
toggleCallMute: _e,
|
|
31744
|
+
endWebRTCCall: ge,
|
|
31745
|
+
formatCallDuration: Pt,
|
|
31746
|
+
callDurationSeconds: ut,
|
|
31747
|
+
onCollapse: Lt,
|
|
31748
|
+
onStartVoice: zt,
|
|
31749
|
+
onNewChat: de,
|
|
31750
|
+
onEndConversation: ue,
|
|
31751
|
+
onMinimize: jt,
|
|
31752
|
+
onExpand: At,
|
|
31753
|
+
isCallMinimized: bt && !!T,
|
|
31754
|
+
showPoweredBy: Ue,
|
|
31755
|
+
getVisitorChatHistory: Se,
|
|
31756
|
+
getVisitorChatThread: Ce,
|
|
31757
|
+
resumeChat: we,
|
|
31758
|
+
isSessionRestoring: Te
|
|
31822
31759
|
}),
|
|
31823
31760
|
/* @__PURE__ */ g("style", { children: "\n /* Force any SVG (or img) inside LogoSlot to fill the container height\n regardless of whether the component forwards its style prop. */\n .fe-logo-slot svg,\n .fe-logo-slot img { height: 100%; width: auto; display: block; }\n\n @keyframes fe-orb-breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }\n @keyframes fe-orb-breathe-subtle { 0%,100%{transform:scale(1)} 50%{transform:scale(1.025)} }\n @keyframes fe-orb-pulse { 0%{transform:scale(1);opacity:.65} 50%{transform:scale(1.28);opacity:.1} 100%{transform:scale(1);opacity:.65} }\n @keyframes fe-orb-glow { from{opacity:.35} to{opacity:.75} }\n @keyframes fe-orb-fade-in { from{opacity:0} to{opacity:1} }\n @keyframes fe-orb-slide-up { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }\n @keyframes fe-orb-slide-down { from{opacity:1;transform:translateY(0)} to{opacity:0;transform:translateY(24px)} }\n @keyframes fe-orb-bar-0 { from{height:6px} to{height:18px} }\n @keyframes fe-orb-bar-1 { from{height:10px} to{height:22px} }\n @keyframes fe-orb-bar-2 { from{height:14px} to{height:26px} }\n @keyframes fe-orb-bar-3 { from{height:8px} to{height:20px} }\n @keyframes fe-orb-bar-4 { from{height:6px} to{height:16px} }\n @keyframes fe-dot-bounce { 0%,80%,100%{transform:translateY(0);opacity:.5} 40%{transform:translateY(-5px);opacity:1} }\n " })
|
|
31824
31761
|
]
|