@flowengage/react-chatbot 1.7.6 → 1.7.8

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.
@@ -2274,7 +2274,7 @@ async function Xn(e, { siteId: t, apiBaseUrl: n }) {
2274
2274
  });
2275
2275
  try {
2276
2276
  let t = await (await fetch(`${r}/api/widget/navigate-allowed?${i.toString()}`)).json().catch(() => ({}));
2277
- return t.success ? t.allowed ? !0 : t.hasIndex === !1 ? Yn(e) : !1 : !1;
2277
+ return t.success ? t.allowed ? !0 : Yn(e) : !1;
2278
2278
  } catch (e) {
2279
2279
  return console.warn("[FlowEngage] navigate-allowed check failed:", e?.message), !1;
2280
2280
  }
@@ -2343,36 +2343,14 @@ async function Qn(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2343
2343
  Array.from(s.body.children).forEach((e) => {
2344
2344
  e.tagName?.toUpperCase() !== "SCRIPT" && document.body.insertBefore(document.importNode(e, !0), c);
2345
2345
  });
2346
- let u = [
2347
- "jquery",
2348
- "jquery-once",
2349
- "drupal.js",
2350
- "core/misc",
2351
- "core/modules",
2352
- "core/assets",
2353
- "core/themes",
2354
- "wp-includes",
2355
- "wp-admin",
2356
- "react.",
2357
- "react-dom",
2358
- "vue.",
2359
- "angular.",
2360
- "flowengage",
2361
- "elevenlabs",
2362
- "11labs"
2363
- ];
2364
- function d(e) {
2365
- let t = e.toLowerCase();
2366
- return u.some((e) => t.includes(e));
2367
- }
2368
- let f = new Set(Array.from(document.querySelectorAll("script[src]")).map((e) => {
2346
+ let u = new Set(Array.from(document.querySelectorAll("script[src]")).map((e) => {
2369
2347
  try {
2370
2348
  return new URL(e.getAttribute("src") || "", window.location.href).href;
2371
2349
  } catch {
2372
2350
  return "";
2373
2351
  }
2374
2352
  }));
2375
- function p(t, n) {
2353
+ function d(t, n) {
2376
2354
  let r = t.getAttribute("src") || "";
2377
2355
  if (r.includes("flowengage")) return;
2378
2356
  let i = document.createElement("script");
@@ -2383,33 +2361,18 @@ async function Qn(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2383
2361
  } catch {
2384
2362
  return;
2385
2363
  }
2386
- if (f.has(n)) {
2387
- if (d(n)) return;
2388
- bn("replayScript: re-running theme script →", n);
2389
- }
2390
- f.add(n), i.src = n, i.async = t.async, i.defer = t.defer;
2364
+ if (u.has(n)) return;
2365
+ u.add(n), i.src = n, i.async = t.async, i.defer = t.defer;
2391
2366
  } else if (t.textContent.trim()) i.textContent = t.textContent;
2392
2367
  else return;
2393
2368
  let a = t.getAttribute("type");
2394
2369
  a && a !== "text/javascript" && a !== "" && (i.type = a), n.parentNode.insertBefore(i, n);
2395
2370
  }
2396
- for (let e of Array.from(s.head.querySelectorAll("script"))) p(e, c);
2397
- for (let e of Array.from(s.body.querySelectorAll("script"))) p(e, c);
2371
+ for (let e of Array.from(s.head.querySelectorAll("script"))) d(e, c);
2372
+ for (let e of Array.from(s.body.querySelectorAll("script"))) d(e, c);
2398
2373
  try {
2399
- if (typeof window.Drupal?.detachBehaviors == "function") try {
2400
- window.Drupal.detachBehaviors(document.body, window.drupalSettings);
2401
- } catch {}
2402
2374
  typeof window.Drupal?.attachBehaviors == "function" && window.Drupal.attachBehaviors(document.body, window.drupalSettings);
2403
2375
  } catch {}
2404
- try {
2405
- document.dispatchEvent(new Event("DOMContentLoaded"));
2406
- } catch {}
2407
- try {
2408
- window.dispatchEvent(new Event("load"));
2409
- } catch {}
2410
- try {
2411
- document.body.dispatchEvent(new Event("post-load", { bubbles: !0 }));
2412
- } catch {}
2413
2376
  if (s.title && (document.title = s.title), !t) try {
2414
2377
  history.pushState({ flowengageSpa: !0 }, "", e);
2415
2378
  } catch {}
@@ -28609,7 +28572,7 @@ function RO(e) {
28609
28572
  if (RD(`Navigating to ${i}...`, { spinner: !0 }), UD(), kD(), ND(), $("flowengage_navigate → shadowNavigate", i), await nr(i, {
28610
28573
  sectionText: typeof a == "string" ? a : void 0,
28611
28574
  voiceActive: !0
28612
- }), await iO(800), LO(), a && typeof a == "string") {
28575
+ }), await iO(), LO(), a && typeof a == "string") {
28613
28576
  let e = null;
28614
28577
  for (let t = 0; t < 5 && !e; t++) e = Gn(null, a), e || await rO(300);
28615
28578
  e && MD(e), $("flowengage_navigate · highlight", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowengage/react-chatbot",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
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",