@flowengage/react-chatbot 8.0.32 → 8.0.34

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.
@@ -18,7 +18,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
18
18
  }, T = (e) => x.call(e, "module.exports") ? e["module.exports"] : w(v({}, "__esModule", { value: !0 }), e), E = (e) => {
19
19
  if (!e || typeof e != "object") throw Error("FlowEngage config is required");
20
20
  if (!e.siteId || typeof e.siteId != "string") throw Error("[FlowEngage] config.siteId is required. Pass it as <FlowEngageProvider siteId=\"your-site-id\" /> or config={{ siteId: 'your-site-id' }}.");
21
- let t = (e.apiBaseUrl || "https://be-flowengage-dev.oslabs.app").replace(/\/+$/, "");
21
+ let t = (e.apiBaseUrl || "https://be-flowengage-stage.oslabs.app").replace(/\/+$/, "");
22
22
  return {
23
23
  siteId: e.siteId.trim(),
24
24
  apiBaseUrl: t
@@ -27152,7 +27152,7 @@ function rO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27152
27152
  dangerouslySetInnerHTML: { __html: qD(e.message) },
27153
27153
  onClick: T
27154
27154
  }) : /* @__PURE__ */ g("div", {
27155
- style: { whiteSpace: n || o ? "normal" : "pre-wrap" },
27155
+ style: { whiteSpace: "pre-wrap" },
27156
27156
  children: e.message
27157
27157
  })]
27158
27158
  }),
@@ -27350,7 +27350,8 @@ function rO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27350
27350
  }
27351
27351
  //#endregion
27352
27352
  //#region src/components/ChatInput.jsx
27353
- function iO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
27353
+ var iO = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
27354
+ function aO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
27354
27355
  let ee = p(null), te = p(null), ne = (e) => {
27355
27356
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
27356
27357
  };
@@ -27358,7 +27359,7 @@ function iO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27358
27359
  d || ne(te.current);
27359
27360
  }, [e, d]);
27360
27361
  let re = (e) => {
27361
- e.key === "Enter" && (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
27362
+ e.key === "Enter" && (iO || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
27362
27363
  }, ie = l?.sender === "user" ? "You" : l?.sender === "agent" ? "Agent" : "AI Assistant", ae = d ? !!f?.trim() : !!e?.trim() || !!S, oe = s || T || !ae, D = !d && b && y;
27363
27364
  return /* @__PURE__ */ _("div", {
27364
27365
  style: {
@@ -27722,7 +27723,7 @@ function iO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27722
27723
  }
27723
27724
  //#endregion
27724
27725
  //#region src/components/StatusBanners.jsx
27725
- function aO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
27726
+ function oO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
27726
27727
  return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
27727
27728
  style: {
27728
27729
  margin: "0 20px 10px",
@@ -27781,13 +27782,13 @@ function aO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
27781
27782
  }
27782
27783
  //#endregion
27783
27784
  //#region src/components/AnimatedOrb.jsx
27784
- var oO = [
27785
+ var sO = [
27785
27786
  "#135bd8",
27786
27787
  "#ef334b",
27787
27788
  "#ffbd2e"
27788
27789
  ];
27789
- function sO(e) {
27790
- return !Array.isArray(e) || e.length === 0 ? oO : e.length === 1 ? [
27790
+ function cO(e) {
27791
+ return !Array.isArray(e) || e.length === 0 ? sO : e.length === 1 ? [
27791
27792
  e[0],
27792
27793
  e[0],
27793
27794
  e[0]
@@ -27801,7 +27802,7 @@ function sO(e) {
27801
27802
  e[2]
27802
27803
  ];
27803
27804
  }
27804
- var cO = {
27805
+ var lO = {
27805
27806
  idle: 3,
27806
27807
  listening: .75,
27807
27808
  thinking: 1,
@@ -27809,7 +27810,7 @@ var cO = {
27809
27810
  muted: .75,
27810
27811
  error: .08
27811
27812
  };
27812
- function lO(e) {
27813
+ function uO(e) {
27813
27814
  if (!e || typeof e != "string") return [
27814
27815
  0,
27815
27816
  0,
@@ -27822,14 +27823,14 @@ function lO(e) {
27822
27823
  parseInt(n.slice(4, 6), 16) / 255
27823
27824
  ];
27824
27825
  }
27825
- function uO(e, t) {
27826
+ function dO(e, t) {
27826
27827
  if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
27827
27828
  if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
27828
27829
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
27829
27830
  return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
27830
27831
  }
27831
- var dO = "\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", fO = "\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";
27832
- function pO(e, t, n) {
27832
+ var fO = "\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", pO = "\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";
27833
+ function mO(e, t, n) {
27833
27834
  let r = (t, n) => {
27834
27835
  let r = e.createShader(t);
27835
27836
  return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
@@ -27838,10 +27839,10 @@ function pO(e, t, n) {
27838
27839
  let o = e.createProgram();
27839
27840
  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);
27840
27841
  }
27841
- function mO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
27842
- let [s, l, u] = sO(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(cO[t] ?? .35);
27842
+ function hO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
27843
+ let [s, l, u] = cO(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(lO[t] ?? .35);
27843
27844
  c(() => {
27844
- h.current = cO[t] ?? .35;
27845
+ h.current = lO[t] ?? .35;
27845
27846
  }, [t]), c(() => {
27846
27847
  let t = m.current;
27847
27848
  if (!t) return;
@@ -27858,7 +27859,7 @@ function mO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27858
27859
  console.warn("[AnimatedOrb] WebGL unavailable.");
27859
27860
  return;
27860
27861
  }
27861
- let i = pO(r, dO, fO);
27862
+ let i = mO(r, fO, pO);
27862
27863
  if (!i) {
27863
27864
  console.error("[AnimatedOrb] WebGL program failed to compile/link");
27864
27865
  return;
@@ -27888,7 +27889,7 @@ function mO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27888
27889
  c2: r.getUniformLocation(i, "u_c2"),
27889
27890
  c3: r.getUniformLocation(i, "u_c3")
27890
27891
  };
27891
- r.uniform3fv(c.c1, lO(s)), r.uniform3fv(c.c2, lO(l)), r.uniform3fv(c.c3, lO(u)), r.viewport(0, 0, t.width, t.height);
27892
+ r.uniform3fv(c.c1, uO(s)), r.uniform3fv(c.c2, uO(l)), r.uniform3fv(c.c3, uO(u)), r.viewport(0, 0, t.width, t.height);
27892
27893
  let d = performance.now(), f, p = (e) => {
27893
27894
  r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
27894
27895
  };
@@ -27919,7 +27920,7 @@ function mO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27919
27920
  position: "absolute",
27920
27921
  inset: -10,
27921
27922
  borderRadius: "50%",
27922
- background: `radial-gradient(circle, ${uO(s, .18)} 0%, transparent 70%)`,
27923
+ background: `radial-gradient(circle, ${dO(s, .18)} 0%, transparent 70%)`,
27923
27924
  pointerEvents: "none"
27924
27925
  },
27925
27926
  animate: { opacity: [.3, .75] },
@@ -27997,17 +27998,17 @@ function mO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27997
27998
  }
27998
27999
  //#endregion
27999
28000
  //#region src/components/CallScreen.jsx
28000
- var hO = "\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";
28001
- function gO(e) {
28001
+ var gO = "\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";
28002
+ function _O(e) {
28002
28003
  let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
28003
28004
  return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
28004
28005
  }
28005
- function _O(e) {
28006
+ function vO(e) {
28006
28007
  if (!e || typeof e != "string") return "#1a1a1a";
28007
28008
  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;
28008
28009
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
28009
28010
  }
28010
- function vO(e, t) {
28011
+ function yO(e, t) {
28011
28012
  let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
28012
28013
  return n.length === 1 ? [
28013
28014
  `radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
@@ -28024,8 +28025,8 @@ function vO(e, t) {
28024
28025
  "#f7f8fa"
28025
28026
  ].join(", ");
28026
28027
  }
28027
- function yO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
28028
- let i = (t || "A")[0].toUpperCase(), a = _O(r), o = n > 48 ? {
28028
+ function bO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
28029
+ let i = (t || "A")[0].toUpperCase(), a = vO(r), o = n > 48 ? {
28029
28030
  boxShadow: `0 0 0 3px ${r}44`,
28030
28031
  border: "3px solid rgba(255,255,255,0.15)"
28031
28032
  } : { border: `1.5px solid ${r}55` };
@@ -28062,7 +28063,7 @@ function yO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
28062
28063
  children: i
28063
28064
  });
28064
28065
  }
28065
- function bO(e) {
28066
+ function xO(e) {
28066
28067
  let t = p(null), n = o(() => {
28067
28068
  if (!t.current) return;
28068
28069
  let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
@@ -28109,8 +28110,8 @@ function bO(e) {
28109
28110
  n
28110
28111
  ]), c(() => () => n(), [n]), n;
28111
28112
  }
28112
- function xO({ 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 = [] }) {
28113
- let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = bO(!!e), S = async () => {
28113
+ 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 = [] }) {
28114
+ let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = xO(!!e), S = async () => {
28114
28115
  x(), await c();
28115
28116
  }, C = async () => {
28116
28117
  x(), await l();
@@ -28122,14 +28123,14 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28122
28123
  flexDirection: "column",
28123
28124
  borderRadius: "inherit",
28124
28125
  overflow: "hidden",
28125
- background: vO(h, m),
28126
+ background: yO(h, m),
28126
28127
  animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
28127
28128
  };
28128
28129
  if (b === "incoming") {
28129
28130
  let e = Array.isArray(h) && h.length > 0 ? h : [m];
28130
28131
  return /* @__PURE__ */ _("div", {
28131
28132
  style: E,
28132
- children: [/* @__PURE__ */ g("style", { children: hO }), /* @__PURE__ */ _("div", {
28133
+ children: [/* @__PURE__ */ g("style", { children: gO }), /* @__PURE__ */ _("div", {
28133
28134
  style: {
28134
28135
  flex: 1,
28135
28136
  display: "flex",
@@ -28160,7 +28161,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28160
28161
  width: "96px",
28161
28162
  height: "96px",
28162
28163
  borderRadius: "50%",
28163
- background: `radial-gradient(circle, rgba(${gO(e[0])},0.2) 0%, transparent 70%)`,
28164
+ background: `radial-gradient(circle, rgba(${_O(e[0])},0.2) 0%, transparent 70%)`,
28164
28165
  filter: "blur(10px)",
28165
28166
  zIndex: 0
28166
28167
  } }),
@@ -28177,7 +28178,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28177
28178
  animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
28178
28179
  zIndex: 1
28179
28180
  } }, n)),
28180
- /* @__PURE__ */ g(yO, {
28181
+ /* @__PURE__ */ g(bO, {
28181
28182
  headshot: o,
28182
28183
  name: y,
28183
28184
  size: 82,
@@ -28315,7 +28316,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28315
28316
  }
28316
28317
  return b === "connecting" ? /* @__PURE__ */ _("div", {
28317
28318
  style: E,
28318
- children: [/* @__PURE__ */ g("style", { children: hO }), /* @__PURE__ */ _("div", {
28319
+ children: [/* @__PURE__ */ g("style", { children: gO }), /* @__PURE__ */ _("div", {
28319
28320
  style: {
28320
28321
  flex: 1,
28321
28322
  display: "flex",
@@ -28325,7 +28326,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28325
28326
  gap: "24px"
28326
28327
  },
28327
28328
  children: [
28328
- /* @__PURE__ */ g(yO, {
28329
+ /* @__PURE__ */ g(bO, {
28329
28330
  headshot: o,
28330
28331
  name: y,
28331
28332
  size: 64,
@@ -28352,7 +28353,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28352
28353
  }) : /* @__PURE__ */ _("div", {
28353
28354
  style: E,
28354
28355
  children: [
28355
- /* @__PURE__ */ g("style", { children: hO }),
28356
+ /* @__PURE__ */ g("style", { children: gO }),
28356
28357
  /* @__PURE__ */ _("div", {
28357
28358
  style: {
28358
28359
  display: "flex",
@@ -28398,7 +28399,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28398
28399
  children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
28399
28400
  })
28400
28401
  }),
28401
- /* @__PURE__ */ g(mO, {
28402
+ /* @__PURE__ */ g(hO, {
28402
28403
  colors: h,
28403
28404
  size: 36,
28404
28405
  voiceState: w
@@ -28449,7 +28450,7 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28449
28450
  gap: "16px",
28450
28451
  padding: "0 24px 16px"
28451
28452
  },
28452
- children: [/* @__PURE__ */ g(yO, {
28453
+ children: [/* @__PURE__ */ g(bO, {
28453
28454
  headshot: o,
28454
28455
  name: y,
28455
28456
  size: 116,
@@ -28538,9 +28539,9 @@ function xO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28538
28539
  ]
28539
28540
  });
28540
28541
  }
28541
- function SO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
28542
+ function CO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
28542
28543
  let u = e || n || "Agent";
28543
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: hO }), /* @__PURE__ */ _("div", {
28544
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: gO }), /* @__PURE__ */ _("div", {
28544
28545
  role: "button",
28545
28546
  tabIndex: 0,
28546
28547
  onClick: c,
@@ -28597,7 +28598,7 @@ function SO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28597
28598
  borderRadius: "50%",
28598
28599
  border: `1.5px solid ${l}55`
28599
28600
  } }),
28600
- /* @__PURE__ */ g(yO, {
28601
+ /* @__PURE__ */ g(bO, {
28601
28602
  headshot: t,
28602
28603
  name: u,
28603
28604
  size: 38,
@@ -28717,7 +28718,7 @@ function SO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28717
28718
  }
28718
28719
  //#endregion
28719
28720
  //#region src/utils/voicePriorContext.js
28720
- function CO(e, t = {}) {
28721
+ function wO(e, t = {}) {
28721
28722
  let n = t.maxChars ?? 4500;
28722
28723
  if (!Array.isArray(e) || e.length === 0) return "";
28723
28724
  let r = [];
@@ -28735,7 +28736,7 @@ function CO(e, t = {}) {
28735
28736
  //#endregion
28736
28737
  //#region src/utils/voiceActionVisuals.js
28737
28738
  var Q = "fe-vv";
28738
- function wO() {
28739
+ function TO() {
28739
28740
  if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
28740
28741
  let e = `
28741
28742
  /* ── Action toast ───────────────────────────────────────────────────────────── */
@@ -28880,14 +28881,14 @@ function wO() {
28880
28881
  `, t = document.createElement("style");
28881
28882
  t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
28882
28883
  }
28883
- var TO = null, EO = null;
28884
- function DO() {
28885
- return (!TO || !TO.isConnected) && (TO = document.createElement("div"), TO.id = `${Q}-toast`, document.body.appendChild(TO)), TO;
28884
+ var EO = null, DO = null;
28885
+ function OO() {
28886
+ return (!EO || !EO.isConnected) && (EO = document.createElement("div"), EO.id = `${Q}-toast`, document.body.appendChild(EO)), EO;
28886
28887
  }
28887
- function OO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28888
+ function kO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28888
28889
  if (typeof document > "u") return;
28889
- wO(), EO &&= (clearTimeout(EO), null);
28890
- let i = DO();
28890
+ TO(), DO &&= (clearTimeout(DO), null);
28891
+ let i = OO();
28891
28892
  if (i.innerHTML = "", n) {
28892
28893
  let e = document.createElement("span");
28893
28894
  e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
@@ -28896,71 +28897,71 @@ function OO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28896
28897
  e.className = `${Q}-spin`, i.appendChild(e);
28897
28898
  }
28898
28899
  let a = document.createElement("span");
28899
- a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (EO = setTimeout(() => kO(), r));
28900
- }
28901
- function kO(e = 0) {
28902
- TO && (e > 0 ? EO = setTimeout(() => {
28903
- TO && TO.classList.remove(`${Q}-show`);
28904
- }, e) : TO && TO.classList.remove(`${Q}-show`));
28900
+ a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (DO = setTimeout(() => AO(), r));
28905
28901
  }
28906
- var AO = null, jO = [];
28907
- function MO() {
28908
- return (!AO || !AO.isConnected) && (AO = document.createElement("div"), AO.id = `${Q}-bar`, document.body.appendChild(AO)), AO;
28902
+ function AO(e = 0) {
28903
+ EO && (e > 0 ? DO = setTimeout(() => {
28904
+ EO && EO.classList.remove(`${Q}-show`);
28905
+ }, e) : EO && EO.classList.remove(`${Q}-show`));
28909
28906
  }
28907
+ var jO = null, MO = [];
28910
28908
  function NO() {
28909
+ return (!jO || !jO.isConnected) && (jO = document.createElement("div"), jO.id = `${Q}-bar`, document.body.appendChild(jO)), jO;
28910
+ }
28911
+ function PO() {
28911
28912
  if (typeof document > "u") return;
28912
- wO(), jO.forEach(clearTimeout), jO = [];
28913
- let e = MO();
28913
+ TO(), MO.forEach(clearTimeout), MO = [];
28914
+ let e = NO();
28914
28915
  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";
28915
28916
  let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
28916
28917
  for (let [e, r] of t) {
28917
28918
  let t = n, i = e, a = r;
28918
- jO.push(setTimeout(() => {
28919
- AO && (AO.style.transition = a, AO.style.width = `${i}%`);
28919
+ MO.push(setTimeout(() => {
28920
+ jO && (jO.style.transition = a, jO.style.width = `${i}%`);
28920
28921
  }, t)), n += 800;
28921
28922
  }
28922
28923
  }
28923
- function PO() {
28924
- AO && (jO.forEach(clearTimeout), jO = [], AO.style.transition = "width 0.2s ease", AO.style.width = "100%", jO.push(setTimeout(() => {
28925
- AO && (AO.style.transition = "opacity 0.35s ease", AO.style.opacity = "0", jO.push(setTimeout(() => {
28926
- AO && (AO.style.width = "0%", AO.classList.remove(`${Q}-bar-active`));
28924
+ function FO() {
28925
+ jO && (MO.forEach(clearTimeout), MO = [], jO.style.transition = "width 0.2s ease", jO.style.width = "100%", MO.push(setTimeout(() => {
28926
+ jO && (jO.style.transition = "opacity 0.35s ease", jO.style.opacity = "0", MO.push(setTimeout(() => {
28927
+ jO && (jO.style.width = "0%", jO.classList.remove(`${Q}-bar-active`));
28927
28928
  }, 380)));
28928
28929
  }, 220)));
28929
28930
  }
28930
- var FO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
28931
+ var IO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
28931
28932
  <filter id="${Q}-csh">
28932
28933
  <feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
28933
28934
  </filter>
28934
28935
  <path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
28935
28936
  fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
28936
28937
  filter="url(#${Q}-csh)"/>
28937
- </svg>`, IO = null, LO = !1;
28938
- function RO() {
28939
- return (!IO || !IO.isConnected) && (IO = document.createElement("div"), IO.id = `${Q}-cursor`, IO.innerHTML = FO, document.body.appendChild(IO), LO = !1), IO;
28938
+ </svg>`, LO = null, RO = !1;
28939
+ function zO() {
28940
+ return (!LO || !LO.isConnected) && (LO = document.createElement("div"), LO.id = `${Q}-cursor`, LO.innerHTML = IO, document.body.appendChild(LO), RO = !1), LO;
28940
28941
  }
28941
- async function zO(e) {
28942
+ async function BO(e) {
28942
28943
  if (typeof document > "u" || !e) return;
28943
- wO();
28944
+ TO();
28944
28945
  let t;
28945
28946
  try {
28946
28947
  t = e.getBoundingClientRect();
28947
28948
  } catch {
28948
28949
  return;
28949
28950
  }
28950
- let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = RO();
28951
- LO ||= (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 UO(360);
28951
+ let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = zO();
28952
+ RO ||= (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 WO(360);
28952
28953
  }
28953
- function BO(e = !1) {
28954
- IO && (e ? (IO.classList.remove(`${Q}-cursor-visible`), LO = !1) : (IO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
28955
- LO = !1;
28954
+ function VO(e = !1) {
28955
+ LO && (e ? (LO.classList.remove(`${Q}-cursor-visible`), RO = !1) : (LO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
28956
+ RO = !1;
28956
28957
  }, 250)));
28957
28958
  }
28958
- async function VO(e) {
28959
- IO && (IO.classList.add(`${Q}-cursor-click`), await UO(280), IO.classList.remove(`${Q}-cursor-click`));
28959
+ async function HO(e) {
28960
+ LO && (LO.classList.add(`${Q}-cursor-click`), await WO(280), LO.classList.remove(`${Q}-cursor-click`));
28960
28961
  }
28961
- function HO(e) {
28962
+ function UO(e) {
28962
28963
  if (!e || typeof document > "u") return;
28963
- wO();
28964
+ TO();
28964
28965
  let t;
28965
28966
  try {
28966
28967
  t = e.getBoundingClientRect();
@@ -28986,7 +28987,7 @@ function HO(e) {
28986
28987
  a.remove(), e.style.position = n, e.style.overflow = r;
28987
28988
  }, 650);
28988
28989
  }
28989
- function UO(e) {
28990
+ function WO(e) {
28990
28991
  return new Promise((t) => setTimeout(t, e));
28991
28992
  }
28992
28993
  //#endregion
@@ -28994,14 +28995,14 @@ function UO(e) {
28994
28995
  function $(...e) {
28995
28996
  Fn() && console.log("[FlowEngage:voice-tools]", ...e);
28996
28997
  }
28997
- function WO(e) {
28998
+ function GO(e) {
28998
28999
  try {
28999
29000
  let t = e.ownerDocument?.defaultView;
29000
29001
  if (t) return t.getComputedStyle(e);
29001
29002
  } catch {}
29002
29003
  return window.getComputedStyle(e);
29003
29004
  }
29004
- function GO(e) {
29005
+ function KO(e) {
29005
29006
  let t = /* @__PURE__ */ new Set();
29006
29007
  function n(r) {
29007
29008
  if (!r || t.has(r)) return;
@@ -29014,10 +29015,10 @@ function GO(e) {
29014
29015
  }
29015
29016
  typeof document < "u" && n(document);
29016
29017
  }
29017
- function KO(e) {
29018
+ function qO(e) {
29018
29019
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
29019
29020
  }
29020
- function qO(e) {
29021
+ function JO(e) {
29021
29022
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
29022
29023
  if (n) {
29023
29024
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -29025,40 +29026,40 @@ function qO(e) {
29025
29026
  let e = t.getElementById(n);
29026
29027
  e?.textContent && r.push(e.textContent.trim());
29027
29028
  } catch {}
29028
- if (r.length) return KO(r.join(" "));
29029
+ if (r.length) return qO(r.join(" "));
29029
29030
  }
29030
- if (e.labels && e.labels.length) return KO(e.labels[0].textContent);
29031
+ if (e.labels && e.labels.length) return qO(e.labels[0].textContent);
29031
29032
  let r = e.id;
29032
29033
  if (r) try {
29033
29034
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
29034
- if (e) return KO(e.textContent);
29035
+ if (e) return qO(e.textContent);
29035
29036
  } catch {
29036
29037
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
29037
- if (e) return KO(e.textContent);
29038
+ if (e) return qO(e.textContent);
29038
29039
  }
29039
29040
  let i = e.previousElementSibling;
29040
29041
  for (let e = 0; e < 6 && i; e += 1) {
29041
- if (i.tagName === "LABEL") return KO(i.textContent);
29042
+ if (i.tagName === "LABEL") return qO(i.textContent);
29042
29043
  let e = (i.className || "").toString().toLowerCase();
29043
29044
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
29044
- let e = KO(i.textContent);
29045
+ let e = qO(i.textContent);
29045
29046
  if (e) return e;
29046
29047
  }
29047
29048
  i = i.previousElementSibling;
29048
29049
  }
29049
29050
  let a = e.parentElement;
29050
29051
  for (let e = 0; e < 5 && a; e += 1) {
29051
- if (a.tagName === "LABEL") return KO(a.textContent);
29052
+ if (a.tagName === "LABEL") return qO(a.textContent);
29052
29053
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
29053
- if (e?.textContent) return KO(e.textContent);
29054
+ if (e?.textContent) return qO(e.textContent);
29054
29055
  a = a.parentElement;
29055
29056
  }
29056
29057
  let o = e.getAttribute("aria-label");
29057
- return o ? KO(o) : null;
29058
+ return o ? qO(o) : null;
29058
29059
  }
29059
- function JO() {
29060
+ function YO() {
29060
29061
  let e = [];
29061
- return GO((t) => {
29062
+ return KO((t) => {
29062
29063
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
29063
29064
  if (Vn(e)) return !1;
29064
29065
  let t = (e.type || "").toLowerCase();
@@ -29069,15 +29070,15 @@ function JO() {
29069
29070
  "image"
29070
29071
  ].includes(t) || e.disabled || e.readOnly) return !1;
29071
29072
  try {
29072
- let t = WO(e);
29073
+ let t = GO(e);
29073
29074
  if (t.display === "none" || t.visibility === "hidden") return !1;
29074
29075
  } catch {}
29075
29076
  return !0;
29076
29077
  }));
29077
29078
  }), e;
29078
29079
  }
29079
- function YO() {
29080
- return JO().map((e, t) => {
29080
+ function XO() {
29081
+ return YO().map((e, t) => {
29081
29082
  let n = {
29082
29083
  formIndex: 0,
29083
29084
  fieldIndex: t,
@@ -29085,7 +29086,7 @@ function YO() {
29085
29086
  type: e.type || "text",
29086
29087
  name: e.name || null,
29087
29088
  id: e.id || null,
29088
- label: qO(e),
29089
+ label: JO(e),
29089
29090
  placeholder: e.placeholder || null
29090
29091
  };
29091
29092
  return e.tagName === "SELECT" && (n.options = Array.from(e.options).filter((e) => e.value !== "" && !e.disabled).map((e) => ({
@@ -29094,13 +29095,13 @@ function YO() {
29094
29095
  })), n.currentValue = e.value || null), n;
29095
29096
  });
29096
29097
  }
29097
- function XO() {
29098
+ function ZO() {
29098
29099
  let e = [];
29099
- return GO((t) => {
29100
+ return KO((t) => {
29100
29101
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
29101
29102
  if (Vn(e) || e.disabled) return !1;
29102
29103
  try {
29103
- let t = WO(e);
29104
+ let t = GO(e);
29104
29105
  if (t.display === "none" || t.visibility === "hidden") return !1;
29105
29106
  } catch {}
29106
29107
  return !0;
@@ -29112,7 +29113,7 @@ function XO() {
29112
29113
  type: e.type || e.tagName
29113
29114
  }));
29114
29115
  }
29115
- function ZO(e, t) {
29116
+ function QO(e, t) {
29116
29117
  try {
29117
29118
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
29118
29119
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -29127,7 +29128,7 @@ function ZO(e, t) {
29127
29128
  return Infinity;
29128
29129
  }
29129
29130
  }
29130
- function QO(e, t) {
29131
+ function $O(e, t) {
29131
29132
  let n = String(t || "").toLowerCase().trim();
29132
29133
  if (!n) return 0;
29133
29134
  let r = (e.innerText || e.textContent || "").replace(/\s+/g, " ").trim(), i = [
@@ -29145,39 +29146,51 @@ function QO(e, t) {
29145
29146
  for (let e of a) i.includes(e) && (o += 1);
29146
29147
  return o / a.length * 92;
29147
29148
  }
29148
- function $O(e, t) {
29149
- let n = [];
29150
- GO((e) => {
29149
+ function ek(e, t, n = 6) {
29150
+ let r = String(t || "").toLowerCase().trim();
29151
+ if (!r) return !1;
29152
+ let i = e;
29153
+ for (let e = 0; e < n && i && (i = i.parentElement, i); e++) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return !0;
29154
+ return !1;
29155
+ }
29156
+ function tk(e, t, n) {
29157
+ let r = [];
29158
+ KO((e) => {
29151
29159
  let t = Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"], a[href]"));
29152
- n.push(...t.filter((e) => {
29160
+ r.push(...t.filter((e) => {
29153
29161
  if (Vn(e) || e.disabled) return !1;
29154
29162
  try {
29155
- let t = WO(e);
29163
+ let t = GO(e);
29156
29164
  if (t.display === "none" || t.visibility === "hidden" || t.opacity === "0") return !1;
29157
29165
  } catch {}
29158
29166
  return !0;
29159
29167
  }));
29160
29168
  });
29161
- let r = 0, i = n.map((t) => ({
29169
+ let i = 0, a = r.map((t) => ({
29162
29170
  el: t,
29163
- s: QO(t, e)
29171
+ s: $O(t, e)
29164
29172
  }));
29165
- for (let { s: e } of i) e > r && (r = e);
29166
- if (r < 28) return null;
29167
- let a = i.filter(({ s: e }) => e === r).map(({ el: e }) => e);
29168
- if (a.length === 1) return a[0];
29169
- let o = Array.isArray(t) ? t.filter((e) => e && e.isConnected) : [];
29170
- if (o.length) {
29171
- let e = a[0], t = Infinity;
29172
- for (let n of a) for (let r of o) {
29173
- let i = ZO(n, r);
29173
+ for (let { s: e } of a) e > i && (i = e);
29174
+ if (i < 28) return null;
29175
+ let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
29176
+ if (o.length === 1) return o[0];
29177
+ if (n) {
29178
+ let e = o.filter((e) => ek(e, n));
29179
+ if (e.length === 1) return e[0];
29180
+ e.length > 1 && (o = e);
29181
+ }
29182
+ let s = Array.isArray(t) ? t.filter((e) => e && e.isConnected) : [];
29183
+ if (s.length) {
29184
+ let e = o[0], t = Infinity;
29185
+ for (let n of o) for (let r of s) {
29186
+ let i = QO(n, r);
29174
29187
  i < t && (t = i, e = n);
29175
29188
  }
29176
29189
  return e;
29177
29190
  }
29178
- return a[0];
29191
+ return o[0];
29179
29192
  }
29180
- function ek(e) {
29193
+ function nk(e) {
29181
29194
  if (e == null) return {};
29182
29195
  if (typeof e == "string") {
29183
29196
  let t = e.trim();
@@ -29190,12 +29203,12 @@ function ek(e) {
29190
29203
  }
29191
29204
  return e;
29192
29205
  }
29193
- function tk(e) {
29206
+ function rk(e) {
29194
29207
  if (!e || typeof e != "object") return null;
29195
29208
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
29196
29209
  return t == null ? null : String(t).trim() || null;
29197
29210
  }
29198
- function nk() {
29211
+ function ik() {
29199
29212
  let e = {};
29200
29213
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
29201
29214
  if (t.id) return;
@@ -29210,7 +29223,7 @@ function nk() {
29210
29223
  e[r] = !0, t.id = r;
29211
29224
  });
29212
29225
  }
29213
- function rk() {
29226
+ function ak() {
29214
29227
  let e = (e) => {
29215
29228
  let t = Array.from(e).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root") && !e.closest("nav, footer, header, aside, .nav, .footer, .header, .sidebar")), n = [], r = 0;
29216
29229
  for (; r < t.length;) {
@@ -29253,7 +29266,7 @@ function rk() {
29253
29266
  introText: o
29254
29267
  };
29255
29268
  }
29256
- function ik(e) {
29269
+ function ok(e) {
29257
29270
  if (!e || typeof document > "u") return "";
29258
29271
  let t = new Set([
29259
29272
  "script",
@@ -29339,11 +29352,11 @@ function ik(e) {
29339
29352
  return d.has(t) ? !1 : (d.add(t), !0);
29340
29353
  }).join("\n").replace(/\n{3,}/g, "\n\n").trim();
29341
29354
  }
29342
- function ak(e) {
29355
+ function sk(e) {
29343
29356
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
29344
29357
  "fwh-navigate-mvp": async (n) => {
29345
29358
  $("fwh-navigate-mvp ▶ raw parameters:", n);
29346
- let i = ek(n), a = tk(i);
29359
+ let i = nk(n), a = rk(i);
29347
29360
  if ($("fwh-navigate-mvp · coerced:", {
29348
29361
  url: a,
29349
29362
  sectionText: i.section_text ?? i.sectionText ?? i.section,
@@ -29377,11 +29390,11 @@ function ak(e) {
29377
29390
  return $("fwh-navigate-mvp ✖ blocked", e), e;
29378
29391
  }
29379
29392
  try {
29380
- OO(`Navigating to ${a}...`, { spinner: !0 }), NO(), zn();
29393
+ kO(`Navigating to ${a}...`, { spinner: !0 }), PO(), zn();
29381
29394
  try {
29382
29395
  let e = r ? r() : "";
29383
29396
  if (e && t) {
29384
- let n = CO([{
29397
+ let n = wO([{
29385
29398
  sender: "user",
29386
29399
  message: e
29387
29400
  }]);
@@ -29409,8 +29422,8 @@ function ak(e) {
29409
29422
  typeof window < "u" && window.scrollTo(0, 0);
29410
29423
  } catch {}
29411
29424
  let s = [], c = null, l = "", u = Date.now() + 12e3;
29412
- for (; Date.now() < u && (await new Promise((e) => setTimeout(e, 300)), {headings: s, pageTitleHeading: c, introText: l} = rk(), !(s.length >= 1)););
29413
- nk(), $("fwh-navigate-mvp → page headings collected:", s, "titleHeading:", c);
29425
+ for (; Date.now() < u && (await new Promise((e) => setTimeout(e, 300)), {headings: s, pageTitleHeading: c, introText: l} = ak(), !(s.length >= 1)););
29426
+ ik(), $("fwh-navigate-mvp → page headings collected:", s, "titleHeading:", c);
29414
29427
  let d = s.length ? s.join(" | ") : "none", f = s.length ? "Use ONLY these exact heading strings for fwh-highlight-mvp — never invent or abbreviate." : "No headings collected yet — call fwh-get-current-page-mvp immediately (no speech) to get the live headings before speaking or highlighting.", p = c ? ` "${c}" is the PAGE TITLE, not a content section — do not fwh-highlight-mvp it separately; if doing a walkthrough, just fold this intro into your opening line: "${l || "(no intro text found)"}"` : l ? ` No separate page-title heading detected, but this intro text precedes the first section — mention it briefly before covering sections: "${l}"` : "", m = "";
29415
29428
  try {
29416
29429
  if (s.length > 0) {
@@ -29418,7 +29431,7 @@ function ak(e) {
29418
29431
  for (let n of e) {
29419
29432
  let e = br(null, n);
29420
29433
  if (e) {
29421
- let r = ik(e).substring(0, 800);
29434
+ let r = ok(e).substring(0, 800);
29422
29435
  r && t.push(`[Section: ${n}] ${r}`);
29423
29436
  }
29424
29437
  }
@@ -29435,45 +29448,45 @@ function ak(e) {
29435
29448
  return `OK_NAVIGATE_RELOADING. Navigating to the page now; the voice session will resume automatically on the new page. When the session resumes, say EXACTLY: "I have navigated you on ${o} page. Do you want to know about any specific section or want a complete overview?" Then STOP — wait for the visitor's reply.`;
29436
29449
  } catch (e) {
29437
29450
  let t = `Navigation error: ${e?.message || String(e)}`;
29438
- return $("fwh-navigate-mvp ✖", t), OO("Navigation failed", {
29451
+ return $("fwh-navigate-mvp ✖", t), kO("Navigation failed", {
29439
29452
  spinner: !1,
29440
29453
  icon: "⚠️",
29441
29454
  duration: 1800
29442
29455
  }), t;
29443
29456
  } finally {
29444
- PO(), kO(900);
29457
+ FO(), AO(900);
29445
29458
  }
29446
29459
  },
29447
29460
  "fwh-highlight-mvp": async (e) => {
29448
29461
  $("fwh-highlight-mvp ▶", e);
29449
- let t = ek(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29462
+ let t = nk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29450
29463
  if (typeof window < "u" && window.__fe_user_nav_during_speech) {
29451
29464
  let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
29452
29465
  if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
29453
29466
  else return $("flowengage_highlight ✖ blocked — user navigated during speech", e), `NAV_CHANGED: The visitor navigated from "${e.fromPageName}" to "${e.toPageName}" (current path: ${t}) while you were speaking. STOP the current walkthrough immediately. DO NOT call flowengage_highlight again. Say out loud: "I see you've navigated to the ${e.toPageName} page — do you want me to continue what I was explaining, or shall I guide you through this page?" Wait for the visitor's answer before doing anything else.`;
29454
29467
  }
29455
- nk();
29468
+ ik();
29456
29469
  let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = br(n || null, i || null);
29457
29470
  if (!a && i) {
29458
29471
  let e = Date.now() + 600;
29459
- for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), nk(), a = br(null, i);
29472
+ for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), ik(), a = br(null, i);
29460
29473
  }
29461
29474
  if (!a) {
29462
29475
  $("fwh-highlight-mvp ✖ no element for:", i || n);
29463
- let { headings: e } = rk(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
29476
+ let { headings: e } = ak(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
29464
29477
  return `HIGHLIGHT_NOT_FOUND: "${i || n}" on the current page. ${t}`;
29465
29478
  }
29466
29479
  return Rn(a), $("fwh-highlight-mvp ✓", i || n), `OK_HIGHLIGHT: "${i || n}". WALKTHROUGH: continue immediately to the next section — do NOT pause between sections.`;
29467
29480
  },
29468
29481
  "fwh-read-content-mvp": async (e) => {
29469
29482
  $("fwh-read-content-mvp ▶", e);
29470
- let t = ek(e), n = t?.section_text || t?.sectionText || "";
29483
+ let t = nk(e), n = t?.section_text || t?.sectionText || "";
29471
29484
  try {
29472
29485
  let e = "";
29473
29486
  if (n) {
29474
29487
  let t = br(null, n);
29475
29488
  if (!t) return `Could not find section "${n}" on the page.`;
29476
- e = ik(t);
29489
+ e = ok(t);
29477
29490
  } else {
29478
29491
  let t = (document.querySelector("main") || document.querySelector("article") || document.querySelector("[role=\"main\"]") || document.querySelector("#content") || document.querySelector(".content") || document.body).cloneNode(!0);
29479
29492
  t.querySelectorAll("nav, footer, header, aside, script, style, noscript, .nav, .footer, .header, .sidebar, #flowengage-root, .flowengage-shell, .flowengage-widget-root").forEach((e) => e.remove()), e = t.textContent.replace(/\s+/g, " ").trim();
@@ -29485,7 +29498,7 @@ function ak(e) {
29485
29498
  },
29486
29499
  "fwh-page-content-mvp": async (e) => {
29487
29500
  $("fwh-page-content-mvp ▶", e);
29488
- let r = ek(e), i = r?.url || r?.page_url || "";
29501
+ let r = nk(e), i = r?.url || r?.page_url || "";
29489
29502
  if ($("fwh-page-content-mvp · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("fwh-page-content-mvp ✖ missing url"), "Missing url parameter.";
29490
29503
  if (!t) return $("fwh-page-content-mvp ✖ no siteId"), "Site is not configured.";
29491
29504
  if (!n) return $("fwh-page-content-mvp ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -29517,7 +29530,7 @@ function ak(e) {
29517
29530
  },
29518
29531
  "fwh-search-mvp": async (e) => {
29519
29532
  $("fwh-search-mvp ▶", e);
29520
- let r = ek(e).query;
29533
+ let r = nk(e).query;
29521
29534
  if (!r) return $("fwh-search-mvp ✖ missing query"), "Missing query parameter.";
29522
29535
  if (!t) return $("fwh-search-mvp ✖ no siteId"), "Search unavailable (no siteId configured).";
29523
29536
  if (!n) return $("fwh-search-mvp ✖ no api base"), "Search unavailable (no API base URL).";
@@ -29555,7 +29568,7 @@ function ak(e) {
29555
29568
  "[class*='menu'] a",
29556
29569
  "[class*='header'] a"
29557
29570
  ];
29558
- if (GO((t) => {
29571
+ if (KO((t) => {
29559
29572
  for (let r of n) try {
29560
29573
  t.querySelectorAll(r).forEach((t) => {
29561
29574
  if (Vn(t)) return;
@@ -29563,7 +29576,7 @@ function ak(e) {
29563
29576
  if (!r || !n || n === "#" || n.startsWith("javascript:")) return;
29564
29577
  try {
29565
29578
  let e = t.parentElement;
29566
- if (e && WO(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
29579
+ if (e && GO(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
29567
29580
  } catch {}
29568
29581
  let i = r.toLowerCase() + "|" + n;
29569
29582
  e.has(i) || e.set(i, {
@@ -29574,7 +29587,7 @@ function ak(e) {
29574
29587
  } catch {}
29575
29588
  t.querySelectorAll("select").forEach((t) => {
29576
29589
  if (Vn(t)) return;
29577
- let n = qO(t);
29590
+ let n = JO(t);
29578
29591
  /nav|menu|page|section|go to/i.test(n || t.name || t.id || "") && Array.from(t.options).forEach((r) => {
29579
29592
  if (!r.value || r.disabled) return;
29580
29593
  let i = r.text.trim();
@@ -29596,7 +29609,7 @@ function ak(e) {
29596
29609
  "fwh-request-email-mvp": async () => ($("fwh-request-email-mvp ▶"), typeof e.requestEmailCollection == "function" && e.requestEmailCollection(), "EMAIL_BOX_SHOWN. An email input text box is now visible to the visitor. Say EXACTLY: \"Please enter your email in the text box to continue.\" Then stop and wait silently — do NOT ask them to say it aloud, do NOT repeat, and do NOT answer any other question until you receive the EMAIL_SAVED message."),
29597
29610
  "fwh-get-current-page-mvp": async () => {
29598
29611
  if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
29599
- let e = window.location.href, t = window.location.pathname, n = document.title || "", { headings: r, pageTitleHeading: i, introText: a } = rk();
29612
+ let e = window.location.href, t = window.location.pathname, n = document.title || "", { headings: r, pageTitleHeading: i, introText: a } = ak();
29600
29613
  $("fwh-get-current-page-mvp ✓", {
29601
29614
  url: e,
29602
29615
  path: t,
@@ -29608,7 +29621,7 @@ function ak(e) {
29608
29621
  return `CURRENT_PAGE. URL: ${e} | Title: ${n} | Page sections (${r.length} total): ${s}.${o} *** WALKTHROUGH RULES: (1) For fwh-highlight-mvp, pass the heading text EXACTLY as shown — no numbers, no extra punctuation, no paraphrasing. (2) TIMING IS CRITICAL: the tool fires AFTER the speech that comes before it. This means: put the SHORT TRANSITION (1-5 words) BEFORE the tool call, put the FULL DESCRIPTION AFTER the tool call. Pattern: "Transition phrase." + fwh-highlight-mvp("Heading") + "Full description (3-4 sentences)". NEVER describe a section before calling its highlight tool. (3) DO NOT call this tool again. If the visitor requested a walkthrough: START IT NOW${o ? " (open with the intro note above first)" : ""} — "Let me walk you through this." + fwh-highlight-mvp("${r[0] || "first heading"}") + "Description..." etc. Cover ALL ${r.length} sections without pausing. ***`;
29609
29622
  },
29610
29623
  "fwh-list-forms-mvp": async () => {
29611
- let e = YO(), t = XO();
29624
+ let e = XO(), t = ZO();
29612
29625
  $("fwh-list-forms-mvp ✓", `${e.length} field(s)`, `${t.length} button(s)`);
29613
29626
  let n = e.map((e) => ({
29614
29627
  ...e,
@@ -29622,36 +29635,36 @@ function ak(e) {
29622
29635
  },
29623
29636
  "fwh-fill-form-mvp": async () => "FORM_FILLING_DISABLED: Form filling is not available at this time. Tell the visitor what fields are present (use fwh-list-forms-mvp) and ask them to fill the form themselves.",
29624
29637
  "fwh-click-button-mvp": async (e) => {
29625
- let t = ek(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29626
- if ($("fwh-click-button-mvp ▶", n), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
29627
- let r = $O(n, i);
29628
- if (!r) return $("fwh-click-button-mvp ✖ no match"), `Could not find a button matching "${n}". Call fwh-list-forms-mvp to see button texts.`;
29638
+ let t = nk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
29639
+ if ($("fwh-click-button-mvp ▶", n, r ? `(card_context: ${r})` : ""), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
29640
+ let a = tk(n, i, r);
29641
+ if (!a) return $("fwh-click-button-mvp ✖ no match"), `Could not find a button matching "${n}". Call fwh-list-forms-mvp to see button texts.`;
29629
29642
  try {
29630
- OO(`Clicking ${n}...`, { spinner: !0 });
29643
+ kO(`Clicking ${n}...`, { spinner: !0 });
29631
29644
  try {
29632
- r.scrollIntoView({
29645
+ a.scrollIntoView({
29633
29646
  block: "center",
29634
29647
  inline: "nearest"
29635
29648
  });
29636
29649
  } catch {
29637
- r.scrollIntoView(!0);
29650
+ a.scrollIntoView(!0);
29638
29651
  }
29639
- await zO(r), r.focus?.(), await VO(r), HO(r), r.click();
29640
- let e = (r.textContent || r.value || r.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
29641
- return $("fwh-click-button-mvp ✓", t), OO(`Clicked ${e}`, {
29652
+ await BO(a), a.focus?.(), await HO(a), UO(a), a.click();
29653
+ let e = (a.textContent || a.value || a.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
29654
+ return $("fwh-click-button-mvp ✓", t), kO(`Clicked ${e}`, {
29642
29655
  spinner: !1,
29643
29656
  icon: "✅",
29644
29657
  duration: 1200
29645
29658
  }), t;
29646
29659
  } catch (e) {
29647
29660
  let t = `Click failed: ${e?.message || String(e)}`;
29648
- return $("fwh-click-button-mvp ✖", t), OO("Click failed", {
29661
+ return $("fwh-click-button-mvp ✖", t), kO("Click failed", {
29649
29662
  spinner: !1,
29650
29663
  icon: "⚠️",
29651
29664
  duration: 1800
29652
29665
  }), t;
29653
29666
  } finally {
29654
- BO(), kO(700);
29667
+ VO(), AO(700);
29655
29668
  }
29656
29669
  }
29657
29670
  };
@@ -29667,7 +29680,7 @@ function ak(e) {
29667
29680
  }
29668
29681
  //#endregion
29669
29682
  //#region src/utils/wrapVoiceToolsForLogging.js
29670
- function ok(e) {
29683
+ function ck(e) {
29671
29684
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29672
29685
  let r = Fn();
29673
29686
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -29684,7 +29697,7 @@ function ok(e) {
29684
29697
  }
29685
29698
  //#endregion
29686
29699
  //#region src/components/FlowEngageWidget.jsx
29687
- var sk = {
29700
+ var lk = {
29688
29701
  blue: "#135bd8",
29689
29702
  red: "#ef334b",
29690
29703
  yellow: "#ffbd2e",
@@ -29692,7 +29705,7 @@ var sk = {
29692
29705
  highlight: "rgba(255,255,255,0.9)",
29693
29706
  green: "#10b981"
29694
29707
  };
29695
- function ck(e) {
29708
+ function uk(e) {
29696
29709
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
29697
29710
  let [t, n, r] = e;
29698
29711
  return e.length >= 3 && r ? [
@@ -29706,12 +29719,12 @@ function ck(e) {
29706
29719
  "#f7f8fa"
29707
29720
  ].join(", ");
29708
29721
  }
29709
- function lk(e) {
29722
+ function dk(e) {
29710
29723
  if (!e || typeof e != "string") return "#1a1a1a";
29711
29724
  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;
29712
29725
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
29713
29726
  }
29714
- function uk(t) {
29727
+ function fk(t) {
29715
29728
  let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
29716
29729
  return e.useEffect(() => {
29717
29730
  if (!i) {
@@ -29729,8 +29742,8 @@ function uk(t) {
29729
29742
  };
29730
29743
  }, [i]), n;
29731
29744
  }
29732
- function dk({ logo: t, style: n }) {
29733
- let r = uk(typeof t == "string" ? t : null);
29745
+ function pk({ logo: t, style: n }) {
29746
+ let r = fk(typeof t == "string" ? t : null);
29734
29747
  if (!t) return null;
29735
29748
  if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
29736
29749
  src: r,
@@ -29755,7 +29768,7 @@ function dk({ logo: t, style: n }) {
29755
29768
  children: i
29756
29769
  }) : null;
29757
29770
  }
29758
- function fk({ title: e }) {
29771
+ function mk({ title: e }) {
29759
29772
  return /* @__PURE__ */ g("div", {
29760
29773
  style: {
29761
29774
  width: "100%",
@@ -29773,18 +29786,18 @@ function fk({ title: e }) {
29773
29786
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
29774
29787
  });
29775
29788
  }
29776
- function pk(e, t) {
29789
+ function hk(e, t) {
29777
29790
  let n = (t || "").trim();
29778
29791
  return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || e === "bot" && (/\b(that'?s all|we'?re done)\b/i.test(n) || /\b(goodbye|bye)\b/i.test(n) || /\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n))) : !1;
29779
29792
  }
29780
- function mk({ orbColors: e, ...t }) {
29781
- return /* @__PURE__ */ g(mO, {
29793
+ function gk({ orbColors: e, ...t }) {
29794
+ return /* @__PURE__ */ g(hO, {
29782
29795
  colors: e,
29783
29796
  ...t
29784
29797
  });
29785
29798
  }
29786
- function hk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29787
- let s = n || sk.green, c = lk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29799
+ function _k({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29800
+ let s = n || lk.green, c = dk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29788
29801
  style: {
29789
29802
  display: "flex",
29790
29803
  alignItems: a ? "flex-end" : "center",
@@ -29910,7 +29923,7 @@ function hk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29910
29923
  delay: 0
29911
29924
  },
29912
29925
  style: { flexShrink: 0 },
29913
- children: /* @__PURE__ */ g(mk, {
29926
+ children: /* @__PURE__ */ g(gk, {
29914
29927
  size: l,
29915
29928
  orbColors: t
29916
29929
  })
@@ -29942,8 +29955,8 @@ function hk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29942
29955
  children: u
29943
29956
  })] });
29944
29957
  }
29945
- function gk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29946
- let c = n || sk.green, l = lk(c);
29958
+ function vk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29959
+ let c = n || lk.green, l = dk(c);
29947
29960
  return /* @__PURE__ */ _(Pm.div, {
29948
29961
  initial: {
29949
29962
  scale: 50 / 350,
@@ -30014,7 +30027,7 @@ function gk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
30014
30027
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
30015
30028
  })
30016
30029
  }),
30017
- /* @__PURE__ */ g(mk, {
30030
+ /* @__PURE__ */ g(gk, {
30018
30031
  size: 72,
30019
30032
  orbColors: t
30020
30033
  }),
@@ -30094,7 +30107,7 @@ function gk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
30094
30107
  ]
30095
30108
  });
30096
30109
  }
30097
- function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, voiceEndCounter: d, websiteName: f, voiceFirstMessage: h, captureVisitorEmail: v, emailRequired: y, emailCaptureEnabled: b = !0, listeningLabel: x = "Listening...", enterChatModeLabel: S = "Enter Chat Mode", endConversationLabel: C = "End Conversation" }) {
30110
+ function yk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, voiceEndCounter: d, websiteName: f, voiceFirstMessage: h, captureVisitorEmail: v, emailRequired: y, emailCaptureEnabled: b = !0, listeningLabel: x = "Listening...", enterChatModeLabel: S = "Enter Chat Mode", endConversationLabel: C = "End Conversation" }) {
30098
30111
  c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
30099
30112
  let [w, T] = m("idle"), [E, ee] = m(!1), [te, ne] = m(!1), [re, ie] = m(!1), [ae, oe] = m(""), [D, se] = m(""), ce = p(!1), le = p(!1), ue = p(null), de = p(0), fe = p(""), O = p(null), pe = p(""), me = p(async () => {}), he = p(!1), ge = p(!1), _e = p(!1), ve = p(!1), ye = p("minimized"), be = p(null), xe = p(null), Se = p(null), Ce = p(0), we = p(!1), Te = p("idle"), Ee = p(!1), De = p(!1), Oe = p(null), A = p(null), Me = p(!1), Ne = o((e = "minimized") => {
30100
30113
  console.warn("[FlowEngage:VoiceDebug] 🛑 requestSessionShutdown called", {
@@ -30171,7 +30184,7 @@ function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30171
30184
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
30172
30185
  l.current = [], pe.current = "", he.current = !1, _e.current = !1, ve.current = !1, ye.current = "minimized", Fr({ onBeforeNavigate: () => {
30173
30186
  if (i && l.current.length > 0) try {
30174
- let e = CO(l.current);
30187
+ let e = wO(l.current);
30175
30188
  e && k(i, e);
30176
30189
  } catch {}
30177
30190
  if (!ar()) {
@@ -30193,7 +30206,7 @@ function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30193
30206
  }
30194
30207
  je();
30195
30208
  } });
30196
- let t = ok(ak({
30209
+ let t = ck(sk({
30197
30210
  siteId: i || null,
30198
30211
  apiBaseUrl: a || null,
30199
30212
  chatId: s || null,
@@ -30301,10 +30314,10 @@ function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30301
30314
  message: r,
30302
30315
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
30303
30316
  }], i) try {
30304
- let e = CO(l.current);
30317
+ let e = wO(l.current);
30305
30318
  e && k(i, e);
30306
30319
  } catch {}
30307
- if (pk(n, r)) {
30320
+ if (hk(n, r)) {
30308
30321
  we.current = !0;
30309
30322
  return;
30310
30323
  }
@@ -30360,7 +30373,7 @@ function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30360
30373
  n.length || (n = Array.from(document.body.querySelectorAll("h1, h2, h3")).filter((t) => !t.closest(e)).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200)), n.length && (a = [...new Set(n)].slice(0, 15).join(" | "));
30361
30374
  } catch {}
30362
30375
  let o = u && !m ? `RESUMING PRIOR SESSION — DO NOT GREET. The visitor is continuing the same conversation after a page reload. Do not introduce yourself or re-state your capabilities. Wait silently until the visitor speaks; if you must speak first, briefly acknowledge where you left off in one short sentence.\nPrior transcript:\n${n?.transcript || ""}\n\n` : "";
30363
- Pe.sendContextualUpdate(`${o}SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${a}. SiteId: ${i || "unknown"}. Forms: ${r}. The visitor is ALREADY on this page — do NOT offer to navigate there. WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. The approximate headings above are for routing awareness ONLY — they are NOT precise enough for fwh-highlight-mvp. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`);
30376
+ Pe.sendContextualUpdate(`${o}SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${a}. SiteId: ${i || "unknown"}. Forms: ${r}. ${y ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}The visitor is ALREADY on this page — do NOT offer to navigate there. WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. The approximate headings above are for routing awareness ONLY — they are NOT precise enough for fwh-highlight-mvp. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`);
30364
30377
  } catch {}
30365
30378
  if (typeof window < "u") {
30366
30379
  let t = window.location.pathname, n = () => {
@@ -30601,7 +30614,7 @@ function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30601
30614
  },
30602
30615
  children: "Muted"
30603
30616
  }),
30604
- /* @__PURE__ */ g(mk, {
30617
+ /* @__PURE__ */ g(gk, {
30605
30618
  size: 72,
30606
30619
  voiceState: w,
30607
30620
  isMuted: E,
@@ -30825,7 +30838,7 @@ function _k({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30825
30838
  ]
30826
30839
  });
30827
30840
  }
30828
- function vk({ orbColors: e }) {
30841
+ function bk({ orbColors: e }) {
30829
30842
  let t = Array.isArray(e) && e.length > 0 ? e : [
30830
30843
  "#135bd8",
30831
30844
  "#ef334b",
@@ -30844,7 +30857,7 @@ function vk({ orbColors: e }) {
30844
30857
  `.replace(/\s+/g, " ").trim()
30845
30858
  } });
30846
30859
  }
30847
- var yk = () => /* @__PURE__ */ g("div", {
30860
+ var xk = () => /* @__PURE__ */ g("div", {
30848
30861
  style: {
30849
30862
  display: "flex",
30850
30863
  marginBottom: "12px",
@@ -30874,7 +30887,7 @@ var yk = () => /* @__PURE__ */ g("div", {
30874
30887
  } }, e))
30875
30888
  })
30876
30889
  });
30877
- function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: ee, selectedFile: te, onFileSelect: ne, onRemoveSelectedFile: re, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: O, setMicError: pe, dismissCallError: me, activeCallId: he, isCallMuted: ge, toggleCallMute: _e, endWebRTCCall: ve, formatCallDuration: ye, callDurationSeconds: be, isCallMinimized: xe, onExpand: Se, onCollapse: Ce, onStartVoice: we, voiceEnabled: Te, headerBgColor: Ee, onNewChat: De, showPoweredBy: Oe, privacyPolicyUrl: k, getVisitorChatHistory: ke, resumeChat: Ae, isSessionRestoring: A, isClosing: je }) {
30890
+ function Sk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: ee, selectedFile: te, onFileSelect: ne, onRemoveSelectedFile: re, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: O, setMicError: pe, dismissCallError: me, activeCallId: he, isCallMuted: ge, toggleCallMute: _e, endWebRTCCall: ve, formatCallDuration: ye, callDurationSeconds: be, isCallMinimized: xe, onExpand: Se, onCollapse: Ce, onStartVoice: we, voiceEnabled: Te, headerBgColor: Ee, onNewChat: De, showPoweredBy: Oe, privacyPolicyUrl: k, getVisitorChatHistory: ke, resumeChat: Ae, isSessionRestoring: A, isClosing: je }) {
30878
30891
  let Me = l.length > 0, Ne = T || E || w, Pe = !!he, [Fe, Ie] = m(!1), [Le, Re] = m(!1), [ze, Be] = m([]), [Ve, He] = m(!1), Ue = p(null), [We, j] = m(() => typeof window < "u" ? window.visualViewport?.height ?? window.innerHeight : 600), [Ge, Ke] = m(0);
30879
30892
  c(() => {
30880
30893
  if (!s) return;
@@ -30912,10 +30925,10 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30912
30925
  "--flowengage-primary": n,
30913
30926
  "--flowengage-accent": n,
30914
30927
  position: "fixed",
30915
- left: "8px",
30916
- right: "8px",
30928
+ left: "0",
30929
+ right: "0",
30917
30930
  bottom: `${Ge}px`,
30918
- height: We > 0 ? `${Math.round(We * .92)}px` : "90dvh",
30931
+ height: We > 0 ? `${Math.round(We * (qe ? 1 : .92))}px` : "90dvh",
30919
30932
  background: r,
30920
30933
  borderRadius: "16px 16px 0 0",
30921
30934
  display: "flex",
@@ -31014,7 +31027,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31014
31027
  justifyContent: "center",
31015
31028
  height: "40px"
31016
31029
  },
31017
- children: i ? /* @__PURE__ */ g(dk, {
31030
+ children: i ? /* @__PURE__ */ g(pk, {
31018
31031
  logo: i,
31019
31032
  style: {
31020
31033
  height: "34px",
@@ -31027,7 +31040,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31027
31040
  height: "40px",
31028
31041
  flexShrink: 0
31029
31042
  },
31030
- children: /* @__PURE__ */ g(fk, { title: e.chatTitle })
31043
+ children: /* @__PURE__ */ g(mk, { title: e.chatTitle })
31031
31044
  })
31032
31045
  }), o && /* @__PURE__ */ g("div", {
31033
31046
  style: {
@@ -31310,7 +31323,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31310
31323
  })
31311
31324
  ]
31312
31325
  }),
31313
- /* @__PURE__ */ g(aO, {
31326
+ /* @__PURE__ */ g(oO, {
31314
31327
  webRTCError: fe,
31315
31328
  micError: O,
31316
31329
  setMicError: pe,
@@ -31318,7 +31331,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31318
31331
  isRateLimited: E,
31319
31332
  rateLimitMessage: ee
31320
31333
  }),
31321
- xe && /* @__PURE__ */ g(SO, {
31334
+ xe && /* @__PURE__ */ g(CO, {
31322
31335
  agentName: v,
31323
31336
  agentHeadshot: y,
31324
31337
  fallbackAgentName: b,
@@ -31458,11 +31471,11 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31458
31471
  isLoading: T,
31459
31472
  isAgentTyping: d,
31460
31473
  setReplyContext: de,
31461
- TypingDots: yk,
31474
+ TypingDots: xk,
31462
31475
  primaryColor: n,
31463
31476
  agentHeadshot: y,
31464
31477
  agentDisplayName: v || b,
31465
- botAvatarNode: /* @__PURE__ */ g(vk, { orbColors: t })
31478
+ botAvatarNode: /* @__PURE__ */ g(bk, { orbColors: t })
31466
31479
  }) : A ? /* @__PURE__ */ _("div", {
31467
31480
  style: {
31468
31481
  flex: 1,
@@ -31503,7 +31516,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31503
31516
  padding: "28px 24px"
31504
31517
  },
31505
31518
  children: [
31506
- /* @__PURE__ */ g(mk, {
31519
+ /* @__PURE__ */ g(gk, {
31507
31520
  size: 94,
31508
31521
  orbColors: t
31509
31522
  }),
@@ -31594,7 +31607,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31594
31607
  zIndex: 1,
31595
31608
  padding: oe ? "6px 0 0" : "12px 0 0"
31596
31609
  },
31597
- children: /* @__PURE__ */ g(iO, {
31610
+ children: /* @__PURE__ */ g(aO, {
31598
31611
  input: x,
31599
31612
  setInput: S,
31600
31613
  onSubmit: C,
@@ -31668,7 +31681,7 @@ function bk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31668
31681
  ]
31669
31682
  });
31670
31683
  }
31671
- function xk() {
31684
+ function Ck() {
31672
31685
  let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: E, callConnectedAt: ee, isCallMuted: te, webRTCError: ne, language: re, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: pe, acceptCall: me, rejectCall: he, endWebRTCCall: ge, toggleCallMute: _e, dismissCallError: ve, startTyping: ye, stopTyping: be, updateTypingDraft: xe, getVisitorChatHistory: Se, resumeChat: Ce, isSessionRestoring: we, openToChatCounter: Te, voiceEndCounter: Ee } = Pn();
31673
31686
  c(() => {
31674
31687
  try {
@@ -31690,7 +31703,7 @@ function xk() {
31690
31703
  small: 50,
31691
31704
  medium: 64,
31692
31705
  large: 80
31693
- }, Re = Le[A.orbSize] || Le.small, ze = A.position || "bottom-right", Be = k.fallbackAgentName || "Agent", Ve = ck(Pe ?? A.chatBgColors), He = k.logo || k.logoUrl || null, Ue = re || "en", We = De.recommendations?.[Ue] || [], j = (Oe.recommendations?.[Ue] ?? We).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31706
+ }, Re = Le[A.orbSize] || Le.small, ze = A.position || "bottom-right", Be = k.fallbackAgentName || "Agent", Ve = uk(Pe ?? A.chatBgColors), He = k.logo || k.logoUrl || null, Ue = re || "en", We = De.recommendations?.[Ue] || [], j = (Oe.recommendations?.[Ue] ?? We).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31694
31707
  id: e.key || `qr-${t}`,
31695
31708
  label: e.label,
31696
31709
  message: e.label,
@@ -31980,7 +31993,7 @@ function xk() {
31980
31993
  onWheel: (e) => e.stopPropagation(),
31981
31994
  onTouchMove: (e) => e.stopPropagation(),
31982
31995
  children: [
31983
- P === "entry_prompt" && /* @__PURE__ */ g(hk, {
31996
+ P === "entry_prompt" && /* @__PURE__ */ g(_k, {
31984
31997
  copy: nt,
31985
31998
  orbColors: Pe,
31986
31999
  primaryColor: Ie,
@@ -32063,13 +32076,13 @@ function xk() {
32063
32076
  children: E === "connected" ? `${Kt(bt)} with ${it}` : `Tap to return to ${it}`
32064
32077
  })]
32065
32078
  })]
32066
- }), /* @__PURE__ */ g(mk, {
32079
+ }), /* @__PURE__ */ g(gk, {
32067
32080
  size: Re,
32068
32081
  orbColors: Pe,
32069
32082
  onClick: T ? Vt : Ne ? Xt : Qt
32070
32083
  })]
32071
32084
  }),
32072
- P === "connection_modal" && /* @__PURE__ */ g(gk, {
32085
+ P === "connection_modal" && /* @__PURE__ */ g(vk, {
32073
32086
  copy: nt,
32074
32087
  orbColors: Pe,
32075
32088
  primaryColor: Ie,
@@ -32079,7 +32092,7 @@ function xk() {
32079
32092
  isMobile: Lt,
32080
32093
  isClosing: Mt
32081
32094
  }),
32082
- P === "voice_mode" && /* @__PURE__ */ g(_k, {
32095
+ P === "voice_mode" && /* @__PURE__ */ g(yk, {
32083
32096
  orbColors: Pe,
32084
32097
  onEnterChat: Qt,
32085
32098
  onEndChat: $t,
@@ -32099,7 +32112,7 @@ function xk() {
32099
32112
  enterChatModeLabel: k.voiceEnterChatLabel || "Enter Chat Mode",
32100
32113
  endConversationLabel: k.voiceEndConversationLabel || "End Conversation"
32101
32114
  }, "voice"),
32102
- P === "call_screen" && /* @__PURE__ */ g(xO, {
32115
+ P === "call_screen" && /* @__PURE__ */ g(SO, {
32103
32116
  incomingCall: w,
32104
32117
  activeCallId: T,
32105
32118
  callConnectionState: E,
@@ -32118,7 +32131,7 @@ function xk() {
32118
32131
  orbColors: Pe,
32119
32132
  chatHistory: r
32120
32133
  }),
32121
- P === "text_chat" && /* @__PURE__ */ g(bk, {
32134
+ P === "text_chat" && /* @__PURE__ */ g(Sk, {
32122
32135
  isClosing: Mt,
32123
32136
  copy: nt,
32124
32137
  orbColors: Pe,
@@ -32184,7 +32197,7 @@ function xk() {
32184
32197
  }
32185
32198
  //#endregion
32186
32199
  //#region src/components/ErrorBoundary.jsx
32187
- var Sk = class extends e.Component {
32200
+ var wk = class extends e.Component {
32188
32201
  constructor(e) {
32189
32202
  super(e), this.state = { hasError: !1 };
32190
32203
  }
@@ -32199,4 +32212,4 @@ var Sk = class extends e.Component {
32199
32212
  }
32200
32213
  };
32201
32214
  //#endregion
32202
- export { mO as AnimatedOrb, Sk as ErrorBoundary, Wr as FlowEngageProvider, xk as FlowEngageWidget, Pn as useFlowEngage };
32215
+ export { hO as AnimatedOrb, wk as ErrorBoundary, Wr as FlowEngageProvider, Ck as FlowEngageWidget, Pn as useFlowEngage };