@flowengage/react-chatbot 7.0.10 → 7.0.11

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.
@@ -3521,20 +3521,36 @@ function Br({ siteId: e, config: t, children: n, language: r = "en" }) {
3521
3521
  currentPageUrl: typeof window < "u" ? window.location.href : void 0,
3522
3522
  currentPageTitle: typeof window < "u" ? document.title : void 0,
3523
3523
  currentPagePath: typeof window < "u" ? window.location.pathname : void 0
3524
- }), s = o.chat_history || [], c = [...s].reverse().find((e) => e.sender === "bot" || e.sender === "assistant");
3525
- if (c?.message) {
3526
- let e = Fr(c.message);
3527
- e && Sr(e.url, {
3524
+ }), s = o.chat_history || [];
3525
+ if (o.navigate?.url) {
3526
+ let { url: e, section: t } = o.navigate;
3527
+ Sr(e, {
3528
3528
  siteId: i?.siteId,
3529
3529
  apiBaseUrl: i?.apiBaseUrl
3530
- }).then((t) => {
3531
- t && Or(e.url, { voiceActive: Et.current }).then((t) => {
3532
- e.section && setTimeout(() => {
3533
- let t = _r(null, e.section);
3534
- t && vr(t);
3535
- }, t ? 300 : 150);
3530
+ }).then((n) => {
3531
+ n && Or(e, { voiceActive: Et.current }).then((e) => {
3532
+ t && setTimeout(() => {
3533
+ let e = _r(null, t);
3534
+ e && vr(e);
3535
+ }, e ? 300 : 150);
3536
3536
  });
3537
3537
  });
3538
+ } else {
3539
+ let e = [...s].reverse().find((e) => e.sender === "bot" || e.sender === "assistant");
3540
+ if (e?.message) {
3541
+ let t = Fr(e.message);
3542
+ t && Sr(t.url, {
3543
+ siteId: i?.siteId,
3544
+ apiBaseUrl: i?.apiBaseUrl
3545
+ }).then((e) => {
3546
+ e && Or(t.url, { voiceActive: Et.current }).then((e) => {
3547
+ t.section && setTimeout(() => {
3548
+ let e = _r(null, t.section);
3549
+ e && vr(e);
3550
+ }, e ? 300 : 150);
3551
+ });
3552
+ });
3553
+ }
3538
3554
  }
3539
3555
  S(Pr(s)), re(!!o.is_human_handled), te(o.is_human_handled ? "agent" : "ai"), we(!1), ke(!1), await k.current.updateChatStatus(y, "messageSent");
3540
3556
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowengage/react-chatbot",
3
- "version": "7.0.10",
3
+ "version": "7.0.11",
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",