@shellapps/experience 1.10.0 → 1.10.2

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.
package/dist/index.mjs CHANGED
@@ -883,10 +883,10 @@ var BreadcrumbManager = class {
883
883
  }
884
884
  setupFetchWrapping() {
885
885
  if (typeof fetch === "undefined" || typeof window === "undefined") return;
886
- this.originalFetch = window.fetch;
886
+ this.originalFetch = window.fetch.bind(window);
887
887
  window.fetch = async (input, init) => {
888
- const url = typeof input === "string" ? input : input.toString();
889
- const method = init?.method || "GET";
888
+ const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input instanceof Request ? input.url : String(input);
889
+ const method = init?.method || (input instanceof Request ? input.method : "GET");
890
890
  const startTime = Date.now();
891
891
  try {
892
892
  const response = await this.originalFetch(input, init);
@@ -1637,7 +1637,7 @@ var DataTTracker = class {
1637
1637
  setupEventDelegation() {
1638
1638
  const handleClick = (event) => {
1639
1639
  const target = event.target;
1640
- if (!target) return;
1640
+ if (!(target instanceof Element)) return;
1641
1641
  const dataTElement = this.findDataTParent(target);
1642
1642
  if (dataTElement) {
1643
1643
  this.trackDataTEvent("click", dataTElement, {
@@ -1679,6 +1679,7 @@ var DataTTracker = class {
1679
1679
  setupHoverTracking() {
1680
1680
  const handleMouseEnter = (event) => {
1681
1681
  const target = event.target;
1682
+ if (!(target instanceof Element)) return;
1682
1683
  const dataTElement = this.findDataTParent(target);
1683
1684
  if (!dataTElement) return;
1684
1685
  const timer = window.setTimeout(() => {
@@ -1689,6 +1690,7 @@ var DataTTracker = class {
1689
1690
  };
1690
1691
  const handleMouseLeave = (event) => {
1691
1692
  const target = event.target;
1693
+ if (!(target instanceof Element)) return;
1692
1694
  const dataTElement = this.findDataTParent(target);
1693
1695
  if (!dataTElement) return;
1694
1696
  const timer = this.hoverTimers.get(dataTElement);
@@ -1719,7 +1721,7 @@ var DataTTracker = class {
1719
1721
  findDataTParent(element) {
1720
1722
  let current = element;
1721
1723
  while (current) {
1722
- if (current.hasAttribute("data-t")) {
1724
+ if (typeof current.hasAttribute === "function" && current.hasAttribute("data-t")) {
1723
1725
  return current;
1724
1726
  }
1725
1727
  current = current.parentElement;