@flowengage/react-chatbot 8.0.80 → 8.0.81

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.
@@ -8947,22 +8947,22 @@ async function Lm(e) {
8947
8947
  }
8948
8948
  }, ee = (e, t, n) => {
8949
8949
  t && (T.role && T.role !== e && D(), T.role = e, T.text = T.text ? `${T.text} ${t}`.replace(/\s+/g, " ") : t, n && (T.debug = n), T.timer && clearTimeout(T.timer), T.timer = setTimeout(D, Sm));
8950
- }, O = !1, k = !1, te = !1, ne = !1, re = !0, A = 0, ie = !1, ae = !1, oe = Cm, se = wm, j = null, ce = !1, le = () => {
8950
+ }, O = !1, k = !1, te = !1, ne = !1, re = !0, A = 0, ie = !1, ae = !1, oe = Cm, se = wm, j = null, ce = !1, le = (e = !0) => {
8951
8951
  j && clearTimeout(j);
8952
- let e = () => {
8952
+ let t = () => {
8953
8953
  if (!O) {
8954
8954
  if (M.isPlaying()) {
8955
- j = setTimeout(e, 150);
8955
+ j = setTimeout(t, 150);
8956
8956
  return;
8957
8957
  }
8958
8958
  if (j = null, ce) {
8959
8959
  p?.();
8960
8960
  return;
8961
8961
  }
8962
- !O && C.readyState === WebSocket.OPEN && C.send(JSON.stringify({ type: "PlaybackDrained" })), d?.();
8962
+ !O && C.readyState === WebSocket.OPEN && C.send(JSON.stringify({ type: "PlaybackDrained" })), e && d?.();
8963
8963
  }
8964
8964
  };
8965
- j = setTimeout(e, 150);
8965
+ j = setTimeout(t, 150);
8966
8966
  }, M = Fm(_, () => {
8967
8967
  ne && (ne = !1, c?.({ mode: "listening" }));
8968
8968
  }, v), ue = _.createMediaStreamSource(g);
@@ -9065,7 +9065,7 @@ async function Lm(e) {
9065
9065
  re = !0, ne = !0, ie = !1, A = 0, c?.({ mode: "speaking" });
9066
9066
  break;
9067
9067
  case "AgentAudioDone":
9068
- ae = !1, D(), le(), M.isPlaying() || (ne = !1, c?.({ mode: "listening" }));
9068
+ ae = !1, D(), le(e.turnComplete !== !1), M.isPlaying() || (ne = !1, c?.({ mode: "listening" }));
9069
9069
  break;
9070
9070
  case "FunctionCallRequest":
9071
9071
  _e(e);
@@ -13026,6 +13026,9 @@ function Fg({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13026
13026
  return;
13027
13027
  }
13028
13028
  if (t === "user-speaking") {
13029
+ try {
13030
+ On();
13031
+ } catch {}
13029
13032
  if (Pe.current &&= (clearTimeout(Pe.current), null), L.current === "speaking") return;
13030
13033
  R.current &&= (clearTimeout(R.current), null), L.current !== "listening" && (E("listening"), L.current = "listening");
13031
13034
  return;
@@ -13083,14 +13086,7 @@ function Fg({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13083
13086
  }
13084
13087
  let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
13085
13088
  if (r) {
13086
- if (n === "user") {
13087
- ve.current = r, typeof window < "u" && (window.__fe_user_nav_during_speech = null), Ne.current = !0, R.current &&= (clearTimeout(R.current), null), L.current !== "speaking" && (E("thinking"), L.current = "thinking");
13088
- try {
13089
- On();
13090
- } catch {}
13091
- Te && !j && !oe.current && !pe.current && (j = !0, le.current = r, M.current = !0, N.current?.injectAgentSpeech?.("Before I answer that, could you please enter your email in the text box below?", "interrupt"), N.current?.setMicMuted?.(!0), se.current || (se.current = !0, ce.current = 0, ne(!0), ze()));
13092
- }
13093
- if (l.current = [...l.current, {
13089
+ if (n === "user" && (ve.current = r, typeof window < "u" && (window.__fe_user_nav_during_speech = null), Ne.current = !0, R.current &&= (clearTimeout(R.current), null), L.current !== "speaking" && (E("thinking"), L.current = "thinking"), Te && !j && !oe.current && !pe.current && (j = !0, le.current = r, M.current = !0, N.current?.injectAgentSpeech?.("Before I answer that, could you please enter your email in the text box below?", "interrupt"), N.current?.setMicMuted?.(!0), se.current || (se.current = !0, ce.current = 0, ne(!0), ze()))), l.current = [...l.current, {
13094
13090
  sender: n,
13095
13091
  message: r,
13096
13092
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowengage/react-chatbot",
3
- "version": "8.0.80",
3
+ "version": "8.0.81",
4
4
  "description": "Embeddable AI chat widget for React — powered by FlowEngage. Drop it in with a single siteId.",
5
5
  "keywords": [
6
6
  "chatbot",