@tracelog/lib 2.8.5-rc.106.6 → 2.8.5
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/browser/tracelog.esm.js +118 -122
- package/dist/browser/tracelog.esm.js.map +1 -1
- package/dist/browser/tracelog.js +2 -2
- package/dist/browser/tracelog.js.map +1 -1
- package/dist/public-api.cjs +2 -2
- package/dist/public-api.cjs.map +1 -1
- package/dist/public-api.js +2 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +2 -8
- package/dist/browser/tracelog-shopify-pixel.iife.js +0 -1
- package/dist/browser/tracelog-shopify-pixel.iife.js.map +0 -1
- package/dist/pixel/index.cjs +0 -3
- package/dist/pixel/index.cjs.map +0 -1
- package/dist/pixel/index.d.mts +0 -138
- package/dist/pixel/index.d.ts +0 -138
- package/dist/pixel/index.js +0 -3
- package/dist/pixel/index.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
const hr = 9e5;
|
|
2
|
+
const fr = 120, mr = 49152, gr = 100, Er = 500, pr = 200;
|
|
3
|
+
const Sr = 1e3, Tr = 500, Ir = 1e3;
|
|
4
4
|
const b = "data-tlog", bt = [
|
|
5
5
|
"button",
|
|
6
6
|
"a",
|
|
@@ -99,7 +99,7 @@ class ie extends Error {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
var u = /* @__PURE__ */ ((r) => (r.PAGE_VIEW = "page_view", r.CLICK = "click", r.SCROLL = "scroll", r.SESSION_START = "session_start", r.CUSTOM = "custom", r.WEB_VITALS = "web_vitals", r.ERROR = "error", r.VIEWPORT_VISIBLE = "viewport_visible", r))(u || {}), Z = /* @__PURE__ */ ((r) => (r.UP = "up", r.DOWN = "down", r))(Z || {}), B = /* @__PURE__ */ ((r) => (r.JS_ERROR = "js_error", r.PROMISE_REJECTION = "promise_rejection", r))(B || {}), ne = /* @__PURE__ */ ((r) => (r.QA = "qa", r))(ne || {});
|
|
102
|
-
const
|
|
102
|
+
const vr = (r) => r.type === u.SCROLL && "scroll_data" in r && r.scroll_data.is_primary === !0, _r = (r) => r.type === u.SCROLL && "scroll_data" in r && r.scroll_data.is_primary === !1;
|
|
103
103
|
class j extends Error {
|
|
104
104
|
constructor(e, t, s) {
|
|
105
105
|
super(e), this.errorCode = t, this.layer = s, this.name = this.constructor.name, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
@@ -127,7 +127,7 @@ class N extends j {
|
|
|
127
127
|
super(e, "INTEGRATION_INVALID", t);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class yr extends j {
|
|
131
131
|
constructor(e, t, s = "runtime") {
|
|
132
132
|
super(e, "INITIALIZATION_TIMEOUT", s), this.timeoutMs = t;
|
|
133
133
|
}
|
|
@@ -254,7 +254,7 @@ const xt = () => {
|
|
|
254
254
|
/:\/\/[^:/]+:([^@]+)@/gi,
|
|
255
255
|
// Sensitive URL query parameters (token=, password=, auth=, secret=, api_key=, etc.)
|
|
256
256
|
/[?&](token|password|passwd|auth|secret|secret_key|private_key|auth_key|api_key|apikey|access_token)=[^&\s]+/gi
|
|
257
|
-
], Xe = 500, Ge = 2e3, je = 5e3, ee = 50, Gt = ee * 2, lt = 1, jt = 1e3,
|
|
257
|
+
], Xe = 500, Ge = 2e3, je = 5e3, ee = 50, Gt = ee * 2, lt = 1, jt = 1e3, zt = 10, ze = 5e3, Kt = 6e4, Qt = 64, wr = {
|
|
258
258
|
LCP: 2500,
|
|
259
259
|
// Good: ≤ 2.5s
|
|
260
260
|
FCP: 1800,
|
|
@@ -266,7 +266,7 @@ const xt = () => {
|
|
|
266
266
|
TTFB: 800,
|
|
267
267
|
// Good: ≤ 800ms
|
|
268
268
|
LONG_TASK: 50
|
|
269
|
-
},
|
|
269
|
+
}, Ke = {
|
|
270
270
|
LCP: 2500,
|
|
271
271
|
// Needs improvement: > 2.5s (same as good boundary)
|
|
272
272
|
FCP: 1800,
|
|
@@ -296,13 +296,13 @@ const xt = () => {
|
|
|
296
296
|
return { LCP: 0, FCP: 0, CLS: 0, INP: 0, TTFB: 0, LONG_TASK: 0 };
|
|
297
297
|
// Track everything
|
|
298
298
|
case "needs-improvement":
|
|
299
|
-
return
|
|
299
|
+
return Ke;
|
|
300
300
|
case "poor":
|
|
301
301
|
return Yt;
|
|
302
302
|
default:
|
|
303
|
-
return
|
|
303
|
+
return Ke;
|
|
304
304
|
}
|
|
305
|
-
}, qt = 1e3, Jt = 50, Zt = "2.8.
|
|
305
|
+
}, qt = 1e3, Jt = 50, Zt = "2.8.4", es = Zt, ct = () => typeof window < "u" && typeof sessionStorage < "u", ts = () => {
|
|
306
306
|
try {
|
|
307
307
|
const r = new URLSearchParams(window.location.search);
|
|
308
308
|
r.delete(rt);
|
|
@@ -1894,7 +1894,7 @@ class Ze extends _ {
|
|
|
1894
1894
|
}
|
|
1895
1895
|
logPermanentError(e, t) {
|
|
1896
1896
|
const s = Date.now(), i = `${t.statusCode ?? "unknown"}:${t.responseCode ?? ""}`;
|
|
1897
|
-
(!this.lastPermanentErrorLog || this.lastPermanentErrorLog.key !== i || s - this.lastPermanentErrorLog.timestamp >=
|
|
1897
|
+
(!this.lastPermanentErrorLog || this.lastPermanentErrorLog.key !== i || s - this.lastPermanentErrorLog.timestamp >= Kt) && (a("error", `${e}${this.integrationId ? ` [${this.integrationId}]` : ""}`, {
|
|
1898
1898
|
data: { status: t.statusCode, code: t.responseCode, message: t.message }
|
|
1899
1899
|
}), this.lastPermanentErrorLog = { key: i, timestamp: s });
|
|
1900
1900
|
}
|
|
@@ -4180,42 +4180,38 @@ class Cs extends _ {
|
|
|
4180
4180
|
});
|
|
4181
4181
|
}
|
|
4182
4182
|
}
|
|
4183
|
-
const Rs = "tracelog_session_id"
|
|
4184
|
-
class
|
|
4183
|
+
const Rs = "tracelog_session_id";
|
|
4184
|
+
class Ns extends _ {
|
|
4185
4185
|
visibilityHandler = null;
|
|
4186
|
-
|
|
4186
|
+
lastSyncedSessionId = null;
|
|
4187
4187
|
activate() {
|
|
4188
4188
|
this.cleanupVisibilityListener(), this.syncCartAttribute(), this.setupVisibilityListener();
|
|
4189
4189
|
}
|
|
4190
4190
|
deactivate() {
|
|
4191
|
-
this.cleanupVisibilityListener(), this.
|
|
4191
|
+
this.cleanupVisibilityListener(), this.lastSyncedSessionId = null;
|
|
4192
4192
|
}
|
|
4193
|
-
/** Re-syncs cart
|
|
4193
|
+
/** Re-syncs the cart attribute when session rotates (called by App on SESSION_START). */
|
|
4194
4194
|
onSessionChange() {
|
|
4195
4195
|
this.syncCartAttribute();
|
|
4196
4196
|
}
|
|
4197
4197
|
syncCartAttribute() {
|
|
4198
4198
|
const e = this.get("sessionId");
|
|
4199
|
-
|
|
4200
|
-
const t = this.get("userId"), s = typeof t == "string" && t.length > 0 ? t : "", i = `${e}|${s}`;
|
|
4201
|
-
i !== this.lastSyncedKey && (this.lastSyncedKey = i, this.postCartUpdate(e, s));
|
|
4199
|
+
!e || e === this.lastSyncedSessionId || (this.lastSyncedSessionId = e, this.postCartUpdate(e));
|
|
4202
4200
|
}
|
|
4203
|
-
postCartUpdate(e
|
|
4204
|
-
const s = { [Rs]: e };
|
|
4205
|
-
t.length > 0 && (s[Ns] = t);
|
|
4201
|
+
postCartUpdate(e) {
|
|
4206
4202
|
try {
|
|
4207
4203
|
fetch("/cart/update.js", {
|
|
4208
4204
|
method: "POST",
|
|
4209
4205
|
headers: { "Content-Type": "application/json" },
|
|
4210
|
-
body: JSON.stringify({ attributes:
|
|
4206
|
+
body: JSON.stringify({ attributes: { [Rs]: e } }),
|
|
4211
4207
|
credentials: "same-origin"
|
|
4212
|
-
}).then((
|
|
4213
|
-
|
|
4208
|
+
}).then((t) => {
|
|
4209
|
+
t.ok || (this.lastSyncedSessionId = null, a("debug", "Shopify cart attribute update failed", { data: { status: t.status } }));
|
|
4214
4210
|
}).catch(() => {
|
|
4215
|
-
this.
|
|
4211
|
+
this.lastSyncedSessionId = null, a("debug", "Shopify cart attribute update failed");
|
|
4216
4212
|
});
|
|
4217
4213
|
} catch {
|
|
4218
|
-
this.
|
|
4214
|
+
this.lastSyncedSessionId = null, a("debug", "Shopify cart attribute update failed");
|
|
4219
4215
|
}
|
|
4220
4216
|
}
|
|
4221
4217
|
setupVisibilityListener() {
|
|
@@ -4227,7 +4223,7 @@ class Os extends _ {
|
|
|
4227
4223
|
this.visibilityHandler && (document.removeEventListener("visibilitychange", this.visibilityHandler), this.visibilityHandler = null);
|
|
4228
4224
|
}
|
|
4229
4225
|
}
|
|
4230
|
-
class
|
|
4226
|
+
class Os {
|
|
4231
4227
|
storage;
|
|
4232
4228
|
sessionStorageRef;
|
|
4233
4229
|
fallbackStorage = /* @__PURE__ */ new Map();
|
|
@@ -4510,7 +4506,7 @@ class Ps {
|
|
|
4510
4506
|
this.fallbackSessionStorage.delete(e);
|
|
4511
4507
|
}
|
|
4512
4508
|
}
|
|
4513
|
-
class
|
|
4509
|
+
class Ps extends _ {
|
|
4514
4510
|
eventManager;
|
|
4515
4511
|
reportedByNav = /* @__PURE__ */ new Map();
|
|
4516
4512
|
navigationHistory = [];
|
|
@@ -4609,7 +4605,7 @@ class Ds extends _ {
|
|
|
4609
4605
|
}
|
|
4610
4606
|
async initWebVitals() {
|
|
4611
4607
|
try {
|
|
4612
|
-
const { onLCP: e, onCLS: t, onFCP: s, onTTFB: i, onINP: n } = await Promise.resolve().then(() =>
|
|
4608
|
+
const { onLCP: e, onCLS: t, onFCP: s, onTTFB: i, onINP: n } = await Promise.resolve().then(() => ur), o = (l) => (c) => {
|
|
4613
4609
|
const d = Number(c.value.toFixed(2));
|
|
4614
4610
|
this.sendVital({ type: l, value: d });
|
|
4615
4611
|
};
|
|
@@ -4779,11 +4775,11 @@ class ae extends _ {
|
|
|
4779
4775
|
const e = Date.now();
|
|
4780
4776
|
if (e < this.burstBackoffUntil)
|
|
4781
4777
|
return !1;
|
|
4782
|
-
if (e - this.burstWindowStart > jt && (this.errorBurstCounter = 0, this.burstWindowStart = e), this.errorBurstCounter++, this.errorBurstCounter >
|
|
4783
|
-
return this.burstBackoffUntil = e +
|
|
4778
|
+
if (e - this.burstWindowStart > jt && (this.errorBurstCounter = 0, this.burstWindowStart = e), this.errorBurstCounter++, this.errorBurstCounter > zt)
|
|
4779
|
+
return this.burstBackoffUntil = e + ze, a("debug", "Error burst detected - entering cooldown", {
|
|
4784
4780
|
data: {
|
|
4785
4781
|
errorsInWindow: this.errorBurstCounter,
|
|
4786
|
-
cooldownMs:
|
|
4782
|
+
cooldownMs: ze
|
|
4787
4783
|
}
|
|
4788
4784
|
}), !1;
|
|
4789
4785
|
const s = this.get("config").errorSampling ?? lt;
|
|
@@ -4873,7 +4869,7 @@ class ae extends _ {
|
|
|
4873
4869
|
}
|
|
4874
4870
|
}
|
|
4875
4871
|
}
|
|
4876
|
-
class
|
|
4872
|
+
class Ds extends _ {
|
|
4877
4873
|
isInitialized = !1;
|
|
4878
4874
|
suppressNextScrollTimer = null;
|
|
4879
4875
|
pageUnloadHandler = null;
|
|
@@ -4896,7 +4892,7 @@ class ks extends _ {
|
|
|
4896
4892
|
async init(e = {}) {
|
|
4897
4893
|
if (this.isInitialized)
|
|
4898
4894
|
return { sessionId: this.get("sessionId") ?? "" };
|
|
4899
|
-
this.managers.storage = new
|
|
4895
|
+
this.managers.storage = new Os();
|
|
4900
4896
|
try {
|
|
4901
4897
|
this.setupState(e);
|
|
4902
4898
|
const t = e.integrations?.custom?.headers ?? {}, s = e.integrations?.custom?.fetchCredentials ?? "include";
|
|
@@ -5243,10 +5239,10 @@ class ks extends _ {
|
|
|
5243
5239
|
this.set("suppressNextScroll", !1);
|
|
5244
5240
|
}, 500);
|
|
5245
5241
|
};
|
|
5246
|
-
if (this.handlers.pageView = new Ls(this.managers.event, t), this.handlers.pageView.startTracking(), this.handlers.click = new As(this.managers.event), this.handlers.click.startTracking(), this.handlers.scroll = new Ms(this.managers.event), this.handlers.scroll.startTracking(), this.handlers.performance = new
|
|
5242
|
+
if (this.handlers.pageView = new Ls(this.managers.event, t), this.handlers.pageView.startTracking(), this.handlers.click = new As(this.managers.event), this.handlers.click.startTracking(), this.handlers.scroll = new Ms(this.managers.event), this.handlers.scroll.startTracking(), this.handlers.performance = new Ps(this.managers.event), this.handlers.performance.startTracking().catch((s) => {
|
|
5247
5243
|
a("warn", "Failed to start performance tracking", { error: s });
|
|
5248
5244
|
}), this.handlers.error = new ae(this.managers.event), this.handlers.error.startTracking(), e.viewport && (this.handlers.viewport = new Cs(this.managers.event), this.handlers.viewport.startTracking()), e.integrations?.tracelog?.shopify) {
|
|
5249
|
-
const s = new
|
|
5245
|
+
const s = new Ns();
|
|
5250
5246
|
s.activate(), this.integrationInstances.shopifyCartLinker = s, this.emitter.on(se.EVENT, (i) => {
|
|
5251
5247
|
i.type === u.SESSION_START && s.onSessionChange();
|
|
5252
5248
|
});
|
|
@@ -5255,9 +5251,9 @@ class ks extends _ {
|
|
|
5255
5251
|
}
|
|
5256
5252
|
const k = [], M = [];
|
|
5257
5253
|
let D = null, h = null, R = !1, T = !1, P = null;
|
|
5258
|
-
const
|
|
5254
|
+
const ks = async (r) => typeof window > "u" || typeof document > "u" ? { sessionId: "" } : (T = !1, window.__traceLogDisabled === !0 ? { sessionId: "" } : h ? { sessionId: h.getSessionId() ?? "" } : (R && P || (R = !0, P = (async () => {
|
|
5259
5255
|
try {
|
|
5260
|
-
const e = fs(r ?? {}), t = new
|
|
5256
|
+
const e = fs(r ?? {}), t = new Ds();
|
|
5261
5257
|
try {
|
|
5262
5258
|
k.forEach(({ event: o, callback: l }) => {
|
|
5263
5259
|
t.on(o, l);
|
|
@@ -5283,7 +5279,7 @@ const Vs = async (r) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
5283
5279
|
} finally {
|
|
5284
5280
|
R = !1, P = null;
|
|
5285
5281
|
}
|
|
5286
|
-
})()), P)),
|
|
5282
|
+
})()), P)), Vs = (r, e) => {
|
|
5287
5283
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5288
5284
|
if (!h)
|
|
5289
5285
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -5291,7 +5287,7 @@ const Vs = async (r) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
5291
5287
|
throw new Error("[TraceLog] Cannot send events while TraceLog is being destroyed");
|
|
5292
5288
|
h.sendCustomEvent(r, e);
|
|
5293
5289
|
}
|
|
5294
|
-
},
|
|
5290
|
+
}, Us = (r, e) => {
|
|
5295
5291
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5296
5292
|
if (!h || R) {
|
|
5297
5293
|
k.push({ event: r, callback: e });
|
|
@@ -5299,7 +5295,7 @@ const Vs = async (r) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
5299
5295
|
}
|
|
5300
5296
|
h.on(r, e);
|
|
5301
5297
|
}
|
|
5302
|
-
},
|
|
5298
|
+
}, Fs = (r, e) => {
|
|
5303
5299
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5304
5300
|
if (!h) {
|
|
5305
5301
|
const t = k.findIndex((s) => s.event === r && s.callback === e);
|
|
@@ -5309,7 +5305,7 @@ const Vs = async (r) => typeof window > "u" || typeof document > "u" ? { session
|
|
|
5309
5305
|
h.off(r, e);
|
|
5310
5306
|
}
|
|
5311
5307
|
};
|
|
5312
|
-
function
|
|
5308
|
+
function Hs(r, e) {
|
|
5313
5309
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5314
5310
|
if (typeof e != "function")
|
|
5315
5311
|
throw new Error(`[TraceLog] Transformer must be a function, received: ${typeof e}`);
|
|
@@ -5323,7 +5319,7 @@ function xs(r, e) {
|
|
|
5323
5319
|
r === "beforeSend" ? h.setTransformer("beforeSend", e) : h.setTransformer("beforeBatch", e);
|
|
5324
5320
|
}
|
|
5325
5321
|
}
|
|
5326
|
-
const
|
|
5322
|
+
const xs = (r) => {
|
|
5327
5323
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5328
5324
|
if (!h) {
|
|
5329
5325
|
const e = M.findIndex((t) => t.hook === r);
|
|
@@ -5334,7 +5330,7 @@ const $s = (r) => {
|
|
|
5334
5330
|
throw new Error("[TraceLog] Cannot remove transformers while TraceLog is being destroyed");
|
|
5335
5331
|
h.removeTransformer(r);
|
|
5336
5332
|
}
|
|
5337
|
-
},
|
|
5333
|
+
}, $s = (r) => {
|
|
5338
5334
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5339
5335
|
if (typeof r != "function")
|
|
5340
5336
|
throw new Error(`[TraceLog] Custom headers provider must be a function, received: ${typeof r}`);
|
|
@@ -5346,7 +5342,7 @@ const $s = (r) => {
|
|
|
5346
5342
|
throw new Error("[TraceLog] Cannot set custom headers while TraceLog is being destroyed");
|
|
5347
5343
|
h.setCustomHeaders(r);
|
|
5348
5344
|
}
|
|
5349
|
-
},
|
|
5345
|
+
}, Bs = () => {
|
|
5350
5346
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5351
5347
|
if (!h) {
|
|
5352
5348
|
D = null;
|
|
@@ -5356,7 +5352,7 @@ const $s = (r) => {
|
|
|
5356
5352
|
throw new Error("[TraceLog] Cannot remove custom headers while TraceLog is being destroyed");
|
|
5357
5353
|
h.removeCustomHeaders();
|
|
5358
5354
|
}
|
|
5359
|
-
},
|
|
5355
|
+
}, Ws = () => typeof window > "u" || typeof document > "u" ? !1 : h !== null, Xs = () => typeof window > "u" || typeof document > "u" || !h ? null : h.getSessionId(), Gs = () => {
|
|
5360
5356
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5361
5357
|
if (T)
|
|
5362
5358
|
throw new Error("[TraceLog] Destroy operation already in progress");
|
|
@@ -5371,7 +5367,7 @@ const $s = (r) => {
|
|
|
5371
5367
|
h = null, R = !1, P = null, k.length = 0, M.length = 0, D = null, T = !1, a("warn", "Error during destroy, forced cleanup completed", { error: r });
|
|
5372
5368
|
}
|
|
5373
5369
|
}
|
|
5374
|
-
},
|
|
5370
|
+
}, js = (r) => {
|
|
5375
5371
|
typeof window > "u" || typeof document > "u" || rs(r);
|
|
5376
5372
|
}, zs = (r) => {
|
|
5377
5373
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
@@ -5381,7 +5377,7 @@ const $s = (r) => {
|
|
|
5381
5377
|
throw new Error("[TraceLog] Cannot update metadata while TraceLog is being destroyed");
|
|
5382
5378
|
h.updateGlobalMetadata(r);
|
|
5383
5379
|
}
|
|
5384
|
-
},
|
|
5380
|
+
}, Ks = (r) => {
|
|
5385
5381
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5386
5382
|
if (!h)
|
|
5387
5383
|
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
@@ -5389,7 +5385,7 @@ const $s = (r) => {
|
|
|
5389
5385
|
throw new Error("[TraceLog] Cannot update metadata while TraceLog is being destroyed");
|
|
5390
5386
|
h.mergeGlobalMetadata(r);
|
|
5391
5387
|
}
|
|
5392
|
-
},
|
|
5388
|
+
}, Qs = (r, e) => {
|
|
5393
5389
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5394
5390
|
if (!r || typeof r != "string" || r.trim().length === 0) {
|
|
5395
5391
|
a("warn", "identify() called with invalid userId");
|
|
@@ -5417,7 +5413,7 @@ const $s = (r) => {
|
|
|
5417
5413
|
a("debug", "Failed to persist pre-init identity");
|
|
5418
5414
|
}
|
|
5419
5415
|
}
|
|
5420
|
-
},
|
|
5416
|
+
}, Ys = async () => {
|
|
5421
5417
|
if (!(typeof window > "u" || typeof document > "u")) {
|
|
5422
5418
|
if (!h) {
|
|
5423
5419
|
try {
|
|
@@ -5430,23 +5426,23 @@ const $s = (r) => {
|
|
|
5430
5426
|
throw new Error("[TraceLog] Cannot reset identity while TraceLog is being destroyed");
|
|
5431
5427
|
await h.resetIdentity();
|
|
5432
5428
|
}
|
|
5433
|
-
},
|
|
5434
|
-
init:
|
|
5435
|
-
event:
|
|
5436
|
-
on:
|
|
5437
|
-
off:
|
|
5438
|
-
setTransformer:
|
|
5439
|
-
removeTransformer:
|
|
5440
|
-
setCustomHeaders:
|
|
5441
|
-
removeCustomHeaders:
|
|
5442
|
-
isInitialized:
|
|
5443
|
-
getSessionId:
|
|
5444
|
-
destroy:
|
|
5445
|
-
setQaMode:
|
|
5429
|
+
}, br = {
|
|
5430
|
+
init: ks,
|
|
5431
|
+
event: Vs,
|
|
5432
|
+
on: Us,
|
|
5433
|
+
off: Fs,
|
|
5434
|
+
setTransformer: Hs,
|
|
5435
|
+
removeTransformer: xs,
|
|
5436
|
+
setCustomHeaders: $s,
|
|
5437
|
+
removeCustomHeaders: Bs,
|
|
5438
|
+
isInitialized: Ws,
|
|
5439
|
+
getSessionId: Xs,
|
|
5440
|
+
destroy: Gs,
|
|
5441
|
+
setQaMode: js,
|
|
5446
5442
|
updateGlobalMetadata: zs,
|
|
5447
|
-
mergeGlobalMetadata:
|
|
5448
|
-
identify:
|
|
5449
|
-
resetIdentity:
|
|
5443
|
+
mergeGlobalMetadata: Ks,
|
|
5444
|
+
identify: Qs,
|
|
5445
|
+
resetIdentity: Ys
|
|
5450
5446
|
};
|
|
5451
5447
|
var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
5452
5448
|
addEventListener("pageshow", (function(e) {
|
|
@@ -5486,7 +5482,7 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5486
5482
|
return r();
|
|
5487
5483
|
}));
|
|
5488
5484
|
}));
|
|
5489
|
-
},
|
|
5485
|
+
}, z = function(r) {
|
|
5490
5486
|
document.addEventListener("visibilitychange", (function() {
|
|
5491
5487
|
document.visibilityState === "hidden" && r();
|
|
5492
5488
|
}));
|
|
@@ -5498,10 +5494,10 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5498
5494
|
}, F = -1, et = function() {
|
|
5499
5495
|
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
5500
5496
|
}, ce = function(r) {
|
|
5501
|
-
document.visibilityState === "hidden" && F > -1 && (F = r.type === "visibilitychange" ? r.timeStamp : 0,
|
|
5497
|
+
document.visibilityState === "hidden" && F > -1 && (F = r.type === "visibilitychange" ? r.timeStamp : 0, qs());
|
|
5502
5498
|
}, tt = function() {
|
|
5503
5499
|
addEventListener("visibilitychange", ce, !0), addEventListener("prerenderingchange", ce, !0);
|
|
5504
|
-
},
|
|
5500
|
+
}, qs = function() {
|
|
5505
5501
|
removeEventListener("visibilitychange", ce, !0), removeEventListener("prerenderingchange", ce, !0);
|
|
5506
5502
|
}, ke = function() {
|
|
5507
5503
|
return F < 0 && (F = et(), tt(), V((function() {
|
|
@@ -5511,12 +5507,12 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5511
5507
|
}))), { get firstHiddenTime() {
|
|
5512
5508
|
return F;
|
|
5513
5509
|
} };
|
|
5514
|
-
},
|
|
5510
|
+
}, K = function(r) {
|
|
5515
5511
|
document.prerendering ? addEventListener("prerenderingchange", (function() {
|
|
5516
5512
|
return r();
|
|
5517
5513
|
}), !0) : r();
|
|
5518
5514
|
}, Ae = [1800, 3e3], St = function(r, e) {
|
|
5519
|
-
e = e || {},
|
|
5515
|
+
e = e || {}, K((function() {
|
|
5520
5516
|
var t, s = ke(), i = y("FCP"), n = H("paint", (function(o) {
|
|
5521
5517
|
o.forEach((function(l) {
|
|
5522
5518
|
l.name === "first-contentful-paint" && (n.disconnect(), l.startTime < s.firstHiddenTime && (i.value = Math.max(l.startTime - de(), 0), i.entries.push(l), t(!0)));
|
|
@@ -5528,7 +5524,7 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5528
5524
|
}));
|
|
5529
5525
|
})));
|
|
5530
5526
|
}));
|
|
5531
|
-
}, Me = [0.1, 0.25],
|
|
5527
|
+
}, Me = [0.1, 0.25], Js = function(r, e) {
|
|
5532
5528
|
e = e || {}, St(ue((function() {
|
|
5533
5529
|
var t, s = y("CLS", 0), i = 0, n = [], o = function(c) {
|
|
5534
5530
|
c.forEach((function(d) {
|
|
@@ -5538,7 +5534,7 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5538
5534
|
}
|
|
5539
5535
|
})), i > s.value && (s.value = i, s.entries = n, t());
|
|
5540
5536
|
}, l = H("layout-shift", o);
|
|
5541
|
-
l && (t = w(r, s, Me, e.reportAllChanges),
|
|
5537
|
+
l && (t = w(r, s, Me, e.reportAllChanges), z((function() {
|
|
5542
5538
|
o(l.takeRecords()), t(!0);
|
|
5543
5539
|
})), V((function() {
|
|
5544
5540
|
i = 0, s = y("CLS", 0), t = w(r, s, Me, e.reportAllChanges), De((function() {
|
|
@@ -5546,19 +5542,19 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5546
5542
|
}));
|
|
5547
5543
|
})), setTimeout(t, 0));
|
|
5548
5544
|
})));
|
|
5549
|
-
}, Tt = 0, pe = 1 / 0, J = 0,
|
|
5545
|
+
}, Tt = 0, pe = 1 / 0, J = 0, Zs = function(r) {
|
|
5550
5546
|
r.forEach((function(e) {
|
|
5551
5547
|
e.interactionId && (pe = Math.min(pe, e.interactionId), J = Math.max(J, e.interactionId), Tt = J ? (J - pe) / 7 + 1 : 0);
|
|
5552
5548
|
}));
|
|
5553
5549
|
}, It = function() {
|
|
5554
5550
|
return Le ? Tt : performance.interactionCount || 0;
|
|
5555
|
-
},
|
|
5556
|
-
"interactionCount" in performance || Le || (Le = H("event",
|
|
5557
|
-
}, L = [], te = /* @__PURE__ */ new Map(), vt = 0,
|
|
5551
|
+
}, er = function() {
|
|
5552
|
+
"interactionCount" in performance || Le || (Le = H("event", Zs, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
5553
|
+
}, L = [], te = /* @__PURE__ */ new Map(), vt = 0, tr = function() {
|
|
5558
5554
|
var r = Math.min(L.length - 1, Math.floor((It() - vt) / 50));
|
|
5559
5555
|
return L[r];
|
|
5560
|
-
},
|
|
5561
|
-
if (
|
|
5556
|
+
}, sr = [], rr = function(r) {
|
|
5557
|
+
if (sr.forEach((function(i) {
|
|
5562
5558
|
return i(r);
|
|
5563
5559
|
})), r.interactionId || r.entryType === "first-input") {
|
|
5564
5560
|
var e = L[L.length - 1], t = te.get(r.interactionId);
|
|
@@ -5577,26 +5573,26 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5577
5573
|
}
|
|
5578
5574
|
}, _t = function(r) {
|
|
5579
5575
|
var e = self.requestIdleCallback || self.setTimeout, t = -1;
|
|
5580
|
-
return r = ue(r), document.visibilityState === "hidden" ? r() : (t = e(r),
|
|
5581
|
-
}, Ce = [200, 500],
|
|
5582
|
-
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (e = e || {},
|
|
5576
|
+
return r = ue(r), document.visibilityState === "hidden" ? r() : (t = e(r), z(r)), t;
|
|
5577
|
+
}, Ce = [200, 500], ir = function(r, e) {
|
|
5578
|
+
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (e = e || {}, K((function() {
|
|
5583
5579
|
var t;
|
|
5584
|
-
|
|
5580
|
+
er();
|
|
5585
5581
|
var s, i = y("INP"), n = function(l) {
|
|
5586
5582
|
_t((function() {
|
|
5587
|
-
l.forEach(
|
|
5588
|
-
var c =
|
|
5583
|
+
l.forEach(rr);
|
|
5584
|
+
var c = tr();
|
|
5589
5585
|
c && c.latency !== i.value && (i.value = c.latency, i.entries = c.entries, s());
|
|
5590
5586
|
}));
|
|
5591
5587
|
}, o = H("event", n, { durationThreshold: (t = e.durationThreshold) !== null && t !== void 0 ? t : 40 });
|
|
5592
|
-
s = w(r, i, Ce, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }),
|
|
5588
|
+
s = w(r, i, Ce, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }), z((function() {
|
|
5593
5589
|
n(o.takeRecords()), s(!0);
|
|
5594
5590
|
})), V((function() {
|
|
5595
5591
|
vt = It(), L.length = 0, te.clear(), i = y("INP"), s = w(r, i, Ce, e.reportAllChanges);
|
|
5596
5592
|
})));
|
|
5597
5593
|
})));
|
|
5598
|
-
}, Re = [2500, 4e3], Se = {},
|
|
5599
|
-
e = e || {},
|
|
5594
|
+
}, Re = [2500, 4e3], Se = {}, nr = function(r, e) {
|
|
5595
|
+
e = e || {}, K((function() {
|
|
5600
5596
|
var t, s = ke(), i = y("LCP"), n = function(c) {
|
|
5601
5597
|
e.reportAllChanges || (c = c.slice(-1)), c.forEach((function(d) {
|
|
5602
5598
|
d.startTime < s.firstHiddenTime && (i.value = Math.max(d.startTime - de(), 0), i.entries = [d], t());
|
|
@@ -5611,38 +5607,38 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5611
5607
|
addEventListener(c, (function() {
|
|
5612
5608
|
return _t(l);
|
|
5613
5609
|
}), { once: !0, capture: !0 });
|
|
5614
|
-
})),
|
|
5610
|
+
})), z(l), V((function(c) {
|
|
5615
5611
|
i = y("LCP"), t = w(r, i, Re, e.reportAllChanges), De((function() {
|
|
5616
5612
|
i.value = performance.now() - c.timeStamp, Se[i.id] = !0, t(!0);
|
|
5617
5613
|
}));
|
|
5618
5614
|
}));
|
|
5619
5615
|
}
|
|
5620
5616
|
}));
|
|
5621
|
-
}, Ne = [800, 1800],
|
|
5622
|
-
document.prerendering ?
|
|
5617
|
+
}, Ne = [800, 1800], or = function r(e) {
|
|
5618
|
+
document.prerendering ? K((function() {
|
|
5623
5619
|
return r(e);
|
|
5624
5620
|
})) : document.readyState !== "complete" ? addEventListener("load", (function() {
|
|
5625
5621
|
return r(e);
|
|
5626
5622
|
}), !0) : setTimeout(e, 0);
|
|
5627
|
-
},
|
|
5623
|
+
}, ar = function(r, e) {
|
|
5628
5624
|
e = e || {};
|
|
5629
5625
|
var t = y("TTFB"), s = w(r, t, Ne, e.reportAllChanges);
|
|
5630
|
-
|
|
5626
|
+
or((function() {
|
|
5631
5627
|
var i = Pe();
|
|
5632
5628
|
i && (t.value = Math.max(i.responseStart - de(), 0), t.entries = [i], s(!0), V((function() {
|
|
5633
5629
|
t = y("TTFB", 0), (s = w(r, t, Ne, e.reportAllChanges))(!0);
|
|
5634
5630
|
})));
|
|
5635
5631
|
}));
|
|
5636
|
-
}, W = { passive: !0, capture: !0 },
|
|
5632
|
+
}, W = { passive: !0, capture: !0 }, lr = /* @__PURE__ */ new Date(), st = function(r, e) {
|
|
5637
5633
|
C || (C = e, G = r, Et = /* @__PURE__ */ new Date(), wt(removeEventListener), yt());
|
|
5638
5634
|
}, yt = function() {
|
|
5639
|
-
if (G >= 0 && G < Et -
|
|
5635
|
+
if (G >= 0 && G < Et - lr) {
|
|
5640
5636
|
var r = { entryType: "first-input", name: C.type, target: C.target, cancelable: C.cancelable, startTime: C.timeStamp, processingStart: C.timeStamp + G };
|
|
5641
5637
|
le.forEach((function(e) {
|
|
5642
5638
|
e(r);
|
|
5643
5639
|
})), le = [];
|
|
5644
5640
|
}
|
|
5645
|
-
},
|
|
5641
|
+
}, cr = function(r) {
|
|
5646
5642
|
if (r.cancelable) {
|
|
5647
5643
|
var e = (r.timeStamp > 1e12 ? /* @__PURE__ */ new Date() : performance.now()) - r.timeStamp;
|
|
5648
5644
|
r.type == "pointerdown" ? (function(t, s) {
|
|
@@ -5658,16 +5654,16 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5658
5654
|
}
|
|
5659
5655
|
}, wt = function(r) {
|
|
5660
5656
|
["mousedown", "keydown", "touchstart", "pointerdown"].forEach((function(e) {
|
|
5661
|
-
return r(e,
|
|
5657
|
+
return r(e, cr, W);
|
|
5662
5658
|
}));
|
|
5663
|
-
}, Oe = [100, 300],
|
|
5664
|
-
e = e || {},
|
|
5659
|
+
}, Oe = [100, 300], dr = function(r, e) {
|
|
5660
|
+
e = e || {}, K((function() {
|
|
5665
5661
|
var t, s = ke(), i = y("FID"), n = function(c) {
|
|
5666
5662
|
c.startTime < s.firstHiddenTime && (i.value = c.processingStart - c.startTime, i.entries.push(c), t(!0));
|
|
5667
5663
|
}, o = function(c) {
|
|
5668
5664
|
c.forEach(n);
|
|
5669
5665
|
}, l = H("first-input", o);
|
|
5670
|
-
t = w(r, i, Oe, e.reportAllChanges), l && (
|
|
5666
|
+
t = w(r, i, Oe, e.reportAllChanges), l && (z(ue((function() {
|
|
5671
5667
|
o(l.takeRecords()), l.disconnect();
|
|
5672
5668
|
}))), V((function() {
|
|
5673
5669
|
var c;
|
|
@@ -5675,7 +5671,7 @@ var Le, C, G, Et, le, pt = -1, V = function(r) {
|
|
|
5675
5671
|
})));
|
|
5676
5672
|
}));
|
|
5677
5673
|
};
|
|
5678
|
-
const
|
|
5674
|
+
const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5679
5675
|
__proto__: null,
|
|
5680
5676
|
CLSThresholds: Me,
|
|
5681
5677
|
FCPThresholds: Ae,
|
|
@@ -5683,31 +5679,31 @@ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5683
5679
|
INPThresholds: Ce,
|
|
5684
5680
|
LCPThresholds: Re,
|
|
5685
5681
|
TTFBThresholds: Ne,
|
|
5686
|
-
onCLS:
|
|
5682
|
+
onCLS: Js,
|
|
5687
5683
|
onFCP: St,
|
|
5688
|
-
onFID:
|
|
5689
|
-
onINP:
|
|
5690
|
-
onLCP:
|
|
5691
|
-
onTTFB:
|
|
5684
|
+
onFID: dr,
|
|
5685
|
+
onINP: ir,
|
|
5686
|
+
onLCP: nr,
|
|
5687
|
+
onTTFB: ar
|
|
5692
5688
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5693
5689
|
export {
|
|
5694
5690
|
m as AppConfigValidationError,
|
|
5695
|
-
|
|
5691
|
+
hr as DEFAULT_SESSION_TIMEOUT,
|
|
5696
5692
|
_e as DEFAULT_WEB_VITALS_MODE,
|
|
5697
5693
|
A as DeviceType,
|
|
5698
5694
|
se as EmitterEvent,
|
|
5699
5695
|
B as ErrorType,
|
|
5700
5696
|
u as EventType,
|
|
5701
|
-
|
|
5697
|
+
yr as InitializationTimeoutError,
|
|
5702
5698
|
N as IntegrationValidationError,
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5699
|
+
Ir as MAX_ARRAY_LENGTH,
|
|
5700
|
+
Er as MAX_CUSTOM_EVENT_ARRAY_SIZE,
|
|
5701
|
+
gr as MAX_CUSTOM_EVENT_KEYS,
|
|
5702
|
+
fr as MAX_CUSTOM_EVENT_NAME_LENGTH,
|
|
5703
|
+
mr as MAX_CUSTOM_EVENT_STRING_SIZE,
|
|
5704
|
+
pr as MAX_NESTED_OBJECT_KEYS,
|
|
5705
|
+
Sr as MAX_STRING_LENGTH,
|
|
5706
|
+
Tr as MAX_STRING_LENGTH_IN_ARRAY,
|
|
5711
5707
|
ne as Mode,
|
|
5712
5708
|
at as PII_PATTERNS,
|
|
5713
5709
|
O as PermanentError,
|
|
@@ -5718,11 +5714,11 @@ export {
|
|
|
5718
5714
|
$ as SpecialApiUrl,
|
|
5719
5715
|
ie as TimeoutError,
|
|
5720
5716
|
j as TraceLogValidationError,
|
|
5721
|
-
|
|
5722
|
-
|
|
5717
|
+
wr as WEB_VITALS_GOOD_THRESHOLDS,
|
|
5718
|
+
Ke as WEB_VITALS_NEEDS_IMPROVEMENT_THRESHOLDS,
|
|
5723
5719
|
Yt as WEB_VITALS_POOR_THRESHOLDS,
|
|
5724
5720
|
Qe as getWebVitalsThresholds,
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5721
|
+
vr as isPrimaryScrollEvent,
|
|
5722
|
+
_r as isSecondaryScrollEvent,
|
|
5723
|
+
br as tracelog
|
|
5728
5724
|
};
|