@tracelog/lib 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/browser/tracelog.esm.js +92 -86
- 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/cjs/api.d.ts.map +1 -1
- package/dist/cjs/api.js +17 -2
- package/dist/cjs/api.js.map +1 -1
- package/dist/esm/api.d.ts.map +1 -1
- package/dist/esm/api.js +17 -2
- package/dist/esm/api.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,6 +213,13 @@ npm run test:coverage # With coverage
|
|
|
213
213
|
|
|
214
214
|
Chrome 60+, Firefox 55+, Safari 12+, Edge 79+
|
|
215
215
|
|
|
216
|
+
## SSR/SSG Support
|
|
217
|
+
|
|
218
|
+
Safe to import in SSR frameworks (Angular Universal, Next.js, Nuxt, SvelteKit). All methods silently no-op in Node.js environments.
|
|
219
|
+
|
|
220
|
+
**Best practice**
|
|
221
|
+
Register listeners AFTER init() in browser-only lifecycle hooks.
|
|
222
|
+
|
|
216
223
|
## Documentation
|
|
217
224
|
|
|
218
225
|
- [Handlers](./src/handlers/README.md) - Event capture implementation
|
|
@@ -97,7 +97,7 @@ class V extends Error {
|
|
|
97
97
|
super(e), this.errorCode = t, this.layer = r, this.name = this.constructor.name, Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
class
|
|
100
|
+
class f extends V {
|
|
101
101
|
constructor(e, t = "config") {
|
|
102
102
|
super(e, "APP_CONFIG_INVALID", t);
|
|
103
103
|
}
|
|
@@ -160,7 +160,7 @@ const Xe = () => {
|
|
|
160
160
|
} catch (n) {
|
|
161
161
|
return a("warn", "Device detection failed, defaulting to desktop", { error: n }), w.Desktop;
|
|
162
162
|
}
|
|
163
|
-
}, y = "tlog",
|
|
163
|
+
}, y = "tlog", fe = `${y}:qa_mode`, ze = `${y}:uid`, Qe = (n) => n ? `${y}:${n}:queue` : `${y}:queue`, je = (n) => n ? `${y}:${n}:session` : `${y}:session`, Ye = (n) => n ? `${y}:${n}:broadcast` : `${y}:broadcast`, ye = {
|
|
164
164
|
LCP: 4e3,
|
|
165
165
|
FCP: 1800,
|
|
166
166
|
CLS: 0.25,
|
|
@@ -182,12 +182,12 @@ const Xe = () => {
|
|
|
182
182
|
/Bearer\s+[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?(?:\.[A-Za-z0-9_-]+)?/gi,
|
|
183
183
|
// Passwords in connection strings (protocol://user:password@host)
|
|
184
184
|
/:\/\/[^:/]+:([^@]+)@/gi
|
|
185
|
-
],
|
|
186
|
-
if (sessionStorage.getItem(
|
|
185
|
+
], Ee = 500, ge = 5e3, x = 50, qe = x * 2, Le = 1, Ze = 1e3, Je = 10, me = 5e3, et = 6e4, Se = "tlog_mode", tt = "qa", rt = () => {
|
|
186
|
+
if (sessionStorage.getItem(fe) === "true")
|
|
187
187
|
return !0;
|
|
188
188
|
const e = new URLSearchParams(window.location.search), r = e.get(Se) === tt;
|
|
189
189
|
if (r) {
|
|
190
|
-
sessionStorage.setItem(
|
|
190
|
+
sessionStorage.setItem(fe, "true"), e.delete(Se);
|
|
191
191
|
const s = e.toString(), i = `${window.location.pathname}${s ? "?" + s : ""}${window.location.hash}`;
|
|
192
192
|
try {
|
|
193
193
|
window.history.replaceState({}, "", i);
|
|
@@ -310,18 +310,18 @@ const Xe = () => {
|
|
|
310
310
|
}
|
|
311
311
|
}, at = (n) => {
|
|
312
312
|
if (n !== void 0 && (n === null || typeof n != "object"))
|
|
313
|
-
throw new
|
|
313
|
+
throw new f("Configuration must be an object", "config");
|
|
314
314
|
if (n) {
|
|
315
315
|
if (n.sessionTimeout !== void 0 && (typeof n.sessionTimeout != "number" || n.sessionTimeout < 3e4 || n.sessionTimeout > 864e5))
|
|
316
316
|
throw new Ge(h.INVALID_SESSION_TIMEOUT, "config");
|
|
317
317
|
if (n.globalMetadata !== void 0 && (typeof n.globalMetadata != "object" || n.globalMetadata === null))
|
|
318
|
-
throw new
|
|
318
|
+
throw new f(h.INVALID_GLOBAL_METADATA, "config");
|
|
319
319
|
if (n.integrations && ct(n.integrations), n.sensitiveQueryParams !== void 0) {
|
|
320
320
|
if (!Array.isArray(n.sensitiveQueryParams))
|
|
321
|
-
throw new
|
|
321
|
+
throw new f(h.INVALID_SENSITIVE_QUERY_PARAMS, "config");
|
|
322
322
|
for (const e of n.sensitiveQueryParams)
|
|
323
323
|
if (typeof e != "string")
|
|
324
|
-
throw new
|
|
324
|
+
throw new f("All sensitive query params must be strings", "config");
|
|
325
325
|
}
|
|
326
326
|
if (n.errorSampling !== void 0 && (typeof n.errorSampling != "number" || n.errorSampling < 0 || n.errorSampling > 1))
|
|
327
327
|
throw new he(h.INVALID_ERROR_SAMPLING_RATE, "config");
|
|
@@ -329,55 +329,55 @@ const Xe = () => {
|
|
|
329
329
|
throw new he(h.INVALID_SAMPLING_RATE, "config");
|
|
330
330
|
if (n.primaryScrollSelector !== void 0) {
|
|
331
331
|
if (typeof n.primaryScrollSelector != "string" || !n.primaryScrollSelector.trim())
|
|
332
|
-
throw new
|
|
332
|
+
throw new f(h.INVALID_PRIMARY_SCROLL_SELECTOR, "config");
|
|
333
333
|
if (n.primaryScrollSelector !== "window")
|
|
334
334
|
try {
|
|
335
335
|
document.querySelector(n.primaryScrollSelector);
|
|
336
336
|
} catch {
|
|
337
|
-
throw new
|
|
337
|
+
throw new f(
|
|
338
338
|
`${h.INVALID_PRIMARY_SCROLL_SELECTOR_SYNTAX}: "${n.primaryScrollSelector}"`,
|
|
339
339
|
"config"
|
|
340
340
|
);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
if (n.pageViewThrottleMs !== void 0 && (typeof n.pageViewThrottleMs != "number" || n.pageViewThrottleMs < 0))
|
|
344
|
-
throw new
|
|
344
|
+
throw new f(h.INVALID_PAGE_VIEW_THROTTLE, "config");
|
|
345
345
|
if (n.clickThrottleMs !== void 0 && (typeof n.clickThrottleMs != "number" || n.clickThrottleMs < 0))
|
|
346
|
-
throw new
|
|
346
|
+
throw new f(h.INVALID_CLICK_THROTTLE, "config");
|
|
347
347
|
if (n.maxSameEventPerMinute !== void 0 && (typeof n.maxSameEventPerMinute != "number" || n.maxSameEventPerMinute <= 0))
|
|
348
|
-
throw new
|
|
348
|
+
throw new f(h.INVALID_MAX_SAME_EVENT_PER_MINUTE, "config");
|
|
349
349
|
n.viewport !== void 0 && lt(n.viewport);
|
|
350
350
|
}
|
|
351
351
|
}, lt = (n) => {
|
|
352
352
|
if (typeof n != "object" || n === null)
|
|
353
|
-
throw new
|
|
353
|
+
throw new f(h.INVALID_VIEWPORT_CONFIG, "config");
|
|
354
354
|
if (!n.elements || !Array.isArray(n.elements))
|
|
355
|
-
throw new
|
|
355
|
+
throw new f(h.INVALID_VIEWPORT_ELEMENTS, "config");
|
|
356
356
|
if (n.elements.length === 0)
|
|
357
|
-
throw new
|
|
357
|
+
throw new f(h.INVALID_VIEWPORT_ELEMENTS, "config");
|
|
358
358
|
const e = /* @__PURE__ */ new Set();
|
|
359
359
|
for (const t of n.elements) {
|
|
360
360
|
if (!t.selector || typeof t.selector != "string" || !t.selector.trim())
|
|
361
|
-
throw new
|
|
361
|
+
throw new f(h.INVALID_VIEWPORT_ELEMENT, "config");
|
|
362
362
|
const r = t.selector.trim();
|
|
363
363
|
if (e.has(r))
|
|
364
|
-
throw new
|
|
364
|
+
throw new f(
|
|
365
365
|
`Duplicate viewport selector found: "${r}". Each selector should appear only once.`,
|
|
366
366
|
"config"
|
|
367
367
|
);
|
|
368
368
|
if (e.add(r), t.id !== void 0 && (typeof t.id != "string" || !t.id.trim()))
|
|
369
|
-
throw new
|
|
369
|
+
throw new f(h.INVALID_VIEWPORT_ELEMENT_ID, "config");
|
|
370
370
|
if (t.name !== void 0 && (typeof t.name != "string" || !t.name.trim()))
|
|
371
|
-
throw new
|
|
371
|
+
throw new f(h.INVALID_VIEWPORT_ELEMENT_NAME, "config");
|
|
372
372
|
}
|
|
373
373
|
if (n.threshold !== void 0 && (typeof n.threshold != "number" || n.threshold < 0 || n.threshold > 1))
|
|
374
|
-
throw new
|
|
374
|
+
throw new f(h.INVALID_VIEWPORT_THRESHOLD, "config");
|
|
375
375
|
if (n.minDwellTime !== void 0 && (typeof n.minDwellTime != "number" || n.minDwellTime < 0))
|
|
376
|
-
throw new
|
|
376
|
+
throw new f(h.INVALID_VIEWPORT_MIN_DWELL_TIME, "config");
|
|
377
377
|
if (n.cooldownPeriod !== void 0 && (typeof n.cooldownPeriod != "number" || n.cooldownPeriod < 0))
|
|
378
|
-
throw new
|
|
378
|
+
throw new f(h.INVALID_VIEWPORT_COOLDOWN_PERIOD, "config");
|
|
379
379
|
if (n.maxTrackedElements !== void 0 && (typeof n.maxTrackedElements != "number" || n.maxTrackedElements <= 0))
|
|
380
|
-
throw new
|
|
380
|
+
throw new f(h.INVALID_VIEWPORT_MAX_TRACKED_ELEMENTS, "config");
|
|
381
381
|
}, ct = (n) => {
|
|
382
382
|
if (n) {
|
|
383
383
|
if (n.tracelog && (!n.tracelog.projectId || typeof n.tracelog.projectId != "string" || n.tracelog.projectId.trim() === ""))
|
|
@@ -535,7 +535,7 @@ const Xe = () => {
|
|
|
535
535
|
valid: !0,
|
|
536
536
|
sanitizedMetadata: r
|
|
537
537
|
};
|
|
538
|
-
},
|
|
538
|
+
}, ft = (n, e, t) => {
|
|
539
539
|
if (Array.isArray(e)) {
|
|
540
540
|
const r = [], s = `${t} "${n}" metadata error`;
|
|
541
541
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -559,7 +559,7 @@ const Xe = () => {
|
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
561
|
return Ie(n, e, t);
|
|
562
|
-
},
|
|
562
|
+
}, Et = (n, e) => {
|
|
563
563
|
const t = ht(n);
|
|
564
564
|
if (!t.valid)
|
|
565
565
|
return a("error", "Event name validation failed", {
|
|
@@ -568,7 +568,7 @@ const Xe = () => {
|
|
|
568
568
|
}), t;
|
|
569
569
|
if (!e)
|
|
570
570
|
return { valid: !0 };
|
|
571
|
-
const r =
|
|
571
|
+
const r = ft(n, e, "customEvent");
|
|
572
572
|
return r.valid || a("error", "Event metadata validation failed", {
|
|
573
573
|
showToClient: !0,
|
|
574
574
|
data: {
|
|
@@ -2470,7 +2470,7 @@ class Nt extends S {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
2472
|
sanitize(e) {
|
|
2473
|
-
let t = e.length >
|
|
2473
|
+
let t = e.length > Ee ? e.slice(0, Ee) + "..." : e;
|
|
2474
2474
|
for (const r of le) {
|
|
2475
2475
|
const s = new RegExp(r.source, r.flags);
|
|
2476
2476
|
t = t.replace(s, "[REDACTED]");
|
|
@@ -2521,7 +2521,7 @@ class Rt extends S {
|
|
|
2521
2521
|
sendCustomEvent(e, t) {
|
|
2522
2522
|
if (!this.managers.event)
|
|
2523
2523
|
return;
|
|
2524
|
-
const { valid: r, error: s, sanitizedMetadata: i } =
|
|
2524
|
+
const { valid: r, error: s, sanitizedMetadata: i } = Et(e, t);
|
|
2525
2525
|
if (!r) {
|
|
2526
2526
|
if (this.get("mode") === D.QA)
|
|
2527
2527
|
throw new Error(`[TraceLog] Custom event "${e}" validation failed: ${s}`);
|
|
@@ -2587,12 +2587,10 @@ class Rt extends S {
|
|
|
2587
2587
|
}
|
|
2588
2588
|
}
|
|
2589
2589
|
const N = [];
|
|
2590
|
-
let
|
|
2590
|
+
let E = null, C = !1, F = !1;
|
|
2591
2591
|
const Ot = async (n) => {
|
|
2592
|
-
if (typeof window > "u" || typeof document > "u")
|
|
2593
|
-
|
|
2594
|
-
if (!window.__traceLogDisabled && !f && !b) {
|
|
2595
|
-
b = !0;
|
|
2592
|
+
if (!(typeof window > "u" || typeof document > "u") && !window.__traceLogDisabled && !E && !C) {
|
|
2593
|
+
C = !0;
|
|
2596
2594
|
try {
|
|
2597
2595
|
const e = ut(n ?? {}), t = new Rt();
|
|
2598
2596
|
try {
|
|
@@ -2604,7 +2602,7 @@ const Ot = async (n) => {
|
|
|
2604
2602
|
o(new Error("[TraceLog] Initialization timeout after 10000ms"));
|
|
2605
2603
|
}, 1e4);
|
|
2606
2604
|
});
|
|
2607
|
-
await Promise.race([r, s]),
|
|
2605
|
+
await Promise.race([r, s]), E = t;
|
|
2608
2606
|
} catch (r) {
|
|
2609
2607
|
try {
|
|
2610
2608
|
t.destroy(!0);
|
|
@@ -2614,42 +2612,50 @@ const Ot = async (n) => {
|
|
|
2614
2612
|
throw r;
|
|
2615
2613
|
}
|
|
2616
2614
|
} catch (e) {
|
|
2617
|
-
throw
|
|
2615
|
+
throw E = null, e;
|
|
2618
2616
|
} finally {
|
|
2619
|
-
|
|
2617
|
+
C = !1;
|
|
2620
2618
|
}
|
|
2621
2619
|
}
|
|
2622
|
-
}, bt = (n, e) => {
|
|
2623
|
-
if (!f)
|
|
2624
|
-
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
2625
|
-
if (F)
|
|
2626
|
-
throw new Error("[TraceLog] Cannot send events while TraceLog is being destroyed");
|
|
2627
|
-
f.sendCustomEvent(n, e);
|
|
2628
2620
|
}, Ct = (n, e) => {
|
|
2629
|
-
if (!
|
|
2630
|
-
|
|
2631
|
-
|
|
2621
|
+
if (!(typeof window > "u" || typeof document > "u")) {
|
|
2622
|
+
if (!E)
|
|
2623
|
+
throw new Error("[TraceLog] TraceLog not initialized. Please call init() first.");
|
|
2624
|
+
if (F)
|
|
2625
|
+
throw new Error("[TraceLog] Cannot send events while TraceLog is being destroyed");
|
|
2626
|
+
E.sendCustomEvent(n, e);
|
|
2627
|
+
}
|
|
2628
|
+
}, bt = (n, e) => {
|
|
2629
|
+
if (!(typeof window > "u" || typeof document > "u")) {
|
|
2630
|
+
if (!E || C) {
|
|
2631
|
+
N.push({ event: n, callback: e });
|
|
2632
|
+
return;
|
|
2633
|
+
}
|
|
2634
|
+
E.on(n, e);
|
|
2632
2635
|
}
|
|
2633
|
-
f.on(n, e);
|
|
2634
2636
|
}, Pt = (n, e) => {
|
|
2635
|
-
if (!
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
if (!
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2637
|
+
if (!(typeof window > "u" || typeof document > "u")) {
|
|
2638
|
+
if (!E) {
|
|
2639
|
+
const t = N.findIndex((r) => r.event === n && r.callback === e);
|
|
2640
|
+
t !== -1 && N.splice(t, 1);
|
|
2641
|
+
return;
|
|
2642
|
+
}
|
|
2643
|
+
E.off(n, e);
|
|
2644
|
+
}
|
|
2645
|
+
}, Dt = () => typeof window > "u" || typeof document > "u" ? !1 : E !== null, Vt = () => {
|
|
2646
|
+
if (!(typeof window > "u" || typeof document > "u")) {
|
|
2647
|
+
if (F)
|
|
2648
|
+
throw new Error("[TraceLog] Destroy operation already in progress");
|
|
2649
|
+
if (!E)
|
|
2650
|
+
throw new Error("[TraceLog] App not initialized");
|
|
2651
|
+
F = !0;
|
|
2652
|
+
try {
|
|
2653
|
+
E.destroy(), E = null, C = !1, N.length = 0;
|
|
2654
|
+
} catch (n) {
|
|
2655
|
+
E = null, C = !1, N.length = 0, a("warn", "Error during destroy, forced cleanup completed", { error: n });
|
|
2656
|
+
} finally {
|
|
2657
|
+
F = !1;
|
|
2658
|
+
}
|
|
2653
2659
|
}
|
|
2654
2660
|
}, or = {
|
|
2655
2661
|
WEB_VITALS_THRESHOLDS: ye
|
|
@@ -2698,14 +2704,14 @@ const Ot = async (n) => {
|
|
|
2698
2704
|
LOW_ERROR_RATE_PERCENT: 1,
|
|
2699
2705
|
HIGH_ERROR_RATE_PERCENT: 5,
|
|
2700
2706
|
CRITICAL_ERROR_RATE_PERCENT: 10
|
|
2701
|
-
},
|
|
2707
|
+
}, fr = {
|
|
2702
2708
|
SHORT_TERM_TREND_HOURS: 24,
|
|
2703
2709
|
MEDIUM_TERM_TREND_DAYS: 7,
|
|
2704
2710
|
LONG_TERM_TREND_DAYS: 30,
|
|
2705
2711
|
MIN_DATA_POINTS_FOR_TREND: 5,
|
|
2706
2712
|
WEEKLY_PATTERN_MIN_WEEKS: 4,
|
|
2707
2713
|
DAILY_PATTERN_MIN_DAYS: 14
|
|
2708
|
-
},
|
|
2714
|
+
}, Er = {
|
|
2709
2715
|
MIN_SEGMENT_SIZE: 10,
|
|
2710
2716
|
MIN_COHORT_SIZE: 5,
|
|
2711
2717
|
COHORT_ANALYSIS_DAYS: [1, 3, 7, 14, 30],
|
|
@@ -2730,13 +2736,13 @@ const Ot = async (n) => {
|
|
|
2730
2736
|
PAGE_URL_UNKNOWN: "unknown"
|
|
2731
2737
|
}, _r = {
|
|
2732
2738
|
init: Ot,
|
|
2733
|
-
event:
|
|
2734
|
-
on:
|
|
2739
|
+
event: Ct,
|
|
2740
|
+
on: bt,
|
|
2735
2741
|
off: Pt,
|
|
2736
2742
|
isInitialized: Dt,
|
|
2737
2743
|
destroy: Vt
|
|
2738
2744
|
};
|
|
2739
|
-
var re, Ne = -1,
|
|
2745
|
+
var re, Ne = -1, b = function(n) {
|
|
2740
2746
|
addEventListener("pageshow", (function(e) {
|
|
2741
2747
|
e.persisted && (Ne = e.timeStamp, n(e));
|
|
2742
2748
|
}), !0);
|
|
@@ -2792,7 +2798,7 @@ var re, Ne = -1, C = function(n) {
|
|
|
2792
2798
|
}, kt = function() {
|
|
2793
2799
|
removeEventListener("visibilitychange", W, !0), removeEventListener("prerenderingchange", W, !0);
|
|
2794
2800
|
}, Re = function() {
|
|
2795
|
-
return O < 0 && (O = ve(), Ae(),
|
|
2801
|
+
return O < 0 && (O = ve(), Ae(), b((function() {
|
|
2796
2802
|
setTimeout((function() {
|
|
2797
2803
|
O = ve(), Ae();
|
|
2798
2804
|
}), 0);
|
|
@@ -2810,7 +2816,7 @@ var re, Ne = -1, C = function(n) {
|
|
|
2810
2816
|
l.name === "first-contentful-paint" && (i.disconnect(), l.startTime < r.firstHiddenTime && (s.value = Math.max(l.startTime - B(), 0), s.entries.push(l), t(!0)));
|
|
2811
2817
|
}));
|
|
2812
2818
|
}));
|
|
2813
|
-
i && (t = I(n, s, ne, e.reportAllChanges),
|
|
2819
|
+
i && (t = I(n, s, ne, e.reportAllChanges), b((function(o) {
|
|
2814
2820
|
s = p("FCP"), t = I(n, s, ne, e.reportAllChanges), ue((function() {
|
|
2815
2821
|
s.value = performance.now() - o.timeStamp, t(!0);
|
|
2816
2822
|
}));
|
|
@@ -2828,22 +2834,22 @@ var re, Ne = -1, C = function(n) {
|
|
|
2828
2834
|
}, l = k("layout-shift", o);
|
|
2829
2835
|
l && (t = I(n, r, se, e.reportAllChanges), X((function() {
|
|
2830
2836
|
o(l.takeRecords()), t(!0);
|
|
2831
|
-
})),
|
|
2837
|
+
})), b((function() {
|
|
2832
2838
|
s = 0, r = p("CLS", 0), t = I(n, r, se, e.reportAllChanges), ue((function() {
|
|
2833
2839
|
return t();
|
|
2834
2840
|
}));
|
|
2835
2841
|
})), setTimeout(t, 0));
|
|
2836
2842
|
})));
|
|
2837
|
-
},
|
|
2843
|
+
}, Ce = 0, Y = 1 / 0, U = 0, Ht = function(n) {
|
|
2838
2844
|
n.forEach((function(e) {
|
|
2839
|
-
e.interactionId && (Y = Math.min(Y, e.interactionId), U = Math.max(U, e.interactionId),
|
|
2845
|
+
e.interactionId && (Y = Math.min(Y, e.interactionId), U = Math.max(U, e.interactionId), Ce = U ? (U - Y) / 7 + 1 : 0);
|
|
2840
2846
|
}));
|
|
2841
|
-
},
|
|
2842
|
-
return re ?
|
|
2847
|
+
}, be = function() {
|
|
2848
|
+
return re ? Ce : performance.interactionCount || 0;
|
|
2843
2849
|
}, xt = function() {
|
|
2844
2850
|
"interactionCount" in performance || re || (re = k("event", Ht, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
2845
2851
|
}, T = [], G = /* @__PURE__ */ new Map(), Pe = 0, Ft = function() {
|
|
2846
|
-
var n = Math.min(T.length - 1, Math.floor((
|
|
2852
|
+
var n = Math.min(T.length - 1, Math.floor((be() - Pe) / 50));
|
|
2847
2853
|
return T[n];
|
|
2848
2854
|
}, Gt = [], Wt = function(n) {
|
|
2849
2855
|
if (Gt.forEach((function(s) {
|
|
@@ -2879,8 +2885,8 @@ var re, Ne = -1, C = function(n) {
|
|
|
2879
2885
|
}, o = k("event", i, { durationThreshold: (t = e.durationThreshold) !== null && t !== void 0 ? t : 40 });
|
|
2880
2886
|
r = I(n, s, ie, e.reportAllChanges), o && (o.observe({ type: "first-input", buffered: !0 }), X((function() {
|
|
2881
2887
|
i(o.takeRecords()), r(!0);
|
|
2882
|
-
})),
|
|
2883
|
-
Pe =
|
|
2888
|
+
})), b((function() {
|
|
2889
|
+
Pe = be(), T.length = 0, G.clear(), s = p("INP"), r = I(n, s, ie, e.reportAllChanges);
|
|
2884
2890
|
})));
|
|
2885
2891
|
})));
|
|
2886
2892
|
}, oe = [2500, 4e3], K = {}, Xt = function(n, e) {
|
|
@@ -2899,7 +2905,7 @@ var re, Ne = -1, C = function(n) {
|
|
|
2899
2905
|
addEventListener(c, (function() {
|
|
2900
2906
|
return De(l);
|
|
2901
2907
|
}), { once: !0, capture: !0 });
|
|
2902
|
-
})), X(l),
|
|
2908
|
+
})), X(l), b((function(c) {
|
|
2903
2909
|
s = p("LCP"), t = I(n, s, oe, e.reportAllChanges), ue((function() {
|
|
2904
2910
|
s.value = performance.now() - c.timeStamp, K[s.id] = !0, t(!0);
|
|
2905
2911
|
}));
|
|
@@ -2917,7 +2923,7 @@ var re, Ne = -1, C = function(n) {
|
|
|
2917
2923
|
var t = p("TTFB"), r = I(n, t, ae, e.reportAllChanges);
|
|
2918
2924
|
$t((function() {
|
|
2919
2925
|
var s = ce();
|
|
2920
|
-
s && (t.value = Math.max(s.responseStart - B(), 0), t.entries = [s], r(!0),
|
|
2926
|
+
s && (t.value = Math.max(s.responseStart - B(), 0), t.entries = [s], r(!0), b((function() {
|
|
2921
2927
|
t = p("TTFB", 0), (r = I(n, t, ae, e.reportAllChanges))(!0);
|
|
2922
2928
|
})));
|
|
2923
2929
|
}));
|
|
@@ -2938,7 +2944,7 @@ const Qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2938
2944
|
export {
|
|
2939
2945
|
gr as ANALYTICS_QUERY_LIMITS,
|
|
2940
2946
|
mr as ANOMALY_DETECTION,
|
|
2941
|
-
|
|
2947
|
+
f as AppConfigValidationError,
|
|
2942
2948
|
dr as CONTENT_ANALYTICS,
|
|
2943
2949
|
ar as DATA_PROTECTION,
|
|
2944
2950
|
ur as DEVICE_ANALYTICS,
|
|
@@ -2962,14 +2968,14 @@ export {
|
|
|
2962
2968
|
D as Mode,
|
|
2963
2969
|
or as PERFORMANCE_CONFIG,
|
|
2964
2970
|
R as PermanentError,
|
|
2965
|
-
|
|
2971
|
+
Er as SEGMENTATION_ANALYTICS,
|
|
2966
2972
|
cr as SESSION_ANALYTICS,
|
|
2967
2973
|
Sr as SPECIAL_PAGE_URLS,
|
|
2968
2974
|
he as SamplingRateValidationError,
|
|
2969
2975
|
H as ScrollDirection,
|
|
2970
2976
|
Ge as SessionTimeoutValidationError,
|
|
2971
2977
|
q as SpecialApiUrl,
|
|
2972
|
-
|
|
2978
|
+
fr as TEMPORAL_ANALYSIS,
|
|
2973
2979
|
V as TraceLogValidationError,
|
|
2974
2980
|
nr as isPrimaryScrollEvent,
|
|
2975
2981
|
sr as isSecondaryScrollEvent,
|