@flowengage/react-chatbot 8.0.117 → 8.0.119

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.
@@ -9719,78 +9719,82 @@ function Ah() {
9719
9719
  #${Q}-panel {
9720
9720
  position: fixed;
9721
9721
  bottom: 1.5rem;
9722
- width: 330px;
9723
- max-height: min(560px, calc(100vh - 140px));
9722
+ right: 1.5rem;
9723
+ width: 320px;
9724
+ min-height: 300px;
9725
+ height: min(72vh, 640px);
9726
+ max-height: calc(100vh - 120px);
9724
9727
  display: flex;
9725
9728
  flex-direction: column;
9726
- background: rgba(15, 22, 36, 0.97);
9727
- backdrop-filter: blur(14px);
9728
- -webkit-backdrop-filter: blur(14px);
9729
- border-radius: 18px;
9730
- box-shadow: 0 14px 48px rgba(0, 0, 0, 0.45);
9731
- color: #f1f5f9;
9729
+ background: #ffffff;
9730
+ border: 1px solid rgba(16, 24, 40, 0.08);
9731
+ border-radius: 16px;
9732
+ box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18), 0 2px 6px rgba(16, 24, 40, 0.06);
9733
+ color: #101828;
9732
9734
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
9733
9735
  z-index: 999998;
9734
9736
  opacity: 0;
9735
- transform: translateY(12px);
9736
- transition: opacity 0.2s ease, transform 0.2s ease;
9737
+ transform: translateY(10px);
9738
+ transition: opacity 0.18s ease, transform 0.18s ease;
9737
9739
  pointer-events: none;
9738
9740
  overflow: hidden;
9739
9741
  }
9740
9742
  #${Q}-panel.${Q}-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
9741
- #${Q}-panel[data-side="right"] { right: calc(1.5rem + 350px + 14px); }
9742
- #${Q}-panel[data-side="left"] { left: calc(1.5rem + 350px + 14px); }
9743
9743
  @media (max-width: 900px) {
9744
- #${Q}-panel,
9745
- #${Q}-panel[data-side="right"],
9746
- #${Q}-panel[data-side="left"] {
9747
- left: 12px; right: 12px; width: auto;
9748
- bottom: 12px; max-height: 45vh;
9744
+ #${Q}-panel {
9745
+ left: 12px !important; right: 12px !important; width: auto !important;
9746
+ bottom: 12px !important; height: 50vh; min-height: 0;
9749
9747
  }
9750
9748
  }
9751
9749
  #${Q}-panel-head {
9752
9750
  display: flex; align-items: center; gap: 8px;
9753
- padding: 13px 14px 11px;
9754
- border-bottom: 1px solid rgba(255,255,255,0.08);
9751
+ padding: 14px 14px 12px;
9752
+ border-bottom: 1px solid rgba(16, 24, 40, 0.07);
9755
9753
  flex-shrink: 0;
9756
9754
  }
9757
- #${Q}-panel-title { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
9758
- #${Q}-panel-count { font-size: 11px; color: rgba(241,245,249,0.55); flex-shrink: 0; }
9755
+ #${Q}-panel-title { font-size: 14px; font-weight: 600; color: #101828; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
9756
+ #${Q}-panel-count {
9757
+ font-size: 11px; font-weight: 600; color: #475467; flex-shrink: 0;
9758
+ background: #f2f4f7; border-radius: 999px; padding: 2px 8px;
9759
+ }
9759
9760
  #${Q}-panel-close {
9760
- flex-shrink: 0; width: 24px; height: 24px; border: none; cursor: pointer;
9761
- border-radius: 50%; background: rgba(255,255,255,0.09); color: #f1f5f9;
9762
- font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
9763
- transition: background 0.15s ease;
9761
+ flex-shrink: 0; width: 26px; height: 26px; border: none; cursor: pointer;
9762
+ border-radius: 50%; background: #f2f4f7; color: #475467;
9763
+ font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
9764
+ transition: background 0.15s ease, color 0.15s ease;
9764
9765
  }
9765
- #${Q}-panel-close:hover { background: rgba(255,255,255,0.18); }
9766
+ #${Q}-panel-close:hover { background: #e4e7ec; color: #101828; }
9766
9767
  #${Q}-panel-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
9767
9768
  .${Q}-card {
9768
- display: flex; gap: 10px; align-items: center;
9769
- padding: 8px; border-radius: 12px;
9770
- background: rgba(255,255,255,0.04);
9769
+ display: flex; gap: 11px; align-items: center;
9770
+ padding: 9px; border-radius: 11px;
9771
+ background: #ffffff; border: 1px solid rgba(16, 24, 40, 0.07);
9771
9772
  text-decoration: none; color: inherit;
9772
- transition: background 0.15s ease, transform 0.15s ease;
9773
+ transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
9774
+ }
9775
+ .${Q}-card:hover {
9776
+ background: #fafbfc; border-color: rgba(16, 24, 40, 0.14);
9777
+ box-shadow: 0 2px 8px rgba(16, 24, 40, 0.07);
9773
9778
  }
9774
- .${Q}-card:hover { background: rgba(255,255,255,0.10); transform: translateY(-1px); }
9775
9779
  .${Q}-card-thumb {
9776
- width: 48px; height: 48px; flex-shrink: 0; border-radius: 8px;
9777
- object-fit: cover; background: rgba(255,255,255,0.07);
9780
+ width: 52px; height: 52px; flex-shrink: 0; border-radius: 9px;
9781
+ object-fit: cover; background: #f2f4f7;
9778
9782
  }
9779
9783
  .${Q}-card-thumb-ph {
9780
- width: 48px; height: 48px; flex-shrink: 0; border-radius: 8px;
9781
- background: rgba(255,255,255,0.07); display: flex; align-items: center;
9782
- justify-content: center; font-size: 17px; opacity: 0.5;
9784
+ width: 52px; height: 52px; flex-shrink: 0; border-radius: 9px;
9785
+ background: #f2f4f7; display: flex; align-items: center;
9786
+ justify-content: center; font-size: 18px; opacity: 0.6;
9783
9787
  }
9784
9788
  .${Q}-card-body { min-width: 0; flex: 1; }
9785
9789
  .${Q}-card-title {
9786
- font-size: 12.5px; font-weight: 550; line-height: 1.3;
9790
+ font-size: 13px; font-weight: 600; line-height: 1.35; color: #101828;
9787
9791
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
9788
9792
  }
9789
- .${Q}-card-meta { font-size: 10.5px; color: rgba(241,245,249,0.55); margin-top: 3px; }
9790
- .${Q}-card-price { font-size: 11.5px; font-weight: 600; margin-top: 2px; }
9793
+ .${Q}-card-meta { font-size: 11px; color: #667085; margin-top: 3px; }
9794
+ .${Q}-card-price { font-size: 12.5px; font-weight: 600; color: #101828; margin-top: 3px; }
9791
9795
  .${Q}-chip {
9792
- display: inline-block; font-size: 9.5px; padding: 1px 6px; border-radius: 999px;
9793
- background: rgba(99,102,241,0.22); color: #c7d2fe; margin-right: 5px;
9796
+ display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px;
9797
+ border-radius: 999px; background: #eef2ff; color: #4338ca; margin-right: 6px;
9794
9798
  }
9795
9799
 
9796
9800
  /* ── Keyframes ───────────────────────────────────────────────────────────────── */
@@ -9844,7 +9848,17 @@ var Ih = null;
9844
9848
  function Lh() {
9845
9849
  return (!Ih || !Ih.isConnected) && (Ih = document.createElement("div"), Ih.id = `${Q}-panel`, document.body.appendChild(Ih)), Ih;
9846
9850
  }
9847
- function Rh(e, t) {
9851
+ var Rh = 12, zh = "right", Bh = !1;
9852
+ function Vh(e, t) {
9853
+ if (e.style.left = "", e.style.right = "", e.style.bottom = "", window.innerWidth <= 900) return;
9854
+ let n = document.getElementById("flowengage-root"), r = (n?.shadowRoot?.querySelector(".flowengage-widget-root") || document.querySelector(".flowengage-widget-root") || n)?.getBoundingClientRect();
9855
+ if (!r || !r.width) {
9856
+ t === "left" ? e.style.left = "calc(1.5rem + 120px)" : e.style.right = "calc(1.5rem + 120px)";
9857
+ return;
9858
+ }
9859
+ t === "left" ? e.style.left = `${Math.round(r.right + Rh)}px` : e.style.right = `${Math.round(window.innerWidth - r.left + Rh)}px`, e.style.bottom = `${Math.max(12, Math.round(window.innerHeight - r.bottom))}px`;
9860
+ }
9861
+ function Hh(e, t) {
9848
9862
  let n = Number(e);
9849
9863
  if (!Number.isFinite(n)) return null;
9850
9864
  let r = n.toLocaleString(void 0, {
@@ -9853,7 +9867,7 @@ function Rh(e, t) {
9853
9867
  });
9854
9868
  return t ? `${t} ${r}` : r;
9855
9869
  }
9856
- function zh(e) {
9870
+ function Uh(e) {
9857
9871
  if (!e) return null;
9858
9872
  let t = new Date(e);
9859
9873
  return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString(void 0, {
@@ -9862,13 +9876,15 @@ function zh(e) {
9862
9876
  year: "numeric"
9863
9877
  });
9864
9878
  }
9865
- function Bh(e, { title: t = "Products", side: n = "right", productUrl: r = null } = {}) {
9879
+ function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null } = {}) {
9866
9880
  if (typeof document > "u") return;
9867
9881
  let i = Array.isArray(e) ? e.filter(Boolean) : [];
9868
- if (!i.length) return Vh();
9882
+ if (!i.length) return Gh();
9869
9883
  Ah();
9870
9884
  let a = Lh();
9871
- a.setAttribute("data-side", n === "left" ? "left" : "right"), a.innerHTML = "";
9885
+ zh = n === "left" ? "left" : "right", Vh(a, zh), Bh || (Bh = !0, window.addEventListener("resize", () => {
9886
+ Ih?.classList.contains(`${Q}-show`) && Vh(Ih, zh);
9887
+ })), a.innerHTML = "";
9872
9888
  let o = document.createElement("div");
9873
9889
  o.id = `${Q}-panel-head`;
9874
9890
  let s = document.createElement("div");
@@ -9876,7 +9892,7 @@ function Bh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9876
9892
  let c = document.createElement("span");
9877
9893
  c.id = `${Q}-panel-count`, c.textContent = String(i.length);
9878
9894
  let l = document.createElement("button");
9879
- l.id = `${Q}-panel-close`, l.type = "button", l.setAttribute("aria-label", "Close product panel"), l.textContent = "×", l.addEventListener("click", () => Vh()), o.append(s, c, l);
9895
+ l.id = `${Q}-panel-close`, l.type = "button", l.setAttribute("aria-label", "Close product panel"), l.textContent = "×", l.addEventListener("click", () => Gh()), o.append(s, c, l);
9880
9896
  let u = document.createElement("div");
9881
9897
  u.id = `${Q}-panel-list`;
9882
9898
  for (let e of i) {
@@ -9897,7 +9913,7 @@ function Bh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9897
9913
  a.className = `${Q}-card-title`, a.textContent = e.title || "Item", i.appendChild(a);
9898
9914
  let o = [];
9899
9915
  e.quantity > 1 && o.push(`Qty ${e.quantity}`);
9900
- let s = zh(e.orderedAt);
9916
+ let s = Uh(e.orderedAt);
9901
9917
  if (s && o.push(s), e.fulfillmentStatus && o.push(e.fulfillmentStatus), o.length || e.productType) {
9902
9918
  let t = document.createElement("div");
9903
9919
  if (t.className = `${Q}-card-meta`, e.productType) {
@@ -9906,7 +9922,7 @@ function Bh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9906
9922
  }
9907
9923
  t.appendChild(document.createTextNode(o.join(" · "))), i.appendChild(t);
9908
9924
  }
9909
- let c = Rh(e.price, e.currency);
9925
+ let c = Hh(e.price, e.currency);
9910
9926
  if (c) {
9911
9927
  let e = document.createElement("div");
9912
9928
  e.className = `${Q}-card-price`, e.textContent = c, i.appendChild(e);
@@ -9915,45 +9931,45 @@ function Bh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9915
9931
  }
9916
9932
  a.append(o, u), a.classList.remove(`${Q}-show`), a.offsetHeight, a.classList.add(`${Q}-show`);
9917
9933
  }
9918
- function Vh() {
9934
+ function Gh() {
9919
9935
  Ih && Ih.classList.remove(`${Q}-show`);
9920
9936
  }
9921
- var Hh = null, Uh = [];
9922
- function Wh() {
9923
- return (!Hh || !Hh.isConnected) && (Hh = document.createElement("div"), Hh.id = `${Q}-bar`, document.body.appendChild(Hh)), Hh;
9937
+ var Kh = null, qh = [];
9938
+ function Jh() {
9939
+ return (!Kh || !Kh.isConnected) && (Kh = document.createElement("div"), Kh.id = `${Q}-bar`, document.body.appendChild(Kh)), Kh;
9924
9940
  }
9925
- function Gh() {
9941
+ function Yh() {
9926
9942
  if (typeof document > "u") return;
9927
- Ah(), Uh.forEach(clearTimeout), Uh = [];
9928
- let e = Wh();
9943
+ Ah(), qh.forEach(clearTimeout), qh = [];
9944
+ let e = Jh();
9929
9945
  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";
9930
9946
  let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
9931
9947
  for (let [e, r] of t) {
9932
9948
  let t = n, i = e, a = r;
9933
- Uh.push(setTimeout(() => {
9934
- Hh && (Hh.style.transition = a, Hh.style.width = `${i}%`);
9949
+ qh.push(setTimeout(() => {
9950
+ Kh && (Kh.style.transition = a, Kh.style.width = `${i}%`);
9935
9951
  }, t)), n += 800;
9936
9952
  }
9937
9953
  }
9938
- function Kh() {
9939
- Hh && (Uh.forEach(clearTimeout), Uh = [], Hh.style.transition = "width 0.2s ease", Hh.style.width = "100%", Uh.push(setTimeout(() => {
9940
- Hh && (Hh.style.transition = "opacity 0.35s ease", Hh.style.opacity = "0", Uh.push(setTimeout(() => {
9941
- Hh && (Hh.style.width = "0%", Hh.classList.remove(`${Q}-bar-active`));
9954
+ function Xh() {
9955
+ Kh && (qh.forEach(clearTimeout), qh = [], Kh.style.transition = "width 0.2s ease", Kh.style.width = "100%", qh.push(setTimeout(() => {
9956
+ Kh && (Kh.style.transition = "opacity 0.35s ease", Kh.style.opacity = "0", qh.push(setTimeout(() => {
9957
+ Kh && (Kh.style.width = "0%", Kh.classList.remove(`${Q}-bar-active`));
9942
9958
  }, 380)));
9943
9959
  }, 220)));
9944
9960
  }
9945
- var qh = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
9961
+ var Zh = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
9946
9962
  <filter id="${Q}-csh">
9947
9963
  <feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
9948
9964
  </filter>
9949
9965
  <path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
9950
9966
  fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
9951
9967
  filter="url(#${Q}-csh)"/>
9952
- </svg>`, Jh = null, Yh = !1;
9953
- function Xh() {
9954
- return (!Jh || !Jh.isConnected) && (Jh = document.createElement("div"), Jh.id = `${Q}-cursor`, Jh.innerHTML = qh, document.body.appendChild(Jh), Yh = !1), Jh;
9968
+ </svg>`, Qh = null, $h = !1;
9969
+ function eg() {
9970
+ return (!Qh || !Qh.isConnected) && (Qh = document.createElement("div"), Qh.id = `${Q}-cursor`, Qh.innerHTML = Zh, document.body.appendChild(Qh), $h = !1), Qh;
9955
9971
  }
9956
- async function Zh(e) {
9972
+ async function tg(e) {
9957
9973
  if (typeof document > "u" || !e) return;
9958
9974
  Ah();
9959
9975
  let t;
@@ -9962,18 +9978,18 @@ async function Zh(e) {
9962
9978
  } catch {
9963
9979
  return;
9964
9980
  }
9965
- let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = Xh();
9966
- Yh ||= (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 tg(360);
9981
+ let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = eg();
9982
+ $h ||= (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 ag(360);
9967
9983
  }
9968
- function Qh(e = !1) {
9969
- Jh && (e ? (Jh.classList.remove(`${Q}-cursor-visible`), Yh = !1) : (Jh.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
9970
- Yh = !1;
9984
+ function ng(e = !1) {
9985
+ Qh && (e ? (Qh.classList.remove(`${Q}-cursor-visible`), $h = !1) : (Qh.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
9986
+ $h = !1;
9971
9987
  }, 250)));
9972
9988
  }
9973
- async function $h(e) {
9974
- Jh && (Jh.classList.add(`${Q}-cursor-click`), await tg(280), Jh.classList.remove(`${Q}-cursor-click`));
9989
+ async function rg(e) {
9990
+ Qh && (Qh.classList.add(`${Q}-cursor-click`), await ag(280), Qh.classList.remove(`${Q}-cursor-click`));
9975
9991
  }
9976
- function eg(e) {
9992
+ function ig(e) {
9977
9993
  if (!e || typeof document > "u") return;
9978
9994
  Ah();
9979
9995
  let t;
@@ -10001,12 +10017,12 @@ function eg(e) {
10001
10017
  a.remove(), e.style.position = n, e.style.overflow = r;
10002
10018
  }, 650);
10003
10019
  }
10004
- function tg(e) {
10020
+ function ag(e) {
10005
10021
  return new Promise((t) => setTimeout(t, e));
10006
10022
  }
10007
10023
  //#endregion
10008
10024
  //#region src/lib/svgIcons.jsx
10009
- var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10025
+ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10010
10026
  width: e,
10011
10027
  height: e,
10012
10028
  viewBox: "0 0 24 24",
@@ -10022,7 +10038,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10022
10038
  strokeLinecap: "round",
10023
10039
  strokeLinejoin: "round"
10024
10040
  })]
10025
- }), rg = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
10041
+ }), sg = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
10026
10042
  width: e,
10027
10043
  height: e,
10028
10044
  viewBox: "0 0 24 24",
@@ -10037,7 +10053,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10037
10053
  x2: "1",
10038
10054
  y2: "23"
10039
10055
  })]
10040
- }), ig = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
10056
+ }), cg = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
10041
10057
  width: e,
10042
10058
  height: e,
10043
10059
  viewBox: "0 0 24 24",
@@ -10052,7 +10068,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10052
10068
  x2: "12",
10053
10069
  y2: "5"
10054
10070
  }), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
10055
- }), ag = () => /* @__PURE__ */ _("svg", {
10071
+ }), lg = () => /* @__PURE__ */ _("svg", {
10056
10072
  width: "14",
10057
10073
  height: "14",
10058
10074
  viewBox: "0 0 24 24",
@@ -10062,7 +10078,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10062
10078
  strokeLinecap: "round",
10063
10079
  strokeLinejoin: "round",
10064
10080
  children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
10065
- }), og = () => /* @__PURE__ */ g("svg", {
10081
+ }), ug = () => /* @__PURE__ */ g("svg", {
10066
10082
  width: "18",
10067
10083
  height: "18",
10068
10084
  viewBox: "0 0 24 24",
@@ -10072,7 +10088,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10072
10088
  strokeLinecap: "round",
10073
10089
  strokeLinejoin: "round",
10074
10090
  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" })
10075
- }), sg = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
10091
+ }), dg = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
10076
10092
  className: e,
10077
10093
  width: "14",
10078
10094
  height: "14",
@@ -10101,7 +10117,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10101
10117
  y2: "16"
10102
10118
  })
10103
10119
  ]
10104
- }), cg = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
10120
+ }), fg = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
10105
10121
  width: e,
10106
10122
  height: e,
10107
10123
  viewBox: "0 0 24 24",
@@ -10124,7 +10140,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10124
10140
  /* @__PURE__ */ g("path", { d: "M15 13v2" }),
10125
10141
  /* @__PURE__ */ g("path", { d: "M9 13v2" })
10126
10142
  ]
10127
- }), lg = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
10143
+ }), pg = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
10128
10144
  width: e,
10129
10145
  height: e,
10130
10146
  viewBox: "0 0 24 24",
@@ -10144,7 +10160,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10144
10160
  x2: "19",
10145
10161
  y2: "12"
10146
10162
  })]
10147
- }), ug = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10163
+ }), mg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10148
10164
  width: e,
10149
10165
  height: e,
10150
10166
  viewBox: "0 0 24 24",
@@ -10170,7 +10186,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10170
10186
  fill: t
10171
10187
  })
10172
10188
  ]
10173
- }), dg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10189
+ }), hg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10174
10190
  width: "24",
10175
10191
  height: "24",
10176
10192
  viewBox: "0 0 24 24",
@@ -10188,7 +10204,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10188
10204
  "stroke-linecap": "round",
10189
10205
  "stroke-linejoin": "round"
10190
10206
  })]
10191
- }), fg = () => /* @__PURE__ */ g("svg", {
10207
+ }), gg = () => /* @__PURE__ */ g("svg", {
10192
10208
  width: "24",
10193
10209
  height: "24",
10194
10210
  viewBox: "0 0 24 24",
@@ -10200,7 +10216,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10200
10216
  "stroke-width": "1.5",
10201
10217
  "stroke-linejoin": "round"
10202
10218
  })
10203
- }), pg = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
10219
+ }), _g = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
10204
10220
  xmlns: "http://www.w3.org/2000/svg",
10205
10221
  width: e,
10206
10222
  height: e,
@@ -10218,7 +10234,7 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10218
10234
  /* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
10219
10235
  /* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
10220
10236
  ]
10221
- }), mg = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), hg = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), gg = new Set([
10237
+ }), vg = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), yg = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), bg = new Set([
10222
10238
  "p",
10223
10239
  "br",
10224
10240
  "ul",
@@ -10229,30 +10245,30 @@ var ng = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10229
10245
  "b",
10230
10246
  "i",
10231
10247
  "a"
10232
- ]), _g = /^https?:\/\//i;
10233
- function vg(e) {
10248
+ ]), xg = /^https?:\/\//i;
10249
+ function Sg(e) {
10234
10250
  let t = Array.from(e.childNodes);
10235
10251
  for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
10236
10252
  let t = n.tagName.toLowerCase();
10237
- if (!gg.has(t)) {
10253
+ if (!bg.has(t)) {
10238
10254
  e.replaceChild(document.createTextNode(n.textContent), n);
10239
10255
  continue;
10240
10256
  }
10241
10257
  let r = {};
10242
10258
  if (t === "a") {
10243
10259
  let e = n.getAttribute("href") || "";
10244
- _g.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
10260
+ xg.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
10245
10261
  }
10246
10262
  for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
10247
10263
  for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
10248
- vg(n);
10264
+ Sg(n);
10249
10265
  } else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
10250
10266
  }
10251
- function yg(e) {
10267
+ function Cg(e) {
10252
10268
  let t = document.createElement("div");
10253
- return t.innerHTML = e, vg(t), t.innerHTML;
10269
+ return t.innerHTML = e, Sg(t), t.innerHTML;
10254
10270
  }
10255
- function bg(e) {
10271
+ function wg(e) {
10256
10272
  let t = String(e || "").trim();
10257
10273
  if (!t) return t;
10258
10274
  let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
@@ -10264,33 +10280,33 @@ function bg(e) {
10264
10280
  }
10265
10281
  return e;
10266
10282
  }
10267
- var xg = (e = "") => {
10283
+ var Tg = (e = "") => {
10268
10284
  let t = String(e || "").trim();
10269
10285
  if (!t) return "";
10270
- if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return bg(yg(t));
10271
- 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) => hg(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>");
10272
- return bg(n.map((e) => {
10286
+ if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return wg(Cg(t));
10287
+ 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) => yg(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>");
10288
+ return wg(n.map((e) => {
10273
10289
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
10274
10290
  if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
10275
10291
  let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
10276
10292
  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>`;
10277
10293
  }).join(""));
10278
- }, Sg = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Cg = new Set([
10294
+ }, Eg = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Dg = new Set([
10279
10295
  ".pdf",
10280
10296
  ".docx",
10281
10297
  ".png",
10282
10298
  ".jpg",
10283
10299
  ".jpeg"
10284
- ]), wg = "image/png,image/jpeg,.pdf,.docx";
10285
- function Tg(e) {
10300
+ ]), Og = "image/png,image/jpeg,.pdf,.docx";
10301
+ function kg(e) {
10286
10302
  if (!e) return !1;
10287
10303
  let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
10288
- return r === "image/png" || r === "image/jpeg" || Sg.has(r) || Cg.has(n);
10304
+ return r === "image/png" || r === "image/jpeg" || Eg.has(r) || Dg.has(n);
10289
10305
  }
10290
- function Eg(e) {
10291
- return e ? Tg(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
10306
+ function Ag(e) {
10307
+ return e ? kg(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
10292
10308
  }
10293
- function Dg(e = 0) {
10309
+ function jg(e = 0) {
10294
10310
  if (!Number.isFinite(e) || e <= 0) return "";
10295
10311
  let t = [
10296
10312
  "B",
@@ -10302,12 +10318,12 @@ function Dg(e = 0) {
10302
10318
  let i = n >= 10 || r === 0 ? 0 : 1;
10303
10319
  return `${n.toFixed(i)} ${t[r]}`;
10304
10320
  }
10305
- function Og(e) {
10321
+ function Mg(e) {
10306
10322
  return e ? e.name || "Attachment" : "";
10307
10323
  }
10308
10324
  //#endregion
10309
10325
  //#region src/utils/avatarHelpers.js
10310
- function kg(e) {
10326
+ function Ng(e) {
10311
10327
  if (!e || typeof e != "string") return "?";
10312
10328
  let t = e.trim();
10313
10329
  if (!t) return "?";
@@ -10316,7 +10332,7 @@ function kg(e) {
10316
10332
  }
10317
10333
  //#endregion
10318
10334
  //#region src/components/AvatarImageOrInitials.jsx
10319
- function Ag({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10335
+ function Pg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10320
10336
  let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
10321
10337
  return c(() => {
10322
10338
  if (!o) {
@@ -10339,12 +10355,12 @@ function Ag({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10339
10355
  onError: () => a(null)
10340
10356
  }) : /* @__PURE__ */ g("span", {
10341
10357
  style: r,
10342
- children: kg(t)
10358
+ children: Ng(t)
10343
10359
  });
10344
10360
  }
10345
10361
  //#endregion
10346
10362
  //#region src/components/MessageList.jsx
10347
- function jg({ siteId: e, onChoose: t }) {
10363
+ function Fg({ siteId: e, onChoose: t }) {
10348
10364
  let [n, r] = m(null), i = (n) => {
10349
10365
  le(e, n), r(n), t?.(n);
10350
10366
  };
@@ -10417,7 +10433,7 @@ function jg({ siteId: e, onChoose: t }) {
10417
10433
  })
10418
10434
  });
10419
10435
  }
10420
- function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
10436
+ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
10421
10437
  let { resolvedConfig: d } = kn(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
10422
10438
  let t = e.target.closest("a[href]");
10423
10439
  if (!t) return;
@@ -10472,8 +10488,8 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10472
10488
  children: [
10473
10489
  e.map((e) => {
10474
10490
  if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
10475
- if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(jg, { siteId: d?.siteId }, e.id || e.messageId);
10476
- let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, f = e.type === "file" && e.metadata?.fileUrl, p = e.agent_name || e.agentName || e.metadata?.agentName || l, m = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, v = mg(e.replyToContent || e.replyContext?.message || ""), S = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
10491
+ if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(Fg, { siteId: d?.siteId }, e.id || e.messageId);
10492
+ let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, f = e.type === "file" && e.metadata?.fileUrl, p = e.agent_name || e.agentName || e.metadata?.agentName || l, m = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, v = vg(e.replyToContent || e.replyContext?.message || ""), S = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
10477
10493
  return t ? /* @__PURE__ */ g("div", {
10478
10494
  style: {
10479
10495
  display: "flex",
@@ -10518,7 +10534,7 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10518
10534
  fontWeight: 800,
10519
10535
  marginTop: !c && (r || o) ? "22px" : "0px"
10520
10536
  },
10521
- children: r ? u || /* @__PURE__ */ g(cg, { size: 16 }) : /* @__PURE__ */ g(Ag, {
10537
+ children: r ? u || /* @__PURE__ */ g(fg, { size: 16 }) : /* @__PURE__ */ g(Pg, {
10522
10538
  src: m || "",
10523
10539
  name: p,
10524
10540
  imgStyle: {
@@ -10560,7 +10576,7 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10560
10576
  onMouseLeave: (e) => {
10561
10577
  e.currentTarget.style.color = "#9ca3af";
10562
10578
  },
10563
- children: [/* @__PURE__ */ g(ag, {}), "Reply"]
10579
+ children: [/* @__PURE__ */ g(lg, {}), "Reply"]
10564
10580
  }),
10565
10581
  /* @__PURE__ */ _("div", {
10566
10582
  style: {
@@ -10604,7 +10620,7 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10604
10620
  children: v
10605
10621
  })]
10606
10622
  }), f ? (() => {
10607
- let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = Dg(e.metadata.fileSize), a = t.startsWith("image/"), o = `shared file: ${r}`.toLowerCase(), s = (e.message || "").trim(), c = s && s.toLowerCase() !== o && !s.toLowerCase().startsWith("shared file:"), l = t === "application/pdf" ? {
10623
+ let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = jg(e.metadata.fileSize), a = t.startsWith("image/"), o = `shared file: ${r}`.toLowerCase(), s = (e.message || "").trim(), c = s && s.toLowerCase() !== o && !s.toLowerCase().startsWith("shared file:"), l = t === "application/pdf" ? {
10608
10624
  color: "#ef4444",
10609
10625
  label: "PDF"
10610
10626
  } : t.includes("word") || t.includes("docx") ? {
@@ -10785,7 +10801,7 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10785
10801
  });
10786
10802
  })() : r ? /* @__PURE__ */ g("div", {
10787
10803
  className: "flowengage-message-content fe-bot-message",
10788
- dangerouslySetInnerHTML: { __html: xg(e.message) },
10804
+ dangerouslySetInnerHTML: { __html: Tg(e.message) },
10789
10805
  onClick: T
10790
10806
  }) : /* @__PURE__ */ g("div", {
10791
10807
  style: { whiteSpace: "pre-wrap" },
@@ -10850,7 +10866,7 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10850
10866
  boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
10851
10867
  overflow: "hidden"
10852
10868
  },
10853
- children: u || /* @__PURE__ */ g(cg, { size: 16 })
10869
+ children: u || /* @__PURE__ */ g(fg, { size: 16 })
10854
10870
  }), /* @__PURE__ */ _("div", {
10855
10871
  style: {
10856
10872
  display: "flex",
@@ -10892,7 +10908,7 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10892
10908
  borderRadius: "50%",
10893
10909
  overflow: "hidden"
10894
10910
  },
10895
- children: /* @__PURE__ */ g(Ag, {
10911
+ children: /* @__PURE__ */ g(Pg, {
10896
10912
  src: s || "",
10897
10913
  name: l,
10898
10914
  imgStyle: {
@@ -10986,22 +11002,22 @@ function Mg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10986
11002
  }
10987
11003
  //#endregion
10988
11004
  //#region src/components/ChatInput.jsx
10989
- var Ng = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
10990
- function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
11005
+ var Lg = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
11006
+ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
10991
11007
  let D = p(null), O = p(null), k = (e) => {
10992
11008
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
10993
11009
  };
10994
11010
  c(() => {
10995
11011
  d || k(O.current);
10996
11012
  }, [e, d]), c(() => {
10997
- d || Ng || e || s || O.current?.focus();
11013
+ d || Lg || e || s || O.current?.focus();
10998
11014
  }, [
10999
11015
  e,
11000
11016
  d,
11001
11017
  s
11002
11018
  ]);
11003
11019
  let A = (e) => {
11004
- e.key === "Enter" && (Ng || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
11020
+ e.key === "Enter" && (Lg || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
11005
11021
  }, ee = l?.sender === "user" ? "You" : l?.sender === "agent" ? "Agent" : "AI Assistant", te = d ? !!f?.trim() : !!e?.trim() || !!S, ne = s || T || !te, j = !d && b && y;
11006
11022
  return /* @__PURE__ */ _("div", {
11007
11023
  style: {
@@ -11096,7 +11112,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11096
11112
  background: "rgba(59,130,246,0.08)",
11097
11113
  color: "var(--flowengage-primary)"
11098
11114
  },
11099
- children: /* @__PURE__ */ g(cg, { size: 13 })
11115
+ children: /* @__PURE__ */ g(fg, { size: 13 })
11100
11116
  }), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
11101
11117
  })
11102
11118
  }),
@@ -11136,7 +11152,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11136
11152
  overflow: "hidden",
11137
11153
  textOverflow: "ellipsis"
11138
11154
  },
11139
- children: Og(S)
11155
+ children: Mg(S)
11140
11156
  }),
11141
11157
  /* @__PURE__ */ g("div", {
11142
11158
  style: {
@@ -11144,7 +11160,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11144
11160
  color: "#6b7280",
11145
11161
  marginTop: "2px"
11146
11162
  },
11147
- children: Dg(S.size)
11163
+ children: jg(S.size)
11148
11164
  })
11149
11165
  ]
11150
11166
  }), /* @__PURE__ */ g("button", {
@@ -11189,7 +11205,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11189
11205
  j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
11190
11206
  ref: D,
11191
11207
  type: "file",
11192
- accept: wg,
11208
+ accept: Og,
11193
11209
  style: { display: "none" },
11194
11210
  onChange: (e) => {
11195
11211
  let t = e.target.files?.[0];
@@ -11221,7 +11237,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11221
11237
  onMouseLeave: (e) => {
11222
11238
  e.currentTarget.style.opacity = "1";
11223
11239
  },
11224
- children: /* @__PURE__ */ g(lg, {
11240
+ children: /* @__PURE__ */ g(pg, {
11225
11241
  size: 16,
11226
11242
  color: "currentColor"
11227
11243
  })
@@ -11302,7 +11318,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11302
11318
  onMouseLeave: (e) => {
11303
11319
  e.currentTarget.style.opacity = "1";
11304
11320
  },
11305
- children: /* @__PURE__ */ g(ig, { size: 16 })
11321
+ children: /* @__PURE__ */ g(cg, { size: 16 })
11306
11322
  })
11307
11323
  ]
11308
11324
  }),
@@ -11365,7 +11381,7 @@ function Pg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11365
11381
  }
11366
11382
  //#endregion
11367
11383
  //#region src/components/StatusBanners.jsx
11368
- function Fg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
11384
+ function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
11369
11385
  return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
11370
11386
  style: {
11371
11387
  margin: "0 20px 10px",
@@ -11378,7 +11394,7 @@ function Fg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
11378
11394
  gap: "10px"
11379
11395
  },
11380
11396
  children: [
11381
- /* @__PURE__ */ g(sg, { className: "" }),
11397
+ /* @__PURE__ */ g(dg, { className: "" }),
11382
11398
  /* @__PURE__ */ g("span", {
11383
11399
  style: {
11384
11400
  fontSize: "12px",
@@ -11424,13 +11440,13 @@ function Fg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
11424
11440
  }
11425
11441
  //#endregion
11426
11442
  //#region src/components/AnimatedOrb.jsx
11427
- var Ig = [
11443
+ var Bg = [
11428
11444
  "#135bd8",
11429
11445
  "#ef334b",
11430
11446
  "#ffbd2e"
11431
11447
  ];
11432
- function Lg(e) {
11433
- return !Array.isArray(e) || e.length === 0 ? Ig : e.length === 1 ? [
11448
+ function Vg(e) {
11449
+ return !Array.isArray(e) || e.length === 0 ? Bg : e.length === 1 ? [
11434
11450
  e[0],
11435
11451
  e[0],
11436
11452
  e[0]
@@ -11444,7 +11460,7 @@ function Lg(e) {
11444
11460
  e[2]
11445
11461
  ];
11446
11462
  }
11447
- var Rg = {
11463
+ var Hg = {
11448
11464
  idle: 3,
11449
11465
  listening: .75,
11450
11466
  thinking: 1,
@@ -11452,7 +11468,7 @@ var Rg = {
11452
11468
  muted: .75,
11453
11469
  error: .08
11454
11470
  };
11455
- function zg(e) {
11471
+ function Ug(e) {
11456
11472
  if (!e || typeof e != "string") return [
11457
11473
  0,
11458
11474
  0,
@@ -11465,14 +11481,14 @@ function zg(e) {
11465
11481
  parseInt(n.slice(4, 6), 16) / 255
11466
11482
  ];
11467
11483
  }
11468
- function Bg(e, t) {
11484
+ function Wg(e, t) {
11469
11485
  if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
11470
11486
  if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
11471
11487
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
11472
11488
  return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
11473
11489
  }
11474
- var Vg = "\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", Hg = "\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";
11475
- function Ug(e, t, n) {
11490
+ var Gg = "\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", Kg = "\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";
11491
+ function qg(e, t, n) {
11476
11492
  let r = (t, n) => {
11477
11493
  let r = e.createShader(t);
11478
11494
  return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
@@ -11481,10 +11497,10 @@ function Ug(e, t, n) {
11481
11497
  let o = e.createProgram();
11482
11498
  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);
11483
11499
  }
11484
- function Wg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
11485
- let [s, l, u] = Lg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(Rg[t] ?? .35);
11500
+ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
11501
+ let [s, l, u] = Vg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(Hg[t] ?? .35);
11486
11502
  c(() => {
11487
- h.current = Rg[t] ?? .35;
11503
+ h.current = Hg[t] ?? .35;
11488
11504
  }, [t]), c(() => {
11489
11505
  let t = m.current;
11490
11506
  if (!t) return;
@@ -11501,7 +11517,7 @@ function Wg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11501
11517
  console.warn("[AnimatedOrb] WebGL unavailable.");
11502
11518
  return;
11503
11519
  }
11504
- let i = Ug(r, Vg, Hg);
11520
+ let i = qg(r, Gg, Kg);
11505
11521
  if (!i) {
11506
11522
  console.error("[AnimatedOrb] WebGL program failed to compile/link");
11507
11523
  return;
@@ -11531,7 +11547,7 @@ function Wg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11531
11547
  c2: r.getUniformLocation(i, "u_c2"),
11532
11548
  c3: r.getUniformLocation(i, "u_c3")
11533
11549
  };
11534
- r.uniform3fv(c.c1, zg(s)), r.uniform3fv(c.c2, zg(l)), r.uniform3fv(c.c3, zg(u)), r.viewport(0, 0, t.width, t.height);
11550
+ r.uniform3fv(c.c1, Ug(s)), r.uniform3fv(c.c2, Ug(l)), r.uniform3fv(c.c3, Ug(u)), r.viewport(0, 0, t.width, t.height);
11535
11551
  let d = performance.now(), f, p = (e) => {
11536
11552
  r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
11537
11553
  };
@@ -11562,7 +11578,7 @@ function Wg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11562
11578
  position: "absolute",
11563
11579
  inset: -10,
11564
11580
  borderRadius: "50%",
11565
- background: `radial-gradient(circle, ${Bg(s, .18)} 0%, transparent 70%)`,
11581
+ background: `radial-gradient(circle, ${Wg(s, .18)} 0%, transparent 70%)`,
11566
11582
  pointerEvents: "none"
11567
11583
  },
11568
11584
  animate: { opacity: [.3, .75] },
@@ -11640,17 +11656,17 @@ function Wg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11640
11656
  }
11641
11657
  //#endregion
11642
11658
  //#region src/components/CallScreen.jsx
11643
- var Gg = "\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";
11644
- function Kg(e) {
11659
+ var Yg = "\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";
11660
+ function Xg(e) {
11645
11661
  let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
11646
11662
  return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
11647
11663
  }
11648
- function qg(e) {
11664
+ function Zg(e) {
11649
11665
  if (!e || typeof e != "string") return "#1a1a1a";
11650
11666
  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;
11651
11667
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
11652
11668
  }
11653
- function Jg(e, t) {
11669
+ function Qg(e, t) {
11654
11670
  let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
11655
11671
  return n.length === 1 ? [
11656
11672
  `radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
@@ -11667,8 +11683,8 @@ function Jg(e, t) {
11667
11683
  "#f7f8fa"
11668
11684
  ].join(", ");
11669
11685
  }
11670
- function Yg({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
11671
- let i = (t || "A")[0].toUpperCase(), a = qg(r), o = n > 48 ? {
11686
+ function $g({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
11687
+ let i = (t || "A")[0].toUpperCase(), a = Zg(r), o = n > 48 ? {
11672
11688
  boxShadow: `0 0 0 3px ${r}44`,
11673
11689
  border: "3px solid rgba(255,255,255,0.15)"
11674
11690
  } : { border: `1.5px solid ${r}55` };
@@ -11705,7 +11721,7 @@ function Yg({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
11705
11721
  children: i
11706
11722
  });
11707
11723
  }
11708
- function Xg(e) {
11724
+ function e_(e) {
11709
11725
  let t = p(null), n = o(() => {
11710
11726
  if (!t.current) return;
11711
11727
  let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
@@ -11752,8 +11768,8 @@ function Xg(e) {
11752
11768
  n
11753
11769
  ]), c(() => () => n(), [n]), n;
11754
11770
  }
11755
- function Zg({ 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 = [] }) {
11756
- let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = Xg(!!e), S = async () => {
11771
+ function t_({ 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 = [] }) {
11772
+ let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = e_(!!e), S = async () => {
11757
11773
  x(), await c();
11758
11774
  }, C = async () => {
11759
11775
  x(), await l();
@@ -11765,14 +11781,14 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11765
11781
  flexDirection: "column",
11766
11782
  borderRadius: "inherit",
11767
11783
  overflow: "hidden",
11768
- background: Jg(h, m),
11784
+ background: Qg(h, m),
11769
11785
  animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
11770
11786
  };
11771
11787
  if (b === "incoming") {
11772
11788
  let e = Array.isArray(h) && h.length > 0 ? h : [m];
11773
11789
  return /* @__PURE__ */ _("div", {
11774
11790
  style: E,
11775
- children: [/* @__PURE__ */ g("style", { children: Gg }), /* @__PURE__ */ _("div", {
11791
+ children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
11776
11792
  style: {
11777
11793
  flex: 1,
11778
11794
  display: "flex",
@@ -11803,7 +11819,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11803
11819
  width: "96px",
11804
11820
  height: "96px",
11805
11821
  borderRadius: "50%",
11806
- background: `radial-gradient(circle, rgba(${Kg(e[0])},0.2) 0%, transparent 70%)`,
11822
+ background: `radial-gradient(circle, rgba(${Xg(e[0])},0.2) 0%, transparent 70%)`,
11807
11823
  filter: "blur(10px)",
11808
11824
  zIndex: 0
11809
11825
  } }),
@@ -11820,7 +11836,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11820
11836
  animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
11821
11837
  zIndex: 1
11822
11838
  } }, n)),
11823
- /* @__PURE__ */ g(Yg, {
11839
+ /* @__PURE__ */ g($g, {
11824
11840
  headshot: o,
11825
11841
  name: y,
11826
11842
  size: 82,
@@ -11900,7 +11916,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11900
11916
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
11901
11917
  },
11902
11918
  "aria-label": "Decline call",
11903
- children: /* @__PURE__ */ g(rg, { size: 26 })
11919
+ children: /* @__PURE__ */ g(sg, { size: 26 })
11904
11920
  }), /* @__PURE__ */ g("span", {
11905
11921
  style: {
11906
11922
  fontSize: "12px",
@@ -11941,7 +11957,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11941
11957
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
11942
11958
  },
11943
11959
  "aria-label": "Accept call",
11944
- children: /* @__PURE__ */ g(og, {})
11960
+ children: /* @__PURE__ */ g(ug, {})
11945
11961
  }), /* @__PURE__ */ g("span", {
11946
11962
  style: {
11947
11963
  fontSize: "12px",
@@ -11958,7 +11974,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11958
11974
  }
11959
11975
  return b === "connecting" ? /* @__PURE__ */ _("div", {
11960
11976
  style: E,
11961
- children: [/* @__PURE__ */ g("style", { children: Gg }), /* @__PURE__ */ _("div", {
11977
+ children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
11962
11978
  style: {
11963
11979
  flex: 1,
11964
11980
  display: "flex",
@@ -11968,7 +11984,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11968
11984
  gap: "24px"
11969
11985
  },
11970
11986
  children: [
11971
- /* @__PURE__ */ g(Yg, {
11987
+ /* @__PURE__ */ g($g, {
11972
11988
  headshot: o,
11973
11989
  name: y,
11974
11990
  size: 64,
@@ -11995,7 +12011,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11995
12011
  }) : /* @__PURE__ */ _("div", {
11996
12012
  style: E,
11997
12013
  children: [
11998
- /* @__PURE__ */ g("style", { children: Gg }),
12014
+ /* @__PURE__ */ g("style", { children: Yg }),
11999
12015
  /* @__PURE__ */ _("div", {
12000
12016
  style: {
12001
12017
  display: "flex",
@@ -12041,7 +12057,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12041
12057
  children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
12042
12058
  })
12043
12059
  }),
12044
- /* @__PURE__ */ g(Wg, {
12060
+ /* @__PURE__ */ g(Jg, {
12045
12061
  colors: h,
12046
12062
  size: 36,
12047
12063
  voiceState: w
@@ -12092,7 +12108,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12092
12108
  gap: "16px",
12093
12109
  padding: "0 24px 16px"
12094
12110
  },
12095
- children: [/* @__PURE__ */ g(Yg, {
12111
+ children: [/* @__PURE__ */ g($g, {
12096
12112
  headshot: o,
12097
12113
  name: y,
12098
12114
  size: 116,
@@ -12147,7 +12163,7 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12147
12163
  transition: "all 0.2s ease"
12148
12164
  },
12149
12165
  "aria-label": i ? "Unmute" : "Mute",
12150
- children: [g(i ? pg : ng, { size: 18 }), i ? "Unmute" : "Mute"]
12166
+ children: [g(i ? _g : og, { size: 18 }), i ? "Unmute" : "Mute"]
12151
12167
  }), /* @__PURE__ */ _("button", {
12152
12168
  type: "button",
12153
12169
  onClick: u,
@@ -12175,15 +12191,15 @@ function Zg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12175
12191
  e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
12176
12192
  },
12177
12193
  "aria-label": "End call",
12178
- children: [/* @__PURE__ */ g(rg, { size: 18 }), "End Call"]
12194
+ children: [/* @__PURE__ */ g(sg, { size: 18 }), "End Call"]
12179
12195
  })]
12180
12196
  })
12181
12197
  ]
12182
12198
  });
12183
12199
  }
12184
- function Qg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
12200
+ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
12185
12201
  let u = e || n || "Agent";
12186
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: Gg }), /* @__PURE__ */ _("div", {
12202
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
12187
12203
  role: "button",
12188
12204
  tabIndex: 0,
12189
12205
  onClick: c,
@@ -12240,7 +12256,7 @@ function Qg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12240
12256
  borderRadius: "50%",
12241
12257
  border: `1.5px solid ${l}55`
12242
12258
  } }),
12243
- /* @__PURE__ */ g(Yg, {
12259
+ /* @__PURE__ */ g($g, {
12244
12260
  headshot: t,
12245
12261
  name: u,
12246
12262
  size: 38,
@@ -12324,7 +12340,7 @@ function Qg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12324
12340
  boxShadow: i ? `0 0 0 3px ${l}12` : "none"
12325
12341
  },
12326
12342
  "aria-label": i ? "Unmute" : "Mute",
12327
- children: g(i ? pg : ng, { size: 15 })
12343
+ children: g(i ? _g : og, { size: 15 })
12328
12344
  }), /* @__PURE__ */ g("button", {
12329
12345
  type: "button",
12330
12346
  onClick: (e) => {
@@ -12352,7 +12368,7 @@ function Qg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12352
12368
  transition: "all 0.18s ease"
12353
12369
  },
12354
12370
  "aria-label": "End call",
12355
- children: /* @__PURE__ */ g(rg, { size: 16 })
12371
+ children: /* @__PURE__ */ g(sg, { size: 16 })
12356
12372
  })]
12357
12373
  })
12358
12374
  ]
@@ -12360,7 +12376,7 @@ function Qg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12360
12376
  }
12361
12377
  //#endregion
12362
12378
  //#region src/utils/voicePriorContext.js
12363
- function $g(e, t = {}) {
12379
+ function r_(e, t = {}) {
12364
12380
  let n = t.maxChars ?? 4500;
12365
12381
  if (!Array.isArray(e) || e.length === 0) return "";
12366
12382
  let r = [];
@@ -12377,24 +12393,24 @@ function $g(e, t = {}) {
12377
12393
  }
12378
12394
  //#endregion
12379
12395
  //#region src/utils/voiceClientTools.js
12380
- var e_ = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
12381
- function t_(e) {
12382
- return String(e || "").replace(e_, "").replace(/\/+$/, "").toLowerCase() || "/";
12396
+ var i_ = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
12397
+ function a_(e) {
12398
+ return String(e || "").replace(i_, "").replace(/\/+$/, "").toLowerCase() || "/";
12383
12399
  }
12384
- function n_(e, t) {
12385
- return t_(e) === t_(t);
12400
+ function o_(e, t) {
12401
+ return a_(e) === a_(t);
12386
12402
  }
12387
12403
  function $(...e) {
12388
12404
  An() && console.log("[FlowEngage:voice-tools]", ...e);
12389
12405
  }
12390
- function r_(e) {
12406
+ function s_(e) {
12391
12407
  try {
12392
12408
  let t = e.ownerDocument?.defaultView;
12393
12409
  if (t) return t.getComputedStyle(e);
12394
12410
  } catch {}
12395
12411
  return window.getComputedStyle(e);
12396
12412
  }
12397
- function i_(e) {
12413
+ function c_(e) {
12398
12414
  let t = /* @__PURE__ */ new Set();
12399
12415
  function n(r) {
12400
12416
  if (!r || t.has(r)) return;
@@ -12407,10 +12423,10 @@ function i_(e) {
12407
12423
  }
12408
12424
  typeof document < "u" && n(document);
12409
12425
  }
12410
- function a_(e) {
12426
+ function l_(e) {
12411
12427
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
12412
12428
  }
12413
- function o_(e) {
12429
+ function u_(e) {
12414
12430
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
12415
12431
  if (n) {
12416
12432
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -12418,40 +12434,40 @@ function o_(e) {
12418
12434
  let e = t.getElementById(n);
12419
12435
  e?.textContent && r.push(e.textContent.trim());
12420
12436
  } catch {}
12421
- if (r.length) return a_(r.join(" "));
12437
+ if (r.length) return l_(r.join(" "));
12422
12438
  }
12423
- if (e.labels && e.labels.length) return a_(e.labels[0].textContent);
12439
+ if (e.labels && e.labels.length) return l_(e.labels[0].textContent);
12424
12440
  let r = e.id;
12425
12441
  if (r) try {
12426
12442
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
12427
- if (e) return a_(e.textContent);
12443
+ if (e) return l_(e.textContent);
12428
12444
  } catch {
12429
12445
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
12430
- if (e) return a_(e.textContent);
12446
+ if (e) return l_(e.textContent);
12431
12447
  }
12432
12448
  let i = e.previousElementSibling;
12433
12449
  for (let e = 0; e < 6 && i; e += 1) {
12434
- if (i.tagName === "LABEL") return a_(i.textContent);
12450
+ if (i.tagName === "LABEL") return l_(i.textContent);
12435
12451
  let e = (i.className || "").toString().toLowerCase();
12436
12452
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
12437
- let e = a_(i.textContent);
12453
+ let e = l_(i.textContent);
12438
12454
  if (e) return e;
12439
12455
  }
12440
12456
  i = i.previousElementSibling;
12441
12457
  }
12442
12458
  let a = e.parentElement;
12443
12459
  for (let e = 0; e < 5 && a; e += 1) {
12444
- if (a.tagName === "LABEL") return a_(a.textContent);
12460
+ if (a.tagName === "LABEL") return l_(a.textContent);
12445
12461
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
12446
- if (e?.textContent) return a_(e.textContent);
12462
+ if (e?.textContent) return l_(e.textContent);
12447
12463
  a = a.parentElement;
12448
12464
  }
12449
12465
  let o = e.getAttribute("aria-label");
12450
- return o ? a_(o) : null;
12466
+ return o ? l_(o) : null;
12451
12467
  }
12452
- function s_() {
12468
+ function d_() {
12453
12469
  let e = [];
12454
- return i_((t) => {
12470
+ return c_((t) => {
12455
12471
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
12456
12472
  if (In(e)) return !1;
12457
12473
  let t = (e.type || "").toLowerCase();
@@ -12462,15 +12478,15 @@ function s_() {
12462
12478
  "image"
12463
12479
  ].includes(t) || e.disabled || e.readOnly) return !1;
12464
12480
  try {
12465
- let t = r_(e);
12481
+ let t = s_(e);
12466
12482
  if (t.display === "none" || t.visibility === "hidden") return !1;
12467
12483
  } catch {}
12468
12484
  return !0;
12469
12485
  }));
12470
12486
  }), e;
12471
12487
  }
12472
- function c_() {
12473
- return s_().map((e, t) => {
12488
+ function f_() {
12489
+ return d_().map((e, t) => {
12474
12490
  let n = {
12475
12491
  formIndex: 0,
12476
12492
  fieldIndex: t,
@@ -12478,7 +12494,7 @@ function c_() {
12478
12494
  type: e.type || "text",
12479
12495
  name: e.name || null,
12480
12496
  id: e.id || null,
12481
- label: o_(e),
12497
+ label: u_(e),
12482
12498
  placeholder: e.placeholder || null
12483
12499
  };
12484
12500
  return e.tagName === "SELECT" && (n.options = Array.from(e.options).filter((e) => e.value !== "" && !e.disabled).map((e) => ({
@@ -12487,13 +12503,13 @@ function c_() {
12487
12503
  })), n.currentValue = e.value || null), n;
12488
12504
  });
12489
12505
  }
12490
- function l_() {
12506
+ function p_() {
12491
12507
  let e = [];
12492
- return i_((t) => {
12508
+ return c_((t) => {
12493
12509
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
12494
12510
  if (In(e) || e.disabled) return !1;
12495
12511
  try {
12496
- let t = r_(e);
12512
+ let t = s_(e);
12497
12513
  if (t.display === "none" || t.visibility === "hidden") return !1;
12498
12514
  } catch {}
12499
12515
  return !0;
@@ -12505,7 +12521,7 @@ function l_() {
12505
12521
  type: e.type || e.tagName
12506
12522
  }));
12507
12523
  }
12508
- function u_(e, t) {
12524
+ function m_(e, t) {
12509
12525
  try {
12510
12526
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
12511
12527
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -12520,7 +12536,7 @@ function u_(e, t) {
12520
12536
  return Infinity;
12521
12537
  }
12522
12538
  }
12523
- function d_(e, t) {
12539
+ function h_(e, t) {
12524
12540
  let n = String(t || "").toLowerCase().trim();
12525
12541
  if (!n) return 0;
12526
12542
  let r = (e.innerText || e.textContent || "").replace(/\s+/g, " ").trim(), i = [
@@ -12538,21 +12554,21 @@ function d_(e, t) {
12538
12554
  for (let e of a) i.includes(e) && (o += 1);
12539
12555
  return o / a.length * 92;
12540
12556
  }
12541
- function f_(e, t, n = 6) {
12557
+ function g_(e, t, n = 6) {
12542
12558
  let r = String(t || "").toLowerCase().trim();
12543
12559
  if (!r) return !1;
12544
12560
  let i = e;
12545
12561
  for (let e = 0; e < n && i && (i = i.parentElement, i); e++) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return !0;
12546
12562
  return !1;
12547
12563
  }
12548
- function p_(e, t, n) {
12564
+ function __(e, t, n) {
12549
12565
  let r = [];
12550
- i_((e) => {
12566
+ c_((e) => {
12551
12567
  let t = Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"], a[href]"));
12552
12568
  r.push(...t.filter((e) => {
12553
12569
  if (In(e) || e.disabled) return !1;
12554
12570
  try {
12555
- let t = r_(e);
12571
+ let t = s_(e);
12556
12572
  if (t.display === "none" || t.visibility === "hidden" || t.opacity === "0") return !1;
12557
12573
  } catch {}
12558
12574
  return !0;
@@ -12560,14 +12576,14 @@ function p_(e, t, n) {
12560
12576
  });
12561
12577
  let i = 0, a = r.map((t) => ({
12562
12578
  el: t,
12563
- s: d_(t, e)
12579
+ s: h_(t, e)
12564
12580
  }));
12565
12581
  for (let { s: e } of a) e > i && (i = e);
12566
12582
  if (i < 28) return null;
12567
12583
  let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
12568
12584
  if (o.length === 1) return o[0];
12569
12585
  if (n) {
12570
- let e = o.filter((e) => f_(e, n));
12586
+ let e = o.filter((e) => g_(e, n));
12571
12587
  if (e.length === 1) return e[0];
12572
12588
  e.length > 1 && (o = e);
12573
12589
  }
@@ -12575,14 +12591,14 @@ function p_(e, t, n) {
12575
12591
  if (s.length) {
12576
12592
  let e = o[0], t = Infinity;
12577
12593
  for (let n of o) for (let r of s) {
12578
- let i = u_(n, r);
12594
+ let i = m_(n, r);
12579
12595
  i < t && (t = i, e = n);
12580
12596
  }
12581
12597
  return e;
12582
12598
  }
12583
12599
  return o[0];
12584
12600
  }
12585
- function m_(e) {
12601
+ function v_(e) {
12586
12602
  if (e == null) return {};
12587
12603
  if (typeof e == "string") {
12588
12604
  let t = e.trim();
@@ -12595,12 +12611,12 @@ function m_(e) {
12595
12611
  }
12596
12612
  return e;
12597
12613
  }
12598
- function h_(e) {
12614
+ function y_(e) {
12599
12615
  if (!e || typeof e != "object") return null;
12600
12616
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
12601
12617
  return t == null ? null : String(t).trim() || null;
12602
12618
  }
12603
- function g_() {
12619
+ function b_() {
12604
12620
  let e = {};
12605
12621
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
12606
12622
  if (t.id) return;
@@ -12615,7 +12631,7 @@ function g_() {
12615
12631
  e[r] = !0, t.id = r;
12616
12632
  });
12617
12633
  }
12618
- function __() {
12634
+ function x_() {
12619
12635
  let e = (e) => {
12620
12636
  let t = Array.from(e).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root") && !e.closest("nav, footer, header, aside, .nav, .footer, .header, .sidebar")), n = [], r = 0;
12621
12637
  for (; r < t.length;) {
@@ -12670,7 +12686,7 @@ function __() {
12670
12686
  containerHeadings: o
12671
12687
  };
12672
12688
  }
12673
- function v_(e) {
12689
+ function S_(e) {
12674
12690
  if (!e || typeof document > "u") return "";
12675
12691
  let t = new Set([
12676
12692
  "script",
@@ -12756,11 +12772,11 @@ function v_(e) {
12756
12772
  return d.has(t) ? !1 : (d.add(t), !0);
12757
12773
  }).join("\n").replace(/\n{3,}/g, "\n\n").trim();
12758
12774
  }
12759
- function y_(e) {
12775
+ function C_(e) {
12760
12776
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = typeof e.beaconSyncFullVoiceHistory == "function" ? e.beaconSyncFullVoiceHistory : null, a = [], o = {
12761
12777
  "fwh-navigate-mvp": async (n) => {
12762
12778
  if ($("fwh-navigate-mvp ▶ raw parameters:", n), e?.isWalkthroughActive?.()) return $("fwh-navigate-mvp ✖ blocked — walkthrough in progress"), "NAVIGATION_BLOCKED_DURING_WALKTHROUGH. A walkthrough of the current page is in progress, so navigation is not allowed. Do NOT tell the visitor you navigated or offer to. Describe the requested section using the CURRENT page's own content (fwh-read-content-mvp), then stop.";
12763
- let a = m_(n), o = h_(a), s = a.section_text ?? a.sectionText ?? a.section, c = Array.isArray(a.expected_landmarks) ? a.expected_landmarks : Array.isArray(a.expectedLandmarks) ? a.expectedLandmarks : [];
12779
+ let a = v_(n), o = y_(a), s = a.section_text ?? a.sectionText ?? a.section, c = Array.isArray(a.expected_landmarks) ? a.expected_landmarks : Array.isArray(a.expectedLandmarks) ? a.expectedLandmarks : [];
12764
12780
  if ($("fwh-navigate-mvp · coerced:", {
12765
12781
  url: o,
12766
12782
  sectionText: s,
@@ -12800,14 +12816,14 @@ function y_(e) {
12800
12816
  correctedUrl: u
12801
12817
  }), o = u);
12802
12818
  try {
12803
- Ph(`Navigating to ${o}...`, { spinner: !0 }), Gh(), Pn();
12819
+ Ph(`Navigating to ${o}...`, { spinner: !0 }), Yh(), Pn();
12804
12820
  try {
12805
12821
  i?.();
12806
12822
  } catch {}
12807
12823
  try {
12808
12824
  let e = r ? r() : "";
12809
12825
  if (e && t) {
12810
- let n = $g([{
12826
+ let n = r_([{
12811
12827
  sender: "user",
12812
12828
  message: e
12813
12829
  }]);
@@ -12842,8 +12858,8 @@ function y_(e) {
12842
12858
  typeof window < "u" && window.scrollTo(0, 0);
12843
12859
  } catch {}
12844
12860
  let a = [], s = null, c = "", l = Date.now() + 12e3;
12845
- for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: a, pageTitleHeading: s, introText: c} = __(), !(a.length >= 1)););
12846
- g_(), $("fwh-navigate-mvp → page headings collected:", a, "titleHeading:", s);
12861
+ for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: a, pageTitleHeading: s, introText: c} = x_(), !(a.length >= 1)););
12862
+ b_(), $("fwh-navigate-mvp → page headings collected:", a, "titleHeading:", s);
12847
12863
  let u = a.length ? a.join(" | ") : "none", d = a.length ? "Use ONLY these exact heading strings for fwh-highlight-mvp — never invent or abbreviate." : "No headings collected yet — call fwh-get-current-page-mvp immediately (no speech) to get the live headings before speaking or highlighting.", f = s ? ` "${s}" is the PAGE TITLE, not a content section — do not fwh-highlight-mvp it separately; if doing a walkthrough, just fold this intro into your opening line: "${c || "(no intro text found)"}"` : c ? ` No separate page-title heading detected, but this intro text precedes the first section — mention it briefly before covering sections: "${c}"` : "", p = "";
12848
12864
  try {
12849
12865
  if (a.length > 0) {
@@ -12851,7 +12867,7 @@ function y_(e) {
12851
12867
  for (let n of e) {
12852
12868
  let e = mr(null, n);
12853
12869
  if (e) {
12854
- let r = v_(e).substring(0, 800);
12870
+ let r = S_(e).substring(0, 800);
12855
12871
  r && t.push(`[Section: ${n}] ${r}`);
12856
12872
  }
12857
12873
  }
@@ -12860,13 +12876,13 @@ function y_(e) {
12860
12876
  } catch {}
12861
12877
  if (Tr()) return Cr(), $("fwh-navigate-mvp ✖ landed on a not-found/404 page:", i), `NAVIGATION_PAGE_NOT_FOUND. The page at ${i} does not exist — it shows a "not found"/404 error, not real content. Do NOT offer a page overview, do NOT describe or highlight any sections, do NOT claim the navigation succeeded. Tell the visitor EXACTLY: "It looks like that page doesn't exist — I couldn't find it. Would you like me to take you somewhere else?" Then STOP and wait for their reply.`;
12862
12878
  let m = Date.now() + 4e3, h = typeof window < "u" ? window.location.pathname : r;
12863
- for (; Date.now() < m && !n_(h, e) && n_(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
12879
+ for (; Date.now() < m && !o_(h, e) && o_(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
12864
12880
  $("fwh-navigate-mvp route settle:", {
12865
12881
  startPath: t,
12866
12882
  targetPath: e,
12867
12883
  settledPath: h
12868
12884
  });
12869
- let g = typeof window < "u" ? window.location.href : i, _ = (h.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home", v = n_(h, e), y = !n_(h, t), b = v || y;
12885
+ let g = typeof window < "u" ? window.location.href : i, _ = (h.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home", v = o_(h, e), y = !o_(h, t), b = v || y;
12870
12886
  return $("fwh-navigate-mvp settled:", h, "target:", e, "match:", b), b ? (Cr(), `OK_NAVIGATE_SPA. Visitor is now on: ${g} (page: "${_}") | Section headings: ${u}.${f} ${d}${p} Now confirm the arrival in ONE short sentence phrased for what the visitor actually asked for — mention the page by name and what it lets them do (e.g. for a contact request: "I've taken you to the Contact Us page — filling in this form sends your query straight to our team."). Do NOT use a fixed template. Then, in the same breath, offer either a specific section or a full overview. Then STOP — wait for their reply.`) : (Cr(), `NAVIGATION_DID_NOT_HAPPEN. The visitor is STILL on ${g} (page: "${_}") — the navigation did not go through. Do NOT say "I have navigated you". Do NOT claim success. Tell the visitor EXACTLY: "Sorry, I couldn't open that page just now. Would you like me to try again, or is there something else I can help with?" Then STOP and wait for their reply.`);
12871
12887
  } catch {}
12872
12888
  return "OK_NAVIGATE_RELOADING. The page is reloading now and this session is ending. Say NOTHING further — do not confirm the navigation, do not describe the page. The arrival greeting is spoken automatically on the new page; you resume from the visitor's next reply.";
@@ -12878,39 +12894,39 @@ function y_(e) {
12878
12894
  duration: 1800
12879
12895
  }), t;
12880
12896
  } finally {
12881
- Kh(), Fh(900);
12897
+ Xh(), Fh(900);
12882
12898
  }
12883
12899
  },
12884
12900
  "fwh-highlight-mvp": async (e) => {
12885
12901
  $("fwh-highlight-mvp ▶", e);
12886
- let t = m_(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
12902
+ let t = v_(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
12887
12903
  if (Wn(3e3), typeof window < "u" && window.__fe_user_nav_during_speech) {
12888
12904
  let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
12889
12905
  if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
12890
12906
  else return $("flowengage_highlight ✖ blocked — user navigated during speech", e), `NAV_CHANGED: The visitor navigated from "${e.fromPageName}" to "${e.toPageName}" (current path: ${t}) while you were speaking. STOP the current walkthrough immediately. DO NOT call fwh-highlight-mvp again. Say out loud: "I see you've navigated to the ${e.toPageName} page — do you want me to continue what I was explaining, or shall I guide you through this page?" Wait for the visitor's answer before doing anything else.`;
12891
12907
  }
12892
- g_();
12908
+ b_();
12893
12909
  let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = mr(n || null, i || null);
12894
12910
  if (!a && i) {
12895
12911
  let e = Date.now() + 600;
12896
- for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), g_(), a = mr(null, i);
12912
+ for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), b_(), a = mr(null, i);
12897
12913
  }
12898
12914
  if (!a) {
12899
12915
  $("fwh-highlight-mvp ✖ no element for:", i || n);
12900
- let { headings: e } = __(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
12916
+ let { headings: e } = x_(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
12901
12917
  return `HIGHLIGHT_NOT_FOUND: "${i || n}" on the current page. ${t}`;
12902
12918
  }
12903
12919
  return Nn(a), $("fwh-highlight-mvp ✓", i || n), `OK_HIGHLIGHT: "${i || n}". Your NEXT response must be speech only (no tool call) describing THIS section — "${i || n}" — using its own content. Do not ask whether to continue.`;
12904
12920
  },
12905
12921
  "fwh-read-content-mvp": async (e) => {
12906
12922
  $("fwh-read-content-mvp ▶", e);
12907
- let t = m_(e), n = t?.section_text || t?.sectionText || "";
12923
+ let t = v_(e), n = t?.section_text || t?.sectionText || "";
12908
12924
  try {
12909
12925
  let e = "";
12910
12926
  if (n) {
12911
12927
  let t = mr(null, n);
12912
12928
  if (!t) return `Could not find section "${n}" on the page.`;
12913
- e = v_(t);
12929
+ e = S_(t);
12914
12930
  } else {
12915
12931
  let t = (document.querySelector("main") || document.querySelector("article") || document.querySelector("[role=\"main\"]") || document.querySelector("#content") || document.querySelector(".content") || document.body).cloneNode(!0);
12916
12932
  t.querySelectorAll("nav, footer, header, aside, script, style, noscript, .nav, .footer, .header, .sidebar, #flowengage-root, .flowengage-shell, .flowengage-widget-root").forEach((e) => e.remove()), e = t.textContent.replace(/\s+/g, " ").trim();
@@ -12922,7 +12938,7 @@ function y_(e) {
12922
12938
  },
12923
12939
  "fwh-page-content-mvp": async (e) => {
12924
12940
  $("fwh-page-content-mvp ▶", e);
12925
- let r = m_(e), i = r?.url || r?.page_url || "";
12941
+ let r = v_(e), i = r?.url || r?.page_url || "";
12926
12942
  if ($("fwh-page-content-mvp · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("fwh-page-content-mvp ✖ missing url"), "Missing url parameter.";
12927
12943
  if (!t) return $("fwh-page-content-mvp ✖ no siteId"), "Site is not configured.";
12928
12944
  if (!n) return $("fwh-page-content-mvp ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -12954,7 +12970,7 @@ function y_(e) {
12954
12970
  },
12955
12971
  "fwh-search-mvp": async (e) => {
12956
12972
  $("fwh-search-mvp ▶", e);
12957
- let r = m_(e).query;
12973
+ let r = v_(e).query;
12958
12974
  if (!r) return $("fwh-search-mvp ✖ missing query"), "Missing query parameter.";
12959
12975
  if (!t) return $("fwh-search-mvp ✖ no siteId"), "Search unavailable (no siteId configured).";
12960
12976
  if (!n) return $("fwh-search-mvp ✖ no api base"), "Search unavailable (no API base URL).";
@@ -12992,7 +13008,7 @@ function y_(e) {
12992
13008
  "[class*='menu'] a",
12993
13009
  "[class*='header'] a"
12994
13010
  ];
12995
- if (i_((t) => {
13011
+ if (c_((t) => {
12996
13012
  for (let r of n) try {
12997
13013
  t.querySelectorAll(r).forEach((t) => {
12998
13014
  if (In(t)) return;
@@ -13000,7 +13016,7 @@ function y_(e) {
13000
13016
  if (!r || !n || n === "#" || n.startsWith("javascript:")) return;
13001
13017
  try {
13002
13018
  let e = t.parentElement;
13003
- if (e && r_(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
13019
+ if (e && s_(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
13004
13020
  } catch {}
13005
13021
  let i = r.toLowerCase() + "|" + n;
13006
13022
  e.has(i) || e.set(i, {
@@ -13011,7 +13027,7 @@ function y_(e) {
13011
13027
  } catch {}
13012
13028
  t.querySelectorAll("select").forEach((t) => {
13013
13029
  if (In(t)) return;
13014
- let n = o_(t);
13030
+ let n = u_(t);
13015
13031
  /nav|menu|page|section|go to/i.test(n || t.name || t.id || "") && Array.from(t.options).forEach((r) => {
13016
13032
  if (!r.value || r.disabled) return;
13017
13033
  let i = r.text.trim();
@@ -13035,7 +13051,7 @@ function y_(e) {
13035
13051
  if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
13036
13052
  let e = window.location.href, t = window.location.pathname, n = document.title || "";
13037
13053
  if (Tr()) return $("fwh-get-current-page-mvp ✓ 404 detected", { url: e }), `CURRENT_PAGE_NOT_FOUND. The visitor is currently on a 404 / page-not-found error page (${e}). There is no real content here. Do NOT describe this page, do NOT list sections, do NOT offer a walkthrough, and do NOT describe it from your own knowledge. Tell the visitor plainly that the page they are on doesn't exist, and offer to take them somewhere that does.`;
13038
- let { headings: r, pageTitleHeading: i, introText: a } = __();
13054
+ let { headings: r, pageTitleHeading: i, introText: a } = x_();
13039
13055
  $("fwh-get-current-page-mvp ✓", {
13040
13056
  url: e,
13041
13057
  path: t,
@@ -13047,7 +13063,7 @@ function y_(e) {
13047
13063
  return `CURRENT_PAGE. URL: ${e} | Title: ${n} | Page sections (${r.length} total): ${s}.${o} *** WALKTHROUGH: do NOT drive it yourself. Do not call fwh-highlight-mvp and do not decide the order — highlighting and section order are handled for you. You will be told which section to describe, one at a time. When told, describe ONLY that section in 3-4 sentences and then stop; never announce another section, never ask whether to continue. ***`;
13048
13064
  },
13049
13065
  "fwh-list-forms-mvp": async () => {
13050
- let e = c_(), t = l_();
13066
+ let e = f_(), t = p_();
13051
13067
  $("fwh-list-forms-mvp ✓", `${e.length} field(s)`, `${t.length} button(s)`);
13052
13068
  let n = e.map((e) => ({
13053
13069
  ...e,
@@ -13061,9 +13077,9 @@ function y_(e) {
13061
13077
  },
13062
13078
  "fwh-fill-form-mvp": async () => "FORM_FILLING_DISABLED: Form filling is not available at this time. Tell the visitor what fields are present (use fwh-list-forms-mvp) and ask them to fill the form themselves.",
13063
13079
  "fwh-click-button-mvp": async (e) => {
13064
- let t = m_(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
13080
+ let t = v_(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
13065
13081
  if ($("fwh-click-button-mvp ▶", n, r ? `(card_context: ${r})` : ""), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
13066
- let i = p_(n, a, r);
13082
+ let i = __(n, a, r);
13067
13083
  if (!i) return $("fwh-click-button-mvp ✖ no match"), `Could not find a button matching "${n}". Call fwh-list-forms-mvp to see button texts.`;
13068
13084
  try {
13069
13085
  Ph(`Clicking ${n}...`, { spinner: !0 });
@@ -13075,7 +13091,7 @@ function y_(e) {
13075
13091
  } catch {
13076
13092
  i.scrollIntoView(!0);
13077
13093
  }
13078
- await Zh(i), i.focus?.(), await $h(i), eg(i), i.click();
13094
+ await tg(i), i.focus?.(), await rg(i), ig(i), i.click();
13079
13095
  let e = (i.textContent || i.value || i.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
13080
13096
  return $("fwh-click-button-mvp ✓", t), Ph(`Clicked ${e}`, {
13081
13097
  spinner: !1,
@@ -13090,7 +13106,7 @@ function y_(e) {
13090
13106
  duration: 1800
13091
13107
  }), t;
13092
13108
  } finally {
13093
- Qh(), Fh(700);
13109
+ ng(), Fh(700);
13094
13110
  }
13095
13111
  },
13096
13112
  "fwh-cart-get-mvp": async () => {
@@ -13203,10 +13219,10 @@ function y_(e) {
13203
13219
  clickPageButton: o["fwh-click-button-mvp"]
13204
13220
  };
13205
13221
  }
13206
- var b_ = /^(get in touch|contact us|let'?s (talk|connect)|subscribe|newsletter|follow us|quick links|company|solutions|what we do|resources|legal|sitemap|share this)/i;
13207
- function x_() {
13222
+ var w_ = /^(get in touch|contact us|let'?s (talk|connect)|subscribe|newsletter|follow us|quick links|company|solutions|what we do|resources|legal|sitemap|share this)/i;
13223
+ function T_() {
13208
13224
  try {
13209
- let { headings: e, pageTitleHeading: t, containerHeadings: n } = __(), r = new Set((n || []).map((e) => e.trim())), i = (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !b_.test(e.trim())), a = i.filter((e) => !r.has(e.trim()));
13225
+ let { headings: e, pageTitleHeading: t, containerHeadings: n } = x_(), r = new Set((n || []).map((e) => e.trim())), i = (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !w_.test(e.trim())), a = i.filter((e) => !r.has(e.trim()));
13210
13226
  return a.length ? a : i;
13211
13227
  } catch {
13212
13228
  return [];
@@ -13214,7 +13230,7 @@ function x_() {
13214
13230
  }
13215
13231
  //#endregion
13216
13232
  //#region src/utils/wrapVoiceToolsForLogging.js
13217
- function S_(e) {
13233
+ function E_(e) {
13218
13234
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
13219
13235
  let r = An();
13220
13236
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -13231,11 +13247,11 @@ function S_(e) {
13231
13247
  }
13232
13248
  //#endregion
13233
13249
  //#region src/components/FlowEngageWidget.jsx
13234
- var C_ = "[PAGE_CONTEXT]";
13235
- function w_(e, t, n) {
13236
- return `${C_} SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${t || ""}. ${n ? `Forms: ${n}. ` : ""}The visitor is ALREADY on this page — do NOT offer to navigate there.`;
13250
+ var D_ = "[PAGE_CONTEXT]";
13251
+ function O_(e, t, n) {
13252
+ return `${D_} SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${t || ""}. ${n ? `Forms: ${n}. ` : ""}The visitor is ALREADY on this page — do NOT offer to navigate there.`;
13237
13253
  }
13238
- var T_ = {
13254
+ var k_ = {
13239
13255
  blue: "#135bd8",
13240
13256
  red: "#ef334b",
13241
13257
  yellow: "#ffbd2e",
@@ -13243,7 +13259,7 @@ var T_ = {
13243
13259
  highlight: "rgba(255,255,255,0.9)",
13244
13260
  green: "#10b981"
13245
13261
  };
13246
- function E_(e) {
13262
+ function A_(e) {
13247
13263
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
13248
13264
  let [t, n, r] = e;
13249
13265
  return e.length >= 3 && r ? [
@@ -13257,12 +13273,12 @@ function E_(e) {
13257
13273
  "#f7f8fa"
13258
13274
  ].join(", ");
13259
13275
  }
13260
- function D_(e) {
13276
+ function j_(e) {
13261
13277
  if (!e || typeof e != "string") return "#1a1a1a";
13262
13278
  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;
13263
13279
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
13264
13280
  }
13265
- function O_(t) {
13281
+ function M_(t) {
13266
13282
  let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
13267
13283
  return e.useEffect(() => {
13268
13284
  if (!i) {
@@ -13280,8 +13296,8 @@ function O_(t) {
13280
13296
  };
13281
13297
  }, [i]), n;
13282
13298
  }
13283
- function k_({ logo: t, style: n }) {
13284
- let r = O_(typeof t == "string" ? t : null);
13299
+ function N_({ logo: t, style: n }) {
13300
+ let r = M_(typeof t == "string" ? t : null);
13285
13301
  if (!t) return null;
13286
13302
  if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
13287
13303
  src: r,
@@ -13306,7 +13322,7 @@ function k_({ logo: t, style: n }) {
13306
13322
  children: i
13307
13323
  }) : null;
13308
13324
  }
13309
- function A_({ title: e }) {
13325
+ function P_({ title: e }) {
13310
13326
  return /* @__PURE__ */ g("div", {
13311
13327
  style: {
13312
13328
  width: "100%",
@@ -13324,18 +13340,18 @@ function A_({ title: e }) {
13324
13340
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
13325
13341
  });
13326
13342
  }
13327
- function j_(e, t) {
13343
+ function F_(e, t) {
13328
13344
  let n = (t || "").trim();
13329
13345
  return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || e === "bot" && (/\b(that'?s all|we'?re done)\b/i.test(n) || /\b(goodbye|bye)\b/i.test(n) || /\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n))) : !1;
13330
13346
  }
13331
- function M_({ orbColors: e, ...t }) {
13332
- return /* @__PURE__ */ g(Wg, {
13347
+ function I_({ orbColors: e, ...t }) {
13348
+ return /* @__PURE__ */ g(Jg, {
13333
13349
  colors: e,
13334
13350
  ...t
13335
13351
  });
13336
13352
  }
13337
- function N_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
13338
- let s = n || T_.green, c = D_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
13353
+ function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
13354
+ let s = n || k_.green, c = j_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
13339
13355
  style: {
13340
13356
  display: "flex",
13341
13357
  alignItems: a ? "flex-end" : "center",
@@ -13461,7 +13477,7 @@ function N_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
13461
13477
  delay: 0
13462
13478
  },
13463
13479
  style: { flexShrink: 0 },
13464
- children: /* @__PURE__ */ g(M_, {
13480
+ children: /* @__PURE__ */ g(I_, {
13465
13481
  size: l,
13466
13482
  orbColors: t
13467
13483
  })
@@ -13493,8 +13509,8 @@ function N_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
13493
13509
  children: u
13494
13510
  })] });
13495
13511
  }
13496
- function P_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
13497
- let c = n || T_.green, l = D_(c);
13512
+ function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
13513
+ let c = n || k_.green, l = j_(c);
13498
13514
  return /* @__PURE__ */ _(oh.div, {
13499
13515
  initial: {
13500
13516
  scale: 50 / 350,
@@ -13565,7 +13581,7 @@ function P_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
13565
13581
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
13566
13582
  })
13567
13583
  }),
13568
- /* @__PURE__ */ g(M_, {
13584
+ /* @__PURE__ */ g(I_, {
13569
13585
  size: 72,
13570
13586
  orbColors: t
13571
13587
  }),
@@ -13645,7 +13661,7 @@ function P_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
13645
13661
  ]
13646
13662
  });
13647
13663
  }
13648
- function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, beaconSyncVoiceTranscript: d, widgetPosition: f = "bottom-right", voiceEndCounter: h, websiteName: v, voiceFirstMessage: y, captureVisitorEmail: b, emailRequired: x, emailCaptureEnabled: S = !0, listeningLabel: C = "Listening...", thinkingLabel: w = "Thinking...", enterChatModeLabel: T = "Enter Chat Mode", endConversationLabel: E = "End Conversation" }) {
13664
+ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, beaconSyncVoiceTranscript: d, widgetPosition: f = "bottom-right", voiceEndCounter: h, websiteName: v, voiceFirstMessage: y, captureVisitorEmail: b, emailRequired: x, emailCaptureEnabled: S = !0, listeningLabel: C = "Listening...", thinkingLabel: w = "Thinking...", enterChatModeLabel: T = "Enter Chat Mode", endConversationLabel: E = "End Conversation" }) {
13649
13665
  c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
13650
13666
  let [D, O] = m("idle"), [k, A] = m(!1), [ee, te] = m(!1), [ne, j] = m(() => ce(i) === "auto"), M = () => {
13651
13667
  let e = ne ? "ask" : "auto";
@@ -13732,7 +13748,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13732
13748
  Pn();
13733
13749
  } catch {}
13734
13750
  try {
13735
- Vh();
13751
+ Gh();
13736
13752
  } catch {}
13737
13753
  if (i) try {
13738
13754
  Le(i);
@@ -13780,7 +13796,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13780
13796
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
13781
13797
  l.current = [], Ce.current = "", Oe.current = !1, je.current = !1, Me.current = !1, Ne.current = "minimized", Nr({ onBeforeNavigate: () => {
13782
13798
  if (i && l.current.length > 0) try {
13783
- let e = $g(l.current);
13799
+ let e = r_(l.current);
13784
13800
  e && Te(i, e);
13785
13801
  } catch {}
13786
13802
  if (!$n()) {
@@ -13802,7 +13818,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13802
13818
  }
13803
13819
  ke();
13804
13820
  } });
13805
- let t = S_(y_({
13821
+ let t = E_(C_({
13806
13822
  siteId: i || null,
13807
13823
  apiBaseUrl: a || null,
13808
13824
  chatId: s || null,
@@ -13864,7 +13880,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13864
13880
  e || Ue("minimized");
13865
13881
  },
13866
13882
  onPanel: ({ title: t, items: n }) => {
13867
- e || Bh(n, {
13883
+ e || Wh(n, {
13868
13884
  title: t || "Products",
13869
13885
  side: f === "bottom-left" ? "left" : "right",
13870
13886
  productUrl: (e) => e.handle ? `${window.location.origin}/products/${encodeURIComponent(e.handle)}` : null
@@ -13927,7 +13943,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13927
13943
  onMessage: (t) => {
13928
13944
  if (e || pe.current && t.role !== "user" && !/email/i.test(String(t.message || ""))) return;
13929
13945
  let n = t.role === "user" && /^(Describe the section titled "|\[SYSTEM:|Give the visitor a complete spoken overview|That was the last section)/.test(String(t.message || "").trim()), r = /\b(?:this|that|the)\s+(?:case\s*stud(?:y|ies)|product|article|blog|post|item|service)\b/i.test(String(t.message || ""));
13930
- if (!n && !r && t.role === "user" && We.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), I(!0), ge.current = !1, me.current = 0, L.current = -1, ve.current = x_(), ye.current = typeof window < "u" ? window.location.pathname : null, setTimeout(() => xe.current?.(), 400), console.log(`[FlowEngage] walkthrough armed — ${ve.current.length} sections on this page`);
13946
+ if (!n && !r && t.role === "user" && We.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), I(!0), ge.current = !1, me.current = 0, L.current = -1, ve.current = T_(), ye.current = typeof window < "u" ? window.location.pathname : null, setTimeout(() => xe.current?.(), 400), console.log(`[FlowEngage] walkthrough armed — ${ve.current.length} sections on this page`);
13931
13947
  else if (!n && t.role === "user" && he.current) {
13932
13948
  let e = String(t.message || "").trim(), n = Ye(e), r = (e) => !!e && (Ke.test(e) || Je.test(e));
13933
13949
  qe.test(be.current || "") ? (console.log("[FlowEngage] walkthrough ended — visitor accepted a navigation offer"), ye.current = null, ve.current = [], I(!1)) : !n || r(e) || r(n) ? ge.current && (ge.current = !1, console.debug("[FlowEngage] walkthrough resumed by visitor"), setTimeout(() => xe.current?.(), 300)) : (console.log("[FlowEngage] walkthrough ended — visitor moved to a new topic"), ye.current = null, ve.current = [], I(!1));
@@ -13944,10 +13960,10 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13944
13960
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13945
13961
  debug: t.debug
13946
13962
  }], i) try {
13947
- let e = $g(l.current);
13963
+ let e = r_(l.current);
13948
13964
  e && Te(i, e);
13949
13965
  } catch {}
13950
- if (j_(a, o)) {
13966
+ if (F_(a, o)) {
13951
13967
  ze.current = !0;
13952
13968
  return;
13953
13969
  }
@@ -14007,7 +14023,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14007
14023
  n.length || (n = Array.from(document.body.querySelectorAll("h1, h2, h3")).filter((t) => !t.closest(e)).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200)), n.length && (o = [...new Set(n)].slice(0, 15).join(" | "));
14008
14024
  } catch {}
14009
14025
  let s = r && !m ? `RESUMING PRIOR SESSION — DO NOT GREET. The visitor is continuing the same conversation after a page reload. Do not introduce yourself or re-state your capabilities. Wait silently until the visitor speaks; if you must speak first, briefly acknowledge where you left off in one short sentence.\nPrior transcript:\n${n?.transcript || ""}\n\n` : "";
14010
- ue.sendContextualUpdate(`${s}SiteId: ${i || "unknown"}. ${x ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`), ue.sendContextualUpdate(w_(e, o, a));
14026
+ ue.sendContextualUpdate(`${s}SiteId: ${i || "unknown"}. ${x ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`), ue.sendContextualUpdate(O_(e, o, a));
14011
14027
  } catch {}
14012
14028
  if (typeof window < "u") {
14013
14029
  let t = window.location.pathname, n = Date.now(), r = (e) => {
@@ -14043,7 +14059,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14043
14059
  } catch {}
14044
14060
  else console.log("[FlowEngage] auto-nav — skipping the arrival acknowledgment turn");
14045
14061
  try {
14046
- R.current?.sendContextualUpdate?.(w_(l, f));
14062
+ R.current?.sendContextualUpdate?.(O_(l, f));
14047
14063
  } catch {}
14048
14064
  return;
14049
14065
  }
@@ -14058,7 +14074,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14058
14074
  R.current?.sendUserMessage?.(`[SYSTEM: I navigated away mid-walkthrough — I am now on the "${h}" page (${l}). Page title: "${u}". Sections: ${JSON.stringify(d)}. STOP everything. Do NOT describe the new page. Say EXACTLY: "I see you've navigated to the ${h} page — would you like me to continue what I was explaining, or shall I walk you through this page?" Then wait for my answer. IF I say continue/yes/carry on: resume speaking verbally from where you left off — do NOT call fwh-navigate-mvp, do NOT call fwh-highlight-mvp, the visitor will navigate themselves if needed. IF I want to hear about this page: call fwh-highlight-mvp for sections of "${h}" only.]`);
14059
14075
  } catch {}
14060
14076
  try {
14061
- R.current?.sendContextualUpdate?.(w_(l, f));
14077
+ R.current?.sendContextualUpdate?.(O_(l, f));
14062
14078
  } catch {}
14063
14079
  };
14064
14080
  c = window.history.pushState.bind(window.history), window.history.pushState = (...e) => {
@@ -14270,7 +14286,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14270
14286
  },
14271
14287
  children: "Muted"
14272
14288
  }),
14273
- /* @__PURE__ */ g(M_, {
14289
+ /* @__PURE__ */ g(I_, {
14274
14290
  size: 72,
14275
14291
  voiceState: D,
14276
14292
  isMuted: k,
@@ -14342,7 +14358,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14342
14358
  y2: "23"
14343
14359
  })
14344
14360
  ]
14345
- }) : /* @__PURE__ */ g(ng, {
14361
+ }) : /* @__PURE__ */ g(og, {
14346
14362
  size: 16,
14347
14363
  color: "currentColor"
14348
14364
  })
@@ -14364,7 +14380,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14364
14380
  padding: 0,
14365
14381
  flexShrink: 0
14366
14382
  },
14367
- children: /* @__PURE__ */ g(ug, {
14383
+ children: /* @__PURE__ */ g(mg, {
14368
14384
  size: 16,
14369
14385
  color: "currentColor"
14370
14386
  })
@@ -14413,7 +14429,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14413
14429
  onMouseLeave: (e) => {
14414
14430
  e.currentTarget.style.background = "none";
14415
14431
  },
14416
- children: [/* @__PURE__ */ g(dg, {}), T]
14432
+ children: [/* @__PURE__ */ g(hg, {}), T]
14417
14433
  }),
14418
14434
  i && /* @__PURE__ */ _("button", {
14419
14435
  onClick: () => M(),
@@ -14517,7 +14533,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14517
14533
  onMouseLeave: (e) => {
14518
14534
  e.currentTarget.style.background = "none";
14519
14535
  },
14520
- children: [/* @__PURE__ */ g(fg, {}), E]
14536
+ children: [/* @__PURE__ */ g(gg, {}), E]
14521
14537
  }),
14522
14538
  /* @__PURE__ */ g("button", {
14523
14539
  onClick: () => te(!1),
@@ -14569,7 +14585,7 @@ function F_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14569
14585
  ]
14570
14586
  });
14571
14587
  }
14572
- function I_({ orbColors: e }) {
14588
+ function B_({ orbColors: e }) {
14573
14589
  let t = Array.isArray(e) && e.length > 0 ? e : [
14574
14590
  "#135bd8",
14575
14591
  "#ef334b",
@@ -14588,7 +14604,7 @@ function I_({ orbColors: e }) {
14588
14604
  `.replace(/\s+/g, " ").trim()
14589
14605
  } });
14590
14606
  }
14591
- var L_ = () => /* @__PURE__ */ g("div", {
14607
+ var V_ = () => /* @__PURE__ */ g("div", {
14592
14608
  style: {
14593
14609
  display: "flex",
14594
14610
  marginBottom: "12px",
@@ -14618,7 +14634,7 @@ var L_ = () => /* @__PURE__ */ g("div", {
14618
14634
  } }, e))
14619
14635
  })
14620
14636
  });
14621
- function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: D, selectedFile: O, onFileSelect: k, onRemoveSelectedFile: A, attachmentError: ee, isUploadingAttachment: te, requiresEmail: ne, emailInput: j, setEmailInput: M, emailError: re, emailCaptureSuccess: ie, replyContext: ae, setReplyContext: N, webRTCError: oe, micError: P, setMicError: se, dismissCallError: F, activeCallId: ue, isCallMuted: de, toggleCallMute: fe, endWebRTCCall: pe, formatCallDuration: me, callDurationSeconds: he, isCallMinimized: ge, onExpand: _e, onCollapse: ve, onStartVoice: ye, voiceEnabled: be, headerBgColor: xe, onNewChat: I, showPoweredBy: L, privacyPolicyUrl: R, getVisitorChatHistory: Se, resumeChat: Ce, isSessionRestoring: we, isClosing: Te }) {
14637
+ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: D, selectedFile: O, onFileSelect: k, onRemoveSelectedFile: A, attachmentError: ee, isUploadingAttachment: te, requiresEmail: ne, emailInput: j, setEmailInput: M, emailError: re, emailCaptureSuccess: ie, replyContext: ae, setReplyContext: N, webRTCError: oe, micError: P, setMicError: se, dismissCallError: F, activeCallId: ue, isCallMuted: de, toggleCallMute: fe, endWebRTCCall: pe, formatCallDuration: me, callDurationSeconds: he, isCallMinimized: ge, onExpand: _e, onCollapse: ve, onStartVoice: ye, voiceEnabled: be, headerBgColor: xe, onNewChat: I, showPoweredBy: L, privacyPolicyUrl: R, getVisitorChatHistory: Se, resumeChat: Ce, isSessionRestoring: we, isClosing: Te }) {
14622
14638
  let Ee = l.length > 0, De = T || E || w, Oe = !!ue, [ke, Ae] = m(!1), { resolvedConfig: je } = kn(), Me = je?.siteId || null, [Ne, Pe] = m(() => ce(Me) === "auto"), Fe = () => {
14623
14639
  let e = Ne ? "ask" : "auto";
14624
14640
  le(Me, e), Pe(e === "auto");
@@ -14761,7 +14777,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
14761
14777
  justifyContent: "center",
14762
14778
  height: "40px"
14763
14779
  },
14764
- children: i ? /* @__PURE__ */ g(k_, {
14780
+ children: i ? /* @__PURE__ */ g(N_, {
14765
14781
  logo: i,
14766
14782
  style: {
14767
14783
  height: "34px",
@@ -14774,7 +14790,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
14774
14790
  height: "40px",
14775
14791
  flexShrink: 0
14776
14792
  },
14777
- children: /* @__PURE__ */ g(A_, { title: e.chatTitle })
14793
+ children: /* @__PURE__ */ g(P_, { title: e.chatTitle })
14778
14794
  })
14779
14795
  }), o && /* @__PURE__ */ g("div", {
14780
14796
  style: {
@@ -15138,7 +15154,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15138
15154
  })
15139
15155
  ]
15140
15156
  }),
15141
- /* @__PURE__ */ g(Fg, {
15157
+ /* @__PURE__ */ g(zg, {
15142
15158
  webRTCError: oe,
15143
15159
  micError: P,
15144
15160
  setMicError: se,
@@ -15146,7 +15162,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15146
15162
  isRateLimited: E,
15147
15163
  rateLimitMessage: D
15148
15164
  }),
15149
- ge && /* @__PURE__ */ g(Qg, {
15165
+ ge && /* @__PURE__ */ g(n_, {
15150
15166
  agentName: v,
15151
15167
  agentHeadshot: y,
15152
15168
  fallbackAgentName: b,
@@ -15280,17 +15296,17 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15280
15296
  children: "No previous chats found."
15281
15297
  })
15282
15298
  })]
15283
- }) : null, Ee ? /* @__PURE__ */ g(Mg, {
15299
+ }) : null, Ee ? /* @__PURE__ */ g(Ig, {
15284
15300
  chatHistory: l,
15285
15301
  isAiTyping: u,
15286
15302
  isLoading: T,
15287
15303
  isAgentTyping: d,
15288
15304
  setReplyContext: N,
15289
- TypingDots: L_,
15305
+ TypingDots: V_,
15290
15306
  primaryColor: n,
15291
15307
  agentHeadshot: y,
15292
15308
  agentDisplayName: v || b,
15293
- botAvatarNode: /* @__PURE__ */ g(I_, { orbColors: t })
15309
+ botAvatarNode: /* @__PURE__ */ g(B_, { orbColors: t })
15294
15310
  }) : we ? /* @__PURE__ */ _("div", {
15295
15311
  style: {
15296
15312
  flex: 1,
@@ -15331,7 +15347,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15331
15347
  padding: "28px 24px"
15332
15348
  },
15333
15349
  children: [
15334
- /* @__PURE__ */ g(M_, {
15350
+ /* @__PURE__ */ g(I_, {
15335
15351
  size: 94,
15336
15352
  orbColors: t
15337
15353
  }),
@@ -15422,7 +15438,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15422
15438
  zIndex: 1,
15423
15439
  padding: ne ? "6px 0 0" : "12px 0 0"
15424
15440
  },
15425
- children: /* @__PURE__ */ g(Pg, {
15441
+ children: /* @__PURE__ */ g(Rg, {
15426
15442
  input: x,
15427
15443
  setInput: S,
15428
15444
  onSubmit: C,
@@ -15496,7 +15512,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15496
15512
  ]
15497
15513
  });
15498
15514
  }
15499
- function z_() {
15515
+ function U_() {
15500
15516
  let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: E, callConnectedAt: D, isCallMuted: O, webRTCError: k, language: A, chatId: ee, historyRef: te, onMessageSync: ne, beaconSyncVoiceTranscript: j, sendMessage: M, uploadChatFile: re, openWidget: ie, captureVisitorEmail: ae, setVoiceMode: N, endConversation: se, startNewChat: F, acceptCall: ce, rejectCall: le, endWebRTCCall: ue, toggleCallMute: de, dismissCallError: fe, startTyping: pe, stopTyping: me, updateTypingDraft: he, getVisitorChatHistory: ge, resumeChat: _e, isSessionRestoring: ve, openToChatCounter: ye, voiceEndCounter: be } = kn();
15501
15517
  c(() => {
15502
15518
  try {
@@ -15518,7 +15534,7 @@ function z_() {
15518
15534
  small: 50,
15519
15535
  medium: 64,
15520
15536
  large: 80
15521
- }, ke = Oe[R.orbSize] || Oe.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", Pe = E_(we ?? R.chatBgColors), Fe = L.logo || L.logoUrl || null, Ie = A || "en", Le = xe.recommendations?.[Ie] || [], z = (I.recommendations?.[Ie] ?? Le).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
15537
+ }, ke = Oe[R.orbSize] || Oe.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", Pe = A_(we ?? R.chatBgColors), Fe = L.logo || L.logoUrl || null, Ie = A || "en", Le = xe.recommendations?.[Ie] || [], z = (I.recommendations?.[Ie] ?? Le).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
15522
15538
  id: e.key || `qr-${t}`,
15523
15539
  label: e.label,
15524
15540
  message: e.label,
@@ -15609,7 +15625,7 @@ function z_() {
15609
15625
  let kt = o(() => {
15610
15626
  ht(null), _t("");
15611
15627
  }, []), At = o((e) => {
15612
- let t = Eg(e);
15628
+ let t = Ag(e);
15613
15629
  if (t) {
15614
15630
  ht(null), _t(t);
15615
15631
  return;
@@ -15715,7 +15731,7 @@ function z_() {
15715
15731
  if (mt) {
15716
15732
  try {
15717
15733
  yt(!0), _t("");
15718
- let e = await re(mt), n = e?.data || e, r = tt.trim() || `Shared file: ${Og(mt)}`;
15734
+ let e = await re(mt), n = e?.data || e, r = tt.trim() || `Shared file: ${Mg(mt)}`;
15719
15735
  nt(""), it(null), kt(), await M(r, "", t, {
15720
15736
  type: "file",
15721
15737
  metadata: {
@@ -15808,7 +15824,7 @@ function z_() {
15808
15824
  onWheel: (e) => e.stopPropagation(),
15809
15825
  onTouchMove: (e) => e.stopPropagation(),
15810
15826
  children: [
15811
- W === "entry_prompt" && /* @__PURE__ */ g(N_, {
15827
+ W === "entry_prompt" && /* @__PURE__ */ g(L_, {
15812
15828
  copy: qe,
15813
15829
  orbColors: we,
15814
15830
  primaryColor: Te,
@@ -15891,13 +15907,13 @@ function z_() {
15891
15907
  children: E === "connected" ? `${It(ut)} with ${Ze}` : `Tap to return to ${Ze}`
15892
15908
  })]
15893
15909
  })]
15894
- }), /* @__PURE__ */ g(M_, {
15910
+ }), /* @__PURE__ */ g(I_, {
15895
15911
  size: ke,
15896
15912
  orbColors: we,
15897
15913
  onClick: T ? jt : Ce ? Bt : Ht
15898
15914
  })]
15899
15915
  }),
15900
- W === "connection_modal" && /* @__PURE__ */ g(P_, {
15916
+ W === "connection_modal" && /* @__PURE__ */ g(R_, {
15901
15917
  copy: qe,
15902
15918
  orbColors: we,
15903
15919
  primaryColor: Te,
@@ -15907,7 +15923,7 @@ function z_() {
15907
15923
  isMobile: Dt,
15908
15924
  isClosing: St
15909
15925
  }),
15910
- W === "voice_mode" && /* @__PURE__ */ g(F_, {
15926
+ W === "voice_mode" && /* @__PURE__ */ g(z_, {
15911
15927
  orbColors: we,
15912
15928
  onEnterChat: Ht,
15913
15929
  onEndChat: Ut,
@@ -15930,7 +15946,7 @@ function z_() {
15930
15946
  enterChatModeLabel: L.voiceEnterChatLabel || "Enter Chat Mode",
15931
15947
  endConversationLabel: L.voiceEndConversationLabel || "End Conversation"
15932
15948
  }, "voice"),
15933
- W === "call_screen" && /* @__PURE__ */ g(Zg, {
15949
+ W === "call_screen" && /* @__PURE__ */ g(t_, {
15934
15950
  incomingCall: w,
15935
15951
  activeCallId: T,
15936
15952
  callConnectionState: E,
@@ -15949,7 +15965,7 @@ function z_() {
15949
15965
  orbColors: we,
15950
15966
  chatHistory: r
15951
15967
  }),
15952
- W === "text_chat" && /* @__PURE__ */ g(R_, {
15968
+ W === "text_chat" && /* @__PURE__ */ g(H_, {
15953
15969
  isClosing: St,
15954
15970
  copy: qe,
15955
15971
  orbColors: we,
@@ -16015,7 +16031,7 @@ function z_() {
16015
16031
  }
16016
16032
  //#endregion
16017
16033
  //#region src/components/ErrorBoundary.jsx
16018
- var B_ = class extends e.Component {
16034
+ var W_ = class extends e.Component {
16019
16035
  constructor(e) {
16020
16036
  super(e), this.state = { hasError: !1 };
16021
16037
  }
@@ -16030,4 +16046,4 @@ var B_ = class extends e.Component {
16030
16046
  }
16031
16047
  };
16032
16048
  //#endregion
16033
- export { Wg as AnimatedOrb, B_ as ErrorBoundary, yi as FlowEngageProvider, z_ as FlowEngageWidget, kn as useFlowEngage };
16049
+ export { Jg as AnimatedOrb, W_ as ErrorBoundary, yi as FlowEngageProvider, U_ as FlowEngageWidget, kn as useFlowEngage };