@sprig-technologies/sprig-browser 2.32.4 → 2.32.6

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.
@@ -1,34 +1,34 @@
1
1
  var Lt = Object.defineProperty;
2
2
  var Ut = (t, e, n) => e in t ? Lt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var $ = (t, e, n) => (Ut(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { g as z, s as Xe, l as D, e as u, S as w, v as Ze, m as I, b as M, h as St, E as te, D as N, c as It, r as B, i as kt, j as Et, k as _t, n as qe, o as ze, a as xt, p as _e, d as Dt, q as et } from "./metricsReporter-Dh_342TQ.js";
5
- const At = "360px", ir = "ul-app", nr = "#e6e6e6", or = "#bd282a", sr = 1030, We = () => {
3
+ var B = (t, e, n) => (Ut(t, typeof e != "symbol" ? e + "" : e, n), n);
4
+ import { g as F, s as Qe, l as D, e as u, S as w, v as Ye, m as I, b as T, h as St, E as te, D as W, c as It, r as N, i as kt, j as Et, k as _t, n as Me, o as Fe, a as xt, p as Xe, d as Dt, q as Ze } from "./metricsReporter-IUVTL7s6.js";
5
+ const At = "360px", ir = "ul-app", nr = "#e6e6e6", or = "#bd282a", sr = 1030, qe = () => {
6
6
  try {
7
7
  return window.parent.Intercom;
8
8
  } catch {
9
9
  return null;
10
10
  }
11
- }, He = [Object.freeze(Object.defineProperty({ __proto__: null, disable: () => {
12
- const t = We();
11
+ }, ze = [Object.freeze(Object.defineProperty({ __proto__: null, disable: () => {
12
+ const t = qe();
13
13
  t && (t.ul_wasVisible = !!document.querySelector("iframe.intercom-launcher-frame"), t.ul_wasVisible && t("update", { hide_default_launcher: !0 }));
14
14
  }, enable: () => {
15
- const t = We();
15
+ const t = qe();
16
16
  t && (t.ul_wasVisible && t("update", { hide_default_launcher: !1 }), delete t.ul_wasVisible);
17
17
  } }, Symbol.toStringTag, { value: "Module" }))];
18
18
  class Rt {
19
19
  static disable() {
20
- He.forEach((e) => e.disable());
20
+ ze.forEach((e) => e.disable());
21
21
  }
22
22
  static enable() {
23
- He.forEach((e) => e.enable());
23
+ ze.forEach((e) => e.enable());
24
24
  }
25
25
  }
26
- const Ne = "ul-view-sdk-script", Ot = ["ios", "android"], F = "visitors", q = "environments";
27
- async function T(t, e) {
26
+ const We = "ul-view-sdk-script", Ot = ["ios", "android"], j = "visitors", M = "environments";
27
+ async function C(t, e) {
28
28
  var i, o, a;
29
29
  const { shouldDropOnRateLimit: n, ...s } = e;
30
- s.headers = Object.assign(z(window.UserLeap), s.headers);
31
- const r = await Xe(t, { ...s, shouldDropOnRateLimit: n });
30
+ s.headers = Object.assign(F(window.UserLeap), s.headers);
31
+ const r = await Qe(t, { ...s, shouldDropOnRateLimit: n });
32
32
  if (r.ok) {
33
33
  const l = (i = r.headers) == null ? void 0 : i.get("Authorization"), c = l ? l.split(" ") : void 0, d = c && c.length === 2 ? c[1] : void 0, p = (o = r.headers) == null ? void 0 : o.get("x-ul-visitor-id");
34
34
  if (window.UserLeap.userId && p === window.UserLeap.visitorId) {
@@ -44,21 +44,21 @@ function x(t, e) {
44
44
  let s = n[window.UserLeap.envId];
45
45
  s ? s[t] = e : s = { [t]: e }, n[window.UserLeap.envId] = s, D.setItemObject("userleap.ids", n);
46
46
  }
47
- function xe() {
47
+ function Ee() {
48
48
  return window.previewMode ? "0" : window.UserLeap.visitorId ?? "";
49
49
  }
50
- function O(t, e, n) {
50
+ function R(t, e, n) {
51
51
  const s = [window.UserLeap._API_URL, "sdk", t];
52
52
  return e && e.forEach((r) => {
53
- s.push(r), r === q ? s.push(window.UserLeap.envId) : r === F && s.push(xe());
53
+ s.push(r), r === M ? s.push(window.UserLeap.envId) : r === j && s.push(Ee());
54
54
  }), n && s.push(n), s.join("/");
55
55
  }
56
- const X = async (t, e) => {
57
- var Te, je, Me;
58
- const { context: n, delay: s, forceBrandedLogo: r, endCard: i, isFeedback: o = !1, heatmap: a, locale: l, previewMode: c, productConfig: d, questions: p, responseGroupUid: y, surveyId: g, uuid: m, vid: _, sessionReplay: b, studyType: U } = t, h = z(window.UserLeap), L = we(h), k = De(h);
56
+ const Y = async (t, e) => {
57
+ var Ce, Pe, Te;
58
+ const { context: n, delay: s, forceBrandedLogo: r, endCard: i, isFeedback: o = !1, heatmap: a, locale: l, previewMode: c, productConfig: d, questions: p, responseGroupUid: y, surveyId: g, uuid: m, vid: _, sessionReplay: b, studyType: U } = t, h = F(window.UserLeap), L = ue(h), E = _e(h);
59
59
  if (b)
60
60
  if (L)
61
- u.emit(w.ReplayCapture, { responseGroupUid: y, hasQuestions: !!(p != null && p.length), surveyId: g, uploadId: b.uploadId, replayType: b.replayDurationType ?? "before", seconds: b.replayDurationSeconds, generateVideoUploadUrlPayload: { mediaRecordingUid: Ze(), mediaType: "screen", questionId: 1, responseGroupUid: y, surveyId: g, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), visitorId: window.UserLeap.visitorId, isReplay: !0 } });
61
+ u.emit(w.ReplayCapture, { responseGroupUid: y, hasQuestions: !!(p != null && p.length), surveyId: g, uploadId: b.uploadId, replayType: b.replayDurationType ?? "before", seconds: b.replayDurationSeconds, generateVideoUploadUrlPayload: { mediaRecordingUid: Ye(), mediaType: "screen", questionId: 1, responseGroupUid: y, surveyId: g, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), visitorId: window.UserLeap.visitorId, isReplay: !0 } });
62
62
  else {
63
63
  if (!I.replay)
64
64
  return window.UserLeap.reportError("displayQuestions", new Error("Replay module not registered")), { success: !1, message: "Replay module not registered", surveyState: "no survey" };
@@ -69,14 +69,14 @@ const X = async (t, e) => {
69
69
  return window.UserLeap.reportError("displayQuestions", new Error("Replay module not registered")), { success: !1, message: "Replay module not registered", surveyState: "no survey" };
70
70
  const { eventId: S, replayParams: me, responseGroupUid: ht, surveyId: bt } = a;
71
71
  await I.replay.initializeReplay({ maxReplayDurationSeconds: 300, maxInflightRequests: window.UserLeap.maxInflightReplayRequests, teardownAfter: !0 }), I.replay.tryReplayAction(() => {
72
- var Fe;
73
- return (Fe = I.replay) == null ? void 0 : Fe.scheduleCapture({ apiUrl: window.UserLeap._API_URL, completeUploadHeaders: h, eventId: S, isHeatmap: !0, replayParams: me, responseGroupId: ht, surveyId: bt, triggerTimestamp: Date.now(), visitorId: _ });
72
+ var je;
73
+ return (je = I.replay) == null ? void 0 : je.scheduleCapture({ apiUrl: window.UserLeap._API_URL, completeUploadHeaders: h, eventId: S, isHeatmap: !0, replayParams: me, responseGroupId: ht, surveyId: bt, triggerTimestamp: Date.now(), visitorId: _ });
74
74
  }, "Error in scheduling/capturing replay");
75
75
  }
76
76
  if (_ == null || !(p != null && p.length))
77
- return M.info("CannotDisplaySurvey", { vid: _ }), { success: !1, message: "[Sprig] no survey found", surveyState: "no survey" };
77
+ return T.info("CannotDisplaySurvey", { vid: _ }), { success: !1, message: "[Sprig] no survey found", surveyState: "no survey" };
78
78
  if (window.UserLeap.container) {
79
- M.info("AlreadyDisplayingSurvey");
79
+ T.info("AlreadyDisplayingSurvey");
80
80
  const S = "[Sprig] (ERR-409) Found an existing Survey container, aborting rendering of this survey";
81
81
  return console.warn(S), { success: !1, message: S, surveyState: "no survey" };
82
82
  }
@@ -84,57 +84,57 @@ const X = async (t, e) => {
84
84
  const S = "Attempted to display survey to a different visitor";
85
85
  return window.UserLeap.reportError("DisplaySurvey", new Error(S)), { success: !1, message: S, surveyState: "no survey" };
86
86
  }
87
- M.info("ShowingSurvey", { surveyId: g }), (Te = I.replay) == null || Te.RecordSurveyShown({ id: g, userAgent: window.navigator.userAgent }), Rt.disable(), u.emit(w.SurveyWillPresent, { name: w.SurveyWillPresent, "survey.id": g });
88
- let C, v, E, A, R = document.createElement("div");
89
- const W = (S) => {
87
+ T.info("ShowingSurvey", { surveyId: g }), (Ce = I.replay) == null || Ce.RecordSurveyShown({ id: g, userAgent: window.navigator.userAgent }), Rt.disable(), u.emit(w.SurveyWillPresent, { name: w.SurveyWillPresent, "survey.id": g });
88
+ let O, v, k, A, q = document.createElement("div");
89
+ const K = (S) => {
90
90
  const { "view.version": me } = S;
91
- me !== h["x-ul-sdk-version"] && rt(), u.removeListener("verify.view.version", W);
91
+ me !== h["x-ul-sdk-version"] && tt(), u.removeListener("verify.view.version", K);
92
92
  };
93
- u.on("verify.view.version", W), window.UserLeap.useMobileStyling = k, St(h) ? (C = "ul-direct-embeded-frame", v = document.head, E = window, A = !1, L && (tt(g, o), R.id = C, window.UserLeap.container.appendChild(R), it(), u.emit(w.SurveyLifeCycle, { state: "presented" }), u.emit(w.SurveyPresented, { name: w.SurveyPresented, "survey.id": g }))) : { frameId: C, contentWinDocHead: v, contentWindow: E, hasOverlay: A, iframe: R } = Pt({ productConfig: d, useMobileStyling: k, surveyId: g, isFeedback: o }), window.UserLeap.frameId = C;
94
- const P = { apiURL: window.UserLeap._API_URL, cards: p, configureExitOnOverlayClick: (S) => {
93
+ u.on("verify.view.version", K), window.UserLeap.useMobileStyling = E, St(h) ? (O = "ul-direct-embeded-frame", v = document.head, k = window, A = !1, L && (et(g, o), q.id = O, window.UserLeap.container.appendChild(q), rt(), u.emit(w.SurveyLifeCycle, { state: "presented" }), u.emit(w.SurveyPresented, { name: w.SurveyPresented, "survey.id": g }))) : { frameId: O, contentWinDocHead: v, contentWindow: k, hasOverlay: A, iframe: q } = Pt({ productConfig: d, useMobileStyling: E, surveyId: g, isFeedback: o }), window.UserLeap.frameId = O;
94
+ const V = { apiURL: window.UserLeap._API_URL, cards: p, configureExitOnOverlayClick: (S) => {
95
95
  u.once(w.CloseSurveyOnOverlayClick, S);
96
- }, context: n, endCard: i, envId: window.UserLeap.envId, eventEmitFn: u.emit.bind(u), fontFamily: window.UserLeap.fontFamily, fontFamilyURL: window.UserLeap.fontFamilyURL, forceBrandedLogo: r, frame: R, headers: h, locale: l, mobileSDKVersion: window.UserLeap.mobileSDKVersion, previewKey: D.getItem("sprig.previewKey"), previewMode: c, productConfig: { framePosition: d == null ? void 0 : d.framePosition, desktopDisplay: d == null ? void 0 : d.desktopDisplay, placement: d == null ? void 0 : d.placement }, responseGroupUid: y, startingQuestionIdx: (je = window.UserLeap.config) == null ? void 0 : je.startingQuestionIdx, studyType: U, styleNonce: window.UserLeap.styleNonce, surveyId: g, tabTitle: document.title, trackPageViewUrl: e, ulEvents: te, upchunkLibraryURL: window.UserLeap.upchunkLibraryURL, useMobileStyling: k, userId: m, viewDocument: E == null ? void 0 : E.document, viewWindow: E, visitorAttributes: { externalUserId: window.UserLeap.userId, email: window.UserLeap.email }, ...window.UserLeap._config };
97
- (Me = window.UserLeap._config) != null && Me.startingQuestionIdx && (window.UserLeap._config = { ...window.UserLeap._config, startingQuestionIdx: null });
98
- const re = (o ? window.UserLeap.feedbackCustomStyles : window.UserLeap.customStyles) ?? d.customStyles;
99
- P.customStyles = re, E && (E.__cfg = P);
100
- const J = window.UserLeap.viewSDKURL ? window.UserLeap.viewSDKURL : P.path, Oe = document.getElementById(Ne);
101
- Oe && Oe.remove();
96
+ }, context: n, endCard: i, envId: window.UserLeap.envId, eventEmitFn: u.emit.bind(u), fontFamily: window.UserLeap.fontFamily, fontFamilyURL: window.UserLeap.fontFamilyURL, forceBrandedLogo: r, frame: q, headers: h, locale: l, mobileSDKVersion: window.UserLeap.mobileSDKVersion, previewKey: D.getItem("sprig.previewKey"), previewMode: c, productConfig: { framePosition: d == null ? void 0 : d.framePosition, desktopDisplay: d == null ? void 0 : d.desktopDisplay, placement: d == null ? void 0 : d.placement }, responseGroupUid: y, startingQuestionIdx: (Pe = window.UserLeap.config) == null ? void 0 : Pe.startingQuestionIdx, studyType: U, styleNonce: window.UserLeap.styleNonce, surveyId: g, tabTitle: document.title, trackPageViewUrl: e, ulEvents: te, upchunkLibraryURL: window.UserLeap.upchunkLibraryURL, useMobileStyling: E, userId: m, viewDocument: k == null ? void 0 : k.document, viewWindow: k, visitorAttributes: { externalUserId: window.UserLeap.userId, email: window.UserLeap.email }, ...window.UserLeap._config };
97
+ (Te = window.UserLeap._config) != null && Te.startingQuestionIdx && (window.UserLeap._config = { ...window.UserLeap._config, startingQuestionIdx: null });
98
+ const vt = (o ? window.UserLeap.feedbackCustomStyles : window.UserLeap.customStyles) ?? d.customStyles;
99
+ V.customStyles = vt, k && (k.__cfg = V);
100
+ const we = window.UserLeap.viewSDKURL ? window.UserLeap.viewSDKURL : V.path, Ae = document.getElementById(We);
101
+ Ae && Ae.remove();
102
102
  const ge = function() {
103
103
  const S = document.createElement("script");
104
- return window.UserLeap.nonce && S.setAttribute("nonce", window.UserLeap.nonce), S.id = Ne, S;
105
- }(), Ce = () => {
104
+ return window.UserLeap.nonce && S.setAttribute("nonce", window.UserLeap.nonce), S.id = We, S;
105
+ }(), Re = () => {
106
106
  window.UserLeap.container && Object.assign(window.UserLeap.container.style, { display: "flex" });
107
107
  };
108
- if (P.installationMethod === "web-npm" || P.installationMethod === "web-npm-bundled") {
109
- const { default: S } = await import("./view-BkqDP9V8.js");
110
- S.configure(P), A && window.UserLeap.container && Ce();
108
+ if (V.installationMethod === "web-npm" || V.installationMethod === "web-npm-bundled") {
109
+ const { default: S } = await import("./view-BC8pDITD.js");
110
+ S.configure(V), A && window.UserLeap.container && Re();
111
111
  } else
112
- J && (ge.src = J, A && ge.addEventListener("load", () => {
113
- window.UserLeap.container && Ce();
114
- }), E == null || E.addEventListener("error", (S) => {
115
- S.target instanceof HTMLScriptElement && S.target.src === J && window.UserLeap.reportError("loadFrameScript", new Error("Frame script failed to load"));
112
+ we && (ge.src = we, A && ge.addEventListener("load", () => {
113
+ window.UserLeap.container && Re();
114
+ }), k == null || k.addEventListener("error", (S) => {
115
+ S.target instanceof HTMLScriptElement && S.target.src === we && window.UserLeap.reportError("loadFrameScript", new Error("Frame script failed to load"));
116
116
  }, { capture: !0, once: !0 }));
117
117
  v == null || v.appendChild(ge);
118
- const Pe = { success: !0, surveyState: "ready", surveyId: g, responseGroupUid: y };
119
- return window.UserLeap.isMobileSDK && s && (Pe.delay = s), Pe;
118
+ const Oe = { success: !0, surveyState: "ready", surveyId: g, responseGroupUid: y };
119
+ return window.UserLeap.isMobileSDK && s && (Oe.delay = s), Oe;
120
120
  };
121
- function De(t) {
121
+ function _e(t) {
122
122
  var n;
123
123
  if (window.UserLeap.useMobileStyling !== void 0)
124
124
  return window.UserLeap.useMobileStyling;
125
125
  const e = ((n = window.UserLeap.windowDimensions) == null ? void 0 : n.width) ?? document.body.clientWidth;
126
- return we(t) || e > 10 && e < 500;
126
+ return ue(t) || e > 10 && e < 500;
127
127
  }
128
- function we(t) {
128
+ function ue(t) {
129
129
  return Ot.includes(t["userleap-platform"]);
130
130
  }
131
- const Ae = "ul-frame";
131
+ const xe = "ul-frame";
132
132
  window.UserLeap && window.Sprig && (window.Sprig._gtm ? window.Sprig = window.UserLeap : window.UserLeap = window.Sprig), window.UserLeap || (window.UserLeap = window.Sprig), window.Sprig || (window.Sprig = window.UserLeap);
133
- const ye = "0px", tt = (t, e, n) => {
133
+ const ye = "0px", et = (t, e, n) => {
134
134
  window.UserLeap.container = document.createElement("div"), window.UserLeap.container.className = "ul-container" + (e ? " ul-container-feedback" : ""), t && (window.UserLeap.container.dataset.studyId = t.toString());
135
- const s = ot();
135
+ const s = nt();
136
136
  n && s && !window.UserLeap.useMobileStyling ? s.appendChild(window.UserLeap.container) : document.body.appendChild(window.UserLeap.container);
137
- }, rt = (t, e) => {
137
+ }, tt = (t, e) => {
138
138
  var s;
139
139
  jt();
140
140
  const n = window.UserLeap.container;
@@ -144,9 +144,9 @@ const ye = "0px", tt = (t, e, n) => {
144
144
  } catch (r) {
145
145
  console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${t} ` + n), r instanceof Error && window.UserLeap.reportError("dismissActiveSurvey", r);
146
146
  }
147
- }, it = () => {
147
+ }, rt = () => {
148
148
  u.once(w.SurveyWillClose, ({ initiator: t, studyType: e }) => {
149
- u.removeAllListeners(w.CloseSurveyOnOverlayClick), rt(t, e);
149
+ u.removeAllListeners(w.CloseSurveyOnOverlayClick), tt(t, e);
150
150
  });
151
151
  }, Ct = (t, e, n, s) => {
152
152
  var d, p;
@@ -184,12 +184,12 @@ const ye = "0px", tt = (t, e, n) => {
184
184
  })(i, n), Object.assign(t.style, r, l), c;
185
185
  }, Pt = ({ productConfig: t, useMobileStyling: e, surveyId: n, isFeedback: s }) => {
186
186
  var y, g;
187
- const r = Ae, i = s && t.desktopDisplay === "slider";
188
- tt(n, s, i), Tt();
187
+ const r = xe, i = s && t.desktopDisplay === "slider";
188
+ et(n, s, i), Tt();
189
189
  const o = document.createElement("iframe");
190
190
  o.id = r, o.setAttribute("title", "Sprig User Feedback Dialog");
191
191
  const a = Ct(o, t, e, s);
192
- it();
192
+ rt();
193
193
  let l = !1;
194
194
  o.setHeight = (m) => {
195
195
  parseInt(o.style.height) == m && l || (l = !0, o.style.height = `${m}px`, u.emit(w.SurveyHeight, { name: w.SurveyHeight, contentFrameHeight: m, "survey.id": n }));
@@ -207,17 +207,17 @@ const ye = "0px", tt = (t, e, n) => {
207
207
  }
208
208
  const p = d == null ? void 0 : d.head;
209
209
  return { frameId: r, contentWinDocHead: p, contentWindow: o.contentWindow, hasOverlay: a, iframe: o };
210
- }, nt = { [w.SurveyFadingOut]: () => {
210
+ }, it = { [w.SurveyFadingOut]: () => {
211
211
  window.UserLeap.container && Object.assign(window.UserLeap.container.style, { "background-color": "rgba(0,0,0,0)" });
212
212
  } }, Tt = () => {
213
- Object.entries(nt).forEach(([t, e]) => {
213
+ Object.entries(it).forEach(([t, e]) => {
214
214
  u.on(t, e);
215
215
  });
216
216
  }, jt = () => {
217
- Object.entries(nt).forEach(([t, e]) => {
217
+ Object.entries(it).forEach(([t, e]) => {
218
218
  u.off(t, e);
219
219
  });
220
- }, G = (t) => !!t && t.nodeType === Node.ELEMENT_NODE, Ve = (t) => t instanceof HTMLElement || t instanceof SVGElement, oe = ({ document: t, elementId: e, styleString: n, nonce: s }) => {
220
+ }, $ = (t) => !!t && t.nodeType === Node.ELEMENT_NODE, He = (t) => t instanceof HTMLElement || t instanceof SVGElement, ne = ({ document: t, elementId: e, styleString: n, nonce: s }) => {
221
221
  const r = t.getElementById(e);
222
222
  if (r)
223
223
  return void (r.textContent = n);
@@ -225,60 +225,60 @@ const ye = "0px", tt = (t, e, n) => {
225
225
  s && (i.nonce = s), i.textContent = n, i.id = e, t.head.appendChild(i);
226
226
  }, Mt = (t, e) => {
227
227
  const n = e.querySelector(".sprig-question-body");
228
- if (!G(n))
228
+ if (!$(n))
229
229
  return t;
230
230
  const s = n.scrollHeight;
231
231
  return s < 100 ? t : t - (s - 100);
232
- }, Be = (t, e) => {
232
+ }, Ne = (t, e) => {
233
233
  const n = e.querySelector(t);
234
- if (!G(n))
234
+ if (!$(n))
235
235
  return 0;
236
236
  const s = getComputedStyle(n);
237
237
  return parseFloat(s.paddingLeft) + parseFloat(s.paddingRight) + (parseFloat(s.marginLeft) + parseFloat(s.marginRight)) + (parseFloat(s.borderLeftWidth) + parseFloat(s.borderRightWidth));
238
238
  }, Ft = (t) => {
239
239
  const e = t.querySelector(".ul-card__container");
240
240
  let n = 600, s = 360, r = 0;
241
- if (G(e)) {
241
+ if ($(e)) {
242
242
  n = e.clientHeight, n += ((a) => {
243
243
  const l = a.querySelector(".sprig-question-body"), c = a.querySelector(".ul-card"), d = a.querySelector(".ul-card-main-content");
244
244
  let p = 0;
245
- return G(c) && (p += c.scrollHeight - c.clientHeight), G(d) && (p += d.scrollHeight - d.clientHeight), G(l) && (p += l.scrollHeight - l.clientHeight), p;
245
+ return $(c) && (p += c.scrollHeight - c.clientHeight), $(d) && (p += d.scrollHeight - d.clientHeight), $(l) && (p += l.scrollHeight - l.clientHeight), p;
246
246
  })(t);
247
247
  const i = getComputedStyle(e);
248
248
  r = n, n += parseFloat(i.marginTop) + parseFloat(i.marginBottom) + (parseFloat(i.borderTopWidth) + parseFloat(i.borderBottomWidth));
249
249
  const o = e.querySelector(".ul-card--matrix_grid");
250
- s = o ? o.scrollWidth : e.scrollWidth, s += Be(".ul-card__container", t), s += Be(".sprig-question-body", t);
250
+ s = o ? o.scrollWidth : e.scrollWidth, s += Ne(".ul-card__container", t), s += Ne(".sprig-question-body", t);
251
251
  }
252
252
  return [n + 1, s, Mt(r, t)];
253
253
  }, ar = (t) => {
254
254
  const e = t.querySelector(".ul-card__container");
255
255
  e && (e.scrollTop = 0);
256
- }, ot = () => f, K = () => document.getElementById("sprig-feedback-container"), be = () => document.getElementById("sprig-feedback-loading-animation"), st = () => !!document.getElementById(Ae);
257
- let $e = !1, f = null, j = null, Re = !1, Z = null, H = null;
258
- const qt = ["bottom-left", "bottom-right", "center-left", "center-right"], se = () => {
256
+ }, nt = () => f, G = () => document.getElementById("sprig-feedback-container"), be = () => document.getElementById("sprig-feedback-loading-animation"), ot = () => !!document.getElementById(xe);
257
+ let Ve = !1, f = null, P = null, De = !1, X = null, z = null;
258
+ const qt = ["bottom-left", "bottom-right", "center-left", "center-right"], oe = () => {
259
259
  var e;
260
260
  const t = window.UserLeap.container;
261
261
  return ((e = t == null ? void 0 : t.parentElement) == null ? void 0 : e.id) === "sprig-feedback-loading-container";
262
- }, at = () => document.getElementById("sprig-feedback-error-container"), dt = () => {
262
+ }, st = () => document.getElementById("sprig-feedback-error-container"), at = () => {
263
263
  if (!f)
264
264
  return 0;
265
265
  const t = f == null ? void 0 : f.clientWidth, e = window.getComputedStyle(f);
266
266
  return t + parseInt(e.borderRightWidth || "0") + parseInt(e.borderLeftWidth || "0");
267
- }, ae = (t) => {
268
- const e = K();
269
- e && (H != null && H.endsWith("right") ? e.style.right = `${t}px` : H != null && H.endsWith("left") && (e.style.left = `${t}px`));
267
+ }, se = (t) => {
268
+ const e = G();
269
+ e && (z != null && z.endsWith("right") ? e.style.right = `${t}px` : z != null && z.endsWith("left") && (e.style.left = `${t}px`));
270
270
  }, fe = () => {
271
- if (f && (se() || at())) {
272
- u.off(w.SurveyAppeared, Y), Le();
273
- const t = dt();
274
- return ae(-t), !0;
271
+ if (f && (oe() || st())) {
272
+ u.off(w.SurveyAppeared, Q), Le();
273
+ const t = at();
274
+ return se(-t), !0;
275
275
  }
276
276
  return !1;
277
- }, Y = () => {
278
- if (!f || !j)
277
+ }, Q = () => {
278
+ if (!f || !P)
279
279
  return;
280
280
  const t = be();
281
- t && t.remove(), f.style.height = "auto", f.style.width = "auto", j.disabled = !1, Re = !1;
281
+ t && t.remove(), f.style.height = "auto", f.style.width = "auto", P.disabled = !1, De = !1;
282
282
  }, Le = () => {
283
283
  if (f && !be()) {
284
284
  const t = (() => {
@@ -296,59 +296,59 @@ const qt = ["bottom-left", "bottom-right", "center-left", "center-right"], se =
296
296
  })();
297
297
  t && (f.style.height = "300px", f.style.width = "360px", f.appendChild(t));
298
298
  }
299
- }, Ge = () => {
300
- f && j && (ae(0), j.disabled = !0, Re = !0);
301
- }, lt = async (t, e, n) => {
299
+ }, Be = () => {
300
+ f && P && (se(0), P.disabled = !0, De = !0);
301
+ }, dt = async (t, e, n) => {
302
302
  const { buttonTheme: s, customStyles: r, eventId: i, placement: o, desktopDisplay: a, feedbackLabel: l, surveyUuid: c, surveyId: d } = t;
303
303
  window.UserLeap.feedbackCustomStyles = void 0;
304
- let p = K();
304
+ let p = G();
305
305
  if (p) {
306
- if (!e && i === Z)
306
+ if (!e && i === X)
307
307
  return;
308
308
  p.remove(), u.off(te.SURVEY_FADING_OUT, fe);
309
309
  }
310
- Z = i, oe({ document, elementId: "sprig-feedback-style", styleString: '.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}#sprig-feedback-button{border-left:0;border-radius:0 8px 8px 0;display:grid;padding:8px;text-align:center;transition:all ease-in-out 1s;z-index:inherit}#sprig-feedback-button:hover{cursor:pointer}.sprig-feedback-button-label{writing-mode:vertical-lr;text-orientation:sideways}.sprig-feedback-button-right{transform:rotate(180deg)}.sprig-feedback-button-bottom{align-self:flex-end;margin-bottom:20px}.sprig-feedback-button-light{background:#efefee;color:#000;border:1px solid #e2e3e1}.sprig-feedback-button-dark{background:#000;color:#fff;border:1px solid #000000}#sprig-feedback-container{display:flex;align-items:center;position:fixed;transition:right .2s linear,left .2s linear;z-index:2147483646}.sprig-feedback-container-left{flex-flow:row-reverse}.sprig-feedback-container-center{top:50%;transform:translateY(-50%)}.sprig-feedback-container-bottom{bottom:0%;margin-bottom:15px}.sprig-feedback-loading-container{align-items:center;background-color:#fff;border:2px solid var(--feedback-border);display:flex;max-height:90vh;max-width:90vw;min-width:0px}.sprig-feedback-loading-container-left{border-left:none;border-radius:0 8px 8px 0}.sprig-feedback-loading-container-right{border-right:none;border-radius:8px 0 0 8px}#sprig-feedback-error-container{margin:auto;text-align:center;width:360px}.sprig-feedback-error-text{font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}#sprig-feedback-loading-container .ul-container{position:relative;max-height:inherit}#sprig-feedback-loading-animation{position:absolute}.sprig-feedback-loading-container-previews iframe{max-height:inherit!important}', nonce: window.UserLeap.styleNonce }), oe({ document, elementId: "ul-custom-style", styleString: r ?? "", nonce: window.UserLeap.styleNonce }), $e = a === "center-modal", H = o;
310
+ X = i, ne({ document, elementId: "sprig-feedback-style", styleString: '.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}#sprig-feedback-button{border-left:0;border-radius:0 8px 8px 0;display:grid;padding:8px;text-align:center;transition:all ease-in-out 1s;z-index:inherit}#sprig-feedback-button:hover{cursor:pointer}.sprig-feedback-button-label{writing-mode:vertical-lr;text-orientation:sideways}.sprig-feedback-button-right{transform:rotate(180deg)}.sprig-feedback-button-bottom{align-self:flex-end;margin-bottom:20px}.sprig-feedback-button-light{background:#efefee;color:#000;border:1px solid #e2e3e1}.sprig-feedback-button-dark{background:#000;color:#fff;border:1px solid #000000}#sprig-feedback-container{display:flex;align-items:center;position:fixed;transition:right .2s linear,left .2s linear;z-index:2147483646}.sprig-feedback-container-left{flex-flow:row-reverse}.sprig-feedback-container-center{top:50%;transform:translateY(-50%)}.sprig-feedback-container-bottom{bottom:0%;margin-bottom:15px}.sprig-feedback-loading-container{align-items:center;background-color:#fff;border:2px solid var(--feedback-border);display:flex;max-height:90vh;max-width:90vw;min-width:0px}.sprig-feedback-loading-container-left{border-left:none;border-radius:0 8px 8px 0}.sprig-feedback-loading-container-right{border-right:none;border-radius:8px 0 0 8px}#sprig-feedback-error-container{margin:auto;text-align:center;width:360px}.sprig-feedback-error-text{font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}#sprig-feedback-loading-container .ul-container{position:relative;max-height:inherit}#sprig-feedback-loading-animation{position:absolute}.sprig-feedback-loading-container-previews iframe{max-height:inherit!important}', nonce: window.UserLeap.styleNonce }), ne({ document, elementId: "ul-custom-style", styleString: r ?? "", nonce: window.UserLeap.styleNonce }), Ve = a === "center-modal", z = o;
311
311
  const [y, g] = o.split("-");
312
312
  ((U) => {
313
- if (K() || !qt.includes(U))
313
+ if (G() || !qt.includes(U))
314
314
  return;
315
- const [h, L] = U.split("-"), k = document.createElement("div");
316
- k.id = "sprig-feedback-container", k.classList.add(`sprig-feedback-container-${L}`, `sprig-feedback-container-${h}`), document.body.appendChild(k);
317
- })(o), p = K(), j = document.createElement("button");
315
+ const [h, L] = U.split("-"), E = document.createElement("div");
316
+ E.id = "sprig-feedback-container", E.classList.add(`sprig-feedback-container-${L}`, `sprig-feedback-container-${h}`), document.body.appendChild(E);
317
+ })(o), p = G(), P = document.createElement("button");
318
318
  const m = document.createElement("div");
319
- m.className = "sprig-feedback-button-label", m.innerText = l, j.appendChild(m), j.id = "sprig-feedback-button", j.classList.add(`sprig-feedback-button-${g}`, `sprig-feedback-button-${y}`, `sprig-feedback-button-${s}`, "fade-in-transition"), u.on(te.SURVEY_FADING_OUT, fe), j.addEventListener("click", async () => {
319
+ m.className = "sprig-feedback-button-label", m.innerText = l, P.appendChild(m), P.id = "sprig-feedback-button", P.classList.add(`sprig-feedback-button-${g}`, `sprig-feedback-button-${y}`, `sprig-feedback-button-${s}`, "fade-in-transition"), u.on(te.SURVEY_FADING_OUT, fe), P.addEventListener("click", async () => {
320
320
  const U = document.getElementById("sprig-feedback-error-container");
321
- if (st() || at()) {
321
+ if (ot() || st()) {
322
322
  if (fe()) {
323
- u.emit(w.SurveyWillClose, { name: w.SurveyWillClose, initiator: N.FeedbackClosed, studyType: "feedbackButton", "survey.id": d });
324
- const L = K();
325
- U && L && (L.remove(), Z = null, f = null);
323
+ u.emit(w.SurveyWillClose, { name: w.SurveyWillClose, initiator: W.FeedbackClosed, studyType: "feedbackButton", "survey.id": d });
324
+ const L = G();
325
+ U && L && (L.remove(), X = null, f = null);
326
326
  }
327
327
  return;
328
328
  }
329
- if (De(z(window.UserLeap)) || Re || Ge(), e)
330
- return f && f.classList.add("sprig-feedback-loading-container-previews"), await X(e), void Y();
329
+ if (_e(F(window.UserLeap)) || De || Be(), e)
330
+ return f && f.classList.add("sprig-feedback-loading-container-previews"), await Y(e), void Q();
331
331
  const h = await (async (L) => {
332
- const k = await T(O("1", [F], "startFeedbackStudy"), { body: JSON.stringify({ surveyUuid: L }), method: "POST" });
333
- return k.ok ? k.json : null;
332
+ const E = await C(R("1", [j], "startFeedbackStudy"), { body: JSON.stringify({ surveyUuid: L }), method: "POST" });
333
+ return E.ok ? E.json : null;
334
334
  })(c);
335
335
  if (h)
336
- u.once(w.SurveyAppeared, Y), X({ ...h, studyType: "feedbackButton" }, n);
336
+ u.once(w.SurveyAppeared, Q), Y({ ...h, studyType: "feedbackButton" }, n);
337
337
  else if (f) {
338
338
  const L = zt();
339
- f.appendChild(L), Y(), f.style.height = "300px", f.style.width = "360px";
339
+ f.appendChild(L), Q(), f.style.height = "300px", f.style.width = "360px";
340
340
  }
341
- }), p == null || p.appendChild(j), u.emit(w.FeedbackButtonLoaded, { name: w.FeedbackButtonLoaded, "survey.id": d });
341
+ }), p == null || p.appendChild(P), u.emit(w.FeedbackButtonLoaded, { name: w.FeedbackButtonLoaded, "survey.id": d });
342
342
  const { useMobileStyling: _, _config: { border: b } } = window.UserLeap;
343
- if ($e || _)
344
- ae(0);
343
+ if (Ve || _)
344
+ se(0);
345
345
  else {
346
346
  const U = document.createElement("div");
347
347
  U.id = "sprig-feedback-loading-container", U.className = `sprig-feedback-loading-container sprig-feedback-loading-container-${g}`, U.style.setProperty("--feedback-border", b), f = U, Le(), p == null || p.appendChild(U);
348
- const h = dt();
349
- ae(-h);
348
+ const h = at();
349
+ se(-h);
350
350
  }
351
- window.UserLeap._config.isOnQuestionsTab && e && !se() && f && (Ge(), Le(), f && f.classList.add("sprig-feedback-loading-container-previews"), X(e), Y());
351
+ window.UserLeap._config.isOnQuestionsTab && e && !oe() && f && (Be(), Le(), f && f.classList.add("sprig-feedback-loading-container-previews"), Y(e), Q());
352
352
  }, zt = () => {
353
353
  const t = document.createElement("div");
354
354
  t.id = "sprig-feedback-error-container", t.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
@@ -360,7 +360,7 @@ const qt = ["bottom-left", "bottom-right", "center-left", "center-right"], se =
360
360
  return e.className = "sprig-feedback-error-text", e.innerText = "There was an error while loading the survey", t.appendChild(e), t;
361
361
  }, Ue = new class {
362
362
  constructor() {
363
- $(this, "_ldData", {});
363
+ B(this, "_ldData", {});
364
364
  }
365
365
  getAllLaunchDarklyVariations() {
366
366
  return this._ldData;
@@ -376,9 +376,9 @@ const qt = ["bottom-left", "bottom-right", "center-left", "center-right"], se =
376
376
  }
377
377
  }();
378
378
  Object.freeze(Ue);
379
- const ne = new class {
379
+ const ie = new class {
380
380
  constructor() {
381
- $(this, "_optimizelyData", {});
381
+ B(this, "_optimizelyData", {});
382
382
  }
383
383
  setOptimizelyExperiment(t, e = !0) {
384
384
  if (!t || typeof t != "object")
@@ -424,12 +424,12 @@ const ne = new class {
424
424
  }
425
425
  }
426
426
  }();
427
- Object.freeze(ne);
427
+ Object.freeze(ie);
428
428
  class Wt {
429
429
  constructor(e, n) {
430
- $(this, "paused");
431
- $(this, "queue");
432
- $(this, "ul");
430
+ B(this, "paused");
431
+ B(this, "queue");
432
+ B(this, "ul");
433
433
  this.ul = e, this.paused = !1, this.queue = [], this.flush(n);
434
434
  }
435
435
  flush(e) {
@@ -476,14 +476,14 @@ class Wt {
476
476
  this.queue.length = 0;
477
477
  }
478
478
  }
479
- let ct, pt;
479
+ let lt, ct;
480
480
  const Se = (t) => {
481
481
  let e = 0, n = t.firstElementChild;
482
482
  for (; n; )
483
483
  e += Se(n), n.shadowRoot && (e += Se(n.shadowRoot)), n = n.nextElementSibling, e++;
484
484
  return e;
485
- }, Ke = () => {
486
- ct.report(Se(document.body)), pt.report(document.documentElement.innerHTML.length);
485
+ }, $e = () => {
486
+ lt.report(Se(document.body)), ct.report(document.documentElement.innerHTML.length);
487
487
  }, Ie = (t, e) => {
488
488
  const n = performance.now();
489
489
  document.hidden ? setTimeout(() => Ie(t, e), t) : setTimeout(() => {
@@ -491,33 +491,33 @@ const Se = (t) => {
491
491
  e.report(s / 1e3), setTimeout(() => Ie(t, e), t);
492
492
  }, 0);
493
493
  };
494
- let de, le, ce, pe, Je, V = {};
495
- const ie = (t, e = 1) => {
494
+ let ae, de, le, ce, Ge, H = {};
495
+ const re = (t, e = 1) => {
496
496
  const { name: n } = t;
497
- V[n] = (V[n] || 0) + e;
498
- }, ut = (t) => {
497
+ H[n] = (H[n] || 0) + e;
498
+ }, pt = (t) => {
499
499
  let e = 1;
500
500
  return t.childNodes.forEach((n) => {
501
- e += ut(n);
501
+ e += pt(n);
502
502
  }), e;
503
- }, Qe = (t) => {
503
+ }, Ke = (t) => {
504
504
  let e = 0;
505
505
  return t.forEach((n) => {
506
- e += ut(n);
506
+ e += pt(n);
507
507
  }), e;
508
508
  }, Ht = (t) => {
509
509
  switch (t.type) {
510
510
  case "childList":
511
- return ie(de, Qe(t.addedNodes)), void ie(le, Qe(t.removedNodes));
511
+ return re(ae, Ke(t.addedNodes)), void re(de, Ke(t.removedNodes));
512
512
  case "attributes":
513
- return void ie(ce);
513
+ return void re(le);
514
514
  case "characterData":
515
- return void ie(pe);
515
+ return void re(ce);
516
516
  }
517
517
  }, Nt = (t) => t.forEach(Ht), Vt = () => {
518
- de.report(V[de.name] || 0), le.report(V[le.name] || 0), ce.report(V[ce.name] || 0), pe.report(V[pe.name] || 0), V = {};
518
+ ae.report(H[ae.name] || 0), de.report(H[de.name] || 0), le.report(H[le.name] || 0), ce.report(H[ce.name] || 0), H = {};
519
519
  }, Bt = (t = 1e3) => {
520
- de = B("sdk_mutations_nodes_added"), le = B("sdk_mutations_nodes_removed"), ce = B("sdk_mutations_attributes_changed"), pe = B("sdk_mutations_character_data"), Je = new MutationObserver(Nt), Je.observe(document, { attributes: !0, attributeOldValue: !0, characterData: !0, characterDataOldValue: !0, childList: !0, subtree: !0 }), setInterval(Vt, t);
520
+ ae = N("sdk_mutations_nodes_added"), de = N("sdk_mutations_nodes_removed"), le = N("sdk_mutations_attributes_changed"), ce = N("sdk_mutations_character_data"), Ge = new MutationObserver(Nt), Ge.observe(document, { attributes: !0, attributeOldValue: !0, characterData: !0, characterDataOldValue: !0, childList: !0, subtree: !0 }), setInterval(Vt, t);
521
521
  }, $t = ({ isWeb: t, reportingIntervalSeconds: e, thresholds: n, postMetrics: s }) => {
522
522
  kt(n, (r, i) => {
523
523
  var o, a;
@@ -526,71 +526,71 @@ const ie = (t, e = 1) => {
526
526
  (a = I.replay) == null || a.disableRecording("Threshold violated", new Error(l), { reportError: !1 }), window.UserLeap.reportError("Sdk Performance Metric threshold violated", new Error("Sdk Performance Metric threshold violated"), { metricName: i.metric, type: i.type, value: i.value }, { metricName: i.metric }), _t();
527
527
  }
528
528
  }), Et({ reportingIntervalSeconds: e, postMetrics: s }), t && (((r = 1e3) => {
529
- const i = B("sdk_event_queue_latency_seconds");
529
+ const i = N("sdk_event_queue_latency_seconds");
530
530
  Ie(r, i);
531
531
  })(), ((r = 1e4) => {
532
- ct = B("sdk_dom_nodes_count"), pt = B("sdk_page_html_characters"), Ke(), setInterval(Ke, r);
532
+ lt = N("sdk_dom_nodes_count"), ct = N("sdk_page_html_characters"), $e(), setInterval($e, r);
533
533
  })(), Bt());
534
534
  }, Gt = "test", Kt = ["popState", "pushState", "replaceState"];
535
- let ke;
536
- const ue = {}, Q = "!email", wt = "pageUrl";
535
+ let Z;
536
+ const pe = {}, J = "!email", ut = "pageUrl";
537
537
  let ve = window.location.href;
538
538
  function ee(t) {
539
539
  var a;
540
540
  const { pageUrlEvents: e, interactiveEvents: n, dismissOnPageChange: s, platform: r } = window.UserLeap._config;
541
541
  if (r && r !== "web")
542
542
  return;
543
- ve !== window.location.href && M.navigation("LocationChange", { from: ve, to: window.location.href }), ve = window.location.href;
544
- const i = yt().trackStartUrl, o = i ? String(i) : null;
545
- e && vt(window.location.href), n && (mt(), Jt()), ot() && (() => {
546
- if (se())
543
+ ve !== window.location.href && T.navigation("LocationChange", { from: ve, to: window.location.href }), ve = window.location.href;
544
+ const i = mt().trackStartUrl, o = i ? String(i) : null;
545
+ e && ft(window.location.href), n && (gt(), Jt()), nt() && (() => {
546
+ if (oe())
547
547
  return;
548
- const l = K();
549
- l && (It(Z) || (l.remove(), Z = null, f = null));
550
- })(), xt.getItem("sprig.isCapturingHeatmap") && ((a = I.replay) == null || a.checkPendingHeatmapsUrl()), !se() && s && o && o !== window.location.href && t && Kt.includes(t.type) && window.UserLeap("dismissActiveSurvey", N.PageChange);
548
+ const l = G();
549
+ l && (It(X) || (l.remove(), X = null, f = null));
550
+ })(), xt.getItem("sprig.isCapturingHeatmap") && ((a = I.replay) == null || a.checkPendingHeatmapsUrl()), !oe() && s && o && o !== window.location.href && t && Kt.includes(t.type) && window.UserLeap("dismissActiveSurvey", W.PageChange);
551
551
  }
552
- const gt = { capture: !0 }, Jt = () => {
553
- const t = window.UserLeap._config.interactiveEvents.filter((n) => _e(n, window.location.href)).map((n) => {
552
+ const wt = { capture: !0 }, Jt = () => {
553
+ const t = window.UserLeap._config.interactiveEvents.filter((n) => Xe(n, window.location.href)).map((n) => {
554
554
  const { name: s, properties: r } = n, { selector: i, innerText: o } = r;
555
555
  return i ? (a) => {
556
- if (Ve(a.target))
556
+ if (He(a.target))
557
557
  try {
558
558
  a.target.closest(i) && window.UserLeap("track", s);
559
559
  } catch {
560
560
  }
561
561
  return !1;
562
- } : (a) => (Ve(a.target) && a.target.innerText === o && window.UserLeap("track", s), !1);
562
+ } : (a) => (He(a.target) && a.target.innerText === o && window.UserLeap("track", s), !1);
563
563
  }), e = (n) => t.forEach((s) => s(n));
564
- window.UserLeap._config.interactiveEventsHandler = e, window.addEventListener("click", e, gt);
565
- }, mt = () => {
566
- window.UserLeap._config.interactiveEventsHandler && window.removeEventListener("click", window.UserLeap._config.interactiveEventsHandler, gt), delete window.UserLeap._config.interactiveEventsHandler;
564
+ window.UserLeap._config.interactiveEventsHandler = e, window.addEventListener("click", e, wt);
565
+ }, gt = () => {
566
+ window.UserLeap._config.interactiveEventsHandler && window.removeEventListener("click", window.UserLeap._config.interactiveEventsHandler, wt), delete window.UserLeap._config.interactiveEventsHandler;
567
567
  };
568
- function yt() {
568
+ function mt() {
569
569
  const t = D.getItemObject("userleap.ids");
570
570
  return t && t[window.UserLeap.envId] || {};
571
571
  }
572
- function ft() {
572
+ function yt() {
573
573
  if (window.previewMode)
574
574
  return;
575
575
  const t = D.getItemObject("sprig.anon.env.vid.map") || {}, e = t[window.UserLeap.envId];
576
- window.UserLeap.visitorId = e || Ze(), M.info("NewVid", { vid: window.UserLeap.visitorId }), x("vid", window.UserLeap.visitorId), e || (t[window.UserLeap.envId] = window.UserLeap.visitorId, D.setItemObject("sprig.anon.env.vid.map", t)), u.emit(w.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId });
576
+ window.UserLeap.visitorId = e || Ye(), T.info("NewVid", { vid: window.UserLeap.visitorId }), x("vid", window.UserLeap.visitorId), e || (t[window.UserLeap.envId] = window.UserLeap.visitorId, D.setItemObject("sprig.anon.env.vid.map", t)), u.emit(w.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId });
577
577
  }
578
- function vt(t, e, n, s) {
578
+ function ft(t, e, n, s) {
579
579
  var r, i;
580
580
  try {
581
581
  if (t.endsWith("mock_snippet.html"))
582
582
  return;
583
- M.info("PageView", { url: t });
583
+ T.info("PageView", { url: t });
584
584
  const o = window.UserLeap._config.pageUrlEvents;
585
585
  let a = !1;
586
586
  if (o && o.length)
587
- for (let d = 0; d < o.length && (a = _e(o[d], t), !a); d++)
587
+ for (let d = 0; d < o.length && (a = Xe(o[d], t), !a); d++)
588
588
  ;
589
589
  if (!a)
590
590
  return;
591
591
  window.UserLeap.debugMode && console.info("[DEBUG] Sprig trackPageView", t);
592
592
  const l = { url: t };
593
- s && (l.trackPageView = !0), window.UserLeap._queue.push(["track", wt, e, l, n]);
593
+ s && (l.trackPageView = !0), window.UserLeap._queue.push(["track", ut, e, l, n]);
594
594
  const c = (r = document == null ? void 0 : document.querySelector('meta[name="description"]')) == null ? void 0 : r.getAttribute("content");
595
595
  (i = I.replay) == null || i.RecordPageView({ ...c && { description: c }, url: t, referrer: document.referrer, pageTitle: document.title });
596
596
  } catch (o) {
@@ -608,21 +608,21 @@ function Qt() {
608
608
  })(t.replaceState)), ["hashchange", "popstate"].forEach((e) => window.addEventListener(e, ee, !0));
609
609
  }
610
610
  async function he(t, e) {
611
- const n = xe();
611
+ const n = Ee();
612
612
  t && !e && (window.UserLeap._config.mode = Gt);
613
- const s = De(z(window.UserLeap)), r = await T(function(i) {
614
- const o = new URL(O("1", [q], "questions"));
613
+ const s = _e(F(window.UserLeap)), r = await C(function(i) {
614
+ const o = new URL(R("1", [M], "questions"));
615
615
  return Object.entries(i || {}).forEach(([a, l]) => {
616
616
  l && o.searchParams.append(a, String(l));
617
617
  }), o.toString();
618
618
  }({ desktopDisplay: window.UserLeap._config.desktopDisplay, isMobile: s, previewLanguage: window.UserLeap._config.previewLanguage, surveyid: t == null ? void 0 : t.surveyId, surveytemplateid: t == null ? void 0 : t.surveyTemplateId, vid: n }), { shouldDropOnRateLimit: !0 });
619
619
  if (!r.ok)
620
620
  return r.reportError && r.error && (console.warn("[Sprig] (ERR-414) Failed to request questions from the server", r.error), window.UserLeap.reportError("getQuestions", r.error)), { success: !1, surveyState: "no survey" };
621
- if (r.json.delay && await et(r.json.delay), !r.json.isFeedback)
622
- return X(r.json, ke);
621
+ if (r.json.delay && await Ze(r.json.delay), !r.json.isFeedback)
622
+ return Y(r.json, Z);
623
623
  {
624
624
  const { feedbackLabel: i, productConfig: o, surveyUuid: a, feedbackCustomStyles: l } = r.json, { buttonTheme: c, placement: d, desktopDisplay: p } = o;
625
- lt({ customStyles: l, buttonTheme: c, desktopDisplay: p, eventId: 0, feedbackLabel: i, placement: d, surveyUuid: a, surveyId: t == null ? void 0 : t.surveyId }, r.json);
625
+ dt({ customStyles: l, buttonTheme: c, desktopDisplay: p, eventId: 0, feedbackLabel: i, placement: d, surveyUuid: a, surveyId: t == null ? void 0 : t.surveyId }, r.json);
626
626
  }
627
627
  }
628
628
  function Yt(t) {
@@ -644,10 +644,10 @@ const Xt = function(t) {
644
644
  if (!window.UserLeap)
645
645
  return;
646
646
  const e = async (r = {}) => {
647
- var U, h, L, k, C;
647
+ var U, h, L, E, O;
648
648
  const { userId: i, anonymousId: o, metadata: a = {}, properties: l, showSurveyCallback: c } = r;
649
649
  let { eventName: d } = r;
650
- if (window.UserLeap.debugMode && d !== wt && console.info("[DEBUG] Sprig track", r), t.mode === "test")
650
+ if (window.UserLeap.debugMode && d !== ut && console.info("[DEBUG] Sprig track", r), t.mode === "test")
651
651
  return;
652
652
  const p = D.getItem("sprig.previewKey") ?? void 0;
653
653
  if (t.requireUserIdForTracking && !window.UserLeap.userId && !i) {
@@ -659,9 +659,9 @@ const Xt = function(t) {
659
659
  const v = "[Sprig] - Invalid event name " + d;
660
660
  return console.warn(v), { success: !1, message: v, surveyState: "no survey" };
661
661
  }
662
- const y = ke ?? window.location.href;
663
- a.url || (a.url = y), x("trackStartUrl", y), (h = (U = window.UserLeap) == null ? void 0 : U._config) != null && h.optimizelyEnabled && (we(z(window.UserLeap)) || ne.getAndSetWebOptimizelyExperiments(), a.optimizelyExperiments = Object.assign({}, ne.getAllOptimizelyExperiments())), (k = (L = window.UserLeap) == null ? void 0 : L._config) != null && k.launchDarklyEnabled && (a.launchDarklyFlags = Ue.getAllLaunchDarklyVariations()), i && (window.UserLeap.userId = i), o && (window.UserLeap.partnerAnonymousId = o), l && (a.eventProperties = l), (C = I.replay) == null || C.RecordEvent({ name: d, url: a.url }), M.info("TrackEvent", { eventName: d });
664
- const g = window.UserLeap.delayingSurvey || st() ? await T(O("1", [F], "events/batch"), { body: JSON.stringify({ events: [{ event: d, metadata: a }], previewKey: p }), method: "POST", shouldDropOnRateLimit: !0 }) : await T(O("1", [F], "events"), { body: JSON.stringify({ event: d, metadata: a, previewKey: p }), method: "POST", shouldDropOnRateLimit: !0 });
662
+ const y = Z ?? window.location.href;
663
+ a.url || (a.url = y), x("trackStartUrl", y), (h = (U = window.UserLeap) == null ? void 0 : U._config) != null && h.optimizelyEnabled && (ue(F(window.UserLeap)) || ie.getAndSetWebOptimizelyExperiments(), a.optimizelyExperiments = Object.assign({}, ie.getAllOptimizelyExperiments())), (E = (L = window.UserLeap) == null ? void 0 : L._config) != null && E.launchDarklyEnabled && (a.launchDarklyFlags = Ue.getAllLaunchDarklyVariations()), i && (window.UserLeap.userId = i), o && (window.UserLeap.partnerAnonymousId = o), l && (a.eventProperties = l), (O = I.replay) == null || O.RecordEvent({ name: d, url: a.url }), T.info("TrackEvent", { eventName: d });
664
+ const g = window.UserLeap.delayingSurvey || ot() ? await C(R("1", [j], "events/batch"), { body: JSON.stringify({ events: [{ event: d, metadata: a }], previewKey: p }), method: "POST", shouldDropOnRateLimit: !0 }) : await C(R("1", [j], "events"), { body: JSON.stringify({ event: d, metadata: a, previewKey: p }), method: "POST", shouldDropOnRateLimit: !0 });
665
665
  if (!g.ok) {
666
666
  const v = "[Sprig] (ERR-421) Failed to track event";
667
667
  return g.reportError && (console.warn(v, g.error), g.error && window.UserLeap.reportError("track", g.error)), { success: !1, message: v, error: g.error, surveyState: "no survey" };
@@ -670,27 +670,24 @@ const Xt = function(t) {
670
670
  const m = g.json;
671
671
  m.invalidPreviewKey && D.removeItem("sprig.previewKey");
672
672
  const _ = a.trackPageView ? a.url : void 0;
673
- return m != null && m.feedbackButton && lt(m.feedbackButton, void 0, _), await async function(v, E) {
674
- var R, W;
673
+ return m != null && m.feedbackButton && dt(m.feedbackButton, void 0, _), await async function(v, k) {
674
+ var q, K;
675
675
  let A = !0;
676
- return !(E && ((R = v == null ? void 0 : v.json) != null && R.surveyId) && (window.UserLeap.delayingSurvey = !0, A = await E(v.json.surveyId), window.UserLeap.delayingSurvey = !1, !A)) && ((W = v == null ? void 0 : v.json) != null && W.delay && !window.UserLeap.isMobileSDK && (window.UserLeap.delayingSurvey = !0, await et(v.json.delay), window.UserLeap.delayingSurvey = !1), A);
677
- }(g, c) ? function(v, E) {
678
- const { pageUrlEvents: A, interactiveEvents: R, dismissOnPageChange: W } = window.UserLeap._config;
679
- if (!W)
676
+ return !(k && ((q = v == null ? void 0 : v.json) != null && q.surveyId) && (window.UserLeap.delayingSurvey = !0, A = await k(v.json.surveyId), window.UserLeap.delayingSurvey = !1, !A)) && ((K = v == null ? void 0 : v.json) != null && K.delay && !window.UserLeap.isMobileSDK && (window.UserLeap.delayingSurvey = !0, await Ze(v.json.delay), window.UserLeap.delayingSurvey = !1), A);
677
+ }(g, c) ? function(v) {
678
+ if (!window.UserLeap._config.dismissOnPageChange)
680
679
  return !0;
681
- const P = [];
682
- A && A.length && P.push(...A), R && R.length && P.push(...R);
683
- const re = v && P.find((J) => J.id === v);
684
- return re ? _e(re, window.location.href) : E === window.location.href;
685
- }(m.eventId, y) ? X(m, _) : { success: !1, message: "Study should not be displayed after page navigation", surveyState: "no survey" } : { success: !1, message: "[Sprig] Callback returned false, aborting rendering of survey", surveyState: "no survey" };
680
+ const k = new URL(v), A = new URL(Z ?? window.location.href);
681
+ return k.hostname === A.hostname && k.pathname === A.pathname;
682
+ }(y) ? Y(m, _) : { success: !1, message: "Study should not be displayed after page navigation", surveyState: "no survey" } : { success: !1, message: "[Sprig] Callback returned false, aborting rendering of survey", surveyState: "no survey" };
686
683
  }, n = (r, i) => {
687
684
  var a;
688
- const o = (a = r == null ? void 0 : r.querySelector(`[id="${Ae}"]`)) == null ? void 0 : a.contentDocument;
689
- o && oe({ document: o, elementId: "ul-custom-style", styleString: i });
690
- }, s = { displaySurvey: async (r) => (console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."), window.UserLeap("dismissActiveSurvey", N.Override), he({ surveyId: r }, !0)), _previewSurvey(r) {
691
- window.UserLeap("dismissActiveSurvey", N.Override), he({ surveyTemplateId: r }, !1);
685
+ const o = (a = r == null ? void 0 : r.querySelector(`[id="${xe}"]`)) == null ? void 0 : a.contentDocument;
686
+ o && ne({ document: o, elementId: "ul-custom-style", styleString: i });
687
+ }, s = { displaySurvey: async (r) => (console.warn("[Sprig] displaySurvey should only be used to debug your studies; not intended for production usage."), window.UserLeap("dismissActiveSurvey", W.Override), he({ surveyId: r }, !0)), _previewSurvey(r) {
688
+ window.UserLeap("dismissActiveSurvey", W.Override), he({ surveyTemplateId: r }, !1);
692
689
  }, _reviewSurvey(r) {
693
- window.UserLeap("dismissActiveSurvey", N.Override), he({ surveyId: r }, !1);
690
+ window.UserLeap("dismissActiveSurvey", W.Override), he({ surveyId: r }, !1);
694
691
  }, previewSurvey(r) {
695
692
  s._previewSurvey(r);
696
693
  }, reviewSurvey(r) {
@@ -701,7 +698,7 @@ const Xt = function(t) {
701
698
  window.UserLeap._queue.unpause();
702
699
  }, setVisitorToken() {
703
700
  console.warn("[Sprig] setVisitorToken is deprecated.");
704
- }, dismissActiveSurvey(r = N.API) {
701
+ }, dismissActiveSurvey(r = W.API) {
705
702
  window.UserLeap.container && u.emit(w.SurveyWillClose, { name: w.SurveyWillClose, initiator: r, "survey.id": parseInt(window.UserLeap.container.dataset.studyId) });
706
703
  }, async setAttribute(r, i) {
707
704
  if (!r || !i && i !== 0 && i !== !1) {
@@ -728,16 +725,16 @@ const Xt = function(t) {
728
725
  return console.warn(d), { success: !1, message: d };
729
726
  }
730
727
  if (a) {
731
- a.email && !a[Q] && (a[Q] = a.email, delete a.email);
728
+ a.email && !a[J] && (a[J] = a.email, delete a.email);
732
729
  const d = Object.keys(a);
733
730
  for (const p of d)
734
- a[p] === ue[p] && delete a[p];
731
+ a[p] === pe[p] && delete a[p];
735
732
  }
736
733
  if (!(a && Object.keys(a).length !== 0 || i && window.UserLeap.userId !== i || o && window.UserLeap.partnerAnonymousId !== o))
737
734
  return { success: !0 };
738
735
  const l = {};
739
736
  let c;
740
- return i && (l.userId = window.UserLeap.userId = i), o && (l.partnerAnonymousId = window.UserLeap.partnerAnonymousId = o), a && Object.keys(a).length > 0 ? (c = await T(O("1", [q, F], "attributes"), { body: JSON.stringify(a), method: "PUT" }), c.ok ? Object.assign(ue, a) : c.reportError && (console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed", c.error), c.error && window.UserLeap.reportError("identifyAndSetAttributes", c.error))) : c = await T(O("1", [q, F]), { body: JSON.stringify(l), method: "PUT" }), a && a[Q] && (window.UserLeap.email = a[Q]), c.ok && (i && x("uid", i), o && x("aid", o)), { success: !!c.ok };
737
+ return i && (l.userId = window.UserLeap.userId = i), o && (l.partnerAnonymousId = window.UserLeap.partnerAnonymousId = o), a && Object.keys(a).length > 0 ? (c = await C(R("1", [M, j], "attributes"), { body: JSON.stringify(a), method: "PUT" }), c.ok ? Object.assign(pe, a) : c.reportError && (console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed", c.error), c.error && window.UserLeap.reportError("identifyAndSetAttributes", c.error))) : c = await C(R("1", [M, j]), { body: JSON.stringify(l), method: "PUT" }), a && a[J] && (window.UserLeap.email = a[J]), c.ok && (i && x("uid", i), o && x("aid", o)), { success: !!c.ok };
741
738
  }, async removeAttributes(r) {
742
739
  if (window.UserLeap.debugMode && console.info("[DEBUG] Sprig removeAttributes", r), t.mode === "test")
743
740
  return;
@@ -749,7 +746,7 @@ const Xt = function(t) {
749
746
  const o = "[Sprig] - Skipping tracking without userId";
750
747
  return console.warn(o), { success: !1, message: o };
751
748
  }
752
- const i = await T(O("1", [q, F], "attributes"), { body: JSON.stringify({ delete: r }), method: "DELETE" });
749
+ const i = await C(R("1", [M, j], "attributes"), { body: JSON.stringify({ delete: r }), method: "DELETE" });
753
750
  return !i.ok && i.reportError && (console.warn("[Sprig] (ERR-433) Remove attributes failed", i.error), i.error && window.UserLeap.reportError("removeAttributes", i.error)), { success: !!i.ok };
754
751
  }, async addSurveyListener(r) {
755
752
  u.on(w.SurveyLifeCycle, r);
@@ -772,7 +769,7 @@ const Xt = function(t) {
772
769
  if (t.mode === "test" || r === window.UserLeap.userId)
773
770
  return;
774
771
  window.UserLeap.userId = r;
775
- const i = window.UserLeap.visitorId, o = await T(O("1", [q, F]), { body: JSON.stringify({ userId: r }), method: "PUT" });
772
+ const i = window.UserLeap.visitorId, o = await C(R("1", [M, j]), { body: JSON.stringify({ userId: r }), method: "PUT" });
776
773
  o.ok ? (i !== window.UserLeap.visitorId && ((a = I.replay) == null || a.clearUserReplayData()), x("uid", r)) : o.reportError && (console.warn("[Sprig] (ERR-420) Failed to set user id", o.error), o.error && window.UserLeap.reportError("setUserId", o.error));
777
774
  }, async setPartnerAnonymousId(r) {
778
775
  if (window.UserLeap.debugMode && console.info("[DEBUG] Sprig setPartnerAnonymousId", r), r == null) {
@@ -781,9 +778,9 @@ const Xt = function(t) {
781
778
  }
782
779
  return window.UserLeap.partnerAnonymousId = r, x("aid", r), { success: !0 };
783
780
  }, track: async (r, i, o = {}, a = void 0) => e({ eventName: r, properties: i, metadata: o, showSurveyCallback: a }), identifyAndTrack: async (r) => await e(r), trackPageView(r, i = void 0, o = void 0, a = !0) {
784
- ke = r, vt(r, i, o, a);
781
+ Z = r, ft(r, i, o, a);
785
782
  }, applyFeedbackStyles({ button: r = "", view: i = "" }) {
786
- window.UserLeap.feedbackCustomStyles = i, document.getElementById("sprig-feedback-style") && oe({ document, elementId: "ul-custom-style", styleString: r, nonce: window.UserLeap.styleNonce }), n(document.querySelector(".ul-container-feedback"), i);
783
+ window.UserLeap.feedbackCustomStyles = i, document.getElementById("sprig-feedback-style") && ne({ document, elementId: "ul-custom-style", styleString: r, nonce: window.UserLeap.styleNonce }), n(document.querySelector(".ul-container-feedback"), i);
787
784
  }, applyStyles(r) {
788
785
  window.UserLeap.customStyles = r, n(window.UserLeap.container, r);
789
786
  }, setWindowDimensions(r, i) {
@@ -795,15 +792,15 @@ const Xt = function(t) {
795
792
  l && (window.UserLeap.useMobileStyling && ((c = window.UserLeap.windowDimensions) != null && c.width && (l.style.width = `${window.UserLeap.windowDimensions.width}px`), (d = window.UserLeap.windowDimensions) != null && d.height && (l.style.maxHeight = window.UserLeap.windowDimensions.height - 20 + "px"), l.contentDocument && (l.style.height = String(Ft(l.contentDocument)[0]) + "px")), u.emit(w.SurveyDimensions, { name: w.SurveyDimensions, contentFrameWidth: l.clientWidth, contentFrameHeight: l.clientHeight, "survey.id": parseInt(window.UserLeap.container.dataset.studyId) }));
796
793
  }, logoutUser() {
797
794
  var r;
798
- window.UserLeap.debugMode && console.info("[DEBUG] Sprig logout"), M.info("LogOut", { vid: window.UserLeap.visitorId, userId: window.UserLeap.userId }), window.UserLeap.visitorId = null, window.UserLeap.userId = null, window.UserLeap.partnerAnonymousId = null, window.UserLeap.token = null, window.UserLeap.email = null, D.removeItem("userleap.ids"), window.UserLeap._queue.isPaused() && window.UserLeap._queue.empty(), ft(), (r = I.replay) == null || r.clearUserReplayData(), window.UserLeap._queue.unpause();
795
+ window.UserLeap.debugMode && console.info("[DEBUG] Sprig logout"), T.info("LogOut", { vid: window.UserLeap.visitorId, userId: window.UserLeap.userId }), window.UserLeap.visitorId = null, window.UserLeap.userId = null, window.UserLeap.partnerAnonymousId = null, window.UserLeap.token = null, window.UserLeap.email = null, D.removeItem("userleap.ids"), window.UserLeap._queue.isPaused() && window.UserLeap._queue.empty(), yt(), (r = I.replay) == null || r.clearUserReplayData(), window.UserLeap._queue.unpause();
799
796
  }, teardown() {
800
- ["hashchange", "popstate"].forEach((r) => window.removeEventListener(r, ee, !0)), window.UserLeap._config.interactiveEvents && mt(), window.UserLeap("dismissActiveSurvey", N.API), delete window.UserLeap, delete window.Sprig, delete window._Sprig;
797
+ ["hashchange", "popstate"].forEach((r) => window.removeEventListener(r, ee, !0)), window.UserLeap._config.interactiveEvents && gt(), window.UserLeap("dismissActiveSurvey", W.API), delete window.UserLeap, delete window.Sprig, delete window._Sprig;
801
798
  }, integrateOptimizely(r, i = !0) {
802
799
  var o, a;
803
800
  if ((a = (o = window.UserLeap) == null ? void 0 : o._config) != null && a.optimizelyEnabled)
804
801
  try {
805
802
  const l = typeof r == "string" ? JSON.parse(r) : r;
806
- ne.setOptimizelyExperiment(l, i);
803
+ ie.setOptimizelyExperiment(l, i);
807
804
  } catch (l) {
808
805
  console.warn("[Sprig] Error with integrating Optimizely data"), l instanceof Error && window.UserLeap.reportError("integrateOptimizely", l);
809
806
  }
@@ -820,7 +817,7 @@ const Xt = function(t) {
820
817
  }, importLaunchDarklyData(r) {
821
818
  var i, o;
822
819
  (o = (i = window.UserLeap) == null ? void 0 : i._config) != null && o.launchDarklyEnabled ? Ue.setLDFlagsVariations(r) : console.warn("[SPRIG] LaunchDarkly integration is currently not enabled for your product.");
823
- }, setVisitorAttribute: (r, i) => (console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"), s.setAttribute(r, i)), setEmail: async (r) => s.setAttribute(Q, r), setVisitorEmail: async (r) => (console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"), s.setEmail(r)), _generateVideoUploadUrl: async (r) => async function(i) {
820
+ }, setVisitorAttribute: (r, i) => (console.warn("[Sprig] setVisitorAttribute is deprecated. Please use setAttribute"), s.setAttribute(r, i)), setEmail: async (r) => s.setAttribute(J, r), setVisitorEmail: async (r) => (console.warn("[Sprig] setVisitorEmail is deprecated. Please use setEmail"), s.setEmail(r)), _generateVideoUploadUrl: async (r) => async function(i) {
824
821
  var a;
825
822
  if (!i)
826
823
  return;
@@ -839,13 +836,13 @@ const Xt = function(t) {
839
836
  Dt(r, i);
840
837
  }, _completeSessionReplay: async ({ surveyId: r, responseGroupUuid: i, eventDigest: o }) => {
841
838
  var a;
842
- return I.replay ? (a = I.replay) == null ? void 0 : a._completeSessionReplay({ surveyId: r, responseGroupUuid: i, eventDigest: o, headers: z(window.UserLeap) }) : (window.UserLeap.reportError("_completeSessionReplay", new Error("Replay module not registered")), !1);
839
+ return I.replay ? (a = I.replay) == null ? void 0 : a._completeSessionReplay({ surveyId: r, responseGroupUuid: i, eventDigest: o, headers: F(window.UserLeap) }) : (window.UserLeap.reportError("_completeSessionReplay", new Error("Replay module not registered")), !1);
843
840
  } };
844
841
  Object.assign(window.UserLeap, s);
845
842
  };
846
843
  async function Zt(t, e, n = {}, s = {}) {
847
- const r = window.__cfg && window.__cfg.mode, i = xe(), o = window.UserLeap.envId, a = window.document.documentElement, l = { mode: r, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: a.clientWidth, clientHeight: a.clientHeight, location: window.location.href, language: window.navigator.language, ...n }, c = { action: t, breadcrumbs: M.breadcrumbs, err: { message: `${e == null ? void 0 : e.name} - ${e == null ? void 0 : e.message}`, stack: e == null ? void 0 : e.stack }, meta: l, vid: i, envId: o, ...s };
848
- (await T(O("1", null, "errors"), { method: "POST", headers: { "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, body: JSON.stringify(c), shouldDropOnRateLimit: !0 })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", e);
844
+ const r = window.__cfg && window.__cfg.mode, i = Ee(), o = window.UserLeap.envId, a = window.document.documentElement, l = { mode: r, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: a.clientWidth, clientHeight: a.clientHeight, location: Z ?? window.location.href, language: window.navigator.language, ...n }, c = { action: t, breadcrumbs: T.breadcrumbs, err: { message: `${e == null ? void 0 : e.name} - ${e == null ? void 0 : e.message}`, stack: e == null ? void 0 : e.stack }, meta: l, vid: i, envId: o, ...s };
845
+ (await C(R("1", null, "errors"), { method: "POST", headers: { "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, body: JSON.stringify(c), shouldDropOnRateLimit: !0 })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", e);
849
846
  }
850
847
  function er(t = {}) {
851
848
  var s;
@@ -864,7 +861,7 @@ function er(t = {}) {
864
861
  window.UserLeap.envId = window.UserLeap.appId;
865
862
  }
866
863
  window.UserLeap.debugMode && console.info("[DEBUG] Sprig debug mode enabled");
867
- const r = yt(), i = window.UserLeap.sampleRate;
864
+ const r = mt(), i = window.UserLeap.sampleRate;
868
865
  let o = r.sampled;
869
866
  if (i) {
870
867
  if (o === null && (o = Math.random() < i, x("sampled", o)), !o)
@@ -877,32 +874,32 @@ function er(t = {}) {
877
874
  for (let b = 0; b < a.length; b++)
878
875
  window.UserLeap._queue.push(a[b]);
879
876
  const l = r.token;
880
- l ? (window.UserLeap.token = l, window.UserLeap.visitorId = r.vid ?? null, window.UserLeap.userId = r.uid ?? null, window.UserLeap.partnerAnonymousId = r.aid ?? null) : ft();
881
- const c = we(z(window.UserLeap));
877
+ l ? (window.UserLeap.token = l, window.UserLeap.visitorId = r.vid ?? null, window.UserLeap.userId = r.uid ?? null, window.UserLeap.partnerAnonymousId = r.aid ?? null) : yt();
878
+ const c = ue(F(window.UserLeap));
882
879
  (y = window.SprigLoggerCallback) == null || y.call(window, "Sprig fetching config");
883
880
  const d = await async function(b) {
884
- var k, C;
885
- const U = z(window.UserLeap);
886
- document.addEventListener("securitypolicyviolation", qe);
887
- const h = await Xe(O("1", [q], "config"), { headers: U });
888
- if (document.removeEventListener("securitypolicyviolation", qe), !h.ok)
889
- return (k = window.SprigLoggerCallback) == null || k.call(window, "Sprig config fetch failed"), h.reportError && (console.warn("[Sprig] (ERR-422) Failed to load configuration", h.error), h.error && window.UserLeap.reportError("applyRemoteConfig", h.error)), ze("Disabled: failed to fetch configuration"), b;
881
+ var E, O;
882
+ const U = F(window.UserLeap);
883
+ document.addEventListener("securitypolicyviolation", Me);
884
+ const h = await Qe(R("1", [M], "config"), { headers: U });
885
+ if (document.removeEventListener("securitypolicyviolation", Me), !h.ok)
886
+ return (E = window.SprigLoggerCallback) == null || E.call(window, "Sprig config fetch failed"), h.reportError && (console.warn("[Sprig] (ERR-422) Failed to load configuration", h.error), h.error && window.UserLeap.reportError("applyRemoteConfig", h.error)), Fe("Disabled: failed to fetch configuration"), b;
890
887
  const L = h.json;
891
- return L != null && L.disabled ? ((C = window.SprigLoggerCallback) == null || C.call(window, "Sprig config fetch disabled"), ze(`Disabled: ${L.disabled}`), { disabled: L.disabled }) : Object.assign({}, L, b);
888
+ return L != null && L.disabled ? ((O = window.SprigLoggerCallback) == null || O.call(window, "Sprig config fetch disabled"), Fe(`Disabled: ${L.disabled}`), { disabled: L.disabled }) : Object.assign({}, L, b);
892
889
  }(t);
893
890
  (g = window.SprigLoggerCallback) == null || g.call(window, "Sprig fetched config"), $t({ isWeb: !c, reportingIntervalSeconds: d.metricsReportingEnabled || d.mobileMetricsReportingEnabled ? d.metricsReportingIntervalSeconds : 0, thresholds: d.metricThresholds, postMetrics: async (b) => {
894
891
  var U;
895
- await T(O("1", [q], "metrics"), { body: b, method: "POST", headers: { "x-ul-replay-enabled": `${!!((U = I.replay) != null && U.isReplayRecording())}` }, shouldDropOnRateLimit: !0 });
892
+ await C(R("1", [M], "metrics"), { body: b, method: "POST", headers: { "x-ul-replay-enabled": `${!!((U = I.replay) != null && U.isReplayRecording())}` }, shouldDropOnRateLimit: !0 });
896
893
  } }), await ((m = I.replay) == null ? void 0 : m.initializeReplay({ maxReplayDurationSeconds: d.maxReplayDurationSeconds, maxInflightRequests: window.UserLeap.maxInflightReplayRequests ?? 2, replaySettings: d.replaySettings })), Xt(d), await Yt(d), window.UserLeap._queue.unpause(), (_ = window.SprigLoggerCallback) == null || _.call(window, "SdkReady"), u.emit(w.SDKReady, { mobileMetricsReportingEnabled: !!d.mobileMetricsReportingEnabled, metricsReportingInterval: d.metricsReportingIntervalSeconds || 0, metricsThresholds: d.metricThresholds || [], maxMobileReplayDurationSeconds: d.maxMobileReplayDurationSeconds, mobileReplaySettings: d.mobileReplaySettings }), u.emit(w.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId }), u.on(w.VisitorIDUpdated, () => {
897
- for (const b in ue)
898
- delete ue[b];
894
+ for (const b in pe)
895
+ delete pe[b];
899
896
  });
900
897
  }
901
898
  window.UserLeap.UPDATES = te, window.UserLeap("setPreviewKey", e), document.readyState === "complete" ? n() : window.attachEvent ? window.attachEvent("onload", n) : window.addEventListener("load", () => {
902
899
  n();
903
900
  }, !1);
904
901
  }
905
- class Ee {
902
+ class ke {
906
903
  constructor() {
907
904
  this.UPDATES = te;
908
905
  }
@@ -970,31 +967,31 @@ class Ee {
970
967
  window.Sprig("teardown");
971
968
  }
972
969
  }
973
- const Ye = { configure: (t) => {
970
+ const Je = { configure: (t) => {
974
971
  if (!t.envId && !t.environmentId)
975
972
  throw new Error("Initialization Error: Sprig configure requires an environmentId");
976
973
  if (t.envId || (t.envId = t.environmentId ?? ""), t.installationMethod = "web-npm", window.Sprig)
977
974
  return window.Sprig;
978
975
  window.Sprig = function() {
979
976
  window.Sprig._queue.push(arguments);
980
- }, Object.getOwnPropertyNames(Ee.prototype).map((n) => {
981
- n !== "constructor" && (window.Sprig[n] = Ee.prototype[n]);
977
+ }, Object.getOwnPropertyNames(ke.prototype).map((n) => {
978
+ n !== "constructor" && (window.Sprig[n] = ke.prototype[n]);
982
979
  });
983
980
  const e = window.Sprig;
984
981
  return e.appId = t.envId, e._queue = [], window.UserLeap = e, er(t), window.Sprig;
985
- } }, dr = { sprig: Ye, SprigAPI: Ee, configure: Ye.configure };
982
+ } }, dr = { sprig: Je, SprigAPI: ke, configure: Je.configure };
986
983
  export {
987
984
  ir as A,
988
985
  Rt as C,
989
986
  At as D,
990
987
  sr as E,
991
- Ee as S,
988
+ ke as S,
992
989
  Ft as a,
993
990
  or as b,
994
991
  dr as c,
995
992
  nr as d,
996
- oe as e,
997
- G as i,
993
+ ne as e,
994
+ $ as i,
998
995
  ar as r,
999
- Ye as s
996
+ Je as s
1000
997
  };