@sprig-technologies/sprig-bundled 2.36.1 → 2.37.0

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.
@@ -6061,7 +6061,7 @@ const Bf = (e) => e._config && e._config.installationMethod ? e._config.installa
6061
6061
  su = !0, iu = e;
6062
6062
  };
6063
6063
  function Ue(e = {}) {
6064
- const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.36.1", "x-ul-installation-method": Bf(e), "sprig-modules": Nf(), "x-ul-package-version": "2.36.1" };
6064
+ const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.36.1", "x-ul-installation-method": Bf(e), "sprig-modules": Nf(), "x-ul-package-version": "2.37.0" };
6065
6065
  if (e.envId && (t["x-ul-environment-id"] = e.envId), e.token && (t.Authorization = "Bearer " + e.token), e.userId && (t["x-ul-user-id"] = e.userId), e.visitorId && (t["x-ul-visitor-id"] = e.visitorId), e.partnerAnonymousId && (t["x-ul-anonymous-id"] = e.partnerAnonymousId), e.mobileHeadersJSON) {
6066
6066
  const r = JSON.parse(e.mobileHeadersJSON);
6067
6067
  Object.assign(t, r);
@@ -6189,7 +6189,7 @@ const Qt = async (e, t, r) => {
6189
6189
  }();
6190
6190
  S.installationMethod === "web-npm" || S.installationMethod;
6191
6191
  {
6192
- const { default: C } = await import("./view-CNVa1mke.js");
6192
+ const { default: C } = await import("./view-BLTLs8qM.js");
6193
6193
  C.configure(S), E && window.UserLeap.container && window.UserLeap.container && Object.assign(window.UserLeap.container.style, { display: "flex" });
6194
6194
  }
6195
6195
  U == null || U.appendChild(b);
@@ -7468,14 +7468,16 @@ const Q = new class {
7468
7468
  await r.done;
7469
7469
  }
7470
7470
  }(), Ke = [];
7471
- let wr, ju, Un, Wu, pn, Vu, mt = [], Ut = !1, At = 0, hn = !1, Gu = !1, oo = [], Ss = !1;
7472
- const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, triggerSnapshot: r, forceInit: n = !1 }) => {
7473
- hn && !n || (ce.isStorageAvailable ? (mt = [], oo.splice(0), Ke.splice(0), At = 0, pn = r, ju = e, wr = { responseGroupUuid: t.responseGroupUuid, surveyId: t.surveyId, userAgent: t.userAgent, sdkVersion: t.sdkVersion }, Wu = t.maxDurationSeconds, Ng(), hn || (Vu = window.setInterval(_g, 500)), hn = !0) : Ut = !0);
7471
+ let wr, ju, mt = [], Ut = !1, At = 0, pn = !1, Wu = !1;
7472
+ const oo = [];
7473
+ let Un, Vu, hn, Gu, Ss = !1;
7474
+ const Tt = () => pn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, triggerSnapshot: r, forceInit: n = !1 }) => {
7475
+ pn && !n || (ce.isStorageAvailable ? (mt = [], oo.splice(0), Ke.splice(0), At = 0, hn = r, ju = e, wr = { responseGroupUuid: t.responseGroupUuid, surveyId: t.surveyId, userAgent: t.userAgent, sdkVersion: t.sdkVersion }, Vu = t.maxDurationSeconds, Ng(), pn || (Gu = window.setInterval(_g, 500)), pn = !0) : Ut = !0);
7474
7476
  }, Dg = [He.Drag, He.Input, He.MediaInteraction, He.MouseInteraction, He.MouseMove, He.Scroll, He.Selection, He.TouchMove], Pg = (e) => e.type === it.Custom || e.type === it.IncrementalSnapshot && Dg.includes(e.data.source), ao = (e) => e.some(Pg), _g = async () => {
7475
- if (!Tt()) return void window.clearInterval(Vu);
7477
+ if (!Tt()) return void window.clearInterval(Gu);
7476
7478
  if (Hu(), !ao(Ke)) return;
7477
7479
  const e = Ke[0].timestamp;
7478
- Date.now() - e > 35e3 && (pn == null || pn());
7480
+ Date.now() - e > 35e3 && (hn == null || hn());
7479
7481
  }, Hu = async () => {
7480
7482
  if (mt.length || Ss) return;
7481
7483
  Ss = !0;
@@ -7488,7 +7490,7 @@ const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, tr
7488
7490
  _.info("Read stored session state", e);
7489
7491
  const t = JSON.parse(e);
7490
7492
  Ut = t.disabled, wr = t.metadata, mt = t.uploadUrls, At = t.currentIndex, Un = t.expirationTimestamp, t.pendingEventTimestamp && (_.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`), Fg(t.pendingEventTimestamp));
7491
- } else Un = 1e3 * Wu + Date.now();
7493
+ } else Un = 1e3 * Vu + Date.now();
7492
7494
  }, Fg = async (e) => {
7493
7495
  const t = Date.now(), r = (await Q.getEventsBetween(e, t)).map((s) => JSON.parse(s.event));
7494
7496
  if (!ao(r)) return;
@@ -7529,7 +7531,7 @@ const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, tr
7529
7531
  const t = e.length ? e[e.length - 1].timestamp : Date.now(), r = At, n = ((i = (s = window.UserLeap) == null ? void 0 : s.config) == null ? void 0 : i.customMetadata) ?? ((a = window.__cfg) == null ? void 0 : a.customMetadata);
7530
7532
  At++, e.push({ timestamp: t, type: it.Custom, data: { tag: "Sprig_Meta", payload: { ...wr, index: r, visitorId: window.UserLeap.visitorId ?? "", timestamp: t, customMetadata: n } } });
7531
7533
  }, zg = (e, t) => {
7532
- Tt() && !Gu && (e || Ke.length) && (e && Ke.length && (async () => {
7534
+ Tt() && !Wu && (e || Ke.length) && (e && Ke.length && (async () => {
7533
7535
  const r = Ke.splice(0);
7534
7536
  if (!ao(r)) return;
7535
7537
  _.info("Capturing always-on event array to upload"), Ju(r);
@@ -7538,7 +7540,7 @@ const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, tr
7538
7540
  })(), Ke.push(t));
7539
7541
  };
7540
7542
  window.addEventListener("beforeunload", async () => {
7541
- Gu = !0, Tt() && (_.info("Always On handle page unload"), (() => {
7543
+ Wu = !0, Tt() && (_.info("Always On handle page unload"), (() => {
7542
7544
  let e;
7543
7545
  Ke.length && (e = Ke[0].timestamp);
7544
7546
  const t = { disabled: Ut, metadata: wr, uploadUrls: mt, currentIndex: At, pendingEventTimestamp: e, expirationTimestamp: Un };
@@ -7765,10 +7767,10 @@ const Oi = async (e = !1) => {
7765
7767
  _.debug("ReplayInit"), await ke(async () => {
7766
7768
  var l;
7767
7769
  r != null && r.minDuration && (Xu = r.minDuration), r != null && r.batchDuration && (Ei = r.batchDuration), l = t, Au.setLimit(l), $g(), Vg(o + 35, 1800, o + 35), Gg();
7768
- const c = window.UserLeap.replayLibraryURL ?? "https://cdn.sprig.com/dependencies/record-2.0.0-alpha.17.min.js", u = window.rrwebRecord;
7770
+ const c = window.UserLeap.replayLibraryURL ?? "https://cdn.sprig.com/dependencies/record.min.js", u = window.rrwebRecord;
7769
7771
  if (!u) return _.error("RecordScriptFailed");
7770
7772
  let d = !0, p = 0;
7771
- const f = { checkoutEveryNms: 3e4, sampling: { input: "last", scroll: 250, media: 800 }, ...r };
7773
+ const f = { checkoutEveryNms: 3e4, sampling: { input: "last", scroll: 250, media: 800 }, ...r, mutationQueueEnabled: r == null ? void 0 : r.enableMutationQueue };
7772
7774
  var y, h;
7773
7775
  de.stopRecording = u({ emit: (k, m) => {
7774
7776
  if (k.type === it.Custom && (xi = Date.now()), Ve() || Mn()) return;