@flowengage/react-chatbot 6.0.3 → 6.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26274,43 +26274,29 @@ var vD = class extends UE {
26274
26274
  static startSession(e) {
26275
26275
  return e.textOnly ? oD.startSession(e) : dD.startSession(e);
26276
26276
  }
26277
- }, yD = {
26278
- wordsSoFar: 0,
26279
- speechStartTime: 0,
26280
- isSpeaking: !1,
26281
- items: [],
26282
- timers: [],
26283
- lastHighlightId: null,
26284
- isVoiceMode: !1
26285
- };
26286
- function bD() {
26287
- yD.timers.forEach(clearTimeout), yD.wordsSoFar = 0, yD.speechStartTime = 0, yD.isSpeaking = !1, yD.items = [], yD.timers = [], yD.lastHighlightId = null;
26288
- }
26289
- //#endregion
26290
- //#region src/utils/highlightEngine.js
26291
- var xD = 80;
26292
- function SD(e) {
26277
+ }, yD = 80;
26278
+ function bD(e) {
26293
26279
  requestAnimationFrame(() => {
26294
- let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = xD, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
26280
+ let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = yD, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
26295
26281
  window.scrollTo({
26296
26282
  top: Math.max(0, a),
26297
26283
  behavior: "smooth"
26298
26284
  });
26299
26285
  });
26300
26286
  }
26301
- function CD(e) {
26287
+ function xD(e) {
26302
26288
  if (!e || e.hasAttribute("data-fe-highlighted")) return;
26303
- wD(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), SD(e);
26289
+ SD(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), bD(e);
26304
26290
  let t = e.style.cssText;
26305
26291
  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";
26306
26292
  }
26307
- function wD() {
26293
+ function SD() {
26308
26294
  let e = document.querySelector("[data-fe-highlighted]");
26309
26295
  e && (e.style.cssText = e.getAttribute("data-fe-orig-style") || "", e.removeAttribute("data-fe-highlighted"), e.removeAttribute("data-fe-orig-style"));
26310
26296
  }
26311
26297
  //#endregion
26312
26298
  //#region src/lib/svgIcons.jsx
26313
- var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
26299
+ var CD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
26314
26300
  width: e,
26315
26301
  height: e,
26316
26302
  viewBox: "0 0 24 24",
@@ -26326,7 +26312,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26326
26312
  strokeLinecap: "round",
26327
26313
  strokeLinejoin: "round"
26328
26314
  })]
26329
- }), ED = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
26315
+ }), wD = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
26330
26316
  width: e,
26331
26317
  height: e,
26332
26318
  viewBox: "0 0 24 24",
@@ -26341,7 +26327,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26341
26327
  x2: "1",
26342
26328
  y2: "23"
26343
26329
  })]
26344
- }), DD = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
26330
+ }), TD = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
26345
26331
  width: e,
26346
26332
  height: e,
26347
26333
  viewBox: "0 0 24 24",
@@ -26356,7 +26342,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26356
26342
  x2: "12",
26357
26343
  y2: "5"
26358
26344
  }), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
26359
- }), OD = () => /* @__PURE__ */ _("svg", {
26345
+ }), ED = () => /* @__PURE__ */ _("svg", {
26360
26346
  width: "14",
26361
26347
  height: "14",
26362
26348
  viewBox: "0 0 24 24",
@@ -26366,7 +26352,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26366
26352
  strokeLinecap: "round",
26367
26353
  strokeLinejoin: "round",
26368
26354
  children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
26369
- }), kD = () => /* @__PURE__ */ g("svg", {
26355
+ }), DD = () => /* @__PURE__ */ g("svg", {
26370
26356
  width: "18",
26371
26357
  height: "18",
26372
26358
  viewBox: "0 0 24 24",
@@ -26376,7 +26362,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26376
26362
  strokeLinecap: "round",
26377
26363
  strokeLinejoin: "round",
26378
26364
  children: /* @__PURE__ */ g("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6.12-6.11A19.79 19.79 0 012 4.11 2 2 0 014.11 2h3a2 2 0 012 1.72c.13.96.37 1.91.71 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.9.34 1.85.58 2.81.71A2 2 0 0122 16.92z" })
26379
- }), AD = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
26365
+ }), OD = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
26380
26366
  className: e,
26381
26367
  width: "14",
26382
26368
  height: "14",
@@ -26405,7 +26391,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26405
26391
  y2: "16"
26406
26392
  })
26407
26393
  ]
26408
- }), jD = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
26394
+ }), kD = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
26409
26395
  width: e,
26410
26396
  height: e,
26411
26397
  viewBox: "0 0 24 24",
@@ -26428,7 +26414,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26428
26414
  /* @__PURE__ */ g("path", { d: "M15 13v2" }),
26429
26415
  /* @__PURE__ */ g("path", { d: "M9 13v2" })
26430
26416
  ]
26431
- }), MD = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
26417
+ }), AD = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
26432
26418
  width: e,
26433
26419
  height: e,
26434
26420
  viewBox: "0 0 24 24",
@@ -26448,7 +26434,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26448
26434
  x2: "19",
26449
26435
  y2: "12"
26450
26436
  })]
26451
- }), ND = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
26437
+ }), jD = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
26452
26438
  width: e,
26453
26439
  height: e,
26454
26440
  viewBox: "0 0 24 24",
@@ -26474,7 +26460,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26474
26460
  fill: t
26475
26461
  })
26476
26462
  ]
26477
- }), PD = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
26463
+ }), MD = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
26478
26464
  width: "24",
26479
26465
  height: "24",
26480
26466
  viewBox: "0 0 24 24",
@@ -26492,7 +26478,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26492
26478
  "stroke-linecap": "round",
26493
26479
  "stroke-linejoin": "round"
26494
26480
  })]
26495
- }), FD = () => /* @__PURE__ */ g("svg", {
26481
+ }), ND = () => /* @__PURE__ */ g("svg", {
26496
26482
  width: "24",
26497
26483
  height: "24",
26498
26484
  viewBox: "0 0 24 24",
@@ -26504,7 +26490,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26504
26490
  "stroke-width": "1.5",
26505
26491
  "stroke-linejoin": "round"
26506
26492
  })
26507
- }), ID = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
26493
+ }), PD = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
26508
26494
  xmlns: "http://www.w3.org/2000/svg",
26509
26495
  width: e,
26510
26496
  height: e,
@@ -26522,7 +26508,7 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26522
26508
  /* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
26523
26509
  /* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
26524
26510
  ]
26525
- }), LD = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), RD = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), zD = new Set([
26511
+ }), FD = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), ID = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), LD = new Set([
26526
26512
  "p",
26527
26513
  "br",
26528
26514
  "ul",
@@ -26533,30 +26519,30 @@ var TD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
26533
26519
  "b",
26534
26520
  "i",
26535
26521
  "a"
26536
- ]), BD = /^https?:\/\//i;
26537
- function VD(e) {
26522
+ ]), RD = /^https?:\/\//i;
26523
+ function zD(e) {
26538
26524
  let t = Array.from(e.childNodes);
26539
26525
  for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
26540
26526
  let t = n.tagName.toLowerCase();
26541
- if (!zD.has(t)) {
26527
+ if (!LD.has(t)) {
26542
26528
  e.replaceChild(document.createTextNode(n.textContent), n);
26543
26529
  continue;
26544
26530
  }
26545
26531
  let r = {};
26546
26532
  if (t === "a") {
26547
26533
  let e = n.getAttribute("href") || "";
26548
- BD.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
26534
+ RD.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
26549
26535
  }
26550
26536
  for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
26551
26537
  for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
26552
- VD(n);
26538
+ zD(n);
26553
26539
  } else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
26554
26540
  }
26555
- function HD(e) {
26541
+ function BD(e) {
26556
26542
  let t = document.createElement("div");
26557
- return t.innerHTML = e, VD(t), t.innerHTML;
26543
+ return t.innerHTML = e, zD(t), t.innerHTML;
26558
26544
  }
26559
- function UD(e) {
26545
+ function VD(e) {
26560
26546
  let t = String(e || "").trim();
26561
26547
  if (!t) return t;
26562
26548
  let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
@@ -26568,33 +26554,33 @@ function UD(e) {
26568
26554
  }
26569
26555
  return e;
26570
26556
  }
26571
- var WD = (e = "") => {
26557
+ var HD = (e = "") => {
26572
26558
  let t = String(e || "").trim();
26573
26559
  if (!t) return "";
26574
- if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return UD(HD(t));
26575
- let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) => RD(e).replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*\n]+)\*/g, "<em>$1</em>");
26576
- return UD(n.map((e) => {
26560
+ if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return VD(BD(t));
26561
+ let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) => ID(e).replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*\n]+)\*/g, "<em>$1</em>");
26562
+ return VD(n.map((e) => {
26577
26563
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
26578
26564
  if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
26579
26565
  let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
26580
26566
  return i.length >= 2 && i.every((e) => /^[-*]\s+/.test(e)) ? `<ul>${i.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>` : `<p>${r(e).replace(/\n/g, "<br />")}</p>`;
26581
26567
  }).join(""));
26582
- }, GD = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), KD = new Set([
26568
+ }, UD = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), WD = new Set([
26583
26569
  ".pdf",
26584
26570
  ".docx",
26585
26571
  ".png",
26586
26572
  ".jpg",
26587
26573
  ".jpeg"
26588
- ]), qD = "image/png,image/jpeg,.pdf,.docx";
26589
- function JD(e) {
26574
+ ]), GD = "image/png,image/jpeg,.pdf,.docx";
26575
+ function KD(e) {
26590
26576
  if (!e) return !1;
26591
26577
  let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
26592
- return r === "image/png" || r === "image/jpeg" || GD.has(r) || KD.has(n);
26578
+ return r === "image/png" || r === "image/jpeg" || UD.has(r) || WD.has(n);
26593
26579
  }
26594
- function YD(e) {
26595
- return e ? JD(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
26580
+ function qD(e) {
26581
+ return e ? KD(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
26596
26582
  }
26597
- function XD(e = 0) {
26583
+ function JD(e = 0) {
26598
26584
  if (!Number.isFinite(e) || e <= 0) return "";
26599
26585
  let t = [
26600
26586
  "B",
@@ -26606,12 +26592,12 @@ function XD(e = 0) {
26606
26592
  let i = n >= 10 || r === 0 ? 0 : 1;
26607
26593
  return `${n.toFixed(i)} ${t[r]}`;
26608
26594
  }
26609
- function ZD(e) {
26595
+ function YD(e) {
26610
26596
  return e ? e.name || "Attachment" : "";
26611
26597
  }
26612
26598
  //#endregion
26613
26599
  //#region src/utils/avatarHelpers.js
26614
- function QD(e) {
26600
+ function XD(e) {
26615
26601
  if (!e || typeof e != "string") return "?";
26616
26602
  let t = e.trim();
26617
26603
  if (!t) return "?";
@@ -26620,7 +26606,7 @@ function QD(e) {
26620
26606
  }
26621
26607
  //#endregion
26622
26608
  //#region src/components/AvatarImageOrInitials.jsx
26623
- function $D({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
26609
+ function ZD({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
26624
26610
  let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
26625
26611
  return c(() => {
26626
26612
  if (!o) {
@@ -26642,12 +26628,12 @@ function $D({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
26642
26628
  style: n
26643
26629
  }) : /* @__PURE__ */ g("span", {
26644
26630
  style: r,
26645
- children: QD(t)
26631
+ children: XD(t)
26646
26632
  });
26647
26633
  }
26648
26634
  //#endregion
26649
26635
  //#region src/components/MessageList.jsx
26650
- function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
26636
+ function QD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
26651
26637
  let { resolvedConfig: d } = Ln(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
26652
26638
  let t = e.target.closest("a[href]");
26653
26639
  if (!t) return;
@@ -26702,7 +26688,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
26702
26688
  children: [
26703
26689
  e.map((e) => {
26704
26690
  if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
26705
- let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m = LD(e.replyToContent || e.replyContext?.message || ""), v = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
26691
+ let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m = FD(e.replyToContent || e.replyContext?.message || ""), v = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
26706
26692
  return t ? /* @__PURE__ */ g("div", {
26707
26693
  style: {
26708
26694
  display: "flex",
@@ -26747,7 +26733,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
26747
26733
  fontWeight: 800,
26748
26734
  marginTop: !c && (r || o) ? "22px" : "0px"
26749
26735
  },
26750
- children: r ? u || /* @__PURE__ */ g(jD, { size: 16 }) : /* @__PURE__ */ g($D, {
26736
+ children: r ? u || /* @__PURE__ */ g(kD, { size: 16 }) : /* @__PURE__ */ g(ZD, {
26751
26737
  src: p || "",
26752
26738
  name: f,
26753
26739
  imgStyle: {
@@ -26789,7 +26775,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
26789
26775
  onMouseLeave: (e) => {
26790
26776
  e.currentTarget.style.color = "#9ca3af";
26791
26777
  },
26792
- children: [/* @__PURE__ */ g(OD, {}), "Reply"]
26778
+ children: [/* @__PURE__ */ g(ED, {}), "Reply"]
26793
26779
  }),
26794
26780
  /* @__PURE__ */ _("div", {
26795
26781
  style: {
@@ -26833,7 +26819,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
26833
26819
  children: m
26834
26820
  })]
26835
26821
  }), d ? (() => {
26836
- let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = XD(e.metadata.fileSize), a = t.startsWith("image/"), o = t === "application/pdf" ? {
26822
+ let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = JD(e.metadata.fileSize), a = t.startsWith("image/"), o = t === "application/pdf" ? {
26837
26823
  color: "#ef4444",
26838
26824
  label: "PDF"
26839
26825
  } : t.includes("word") || t.includes("docx") ? {
@@ -27005,7 +26991,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27005
26991
  });
27006
26992
  })() : r ? /* @__PURE__ */ g("div", {
27007
26993
  className: "flowengage-message-content fe-bot-message",
27008
- dangerouslySetInnerHTML: { __html: WD(e.message) },
26994
+ dangerouslySetInnerHTML: { __html: HD(e.message) },
27009
26995
  onClick: T
27010
26996
  }) : /* @__PURE__ */ g("div", {
27011
26997
  style: { whiteSpace: n || o ? "normal" : "pre-wrap" },
@@ -27070,7 +27056,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27070
27056
  boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
27071
27057
  overflow: "hidden"
27072
27058
  },
27073
- children: u || /* @__PURE__ */ g(jD, { size: 16 })
27059
+ children: u || /* @__PURE__ */ g(kD, { size: 16 })
27074
27060
  }), /* @__PURE__ */ _("div", {
27075
27061
  style: {
27076
27062
  display: "flex",
@@ -27112,7 +27098,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27112
27098
  borderRadius: "50%",
27113
27099
  overflow: "hidden"
27114
27100
  },
27115
- children: /* @__PURE__ */ g($D, {
27101
+ children: /* @__PURE__ */ g(ZD, {
27116
27102
  src: s || "",
27117
27103
  name: l,
27118
27104
  imgStyle: {
@@ -27206,7 +27192,7 @@ function eO({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
27206
27192
  }
27207
27193
  //#endregion
27208
27194
  //#region src/components/ChatInput.jsx
27209
- function tO({ 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" }) {
27195
+ function $D({ 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" }) {
27210
27196
  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;
27211
27197
  return /* @__PURE__ */ _("div", {
27212
27198
  style: {
@@ -27301,7 +27287,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27301
27287
  background: "rgba(59,130,246,0.08)",
27302
27288
  color: "var(--flowengage-primary)"
27303
27289
  },
27304
- children: /* @__PURE__ */ g(jD, { size: 13 })
27290
+ children: /* @__PURE__ */ g(kD, { size: 13 })
27305
27291
  }), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
27306
27292
  })
27307
27293
  }),
@@ -27341,7 +27327,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27341
27327
  overflow: "hidden",
27342
27328
  textOverflow: "ellipsis"
27343
27329
  },
27344
- children: ZD(x)
27330
+ children: YD(x)
27345
27331
  }),
27346
27332
  /* @__PURE__ */ g("div", {
27347
27333
  style: {
@@ -27349,7 +27335,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27349
27335
  color: "#6b7280",
27350
27336
  marginTop: "2px"
27351
27337
  },
27352
- children: XD(x.size)
27338
+ children: JD(x.size)
27353
27339
  })
27354
27340
  ]
27355
27341
  }), /* @__PURE__ */ g("button", {
@@ -27394,7 +27380,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27394
27380
  E ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
27395
27381
  ref: ee,
27396
27382
  type: "file",
27397
- accept: qD,
27383
+ accept: GD,
27398
27384
  style: { display: "none" },
27399
27385
  onChange: (e) => {
27400
27386
  let t = e.target.files?.[0];
@@ -27426,7 +27412,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27426
27412
  onMouseLeave: (e) => {
27427
27413
  e.currentTarget.style.opacity = "1";
27428
27414
  },
27429
- children: /* @__PURE__ */ g(MD, {
27415
+ children: /* @__PURE__ */ g(AD, {
27430
27416
  size: 16,
27431
27417
  color: "currentColor"
27432
27418
  })
@@ -27483,7 +27469,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27483
27469
  onMouseLeave: (e) => {
27484
27470
  e.currentTarget.style.opacity = "1";
27485
27471
  },
27486
- children: /* @__PURE__ */ g(DD, { size: 16 })
27472
+ children: /* @__PURE__ */ g(TD, { size: 16 })
27487
27473
  })
27488
27474
  ]
27489
27475
  }),
@@ -27546,7 +27532,7 @@ function tO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
27546
27532
  }
27547
27533
  //#endregion
27548
27534
  //#region src/components/StatusBanners.jsx
27549
- function nO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
27535
+ function eO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
27550
27536
  return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
27551
27537
  style: {
27552
27538
  margin: "0 20px 10px",
@@ -27559,7 +27545,7 @@ function nO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
27559
27545
  gap: "10px"
27560
27546
  },
27561
27547
  children: [
27562
- /* @__PURE__ */ g(AD, { className: "" }),
27548
+ /* @__PURE__ */ g(OD, { className: "" }),
27563
27549
  /* @__PURE__ */ g("span", {
27564
27550
  style: {
27565
27551
  fontSize: "12px",
@@ -27605,13 +27591,13 @@ function nO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
27605
27591
  }
27606
27592
  //#endregion
27607
27593
  //#region src/components/AnimatedOrb.jsx
27608
- var rO = [
27594
+ var tO = [
27609
27595
  "#135bd8",
27610
27596
  "#ef334b",
27611
27597
  "#ffbd2e"
27612
27598
  ];
27613
- function iO(e) {
27614
- return !Array.isArray(e) || e.length === 0 ? rO : e.length === 1 ? [
27599
+ function nO(e) {
27600
+ return !Array.isArray(e) || e.length === 0 ? tO : e.length === 1 ? [
27615
27601
  e[0],
27616
27602
  e[0],
27617
27603
  e[0]
@@ -27625,7 +27611,7 @@ function iO(e) {
27625
27611
  e[2]
27626
27612
  ];
27627
27613
  }
27628
- var aO = {
27614
+ var rO = {
27629
27615
  idle: 3,
27630
27616
  listening: .75,
27631
27617
  thinking: 1,
@@ -27633,7 +27619,7 @@ var aO = {
27633
27619
  muted: .75,
27634
27620
  error: .08
27635
27621
  };
27636
- function oO(e) {
27622
+ function iO(e) {
27637
27623
  if (!e || typeof e != "string") return [
27638
27624
  0,
27639
27625
  0,
@@ -27646,14 +27632,14 @@ function oO(e) {
27646
27632
  parseInt(n.slice(4, 6), 16) / 255
27647
27633
  ];
27648
27634
  }
27649
- function sO(e, t) {
27635
+ function aO(e, t) {
27650
27636
  if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
27651
27637
  if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
27652
27638
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
27653
27639
  return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
27654
27640
  }
27655
- var cO = "\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", lO = "\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";
27656
- function uO(e, t, n) {
27641
+ var oO = "\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", sO = "\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";
27642
+ function cO(e, t, n) {
27657
27643
  let r = (t, n) => {
27658
27644
  let r = e.createShader(t);
27659
27645
  return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
@@ -27662,10 +27648,10 @@ function uO(e, t, n) {
27662
27648
  let o = e.createProgram();
27663
27649
  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);
27664
27650
  }
27665
- function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
27666
- let [s, l, u] = iO(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(aO[t] ?? .35);
27651
+ function lO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
27652
+ let [s, l, u] = nO(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(rO[t] ?? .35);
27667
27653
  c(() => {
27668
- h.current = aO[t] ?? .35;
27654
+ h.current = rO[t] ?? .35;
27669
27655
  }, [t]), c(() => {
27670
27656
  let t = m.current;
27671
27657
  if (!t) return;
@@ -27682,7 +27668,7 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27682
27668
  console.warn("[AnimatedOrb] WebGL unavailable.");
27683
27669
  return;
27684
27670
  }
27685
- let i = uO(r, cO, lO);
27671
+ let i = cO(r, oO, sO);
27686
27672
  if (!i) {
27687
27673
  console.error("[AnimatedOrb] WebGL program failed to compile/link");
27688
27674
  return;
@@ -27712,7 +27698,7 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27712
27698
  c2: r.getUniformLocation(i, "u_c2"),
27713
27699
  c3: r.getUniformLocation(i, "u_c3")
27714
27700
  };
27715
- r.uniform3fv(c.c1, oO(s)), r.uniform3fv(c.c2, oO(l)), r.uniform3fv(c.c3, oO(u)), r.viewport(0, 0, t.width, t.height);
27701
+ r.uniform3fv(c.c1, iO(s)), r.uniform3fv(c.c2, iO(l)), r.uniform3fv(c.c3, iO(u)), r.viewport(0, 0, t.width, t.height);
27716
27702
  let d = performance.now(), f, p = (e) => {
27717
27703
  r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
27718
27704
  };
@@ -27743,7 +27729,7 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27743
27729
  position: "absolute",
27744
27730
  inset: -10,
27745
27731
  borderRadius: "50%",
27746
- background: `radial-gradient(circle, ${sO(s, .18)} 0%, transparent 70%)`,
27732
+ background: `radial-gradient(circle, ${aO(s, .18)} 0%, transparent 70%)`,
27747
27733
  pointerEvents: "none"
27748
27734
  },
27749
27735
  animate: { opacity: [.3, .75] },
@@ -27821,17 +27807,17 @@ function dO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
27821
27807
  }
27822
27808
  //#endregion
27823
27809
  //#region src/components/CallScreen.jsx
27824
- var fO = "\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";
27825
- function pO(e) {
27810
+ var uO = "\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";
27811
+ function dO(e) {
27826
27812
  let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
27827
27813
  return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
27828
27814
  }
27829
- function mO(e) {
27815
+ function fO(e) {
27830
27816
  if (!e || typeof e != "string") return "#1a1a1a";
27831
27817
  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;
27832
27818
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
27833
27819
  }
27834
- function hO(e, t) {
27820
+ function pO(e, t) {
27835
27821
  let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
27836
27822
  return n.length === 1 ? [
27837
27823
  `radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
@@ -27848,8 +27834,8 @@ function hO(e, t) {
27848
27834
  "#f7f8fa"
27849
27835
  ].join(", ");
27850
27836
  }
27851
- function gO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
27852
- let i = (t || "A")[0].toUpperCase(), a = mO(r), o = n > 48 ? {
27837
+ function mO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
27838
+ let i = (t || "A")[0].toUpperCase(), a = fO(r), o = n > 48 ? {
27853
27839
  boxShadow: `0 0 0 3px ${r}44`,
27854
27840
  border: "3px solid rgba(255,255,255,0.15)"
27855
27841
  } : { border: `1.5px solid ${r}55` };
@@ -27886,7 +27872,7 @@ function gO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
27886
27872
  children: i
27887
27873
  });
27888
27874
  }
27889
- function _O(e) {
27875
+ function hO(e) {
27890
27876
  let t = p(null), n = o(() => {
27891
27877
  if (!t.current) return;
27892
27878
  let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
@@ -27933,8 +27919,8 @@ function _O(e) {
27933
27919
  n
27934
27920
  ]), c(() => () => n(), [n]), n;
27935
27921
  }
27936
- function vO({ 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 = [] }) {
27937
- let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = _O(!!e), S = async () => {
27922
+ function gO({ 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 = [] }) {
27923
+ let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = hO(!!e), S = async () => {
27938
27924
  x(), await c();
27939
27925
  }, C = async () => {
27940
27926
  x(), await l();
@@ -27946,14 +27932,14 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
27946
27932
  flexDirection: "column",
27947
27933
  borderRadius: "inherit",
27948
27934
  overflow: "hidden",
27949
- background: hO(h, m),
27935
+ background: pO(h, m),
27950
27936
  animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
27951
27937
  };
27952
27938
  if (b === "incoming") {
27953
27939
  let e = Array.isArray(h) && h.length > 0 ? h : [m];
27954
27940
  return /* @__PURE__ */ _("div", {
27955
27941
  style: ee,
27956
- children: [/* @__PURE__ */ g("style", { children: fO }), /* @__PURE__ */ _("div", {
27942
+ children: [/* @__PURE__ */ g("style", { children: uO }), /* @__PURE__ */ _("div", {
27957
27943
  style: {
27958
27944
  flex: 1,
27959
27945
  display: "flex",
@@ -27984,7 +27970,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
27984
27970
  width: "96px",
27985
27971
  height: "96px",
27986
27972
  borderRadius: "50%",
27987
- background: `radial-gradient(circle, rgba(${pO(e[0])},0.2) 0%, transparent 70%)`,
27973
+ background: `radial-gradient(circle, rgba(${dO(e[0])},0.2) 0%, transparent 70%)`,
27988
27974
  filter: "blur(10px)",
27989
27975
  zIndex: 0
27990
27976
  } }),
@@ -28001,7 +27987,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28001
27987
  animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
28002
27988
  zIndex: 1
28003
27989
  } }, n)),
28004
- /* @__PURE__ */ g(gO, {
27990
+ /* @__PURE__ */ g(mO, {
28005
27991
  headshot: o,
28006
27992
  name: y,
28007
27993
  size: 82,
@@ -28081,7 +28067,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28081
28067
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
28082
28068
  },
28083
28069
  "aria-label": "Decline call",
28084
- children: /* @__PURE__ */ g(ED, { size: 26 })
28070
+ children: /* @__PURE__ */ g(wD, { size: 26 })
28085
28071
  }), /* @__PURE__ */ g("span", {
28086
28072
  style: {
28087
28073
  fontSize: "12px",
@@ -28122,7 +28108,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28122
28108
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
28123
28109
  },
28124
28110
  "aria-label": "Accept call",
28125
- children: /* @__PURE__ */ g(kD, {})
28111
+ children: /* @__PURE__ */ g(DD, {})
28126
28112
  }), /* @__PURE__ */ g("span", {
28127
28113
  style: {
28128
28114
  fontSize: "12px",
@@ -28139,7 +28125,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28139
28125
  }
28140
28126
  return b === "connecting" ? /* @__PURE__ */ _("div", {
28141
28127
  style: ee,
28142
- children: [/* @__PURE__ */ g("style", { children: fO }), /* @__PURE__ */ _("div", {
28128
+ children: [/* @__PURE__ */ g("style", { children: uO }), /* @__PURE__ */ _("div", {
28143
28129
  style: {
28144
28130
  flex: 1,
28145
28131
  display: "flex",
@@ -28149,7 +28135,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28149
28135
  gap: "24px"
28150
28136
  },
28151
28137
  children: [
28152
- /* @__PURE__ */ g(gO, {
28138
+ /* @__PURE__ */ g(mO, {
28153
28139
  headshot: o,
28154
28140
  name: y,
28155
28141
  size: 64,
@@ -28176,7 +28162,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28176
28162
  }) : /* @__PURE__ */ _("div", {
28177
28163
  style: ee,
28178
28164
  children: [
28179
- /* @__PURE__ */ g("style", { children: fO }),
28165
+ /* @__PURE__ */ g("style", { children: uO }),
28180
28166
  /* @__PURE__ */ _("div", {
28181
28167
  style: {
28182
28168
  display: "flex",
@@ -28222,7 +28208,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28222
28208
  children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
28223
28209
  })
28224
28210
  }),
28225
- /* @__PURE__ */ g(dO, {
28211
+ /* @__PURE__ */ g(lO, {
28226
28212
  colors: h,
28227
28213
  size: 36,
28228
28214
  voiceState: w
@@ -28273,7 +28259,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28273
28259
  gap: "16px",
28274
28260
  padding: "0 24px 16px"
28275
28261
  },
28276
- children: [/* @__PURE__ */ g(gO, {
28262
+ children: [/* @__PURE__ */ g(mO, {
28277
28263
  headshot: o,
28278
28264
  name: y,
28279
28265
  size: 116,
@@ -28328,7 +28314,7 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28328
28314
  transition: "all 0.2s ease"
28329
28315
  },
28330
28316
  "aria-label": i ? "Unmute" : "Mute",
28331
- children: [g(i ? ID : TD, { size: 18 }), i ? "Unmute" : "Mute"]
28317
+ children: [g(i ? PD : CD, { size: 18 }), i ? "Unmute" : "Mute"]
28332
28318
  }), /* @__PURE__ */ _("button", {
28333
28319
  type: "button",
28334
28320
  onClick: u,
@@ -28356,15 +28342,15 @@ function vO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
28356
28342
  e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
28357
28343
  },
28358
28344
  "aria-label": "End call",
28359
- children: [/* @__PURE__ */ g(ED, { size: 18 }), "End Call"]
28345
+ children: [/* @__PURE__ */ g(wD, { size: 18 }), "End Call"]
28360
28346
  })]
28361
28347
  })
28362
28348
  ]
28363
28349
  });
28364
28350
  }
28365
- function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
28351
+ function _O({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
28366
28352
  let u = e || n || "Agent";
28367
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: fO }), /* @__PURE__ */ _("div", {
28353
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: uO }), /* @__PURE__ */ _("div", {
28368
28354
  role: "button",
28369
28355
  tabIndex: 0,
28370
28356
  onClick: c,
@@ -28421,7 +28407,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28421
28407
  borderRadius: "50%",
28422
28408
  border: `1.5px solid ${l}55`
28423
28409
  } }),
28424
- /* @__PURE__ */ g(gO, {
28410
+ /* @__PURE__ */ g(mO, {
28425
28411
  headshot: t,
28426
28412
  name: u,
28427
28413
  size: 38,
@@ -28505,7 +28491,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28505
28491
  boxShadow: i ? `0 0 0 3px ${l}12` : "none"
28506
28492
  },
28507
28493
  "aria-label": i ? "Unmute" : "Mute",
28508
- children: g(i ? ID : TD, { size: 15 })
28494
+ children: g(i ? PD : CD, { size: 15 })
28509
28495
  }), /* @__PURE__ */ g("button", {
28510
28496
  type: "button",
28511
28497
  onClick: (e) => {
@@ -28533,7 +28519,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28533
28519
  transition: "all 0.18s ease"
28534
28520
  },
28535
28521
  "aria-label": "End call",
28536
- children: /* @__PURE__ */ g(ED, { size: 16 })
28522
+ children: /* @__PURE__ */ g(wD, { size: 16 })
28537
28523
  })]
28538
28524
  })
28539
28525
  ]
@@ -28541,7 +28527,7 @@ function yO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
28541
28527
  }
28542
28528
  //#endregion
28543
28529
  //#region src/utils/voicePriorContext.js
28544
- function bO(e, t = {}) {
28530
+ function vO(e, t = {}) {
28545
28531
  let n = t.maxChars ?? 4500;
28546
28532
  if (!Array.isArray(e) || e.length === 0) return "";
28547
28533
  let r = [];
@@ -28559,7 +28545,7 @@ function bO(e, t = {}) {
28559
28545
  //#endregion
28560
28546
  //#region src/utils/voiceActionVisuals.js
28561
28547
  var Q = "fe-vv";
28562
- function xO() {
28548
+ function yO() {
28563
28549
  if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
28564
28550
  let e = `
28565
28551
  /* ── Action toast ───────────────────────────────────────────────────────────── */
@@ -28704,14 +28690,14 @@ function xO() {
28704
28690
  `, t = document.createElement("style");
28705
28691
  t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
28706
28692
  }
28707
- var SO = null, CO = null;
28708
- function wO() {
28709
- return (!SO || !SO.isConnected) && (SO = document.createElement("div"), SO.id = `${Q}-toast`, document.body.appendChild(SO)), SO;
28693
+ var bO = null, xO = null;
28694
+ function SO() {
28695
+ return (!bO || !bO.isConnected) && (bO = document.createElement("div"), bO.id = `${Q}-toast`, document.body.appendChild(bO)), bO;
28710
28696
  }
28711
- function TO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28697
+ function CO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28712
28698
  if (typeof document > "u") return;
28713
- xO(), CO &&= (clearTimeout(CO), null);
28714
- let i = wO();
28699
+ yO(), xO &&= (clearTimeout(xO), null);
28700
+ let i = SO();
28715
28701
  if (i.innerHTML = "", n) {
28716
28702
  let e = document.createElement("span");
28717
28703
  e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
@@ -28720,82 +28706,82 @@ function TO(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
28720
28706
  e.className = `${Q}-spin`, i.appendChild(e);
28721
28707
  }
28722
28708
  let a = document.createElement("span");
28723
- a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (CO = setTimeout(() => EO(), r));
28709
+ a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (xO = setTimeout(() => wO(), r));
28724
28710
  }
28725
- function EO(e = 0) {
28726
- SO && (e > 0 ? CO = setTimeout(() => {
28727
- SO && SO.classList.remove(`${Q}-show`);
28728
- }, e) : SO && SO.classList.remove(`${Q}-show`));
28711
+ function wO(e = 0) {
28712
+ bO && (e > 0 ? xO = setTimeout(() => {
28713
+ bO && bO.classList.remove(`${Q}-show`);
28714
+ }, e) : bO && bO.classList.remove(`${Q}-show`));
28729
28715
  }
28730
- var DO = null, OO = [];
28731
- function kO() {
28732
- return (!DO || !DO.isConnected) && (DO = document.createElement("div"), DO.id = `${Q}-bar`, document.body.appendChild(DO)), DO;
28716
+ var TO = null, EO = [];
28717
+ function DO() {
28718
+ return (!TO || !TO.isConnected) && (TO = document.createElement("div"), TO.id = `${Q}-bar`, document.body.appendChild(TO)), TO;
28733
28719
  }
28734
- function AO() {
28720
+ function OO() {
28735
28721
  if (typeof document > "u") return;
28736
- xO(), OO.forEach(clearTimeout), OO = [];
28737
- let e = kO();
28722
+ yO(), EO.forEach(clearTimeout), EO = [];
28723
+ let e = DO();
28738
28724
  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";
28739
28725
  let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
28740
28726
  for (let [e, r] of t) {
28741
28727
  let t = n, i = e, a = r;
28742
- OO.push(setTimeout(() => {
28743
- DO && (DO.style.transition = a, DO.style.width = `${i}%`);
28728
+ EO.push(setTimeout(() => {
28729
+ TO && (TO.style.transition = a, TO.style.width = `${i}%`);
28744
28730
  }, t)), n += 800;
28745
28731
  }
28746
28732
  }
28747
- function jO() {
28748
- DO && (OO.forEach(clearTimeout), OO = [], DO.style.transition = "width 0.2s ease", DO.style.width = "100%", OO.push(setTimeout(() => {
28749
- DO && (DO.style.transition = "opacity 0.35s ease", DO.style.opacity = "0", OO.push(setTimeout(() => {
28750
- DO && (DO.style.width = "0%", DO.classList.remove(`${Q}-bar-active`));
28733
+ function kO() {
28734
+ TO && (EO.forEach(clearTimeout), EO = [], TO.style.transition = "width 0.2s ease", TO.style.width = "100%", EO.push(setTimeout(() => {
28735
+ TO && (TO.style.transition = "opacity 0.35s ease", TO.style.opacity = "0", EO.push(setTimeout(() => {
28736
+ TO && (TO.style.width = "0%", TO.classList.remove(`${Q}-bar-active`));
28751
28737
  }, 380)));
28752
28738
  }, 220)));
28753
28739
  }
28754
- function MO() {
28740
+ function AO() {
28755
28741
  typeof document > "u" || document.querySelectorAll(`.${Q}-field-active, .${Q}-field-filled`).forEach((e) => e.classList.remove(`${Q}-field-active`, `${Q}-field-filled`));
28756
28742
  }
28757
- function NO(e) {
28758
- !e || typeof document > "u" || (xO(), MO(), e.classList.add(`${Q}-field-active`));
28743
+ function jO(e) {
28744
+ !e || typeof document > "u" || (yO(), AO(), e.classList.add(`${Q}-field-active`));
28759
28745
  }
28760
- function PO(e) {
28746
+ function MO(e) {
28761
28747
  e && (e.classList.remove(`${Q}-field-active`), e.classList.add(`${Q}-field-filled`), setTimeout(() => {
28762
28748
  e.isConnected && e.classList.remove(`${Q}-field-filled`);
28763
28749
  }, 1400));
28764
28750
  }
28765
- var FO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
28751
+ var NO = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
28766
28752
  <filter id="${Q}-csh">
28767
28753
  <feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
28768
28754
  </filter>
28769
28755
  <path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
28770
28756
  fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
28771
28757
  filter="url(#${Q}-csh)"/>
28772
- </svg>`, IO = null, LO = !1;
28773
- function RO() {
28774
- return (!IO || !IO.isConnected) && (IO = document.createElement("div"), IO.id = `${Q}-cursor`, IO.innerHTML = FO, document.body.appendChild(IO), LO = !1), IO;
28758
+ </svg>`, PO = null, FO = !1;
28759
+ function IO() {
28760
+ return (!PO || !PO.isConnected) && (PO = document.createElement("div"), PO.id = `${Q}-cursor`, PO.innerHTML = NO, document.body.appendChild(PO), FO = !1), PO;
28775
28761
  }
28776
- async function zO(e) {
28762
+ async function LO(e) {
28777
28763
  if (typeof document > "u" || !e) return;
28778
- xO();
28764
+ yO();
28779
28765
  let t;
28780
28766
  try {
28781
28767
  t = e.getBoundingClientRect();
28782
28768
  } catch {
28783
28769
  return;
28784
28770
  }
28785
- let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = RO();
28786
- 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);
28771
+ let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = IO();
28772
+ FO ||= (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 VO(360);
28787
28773
  }
28788
- function BO(e = !1) {
28789
- IO && (e ? (IO.classList.remove(`${Q}-cursor-visible`), LO = !1) : (IO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
28790
- LO = !1;
28774
+ function RO(e = !1) {
28775
+ PO && (e ? (PO.classList.remove(`${Q}-cursor-visible`), FO = !1) : (PO.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
28776
+ FO = !1;
28791
28777
  }, 250)));
28792
28778
  }
28793
- async function VO(e) {
28794
- IO && (IO.classList.add(`${Q}-cursor-click`), await UO(280), IO.classList.remove(`${Q}-cursor-click`));
28779
+ async function zO(e) {
28780
+ PO && (PO.classList.add(`${Q}-cursor-click`), await VO(280), PO.classList.remove(`${Q}-cursor-click`));
28795
28781
  }
28796
- function HO(e) {
28782
+ function BO(e) {
28797
28783
  if (!e || typeof document > "u") return;
28798
- xO();
28784
+ yO();
28799
28785
  let t;
28800
28786
  try {
28801
28787
  t = e.getBoundingClientRect();
@@ -28821,7 +28807,7 @@ function HO(e) {
28821
28807
  a.remove(), e.style.position = n, e.style.overflow = r;
28822
28808
  }, 650);
28823
28809
  }
28824
- function UO(e) {
28810
+ function VO(e) {
28825
28811
  return new Promise((t) => setTimeout(t, e));
28826
28812
  }
28827
28813
  //#endregion
@@ -28829,42 +28815,42 @@ function UO(e) {
28829
28815
  function $(...e) {
28830
28816
  Rn() && console.log("[FlowEngage:voice-tools]", ...e);
28831
28817
  }
28832
- function WO(e) {
28818
+ function HO(e) {
28833
28819
  return new Promise((t) => setTimeout(t, e));
28834
28820
  }
28835
- var GO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
28836
- function KO(e) {
28821
+ var UO = "#flowengage-root, .flowengage-shell, .flowengage-widget-root";
28822
+ function WO(e) {
28837
28823
  if (!e || typeof e.closest != "function") return !1;
28838
28824
  try {
28839
- return !!e.closest(GO);
28825
+ return !!e.closest(UO);
28840
28826
  } catch {
28841
28827
  return !1;
28842
28828
  }
28843
28829
  }
28844
- function qO(e) {
28830
+ function GO(e) {
28845
28831
  try {
28846
28832
  let t = e.ownerDocument?.defaultView;
28847
28833
  if (t) return t.getComputedStyle(e);
28848
28834
  } catch {}
28849
28835
  return window.getComputedStyle(e);
28850
28836
  }
28851
- function JO(e) {
28837
+ function KO(e) {
28852
28838
  let t = /* @__PURE__ */ new Set();
28853
28839
  function n(r) {
28854
28840
  if (!r || t.has(r)) return;
28855
28841
  t.add(r), e(r);
28856
28842
  let i = r.querySelectorAll("iframe");
28857
- for (let e of i) if (!KO(e)) try {
28843
+ for (let e of i) if (!WO(e)) try {
28858
28844
  let t = e.contentDocument;
28859
28845
  t && n(t);
28860
28846
  } catch {}
28861
28847
  }
28862
28848
  typeof document < "u" && n(document);
28863
28849
  }
28864
- function YO(e) {
28850
+ function qO(e) {
28865
28851
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
28866
28852
  }
28867
- function XO(e) {
28853
+ function JO(e) {
28868
28854
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
28869
28855
  if (n) {
28870
28856
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -28872,42 +28858,42 @@ function XO(e) {
28872
28858
  let e = t.getElementById(n);
28873
28859
  e?.textContent && r.push(e.textContent.trim());
28874
28860
  } catch {}
28875
- if (r.length) return YO(r.join(" "));
28861
+ if (r.length) return qO(r.join(" "));
28876
28862
  }
28877
- if (e.labels && e.labels.length) return YO(e.labels[0].textContent);
28863
+ if (e.labels && e.labels.length) return qO(e.labels[0].textContent);
28878
28864
  let r = e.id;
28879
28865
  if (r) try {
28880
28866
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
28881
- if (e) return YO(e.textContent);
28867
+ if (e) return qO(e.textContent);
28882
28868
  } catch {
28883
28869
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
28884
- if (e) return YO(e.textContent);
28870
+ if (e) return qO(e.textContent);
28885
28871
  }
28886
28872
  let i = e.previousElementSibling;
28887
28873
  for (let e = 0; e < 6 && i; e += 1) {
28888
- if (i.tagName === "LABEL") return YO(i.textContent);
28874
+ if (i.tagName === "LABEL") return qO(i.textContent);
28889
28875
  let e = (i.className || "").toString().toLowerCase();
28890
28876
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
28891
- let e = YO(i.textContent);
28877
+ let e = qO(i.textContent);
28892
28878
  if (e) return e;
28893
28879
  }
28894
28880
  i = i.previousElementSibling;
28895
28881
  }
28896
28882
  let a = e.parentElement;
28897
28883
  for (let e = 0; e < 5 && a; e += 1) {
28898
- if (a.tagName === "LABEL") return YO(a.textContent);
28884
+ if (a.tagName === "LABEL") return qO(a.textContent);
28899
28885
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
28900
- if (e?.textContent) return YO(e.textContent);
28886
+ if (e?.textContent) return qO(e.textContent);
28901
28887
  a = a.parentElement;
28902
28888
  }
28903
28889
  let o = e.getAttribute("aria-label");
28904
- return o ? YO(o) : null;
28890
+ return o ? qO(o) : null;
28905
28891
  }
28906
- function ZO() {
28892
+ function YO() {
28907
28893
  let e = [];
28908
- return JO((t) => {
28894
+ return KO((t) => {
28909
28895
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
28910
- if (KO(e)) return !1;
28896
+ if (WO(e)) return !1;
28911
28897
  let t = (e.type || "").toLowerCase();
28912
28898
  if ([
28913
28899
  "hidden",
@@ -28916,32 +28902,32 @@ function ZO() {
28916
28902
  "image"
28917
28903
  ].includes(t) || e.disabled || e.readOnly) return !1;
28918
28904
  try {
28919
- let t = qO(e);
28905
+ let t = GO(e);
28920
28906
  if (t.display === "none" || t.visibility === "hidden") return !1;
28921
28907
  } catch {}
28922
28908
  return !0;
28923
28909
  }));
28924
28910
  }), e;
28925
28911
  }
28926
- function QO() {
28927
- return ZO().map((e, t) => ({
28912
+ function XO() {
28913
+ return YO().map((e, t) => ({
28928
28914
  formIndex: 0,
28929
28915
  fieldIndex: t,
28930
28916
  tag: e.tagName,
28931
28917
  type: e.type || "text",
28932
28918
  name: e.name || null,
28933
28919
  id: e.id || null,
28934
- label: XO(e),
28920
+ label: JO(e),
28935
28921
  placeholder: e.placeholder || null
28936
28922
  }));
28937
28923
  }
28938
- function $O() {
28924
+ function ZO() {
28939
28925
  let e = [];
28940
- return JO((t) => {
28926
+ return KO((t) => {
28941
28927
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
28942
- if (KO(e) || e.disabled) return !1;
28928
+ if (WO(e) || e.disabled) return !1;
28943
28929
  try {
28944
- let t = qO(e);
28930
+ let t = GO(e);
28945
28931
  if (t.display === "none" || t.visibility === "hidden") return !1;
28946
28932
  } catch {}
28947
28933
  return !0;
@@ -28953,15 +28939,15 @@ function $O() {
28953
28939
  type: e.type || e.tagName
28954
28940
  }));
28955
28941
  }
28956
- function ek(e) {
28942
+ function QO(e) {
28957
28943
  return String(e || "").toLowerCase().replace(/\u00a0/g, " ").replace(/\*/g, "").replace(/\s+/g, " ").trim();
28958
28944
  }
28959
- function tk(e) {
28960
- let t = ek(e);
28945
+ function $O(e) {
28946
+ let t = QO(e);
28961
28947
  return t = t.replace(/\s+field\s*$/i, "").trim(), t;
28962
28948
  }
28963
- function nk(e, t) {
28964
- let n = tk(t);
28949
+ function ek(e, t) {
28950
+ let n = $O(t);
28965
28951
  if (!n) return 0;
28966
28952
  let r = (e.name || "").toLowerCase(), i = (e.id || "").toLowerCase();
28967
28953
  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;
@@ -28969,12 +28955,12 @@ function nk(e, t) {
28969
28955
  e.name,
28970
28956
  e.id,
28971
28957
  e.placeholder,
28972
- XO(e),
28958
+ JO(e),
28973
28959
  e.getAttribute("aria-label"),
28974
28960
  e.getAttribute("title"),
28975
28961
  e.getAttribute("data-testid"),
28976
28962
  e.getAttribute("autocomplete")
28977
- ].filter(Boolean).map((e) => ek(e)), o = 0;
28963
+ ].filter(Boolean).map((e) => QO(e)), o = 0;
28978
28964
  for (let e of a) {
28979
28965
  if (!e) continue;
28980
28966
  if (e.includes(n) || n.includes(e)) {
@@ -28989,16 +28975,16 @@ function nk(e, t) {
28989
28975
  }
28990
28976
  return o;
28991
28977
  }
28992
- var rk = 28;
28993
- function ik(e, t) {
28978
+ var tk = 28;
28979
+ function nk(e, t) {
28994
28980
  let n = null, r = 0;
28995
28981
  for (let i of e) {
28996
- let e = nk(i, t);
28982
+ let e = ek(i, t);
28997
28983
  e > r && (r = e, n = i);
28998
28984
  }
28999
- return !n || r < rk ? null : n;
28985
+ return !n || r < tk ? null : n;
29000
28986
  }
29001
- function ak(e, t, n) {
28987
+ function rk(e, t, n) {
29002
28988
  let r = String(t || "").toLowerCase().trim(), i = String(n || "").trim();
29003
28989
  if (!(/^https?:\/\//i.test(i) || /\.\w{2,}(\/|\s|$)/.test(i) || r.includes("url") || r.includes("website") || r.includes("domain") || r.includes("site"))) return null;
29004
28990
  let a = null, o = 0;
@@ -29018,7 +29004,7 @@ function ak(e, t, n) {
29018
29004
  t.name,
29019
29005
  t.id,
29020
29006
  t.placeholder,
29021
- XO(t),
29007
+ JO(t),
29022
29008
  t.getAttribute("aria-label"),
29023
29009
  t.getAttribute("autocomplete")
29024
29010
  ].filter(Boolean).join(" ").toLowerCase();
@@ -29026,15 +29012,15 @@ function ak(e, t, n) {
29026
29012
  }
29027
29013
  return !a || o < 42 ? null : a;
29028
29014
  }
29029
- function ok(e) {
29015
+ function ik(e) {
29030
29016
  let t = String(e ?? "").trim();
29031
29017
  return t ? /^https?:\/\//i.test(t) ? !0 : /\.\w{2,}(\/|\s|$)/.test(t) : !1;
29032
29018
  }
29033
- function sk(e) {
29019
+ function ak(e) {
29034
29020
  let t = String(e ?? "").toLowerCase().trim();
29035
29021
  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;
29036
29022
  }
29037
- function ck(e) {
29023
+ function ok(e) {
29038
29024
  if (!e || e.tagName !== "INPUT" && e.tagName !== "TEXTAREA") return !1;
29039
29025
  let t = (e.type || "").toLowerCase();
29040
29026
  return ![
@@ -29046,22 +29032,22 @@ function ck(e) {
29046
29032
  "file"
29047
29033
  ].includes(t);
29048
29034
  }
29049
- function lk(e) {
29050
- if (!ck(e)) return !1;
29035
+ function sk(e) {
29036
+ if (!ok(e)) return !1;
29051
29037
  let t = (e.name || "").toLowerCase(), n = (e.id || "").toLowerCase(), r = [
29052
29038
  e.name,
29053
29039
  e.id,
29054
29040
  e.placeholder,
29055
- XO(e),
29041
+ JO(e),
29056
29042
  e.getAttribute("aria-label")
29057
29043
  ].filter(Boolean).join(" ").toLowerCase();
29058
29044
  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);
29059
29045
  }
29060
- function uk(e, t, n) {
29061
- let r = String(t ?? ""), i = String(n ?? ""), a = pk(e, r) || ik(e, r) || ak(e, r, i);
29046
+ function ck(e, t, n) {
29047
+ let r = String(t ?? ""), i = String(n ?? ""), a = dk(e, r) || nk(e, r) || rk(e, r, i);
29062
29048
  if (!a) return [];
29063
29049
  let o = new Set([a]);
29064
- if (ok(i) && sk(r)) for (let t of e) t !== a && lk(t) && o.add(t);
29050
+ if (ik(i) && ak(r)) for (let t of e) t !== a && sk(t) && o.add(t);
29065
29051
  let s = Array.from(o);
29066
29052
  return s.sort((e, t) => {
29067
29053
  if (e === t) return 0;
@@ -29069,7 +29055,7 @@ function uk(e, t, n) {
29069
29055
  return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
29070
29056
  }), s;
29071
29057
  }
29072
- function dk(e, t) {
29058
+ function lk(e, t) {
29073
29059
  try {
29074
29060
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
29075
29061
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -29084,17 +29070,17 @@ function dk(e, t) {
29084
29070
  return Infinity;
29085
29071
  }
29086
29072
  }
29087
- function fk(e) {
29073
+ function uk(e) {
29088
29074
  if (!e || typeof e != "string") return null;
29089
29075
  let t = null;
29090
- return JO((n) => {
29076
+ return KO((n) => {
29091
29077
  try {
29092
29078
  let r = n.getElementById(e);
29093
- r && !KO(r) && r.matches?.("input, select, textarea") && (t = r);
29079
+ r && !WO(r) && r.matches?.("input, select, textarea") && (t = r);
29094
29080
  } catch {}
29095
29081
  }), t;
29096
29082
  }
29097
- function pk(e, t) {
29083
+ function dk(e, t) {
29098
29084
  let n = String(t ?? "").trim();
29099
29085
  if (!n) return null;
29100
29086
  let r = n.match(/^name:\s*([\w.-]+)$/i);
@@ -29104,12 +29090,12 @@ function pk(e, t) {
29104
29090
  }
29105
29091
  let i = n.match(/^id:\s*([\w.-]+)$/i);
29106
29092
  if (i) {
29107
- let e = fk(i[1]);
29093
+ let e = uk(i[1]);
29108
29094
  if (e) return e;
29109
29095
  }
29110
29096
  let a = n.startsWith("#") ? n.slice(1) : n;
29111
29097
  if (/^[\w-]+$/.test(a)) {
29112
- let e = fk(a);
29098
+ let e = uk(a);
29113
29099
  if (e) return e;
29114
29100
  }
29115
29101
  let o = n.toLowerCase().replace(/\s+/g, " ");
@@ -29119,7 +29105,7 @@ function pk(e, t) {
29119
29105
  }
29120
29106
  return null;
29121
29107
  }
29122
- function mk(e, t) {
29108
+ function fk(e, t) {
29123
29109
  let n = String(t || "").toLowerCase().trim();
29124
29110
  if (!n) return 0;
29125
29111
  let r = [
@@ -29135,13 +29121,13 @@ function mk(e, t) {
29135
29121
  for (let e of i) r.includes(e) && (a += 1);
29136
29122
  return a / i.length * 92;
29137
29123
  }
29138
- function hk(e, t) {
29124
+ function pk(e, t) {
29139
29125
  let n = [];
29140
- JO((e) => {
29126
+ KO((e) => {
29141
29127
  n.push(...Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
29142
- if (KO(e) || e.disabled) return !1;
29128
+ if (WO(e) || e.disabled) return !1;
29143
29129
  try {
29144
- let t = qO(e);
29130
+ let t = GO(e);
29145
29131
  if (t.display === "none" || t.visibility === "hidden") return !1;
29146
29132
  } catch {}
29147
29133
  return !0;
@@ -29149,7 +29135,7 @@ function hk(e, t) {
29149
29135
  });
29150
29136
  let r = 0, i = n.map((t) => ({
29151
29137
  el: t,
29152
- s: mk(t, e)
29138
+ s: fk(t, e)
29153
29139
  }));
29154
29140
  for (let { s: e } of i) e > r && (r = e);
29155
29141
  if (r < 36) return null;
@@ -29159,14 +29145,14 @@ function hk(e, t) {
29159
29145
  if (o.length) {
29160
29146
  let e = a[0], t = Infinity;
29161
29147
  for (let n of a) for (let r of o) {
29162
- let i = dk(n, r);
29148
+ let i = lk(n, r);
29163
29149
  i < t && (t = i, e = n);
29164
29150
  }
29165
29151
  return e;
29166
29152
  }
29167
29153
  return a[0];
29168
29154
  }
29169
- function gk(e) {
29155
+ function mk(e) {
29170
29156
  if (e == null) return {};
29171
29157
  if (typeof e == "string") {
29172
29158
  let t = e.trim();
@@ -29179,8 +29165,8 @@ function gk(e) {
29179
29165
  }
29180
29166
  return e;
29181
29167
  }
29182
- function _k(e) {
29183
- let t = gk(e);
29168
+ function hk(e) {
29169
+ let t = mk(e);
29184
29170
  if (Array.isArray(t) && t.length > 0) {
29185
29171
  let e = t[0];
29186
29172
  if (e?.field_key != null || e?.fieldKey != null) return t.map((e) => ({
@@ -29208,7 +29194,7 @@ function _k(e) {
29208
29194
  value: e?.value ?? e?.Value
29209
29195
  })) : [];
29210
29196
  }
29211
- function vk(e) {
29197
+ function gk(e) {
29212
29198
  if (!e || typeof e != "string") return [];
29213
29199
  let t = e.trim();
29214
29200
  if (!t || /\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\b/i.test(t)) return [];
@@ -29227,7 +29213,7 @@ function vk(e) {
29227
29213
  }
29228
29214
  return [];
29229
29215
  }
29230
- function yk(e) {
29216
+ function _k(e) {
29231
29217
  if (!e || typeof e != "string") return [];
29232
29218
  let t = e.trim();
29233
29219
  if (!t) return [];
@@ -29263,17 +29249,17 @@ function yk(e) {
29263
29249
  }
29264
29250
  return n;
29265
29251
  }
29266
- function bk(e) {
29252
+ function vk(e) {
29267
29253
  if (!e || typeof e != "object") return null;
29268
29254
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
29269
29255
  return t == null ? null : String(t).trim() || null;
29270
29256
  }
29271
- function xk(e) {
29257
+ function yk(e) {
29272
29258
  if (!e || typeof e != "object") return null;
29273
29259
  let t = e.query ?? e.q ?? e.search ?? e.text ?? e.keywords;
29274
29260
  return t == null ? null : String(t).trim() || null;
29275
29261
  }
29276
- function Sk(e, t, n) {
29262
+ function bk(e, t, n) {
29277
29263
  if (!n?.skipScroll) try {
29278
29264
  e.scrollIntoView({
29279
29265
  block: "center",
@@ -29328,7 +29314,7 @@ function Sk(e, t, n) {
29328
29314
  } catch {}
29329
29315
  return !0;
29330
29316
  }
29331
- function Ck() {
29317
+ function xk() {
29332
29318
  let e = {};
29333
29319
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
29334
29320
  if (t.id) return;
@@ -29343,15 +29329,22 @@ function Ck() {
29343
29329
  e[r] = !0, t.id = r;
29344
29330
  });
29345
29331
  }
29346
- function wk() {
29347
- let e = document.querySelector("main, [role='main'], article") || document.body;
29348
- return Array.from(e.querySelectorAll("h1, h2, h3, h4")).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root")).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200).slice(0, 12);
29332
+ function Sk() {
29333
+ let e = document.querySelector("main, [role='main'], article") || document.body, t = "#flowengage-root, .flowengage-shell, .flowengage-widget-root", n = /* @__PURE__ */ new Set(), r = [], i = (e) => {
29334
+ let t = e.textContent.replace(/\s+/g, " ").trim();
29335
+ t.length > 2 && t.length < 200 && !n.has(t) && (n.add(t), r.push(t));
29336
+ };
29337
+ return e.querySelectorAll("h1, h2").forEach((e) => {
29338
+ e.closest(t) || i(e);
29339
+ }), e.querySelectorAll("h3, h4").forEach((e) => {
29340
+ e.closest(t) || i(e);
29341
+ }), r.slice(0, 12);
29349
29342
  }
29350
- function Tk(e) {
29343
+ function Ck(e) {
29351
29344
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
29352
29345
  flowengage_navigate: async (n) => {
29353
29346
  $("flowengage_navigate ▶ raw parameters:", n);
29354
- let i = gk(n), a = bk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
29347
+ let i = mk(n), a = vk(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
29355
29348
  if ($("flowengage_navigate · coerced:", {
29356
29349
  url: a,
29357
29350
  sectionText: o,
@@ -29376,11 +29369,11 @@ function Tk(e) {
29376
29369
  return $("flowengage_navigate ✖ blocked", e), e;
29377
29370
  }
29378
29371
  try {
29379
- TO(`Navigating to ${a}...`, { spinner: !0 }), AO(), bD(), wD();
29372
+ CO(`Navigating to ${a}...`, { spinner: !0 }), OO(), SD();
29380
29373
  try {
29381
29374
  let e = r ? r() : "";
29382
29375
  if (e && t) {
29383
- let n = bO([{
29376
+ let n = vO([{
29384
29377
  sender: "user",
29385
29378
  message: e
29386
29379
  }]);
@@ -29399,8 +29392,8 @@ function Tk(e) {
29399
29392
  for (; Date.now() < t && !(typeof window < "u" && window.location.pathname === e);) await new Promise((e) => setTimeout(e, 80));
29400
29393
  let n = typeof window < "u" ? window.location.pathname : e, r = typeof window < "u" ? window.location.href : a, i = n === e, o = (n.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home";
29401
29394
  $("flowengage_navigate → SPA nav complete. target:", e, "actual:", n);
29402
- let s = [], c = Date.now() + 2e3;
29403
- for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s = wk(), !(s.length >= 3)););
29395
+ let s = [], c = Date.now() + 3e3;
29396
+ for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s = Sk(), !((document.querySelector("main, [role='main'], article") || document.body).querySelector("h1, h2") && s.length >= 2)););
29404
29397
  $("flowengage_navigate → page headings collected:", s);
29405
29398
  let l = s.length ? s.join(" | ") : "none";
29406
29399
  return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. Use ONLY these exact heading strings for flowengage_highlight. Do NOT say "I have navigated you" or "I've taken you to" — start immediately with highlights and content about THIS page.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. Use ONLY these exact heading strings for flowengage_highlight. Describe THIS page only — do not mention the page you tried to navigate to.`);
@@ -29408,30 +29401,30 @@ function Tk(e) {
29408
29401
  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.";
29409
29402
  } catch (e) {
29410
29403
  let t = `Navigation error: ${e?.message || String(e)}`;
29411
- return $("flowengage_navigate ✖", t), TO("Navigation failed", {
29404
+ return $("flowengage_navigate ✖", t), CO("Navigation failed", {
29412
29405
  spinner: !1,
29413
29406
  icon: "⚠️",
29414
29407
  duration: 1800
29415
29408
  }), t;
29416
29409
  } finally {
29417
- jO(), EO(900);
29410
+ kO(), wO(900);
29418
29411
  }
29419
29412
  },
29420
29413
  flowengage_highlight: async (e) => {
29421
29414
  $("flowengage_highlight ▶", e);
29422
- let t = gk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29423
- Ck();
29415
+ let t = mk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29416
+ xk();
29424
29417
  let i = hr(n || null, r || null);
29425
- if (!i && r && (await new Promise((e) => setTimeout(e, 500)), Ck(), i = hr(null, r)), !i) {
29418
+ if (!i && r && (await new Promise((e) => setTimeout(e, 500)), xk(), i = hr(null, r)), !i) {
29426
29419
  $("flowengage_highlight ✖ no element for:", r || n);
29427
- let e = wk(), t = e.length ? `Page headings: ${e.join(" | ")}. Use one of these exact strings for section_text.` : "No headings found — skip highlight and continue.";
29420
+ let e = Sk(), t = e.length ? `Page headings: ${e.join(" | ")}. Use one of these exact strings for section_text.` : "No headings found — skip highlight and continue.";
29428
29421
  return `HIGHLIGHT_NOT_FOUND: "${r || n}" on the current page. ${t}`;
29429
29422
  }
29430
- return CD(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}". WALKTHROUGH: If you are mid-walkthrough and have more sections to cover, continue immediately to the next section — do NOT pause or wait for the visitor to speak between sections.`;
29423
+ return xD(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}". WALKTHROUGH: If you are mid-walkthrough and have more sections to cover, continue immediately to the next section — do NOT pause or wait for the visitor to speak between sections.`;
29431
29424
  },
29432
29425
  flowengage_read_content: async (e) => {
29433
29426
  $("flowengage_read_content ▶", e);
29434
- let t = gk(e), n = t?.section_text || t?.sectionText || "";
29427
+ let t = mk(e), n = t?.section_text || t?.sectionText || "";
29435
29428
  try {
29436
29429
  let e = "";
29437
29430
  if (n) {
@@ -29454,11 +29447,11 @@ function Tk(e) {
29454
29447
  },
29455
29448
  flowengage_search: async (e) => {
29456
29449
  $("flowengage_search ▶", e);
29457
- let r = xk(gk(e));
29450
+ let r = yk(mk(e));
29458
29451
  if ($("flowengage_search · query:", r, "siteId:", t, "apiBase:", n || "(empty)"), !r) return $("flowengage_search ✖ missing query"), "Missing query parameter.";
29459
29452
  if (!t) return $("flowengage_search ✖ no siteId"), "Site is not configured for search.";
29460
29453
  if (!n) return $("flowengage_search ✖ no api base"), "API base URL is missing; cannot search.";
29461
- TO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
29454
+ CO(`Searching${r ? ` for "${r}"` : ""}…`, { spinner: !0 });
29462
29455
  try {
29463
29456
  let e = `${n}/api/site-tools/search`;
29464
29457
  $("flowengage_search → POST", e);
@@ -29481,12 +29474,12 @@ function Tk(e) {
29481
29474
  let t = `Search error: ${e.message || "network"}`;
29482
29475
  return $("flowengage_search ✖", t), t;
29483
29476
  } finally {
29484
- EO(600);
29477
+ wO(600);
29485
29478
  }
29486
29479
  },
29487
29480
  flowengage_page_content: async (e) => {
29488
29481
  $("flowengage_page_content ▶", e);
29489
- let r = gk(e), i = r?.url || r?.page_url || "";
29482
+ let r = mk(e), i = r?.url || r?.page_url || "";
29490
29483
  if ($("flowengage_page_content · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("flowengage_page_content ✖ missing url"), "Missing url parameter.";
29491
29484
  if (!t) return $("flowengage_page_content ✖ no siteId"), "Site is not configured.";
29492
29485
  if (!n) return $("flowengage_page_content ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -29500,26 +29493,21 @@ function Tk(e) {
29500
29493
  siteId: t,
29501
29494
  url: i
29502
29495
  })
29503
- }), a = await r.json();
29504
- if ($("flowengage_page_content · HTTP", r.status, "success:", a.success), !a.success) {
29505
- let e = a.error || "Failed to get page content.";
29506
- return $("flowengage_page_content ✖", e), `${e} FALLBACK REQUIRED: This page is not in the search index. Call flowengage_read_content (no parameters) immediately to read the live page content directly from the visitor's browser — do NOT tell the visitor you cannot access the page.`;
29507
- }
29508
- return $("flowengage_page_content ✓", `title: ${a.title}`, `sections: ${(a.sections || []).length}`, `content: ${(a.content || "").length} chars`), JSON.stringify({
29509
- title: a.title,
29510
- url: a.url,
29511
- sections: a.sections,
29512
- content: a.content
29513
- });
29496
+ }), o = await r.json();
29497
+ return $("flowengage_page_content · HTTP", r.status, "success:", o.success), o.success ? ($("flowengage_page_content ✓", `title: ${o.title}`, `sections: ${(o.sections || []).length}`, `content: ${(o.content || "").length} chars`), JSON.stringify({
29498
+ title: o.title,
29499
+ url: o.url,
29500
+ sections: o.sections,
29501
+ content: o.content
29502
+ })) : ($("flowengage_page_content ✖ not indexed — auto-fallback to flowengage_read_content"), a.flowengage_read_content({}));
29514
29503
  } catch (e) {
29515
- let t = `Page content error: ${e.message || "network"}`;
29516
- return $("flowengage_page_content ✖", t), t;
29504
+ return $("flowengage_page_content network error — auto-fallback to flowengage_read_content", e.message), a.flowengage_read_content({});
29517
29505
  }
29518
29506
  },
29519
29507
  flowengage_end_session: async () => ($("flowengage_end_session ▶"), typeof e.requestEndSession == "function" && e.requestEndSession(), "Voice session is ending."),
29520
29508
  flowengage_get_current_page: async () => {
29521
29509
  if ($("flowengage_get_current_page ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
29522
- let e = window.location.href, t = window.location.pathname, n = document.title || "", r = wk(), i = r.length ? r.join(" | ") : "none";
29510
+ let e = window.location.href, t = window.location.pathname, n = document.title || "", r = Sk(), i = r.length ? r.join(" | ") : "none";
29523
29511
  return $("flowengage_get_current_page ✓", {
29524
29512
  url: e,
29525
29513
  path: t,
@@ -29527,7 +29515,7 @@ function Tk(e) {
29527
29515
  }), $("flowengage_get_current_page → page headings collected:", r), `CURRENT_PAGE. URL: ${e} | Path: ${t} | Title: ${n} | Section headings: ${i}. Use ONLY these exact heading strings for flowengage_highlight — never invent or abbreviate section names.`;
29528
29516
  },
29529
29517
  flowengage_list_forms: async () => {
29530
- let e = QO(), t = $O();
29518
+ let e = XO(), t = ZO();
29531
29519
  return $("flowengage_list_forms ✓", `${e.length} field(s)`, `${t.length} button(s)`), JSON.stringify({
29532
29520
  fields: e,
29533
29521
  buttons: t,
@@ -29536,52 +29524,52 @@ function Tk(e) {
29536
29524
  },
29537
29525
  flowengage_fill_form: async (e) => {
29538
29526
  try {
29539
- $("flowengage_fill_form ▶ raw:", e), MO();
29540
- let t = _k(e);
29527
+ $("flowengage_fill_form ▶ raw:", e), AO();
29528
+ let t = hk(e);
29541
29529
  if (!t.length && r) {
29542
- let e = r(), n = vk(e);
29543
- n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = yk(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = n);
29530
+ let e = r(), n = gk(e);
29531
+ n.length ? $("flowengage_fill_form · inferred URL from last user utterance (model omitted usable fields):", n) : (n = _k(e), n.length && $("flowengage_fill_form · inferred contact fields from last user utterance (empty tool params):", n)), n.length && (t = n);
29544
29532
  }
29545
29533
  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.";
29546
29534
  let n = [];
29547
29535
  for (let e of t) {
29548
29536
  let t = e?.field_key ?? e?.fieldKey, r = e?.value;
29549
29537
  if (t == null || r == null) continue;
29550
- TO(`Filling ${String(t)}...`, { spinner: !0 });
29551
- let a = ZO(), o = uk(a, String(t), r);
29538
+ CO(`Filling ${String(t)}...`, { spinner: !0 });
29539
+ let a = YO(), o = ck(a, String(t), r);
29552
29540
  if (o.length) {
29553
- for (let [e, t] of o.entries()) NO(t), await zO(t), Sk(t, r, { skipScroll: e > 0 }), PO(t), await WO(120);
29541
+ for (let [e, t] of o.entries()) jO(t), await LO(t), bk(t, r, { skipScroll: e > 0 }), MO(t), await HO(120);
29554
29542
  i = o, n.push(String(t));
29555
29543
  continue;
29556
29544
  }
29557
- let s = pk(a, String(t));
29558
- s ||= ik(a, String(t)), s ||= ak(a, String(t), r), s && (NO(s), await zO(s), Sk(s, r), PO(s), await WO(120), i = [s], n.push(String(t)));
29545
+ let s = dk(a, String(t));
29546
+ s ||= nk(a, String(t)), s ||= rk(a, String(t), r), s && (jO(s), await LO(s), bk(s, r), MO(s), await HO(120), i = [s], n.push(String(t)));
29559
29547
  }
29560
29548
  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.";
29561
29549
  let a = `OK_FILLED: ${n.join(", ")}`;
29562
- return $("flowengage_fill_form ✓", a), TO("Form filled", {
29550
+ return $("flowengage_fill_form ✓", a), CO("Form filled", {
29563
29551
  spinner: !1,
29564
29552
  icon: "✅",
29565
29553
  duration: 1100
29566
29554
  }), a;
29567
29555
  } catch (e) {
29568
29556
  let t = `flowengage_fill_form error: ${e?.message || String(e)}`;
29569
- return $("flowengage_fill_form ✖", t), TO("Failed to fill form", {
29557
+ return $("flowengage_fill_form ✖", t), CO("Failed to fill form", {
29570
29558
  spinner: !1,
29571
29559
  icon: "⚠️",
29572
29560
  duration: 1800
29573
29561
  }), t;
29574
29562
  } finally {
29575
- BO(), MO(), EO(700);
29563
+ RO(), AO(), wO(700);
29576
29564
  }
29577
29565
  },
29578
29566
  flowengage_click_button: async (e) => {
29579
- let t = gk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29567
+ let t = mk(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim();
29580
29568
  if ($("flowengage_click_button ▶", n), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
29581
- let r = hk(n, i);
29569
+ let r = pk(n, i);
29582
29570
  if (!r) return $("flowengage_click_button ✖ no match"), `Could not find a button matching "${n}". Call flowengage_list_forms to see button texts.`;
29583
29571
  try {
29584
- TO(`Clicking ${n}...`, { spinner: !0 });
29572
+ CO(`Clicking ${n}...`, { spinner: !0 });
29585
29573
  try {
29586
29574
  r.scrollIntoView({
29587
29575
  block: "center",
@@ -29590,22 +29578,22 @@ function Tk(e) {
29590
29578
  } catch {
29591
29579
  r.scrollIntoView(!0);
29592
29580
  }
29593
- await zO(r), r.focus?.(), await VO(r), HO(r), r.click();
29581
+ await LO(r), r.focus?.(), await zO(r), BO(r), r.click();
29594
29582
  let e = (r.textContent || r.value || r.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
29595
- return $("flowengage_click_button ✓", t), TO(`Clicked ${e}`, {
29583
+ return $("flowengage_click_button ✓", t), CO(`Clicked ${e}`, {
29596
29584
  spinner: !1,
29597
29585
  icon: "✅",
29598
29586
  duration: 1200
29599
29587
  }), t;
29600
29588
  } catch (e) {
29601
29589
  let t = `Click failed: ${e?.message || String(e)}`;
29602
- return $("flowengage_click_button ✖", t), TO("Click failed", {
29590
+ return $("flowengage_click_button ✖", t), CO("Click failed", {
29603
29591
  spinner: !1,
29604
29592
  icon: "⚠️",
29605
29593
  duration: 1800
29606
29594
  }), t;
29607
29595
  } finally {
29608
- BO(), EO(700);
29596
+ RO(), wO(700);
29609
29597
  }
29610
29598
  }
29611
29599
  };
@@ -29622,7 +29610,7 @@ function Tk(e) {
29622
29610
  }
29623
29611
  //#endregion
29624
29612
  //#region src/utils/wrapVoiceToolsForLogging.js
29625
- function Ek(e) {
29613
+ function wk(e) {
29626
29614
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29627
29615
  let r = Rn();
29628
29616
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -29639,7 +29627,7 @@ function Ek(e) {
29639
29627
  }
29640
29628
  //#endregion
29641
29629
  //#region src/components/FlowEngageWidget.jsx
29642
- var Dk = {
29630
+ var Tk = {
29643
29631
  blue: "#135bd8",
29644
29632
  red: "#ef334b",
29645
29633
  yellow: "#ffbd2e",
@@ -29647,7 +29635,7 @@ var Dk = {
29647
29635
  highlight: "rgba(255,255,255,0.9)",
29648
29636
  green: "#10b981"
29649
29637
  };
29650
- function Ok(e) {
29638
+ function Ek(e) {
29651
29639
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
29652
29640
  let [t, n, r] = e;
29653
29641
  return e.length >= 3 && r ? [
@@ -29661,12 +29649,12 @@ function Ok(e) {
29661
29649
  "#f7f8fa"
29662
29650
  ].join(", ");
29663
29651
  }
29664
- function kk(e) {
29652
+ function Dk(e) {
29665
29653
  if (!e || typeof e != "string") return "#1a1a1a";
29666
29654
  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;
29667
29655
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
29668
29656
  }
29669
- function Ak({ logo: t, style: n }) {
29657
+ function Ok({ logo: t, style: n }) {
29670
29658
  if (!t) return null;
29671
29659
  if (typeof t == "string") return /* @__PURE__ */ g("img", {
29672
29660
  src: t,
@@ -29691,7 +29679,7 @@ function Ak({ logo: t, style: n }) {
29691
29679
  children: r
29692
29680
  }) : null;
29693
29681
  }
29694
- function jk({ title: e }) {
29682
+ function kk({ title: e }) {
29695
29683
  return /* @__PURE__ */ g("div", {
29696
29684
  style: {
29697
29685
  width: "100%",
@@ -29709,18 +29697,18 @@ function jk({ title: e }) {
29709
29697
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
29710
29698
  });
29711
29699
  }
29712
- function Mk(e, t) {
29700
+ function Ak(e, t) {
29713
29701
  let n = (t || "").trim();
29714
29702
  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;
29715
29703
  }
29716
- function Nk({ orbColors: e, ...t }) {
29717
- return /* @__PURE__ */ g(dO, {
29704
+ function jk({ orbColors: e, ...t }) {
29705
+ return /* @__PURE__ */ g(lO, {
29718
29706
  colors: e,
29719
29707
  ...t
29720
29708
  });
29721
29709
  }
29722
- function Pk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29723
- let s = n || Dk.green, c = kk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29710
+ function Mk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
29711
+ let s = n || Tk.green, c = Dk(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
29724
29712
  style: {
29725
29713
  display: "flex",
29726
29714
  alignItems: a ? "flex-end" : "center",
@@ -29841,7 +29829,7 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29841
29829
  delay: 0
29842
29830
  },
29843
29831
  style: { flexShrink: 0 },
29844
- children: /* @__PURE__ */ g(Nk, {
29832
+ children: /* @__PURE__ */ g(jk, {
29845
29833
  size: l,
29846
29834
  orbColors: t
29847
29835
  })
@@ -29873,8 +29861,8 @@ function Pk({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
29873
29861
  children: u
29874
29862
  })] });
29875
29863
  }
29876
- function Fk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29877
- let c = n || Dk.green, l = kk(c);
29864
+ function Nk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
29865
+ let c = n || Tk.green, l = Dk(c);
29878
29866
  return /* @__PURE__ */ _(Dm.div, {
29879
29867
  initial: {
29880
29868
  scale: 50 / 350,
@@ -29945,7 +29933,7 @@ function Fk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
29945
29933
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
29946
29934
  })
29947
29935
  }),
29948
- /* @__PURE__ */ g(Nk, {
29936
+ /* @__PURE__ */ g(jk, {
29949
29937
  size: 72,
29950
29938
  orbColors: t
29951
29939
  }),
@@ -30014,7 +30002,7 @@ function Fk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
30014
30002
  ]
30015
30003
  });
30016
30004
  }
30017
- function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
30005
+ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i, siteId: a, apiBaseUrl: s, chatId: l, historyRef: u, onMessageSync: d, voiceEndCounter: f }) {
30018
30006
  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 = p("idle"), le = p(!1), ue = p(null), de = p(null), fe = p(!1), pe = o((e = "minimized") => {
30019
30007
  E.current = e, re.current = !0, queueMicrotask(() => {
30020
30008
  ee.current || (ee.current = !0, T.current?.());
@@ -30022,7 +30010,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30022
30010
  }, [u]), me = o(async (e) => {
30023
30011
  re.current = !0;
30024
30012
  try {
30025
- wD();
30013
+ SD();
30026
30014
  } catch {}
30027
30015
  if (a) try {
30028
30016
  Ve(a);
@@ -30070,7 +30058,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30070
30058
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
30071
30059
  u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", kr({ onBeforeNavigate: () => {
30072
30060
  if (a && u.current.length > 0) try {
30073
- let e = bO(u.current);
30061
+ let e = vO(u.current);
30074
30062
  e && Ae(a, e);
30075
30063
  } catch {}
30076
30064
  if (!er()) {
@@ -30092,7 +30080,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30092
30080
  }
30093
30081
  Ne();
30094
30082
  } });
30095
- let t = Ek(Tk({
30083
+ let t = wk(Ck({
30096
30084
  siteId: a || null,
30097
30085
  apiBaseUrl: s || null,
30098
30086
  getLastUserVoiceText: () => w.current,
@@ -30162,10 +30150,10 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30162
30150
  message: r,
30163
30151
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
30164
30152
  }], a) try {
30165
- let e = bO(u.current);
30153
+ let e = vO(u.current);
30166
30154
  e && Ae(a, e);
30167
30155
  } catch {}
30168
- if (Mk(n, r)) {
30156
+ if (Ak(n, r)) {
30169
30157
  pe("minimized");
30170
30158
  return;
30171
30159
  }
@@ -30248,7 +30236,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30248
30236
  })(), () => {
30249
30237
  e = !0, re.current = !0;
30250
30238
  try {
30251
- wD();
30239
+ SD();
30252
30240
  } catch {}
30253
30241
  if (a) try {
30254
30242
  Ve(a);
@@ -30329,7 +30317,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30329
30317
  },
30330
30318
  children: "Muted"
30331
30319
  }),
30332
- /* @__PURE__ */ g(Nk, {
30320
+ /* @__PURE__ */ g(jk, {
30333
30321
  size: 72,
30334
30322
  voiceState: h,
30335
30323
  isMuted: y,
@@ -30415,7 +30403,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30415
30403
  y2: "23"
30416
30404
  })
30417
30405
  ]
30418
- }) : /* @__PURE__ */ g(TD, {
30406
+ }) : /* @__PURE__ */ g(CD, {
30419
30407
  size: 16,
30420
30408
  color: "currentColor"
30421
30409
  })
@@ -30437,7 +30425,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30437
30425
  padding: 0,
30438
30426
  flexShrink: 0
30439
30427
  },
30440
- children: /* @__PURE__ */ g(ND, {
30428
+ children: /* @__PURE__ */ g(jD, {
30441
30429
  size: 16,
30442
30430
  color: "currentColor"
30443
30431
  })
@@ -30486,7 +30474,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30486
30474
  onMouseLeave: (e) => {
30487
30475
  e.currentTarget.style.background = "none";
30488
30476
  },
30489
- children: [/* @__PURE__ */ g(PD, {}), "Enter Chat Mode"]
30477
+ children: [/* @__PURE__ */ g(MD, {}), "Enter Chat Mode"]
30490
30478
  }),
30491
30479
  /* @__PURE__ */ _("button", {
30492
30480
  onClick: () => {
@@ -30515,7 +30503,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30515
30503
  onMouseLeave: (e) => {
30516
30504
  e.currentTarget.style.background = "none";
30517
30505
  },
30518
- children: [/* @__PURE__ */ g(FD, {}), "End Conversation"]
30506
+ children: [/* @__PURE__ */ g(ND, {}), "End Conversation"]
30519
30507
  }),
30520
30508
  /* @__PURE__ */ g("button", {
30521
30509
  onClick: () => S(!1),
@@ -30567,7 +30555,7 @@ function Ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30567
30555
  ]
30568
30556
  });
30569
30557
  }
30570
- function Lk({ orbColors: e }) {
30558
+ function Fk({ orbColors: e }) {
30571
30559
  return /* @__PURE__ */ g("div", {
30572
30560
  style: {
30573
30561
  flexShrink: 0,
@@ -30577,13 +30565,13 @@ function Lk({ orbColors: e }) {
30577
30565
  alignItems: "center",
30578
30566
  justifyContent: "center"
30579
30567
  },
30580
- children: /* @__PURE__ */ g(Nk, {
30568
+ children: /* @__PURE__ */ g(jk, {
30581
30569
  size: 36,
30582
30570
  orbColors: e
30583
30571
  })
30584
30572
  });
30585
30573
  }
30586
- var Rk = () => /* @__PURE__ */ g("div", {
30574
+ var Ik = () => /* @__PURE__ */ g("div", {
30587
30575
  style: {
30588
30576
  display: "flex",
30589
30577
  marginBottom: "12px",
@@ -30613,7 +30601,7 @@ var Rk = () => /* @__PURE__ */ g("div", {
30613
30601
  } }, e))
30614
30602
  })
30615
30603
  });
30616
- function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, 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 }) {
30604
+ function Lk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, onEndConversation: De, showPoweredBy: Oe, getVisitorChatHistory: ke, getVisitorChatThread: Ae, resumeChat: je, isSessionRestoring: Me, isClosing: O }) {
30617
30605
  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 () => {
30618
30606
  Le(!1), ze(!0), Ue(!0), Ge(null);
30619
30607
  try {
@@ -30738,7 +30726,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30738
30726
  justifyContent: "center",
30739
30727
  height: "40px"
30740
30728
  },
30741
- children: i ? /* @__PURE__ */ g(Ak, {
30729
+ children: i ? /* @__PURE__ */ g(Ok, {
30742
30730
  logo: i,
30743
30731
  style: {
30744
30732
  height: "34px",
@@ -30751,7 +30739,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30751
30739
  height: "40px",
30752
30740
  flexShrink: 0
30753
30741
  },
30754
- children: /* @__PURE__ */ g(jk, { title: e.chatTitle })
30742
+ children: /* @__PURE__ */ g(kk, { title: e.chatTitle })
30755
30743
  })
30756
30744
  }), /* @__PURE__ */ g("div", {
30757
30745
  style: {
@@ -31033,7 +31021,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31033
31021
  })
31034
31022
  ]
31035
31023
  }),
31036
- /* @__PURE__ */ g(nO, {
31024
+ /* @__PURE__ */ g(eO, {
31037
31025
  webRTCError: fe,
31038
31026
  micError: pe,
31039
31027
  setMicError: me,
@@ -31041,7 +31029,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31041
31029
  isRateLimited: ee,
31042
31030
  rateLimitMessage: te
31043
31031
  }),
31044
- Se && /* @__PURE__ */ g(yO, {
31032
+ Se && /* @__PURE__ */ g(_O, {
31045
31033
  agentName: v,
31046
31034
  agentHeadshot: y,
31047
31035
  fallbackAgentName: b,
@@ -31233,17 +31221,17 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31233
31221
  children: "No previous chats found."
31234
31222
  })
31235
31223
  })]
31236
- }) : null, Ne ? /* @__PURE__ */ g(eO, {
31224
+ }) : null, Ne ? /* @__PURE__ */ g(QD, {
31237
31225
  chatHistory: l,
31238
31226
  isAiTyping: u,
31239
31227
  isLoading: T,
31240
31228
  isAgentTyping: d,
31241
31229
  setReplyContext: de,
31242
- TypingDots: Rk,
31230
+ TypingDots: Ik,
31243
31231
  primaryColor: n,
31244
31232
  agentHeadshot: y,
31245
31233
  agentDisplayName: v || b,
31246
- botAvatarNode: /* @__PURE__ */ g(Lk, { orbColors: t })
31234
+ botAvatarNode: /* @__PURE__ */ g(Fk, { orbColors: t })
31247
31235
  }) : Me ? /* @__PURE__ */ _("div", {
31248
31236
  style: {
31249
31237
  flex: 1,
@@ -31284,7 +31272,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31284
31272
  padding: "28px 24px"
31285
31273
  },
31286
31274
  children: [
31287
- /* @__PURE__ */ g(Nk, {
31275
+ /* @__PURE__ */ g(jk, {
31288
31276
  size: 94,
31289
31277
  orbColors: t
31290
31278
  }),
@@ -31375,7 +31363,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31375
31363
  zIndex: 1,
31376
31364
  padding: oe ? "6px 0 0" : "12px 0 0"
31377
31365
  },
31378
- children: /* @__PURE__ */ g(tO, {
31366
+ children: /* @__PURE__ */ g($D, {
31379
31367
  input: x,
31380
31368
  setInput: S,
31381
31369
  onSubmit: C,
@@ -31425,7 +31413,7 @@ function zk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31425
31413
  ]
31426
31414
  });
31427
31415
  }
31428
- function Bk() {
31416
+ function Rk() {
31429
31417
  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();
31430
31418
  c(() => {
31431
31419
  try {
@@ -31443,7 +31431,7 @@ function Bk() {
31443
31431
  }, Fe = {
31444
31432
  ...ke.features || {},
31445
31433
  ...Ae.features || {}
31446
- }, 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 = Ok(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) => ({
31434
+ }, 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 = Ek(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) => ({
31447
31435
  id: e.key || `qr-${t}`,
31448
31436
  label: e.label,
31449
31437
  message: e.label,
@@ -31508,7 +31496,7 @@ function Bk() {
31508
31496
  let Ft = o(() => {
31509
31497
  St(null), wt("");
31510
31498
  }, []), It = o((e) => {
31511
- let t = YD(e);
31499
+ let t = qD(e);
31512
31500
  if (t) {
31513
31501
  St(null), wt(t);
31514
31502
  return;
@@ -31614,7 +31602,7 @@ function Bk() {
31614
31602
  if (xt) {
31615
31603
  try {
31616
31604
  Et(!0), wt("");
31617
- let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${ZD(xt)}`;
31605
+ let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${YD(xt)}`;
31618
31606
  lt(""), dt(null), Ft(), await D(r, "", t, {
31619
31607
  type: "file",
31620
31608
  metadata: {
@@ -31707,7 +31695,7 @@ function Bk() {
31707
31695
  onWheel: (e) => e.stopPropagation(),
31708
31696
  onTouchMove: (e) => e.stopPropagation(),
31709
31697
  children: [
31710
- A === "entry_prompt" && /* @__PURE__ */ g(Pk, {
31698
+ A === "entry_prompt" && /* @__PURE__ */ g(Mk, {
31711
31699
  copy: Ze,
31712
31700
  orbColors: Re,
31713
31701
  primaryColor: ze,
@@ -31790,13 +31778,13 @@ function Bk() {
31790
31778
  children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
31791
31779
  })]
31792
31780
  })]
31793
- }), /* @__PURE__ */ g(Nk, {
31781
+ }), /* @__PURE__ */ g(jk, {
31794
31782
  size: 50,
31795
31783
  orbColors: Re,
31796
31784
  onClick: T && Dt ? Lt : Ie ? Kt : Jt
31797
31785
  })]
31798
31786
  }),
31799
- A === "connection_modal" && /* @__PURE__ */ g(Fk, {
31787
+ A === "connection_modal" && /* @__PURE__ */ g(Nk, {
31800
31788
  copy: Ze,
31801
31789
  orbColors: Re,
31802
31790
  primaryColor: ze,
@@ -31806,7 +31794,7 @@ function Bk() {
31806
31794
  isMobile: Nt,
31807
31795
  isClosing: kt
31808
31796
  }),
31809
- A === "voice_mode" && /* @__PURE__ */ g(Ik, {
31797
+ A === "voice_mode" && /* @__PURE__ */ g(Pk, {
31810
31798
  orbColors: Re,
31811
31799
  onEnterChat: Jt,
31812
31800
  onEndChat: Yt,
@@ -31819,7 +31807,7 @@ function Bk() {
31819
31807
  onMessageSync: oe,
31820
31808
  voiceEndCounter: Oe
31821
31809
  }, "voice"),
31822
- A === "call_screen" && /* @__PURE__ */ g(vO, {
31810
+ A === "call_screen" && /* @__PURE__ */ g(gO, {
31823
31811
  incomingCall: w,
31824
31812
  activeCallId: T,
31825
31813
  callConnectionState: ee,
@@ -31838,7 +31826,7 @@ function Bk() {
31838
31826
  orbColors: Re,
31839
31827
  chatHistory: r
31840
31828
  }),
31841
- A === "text_chat" && /* @__PURE__ */ g(zk, {
31829
+ A === "text_chat" && /* @__PURE__ */ g(Lk, {
31842
31830
  isClosing: kt,
31843
31831
  copy: Ze,
31844
31832
  orbColors: Re,
@@ -31903,7 +31891,7 @@ function Bk() {
31903
31891
  }
31904
31892
  //#endregion
31905
31893
  //#region src/components/ErrorBoundary.jsx
31906
- var Vk = class extends e.Component {
31894
+ var zk = class extends e.Component {
31907
31895
  constructor(e) {
31908
31896
  super(e), this.state = { hasError: !1 };
31909
31897
  }
@@ -31918,4 +31906,4 @@ var Vk = class extends e.Component {
31918
31906
  }
31919
31907
  };
31920
31908
  //#endregion
31921
- export { dO as AnimatedOrb, Vk as ErrorBoundary, Rr as FlowEngageProvider, Bk as FlowEngageWidget, Ln as useFlowEngage };
31909
+ export { lO as AnimatedOrb, zk as ErrorBoundary, Rr as FlowEngageProvider, Rk as FlowEngageWidget, Ln as useFlowEngage };