@flowengage/react-chatbot 5.0.29 → 5.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flowengage-embed.js +10 -10
- package/dist/flowengage-react-chatbot.cjs +10 -10
- package/dist/flowengage-react-chatbot.mjs +259 -252
- package/package.json +1 -1
|
@@ -3245,13 +3245,6 @@ function Nr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3245
3245
|
c(() => {
|
|
3246
3246
|
let e = k.current;
|
|
3247
3247
|
!e || !y || zt.current !== C && (C && zt.current !== null ? (e.updateChatStatus(y, "open").catch(() => {}), Bt.current = !0) : zt.current === !0 && e.updateChatStatus(y, "widget_closed").catch(() => {}), zt.current = C);
|
|
3248
|
-
}, [C, y]), c(() => {
|
|
3249
|
-
if (!C || !y || !Bt.current) return;
|
|
3250
|
-
let e = setInterval(() => {
|
|
3251
|
-
let e = k.current;
|
|
3252
|
-
e && y && e.updateChatStatus(y, "open").catch(() => {});
|
|
3253
|
-
}, 1e4);
|
|
3254
|
-
return () => clearInterval(e);
|
|
3255
3248
|
}, [C, y]), c(() => {
|
|
3256
3249
|
let e = () => {
|
|
3257
3250
|
let e = ot.current, t = k.current;
|
|
@@ -26603,7 +26596,20 @@ function HD({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
|
26603
26596
|
}
|
|
26604
26597
|
//#endregion
|
|
26605
26598
|
//#region src/components/MessageList.jsx
|
|
26606
|
-
function UD(
|
|
26599
|
+
function UD(e) {
|
|
26600
|
+
let t = e.target.closest("a[href]");
|
|
26601
|
+
if (!t) return;
|
|
26602
|
+
let n = t.getAttribute("href") || "";
|
|
26603
|
+
if (!(!n || n.startsWith("mailto:") || n.startsWith("tel:") || n.startsWith("javascript:"))) try {
|
|
26604
|
+
let t = new URL(n, window.location.href);
|
|
26605
|
+
if (t.origin !== window.location.origin) {
|
|
26606
|
+
e.preventDefault(), window.open(t.href, "_blank", "noopener,noreferrer");
|
|
26607
|
+
return;
|
|
26608
|
+
}
|
|
26609
|
+
e.preventDefault(), xr(t.href);
|
|
26610
|
+
} catch {}
|
|
26611
|
+
}
|
|
26612
|
+
function WD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: o = null, agentDisplayName: s = "Agent", botAvatarNode: l = null }) {
|
|
26607
26613
|
let u = p(null), [d, f] = m(null), [v, y] = m(null), b = p(e.length), x = p(!0), S = p(null), C = (e) => {
|
|
26608
26614
|
if (!e) return "just now";
|
|
26609
26615
|
let t = /* @__PURE__ */ new Date(), n = new Date(e), r = Math.max(0, Math.floor((t - n) / 1e3));
|
|
@@ -26944,7 +26950,8 @@ function UD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26944
26950
|
});
|
|
26945
26951
|
})() : r ? /* @__PURE__ */ g("div", {
|
|
26946
26952
|
className: "flowengage-message-content fe-bot-message",
|
|
26947
|
-
dangerouslySetInnerHTML: { __html: ND(e.message) }
|
|
26953
|
+
dangerouslySetInnerHTML: { __html: ND(e.message) },
|
|
26954
|
+
onClick: UD
|
|
26948
26955
|
}) : /* @__PURE__ */ g("div", {
|
|
26949
26956
|
style: { whiteSpace: n || c ? "normal" : "pre-wrap" },
|
|
26950
26957
|
children: e.message
|
|
@@ -27144,7 +27151,7 @@ function UD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27144
27151
|
}
|
|
27145
27152
|
//#endregion
|
|
27146
27153
|
//#region src/components/ChatInput.jsx
|
|
27147
|
-
function
|
|
27154
|
+
function GD({ 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" }) {
|
|
27148
27155
|
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;
|
|
27149
27156
|
return /* @__PURE__ */ _("div", {
|
|
27150
27157
|
style: {
|
|
@@ -27484,7 +27491,7 @@ function WD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27484
27491
|
}
|
|
27485
27492
|
//#endregion
|
|
27486
27493
|
//#region src/components/StatusBanners.jsx
|
|
27487
|
-
function
|
|
27494
|
+
function KD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
|
|
27488
27495
|
return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
|
|
27489
27496
|
style: {
|
|
27490
27497
|
margin: "0 20px 10px",
|
|
@@ -27543,13 +27550,13 @@ function GD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
27543
27550
|
}
|
|
27544
27551
|
//#endregion
|
|
27545
27552
|
//#region src/components/AnimatedOrb.jsx
|
|
27546
|
-
var
|
|
27553
|
+
var qD = [
|
|
27547
27554
|
"#135bd8",
|
|
27548
27555
|
"#ef334b",
|
|
27549
27556
|
"#ffbd2e"
|
|
27550
27557
|
];
|
|
27551
|
-
function
|
|
27552
|
-
return !Array.isArray(e) || e.length === 0 ?
|
|
27558
|
+
function JD(e) {
|
|
27559
|
+
return !Array.isArray(e) || e.length === 0 ? qD : e.length === 1 ? [
|
|
27553
27560
|
e[0],
|
|
27554
27561
|
e[0],
|
|
27555
27562
|
e[0]
|
|
@@ -27563,14 +27570,14 @@ function qD(e) {
|
|
|
27563
27570
|
e[2]
|
|
27564
27571
|
];
|
|
27565
27572
|
}
|
|
27566
|
-
var
|
|
27573
|
+
var YD = {
|
|
27567
27574
|
idle: 3,
|
|
27568
27575
|
listening: .75,
|
|
27569
27576
|
speaking: 1.4,
|
|
27570
27577
|
muted: .75,
|
|
27571
27578
|
error: .08
|
|
27572
27579
|
};
|
|
27573
|
-
function
|
|
27580
|
+
function XD(e) {
|
|
27574
27581
|
if (!e || typeof e != "string") return [
|
|
27575
27582
|
0,
|
|
27576
27583
|
0,
|
|
@@ -27583,14 +27590,14 @@ function YD(e) {
|
|
|
27583
27590
|
parseInt(n.slice(4, 6), 16) / 255
|
|
27584
27591
|
];
|
|
27585
27592
|
}
|
|
27586
|
-
function
|
|
27593
|
+
function ZD(e, t) {
|
|
27587
27594
|
if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
|
|
27588
27595
|
if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
|
|
27589
27596
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
27590
27597
|
return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
|
|
27591
27598
|
}
|
|
27592
|
-
var
|
|
27593
|
-
function
|
|
27599
|
+
var QD = "\n attribute vec2 a_pos;\n varying vec2 v_uv;\n void main() {\n v_uv = a_pos * 0.5 + 0.5;\n gl_Position = vec4(a_pos, 0.0, 1.0);\n }\n", $D = "\n precision highp float;\n\n varying vec2 v_uv;\n uniform float u_time;\n uniform float u_speed;\n uniform vec3 u_c1;\n uniform vec3 u_c2;\n uniform vec3 u_c3;\n\n // ── Gradient noise ─────────────────────────────────────────────────────────\n vec2 hash2(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n }\n float gnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*f*(f*(f*6.0-15.0)+10.0);\n return mix(\n mix(dot(hash2(i), f),\n dot(hash2(i+vec2(1,0)), f-vec2(1,0)), u.x),\n mix(dot(hash2(i+vec2(0,1)), f-vec2(0,1)),\n dot(hash2(i+vec2(1,1)), f-vec2(1,1)), u.x),\n u.y\n ) * 0.5 + 0.5;\n }\n\n // ── 3-octave FBM normalised to [0,1] — fewer octaves → larger, softer blobs\n float fbm(vec2 p) {\n float v = 0.0, a = 0.5;\n for (int i = 0; i < 3; i++) {\n v += a * gnoise(p);\n p = p * 2.1 + vec2(100.0);\n a *= 0.5;\n }\n return v / 0.875;\n }\n\n // ── Scalar hash for grain ──────────────────────────────────────────────────\n float hash1(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n }\n\n void main() {\n vec2 uv = v_uv;\n float t = u_time * u_speed + 47.3;\n\n // ── ① Two-level domain warp — deep organic folding and swirling ───────────\n // First pass: large-scale sweep\n vec2 q = vec2(\n fbm(uv * 1.8 + vec2( t * 0.13, t * 0.11)) * 2.0 - 1.0,\n fbm(uv * 1.8 + vec2( t * 0.11 + 3.7, -t * 0.14 + 1.1)) * 2.0 - 1.0\n );\n // Second pass: warp the warp — creates curling, folding sub-currents\n vec2 r = vec2(\n fbm(uv * 1.8 + q * 0.55 + vec2( t * 0.09, t * 0.07)) * 2.0 - 1.0,\n fbm(uv * 1.8 + q * 0.55 + vec2(-t * 0.07 + 5.1, t * 0.10 + 2.3)) * 2.0 - 1.0\n );\n vec2 wp = uv + r * 0.38;\n\n // ── ② Three independent fields — each drifts inward from its source edge ──\n // Asymmetric velocities: dominant axis matches the inflow direction so the\n // noise texture visually streams inward (left→right, right→left, bottom→top).\n float f1 = fbm(wp * 0.85 + vec2(-t * 0.18, t * 0.04)); // LEFT → right\n float f2 = fbm(wp * 0.85 + vec2( t * 0.18 + 5.3, t * 0.04 + 1.7)); // RIGHT → left\n float f3 = fbm(wp * 0.85 + vec2( t * 0.04 - 3.2, -t * 0.18 + 6.4)); // BOTTOM → up\n\n // ── ③ Breathing blobs — sin pulse makes each field expand and contract ────\n float p1 = 0.88 + 0.12 * sin(t * 0.61);\n float p2 = 0.88 + 0.12 * sin(t * 0.47 + 2.09);\n float p3 = 0.88 + 0.12 * sin(t * 0.53 + 4.19);\n\n // Wide smoothstep (0.26 → 0.70) → soft, diffused blob edges that dissolve\n // gradually into each other, like dye spreading through water.\n float b1 = smoothstep(0.26, 0.70, f1 * p1);\n float b2 = smoothstep(0.26, 0.70, f2 * p2);\n float b3 = smoothstep(0.26, 0.70, f3 * p3);\n\n // ── ④ Directional origin gradients.\n // Each color owns its home edge (value = 1.0) and smoothly fades to zero\n // before reaching the opposite side. The transition windows are offset so\n // they overlap only in the center third — that overlap zone is where the\n // three colors meet and blend, while the edges stay uncontaminated.\n float d1 = 1.0 - smoothstep(0.20, 0.74, uv.x); // c1: LEFT → full at x<0.20, zero by x=0.74\n float d2 = 1.0 - smoothstep(0.20, 0.74, 1.0 - uv.x); // c2: RIGHT → full at x>0.80, zero by x=0.26\n float d3 = 1.0 - smoothstep(0.18, 0.68, uv.y); // c3: BOTTOM → full at y<0.18, zero by y=0.68\n\n float w1 = b1 * d1;\n float w2 = b2 * d2;\n float w3 = b3 * d3;\n\n // ── ⑤ Dye-mixing colour blend ──────────────────────────────────────────────\n // dyeColor is the weighted average of all active colours — exactly how dyes\n // mix in water: overlapping streams blend smoothly, no hard edges.\n float total = w1 + w2 + w3;\n vec3 dyeColor = (u_c1 * w1 + u_c2 * w2 + u_c3 * w3) / max(total, 0.001);\n\n // Boost brightness of the dye to make colors pop and seem less dull\n dyeColor *= 1.65;\n\n // Exponential coverage: cores are rich and opaque; edges dissolve into the\n // near-white base. White only shows through where dye concentration is thin.\n float coverage = 1.0 - exp(-total * 5.0);\n vec3 col = mix(vec3(1.0, 1.0, 1.0), dyeColor, coverage);\n col = clamp(col, 0.0, 1.0);\n\n // ── ⑥ Sphere shading — subtle edge vignette only, no specular ─────────────\n vec2 uvc = v_uv * 2.0 - 1.0;\n\n // ── ⑦ Subtle grain — breaks gradient banding, adds filmic texture ──────────\n float grain = hash1(v_uv * 437.3 + fract(t)) * 2.0 - 1.0;\n col += grain * 0.018;\n\n gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n }\n";
|
|
27600
|
+
function eO(e, t, n) {
|
|
27594
27601
|
let r = (t, n) => {
|
|
27595
27602
|
let r = e.createShader(t);
|
|
27596
27603
|
return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
|
|
@@ -27599,10 +27606,10 @@ function $D(e, t, n) {
|
|
|
27599
27606
|
let o = e.createProgram();
|
|
27600
27607
|
return e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.getProgramParameter(o, e.LINK_STATUS) ? o : (console.error("[AnimatedOrb link]", e.getProgramInfoLog(o)), null);
|
|
27601
27608
|
}
|
|
27602
|
-
function
|
|
27603
|
-
let [s, l, u] =
|
|
27609
|
+
function tO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
|
|
27610
|
+
let [s, l, u] = JD(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(YD[t] ?? .35);
|
|
27604
27611
|
c(() => {
|
|
27605
|
-
h.current =
|
|
27612
|
+
h.current = YD[t] ?? .35;
|
|
27606
27613
|
}, [t]), c(() => {
|
|
27607
27614
|
let t = m.current;
|
|
27608
27615
|
if (!t) return;
|
|
@@ -27619,7 +27626,7 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27619
27626
|
console.warn("[AnimatedOrb] WebGL unavailable.");
|
|
27620
27627
|
return;
|
|
27621
27628
|
}
|
|
27622
|
-
let i =
|
|
27629
|
+
let i = eO(r, QD, $D);
|
|
27623
27630
|
if (!i) {
|
|
27624
27631
|
console.error("[AnimatedOrb] WebGL program failed to compile/link");
|
|
27625
27632
|
return;
|
|
@@ -27649,7 +27656,7 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27649
27656
|
c2: r.getUniformLocation(i, "u_c2"),
|
|
27650
27657
|
c3: r.getUniformLocation(i, "u_c3")
|
|
27651
27658
|
};
|
|
27652
|
-
r.uniform3fv(c.c1,
|
|
27659
|
+
r.uniform3fv(c.c1, XD(s)), r.uniform3fv(c.c2, XD(l)), r.uniform3fv(c.c3, XD(u)), r.viewport(0, 0, t.width, t.height);
|
|
27653
27660
|
let d = performance.now(), f, p = (e) => {
|
|
27654
27661
|
r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
|
|
27655
27662
|
};
|
|
@@ -27680,7 +27687,7 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27680
27687
|
position: "absolute",
|
|
27681
27688
|
inset: -10,
|
|
27682
27689
|
borderRadius: "50%",
|
|
27683
|
-
background: `radial-gradient(circle, ${
|
|
27690
|
+
background: `radial-gradient(circle, ${ZD(s, .18)} 0%, transparent 70%)`,
|
|
27684
27691
|
pointerEvents: "none"
|
|
27685
27692
|
},
|
|
27686
27693
|
animate: { opacity: [.3, .75] },
|
|
@@ -27758,17 +27765,17 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27758
27765
|
}
|
|
27759
27766
|
//#endregion
|
|
27760
27767
|
//#region src/components/CallScreen.jsx
|
|
27761
|
-
var
|
|
27762
|
-
function
|
|
27768
|
+
var nO = "\n @keyframes fe-call-ring-pulse {\n 0% { transform: scale(1); opacity: 0.55; }\n 70% { transform: scale(1.85); opacity: 0; }\n 100% { transform: scale(1.85); opacity: 0; }\n }\n @keyframes fe-call-spin {\n to { transform: rotate(360deg); }\n }\n @keyframes fe-call-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes fe-call-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes fe-call-bar-slide-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n @keyframes fe-call-dot-blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.35; }\n }\n @keyframes fe-call-avatar-breathe {\n 0%, 100% { opacity: 0.5; transform: scale(1); }\n 50% { opacity: 0.9; transform: scale(1.12); }\n }\n";
|
|
27769
|
+
function rO(e) {
|
|
27763
27770
|
let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
27764
27771
|
return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
|
|
27765
27772
|
}
|
|
27766
|
-
function
|
|
27773
|
+
function iO(e) {
|
|
27767
27774
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
27768
27775
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
27769
27776
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
27770
27777
|
}
|
|
27771
|
-
function
|
|
27778
|
+
function aO(e, t) {
|
|
27772
27779
|
let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
|
|
27773
27780
|
return n.length === 1 ? [
|
|
27774
27781
|
`radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
|
|
@@ -27785,8 +27792,8 @@ function iO(e, t) {
|
|
|
27785
27792
|
"#f7f8fa"
|
|
27786
27793
|
].join(", ");
|
|
27787
27794
|
}
|
|
27788
|
-
function
|
|
27789
|
-
let i = (t || "A")[0].toUpperCase(), a =
|
|
27795
|
+
function oO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
|
|
27796
|
+
let i = (t || "A")[0].toUpperCase(), a = iO(r), o = n > 48 ? {
|
|
27790
27797
|
boxShadow: `0 0 0 3px ${r}44`,
|
|
27791
27798
|
border: "3px solid rgba(255,255,255,0.15)"
|
|
27792
27799
|
} : { border: `1.5px solid ${r}55` };
|
|
@@ -27823,7 +27830,7 @@ function aO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
|
|
|
27823
27830
|
children: i
|
|
27824
27831
|
});
|
|
27825
27832
|
}
|
|
27826
|
-
function
|
|
27833
|
+
function sO(e) {
|
|
27827
27834
|
let t = p(null), n = o(() => {
|
|
27828
27835
|
if (!t.current) return;
|
|
27829
27836
|
let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
|
|
@@ -27870,8 +27877,8 @@ function oO(e) {
|
|
|
27870
27877
|
n
|
|
27871
27878
|
]), c(() => () => n(), [n]), n;
|
|
27872
27879
|
}
|
|
27873
|
-
function
|
|
27874
|
-
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x =
|
|
27880
|
+
function cO({ 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 = [] }) {
|
|
27881
|
+
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = sO(!!e), S = async () => {
|
|
27875
27882
|
x(), await c();
|
|
27876
27883
|
}, C = async () => {
|
|
27877
27884
|
x(), await l();
|
|
@@ -27883,14 +27890,14 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27883
27890
|
flexDirection: "column",
|
|
27884
27891
|
borderRadius: "inherit",
|
|
27885
27892
|
overflow: "hidden",
|
|
27886
|
-
background:
|
|
27893
|
+
background: aO(h, m),
|
|
27887
27894
|
animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
|
|
27888
27895
|
};
|
|
27889
27896
|
if (b === "incoming") {
|
|
27890
27897
|
let e = Array.isArray(h) && h.length > 0 ? h : [m];
|
|
27891
27898
|
return /* @__PURE__ */ _("div", {
|
|
27892
27899
|
style: ee,
|
|
27893
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
27900
|
+
children: [/* @__PURE__ */ g("style", { children: nO }), /* @__PURE__ */ _("div", {
|
|
27894
27901
|
style: {
|
|
27895
27902
|
flex: 1,
|
|
27896
27903
|
display: "flex",
|
|
@@ -27921,7 +27928,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27921
27928
|
width: "96px",
|
|
27922
27929
|
height: "96px",
|
|
27923
27930
|
borderRadius: "50%",
|
|
27924
|
-
background: `radial-gradient(circle, rgba(${
|
|
27931
|
+
background: `radial-gradient(circle, rgba(${rO(e[0])},0.2) 0%, transparent 70%)`,
|
|
27925
27932
|
filter: "blur(10px)",
|
|
27926
27933
|
zIndex: 0
|
|
27927
27934
|
} }),
|
|
@@ -27938,7 +27945,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27938
27945
|
animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
|
|
27939
27946
|
zIndex: 1
|
|
27940
27947
|
} }, n)),
|
|
27941
|
-
/* @__PURE__ */ g(
|
|
27948
|
+
/* @__PURE__ */ g(oO, {
|
|
27942
27949
|
headshot: o,
|
|
27943
27950
|
name: y,
|
|
27944
27951
|
size: 82,
|
|
@@ -28076,7 +28083,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28076
28083
|
}
|
|
28077
28084
|
return b === "connecting" ? /* @__PURE__ */ _("div", {
|
|
28078
28085
|
style: ee,
|
|
28079
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
28086
|
+
children: [/* @__PURE__ */ g("style", { children: nO }), /* @__PURE__ */ _("div", {
|
|
28080
28087
|
style: {
|
|
28081
28088
|
flex: 1,
|
|
28082
28089
|
display: "flex",
|
|
@@ -28086,7 +28093,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28086
28093
|
gap: "24px"
|
|
28087
28094
|
},
|
|
28088
28095
|
children: [
|
|
28089
|
-
/* @__PURE__ */ g(
|
|
28096
|
+
/* @__PURE__ */ g(oO, {
|
|
28090
28097
|
headshot: o,
|
|
28091
28098
|
name: y,
|
|
28092
28099
|
size: 64,
|
|
@@ -28113,7 +28120,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28113
28120
|
}) : /* @__PURE__ */ _("div", {
|
|
28114
28121
|
style: ee,
|
|
28115
28122
|
children: [
|
|
28116
|
-
/* @__PURE__ */ g("style", { children:
|
|
28123
|
+
/* @__PURE__ */ g("style", { children: nO }),
|
|
28117
28124
|
/* @__PURE__ */ _("div", {
|
|
28118
28125
|
style: {
|
|
28119
28126
|
display: "flex",
|
|
@@ -28159,7 +28166,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28159
28166
|
children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
|
|
28160
28167
|
})
|
|
28161
28168
|
}),
|
|
28162
|
-
/* @__PURE__ */ g(
|
|
28169
|
+
/* @__PURE__ */ g(tO, {
|
|
28163
28170
|
colors: h,
|
|
28164
28171
|
size: 36,
|
|
28165
28172
|
voiceState: w
|
|
@@ -28210,7 +28217,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28210
28217
|
gap: "16px",
|
|
28211
28218
|
padding: "0 24px 16px"
|
|
28212
28219
|
},
|
|
28213
|
-
children: [/* @__PURE__ */ g(
|
|
28220
|
+
children: [/* @__PURE__ */ g(oO, {
|
|
28214
28221
|
headshot: o,
|
|
28215
28222
|
name: y,
|
|
28216
28223
|
size: 116,
|
|
@@ -28299,9 +28306,9 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28299
28306
|
]
|
|
28300
28307
|
});
|
|
28301
28308
|
}
|
|
28302
|
-
function
|
|
28309
|
+
function lO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
|
|
28303
28310
|
let u = e || n || "Agent";
|
|
28304
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children:
|
|
28311
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: nO }), /* @__PURE__ */ _("div", {
|
|
28305
28312
|
role: "button",
|
|
28306
28313
|
tabIndex: 0,
|
|
28307
28314
|
onClick: c,
|
|
@@ -28358,7 +28365,7 @@ function cO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28358
28365
|
borderRadius: "50%",
|
|
28359
28366
|
border: `1.5px solid ${l}55`
|
|
28360
28367
|
} }),
|
|
28361
|
-
/* @__PURE__ */ g(
|
|
28368
|
+
/* @__PURE__ */ g(oO, {
|
|
28362
28369
|
headshot: t,
|
|
28363
28370
|
name: u,
|
|
28364
28371
|
size: 38,
|
|
@@ -28478,7 +28485,7 @@ function cO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28478
28485
|
}
|
|
28479
28486
|
//#endregion
|
|
28480
28487
|
//#region src/utils/voicePriorContext.js
|
|
28481
|
-
function
|
|
28488
|
+
function uO(e, t = {}) {
|
|
28482
28489
|
let n = t.maxChars ?? 4500;
|
|
28483
28490
|
if (!Array.isArray(e) || e.length === 0) return "";
|
|
28484
28491
|
let r = [];
|
|
@@ -28495,7 +28502,7 @@ function lO(e, t = {}) {
|
|
|
28495
28502
|
}
|
|
28496
28503
|
//#endregion
|
|
28497
28504
|
//#region src/utils/actionQueue.js
|
|
28498
|
-
var
|
|
28505
|
+
var dO = {
|
|
28499
28506
|
wordsSoFar: 0,
|
|
28500
28507
|
speechStartTime: 0,
|
|
28501
28508
|
isSpeaking: !1,
|
|
@@ -28504,35 +28511,35 @@ var uO = {
|
|
|
28504
28511
|
lastHighlightId: null,
|
|
28505
28512
|
isVoiceMode: !1
|
|
28506
28513
|
};
|
|
28507
|
-
function
|
|
28508
|
-
|
|
28514
|
+
function fO() {
|
|
28515
|
+
dO.timers.forEach(clearTimeout), dO.wordsSoFar = 0, dO.speechStartTime = 0, dO.isSpeaking = !1, dO.items = [], dO.timers = [], dO.lastHighlightId = null;
|
|
28509
28516
|
}
|
|
28510
28517
|
//#endregion
|
|
28511
28518
|
//#region src/utils/highlightEngine.js
|
|
28512
|
-
var
|
|
28513
|
-
function
|
|
28519
|
+
var pO = 80;
|
|
28520
|
+
function mO(e) {
|
|
28514
28521
|
requestAnimationFrame(() => {
|
|
28515
|
-
let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r =
|
|
28522
|
+
let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = pO, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
|
|
28516
28523
|
window.scrollTo({
|
|
28517
28524
|
top: Math.max(0, a),
|
|
28518
28525
|
behavior: "smooth"
|
|
28519
28526
|
});
|
|
28520
28527
|
});
|
|
28521
28528
|
}
|
|
28522
|
-
function
|
|
28529
|
+
function hO(e) {
|
|
28523
28530
|
if (!e || e.hasAttribute("data-fe-highlighted")) return;
|
|
28524
|
-
|
|
28531
|
+
gO(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), mO(e);
|
|
28525
28532
|
let t = e.style.cssText;
|
|
28526
28533
|
e.setAttribute("data-fe-highlighted", "true"), e.setAttribute("data-fe-orig-style", t), e.style.outline = "3px solid #2563eb", e.style.outlineOffset = "8px", e.style.background = "rgba(37, 99, 235, 0.08)", e.style.borderRadius = "8px", e.style.padding = "12px 16px", e.style.transition = "all 0.4s ease";
|
|
28527
28534
|
}
|
|
28528
|
-
function
|
|
28535
|
+
function gO() {
|
|
28529
28536
|
let e = document.querySelector("[data-fe-highlighted]");
|
|
28530
28537
|
e && (e.style.cssText = e.getAttribute("data-fe-orig-style") || "", e.removeAttribute("data-fe-highlighted"), e.removeAttribute("data-fe-orig-style"));
|
|
28531
28538
|
}
|
|
28532
28539
|
//#endregion
|
|
28533
28540
|
//#region src/utils/voiceActionVisuals.js
|
|
28534
28541
|
var Q = "fe-vv";
|
|
28535
|
-
function
|
|
28542
|
+
function _O() {
|
|
28536
28543
|
if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
|
|
28537
28544
|
let e = `
|
|
28538
28545
|
/* ── Action toast ───────────────────────────────────────────────────────────── */
|
|
@@ -28677,14 +28684,14 @@ function gO() {
|
|
|
28677
28684
|
`, t = document.createElement("style");
|
|
28678
28685
|
t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
|
|
28679
28686
|
}
|
|
28680
|
-
var
|
|
28681
|
-
function
|
|
28682
|
-
return (!
|
|
28687
|
+
var vO = null, yO = null;
|
|
28688
|
+
function bO() {
|
|
28689
|
+
return (!vO || !vO.isConnected) && (vO = document.createElement("div"), vO.id = `${Q}-toast`, document.body.appendChild(vO)), vO;
|
|
28683
28690
|
}
|
|
28684
|
-
function
|
|
28691
|
+
function xO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
28685
28692
|
if (typeof document > "u") return;
|
|
28686
|
-
|
|
28687
|
-
let i =
|
|
28693
|
+
_O(), yO &&= (clearTimeout(yO), null);
|
|
28694
|
+
let i = bO();
|
|
28688
28695
|
if (i.innerHTML = "", n) {
|
|
28689
28696
|
let e = document.createElement("span");
|
|
28690
28697
|
e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
|
|
@@ -28693,82 +28700,82 @@ function bO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
|
28693
28700
|
e.className = `${Q}-spin`, i.appendChild(e);
|
|
28694
28701
|
}
|
|
28695
28702
|
let a = document.createElement("span");
|
|
28696
|
-
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (
|
|
28697
|
-
}
|
|
28698
|
-
function xO(e = 0) {
|
|
28699
|
-
_O && (e > 0 ? vO = setTimeout(() => {
|
|
28700
|
-
_O && _O.classList.remove(`${Q}-show`);
|
|
28701
|
-
}, e) : _O && _O.classList.remove(`${Q}-show`));
|
|
28703
|
+
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (yO = setTimeout(() => SO(), r));
|
|
28702
28704
|
}
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28705
|
+
function SO(e = 0) {
|
|
28706
|
+
vO && (e > 0 ? yO = setTimeout(() => {
|
|
28707
|
+
vO && vO.classList.remove(`${Q}-show`);
|
|
28708
|
+
}, e) : vO && vO.classList.remove(`${Q}-show`));
|
|
28706
28709
|
}
|
|
28710
|
+
var CO = null, wO = [];
|
|
28707
28711
|
function TO() {
|
|
28712
|
+
return (!CO || !CO.isConnected) && (CO = document.createElement("div"), CO.id = `${Q}-bar`, document.body.appendChild(CO)), CO;
|
|
28713
|
+
}
|
|
28714
|
+
function EO() {
|
|
28708
28715
|
if (typeof document > "u") return;
|
|
28709
|
-
|
|
28710
|
-
let e =
|
|
28716
|
+
_O(), wO.forEach(clearTimeout), wO = [];
|
|
28717
|
+
let e = TO();
|
|
28711
28718
|
e.style.transition = "none", e.style.width = "0%", e.classList.add(`${Q}-bar-active`), e.offsetHeight, e.style.transition = "width 0.35s ease, opacity 0.25s ease";
|
|
28712
28719
|
let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
|
|
28713
28720
|
for (let [e, r] of t) {
|
|
28714
28721
|
let t = n, i = e, a = r;
|
|
28715
|
-
|
|
28716
|
-
|
|
28722
|
+
wO.push(setTimeout(() => {
|
|
28723
|
+
CO && (CO.style.transition = a, CO.style.width = `${i}%`);
|
|
28717
28724
|
}, t)), n += 800;
|
|
28718
28725
|
}
|
|
28719
28726
|
}
|
|
28720
|
-
function
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
28727
|
+
function DO() {
|
|
28728
|
+
CO && (wO.forEach(clearTimeout), wO = [], CO.style.transition = "width 0.2s ease", CO.style.width = "100%", wO.push(setTimeout(() => {
|
|
28729
|
+
CO && (CO.style.transition = "opacity 0.35s ease", CO.style.opacity = "0", wO.push(setTimeout(() => {
|
|
28730
|
+
CO && (CO.style.width = "0%", CO.classList.remove(`${Q}-bar-active`));
|
|
28724
28731
|
}, 380)));
|
|
28725
28732
|
}, 220)));
|
|
28726
28733
|
}
|
|
28727
|
-
function
|
|
28734
|
+
function OO() {
|
|
28728
28735
|
typeof document > "u" || document.querySelectorAll(`.${Q}-field-active, .${Q}-field-filled`).forEach((e) => e.classList.remove(`${Q}-field-active`, `${Q}-field-filled`));
|
|
28729
28736
|
}
|
|
28730
|
-
function OO(e) {
|
|
28731
|
-
!e || typeof document > "u" || (gO(), DO(), e.classList.add(`${Q}-field-active`));
|
|
28732
|
-
}
|
|
28733
28737
|
function kO(e) {
|
|
28738
|
+
!e || typeof document > "u" || (_O(), OO(), e.classList.add(`${Q}-field-active`));
|
|
28739
|
+
}
|
|
28740
|
+
function AO(e) {
|
|
28734
28741
|
e && (e.classList.remove(`${Q}-field-active`), e.classList.add(`${Q}-field-filled`), setTimeout(() => {
|
|
28735
28742
|
e.isConnected && e.classList.remove(`${Q}-field-filled`);
|
|
28736
28743
|
}, 1400));
|
|
28737
28744
|
}
|
|
28738
|
-
var
|
|
28745
|
+
var jO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
|
|
28739
28746
|
<filter id="${Q}-csh">
|
|
28740
28747
|
<feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
|
|
28741
28748
|
</filter>
|
|
28742
28749
|
<path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
|
|
28743
28750
|
fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
|
|
28744
28751
|
filter="url(#${Q}-csh)"/>
|
|
28745
|
-
</svg>`,
|
|
28746
|
-
function
|
|
28747
|
-
return (!
|
|
28752
|
+
</svg>`, MO = null, NO = !1;
|
|
28753
|
+
function PO() {
|
|
28754
|
+
return (!MO || !MO.isConnected) && (MO = document.createElement("div"), MO.id = `${Q}-cursor`, MO.innerHTML = jO, document.body.appendChild(MO), NO = !1), MO;
|
|
28748
28755
|
}
|
|
28749
|
-
async function
|
|
28756
|
+
async function FO(e) {
|
|
28750
28757
|
if (typeof document > "u" || !e) return;
|
|
28751
|
-
|
|
28758
|
+
_O();
|
|
28752
28759
|
let t;
|
|
28753
28760
|
try {
|
|
28754
28761
|
t = e.getBoundingClientRect();
|
|
28755
28762
|
} catch {
|
|
28756
28763
|
return;
|
|
28757
28764
|
}
|
|
28758
|
-
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i =
|
|
28759
|
-
|
|
28765
|
+
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = PO();
|
|
28766
|
+
NO ||= (i.style.transition = "none", i.style.left = `${window.innerWidth / 2}px`, i.style.top = `${window.innerHeight * .4}px`, i.classList.add(`${Q}-cursor-visible`), i.offsetHeight, i.style.transition = "left 0.32s cubic-bezier(0.25,0.46,0.45,0.94), top 0.32s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.2s ease", !0), i.style.left = `${n}px`, i.style.top = `${r}px`, await zO(360);
|
|
28760
28767
|
}
|
|
28761
|
-
function
|
|
28762
|
-
|
|
28763
|
-
|
|
28768
|
+
function IO(e = !1) {
|
|
28769
|
+
MO && (e ? (MO.classList.remove(`${Q}-cursor-visible`), NO = !1) : (MO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
|
|
28770
|
+
NO = !1;
|
|
28764
28771
|
}, 250)));
|
|
28765
28772
|
}
|
|
28766
|
-
async function
|
|
28767
|
-
|
|
28773
|
+
async function LO(e) {
|
|
28774
|
+
MO && (MO.classList.add(`${Q}-cursor-click`), await zO(280), MO.classList.remove(`${Q}-cursor-click`));
|
|
28768
28775
|
}
|
|
28769
|
-
function
|
|
28776
|
+
function RO(e) {
|
|
28770
28777
|
if (!e || typeof document > "u") return;
|
|
28771
|
-
|
|
28778
|
+
_O();
|
|
28772
28779
|
let t;
|
|
28773
28780
|
try {
|
|
28774
28781
|
t = e.getBoundingClientRect();
|
|
@@ -28794,7 +28801,7 @@ function LO(e) {
|
|
|
28794
28801
|
a.remove(), e.style.position = n, e.style.overflow = r;
|
|
28795
28802
|
}, 650);
|
|
28796
28803
|
}
|
|
28797
|
-
function
|
|
28804
|
+
function zO(e) {
|
|
28798
28805
|
return new Promise((t) => setTimeout(t, e));
|
|
28799
28806
|
}
|
|
28800
28807
|
//#endregion
|
|
@@ -28802,42 +28809,42 @@ function RO(e) {
|
|
|
28802
28809
|
function $(...e) {
|
|
28803
28810
|
Rn() && console.log("[FlowEngage:voice-tools]", ...e);
|
|
28804
28811
|
}
|
|
28805
|
-
function
|
|
28812
|
+
function BO(e) {
|
|
28806
28813
|
return new Promise((t) => setTimeout(t, e));
|
|
28807
28814
|
}
|
|
28808
|
-
var
|
|
28809
|
-
function
|
|
28815
|
+
var VO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
|
|
28816
|
+
function HO(e) {
|
|
28810
28817
|
if (!e || typeof e.closest != "function") return !1;
|
|
28811
28818
|
try {
|
|
28812
|
-
return !!e.closest(
|
|
28819
|
+
return !!e.closest(VO);
|
|
28813
28820
|
} catch {
|
|
28814
28821
|
return !1;
|
|
28815
28822
|
}
|
|
28816
28823
|
}
|
|
28817
|
-
function
|
|
28824
|
+
function UO(e) {
|
|
28818
28825
|
try {
|
|
28819
28826
|
let t = e.ownerDocument?.defaultView;
|
|
28820
28827
|
if (t) return t.getComputedStyle(e);
|
|
28821
28828
|
} catch {}
|
|
28822
28829
|
return window.getComputedStyle(e);
|
|
28823
28830
|
}
|
|
28824
|
-
function
|
|
28831
|
+
function WO(e) {
|
|
28825
28832
|
let t = /* @__PURE__ */ new Set();
|
|
28826
28833
|
function n(r) {
|
|
28827
28834
|
if (!r || t.has(r)) return;
|
|
28828
28835
|
t.add(r), e(r);
|
|
28829
28836
|
let i = r.querySelectorAll("iframe");
|
|
28830
|
-
for (let e of i) if (!
|
|
28837
|
+
for (let e of i) if (!HO(e)) try {
|
|
28831
28838
|
let t = e.contentDocument;
|
|
28832
28839
|
t && n(t);
|
|
28833
28840
|
} catch {}
|
|
28834
28841
|
}
|
|
28835
28842
|
typeof document < "u" && n(document);
|
|
28836
28843
|
}
|
|
28837
|
-
function
|
|
28844
|
+
function GO(e) {
|
|
28838
28845
|
return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
|
|
28839
28846
|
}
|
|
28840
|
-
function
|
|
28847
|
+
function KO(e) {
|
|
28841
28848
|
let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
|
|
28842
28849
|
if (n) {
|
|
28843
28850
|
let e = n.trim().split(/\s+/).filter(Boolean), r = [];
|
|
@@ -28845,42 +28852,42 @@ function GO(e) {
|
|
|
28845
28852
|
let e = t.getElementById(n);
|
|
28846
28853
|
e?.textContent && r.push(e.textContent.trim());
|
|
28847
28854
|
} catch {}
|
|
28848
|
-
if (r.length) return
|
|
28855
|
+
if (r.length) return GO(r.join(" "));
|
|
28849
28856
|
}
|
|
28850
|
-
if (e.labels && e.labels.length) return
|
|
28857
|
+
if (e.labels && e.labels.length) return GO(e.labels[0].textContent);
|
|
28851
28858
|
let r = e.id;
|
|
28852
28859
|
if (r) try {
|
|
28853
28860
|
let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
|
|
28854
|
-
if (e) return
|
|
28861
|
+
if (e) return GO(e.textContent);
|
|
28855
28862
|
} catch {
|
|
28856
28863
|
let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
|
|
28857
|
-
if (e) return
|
|
28864
|
+
if (e) return GO(e.textContent);
|
|
28858
28865
|
}
|
|
28859
28866
|
let i = e.previousElementSibling;
|
|
28860
28867
|
for (let e = 0; e < 6 && i; e += 1) {
|
|
28861
|
-
if (i.tagName === "LABEL") return
|
|
28868
|
+
if (i.tagName === "LABEL") return GO(i.textContent);
|
|
28862
28869
|
let e = (i.className || "").toString().toLowerCase();
|
|
28863
28870
|
if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
|
|
28864
|
-
let e =
|
|
28871
|
+
let e = GO(i.textContent);
|
|
28865
28872
|
if (e) return e;
|
|
28866
28873
|
}
|
|
28867
28874
|
i = i.previousElementSibling;
|
|
28868
28875
|
}
|
|
28869
28876
|
let a = e.parentElement;
|
|
28870
28877
|
for (let e = 0; e < 5 && a; e += 1) {
|
|
28871
|
-
if (a.tagName === "LABEL") return
|
|
28878
|
+
if (a.tagName === "LABEL") return GO(a.textContent);
|
|
28872
28879
|
let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
|
|
28873
|
-
if (e?.textContent) return
|
|
28880
|
+
if (e?.textContent) return GO(e.textContent);
|
|
28874
28881
|
a = a.parentElement;
|
|
28875
28882
|
}
|
|
28876
28883
|
let o = e.getAttribute("aria-label");
|
|
28877
|
-
return o ?
|
|
28884
|
+
return o ? GO(o) : null;
|
|
28878
28885
|
}
|
|
28879
|
-
function
|
|
28886
|
+
function qO() {
|
|
28880
28887
|
let e = [];
|
|
28881
|
-
return
|
|
28888
|
+
return WO((t) => {
|
|
28882
28889
|
e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
|
|
28883
|
-
if (
|
|
28890
|
+
if (HO(e)) return !1;
|
|
28884
28891
|
let t = (e.type || "").toLowerCase();
|
|
28885
28892
|
if ([
|
|
28886
28893
|
"hidden",
|
|
@@ -28889,32 +28896,32 @@ function KO() {
|
|
|
28889
28896
|
"image"
|
|
28890
28897
|
].includes(t) || e.disabled || e.readOnly) return !1;
|
|
28891
28898
|
try {
|
|
28892
|
-
let t =
|
|
28899
|
+
let t = UO(e);
|
|
28893
28900
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
28894
28901
|
} catch {}
|
|
28895
28902
|
return !0;
|
|
28896
28903
|
}));
|
|
28897
28904
|
}), e;
|
|
28898
28905
|
}
|
|
28899
|
-
function
|
|
28900
|
-
return
|
|
28906
|
+
function JO() {
|
|
28907
|
+
return qO().map((e, t) => ({
|
|
28901
28908
|
formIndex: 0,
|
|
28902
28909
|
fieldIndex: t,
|
|
28903
28910
|
tag: e.tagName,
|
|
28904
28911
|
type: e.type || "text",
|
|
28905
28912
|
name: e.name || null,
|
|
28906
28913
|
id: e.id || null,
|
|
28907
|
-
label:
|
|
28914
|
+
label: KO(e),
|
|
28908
28915
|
placeholder: e.placeholder || null
|
|
28909
28916
|
}));
|
|
28910
28917
|
}
|
|
28911
|
-
function
|
|
28918
|
+
function YO() {
|
|
28912
28919
|
let e = [];
|
|
28913
|
-
return
|
|
28920
|
+
return WO((t) => {
|
|
28914
28921
|
e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
|
|
28915
|
-
if (
|
|
28922
|
+
if (HO(e) || e.disabled) return !1;
|
|
28916
28923
|
try {
|
|
28917
|
-
let t =
|
|
28924
|
+
let t = UO(e);
|
|
28918
28925
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
28919
28926
|
} catch {}
|
|
28920
28927
|
return !0;
|
|
@@ -28926,15 +28933,15 @@ function JO() {
|
|
|
28926
28933
|
type: e.type || e.tagName
|
|
28927
28934
|
}));
|
|
28928
28935
|
}
|
|
28929
|
-
function
|
|
28936
|
+
function XO(e) {
|
|
28930
28937
|
return String(e || "").toLowerCase().replace(/\u00a0/g, " ").replace(/\*/g, "").replace(/\s+/g, " ").trim();
|
|
28931
28938
|
}
|
|
28932
|
-
function
|
|
28933
|
-
let t =
|
|
28939
|
+
function ZO(e) {
|
|
28940
|
+
let t = XO(e);
|
|
28934
28941
|
return t = t.replace(/\s+field\s*$/i, "").trim(), t;
|
|
28935
28942
|
}
|
|
28936
|
-
function
|
|
28937
|
-
let n =
|
|
28943
|
+
function QO(e, t) {
|
|
28944
|
+
let n = ZO(t);
|
|
28938
28945
|
if (!n) return 0;
|
|
28939
28946
|
let r = (e.name || "").toLowerCase(), i = (e.id || "").toLowerCase();
|
|
28940
28947
|
if (r === "url" && /url|website|domain|site|audit/.test(n) || (i === "url-input" || i.endsWith("-url-input")) && /url|website|domain|site|audit/.test(n)) return 100;
|
|
@@ -28942,12 +28949,12 @@ function ZO(e, t) {
|
|
|
28942
28949
|
e.name,
|
|
28943
28950
|
e.id,
|
|
28944
28951
|
e.placeholder,
|
|
28945
|
-
|
|
28952
|
+
KO(e),
|
|
28946
28953
|
e.getAttribute("aria-label"),
|
|
28947
28954
|
e.getAttribute("title"),
|
|
28948
28955
|
e.getAttribute("data-testid"),
|
|
28949
28956
|
e.getAttribute("autocomplete")
|
|
28950
|
-
].filter(Boolean).map((e) =>
|
|
28957
|
+
].filter(Boolean).map((e) => XO(e)), o = 0;
|
|
28951
28958
|
for (let e of a) {
|
|
28952
28959
|
if (!e) continue;
|
|
28953
28960
|
if (e.includes(n) || n.includes(e)) {
|
|
@@ -28962,16 +28969,16 @@ function ZO(e, t) {
|
|
|
28962
28969
|
}
|
|
28963
28970
|
return o;
|
|
28964
28971
|
}
|
|
28965
|
-
var
|
|
28966
|
-
function
|
|
28972
|
+
var $O = 28;
|
|
28973
|
+
function ek(e, t) {
|
|
28967
28974
|
let n = null, r = 0;
|
|
28968
28975
|
for (let i of e) {
|
|
28969
|
-
let e =
|
|
28976
|
+
let e = QO(i, t);
|
|
28970
28977
|
e > r && (r = e, n = i);
|
|
28971
28978
|
}
|
|
28972
|
-
return !n || r <
|
|
28979
|
+
return !n || r < $O ? null : n;
|
|
28973
28980
|
}
|
|
28974
|
-
function
|
|
28981
|
+
function tk(e, t, n) {
|
|
28975
28982
|
let r = String(t || "").toLowerCase().trim(), i = String(n || "").trim();
|
|
28976
28983
|
if (!(/^https?:\/\//i.test(i) || /\.\w{2,}(\/|\s|$)/.test(i) || r.includes("url") || r.includes("website") || r.includes("domain") || r.includes("site"))) return null;
|
|
28977
28984
|
let a = null, o = 0;
|
|
@@ -28991,7 +28998,7 @@ function ek(e, t, n) {
|
|
|
28991
28998
|
t.name,
|
|
28992
28999
|
t.id,
|
|
28993
29000
|
t.placeholder,
|
|
28994
|
-
|
|
29001
|
+
KO(t),
|
|
28995
29002
|
t.getAttribute("aria-label"),
|
|
28996
29003
|
t.getAttribute("autocomplete")
|
|
28997
29004
|
].filter(Boolean).join(" ").toLowerCase();
|
|
@@ -28999,15 +29006,15 @@ function ek(e, t, n) {
|
|
|
28999
29006
|
}
|
|
29000
29007
|
return !a || o < 42 ? null : a;
|
|
29001
29008
|
}
|
|
29002
|
-
function
|
|
29009
|
+
function nk(e) {
|
|
29003
29010
|
let t = String(e ?? "").trim();
|
|
29004
29011
|
return t ? /^https?:\/\//i.test(t) ? !0 : /\.\w{2,}(\/|\s|$)/.test(t) : !1;
|
|
29005
29012
|
}
|
|
29006
|
-
function
|
|
29013
|
+
function rk(e) {
|
|
29007
29014
|
let t = String(e ?? "").toLowerCase().trim();
|
|
29008
29015
|
return t ? !!(t === "url" || t === "website" || t === "website url" || t === "website_url" || t === "enter website url" || t.includes("website") || t.includes("domain") || /(enter\s+website|site\s*url|page\s*url)/.test(t)) : !1;
|
|
29009
29016
|
}
|
|
29010
|
-
function
|
|
29017
|
+
function ik(e) {
|
|
29011
29018
|
if (!e || e.tagName !== "INPUT" && e.tagName !== "TEXTAREA") return !1;
|
|
29012
29019
|
let t = (e.type || "").toLowerCase();
|
|
29013
29020
|
return ![
|
|
@@ -29019,22 +29026,22 @@ function rk(e) {
|
|
|
29019
29026
|
"file"
|
|
29020
29027
|
].includes(t);
|
|
29021
29028
|
}
|
|
29022
|
-
function
|
|
29023
|
-
if (!
|
|
29029
|
+
function ak(e) {
|
|
29030
|
+
if (!ik(e)) return !1;
|
|
29024
29031
|
let t = (e.name || "").toLowerCase(), n = (e.id || "").toLowerCase(), r = [
|
|
29025
29032
|
e.name,
|
|
29026
29033
|
e.id,
|
|
29027
29034
|
e.placeholder,
|
|
29028
|
-
|
|
29035
|
+
KO(e),
|
|
29029
29036
|
e.getAttribute("aria-label")
|
|
29030
29037
|
].filter(Boolean).join(" ").toLowerCase();
|
|
29031
29038
|
return t === "url" || n === "url-input" || n.endsWith("-url-input") || /(website\s*url|enter\s+website|site\s*url)/.test(r) || /(website|domain)/.test(r) && /(url|site)/.test(r);
|
|
29032
29039
|
}
|
|
29033
|
-
function
|
|
29034
|
-
let r = String(t ?? ""), i = String(n ?? ""), a =
|
|
29040
|
+
function ok(e, t, n) {
|
|
29041
|
+
let r = String(t ?? ""), i = String(n ?? ""), a = lk(e, r) || ek(e, r) || tk(e, r, i);
|
|
29035
29042
|
if (!a) return [];
|
|
29036
29043
|
let o = new Set([a]);
|
|
29037
|
-
if (
|
|
29044
|
+
if (nk(i) && rk(r)) for (let t of e) t !== a && ak(t) && o.add(t);
|
|
29038
29045
|
let s = Array.from(o);
|
|
29039
29046
|
return s.sort((e, t) => {
|
|
29040
29047
|
if (e === t) return 0;
|
|
@@ -29042,7 +29049,7 @@ function ak(e, t, n) {
|
|
|
29042
29049
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
29043
29050
|
}), s;
|
|
29044
29051
|
}
|
|
29045
|
-
function
|
|
29052
|
+
function sk(e, t) {
|
|
29046
29053
|
try {
|
|
29047
29054
|
if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
|
|
29048
29055
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
@@ -29057,17 +29064,17 @@ function ok(e, t) {
|
|
|
29057
29064
|
return Infinity;
|
|
29058
29065
|
}
|
|
29059
29066
|
}
|
|
29060
|
-
function
|
|
29067
|
+
function ck(e) {
|
|
29061
29068
|
if (!e || typeof e != "string") return null;
|
|
29062
29069
|
let t = null;
|
|
29063
|
-
return
|
|
29070
|
+
return WO((n) => {
|
|
29064
29071
|
try {
|
|
29065
29072
|
let r = n.getElementById(e);
|
|
29066
|
-
r && !
|
|
29073
|
+
r && !HO(r) && r.matches?.("input, select, textarea") && (t = r);
|
|
29067
29074
|
} catch {}
|
|
29068
29075
|
}), t;
|
|
29069
29076
|
}
|
|
29070
|
-
function
|
|
29077
|
+
function lk(e, t) {
|
|
29071
29078
|
let n = String(t ?? "").trim();
|
|
29072
29079
|
if (!n) return null;
|
|
29073
29080
|
let r = n.match(/^name:\s*([\w.-]+)$/i);
|
|
@@ -29077,12 +29084,12 @@ function ck(e, t) {
|
|
|
29077
29084
|
}
|
|
29078
29085
|
let i = n.match(/^id:\s*([\w.-]+)$/i);
|
|
29079
29086
|
if (i) {
|
|
29080
|
-
let e =
|
|
29087
|
+
let e = ck(i[1]);
|
|
29081
29088
|
if (e) return e;
|
|
29082
29089
|
}
|
|
29083
29090
|
let a = n.startsWith("#") ? n.slice(1) : n;
|
|
29084
29091
|
if (/^[\w-]+$/.test(a)) {
|
|
29085
|
-
let e =
|
|
29092
|
+
let e = ck(a);
|
|
29086
29093
|
if (e) return e;
|
|
29087
29094
|
}
|
|
29088
29095
|
let o = n.toLowerCase().replace(/\s+/g, " ");
|
|
@@ -29092,7 +29099,7 @@ function ck(e, t) {
|
|
|
29092
29099
|
}
|
|
29093
29100
|
return null;
|
|
29094
29101
|
}
|
|
29095
|
-
function
|
|
29102
|
+
function uk(e, t) {
|
|
29096
29103
|
let n = String(t || "").toLowerCase().trim();
|
|
29097
29104
|
if (!n) return 0;
|
|
29098
29105
|
let r = [
|
|
@@ -29108,13 +29115,13 @@ function lk(e, t) {
|
|
|
29108
29115
|
for (let e of i) r.includes(e) && (a += 1);
|
|
29109
29116
|
return a / i.length * 92;
|
|
29110
29117
|
}
|
|
29111
|
-
function
|
|
29118
|
+
function dk(e, t) {
|
|
29112
29119
|
let n = [];
|
|
29113
|
-
|
|
29120
|
+
WO((e) => {
|
|
29114
29121
|
n.push(...Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
|
|
29115
|
-
if (
|
|
29122
|
+
if (HO(e) || e.disabled) return !1;
|
|
29116
29123
|
try {
|
|
29117
|
-
let t =
|
|
29124
|
+
let t = UO(e);
|
|
29118
29125
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
29119
29126
|
} catch {}
|
|
29120
29127
|
return !0;
|
|
@@ -29122,7 +29129,7 @@ function uk(e, t) {
|
|
|
29122
29129
|
});
|
|
29123
29130
|
let r = 0, i = n.map((t) => ({
|
|
29124
29131
|
el: t,
|
|
29125
|
-
s:
|
|
29132
|
+
s: uk(t, e)
|
|
29126
29133
|
}));
|
|
29127
29134
|
for (let { s: e } of i) e > r && (r = e);
|
|
29128
29135
|
if (r < 36) return null;
|
|
@@ -29132,14 +29139,14 @@ function uk(e, t) {
|
|
|
29132
29139
|
if (o.length) {
|
|
29133
29140
|
let e = a[0], t = Infinity;
|
|
29134
29141
|
for (let n of a) for (let r of o) {
|
|
29135
|
-
let i =
|
|
29142
|
+
let i = sk(n, r);
|
|
29136
29143
|
i < t && (t = i, e = n);
|
|
29137
29144
|
}
|
|
29138
29145
|
return e;
|
|
29139
29146
|
}
|
|
29140
29147
|
return a[0];
|
|
29141
29148
|
}
|
|
29142
|
-
function
|
|
29149
|
+
function fk(e) {
|
|
29143
29150
|
if (e == null) return {};
|
|
29144
29151
|
if (typeof e == "string") {
|
|
29145
29152
|
let t = e.trim();
|
|
@@ -29152,8 +29159,8 @@ function dk(e) {
|
|
|
29152
29159
|
}
|
|
29153
29160
|
return e;
|
|
29154
29161
|
}
|
|
29155
|
-
function
|
|
29156
|
-
let t =
|
|
29162
|
+
function pk(e) {
|
|
29163
|
+
let t = fk(e);
|
|
29157
29164
|
if (Array.isArray(t) && t.length > 0) {
|
|
29158
29165
|
let e = t[0];
|
|
29159
29166
|
if (e?.field_key != null || e?.fieldKey != null) return t.map((e) => ({
|
|
@@ -29181,7 +29188,7 @@ function fk(e) {
|
|
|
29181
29188
|
value: e?.value ?? e?.Value
|
|
29182
29189
|
})) : [];
|
|
29183
29190
|
}
|
|
29184
|
-
function
|
|
29191
|
+
function mk(e) {
|
|
29185
29192
|
if (!e || typeof e != "string") return [];
|
|
29186
29193
|
let t = e.trim();
|
|
29187
29194
|
if (!t || /\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\b/i.test(t)) return [];
|
|
@@ -29200,7 +29207,7 @@ function pk(e) {
|
|
|
29200
29207
|
}
|
|
29201
29208
|
return [];
|
|
29202
29209
|
}
|
|
29203
|
-
function
|
|
29210
|
+
function hk(e) {
|
|
29204
29211
|
if (!e || typeof e != "string") return [];
|
|
29205
29212
|
let t = e.trim();
|
|
29206
29213
|
if (!t) return [];
|
|
@@ -29236,17 +29243,17 @@ function mk(e) {
|
|
|
29236
29243
|
}
|
|
29237
29244
|
return n;
|
|
29238
29245
|
}
|
|
29239
|
-
function
|
|
29246
|
+
function gk(e) {
|
|
29240
29247
|
if (!e || typeof e != "object") return null;
|
|
29241
29248
|
let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
|
|
29242
29249
|
return t == null ? null : String(t).trim() || null;
|
|
29243
29250
|
}
|
|
29244
|
-
function
|
|
29251
|
+
function _k(e) {
|
|
29245
29252
|
if (!e || typeof e != "object") return null;
|
|
29246
29253
|
let t = e.query ?? e.q ?? e.search ?? e.text ?? e.keywords;
|
|
29247
29254
|
return t == null ? null : String(t).trim() || null;
|
|
29248
29255
|
}
|
|
29249
|
-
function
|
|
29256
|
+
function vk(e, t, n) {
|
|
29250
29257
|
if (!n?.skipScroll) try {
|
|
29251
29258
|
e.scrollIntoView({
|
|
29252
29259
|
block: "center",
|
|
@@ -29301,7 +29308,7 @@ function _k(e, t, n) {
|
|
|
29301
29308
|
} catch {}
|
|
29302
29309
|
return !0;
|
|
29303
29310
|
}
|
|
29304
|
-
function
|
|
29311
|
+
function yk() {
|
|
29305
29312
|
let e = {};
|
|
29306
29313
|
document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
|
|
29307
29314
|
if (t.id) return;
|
|
@@ -29316,11 +29323,11 @@ function vk() {
|
|
|
29316
29323
|
e[r] = !0, t.id = r;
|
|
29317
29324
|
});
|
|
29318
29325
|
}
|
|
29319
|
-
function
|
|
29326
|
+
function bk(e) {
|
|
29320
29327
|
let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
|
|
29321
29328
|
flowengage_navigate: async (n) => {
|
|
29322
29329
|
$("flowengage_navigate ▶ raw parameters:", n);
|
|
29323
|
-
let i =
|
|
29330
|
+
let i = fk(n), a = gk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
|
|
29324
29331
|
if ($("flowengage_navigate · coerced:", {
|
|
29325
29332
|
url: a,
|
|
29326
29333
|
sectionText: o,
|
|
@@ -29345,11 +29352,11 @@ function yk(e) {
|
|
|
29345
29352
|
return $("flowengage_navigate ✖ blocked", e), e;
|
|
29346
29353
|
}
|
|
29347
29354
|
try {
|
|
29348
|
-
|
|
29355
|
+
xO(`Navigating to ${a}...`, { spinner: !0 }), EO(), fO(), gO();
|
|
29349
29356
|
try {
|
|
29350
29357
|
let e = r ? r() : "";
|
|
29351
29358
|
if (e && t) {
|
|
29352
|
-
let n =
|
|
29359
|
+
let n = uO([{
|
|
29353
29360
|
sender: "user",
|
|
29354
29361
|
message: e
|
|
29355
29362
|
}]);
|
|
@@ -29372,25 +29379,25 @@ function yk(e) {
|
|
|
29372
29379
|
return "OK_NAVIGATE_RELOADING. Navigating to the page now; the voice session will resume automatically on the new page. When the session resumes, immediately introduce the new page and continue guiding the visitor — do not wait for the user to speak first.";
|
|
29373
29380
|
} catch (e) {
|
|
29374
29381
|
let t = `Navigation error: ${e?.message || String(e)}`;
|
|
29375
|
-
return $("flowengage_navigate ✖", t),
|
|
29382
|
+
return $("flowengage_navigate ✖", t), xO("Navigation failed", {
|
|
29376
29383
|
spinner: !1,
|
|
29377
29384
|
icon: "⚠️",
|
|
29378
29385
|
duration: 1800
|
|
29379
29386
|
}), t;
|
|
29380
29387
|
} finally {
|
|
29381
|
-
|
|
29388
|
+
DO(), SO(900);
|
|
29382
29389
|
}
|
|
29383
29390
|
},
|
|
29384
29391
|
flowengage_highlight: async (e) => {
|
|
29385
29392
|
$("flowengage_highlight ▶", e);
|
|
29386
|
-
let t =
|
|
29387
|
-
|
|
29393
|
+
let t = fk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
|
|
29394
|
+
yk();
|
|
29388
29395
|
let i = dr(n || null, r || null);
|
|
29389
|
-
return !i && r && (await new Promise((e) => setTimeout(e, 500)),
|
|
29396
|
+
return !i && r && (await new Promise((e) => setTimeout(e, 500)), yk(), i = dr(null, r)), i ? (hO(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}"`) : ($("flowengage_highlight ✖ no element for:", r || n), `Could not find "${r || n}" on the current page. Try a shorter phrase matching a visible heading.`);
|
|
29390
29397
|
},
|
|
29391
29398
|
flowengage_read_content: async (e) => {
|
|
29392
29399
|
$("flowengage_read_content ▶", e);
|
|
29393
|
-
let t =
|
|
29400
|
+
let t = fk(e), n = t?.section_text || t?.sectionText || "";
|
|
29394
29401
|
try {
|
|
29395
29402
|
let e = "";
|
|
29396
29403
|
if (n) {
|
|
@@ -29413,11 +29420,11 @@ function yk(e) {
|
|
|
29413
29420
|
},
|
|
29414
29421
|
flowengage_search: async (e) => {
|
|
29415
29422
|
$("flowengage_search ▶", e);
|
|
29416
|
-
let r =
|
|
29423
|
+
let r = _k(fk(e));
|
|
29417
29424
|
if ($("flowengage_search · query:", r, "siteId:", t, "apiBase:", n || "(empty)"), !r) return $("flowengage_search ✖ missing query"), "Missing query parameter.";
|
|
29418
29425
|
if (!t) return $("flowengage_search ✖ no siteId"), "Site is not configured for search.";
|
|
29419
29426
|
if (!n) return $("flowengage_search ✖ no api base"), "API base URL is missing; cannot search.";
|
|
29420
|
-
|
|
29427
|
+
xO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
|
|
29421
29428
|
try {
|
|
29422
29429
|
let e = `${n}/api/site-tools/search`;
|
|
29423
29430
|
$("flowengage_search → POST", e);
|
|
@@ -29440,12 +29447,12 @@ function yk(e) {
|
|
|
29440
29447
|
let t = `Search error: ${e.message || "network"}`;
|
|
29441
29448
|
return $("flowengage_search ✖", t), t;
|
|
29442
29449
|
} finally {
|
|
29443
|
-
|
|
29450
|
+
SO(600);
|
|
29444
29451
|
}
|
|
29445
29452
|
},
|
|
29446
29453
|
flowengage_page_content: async (e) => {
|
|
29447
29454
|
$("flowengage_page_content ▶", e);
|
|
29448
|
-
let r =
|
|
29455
|
+
let r = fk(e), i = r?.url || r?.page_url || "";
|
|
29449
29456
|
if ($("flowengage_page_content · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("flowengage_page_content ✖ missing url"), "Missing url parameter.";
|
|
29450
29457
|
if (!t) return $("flowengage_page_content ✖ no siteId"), "Site is not configured.";
|
|
29451
29458
|
if (!n) return $("flowengage_page_content ✖ no api base"), "API base URL is missing; cannot fetch page content.";
|
|
@@ -29477,7 +29484,7 @@ function yk(e) {
|
|
|
29477
29484
|
},
|
|
29478
29485
|
flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
|
|
29479
29486
|
flowengage_list_forms: async () => {
|
|
29480
|
-
let e =
|
|
29487
|
+
let e = JO(), t = YO();
|
|
29481
29488
|
return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
|
|
29482
29489
|
fields: e,
|
|
29483
29490
|
buttons: t,
|
|
@@ -29486,52 +29493,52 @@ function yk(e) {
|
|
|
29486
29493
|
},
|
|
29487
29494
|
flowengage_fill_form: async (e) => {
|
|
29488
29495
|
try {
|
|
29489
|
-
$("flowengage_fill_form ▶ raw:", e),
|
|
29490
|
-
let t =
|
|
29496
|
+
$("flowengage_fill_form ▶ raw:", e), OO();
|
|
29497
|
+
let t = pk(e);
|
|
29491
29498
|
if (!t.length && r) {
|
|
29492
|
-
let e = r(), n =
|
|
29493
|
-
n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n =
|
|
29499
|
+
let e = r(), n = mk(e);
|
|
29500
|
+
n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = hk(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = n);
|
|
29494
29501
|
}
|
|
29495
29502
|
if ($("flowengage_fill_form · normalized fields:", t), !t.length) return "No fields provided. Call flowengage_list_forms for field_key strings, then flowengage_fill_form with { \"fields\": [ { \"field_key\": \"<label or placeholder from list>\", \"value\": \"<user value>\" } ] }. Never use empty {}. Pass the value the user just said (email, message, name, URL) in fields.";
|
|
29496
29503
|
let n = [];
|
|
29497
29504
|
for (let e of t) {
|
|
29498
29505
|
let t = e?.field_key ?? e?.fieldKey, r = e?.value;
|
|
29499
29506
|
if (t == null || r == null) continue;
|
|
29500
|
-
|
|
29501
|
-
let a =
|
|
29507
|
+
xO(`Filling ${String(t)}...`, { spinner: !0 });
|
|
29508
|
+
let a = qO(), o = ok(a, String(t), r);
|
|
29502
29509
|
if (o.length) {
|
|
29503
|
-
for (let [e, t] of o.entries())
|
|
29510
|
+
for (let [e, t] of o.entries()) kO(t), await FO(t), vk(t, r, { skipScroll: e > 0 }), AO(t), await BO(120);
|
|
29504
29511
|
i = o, n.push(String(t));
|
|
29505
29512
|
continue;
|
|
29506
29513
|
}
|
|
29507
|
-
let s =
|
|
29508
|
-
s ||=
|
|
29514
|
+
let s = lk(a, String(t));
|
|
29515
|
+
s ||= ek(a, String(t)), s ||= tk(a, String(t), r), s && (kO(s), await FO(s), vk(s, r), AO(s), await BO(120), i = [s], n.push(String(t)));
|
|
29509
29516
|
}
|
|
29510
29517
|
if (!n.length) return $("flowengage_fill_form ✖ no matches"), "Could not match any fields. Call flowengage_list_forms and use field_key values that match placeholder, label, name, or id (e.g. Enter Website URL). Ensure the form is on the page, not the chat panel.";
|
|
29511
29518
|
let a = `OK_FILLED: ${n.join(", ")}`;
|
|
29512
|
-
return $("flowengage_fill_form ✓", a),
|
|
29519
|
+
return $("flowengage_fill_form ✓", a), xO("Form filled", {
|
|
29513
29520
|
spinner: !1,
|
|
29514
29521
|
icon: "✅",
|
|
29515
29522
|
duration: 1100
|
|
29516
29523
|
}), a;
|
|
29517
29524
|
} catch (e) {
|
|
29518
29525
|
let t = `flowengage_fill_form error: ${e?.message || String(e)}`;
|
|
29519
|
-
return $("flowengage_fill_form ✖", t),
|
|
29526
|
+
return $("flowengage_fill_form ✖", t), xO("Failed to fill form", {
|
|
29520
29527
|
spinner: !1,
|
|
29521
29528
|
icon: "⚠️",
|
|
29522
29529
|
duration: 1800
|
|
29523
29530
|
}), t;
|
|
29524
29531
|
} finally {
|
|
29525
|
-
|
|
29532
|
+
IO(), OO(), SO(700);
|
|
29526
29533
|
}
|
|
29527
29534
|
},
|
|
29528
29535
|
flowengage_click_button: async (e) => {
|
|
29529
|
-
let t =
|
|
29536
|
+
let t = fk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
|
|
29530
29537
|
if ($("flowengage_click_button ▶", n), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
|
|
29531
|
-
let r =
|
|
29538
|
+
let r = dk(n, i);
|
|
29532
29539
|
if (!r) return $("flowengage_click_button ✖ no match"), `Could not find a button matching "${n}". Call flowengage_list_forms to see button texts.`;
|
|
29533
29540
|
try {
|
|
29534
|
-
|
|
29541
|
+
xO(`Clicking ${n}...`, { spinner: !0 });
|
|
29535
29542
|
try {
|
|
29536
29543
|
r.scrollIntoView({
|
|
29537
29544
|
block: "center",
|
|
@@ -29540,22 +29547,22 @@ function yk(e) {
|
|
|
29540
29547
|
} catch {
|
|
29541
29548
|
r.scrollIntoView(!0);
|
|
29542
29549
|
}
|
|
29543
|
-
await
|
|
29550
|
+
await FO(r), r.focus?.(), await LO(r), RO(r), r.click();
|
|
29544
29551
|
let e = (r.textContent || r.value || r.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
|
|
29545
|
-
return $("flowengage_click_button ✓", t),
|
|
29552
|
+
return $("flowengage_click_button ✓", t), xO(`Clicked ${e}`, {
|
|
29546
29553
|
spinner: !1,
|
|
29547
29554
|
icon: "✅",
|
|
29548
29555
|
duration: 1200
|
|
29549
29556
|
}), t;
|
|
29550
29557
|
} catch (e) {
|
|
29551
29558
|
let t = `Click failed: ${e?.message || String(e)}`;
|
|
29552
|
-
return $("flowengage_click_button ✖", t),
|
|
29559
|
+
return $("flowengage_click_button ✖", t), xO("Click failed", {
|
|
29553
29560
|
spinner: !1,
|
|
29554
29561
|
icon: "⚠️",
|
|
29555
29562
|
duration: 1800
|
|
29556
29563
|
}), t;
|
|
29557
29564
|
} finally {
|
|
29558
|
-
|
|
29565
|
+
IO(), SO(700);
|
|
29559
29566
|
}
|
|
29560
29567
|
}
|
|
29561
29568
|
};
|
|
@@ -29572,7 +29579,7 @@ function yk(e) {
|
|
|
29572
29579
|
}
|
|
29573
29580
|
//#endregion
|
|
29574
29581
|
//#region src/utils/wrapVoiceToolsForLogging.js
|
|
29575
|
-
function
|
|
29582
|
+
function xk(e) {
|
|
29576
29583
|
return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
|
|
29577
29584
|
let r = Rn();
|
|
29578
29585
|
r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
|
|
@@ -29589,7 +29596,7 @@ function bk(e) {
|
|
|
29589
29596
|
}
|
|
29590
29597
|
//#endregion
|
|
29591
29598
|
//#region src/components/FlowEngageWidget.jsx
|
|
29592
|
-
var
|
|
29599
|
+
var Sk = {
|
|
29593
29600
|
blue: "#135bd8",
|
|
29594
29601
|
red: "#ef334b",
|
|
29595
29602
|
yellow: "#ffbd2e",
|
|
@@ -29597,7 +29604,7 @@ var xk = {
|
|
|
29597
29604
|
highlight: "rgba(255,255,255,0.9)",
|
|
29598
29605
|
green: "#10b981"
|
|
29599
29606
|
};
|
|
29600
|
-
function
|
|
29607
|
+
function Ck(e) {
|
|
29601
29608
|
if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
|
|
29602
29609
|
let [t, n, r] = e;
|
|
29603
29610
|
return e.length >= 3 && r ? [
|
|
@@ -29611,12 +29618,12 @@ function Sk(e) {
|
|
|
29611
29618
|
"#f7f8fa"
|
|
29612
29619
|
].join(", ");
|
|
29613
29620
|
}
|
|
29614
|
-
function
|
|
29621
|
+
function wk(e) {
|
|
29615
29622
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
29616
29623
|
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
29617
29624
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
29618
29625
|
}
|
|
29619
|
-
function
|
|
29626
|
+
function Tk({ logo: t, style: n }) {
|
|
29620
29627
|
if (!t) return null;
|
|
29621
29628
|
if (typeof t == "string") return /* @__PURE__ */ g("img", {
|
|
29622
29629
|
src: t,
|
|
@@ -29641,7 +29648,7 @@ function wk({ logo: t, style: n }) {
|
|
|
29641
29648
|
children: r
|
|
29642
29649
|
}) : null;
|
|
29643
29650
|
}
|
|
29644
|
-
function
|
|
29651
|
+
function Ek({ title: e }) {
|
|
29645
29652
|
return /* @__PURE__ */ g("div", {
|
|
29646
29653
|
style: {
|
|
29647
29654
|
width: "100%",
|
|
@@ -29659,18 +29666,18 @@ function Tk({ title: e }) {
|
|
|
29659
29666
|
children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
|
|
29660
29667
|
});
|
|
29661
29668
|
}
|
|
29662
|
-
function
|
|
29669
|
+
function Dk(e, t) {
|
|
29663
29670
|
let n = (t || "").trim();
|
|
29664
29671
|
return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || /\b(that'?s all|we'?re done)\b/i.test(n) || e === "bot" && (/\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n)) || /^(goodbye|bye|that'?s all|we'?re done|hang up|disconnect)\b/i.test(n)) : !1;
|
|
29665
29672
|
}
|
|
29666
|
-
function
|
|
29667
|
-
return /* @__PURE__ */ g(
|
|
29673
|
+
function Ok({ orbColors: e, ...t }) {
|
|
29674
|
+
return /* @__PURE__ */ g(tO, {
|
|
29668
29675
|
colors: e,
|
|
29669
29676
|
...t
|
|
29670
29677
|
});
|
|
29671
29678
|
}
|
|
29672
|
-
function
|
|
29673
|
-
let s = n ||
|
|
29679
|
+
function kk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
|
|
29680
|
+
let s = n || Sk.green, c = wk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
|
|
29674
29681
|
style: {
|
|
29675
29682
|
display: "flex",
|
|
29676
29683
|
alignItems: a ? "flex-end" : "center",
|
|
@@ -29791,7 +29798,7 @@ function Ok({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
29791
29798
|
delay: 0
|
|
29792
29799
|
},
|
|
29793
29800
|
style: { flexShrink: 0 },
|
|
29794
|
-
children: /* @__PURE__ */ g(
|
|
29801
|
+
children: /* @__PURE__ */ g(Ok, {
|
|
29795
29802
|
size: l,
|
|
29796
29803
|
orbColors: t
|
|
29797
29804
|
})
|
|
@@ -29823,8 +29830,8 @@ function Ok({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
29823
29830
|
children: u
|
|
29824
29831
|
})] });
|
|
29825
29832
|
}
|
|
29826
|
-
function
|
|
29827
|
-
let c = n ||
|
|
29833
|
+
function Ak({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
|
|
29834
|
+
let c = n || Sk.green, l = wk(c);
|
|
29828
29835
|
return /* @__PURE__ */ _(Sm.div, {
|
|
29829
29836
|
initial: {
|
|
29830
29837
|
scale: 50 / 350,
|
|
@@ -29895,7 +29902,7 @@ function kk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
29895
29902
|
children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
|
|
29896
29903
|
})
|
|
29897
29904
|
}),
|
|
29898
|
-
/* @__PURE__ */ g(
|
|
29905
|
+
/* @__PURE__ */ g(Ok, {
|
|
29899
29906
|
size: 72,
|
|
29900
29907
|
orbColors: t
|
|
29901
29908
|
}),
|
|
@@ -29964,7 +29971,7 @@ function kk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
29964
29971
|
]
|
|
29965
29972
|
});
|
|
29966
29973
|
}
|
|
29967
|
-
function
|
|
29974
|
+
function jk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
|
|
29968
29975
|
let [h, v] = m("idle"), [y, b] = m(!1), [x, S] = m(!1), C = p(null), w = p(""), T = p(async () => {}), ee = p(!1), te = p(!1), ne = p(!1), re = p(!1), E = p("minimized"), ie = p(null), ae = p(null), oe = p(null), D = p(0), se = p(!1), ce = o((e = "minimized") => {
|
|
29969
29976
|
E.current = e, re.current = !0, queueMicrotask(() => {
|
|
29970
29977
|
ee.current || (ee.current = !0, T.current?.());
|
|
@@ -30014,7 +30021,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30014
30021
|
if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
|
|
30015
30022
|
u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", wr({ onBeforeNavigate: () => {
|
|
30016
30023
|
if (a && u.current.length > 0) try {
|
|
30017
|
-
let e =
|
|
30024
|
+
let e = uO(u.current);
|
|
30018
30025
|
e && Ae(a, e);
|
|
30019
30026
|
} catch {}
|
|
30020
30027
|
if (!Xn()) {
|
|
@@ -30036,7 +30043,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30036
30043
|
}
|
|
30037
30044
|
Ne();
|
|
30038
30045
|
} });
|
|
30039
|
-
let t = bk(
|
|
30046
|
+
let t = xk(bk({
|
|
30040
30047
|
siteId: a || null,
|
|
30041
30048
|
apiBaseUrl: s || null,
|
|
30042
30049
|
getLastUserVoiceText: () => w.current,
|
|
@@ -30095,10 +30102,10 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30095
30102
|
message: r,
|
|
30096
30103
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
30097
30104
|
}], a) try {
|
|
30098
|
-
let e =
|
|
30105
|
+
let e = uO(u.current);
|
|
30099
30106
|
e && Ae(a, e);
|
|
30100
30107
|
} catch {}
|
|
30101
|
-
if (
|
|
30108
|
+
if (Dk(n, r)) {
|
|
30102
30109
|
ce("minimized");
|
|
30103
30110
|
return;
|
|
30104
30111
|
}
|
|
@@ -30233,7 +30240,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30233
30240
|
},
|
|
30234
30241
|
children: "Muted"
|
|
30235
30242
|
}),
|
|
30236
|
-
/* @__PURE__ */ g(
|
|
30243
|
+
/* @__PURE__ */ g(Ok, {
|
|
30237
30244
|
size: 72,
|
|
30238
30245
|
voiceState: h,
|
|
30239
30246
|
isMuted: y,
|
|
@@ -30471,7 +30478,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30471
30478
|
]
|
|
30472
30479
|
});
|
|
30473
30480
|
}
|
|
30474
|
-
function
|
|
30481
|
+
function Mk({ orbColors: e }) {
|
|
30475
30482
|
return /* @__PURE__ */ g("div", {
|
|
30476
30483
|
style: {
|
|
30477
30484
|
flexShrink: 0,
|
|
@@ -30481,13 +30488,13 @@ function jk({ orbColors: e }) {
|
|
|
30481
30488
|
alignItems: "center",
|
|
30482
30489
|
justifyContent: "center"
|
|
30483
30490
|
},
|
|
30484
|
-
children: /* @__PURE__ */ g(
|
|
30491
|
+
children: /* @__PURE__ */ g(Ok, {
|
|
30485
30492
|
size: 36,
|
|
30486
30493
|
orbColors: e
|
|
30487
30494
|
})
|
|
30488
30495
|
});
|
|
30489
30496
|
}
|
|
30490
|
-
var
|
|
30497
|
+
var Nk = () => /* @__PURE__ */ g("div", {
|
|
30491
30498
|
style: {
|
|
30492
30499
|
display: "flex",
|
|
30493
30500
|
marginBottom: "12px",
|
|
@@ -30517,7 +30524,7 @@ var Mk = () => /* @__PURE__ */ g("div", {
|
|
|
30517
30524
|
} }, e))
|
|
30518
30525
|
})
|
|
30519
30526
|
});
|
|
30520
|
-
function
|
|
30527
|
+
function Pk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, onEndConversation: De, showPoweredBy: Oe, getVisitorChatHistory: ke, getVisitorChatThread: Ae, resumeChat: je, isSessionRestoring: Me, isClosing: O }) {
|
|
30521
30528
|
let Ne = l.length > 0, Pe = T || ee || w, Fe = !!ge, [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 () => {
|
|
30522
30529
|
Le(!1), ze(!0), Ue(!0), Ge(null);
|
|
30523
30530
|
try {
|
|
@@ -30642,7 +30649,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30642
30649
|
justifyContent: "center",
|
|
30643
30650
|
height: "40px"
|
|
30644
30651
|
},
|
|
30645
|
-
children: i ? /* @__PURE__ */ g(
|
|
30652
|
+
children: i ? /* @__PURE__ */ g(Tk, {
|
|
30646
30653
|
logo: i,
|
|
30647
30654
|
style: {
|
|
30648
30655
|
height: "34px",
|
|
@@ -30655,7 +30662,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30655
30662
|
height: "40px",
|
|
30656
30663
|
flexShrink: 0
|
|
30657
30664
|
},
|
|
30658
|
-
children: /* @__PURE__ */ g(
|
|
30665
|
+
children: /* @__PURE__ */ g(Ek, { title: e.chatTitle })
|
|
30659
30666
|
})
|
|
30660
30667
|
}), /* @__PURE__ */ g("div", {
|
|
30661
30668
|
style: {
|
|
@@ -30937,7 +30944,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30937
30944
|
})
|
|
30938
30945
|
]
|
|
30939
30946
|
}),
|
|
30940
|
-
/* @__PURE__ */ g(
|
|
30947
|
+
/* @__PURE__ */ g(KD, {
|
|
30941
30948
|
webRTCError: fe,
|
|
30942
30949
|
micError: pe,
|
|
30943
30950
|
setMicError: me,
|
|
@@ -30945,7 +30952,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
30945
30952
|
isRateLimited: ee,
|
|
30946
30953
|
rateLimitMessage: te
|
|
30947
30954
|
}),
|
|
30948
|
-
Se && /* @__PURE__ */ g(
|
|
30955
|
+
Se && /* @__PURE__ */ g(lO, {
|
|
30949
30956
|
agentName: v,
|
|
30950
30957
|
agentHeadshot: y,
|
|
30951
30958
|
fallbackAgentName: b,
|
|
@@ -31137,17 +31144,17 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31137
31144
|
children: "No previous chats found."
|
|
31138
31145
|
})
|
|
31139
31146
|
})]
|
|
31140
|
-
}) : null, Ne ? /* @__PURE__ */ g(
|
|
31147
|
+
}) : null, Ne ? /* @__PURE__ */ g(WD, {
|
|
31141
31148
|
chatHistory: l,
|
|
31142
31149
|
isAiTyping: u,
|
|
31143
31150
|
isLoading: T,
|
|
31144
31151
|
isAgentTyping: d,
|
|
31145
31152
|
setReplyContext: de,
|
|
31146
|
-
TypingDots:
|
|
31153
|
+
TypingDots: Nk,
|
|
31147
31154
|
primaryColor: n,
|
|
31148
31155
|
agentHeadshot: y,
|
|
31149
31156
|
agentDisplayName: v || b,
|
|
31150
|
-
botAvatarNode: /* @__PURE__ */ g(
|
|
31157
|
+
botAvatarNode: /* @__PURE__ */ g(Mk, { orbColors: t })
|
|
31151
31158
|
}) : Me ? /* @__PURE__ */ _("div", {
|
|
31152
31159
|
style: {
|
|
31153
31160
|
flex: 1,
|
|
@@ -31188,7 +31195,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31188
31195
|
padding: "28px 24px"
|
|
31189
31196
|
},
|
|
31190
31197
|
children: [
|
|
31191
|
-
/* @__PURE__ */ g(
|
|
31198
|
+
/* @__PURE__ */ g(Ok, {
|
|
31192
31199
|
size: 94,
|
|
31193
31200
|
orbColors: t
|
|
31194
31201
|
}),
|
|
@@ -31279,7 +31286,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31279
31286
|
zIndex: 1,
|
|
31280
31287
|
padding: oe ? "6px 0 0" : "12px 0 0"
|
|
31281
31288
|
},
|
|
31282
|
-
children: /* @__PURE__ */ g(
|
|
31289
|
+
children: /* @__PURE__ */ g(GD, {
|
|
31283
31290
|
input: x,
|
|
31284
31291
|
setInput: S,
|
|
31285
31292
|
onSubmit: C,
|
|
@@ -31329,7 +31336,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31329
31336
|
]
|
|
31330
31337
|
});
|
|
31331
31338
|
}
|
|
31332
|
-
function
|
|
31339
|
+
function Fk() {
|
|
31333
31340
|
let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: ee, callConnectedAt: te, isCallMuted: ne, webRTCError: re, language: E, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: me, acceptCall: he, rejectCall: ge, endWebRTCCall: _e, toggleCallMute: ve, dismissCallError: ye, startTyping: be, stopTyping: xe, updateTypingDraft: Se, getVisitorChatHistory: Ce, getVisitorChatThread: we, resumeChat: Te, isSessionRestoring: Ee, openToChatCounter: De, voiceEndCounter: Oe } = Ln();
|
|
31334
31341
|
c(() => {
|
|
31335
31342
|
try {
|
|
@@ -31347,7 +31354,7 @@ function Pk() {
|
|
|
31347
31354
|
}, Fe = {
|
|
31348
31355
|
...ke.features || {},
|
|
31349
31356
|
...Ae.features || {}
|
|
31350
|
-
}, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He =
|
|
31357
|
+
}, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He = Ck(Re ?? Ne.chatBgColors), Ue = O.logo || O.logoUrl || null, We = E || "en", Ge = ke.recommendations?.[We] || [], Ke = (Ae.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
31351
31358
|
id: e.key || `qr-${t}`,
|
|
31352
31359
|
label: e.label,
|
|
31353
31360
|
message: e.label,
|
|
@@ -31611,7 +31618,7 @@ function Pk() {
|
|
|
31611
31618
|
onWheel: (e) => e.stopPropagation(),
|
|
31612
31619
|
onTouchMove: (e) => e.stopPropagation(),
|
|
31613
31620
|
children: [
|
|
31614
|
-
A === "entry_prompt" && /* @__PURE__ */ g(
|
|
31621
|
+
A === "entry_prompt" && /* @__PURE__ */ g(kk, {
|
|
31615
31622
|
copy: Ze,
|
|
31616
31623
|
orbColors: Re,
|
|
31617
31624
|
primaryColor: ze,
|
|
@@ -31694,13 +31701,13 @@ function Pk() {
|
|
|
31694
31701
|
children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
|
|
31695
31702
|
})]
|
|
31696
31703
|
})]
|
|
31697
|
-
}), /* @__PURE__ */ g(
|
|
31704
|
+
}), /* @__PURE__ */ g(Ok, {
|
|
31698
31705
|
size: 50,
|
|
31699
31706
|
orbColors: Re,
|
|
31700
31707
|
onClick: T && Dt ? Lt : Ie ? Kt : Jt
|
|
31701
31708
|
})]
|
|
31702
31709
|
}),
|
|
31703
|
-
A === "connection_modal" && /* @__PURE__ */ g(
|
|
31710
|
+
A === "connection_modal" && /* @__PURE__ */ g(Ak, {
|
|
31704
31711
|
copy: Ze,
|
|
31705
31712
|
orbColors: Re,
|
|
31706
31713
|
primaryColor: ze,
|
|
@@ -31710,7 +31717,7 @@ function Pk() {
|
|
|
31710
31717
|
isMobile: Nt,
|
|
31711
31718
|
isClosing: kt
|
|
31712
31719
|
}),
|
|
31713
|
-
A === "voice_mode" && /* @__PURE__ */ g(
|
|
31720
|
+
A === "voice_mode" && /* @__PURE__ */ g(jk, {
|
|
31714
31721
|
orbColors: Re,
|
|
31715
31722
|
onEnterChat: Jt,
|
|
31716
31723
|
onEndChat: Yt,
|
|
@@ -31723,7 +31730,7 @@ function Pk() {
|
|
|
31723
31730
|
onMessageSync: oe,
|
|
31724
31731
|
voiceEndCounter: Oe
|
|
31725
31732
|
}, "voice"),
|
|
31726
|
-
A === "call_screen" && /* @__PURE__ */ g(
|
|
31733
|
+
A === "call_screen" && /* @__PURE__ */ g(cO, {
|
|
31727
31734
|
incomingCall: w,
|
|
31728
31735
|
activeCallId: T,
|
|
31729
31736
|
callConnectionState: ee,
|
|
@@ -31742,7 +31749,7 @@ function Pk() {
|
|
|
31742
31749
|
orbColors: Re,
|
|
31743
31750
|
chatHistory: r
|
|
31744
31751
|
}),
|
|
31745
|
-
A === "text_chat" && /* @__PURE__ */ g(
|
|
31752
|
+
A === "text_chat" && /* @__PURE__ */ g(Pk, {
|
|
31746
31753
|
isClosing: kt,
|
|
31747
31754
|
copy: Ze,
|
|
31748
31755
|
orbColors: Re,
|
|
@@ -31807,7 +31814,7 @@ function Pk() {
|
|
|
31807
31814
|
}
|
|
31808
31815
|
//#endregion
|
|
31809
31816
|
//#region src/components/ErrorBoundary.jsx
|
|
31810
|
-
var
|
|
31817
|
+
var Ik = class extends e.Component {
|
|
31811
31818
|
constructor(e) {
|
|
31812
31819
|
super(e), this.state = { hasError: !1 };
|
|
31813
31820
|
}
|
|
@@ -31822,4 +31829,4 @@ var Fk = class extends e.Component {
|
|
|
31822
31829
|
}
|
|
31823
31830
|
};
|
|
31824
31831
|
//#endregion
|
|
31825
|
-
export {
|
|
31832
|
+
export { tO as AnimatedOrb, Ik as ErrorBoundary, Nr as FlowEngageProvider, Fk as FlowEngageWidget, Ln as useFlowEngage };
|