@flowengage/react-chatbot 5.0.30 → 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.
@@ -26596,7 +26596,20 @@ function HD({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
26596
26596
  }
26597
26597
  //#endregion
26598
26598
  //#region src/components/MessageList.jsx
26599
- function UD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: o = null, agentDisplayName: s = "Agent", botAvatarNode: l = null }) {
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 }) {
26600
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) => {
26601
26614
  if (!e) return "just now";
26602
26615
  let t = /* @__PURE__ */ new Date(), n = new Date(e), r = Math.max(0, Math.floor((t - n) / 1e3));
@@ -26937,7 +26950,8 @@ function UD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
26937
26950
  });
26938
26951
  })() : r ? /* @__PURE__ */ g("div", {
26939
26952
  className: "flowengage-message-content fe-bot-message",
26940
- dangerouslySetInnerHTML: { __html: ND(e.message) }
26953
+ dangerouslySetInnerHTML: { __html: ND(e.message) },
26954
+ onClick: UD
26941
26955
  }) : /* @__PURE__ */ g("div", {
26942
26956
  style: { whiteSpace: n || c ? "normal" : "pre-wrap" },
26943
26957
  children: e.message
@@ -27137,7 +27151,7 @@ function UD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27137
27151
  }
27138
27152
  //#endregion
27139
27153
  //#region src/components/ChatInput.jsx
27140
- function WD({ 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" }) {
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" }) {
27141
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;
27142
27156
  return /* @__PURE__ */ _("div", {
27143
27157
  style: {
@@ -27477,7 +27491,7 @@ function WD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27477
27491
  }
27478
27492
  //#endregion
27479
27493
  //#region src/components/StatusBanners.jsx
27480
- function GD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
27494
+ function KD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
27481
27495
  return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
27482
27496
  style: {
27483
27497
  margin: "0 20px 10px",
@@ -27536,13 +27550,13 @@ function GD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
27536
27550
  }
27537
27551
  //#endregion
27538
27552
  //#region src/components/AnimatedOrb.jsx
27539
- var KD = [
27553
+ var qD = [
27540
27554
  "#135bd8",
27541
27555
  "#ef334b",
27542
27556
  "#ffbd2e"
27543
27557
  ];
27544
- function qD(e) {
27545
- return !Array.isArray(e) || e.length === 0 ? KD : e.length === 1 ? [
27558
+ function JD(e) {
27559
+ return !Array.isArray(e) || e.length === 0 ? qD : e.length === 1 ? [
27546
27560
  e[0],
27547
27561
  e[0],
27548
27562
  e[0]
@@ -27556,14 +27570,14 @@ function qD(e) {
27556
27570
  e[2]
27557
27571
  ];
27558
27572
  }
27559
- var JD = {
27573
+ var YD = {
27560
27574
  idle: 3,
27561
27575
  listening: .75,
27562
27576
  speaking: 1.4,
27563
27577
  muted: .75,
27564
27578
  error: .08
27565
27579
  };
27566
- function YD(e) {
27580
+ function XD(e) {
27567
27581
  if (!e || typeof e != "string") return [
27568
27582
  0,
27569
27583
  0,
@@ -27576,14 +27590,14 @@ function YD(e) {
27576
27590
  parseInt(n.slice(4, 6), 16) / 255
27577
27591
  ];
27578
27592
  }
27579
- function XD(e, t) {
27593
+ function ZD(e, t) {
27580
27594
  if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
27581
27595
  if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
27582
27596
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
27583
27597
  return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
27584
27598
  }
27585
- var ZD = "\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", QD = "\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";
27586
- function $D(e, t, n) {
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) {
27587
27601
  let r = (t, n) => {
27588
27602
  let r = e.createShader(t);
27589
27603
  return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
@@ -27592,10 +27606,10 @@ function $D(e, t, n) {
27592
27606
  let o = e.createProgram();
27593
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);
27594
27608
  }
27595
- function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
27596
- let [s, l, u] = qD(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(JD[t] ?? .35);
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);
27597
27611
  c(() => {
27598
- h.current = JD[t] ?? .35;
27612
+ h.current = YD[t] ?? .35;
27599
27613
  }, [t]), c(() => {
27600
27614
  let t = m.current;
27601
27615
  if (!t) return;
@@ -27612,7 +27626,7 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27612
27626
  console.warn("[AnimatedOrb] WebGL unavailable.");
27613
27627
  return;
27614
27628
  }
27615
- let i = $D(r, ZD, QD);
27629
+ let i = eO(r, QD, $D);
27616
27630
  if (!i) {
27617
27631
  console.error("[AnimatedOrb] WebGL program failed to compile/link");
27618
27632
  return;
@@ -27642,7 +27656,7 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27642
27656
  c2: r.getUniformLocation(i, "u_c2"),
27643
27657
  c3: r.getUniformLocation(i, "u_c3")
27644
27658
  };
27645
- r.uniform3fv(c.c1, YD(s)), r.uniform3fv(c.c2, YD(l)), r.uniform3fv(c.c3, YD(u)), r.viewport(0, 0, t.width, t.height);
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);
27646
27660
  let d = performance.now(), f, p = (e) => {
27647
27661
  r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
27648
27662
  };
@@ -27673,7 +27687,7 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27673
27687
  position: "absolute",
27674
27688
  inset: -10,
27675
27689
  borderRadius: "50%",
27676
- background: `radial-gradient(circle, ${XD(s, .18)} 0%, transparent 70%)`,
27690
+ background: `radial-gradient(circle, ${ZD(s, .18)} 0%, transparent 70%)`,
27677
27691
  pointerEvents: "none"
27678
27692
  },
27679
27693
  animate: { opacity: [.3, .75] },
@@ -27751,17 +27765,17 @@ function eO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27751
27765
  }
27752
27766
  //#endregion
27753
27767
  //#region src/components/CallScreen.jsx
27754
- var tO = "\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";
27755
- function nO(e) {
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) {
27756
27770
  let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
27757
27771
  return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
27758
27772
  }
27759
- function rO(e) {
27773
+ function iO(e) {
27760
27774
  if (!e || typeof e != "string") return "#1a1a1a";
27761
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;
27762
27776
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
27763
27777
  }
27764
- function iO(e, t) {
27778
+ function aO(e, t) {
27765
27779
  let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
27766
27780
  return n.length === 1 ? [
27767
27781
  `radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
@@ -27778,8 +27792,8 @@ function iO(e, t) {
27778
27792
  "#f7f8fa"
27779
27793
  ].join(", ");
27780
27794
  }
27781
- function aO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
27782
- let i = (t || "A")[0].toUpperCase(), a = rO(r), o = n > 48 ? {
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 ? {
27783
27797
  boxShadow: `0 0 0 3px ${r}44`,
27784
27798
  border: "3px solid rgba(255,255,255,0.15)"
27785
27799
  } : { border: `1.5px solid ${r}55` };
@@ -27816,7 +27830,7 @@ function aO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
27816
27830
  children: i
27817
27831
  });
27818
27832
  }
27819
- function oO(e) {
27833
+ function sO(e) {
27820
27834
  let t = p(null), n = o(() => {
27821
27835
  if (!t.current) return;
27822
27836
  let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
@@ -27863,8 +27877,8 @@ function oO(e) {
27863
27877
  n
27864
27878
  ]), c(() => () => n(), [n]), n;
27865
27879
  }
27866
- function sO({ 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 = [] }) {
27867
- let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = oO(!!e), S = async () => {
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 () => {
27868
27882
  x(), await c();
27869
27883
  }, C = async () => {
27870
27884
  x(), await l();
@@ -27876,14 +27890,14 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
27876
27890
  flexDirection: "column",
27877
27891
  borderRadius: "inherit",
27878
27892
  overflow: "hidden",
27879
- background: iO(h, m),
27893
+ background: aO(h, m),
27880
27894
  animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
27881
27895
  };
27882
27896
  if (b === "incoming") {
27883
27897
  let e = Array.isArray(h) && h.length > 0 ? h : [m];
27884
27898
  return /* @__PURE__ */ _("div", {
27885
27899
  style: ee,
27886
- children: [/* @__PURE__ */ g("style", { children: tO }), /* @__PURE__ */ _("div", {
27900
+ children: [/* @__PURE__ */ g("style", { children: nO }), /* @__PURE__ */ _("div", {
27887
27901
  style: {
27888
27902
  flex: 1,
27889
27903
  display: "flex",
@@ -27914,7 +27928,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
27914
27928
  width: "96px",
27915
27929
  height: "96px",
27916
27930
  borderRadius: "50%",
27917
- background: `radial-gradient(circle, rgba(${nO(e[0])},0.2) 0%, transparent 70%)`,
27931
+ background: `radial-gradient(circle, rgba(${rO(e[0])},0.2) 0%, transparent 70%)`,
27918
27932
  filter: "blur(10px)",
27919
27933
  zIndex: 0
27920
27934
  } }),
@@ -27931,7 +27945,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
27931
27945
  animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
27932
27946
  zIndex: 1
27933
27947
  } }, n)),
27934
- /* @__PURE__ */ g(aO, {
27948
+ /* @__PURE__ */ g(oO, {
27935
27949
  headshot: o,
27936
27950
  name: y,
27937
27951
  size: 82,
@@ -28069,7 +28083,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28069
28083
  }
28070
28084
  return b === "connecting" ? /* @__PURE__ */ _("div", {
28071
28085
  style: ee,
28072
- children: [/* @__PURE__ */ g("style", { children: tO }), /* @__PURE__ */ _("div", {
28086
+ children: [/* @__PURE__ */ g("style", { children: nO }), /* @__PURE__ */ _("div", {
28073
28087
  style: {
28074
28088
  flex: 1,
28075
28089
  display: "flex",
@@ -28079,7 +28093,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28079
28093
  gap: "24px"
28080
28094
  },
28081
28095
  children: [
28082
- /* @__PURE__ */ g(aO, {
28096
+ /* @__PURE__ */ g(oO, {
28083
28097
  headshot: o,
28084
28098
  name: y,
28085
28099
  size: 64,
@@ -28106,7 +28120,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28106
28120
  }) : /* @__PURE__ */ _("div", {
28107
28121
  style: ee,
28108
28122
  children: [
28109
- /* @__PURE__ */ g("style", { children: tO }),
28123
+ /* @__PURE__ */ g("style", { children: nO }),
28110
28124
  /* @__PURE__ */ _("div", {
28111
28125
  style: {
28112
28126
  display: "flex",
@@ -28152,7 +28166,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28152
28166
  children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
28153
28167
  })
28154
28168
  }),
28155
- /* @__PURE__ */ g(eO, {
28169
+ /* @__PURE__ */ g(tO, {
28156
28170
  colors: h,
28157
28171
  size: 36,
28158
28172
  voiceState: w
@@ -28203,7 +28217,7 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28203
28217
  gap: "16px",
28204
28218
  padding: "0 24px 16px"
28205
28219
  },
28206
- children: [/* @__PURE__ */ g(aO, {
28220
+ children: [/* @__PURE__ */ g(oO, {
28207
28221
  headshot: o,
28208
28222
  name: y,
28209
28223
  size: 116,
@@ -28292,9 +28306,9 @@ function sO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28292
28306
  ]
28293
28307
  });
28294
28308
  }
28295
- function cO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
28309
+ function lO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
28296
28310
  let u = e || n || "Agent";
28297
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: tO }), /* @__PURE__ */ _("div", {
28311
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: nO }), /* @__PURE__ */ _("div", {
28298
28312
  role: "button",
28299
28313
  tabIndex: 0,
28300
28314
  onClick: c,
@@ -28351,7 +28365,7 @@ function cO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28351
28365
  borderRadius: "50%",
28352
28366
  border: `1.5px solid ${l}55`
28353
28367
  } }),
28354
- /* @__PURE__ */ g(aO, {
28368
+ /* @__PURE__ */ g(oO, {
28355
28369
  headshot: t,
28356
28370
  name: u,
28357
28371
  size: 38,
@@ -28471,7 +28485,7 @@ function cO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28471
28485
  }
28472
28486
  //#endregion
28473
28487
  //#region src/utils/voicePriorContext.js
28474
- function lO(e, t = {}) {
28488
+ function uO(e, t = {}) {
28475
28489
  let n = t.maxChars ?? 4500;
28476
28490
  if (!Array.isArray(e) || e.length === 0) return "";
28477
28491
  let r = [];
@@ -28488,7 +28502,7 @@ function lO(e, t = {}) {
28488
28502
  }
28489
28503
  //#endregion
28490
28504
  //#region src/utils/actionQueue.js
28491
- var uO = {
28505
+ var dO = {
28492
28506
  wordsSoFar: 0,
28493
28507
  speechStartTime: 0,
28494
28508
  isSpeaking: !1,
@@ -28497,35 +28511,35 @@ var uO = {
28497
28511
  lastHighlightId: null,
28498
28512
  isVoiceMode: !1
28499
28513
  };
28500
- function dO() {
28501
- uO.timers.forEach(clearTimeout), uO.wordsSoFar = 0, uO.speechStartTime = 0, uO.isSpeaking = !1, uO.items = [], uO.timers = [], uO.lastHighlightId = null;
28514
+ function fO() {
28515
+ dO.timers.forEach(clearTimeout), dO.wordsSoFar = 0, dO.speechStartTime = 0, dO.isSpeaking = !1, dO.items = [], dO.timers = [], dO.lastHighlightId = null;
28502
28516
  }
28503
28517
  //#endregion
28504
28518
  //#region src/utils/highlightEngine.js
28505
- var fO = 80;
28506
- function pO(e) {
28519
+ var pO = 80;
28520
+ function mO(e) {
28507
28521
  requestAnimationFrame(() => {
28508
- let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = fO, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
28522
+ let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = pO, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
28509
28523
  window.scrollTo({
28510
28524
  top: Math.max(0, a),
28511
28525
  behavior: "smooth"
28512
28526
  });
28513
28527
  });
28514
28528
  }
28515
- function mO(e) {
28529
+ function hO(e) {
28516
28530
  if (!e || e.hasAttribute("data-fe-highlighted")) return;
28517
- hO(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), pO(e);
28531
+ gO(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), mO(e);
28518
28532
  let t = e.style.cssText;
28519
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";
28520
28534
  }
28521
- function hO() {
28535
+ function gO() {
28522
28536
  let e = document.querySelector("[data-fe-highlighted]");
28523
28537
  e && (e.style.cssText = e.getAttribute("data-fe-orig-style") || "", e.removeAttribute("data-fe-highlighted"), e.removeAttribute("data-fe-orig-style"));
28524
28538
  }
28525
28539
  //#endregion
28526
28540
  //#region src/utils/voiceActionVisuals.js
28527
28541
  var Q = "fe-vv";
28528
- function gO() {
28542
+ function _O() {
28529
28543
  if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
28530
28544
  let e = `
28531
28545
  /* ── Action toast ───────────────────────────────────────────────────────────── */
@@ -28670,14 +28684,14 @@ function gO() {
28670
28684
  `, t = document.createElement("style");
28671
28685
  t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
28672
28686
  }
28673
- var _O = null, vO = null;
28674
- function yO() {
28675
- return (!_O || !_O.isConnected) && (_O = document.createElement("div"), _O.id = `${Q}-toast`, document.body.appendChild(_O)), _O;
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;
28676
28690
  }
28677
- function bO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28691
+ function xO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28678
28692
  if (typeof document > "u") return;
28679
- gO(), vO &&= (clearTimeout(vO), null);
28680
- let i = yO();
28693
+ _O(), yO &&= (clearTimeout(yO), null);
28694
+ let i = bO();
28681
28695
  if (i.innerHTML = "", n) {
28682
28696
  let e = document.createElement("span");
28683
28697
  e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
@@ -28686,82 +28700,82 @@ function bO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28686
28700
  e.className = `${Q}-spin`, i.appendChild(e);
28687
28701
  }
28688
28702
  let a = document.createElement("span");
28689
- a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (vO = setTimeout(() => xO(), r));
28690
- }
28691
- function xO(e = 0) {
28692
- _O && (e > 0 ? vO = setTimeout(() => {
28693
- _O && _O.classList.remove(`${Q}-show`);
28694
- }, 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));
28695
28704
  }
28696
- var SO = null, CO = [];
28697
- function wO() {
28698
- return (!SO || !SO.isConnected) && (SO = document.createElement("div"), SO.id = `${Q}-bar`, document.body.appendChild(SO)), SO;
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`));
28699
28709
  }
28710
+ var CO = null, wO = [];
28700
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() {
28701
28715
  if (typeof document > "u") return;
28702
- gO(), CO.forEach(clearTimeout), CO = [];
28703
- let e = wO();
28716
+ _O(), wO.forEach(clearTimeout), wO = [];
28717
+ let e = TO();
28704
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";
28705
28719
  let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
28706
28720
  for (let [e, r] of t) {
28707
28721
  let t = n, i = e, a = r;
28708
- CO.push(setTimeout(() => {
28709
- SO && (SO.style.transition = a, SO.style.width = `${i}%`);
28722
+ wO.push(setTimeout(() => {
28723
+ CO && (CO.style.transition = a, CO.style.width = `${i}%`);
28710
28724
  }, t)), n += 800;
28711
28725
  }
28712
28726
  }
28713
- function EO() {
28714
- SO && (CO.forEach(clearTimeout), CO = [], SO.style.transition = "width 0.2s ease", SO.style.width = "100%", CO.push(setTimeout(() => {
28715
- SO && (SO.style.transition = "opacity 0.35s ease", SO.style.opacity = "0", CO.push(setTimeout(() => {
28716
- SO && (SO.style.width = "0%", SO.classList.remove(`${Q}-bar-active`));
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`));
28717
28731
  }, 380)));
28718
28732
  }, 220)));
28719
28733
  }
28720
- function DO() {
28734
+ function OO() {
28721
28735
  typeof document > "u" || document.querySelectorAll(`.${Q}-field-active, .${Q}-field-filled`).forEach((e) => e.classList.remove(`${Q}-field-active`, `${Q}-field-filled`));
28722
28736
  }
28723
- function OO(e) {
28724
- !e || typeof document > "u" || (gO(), DO(), e.classList.add(`${Q}-field-active`));
28725
- }
28726
28737
  function kO(e) {
28738
+ !e || typeof document > "u" || (_O(), OO(), e.classList.add(`${Q}-field-active`));
28739
+ }
28740
+ function AO(e) {
28727
28741
  e && (e.classList.remove(`${Q}-field-active`), e.classList.add(`${Q}-field-filled`), setTimeout(() => {
28728
28742
  e.isConnected && e.classList.remove(`${Q}-field-filled`);
28729
28743
  }, 1400));
28730
28744
  }
28731
- var AO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
28745
+ var jO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
28732
28746
  <filter id="${Q}-csh">
28733
28747
  <feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
28734
28748
  </filter>
28735
28749
  <path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
28736
28750
  fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
28737
28751
  filter="url(#${Q}-csh)"/>
28738
- </svg>`, jO = null, MO = !1;
28739
- function NO() {
28740
- return (!jO || !jO.isConnected) && (jO = document.createElement("div"), jO.id = `${Q}-cursor`, jO.innerHTML = AO, document.body.appendChild(jO), MO = !1), jO;
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;
28741
28755
  }
28742
- async function PO(e) {
28756
+ async function FO(e) {
28743
28757
  if (typeof document > "u" || !e) return;
28744
- gO();
28758
+ _O();
28745
28759
  let t;
28746
28760
  try {
28747
28761
  t = e.getBoundingClientRect();
28748
28762
  } catch {
28749
28763
  return;
28750
28764
  }
28751
- let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = NO();
28752
- MO ||= (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 RO(360);
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);
28753
28767
  }
28754
- function FO(e = !1) {
28755
- jO && (e ? (jO.classList.remove(`${Q}-cursor-visible`), MO = !1) : (jO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
28756
- MO = !1;
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;
28757
28771
  }, 250)));
28758
28772
  }
28759
- async function IO(e) {
28760
- jO && (jO.classList.add(`${Q}-cursor-click`), await RO(280), jO.classList.remove(`${Q}-cursor-click`));
28773
+ async function LO(e) {
28774
+ MO && (MO.classList.add(`${Q}-cursor-click`), await zO(280), MO.classList.remove(`${Q}-cursor-click`));
28761
28775
  }
28762
- function LO(e) {
28776
+ function RO(e) {
28763
28777
  if (!e || typeof document > "u") return;
28764
- gO();
28778
+ _O();
28765
28779
  let t;
28766
28780
  try {
28767
28781
  t = e.getBoundingClientRect();
@@ -28787,7 +28801,7 @@ function LO(e) {
28787
28801
  a.remove(), e.style.position = n, e.style.overflow = r;
28788
28802
  }, 650);
28789
28803
  }
28790
- function RO(e) {
28804
+ function zO(e) {
28791
28805
  return new Promise((t) => setTimeout(t, e));
28792
28806
  }
28793
28807
  //#endregion
@@ -28795,42 +28809,42 @@ function RO(e) {
28795
28809
  function $(...e) {
28796
28810
  Rn() && console.log("[FlowEngage:voice-tools]", ...e);
28797
28811
  }
28798
- function zO(e) {
28812
+ function BO(e) {
28799
28813
  return new Promise((t) => setTimeout(t, e));
28800
28814
  }
28801
- var BO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
28802
- function VO(e) {
28815
+ var VO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
28816
+ function HO(e) {
28803
28817
  if (!e || typeof e.closest != "function") return !1;
28804
28818
  try {
28805
- return !!e.closest(BO);
28819
+ return !!e.closest(VO);
28806
28820
  } catch {
28807
28821
  return !1;
28808
28822
  }
28809
28823
  }
28810
- function HO(e) {
28824
+ function UO(e) {
28811
28825
  try {
28812
28826
  let t = e.ownerDocument?.defaultView;
28813
28827
  if (t) return t.getComputedStyle(e);
28814
28828
  } catch {}
28815
28829
  return window.getComputedStyle(e);
28816
28830
  }
28817
- function UO(e) {
28831
+ function WO(e) {
28818
28832
  let t = /* @__PURE__ */ new Set();
28819
28833
  function n(r) {
28820
28834
  if (!r || t.has(r)) return;
28821
28835
  t.add(r), e(r);
28822
28836
  let i = r.querySelectorAll("iframe");
28823
- for (let e of i) if (!VO(e)) try {
28837
+ for (let e of i) if (!HO(e)) try {
28824
28838
  let t = e.contentDocument;
28825
28839
  t && n(t);
28826
28840
  } catch {}
28827
28841
  }
28828
28842
  typeof document < "u" && n(document);
28829
28843
  }
28830
- function WO(e) {
28844
+ function GO(e) {
28831
28845
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
28832
28846
  }
28833
- function GO(e) {
28847
+ function KO(e) {
28834
28848
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
28835
28849
  if (n) {
28836
28850
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -28838,42 +28852,42 @@ function GO(e) {
28838
28852
  let e = t.getElementById(n);
28839
28853
  e?.textContent && r.push(e.textContent.trim());
28840
28854
  } catch {}
28841
- if (r.length) return WO(r.join(" "));
28855
+ if (r.length) return GO(r.join(" "));
28842
28856
  }
28843
- if (e.labels && e.labels.length) return WO(e.labels[0].textContent);
28857
+ if (e.labels && e.labels.length) return GO(e.labels[0].textContent);
28844
28858
  let r = e.id;
28845
28859
  if (r) try {
28846
28860
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
28847
- if (e) return WO(e.textContent);
28861
+ if (e) return GO(e.textContent);
28848
28862
  } catch {
28849
28863
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
28850
- if (e) return WO(e.textContent);
28864
+ if (e) return GO(e.textContent);
28851
28865
  }
28852
28866
  let i = e.previousElementSibling;
28853
28867
  for (let e = 0; e < 6 && i; e += 1) {
28854
- if (i.tagName === "LABEL") return WO(i.textContent);
28868
+ if (i.tagName === "LABEL") return GO(i.textContent);
28855
28869
  let e = (i.className || "").toString().toLowerCase();
28856
28870
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
28857
- let e = WO(i.textContent);
28871
+ let e = GO(i.textContent);
28858
28872
  if (e) return e;
28859
28873
  }
28860
28874
  i = i.previousElementSibling;
28861
28875
  }
28862
28876
  let a = e.parentElement;
28863
28877
  for (let e = 0; e < 5 && a; e += 1) {
28864
- if (a.tagName === "LABEL") return WO(a.textContent);
28878
+ if (a.tagName === "LABEL") return GO(a.textContent);
28865
28879
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
28866
- if (e?.textContent) return WO(e.textContent);
28880
+ if (e?.textContent) return GO(e.textContent);
28867
28881
  a = a.parentElement;
28868
28882
  }
28869
28883
  let o = e.getAttribute("aria-label");
28870
- return o ? WO(o) : null;
28884
+ return o ? GO(o) : null;
28871
28885
  }
28872
- function KO() {
28886
+ function qO() {
28873
28887
  let e = [];
28874
- return UO((t) => {
28888
+ return WO((t) => {
28875
28889
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
28876
- if (VO(e)) return !1;
28890
+ if (HO(e)) return !1;
28877
28891
  let t = (e.type || "").toLowerCase();
28878
28892
  if ([
28879
28893
  "hidden",
@@ -28882,32 +28896,32 @@ function KO() {
28882
28896
  "image"
28883
28897
  ].includes(t) || e.disabled || e.readOnly) return !1;
28884
28898
  try {
28885
- let t = HO(e);
28899
+ let t = UO(e);
28886
28900
  if (t.display === "none" || t.visibility === "hidden") return !1;
28887
28901
  } catch {}
28888
28902
  return !0;
28889
28903
  }));
28890
28904
  }), e;
28891
28905
  }
28892
- function qO() {
28893
- return KO().map((e, t) => ({
28906
+ function JO() {
28907
+ return qO().map((e, t) => ({
28894
28908
  formIndex: 0,
28895
28909
  fieldIndex: t,
28896
28910
  tag: e.tagName,
28897
28911
  type: e.type || "text",
28898
28912
  name: e.name || null,
28899
28913
  id: e.id || null,
28900
- label: GO(e),
28914
+ label: KO(e),
28901
28915
  placeholder: e.placeholder || null
28902
28916
  }));
28903
28917
  }
28904
- function JO() {
28918
+ function YO() {
28905
28919
  let e = [];
28906
- return UO((t) => {
28920
+ return WO((t) => {
28907
28921
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
28908
- if (VO(e) || e.disabled) return !1;
28922
+ if (HO(e) || e.disabled) return !1;
28909
28923
  try {
28910
- let t = HO(e);
28924
+ let t = UO(e);
28911
28925
  if (t.display === "none" || t.visibility === "hidden") return !1;
28912
28926
  } catch {}
28913
28927
  return !0;
@@ -28919,15 +28933,15 @@ function JO() {
28919
28933
  type: e.type || e.tagName
28920
28934
  }));
28921
28935
  }
28922
- function YO(e) {
28936
+ function XO(e) {
28923
28937
  return String(e || "").toLowerCase().replace(/\u00a0/g, " ").replace(/\*/g, "").replace(/\s+/g, " ").trim();
28924
28938
  }
28925
- function XO(e) {
28926
- let t = YO(e);
28939
+ function ZO(e) {
28940
+ let t = XO(e);
28927
28941
  return t = t.replace(/\s+field\s*$/i, "").trim(), t;
28928
28942
  }
28929
- function ZO(e, t) {
28930
- let n = XO(t);
28943
+ function QO(e, t) {
28944
+ let n = ZO(t);
28931
28945
  if (!n) return 0;
28932
28946
  let r = (e.name || "").toLowerCase(), i = (e.id || "").toLowerCase();
28933
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;
@@ -28935,12 +28949,12 @@ function ZO(e, t) {
28935
28949
  e.name,
28936
28950
  e.id,
28937
28951
  e.placeholder,
28938
- GO(e),
28952
+ KO(e),
28939
28953
  e.getAttribute("aria-label"),
28940
28954
  e.getAttribute("title"),
28941
28955
  e.getAttribute("data-testid"),
28942
28956
  e.getAttribute("autocomplete")
28943
- ].filter(Boolean).map((e) => YO(e)), o = 0;
28957
+ ].filter(Boolean).map((e) => XO(e)), o = 0;
28944
28958
  for (let e of a) {
28945
28959
  if (!e) continue;
28946
28960
  if (e.includes(n) || n.includes(e)) {
@@ -28955,16 +28969,16 @@ function ZO(e, t) {
28955
28969
  }
28956
28970
  return o;
28957
28971
  }
28958
- var QO = 28;
28959
- function $O(e, t) {
28972
+ var $O = 28;
28973
+ function ek(e, t) {
28960
28974
  let n = null, r = 0;
28961
28975
  for (let i of e) {
28962
- let e = ZO(i, t);
28976
+ let e = QO(i, t);
28963
28977
  e > r && (r = e, n = i);
28964
28978
  }
28965
- return !n || r < QO ? null : n;
28979
+ return !n || r < $O ? null : n;
28966
28980
  }
28967
- function ek(e, t, n) {
28981
+ function tk(e, t, n) {
28968
28982
  let r = String(t || "").toLowerCase().trim(), i = String(n || "").trim();
28969
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;
28970
28984
  let a = null, o = 0;
@@ -28984,7 +28998,7 @@ function ek(e, t, n) {
28984
28998
  t.name,
28985
28999
  t.id,
28986
29000
  t.placeholder,
28987
- GO(t),
29001
+ KO(t),
28988
29002
  t.getAttribute("aria-label"),
28989
29003
  t.getAttribute("autocomplete")
28990
29004
  ].filter(Boolean).join(" ").toLowerCase();
@@ -28992,15 +29006,15 @@ function ek(e, t, n) {
28992
29006
  }
28993
29007
  return !a || o < 42 ? null : a;
28994
29008
  }
28995
- function tk(e) {
29009
+ function nk(e) {
28996
29010
  let t = String(e ?? "").trim();
28997
29011
  return t ? /^https?:\/\//i.test(t) ? !0 : /\.\w{2,}(\/|\s|$)/.test(t) : !1;
28998
29012
  }
28999
- function nk(e) {
29013
+ function rk(e) {
29000
29014
  let t = String(e ?? "").toLowerCase().trim();
29001
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;
29002
29016
  }
29003
- function rk(e) {
29017
+ function ik(e) {
29004
29018
  if (!e || e.tagName !== "INPUT" && e.tagName !== "TEXTAREA") return !1;
29005
29019
  let t = (e.type || "").toLowerCase();
29006
29020
  return ![
@@ -29012,22 +29026,22 @@ function rk(e) {
29012
29026
  "file"
29013
29027
  ].includes(t);
29014
29028
  }
29015
- function ik(e) {
29016
- if (!rk(e)) return !1;
29029
+ function ak(e) {
29030
+ if (!ik(e)) return !1;
29017
29031
  let t = (e.name || "").toLowerCase(), n = (e.id || "").toLowerCase(), r = [
29018
29032
  e.name,
29019
29033
  e.id,
29020
29034
  e.placeholder,
29021
- GO(e),
29035
+ KO(e),
29022
29036
  e.getAttribute("aria-label")
29023
29037
  ].filter(Boolean).join(" ").toLowerCase();
29024
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);
29025
29039
  }
29026
- function ak(e, t, n) {
29027
- let r = String(t ?? ""), i = String(n ?? ""), a = ck(e, r) || $O(e, r) || ek(e, r, i);
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);
29028
29042
  if (!a) return [];
29029
29043
  let o = new Set([a]);
29030
- if (tk(i) && nk(r)) for (let t of e) t !== a && ik(t) && o.add(t);
29044
+ if (nk(i) && rk(r)) for (let t of e) t !== a && ak(t) && o.add(t);
29031
29045
  let s = Array.from(o);
29032
29046
  return s.sort((e, t) => {
29033
29047
  if (e === t) return 0;
@@ -29035,7 +29049,7 @@ function ak(e, t, n) {
29035
29049
  return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
29036
29050
  }), s;
29037
29051
  }
29038
- function ok(e, t) {
29052
+ function sk(e, t) {
29039
29053
  try {
29040
29054
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
29041
29055
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -29050,17 +29064,17 @@ function ok(e, t) {
29050
29064
  return Infinity;
29051
29065
  }
29052
29066
  }
29053
- function sk(e) {
29067
+ function ck(e) {
29054
29068
  if (!e || typeof e != "string") return null;
29055
29069
  let t = null;
29056
- return UO((n) => {
29070
+ return WO((n) => {
29057
29071
  try {
29058
29072
  let r = n.getElementById(e);
29059
- r && !VO(r) && r.matches?.("input, select, textarea") && (t = r);
29073
+ r && !HO(r) && r.matches?.("input, select, textarea") && (t = r);
29060
29074
  } catch {}
29061
29075
  }), t;
29062
29076
  }
29063
- function ck(e, t) {
29077
+ function lk(e, t) {
29064
29078
  let n = String(t ?? "").trim();
29065
29079
  if (!n) return null;
29066
29080
  let r = n.match(/^name:\s*([\w.-]+)$/i);
@@ -29070,12 +29084,12 @@ function ck(e, t) {
29070
29084
  }
29071
29085
  let i = n.match(/^id:\s*([\w.-]+)$/i);
29072
29086
  if (i) {
29073
- let e = sk(i[1]);
29087
+ let e = ck(i[1]);
29074
29088
  if (e) return e;
29075
29089
  }
29076
29090
  let a = n.startsWith("#") ? n.slice(1) : n;
29077
29091
  if (/^[\w-]+$/.test(a)) {
29078
- let e = sk(a);
29092
+ let e = ck(a);
29079
29093
  if (e) return e;
29080
29094
  }
29081
29095
  let o = n.toLowerCase().replace(/\s+/g, " ");
@@ -29085,7 +29099,7 @@ function ck(e, t) {
29085
29099
  }
29086
29100
  return null;
29087
29101
  }
29088
- function lk(e, t) {
29102
+ function uk(e, t) {
29089
29103
  let n = String(t || "").toLowerCase().trim();
29090
29104
  if (!n) return 0;
29091
29105
  let r = [
@@ -29101,13 +29115,13 @@ function lk(e, t) {
29101
29115
  for (let e of i) r.includes(e) && (a += 1);
29102
29116
  return a / i.length * 92;
29103
29117
  }
29104
- function uk(e, t) {
29118
+ function dk(e, t) {
29105
29119
  let n = [];
29106
- UO((e) => {
29120
+ WO((e) => {
29107
29121
  n.push(...Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
29108
- if (VO(e) || e.disabled) return !1;
29122
+ if (HO(e) || e.disabled) return !1;
29109
29123
  try {
29110
- let t = HO(e);
29124
+ let t = UO(e);
29111
29125
  if (t.display === "none" || t.visibility === "hidden") return !1;
29112
29126
  } catch {}
29113
29127
  return !0;
@@ -29115,7 +29129,7 @@ function uk(e, t) {
29115
29129
  });
29116
29130
  let r = 0, i = n.map((t) => ({
29117
29131
  el: t,
29118
- s: lk(t, e)
29132
+ s: uk(t, e)
29119
29133
  }));
29120
29134
  for (let { s: e } of i) e > r && (r = e);
29121
29135
  if (r < 36) return null;
@@ -29125,14 +29139,14 @@ function uk(e, t) {
29125
29139
  if (o.length) {
29126
29140
  let e = a[0], t = Infinity;
29127
29141
  for (let n of a) for (let r of o) {
29128
- let i = ok(n, r);
29142
+ let i = sk(n, r);
29129
29143
  i < t && (t = i, e = n);
29130
29144
  }
29131
29145
  return e;
29132
29146
  }
29133
29147
  return a[0];
29134
29148
  }
29135
- function dk(e) {
29149
+ function fk(e) {
29136
29150
  if (e == null) return {};
29137
29151
  if (typeof e == "string") {
29138
29152
  let t = e.trim();
@@ -29145,8 +29159,8 @@ function dk(e) {
29145
29159
  }
29146
29160
  return e;
29147
29161
  }
29148
- function fk(e) {
29149
- let t = dk(e);
29162
+ function pk(e) {
29163
+ let t = fk(e);
29150
29164
  if (Array.isArray(t) && t.length > 0) {
29151
29165
  let e = t[0];
29152
29166
  if (e?.field_key != null || e?.fieldKey != null) return t.map((e) => ({
@@ -29174,7 +29188,7 @@ function fk(e) {
29174
29188
  value: e?.value ?? e?.Value
29175
29189
  })) : [];
29176
29190
  }
29177
- function pk(e) {
29191
+ function mk(e) {
29178
29192
  if (!e || typeof e != "string") return [];
29179
29193
  let t = e.trim();
29180
29194
  if (!t || /\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\b/i.test(t)) return [];
@@ -29193,7 +29207,7 @@ function pk(e) {
29193
29207
  }
29194
29208
  return [];
29195
29209
  }
29196
- function mk(e) {
29210
+ function hk(e) {
29197
29211
  if (!e || typeof e != "string") return [];
29198
29212
  let t = e.trim();
29199
29213
  if (!t) return [];
@@ -29229,17 +29243,17 @@ function mk(e) {
29229
29243
  }
29230
29244
  return n;
29231
29245
  }
29232
- function hk(e) {
29246
+ function gk(e) {
29233
29247
  if (!e || typeof e != "object") return null;
29234
29248
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
29235
29249
  return t == null ? null : String(t).trim() || null;
29236
29250
  }
29237
- function gk(e) {
29251
+ function _k(e) {
29238
29252
  if (!e || typeof e != "object") return null;
29239
29253
  let t = e.query ?? e.q ?? e.search ?? e.text ?? e.keywords;
29240
29254
  return t == null ? null : String(t).trim() || null;
29241
29255
  }
29242
- function _k(e, t, n) {
29256
+ function vk(e, t, n) {
29243
29257
  if (!n?.skipScroll) try {
29244
29258
  e.scrollIntoView({
29245
29259
  block: "center",
@@ -29294,7 +29308,7 @@ function _k(e, t, n) {
29294
29308
  } catch {}
29295
29309
  return !0;
29296
29310
  }
29297
- function vk() {
29311
+ function yk() {
29298
29312
  let e = {};
29299
29313
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
29300
29314
  if (t.id) return;
@@ -29309,11 +29323,11 @@ function vk() {
29309
29323
  e[r] = !0, t.id = r;
29310
29324
  });
29311
29325
  }
29312
- function yk(e) {
29326
+ function bk(e) {
29313
29327
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
29314
29328
  flowengage_navigate: async (n) => {
29315
29329
  $("flowengage_navigate ▶ raw parameters:", n);
29316
- let i = dk(n), a = hk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
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 : [];
29317
29331
  if ($("flowengage_navigate · coerced:", {
29318
29332
  url: a,
29319
29333
  sectionText: o,
@@ -29338,11 +29352,11 @@ function yk(e) {
29338
29352
  return $("flowengage_navigate ✖ blocked", e), e;
29339
29353
  }
29340
29354
  try {
29341
- bO(`Navigating to ${a}...`, { spinner: !0 }), TO(), dO(), hO();
29355
+ xO(`Navigating to ${a}...`, { spinner: !0 }), EO(), fO(), gO();
29342
29356
  try {
29343
29357
  let e = r ? r() : "";
29344
29358
  if (e && t) {
29345
- let n = lO([{
29359
+ let n = uO([{
29346
29360
  sender: "user",
29347
29361
  message: e
29348
29362
  }]);
@@ -29365,25 +29379,25 @@ function yk(e) {
29365
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.";
29366
29380
  } catch (e) {
29367
29381
  let t = `Navigation error: ${e?.message || String(e)}`;
29368
- return $("flowengage_navigate ✖", t), bO("Navigation failed", {
29382
+ return $("flowengage_navigate ✖", t), xO("Navigation failed", {
29369
29383
  spinner: !1,
29370
29384
  icon: "⚠️",
29371
29385
  duration: 1800
29372
29386
  }), t;
29373
29387
  } finally {
29374
- EO(), xO(900);
29388
+ DO(), SO(900);
29375
29389
  }
29376
29390
  },
29377
29391
  flowengage_highlight: async (e) => {
29378
29392
  $("flowengage_highlight ▶", e);
29379
- let t = dk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29380
- vk();
29393
+ let t = fk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29394
+ yk();
29381
29395
  let i = dr(n || null, r || null);
29382
- return !i && r && (await new Promise((e) => setTimeout(e, 500)), vk(), i = dr(null, r)), i ? (mO(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.`);
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.`);
29383
29397
  },
29384
29398
  flowengage_read_content: async (e) => {
29385
29399
  $("flowengage_read_content ▶", e);
29386
- let t = dk(e), n = t?.section_text || t?.sectionText || "";
29400
+ let t = fk(e), n = t?.section_text || t?.sectionText || "";
29387
29401
  try {
29388
29402
  let e = "";
29389
29403
  if (n) {
@@ -29406,11 +29420,11 @@ function yk(e) {
29406
29420
  },
29407
29421
  flowengage_search: async (e) => {
29408
29422
  $("flowengage_search ▶", e);
29409
- let r = gk(dk(e));
29423
+ let r = _k(fk(e));
29410
29424
  if ($("flowengage_search · query:", r, "siteId:", t, "apiBase:", n || "(empty)"), !r) return $("flowengage_search ✖ missing query"), "Missing query parameter.";
29411
29425
  if (!t) return $("flowengage_search ✖ no siteId"), "Site is not configured for search.";
29412
29426
  if (!n) return $("flowengage_search ✖ no api base"), "API base URL is missing; cannot search.";
29413
- bO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
29427
+ xO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
29414
29428
  try {
29415
29429
  let e = `${n}/api/site-tools/search`;
29416
29430
  $("flowengage_search → POST", e);
@@ -29433,12 +29447,12 @@ function yk(e) {
29433
29447
  let t = `Search error: ${e.message || "network"}`;
29434
29448
  return $("flowengage_search ✖", t), t;
29435
29449
  } finally {
29436
- xO(600);
29450
+ SO(600);
29437
29451
  }
29438
29452
  },
29439
29453
  flowengage_page_content: async (e) => {
29440
29454
  $("flowengage_page_content ▶", e);
29441
- let r = dk(e), i = r?.url || r?.page_url || "";
29455
+ let r = fk(e), i = r?.url || r?.page_url || "";
29442
29456
  if ($("flowengage_page_content · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("flowengage_page_content ✖ missing url"), "Missing url parameter.";
29443
29457
  if (!t) return $("flowengage_page_content ✖ no siteId"), "Site is not configured.";
29444
29458
  if (!n) return $("flowengage_page_content ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -29470,7 +29484,7 @@ function yk(e) {
29470
29484
  },
29471
29485
  flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
29472
29486
  flowengage_list_forms: async () => {
29473
- let e = qO(), t = JO();
29487
+ let e = JO(), t = YO();
29474
29488
  return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
29475
29489
  fields: e,
29476
29490
  buttons: t,
@@ -29479,52 +29493,52 @@ function yk(e) {
29479
29493
  },
29480
29494
  flowengage_fill_form: async (e) => {
29481
29495
  try {
29482
- $("flowengage_fill_form ▶ raw:", e), DO();
29483
- let t = fk(e);
29496
+ $("flowengage_fill_form ▶ raw:", e), OO();
29497
+ let t = pk(e);
29484
29498
  if (!t.length && r) {
29485
- let e = r(), n = pk(e);
29486
- n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = mk(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = 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);
29487
29501
  }
29488
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.";
29489
29503
  let n = [];
29490
29504
  for (let e of t) {
29491
29505
  let t = e?.field_key ?? e?.fieldKey, r = e?.value;
29492
29506
  if (t == null || r == null) continue;
29493
- bO(`Filling ${String(t)}...`, { spinner: !0 });
29494
- let a = KO(), o = ak(a, String(t), r);
29507
+ xO(`Filling ${String(t)}...`, { spinner: !0 });
29508
+ let a = qO(), o = ok(a, String(t), r);
29495
29509
  if (o.length) {
29496
- for (let [e, t] of o.entries()) OO(t), await PO(t), _k(t, r, { skipScroll: e > 0 }), kO(t), await zO(120);
29510
+ for (let [e, t] of o.entries()) kO(t), await FO(t), vk(t, r, { skipScroll: e > 0 }), AO(t), await BO(120);
29497
29511
  i = o, n.push(String(t));
29498
29512
  continue;
29499
29513
  }
29500
- let s = ck(a, String(t));
29501
- s ||= $O(a, String(t)), s ||= ek(a, String(t), r), s && (OO(s), await PO(s), _k(s, r), kO(s), await zO(120), i = [s], n.push(String(t)));
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)));
29502
29516
  }
29503
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.";
29504
29518
  let a = `OK_FILLED: ${n.join(", ")}`;
29505
- return $("flowengage_fill_form ✓", a), bO("Form filled", {
29519
+ return $("flowengage_fill_form ✓", a), xO("Form filled", {
29506
29520
  spinner: !1,
29507
29521
  icon: "✅",
29508
29522
  duration: 1100
29509
29523
  }), a;
29510
29524
  } catch (e) {
29511
29525
  let t = `flowengage_fill_form error: ${e?.message || String(e)}`;
29512
- return $("flowengage_fill_form ✖", t), bO("Failed to fill form", {
29526
+ return $("flowengage_fill_form ✖", t), xO("Failed to fill form", {
29513
29527
  spinner: !1,
29514
29528
  icon: "⚠️",
29515
29529
  duration: 1800
29516
29530
  }), t;
29517
29531
  } finally {
29518
- FO(), DO(), xO(700);
29532
+ IO(), OO(), SO(700);
29519
29533
  }
29520
29534
  },
29521
29535
  flowengage_click_button: async (e) => {
29522
- let t = dk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29536
+ let t = fk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29523
29537
  if ($("flowengage_click_button ▶", n), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
29524
- let r = uk(n, i);
29538
+ let r = dk(n, i);
29525
29539
  if (!r) return $("flowengage_click_button ✖ no match"), `Could not find a button matching "${n}". Call flowengage_list_forms to see button texts.`;
29526
29540
  try {
29527
- bO(`Clicking ${n}...`, { spinner: !0 });
29541
+ xO(`Clicking ${n}...`, { spinner: !0 });
29528
29542
  try {
29529
29543
  r.scrollIntoView({
29530
29544
  block: "center",
@@ -29533,22 +29547,22 @@ function yk(e) {
29533
29547
  } catch {
29534
29548
  r.scrollIntoView(!0);
29535
29549
  }
29536
- await PO(r), r.focus?.(), await IO(r), LO(r), r.click();
29550
+ await FO(r), r.focus?.(), await LO(r), RO(r), r.click();
29537
29551
  let e = (r.textContent || r.value || r.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
29538
- return $("flowengage_click_button ✓", t), bO(`Clicked ${e}`, {
29552
+ return $("flowengage_click_button ✓", t), xO(`Clicked ${e}`, {
29539
29553
  spinner: !1,
29540
29554
  icon: "✅",
29541
29555
  duration: 1200
29542
29556
  }), t;
29543
29557
  } catch (e) {
29544
29558
  let t = `Click failed: ${e?.message || String(e)}`;
29545
- return $("flowengage_click_button ✖", t), bO("Click failed", {
29559
+ return $("flowengage_click_button ✖", t), xO("Click failed", {
29546
29560
  spinner: !1,
29547
29561
  icon: "⚠️",
29548
29562
  duration: 1800
29549
29563
  }), t;
29550
29564
  } finally {
29551
- FO(), xO(700);
29565
+ IO(), SO(700);
29552
29566
  }
29553
29567
  }
29554
29568
  };
@@ -29565,7 +29579,7 @@ function yk(e) {
29565
29579
  }
29566
29580
  //#endregion
29567
29581
  //#region src/utils/wrapVoiceToolsForLogging.js
29568
- function bk(e) {
29582
+ function xk(e) {
29569
29583
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29570
29584
  let r = Rn();
29571
29585
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -29582,7 +29596,7 @@ function bk(e) {
29582
29596
  }
29583
29597
  //#endregion
29584
29598
  //#region src/components/FlowEngageWidget.jsx
29585
- var xk = {
29599
+ var Sk = {
29586
29600
  blue: "#135bd8",
29587
29601
  red: "#ef334b",
29588
29602
  yellow: "#ffbd2e",
@@ -29590,7 +29604,7 @@ var xk = {
29590
29604
  highlight: "rgba(255,255,255,0.9)",
29591
29605
  green: "#10b981"
29592
29606
  };
29593
- function Sk(e) {
29607
+ function Ck(e) {
29594
29608
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
29595
29609
  let [t, n, r] = e;
29596
29610
  return e.length >= 3 && r ? [
@@ -29604,12 +29618,12 @@ function Sk(e) {
29604
29618
  "#f7f8fa"
29605
29619
  ].join(", ");
29606
29620
  }
29607
- function Ck(e) {
29621
+ function wk(e) {
29608
29622
  if (!e || typeof e != "string") return "#1a1a1a";
29609
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;
29610
29624
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
29611
29625
  }
29612
- function wk({ logo: t, style: n }) {
29626
+ function Tk({ logo: t, style: n }) {
29613
29627
  if (!t) return null;
29614
29628
  if (typeof t == "string") return /* @__PURE__ */ g("img", {
29615
29629
  src: t,
@@ -29634,7 +29648,7 @@ function wk({ logo: t, style: n }) {
29634
29648
  children: r
29635
29649
  }) : null;
29636
29650
  }
29637
- function Tk({ title: e }) {
29651
+ function Ek({ title: e }) {
29638
29652
  return /* @__PURE__ */ g("div", {
29639
29653
  style: {
29640
29654
  width: "100%",
@@ -29652,18 +29666,18 @@ function Tk({ title: e }) {
29652
29666
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
29653
29667
  });
29654
29668
  }
29655
- function Ek(e, t) {
29669
+ function Dk(e, t) {
29656
29670
  let n = (t || "").trim();
29657
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;
29658
29672
  }
29659
- function Dk({ orbColors: e, ...t }) {
29660
- return /* @__PURE__ */ g(eO, {
29673
+ function Ok({ orbColors: e, ...t }) {
29674
+ return /* @__PURE__ */ g(tO, {
29661
29675
  colors: e,
29662
29676
  ...t
29663
29677
  });
29664
29678
  }
29665
- function Ok({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29666
- let s = n || xk.green, c = Ck(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
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", {
29667
29681
  style: {
29668
29682
  display: "flex",
29669
29683
  alignItems: a ? "flex-end" : "center",
@@ -29784,7 +29798,7 @@ function Ok({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29784
29798
  delay: 0
29785
29799
  },
29786
29800
  style: { flexShrink: 0 },
29787
- children: /* @__PURE__ */ g(Dk, {
29801
+ children: /* @__PURE__ */ g(Ok, {
29788
29802
  size: l,
29789
29803
  orbColors: t
29790
29804
  })
@@ -29816,8 +29830,8 @@ function Ok({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29816
29830
  children: u
29817
29831
  })] });
29818
29832
  }
29819
- function kk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29820
- let c = n || xk.green, l = Ck(c);
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);
29821
29835
  return /* @__PURE__ */ _(Sm.div, {
29822
29836
  initial: {
29823
29837
  scale: 50 / 350,
@@ -29888,7 +29902,7 @@ function kk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
29888
29902
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
29889
29903
  })
29890
29904
  }),
29891
- /* @__PURE__ */ g(Dk, {
29905
+ /* @__PURE__ */ g(Ok, {
29892
29906
  size: 72,
29893
29907
  orbColors: t
29894
29908
  }),
@@ -29957,7 +29971,7 @@ function kk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
29957
29971
  ]
29958
29972
  });
29959
29973
  }
29960
- function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
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 }) {
29961
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") => {
29962
29976
  E.current = e, re.current = !0, queueMicrotask(() => {
29963
29977
  ee.current || (ee.current = !0, T.current?.());
@@ -30007,7 +30021,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30007
30021
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
30008
30022
  u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", wr({ onBeforeNavigate: () => {
30009
30023
  if (a && u.current.length > 0) try {
30010
- let e = lO(u.current);
30024
+ let e = uO(u.current);
30011
30025
  e && Ae(a, e);
30012
30026
  } catch {}
30013
30027
  if (!Xn()) {
@@ -30029,7 +30043,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30029
30043
  }
30030
30044
  Ne();
30031
30045
  } });
30032
- let t = bk(yk({
30046
+ let t = xk(bk({
30033
30047
  siteId: a || null,
30034
30048
  apiBaseUrl: s || null,
30035
30049
  getLastUserVoiceText: () => w.current,
@@ -30088,10 +30102,10 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30088
30102
  message: r,
30089
30103
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
30090
30104
  }], a) try {
30091
- let e = lO(u.current);
30105
+ let e = uO(u.current);
30092
30106
  e && Ae(a, e);
30093
30107
  } catch {}
30094
- if (Ek(n, r)) {
30108
+ if (Dk(n, r)) {
30095
30109
  ce("minimized");
30096
30110
  return;
30097
30111
  }
@@ -30226,7 +30240,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30226
30240
  },
30227
30241
  children: "Muted"
30228
30242
  }),
30229
- /* @__PURE__ */ g(Dk, {
30243
+ /* @__PURE__ */ g(Ok, {
30230
30244
  size: 72,
30231
30245
  voiceState: h,
30232
30246
  isMuted: y,
@@ -30464,7 +30478,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30464
30478
  ]
30465
30479
  });
30466
30480
  }
30467
- function jk({ orbColors: e }) {
30481
+ function Mk({ orbColors: e }) {
30468
30482
  return /* @__PURE__ */ g("div", {
30469
30483
  style: {
30470
30484
  flexShrink: 0,
@@ -30474,13 +30488,13 @@ function jk({ orbColors: e }) {
30474
30488
  alignItems: "center",
30475
30489
  justifyContent: "center"
30476
30490
  },
30477
- children: /* @__PURE__ */ g(Dk, {
30491
+ children: /* @__PURE__ */ g(Ok, {
30478
30492
  size: 36,
30479
30493
  orbColors: e
30480
30494
  })
30481
30495
  });
30482
30496
  }
30483
- var Mk = () => /* @__PURE__ */ g("div", {
30497
+ var Nk = () => /* @__PURE__ */ g("div", {
30484
30498
  style: {
30485
30499
  display: "flex",
30486
30500
  marginBottom: "12px",
@@ -30510,7 +30524,7 @@ var Mk = () => /* @__PURE__ */ g("div", {
30510
30524
  } }, e))
30511
30525
  })
30512
30526
  });
30513
- function Nk({ 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 }) {
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 }) {
30514
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 () => {
30515
30529
  Le(!1), ze(!0), Ue(!0), Ge(null);
30516
30530
  try {
@@ -30635,7 +30649,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30635
30649
  justifyContent: "center",
30636
30650
  height: "40px"
30637
30651
  },
30638
- children: i ? /* @__PURE__ */ g(wk, {
30652
+ children: i ? /* @__PURE__ */ g(Tk, {
30639
30653
  logo: i,
30640
30654
  style: {
30641
30655
  height: "34px",
@@ -30648,7 +30662,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30648
30662
  height: "40px",
30649
30663
  flexShrink: 0
30650
30664
  },
30651
- children: /* @__PURE__ */ g(Tk, { title: e.chatTitle })
30665
+ children: /* @__PURE__ */ g(Ek, { title: e.chatTitle })
30652
30666
  })
30653
30667
  }), /* @__PURE__ */ g("div", {
30654
30668
  style: {
@@ -30930,7 +30944,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30930
30944
  })
30931
30945
  ]
30932
30946
  }),
30933
- /* @__PURE__ */ g(GD, {
30947
+ /* @__PURE__ */ g(KD, {
30934
30948
  webRTCError: fe,
30935
30949
  micError: pe,
30936
30950
  setMicError: me,
@@ -30938,7 +30952,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30938
30952
  isRateLimited: ee,
30939
30953
  rateLimitMessage: te
30940
30954
  }),
30941
- Se && /* @__PURE__ */ g(cO, {
30955
+ Se && /* @__PURE__ */ g(lO, {
30942
30956
  agentName: v,
30943
30957
  agentHeadshot: y,
30944
30958
  fallbackAgentName: b,
@@ -31130,17 +31144,17 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31130
31144
  children: "No previous chats found."
31131
31145
  })
31132
31146
  })]
31133
- }) : null, Ne ? /* @__PURE__ */ g(UD, {
31147
+ }) : null, Ne ? /* @__PURE__ */ g(WD, {
31134
31148
  chatHistory: l,
31135
31149
  isAiTyping: u,
31136
31150
  isLoading: T,
31137
31151
  isAgentTyping: d,
31138
31152
  setReplyContext: de,
31139
- TypingDots: Mk,
31153
+ TypingDots: Nk,
31140
31154
  primaryColor: n,
31141
31155
  agentHeadshot: y,
31142
31156
  agentDisplayName: v || b,
31143
- botAvatarNode: /* @__PURE__ */ g(jk, { orbColors: t })
31157
+ botAvatarNode: /* @__PURE__ */ g(Mk, { orbColors: t })
31144
31158
  }) : Me ? /* @__PURE__ */ _("div", {
31145
31159
  style: {
31146
31160
  flex: 1,
@@ -31181,7 +31195,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31181
31195
  padding: "28px 24px"
31182
31196
  },
31183
31197
  children: [
31184
- /* @__PURE__ */ g(Dk, {
31198
+ /* @__PURE__ */ g(Ok, {
31185
31199
  size: 94,
31186
31200
  orbColors: t
31187
31201
  }),
@@ -31272,7 +31286,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31272
31286
  zIndex: 1,
31273
31287
  padding: oe ? "6px 0 0" : "12px 0 0"
31274
31288
  },
31275
- children: /* @__PURE__ */ g(WD, {
31289
+ children: /* @__PURE__ */ g(GD, {
31276
31290
  input: x,
31277
31291
  setInput: S,
31278
31292
  onSubmit: C,
@@ -31322,7 +31336,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31322
31336
  ]
31323
31337
  });
31324
31338
  }
31325
- function Pk() {
31339
+ function Fk() {
31326
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();
31327
31341
  c(() => {
31328
31342
  try {
@@ -31340,7 +31354,7 @@ function Pk() {
31340
31354
  }, Fe = {
31341
31355
  ...ke.features || {},
31342
31356
  ...Ae.features || {}
31343
- }, 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 = Sk(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) => ({
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) => ({
31344
31358
  id: e.key || `qr-${t}`,
31345
31359
  label: e.label,
31346
31360
  message: e.label,
@@ -31604,7 +31618,7 @@ function Pk() {
31604
31618
  onWheel: (e) => e.stopPropagation(),
31605
31619
  onTouchMove: (e) => e.stopPropagation(),
31606
31620
  children: [
31607
- A === "entry_prompt" && /* @__PURE__ */ g(Ok, {
31621
+ A === "entry_prompt" && /* @__PURE__ */ g(kk, {
31608
31622
  copy: Ze,
31609
31623
  orbColors: Re,
31610
31624
  primaryColor: ze,
@@ -31687,13 +31701,13 @@ function Pk() {
31687
31701
  children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
31688
31702
  })]
31689
31703
  })]
31690
- }), /* @__PURE__ */ g(Dk, {
31704
+ }), /* @__PURE__ */ g(Ok, {
31691
31705
  size: 50,
31692
31706
  orbColors: Re,
31693
31707
  onClick: T && Dt ? Lt : Ie ? Kt : Jt
31694
31708
  })]
31695
31709
  }),
31696
- A === "connection_modal" && /* @__PURE__ */ g(kk, {
31710
+ A === "connection_modal" && /* @__PURE__ */ g(Ak, {
31697
31711
  copy: Ze,
31698
31712
  orbColors: Re,
31699
31713
  primaryColor: ze,
@@ -31703,7 +31717,7 @@ function Pk() {
31703
31717
  isMobile: Nt,
31704
31718
  isClosing: kt
31705
31719
  }),
31706
- A === "voice_mode" && /* @__PURE__ */ g(Ak, {
31720
+ A === "voice_mode" && /* @__PURE__ */ g(jk, {
31707
31721
  orbColors: Re,
31708
31722
  onEnterChat: Jt,
31709
31723
  onEndChat: Yt,
@@ -31716,7 +31730,7 @@ function Pk() {
31716
31730
  onMessageSync: oe,
31717
31731
  voiceEndCounter: Oe
31718
31732
  }, "voice"),
31719
- A === "call_screen" && /* @__PURE__ */ g(sO, {
31733
+ A === "call_screen" && /* @__PURE__ */ g(cO, {
31720
31734
  incomingCall: w,
31721
31735
  activeCallId: T,
31722
31736
  callConnectionState: ee,
@@ -31735,7 +31749,7 @@ function Pk() {
31735
31749
  orbColors: Re,
31736
31750
  chatHistory: r
31737
31751
  }),
31738
- A === "text_chat" && /* @__PURE__ */ g(Nk, {
31752
+ A === "text_chat" && /* @__PURE__ */ g(Pk, {
31739
31753
  isClosing: kt,
31740
31754
  copy: Ze,
31741
31755
  orbColors: Re,
@@ -31800,7 +31814,7 @@ function Pk() {
31800
31814
  }
31801
31815
  //#endregion
31802
31816
  //#region src/components/ErrorBoundary.jsx
31803
- var Fk = class extends e.Component {
31817
+ var Ik = class extends e.Component {
31804
31818
  constructor(e) {
31805
31819
  super(e), this.state = { hasError: !1 };
31806
31820
  }
@@ -31815,4 +31829,4 @@ var Fk = class extends e.Component {
31815
31829
  }
31816
31830
  };
31817
31831
  //#endregion
31818
- export { eO as AnimatedOrb, Fk as ErrorBoundary, Nr as FlowEngageProvider, Pk as FlowEngageWidget, Ln as useFlowEngage };
31832
+ export { tO as AnimatedOrb, Ik as ErrorBoundary, Nr as FlowEngageProvider, Fk as FlowEngageWidget, Ln as useFlowEngage };