@flowengage/react-chatbot 1.8.11 → 1.8.12
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.
|
@@ -3429,8 +3429,8 @@ function tr({ siteId: e, config: t, children: n, language: r = "en" }) {
|
|
|
3429
3429
|
let t = Yn(e);
|
|
3430
3430
|
b((e) => {
|
|
3431
3431
|
if (!e.length) return t;
|
|
3432
|
-
let n = e
|
|
3433
|
-
return
|
|
3432
|
+
let n = new Set(e.map((e) => `${e.sender}\0${e.message}`)), r = t.filter((e) => !n.has(`${e.sender}\0${e.message}`));
|
|
3433
|
+
return r.length ? [...e, ...r] : e;
|
|
3434
3434
|
});
|
|
3435
3435
|
};
|
|
3436
3436
|
try {
|
|
@@ -29492,7 +29492,9 @@ function ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
29492
29492
|
onMessage: (t) => {
|
|
29493
29493
|
if (e) return;
|
|
29494
29494
|
let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
|
|
29495
|
-
|
|
29495
|
+
if (!r) return;
|
|
29496
|
+
let i = s.current, a = i.length > 0 ? i[i.length - 1] : null;
|
|
29497
|
+
a && a.sender === n && a.message === r || (n === "user" && (C.current = r), s.current = [...i, {
|
|
29496
29498
|
sender: n,
|
|
29497
29499
|
message: r,
|
|
29498
29500
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -29508,7 +29510,7 @@ function ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
29508
29510
|
try {
|
|
29509
29511
|
S.current?.setMicMuted?.(!0);
|
|
29510
29512
|
} catch {}
|
|
29511
|
-
y(!0), h("error"), oe("
|
|
29513
|
+
y(!0), h("error"), oe("minimized");
|
|
29512
29514
|
}
|
|
29513
29515
|
},
|
|
29514
29516
|
onDisconnect: () => {
|
|
@@ -29521,7 +29523,7 @@ function ik({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
29521
29523
|
try {
|
|
29522
29524
|
S.current?.setMicMuted?.(!0);
|
|
29523
29525
|
} catch {}
|
|
29524
|
-
y(!0), oe("
|
|
29526
|
+
y(!0), oe("minimized");
|
|
29525
29527
|
}
|
|
29526
29528
|
}
|
|
29527
29529
|
});
|