@adobe/helix-rum-enhancer 2.34.2 → 2.34.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.34.3](https://github.com/adobe/helix-rum-enhancer/compare/v2.34.2...v2.34.3) (2025-05-12)
2
+
3
+
4
+ ### Reverts
5
+
6
+ * Revert "chore: ignore psi check not needed ([#383](https://github.com/adobe/helix-rum-enhancer/issues/383))" ([c9d577f](https://github.com/adobe/helix-rum-enhancer/commit/c9d577f535a937f515319431ec56d972188840b4))
7
+
1
8
  ## [2.34.2](https://github.com/adobe/helix-rum-enhancer/compare/v2.34.1...v2.34.2) (2025-04-17)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-rum-enhancer",
3
- "version": "2.34.2",
3
+ "version": "2.34.3",
4
4
  "description": "Helix RUM Enhancer",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "@esm-bundle/chai": "4.3.4-fix.0",
39
39
  "@rollup/plugin-babel": "6.0.4",
40
40
  "@semantic-release/changelog": "6.0.3",
41
- "@semantic-release/exec": "7.0.3",
41
+ "@semantic-release/exec": "7.1.0",
42
42
  "@semantic-release/git": "10.0.1",
43
43
  "@semantic-release/npm": "12.0.1",
44
44
  "@web/test-runner": "0.20.1",
@@ -54,15 +54,15 @@
54
54
  "husky": "9.1.7",
55
55
  "jsdoc-to-markdown": "9.1.1",
56
56
  "junit-report-builder": "5.1.1",
57
- "lint-staged": "15.5.1",
58
- "mocha": "11.1.0",
57
+ "lint-staged": "16.0.0",
58
+ "mocha": "11.2.2",
59
59
  "mocha-multi-reporters": "1.5.1",
60
- "rollup": "4.40.0",
60
+ "rollup": "4.40.2",
61
61
  "rollup-plugin-checksum": "1.0.1",
62
62
  "rollup-plugin-eslint-bundle": "9.0.0",
63
63
  "semantic-release": "24.2.3",
64
64
  "semantic-release-slack-bot": "^4.0.2",
65
- "web-vitals": "4.2.4"
65
+ "web-vitals": "5.0.0"
66
66
  },
67
67
  "lint-staged": {
68
68
  "*.js": "eslint",
package/src/index.md5 CHANGED
@@ -1 +1 @@
1
- e063cfac7b3a826d141de35d9d80d877
1
+ ec0f8d360b4b5a3f5b5b84ff90cd98cc
@@ -11,345 +11,264 @@
11
11
  */
12
12
  (function (e) {
13
13
 
14
- var n,
15
- t,
16
- r,
17
- i,
18
- o,
19
- a = -1,
20
- c = function (e) {
21
- addEventListener("pageshow", function (n) {
22
- n.persisted && (a = n.timeStamp, e(n));
14
+ let t = -1;
15
+ const n = e => {
16
+ addEventListener("pageshow", n => {
17
+ n.persisted && (t = n.timeStamp, e(n));
23
18
  }, true);
24
19
  },
25
- u = function () {
26
- var e = self.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
20
+ i = (e, t, n, i) => {
21
+ let o, s;
22
+ return r => {
23
+ t.value >= 0 && (r || i) && (s = t.value - (o ?? 0), (s || void 0 === o) && (o = t.value, t.delta = s, t.rating = ((e, t) => e > t[1] ? "poor" : e > t[0] ? "needs-improvement" : "good")(t.value, n), e(t)));
24
+ };
25
+ },
26
+ o = e => {
27
+ requestAnimationFrame(() => requestAnimationFrame(() => e()));
28
+ },
29
+ s = () => {
30
+ const e = performance.getEntriesByType("navigation")[0];
27
31
  if (e && e.responseStart > 0 && e.responseStart < performance.now()) return e;
28
32
  },
29
- s = function () {
30
- var e = u();
31
- return e && e.activationStart || 0;
33
+ r = () => {
34
+ const e = s();
35
+ return e?.activationStart ?? 0;
32
36
  },
33
- f = function (e, n) {
34
- var t = u(),
35
- r = "navigate";
36
- a >= 0 ? r = "back-forward-cache" : t && (document.prerendering || s() > 0 ? r = "prerender" : document.wasDiscarded ? r = "restore" : t.type && (r = t.type.replace(/_/g, "-")));
37
+ c = (e, n = -1) => {
38
+ const i = s();
39
+ let o = "navigate";
40
+ t >= 0 ? o = "back-forward-cache" : i && (document.prerendering || r() > 0 ? o = "prerender" : document.wasDiscarded ? o = "restore" : i.type && (o = i.type.replace(/_/g, "-")));
37
41
  return {
38
42
  name: e,
39
- value: void 0 === n ? -1 : n,
43
+ value: n,
40
44
  rating: "good",
41
45
  delta: 0,
42
46
  entries: [],
43
- id: "v4-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12),
44
- navigationType: r
47
+ id: `v5-${Date.now()}-${Math.floor(8999999999999 * Math.random()) + 1e12}`,
48
+ navigationType: o
45
49
  };
46
50
  },
47
- d = function (e, n, t) {
51
+ a = new WeakMap();
52
+ function d(e, t) {
53
+ return a.get(e) || a.set(e, new t()), a.get(e);
54
+ }
55
+ class h {
56
+ t;
57
+ i = 0;
58
+ o = [];
59
+ h(e) {
60
+ if (e.hadRecentInput) return;
61
+ const t = this.o[0],
62
+ n = this.o.at(-1);
63
+ this.i && t && n && e.startTime - n.startTime < 1e3 && e.startTime - t.startTime < 5e3 ? (this.i += e.value, this.o.push(e)) : (this.i = e.value, this.o = [e]), this.t?.(e);
64
+ }
65
+ }
66
+ const f = (e, t, n = {}) => {
48
67
  try {
49
68
  if (PerformanceObserver.supportedEntryTypes.includes(e)) {
50
- var r = new PerformanceObserver(function (e) {
51
- Promise.resolve().then(function () {
52
- n(e.getEntries());
69
+ const i = new PerformanceObserver(e => {
70
+ Promise.resolve().then(() => {
71
+ t(e.getEntries());
53
72
  });
54
73
  });
55
- return r.observe(Object.assign({
74
+ return i.observe({
56
75
  type: e,
57
- buffered: !0
58
- }, t || {})), r;
76
+ buffered: !0,
77
+ ...n
78
+ }), i;
59
79
  }
60
- } catch (e) {}
61
- },
62
- l = function (e, n, t, r) {
63
- var i, o;
64
- return function (a) {
65
- n.value >= 0 && (a || r) && ((o = n.value - (i || 0)) || void 0 === i) && (i = n.value, n.delta = o, n.rating = function (e, n) {
66
- return e > n[1] ? "poor" : e > n[0] ? "needs-improvement" : "good";
67
- }(n.value, t), e(n));
68
- };
69
- },
70
- p = function (e) {
71
- requestAnimationFrame(function () {
72
- return requestAnimationFrame(function () {
73
- return e();
74
- });
75
- });
76
- },
77
- v = function (e) {
78
- document.addEventListener("visibilitychange", function () {
79
- "hidden" === document.visibilityState && e();
80
- });
80
+ } catch {}
81
81
  },
82
- m = function (e) {
83
- var n = false;
84
- return function () {
85
- n || (e(), n = true);
82
+ u = e => {
83
+ let t = false;
84
+ return () => {
85
+ t || (e(), t = true);
86
86
  };
87
+ };
88
+ let l = -1;
89
+ const m = () => "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0,
90
+ g = e => {
91
+ "hidden" === document.visibilityState && l > -1 && (l = "visibilitychange" === e.type ? e.timeStamp : 0, p());
87
92
  },
88
- h = -1,
89
- g = function () {
90
- return "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0;
91
- },
92
- T = function (e) {
93
- "hidden" === document.visibilityState && h > -1 && (h = "visibilitychange" === e.type ? e.timeStamp : 0, E());
94
- },
95
- y = function () {
96
- addEventListener("visibilitychange", T, true), addEventListener("prerenderingchange", T, true);
93
+ v = () => {
94
+ addEventListener("visibilitychange", g, true), addEventListener("prerenderingchange", g, true);
97
95
  },
98
- E = function () {
99
- removeEventListener("visibilitychange", T, true), removeEventListener("prerenderingchange", T, true);
96
+ p = () => {
97
+ removeEventListener("visibilitychange", g, true), removeEventListener("prerenderingchange", g, true);
100
98
  },
101
- C = function () {
102
- return h < 0 && (h = g(), y(), c(function () {
103
- setTimeout(function () {
104
- h = g(), y();
105
- }, 0);
106
- })), {
99
+ y = () => {
100
+ if (l < 0) {
101
+ const e = document.prerendering ? void 0 : globalThis.performance.getEntriesByType("visibility-state").filter(e => "hidden" === e.name)[0]?.startTime;
102
+ l = e ?? m(), v(), n(() => {
103
+ setTimeout(() => {
104
+ l = m(), v();
105
+ });
106
+ });
107
+ }
108
+ return {
107
109
  get firstHiddenTime() {
108
- return h;
110
+ return l;
109
111
  }
110
112
  };
111
113
  },
112
- L = function (e) {
113
- document.prerendering ? addEventListener("prerenderingchange", function () {
114
- return e();
115
- }, true) : e();
114
+ b = e => {
115
+ document.prerendering ? addEventListener("prerenderingchange", () => e(), true) : e();
116
116
  },
117
- S = [1800, 3e3],
118
- b = function (e, n) {
119
- n = n || {}, L(function () {
120
- var t,
121
- r = C(),
122
- i = f("FCP"),
123
- o = d("paint", function (e) {
124
- e.forEach(function (e) {
125
- "first-contentful-paint" === e.name && (o.disconnect(), e.startTime < r.firstHiddenTime && (i.value = Math.max(e.startTime - s(), 0), i.entries.push(e), t(true)));
126
- });
127
- });
128
- o && (t = l(e, i, S, n.reportAllChanges), c(function (r) {
129
- i = f("FCP"), t = l(e, i, S, n.reportAllChanges), p(function () {
130
- i.value = performance.now() - r.timeStamp, t(true);
117
+ P = [1800, 3e3],
118
+ T = (e, t = {}) => {
119
+ b(() => {
120
+ const s = y();
121
+ let a,
122
+ d = c("FCP");
123
+ const h = f("paint", e => {
124
+ for (const t of e) "first-contentful-paint" === t.name && (h.disconnect(), t.startTime < s.firstHiddenTime && (d.value = Math.max(t.startTime - r(), 0), d.entries.push(t), a(true)));
125
+ });
126
+ h && (a = i(e, d, P, t.reportAllChanges), n(n => {
127
+ d = c("FCP"), a = i(e, d, P, t.reportAllChanges), o(() => {
128
+ d.value = performance.now() - n.timeStamp, a(true);
131
129
  });
132
130
  }));
133
131
  });
134
132
  },
135
- w = [.1, .25],
136
- I = 0,
137
- P = 1 / 0,
138
- A = 0,
139
- F = function (e) {
140
- e.forEach(function (e) {
141
- e.interactionId && (P = Math.min(P, e.interactionId), A = Math.max(A, e.interactionId), I = A ? (A - P) / 7 + 1 : 0);
142
- });
143
- },
144
- M = function () {
145
- return n ? I : performance.interactionCount || 0;
146
- },
147
- k = function () {
148
- "interactionCount" in performance || n || (n = d("event", F, {
133
+ E = [.1, .25];
134
+ let _ = 0,
135
+ L = 1 / 0,
136
+ M = 0;
137
+ const w = e => {
138
+ for (const t of e) t.interactionId && (L = Math.min(L, t.interactionId), M = Math.max(M, t.interactionId), _ = M ? (M - L) / 7 + 1 : 0);
139
+ };
140
+ let C;
141
+ const I = () => C ? _ : performance.interactionCount ?? 0,
142
+ F = () => {
143
+ "interactionCount" in performance || C || (C = f("event", w, {
149
144
  type: "event",
150
145
  buffered: true,
151
146
  durationThreshold: 0
152
147
  }));
153
- },
154
- D = [],
155
- B = new Map(),
156
- R = 0,
157
- x = function () {
158
- var e = Math.min(D.length - 1, Math.floor((M() - R) / 50));
159
- return D[e];
160
- },
161
- H = [],
162
- N = function (e) {
163
- if (H.forEach(function (n) {
164
- return n(e);
165
- }), e.interactionId || "first-input" === e.entryType) {
166
- var n = D[D.length - 1],
167
- t = B.get(e.interactionId);
168
- if (t || D.length < 10 || e.duration > n.latency) {
169
- if (t) e.duration > t.latency ? (t.entries = [e], t.latency = e.duration) : e.duration === t.latency && e.startTime === t.entries[0].startTime && t.entries.push(e);else {
170
- var r = {
171
- id: e.interactionId,
172
- latency: e.duration,
173
- entries: [e]
174
- };
175
- B.set(r.id, r), D.push(r);
176
- }
177
- D.sort(function (e, n) {
178
- return n.latency - e.latency;
179
- }), D.length > 10 && D.splice(10).forEach(function (e) {
180
- return B.delete(e.id);
181
- });
148
+ };
149
+ let k = 0;
150
+ class A {
151
+ u = [];
152
+ l = new Map();
153
+ m;
154
+ v;
155
+ p() {
156
+ k = I(), this.u.length = 0, this.l.clear();
157
+ }
158
+ P() {
159
+ const e = Math.min(this.u.length - 1, Math.floor((I() - k) / 50));
160
+ return this.u[e];
161
+ }
162
+ h(e) {
163
+ if (this.m?.(e), !e.interactionId && "first-input" !== e.entryType) return;
164
+ const t = this.u.at(-1);
165
+ let n = this.l.get(e.interactionId);
166
+ if (n || this.u.length < 10 || e.duration > t.T) {
167
+ if (n ? e.duration > n.T ? (n.entries = [e], n.T = e.duration) : e.duration === n.T && e.startTime === n.entries[0].startTime && n.entries.push(e) : (n = {
168
+ id: e.interactionId,
169
+ entries: [e],
170
+ T: e.duration
171
+ }, this.l.set(n.id, n), this.u.push(n)), this.u.sort((e, t) => t.T - e.T), this.u.length > 10) {
172
+ const e = this.u.splice(10);
173
+ for (const t of e) this.l.delete(t.id);
182
174
  }
175
+ this.v?.(n);
183
176
  }
177
+ }
178
+ }
179
+ const B = e => {
180
+ const t = globalThis.requestIdleCallback || setTimeout;
181
+ "hidden" === document.visibilityState ? e() : (t(e = u(e)), document.addEventListener("visibilitychange", e, {
182
+ once: true
183
+ }));
184
184
  },
185
- q = function (e) {
186
- var n = self.requestIdleCallback || self.setTimeout,
187
- t = -1;
188
- return e = m(e), "hidden" === document.visibilityState ? e() : (t = n(e), v(e)), t;
189
- },
190
- O = [200, 500],
191
- j = [2500, 4e3],
192
- V = {},
193
- _ = [800, 1800],
194
- z = function e(n) {
195
- document.prerendering ? L(function () {
196
- return e(n);
197
- }) : "complete" !== document.readyState ? addEventListener("load", function () {
198
- return e(n);
199
- }, true) : setTimeout(n, 0);
200
- },
201
- G = {
202
- passive: true,
203
- capture: true
204
- },
205
- J = new Date(),
206
- K = function (e, n) {
207
- t || (t = n, r = e, i = new Date(), W(removeEventListener), Q());
208
- },
209
- Q = function () {
210
- if (r >= 0 && r < i - J) {
211
- var e = {
212
- entryType: "first-input",
213
- name: t.type,
214
- target: t.target,
215
- cancelable: t.cancelable,
216
- startTime: t.timeStamp,
217
- processingStart: t.timeStamp + r
218
- };
219
- o.forEach(function (n) {
220
- n(e);
221
- }), o = [];
222
- }
223
- },
224
- U = function (e) {
225
- if (e.cancelable) {
226
- var n = (e.timeStamp > 1e12 ? new Date() : performance.now()) - e.timeStamp;
227
- "pointerdown" == e.type ? function (e, n) {
228
- var t = function () {
229
- K(e, n), i();
230
- },
231
- r = function () {
232
- i();
233
- },
234
- i = function () {
235
- removeEventListener("pointerup", t, G), removeEventListener("pointercancel", r, G);
236
- };
237
- addEventListener("pointerup", t, G), addEventListener("pointercancel", r, G);
238
- }(n, e) : K(n, e);
239
- }
240
- },
241
- W = function (e) {
242
- ["mousedown", "keydown", "touchstart", "pointerdown"].forEach(function (n) {
243
- return e(n, U, G);
244
- });
245
- },
246
- X = [100, 300];
247
- return e.CLSThresholds = w, e.FCPThresholds = S, e.FIDThresholds = X, e.INPThresholds = O, e.LCPThresholds = j, e.TTFBThresholds = _, e.onCLS = function (e, n) {
248
- n = n || {}, b(m(function () {
249
- var t,
250
- r = f("CLS", 0),
251
- i = 0,
252
- o = [],
253
- a = function (e) {
254
- e.forEach(function (e) {
255
- if (!e.hadRecentInput) {
256
- var n = o[0],
257
- t = o[o.length - 1];
258
- i && e.startTime - t.startTime < 1e3 && e.startTime - n.startTime < 5e3 ? (i += e.value, o.push(e)) : (i = e.value, o = [e]);
259
- }
260
- }), i > r.value && (r.value = i, r.entries = o, t());
185
+ N = [200, 500];
186
+ class S {
187
+ m;
188
+ h(e) {
189
+ this.m?.(e);
190
+ }
191
+ }
192
+ const q = [2500, 4e3],
193
+ O = [800, 1800],
194
+ V = e => {
195
+ document.prerendering ? b(() => V(e)) : "complete" !== document.readyState ? addEventListener("load", () => V(e), true) : setTimeout(e);
196
+ };
197
+ return e.CLSThresholds = E, e.FCPThresholds = P, e.INPThresholds = N, e.LCPThresholds = q, e.TTFBThresholds = O, e.onCLS = (e, t = {}) => {
198
+ T(u(() => {
199
+ let s,
200
+ r = c("CLS", 0);
201
+ const a = d(t, h),
202
+ u = e => {
203
+ for (const t of e) a.h(t);
204
+ a.i > r.value && (r.value = a.i, r.entries = a.o, s());
261
205
  },
262
- u = d("layout-shift", a);
263
- u && (t = l(e, r, w, n.reportAllChanges), v(function () {
264
- a(u.takeRecords()), t(true);
265
- }), c(function () {
266
- i = 0, r = f("CLS", 0), t = l(e, r, w, n.reportAllChanges), p(function () {
267
- return t();
268
- });
269
- }), setTimeout(t, 0));
206
+ l = f("layout-shift", u);
207
+ l && (s = i(e, r, E, t.reportAllChanges), document.addEventListener("visibilitychange", () => {
208
+ "hidden" === document.visibilityState && (u(l.takeRecords()), s(true));
209
+ }), n(() => {
210
+ a.i = 0, r = c("CLS", 0), s = i(e, r, E, t.reportAllChanges), o(() => s());
211
+ }), setTimeout(s));
270
212
  }));
271
- }, e.onFCP = b, e.onFID = function (e, n) {
272
- n = n || {}, L(function () {
273
- var i,
274
- a = C(),
275
- u = f("FID"),
276
- s = function (e) {
277
- e.startTime < a.firstHiddenTime && (u.value = e.processingStart - e.startTime, u.entries.push(e), i(true));
278
- },
279
- p = function (e) {
280
- e.forEach(s);
281
- },
282
- h = d("first-input", p);
283
- i = l(e, u, X, n.reportAllChanges), h && (v(m(function () {
284
- p(h.takeRecords()), h.disconnect();
285
- })), c(function () {
286
- var a;
287
- u = f("FID"), i = l(e, u, X, n.reportAllChanges), o = [], r = -1, t = null, W(addEventListener), a = s, o.push(a), Q();
288
- }));
289
- });
290
- }, e.onINP = function (e, n) {
291
- "PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (n = n || {}, L(function () {
292
- var t;
293
- k();
294
- var r,
295
- i = f("INP"),
296
- o = function (e) {
297
- q(function () {
298
- e.forEach(N);
299
- var n = x();
300
- n && n.latency !== i.value && (i.value = n.latency, i.entries = n.entries, r());
213
+ }, e.onFCP = T, e.onINP = (e, t = {}) => {
214
+ globalThis.PerformanceEventTiming && "interactionId" in PerformanceEventTiming.prototype && b(() => {
215
+ F();
216
+ let o,
217
+ s = c("INP");
218
+ const r = d(t, A),
219
+ a = e => {
220
+ B(() => {
221
+ for (const t of e) r.h(t);
222
+ const t = r.P();
223
+ t && t.T !== s.value && (s.value = t.T, s.entries = t.entries, o());
301
224
  });
302
225
  },
303
- a = d("event", o, {
304
- durationThreshold: null !== (t = n.durationThreshold) && void 0 !== t ? t : 40
226
+ h = f("event", a, {
227
+ durationThreshold: t.durationThreshold ?? 40
305
228
  });
306
- r = l(e, i, O, n.reportAllChanges), a && (a.observe({
229
+ o = i(e, s, N, t.reportAllChanges), h && (h.observe({
307
230
  type: "first-input",
308
231
  buffered: true
309
- }), v(function () {
310
- o(a.takeRecords()), r(true);
311
- }), c(function () {
312
- R = M(), D.length = 0, B.clear(), i = f("INP"), r = l(e, i, O, n.reportAllChanges);
232
+ }), document.addEventListener("visibilitychange", () => {
233
+ "hidden" === document.visibilityState && (a(h.takeRecords()), o(true));
234
+ }), n(() => {
235
+ r.p(), s = c("INP"), o = i(e, s, N, t.reportAllChanges);
313
236
  }));
314
- }));
315
- }, e.onLCP = function (e, n) {
316
- n = n || {}, L(function () {
317
- var t,
318
- r = C(),
319
- i = f("LCP"),
320
- o = function (e) {
321
- n.reportAllChanges || (e = e.slice(-1)), e.forEach(function (e) {
322
- e.startTime < r.firstHiddenTime && (i.value = Math.max(e.startTime - s(), 0), i.entries = [e], t());
323
- });
237
+ });
238
+ }, e.onLCP = (e, t = {}) => {
239
+ b(() => {
240
+ const s = y();
241
+ let a,
242
+ h = c("LCP");
243
+ const l = d(t, S),
244
+ m = e => {
245
+ t.reportAllChanges || (e = e.slice(-1));
246
+ for (const t of e) l.h(t), t.startTime < s.firstHiddenTime && (h.value = Math.max(t.startTime - r(), 0), h.entries = [t], a());
324
247
  },
325
- a = d("largest-contentful-paint", o);
326
- if (a) {
327
- t = l(e, i, j, n.reportAllChanges);
328
- var u = m(function () {
329
- V[i.id] || (o(a.takeRecords()), a.disconnect(), V[i.id] = true, t(true));
248
+ g = f("largest-contentful-paint", m);
249
+ if (g) {
250
+ a = i(e, h, q, t.reportAllChanges);
251
+ const s = u(() => {
252
+ m(g.takeRecords()), g.disconnect(), a(true);
330
253
  });
331
- ["keydown", "click"].forEach(function (e) {
332
- addEventListener(e, function () {
333
- return q(u);
334
- }, {
335
- once: true,
336
- capture: true
337
- });
338
- }), v(u), c(function (r) {
339
- i = f("LCP"), t = l(e, i, j, n.reportAllChanges), p(function () {
340
- i.value = performance.now() - r.timeStamp, V[i.id] = true, t(true);
254
+ for (const e of ["keydown", "click", "visibilitychange"]) addEventListener(e, () => B(s), {
255
+ capture: true,
256
+ once: true
257
+ });
258
+ n(n => {
259
+ h = c("LCP"), a = i(e, h, q, t.reportAllChanges), o(() => {
260
+ h.value = performance.now() - n.timeStamp, a(true);
341
261
  });
342
262
  });
343
263
  }
344
264
  });
345
- }, e.onTTFB = function (e, n) {
346
- n = n || {};
347
- var t = f("TTFB"),
348
- r = l(e, t, _, n.reportAllChanges);
349
- z(function () {
350
- var i = u();
351
- i && (t.value = Math.max(i.responseStart - s(), 0), t.entries = [i], r(true), c(function () {
352
- t = f("TTFB", 0), (r = l(e, t, _, n.reportAllChanges))(true);
265
+ }, e.onTTFB = (e, t = {}) => {
266
+ let o = c("TTFB"),
267
+ a = i(e, o, O, t.reportAllChanges);
268
+ V(() => {
269
+ const d = s();
270
+ d && (o.value = Math.max(d.responseStart - r(), 0), o.entries = [d], a(true), n(() => {
271
+ o = c("TTFB", 0), a = i(e, o, O, t.reportAllChanges), a(true);
353
272
  }));
354
273
  });
355
274
  }, e;