@blueking/open-telemetry 0.0.22-beta.1 → 0.0.23
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 +258 -70
- package/dist/bk-rum.global.js +2 -2
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/config.d.ts +10 -10
- package/dist/core/runtime-context.d.ts +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +608 -662
- package/dist/index.js.map +1 -1
- package/dist/plugins/blank-screen.d.ts +1 -1
- package/dist/plugins/common.d.ts +2 -2
- package/dist/plugins/device.d.ts +2 -2
- package/dist/plugins/resource.d.ts +1 -0
- package/dist/plugins/web-vitals.d.ts +1 -3
- package/dist/schema/attributes.d.ts +6 -7
- package/dist/schema/span.d.ts +24 -15
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +31 -30
- package/skills/bk-rum-otele/references/actions.md +166 -0
- package/skills/bk-rum-otele/references/api.md +248 -215
- package/skills/bk-rum-otele/references/architecture.md +139 -37
- package/skills/bk-rum-otele/references/blank-screen.md +190 -0
- package/skills/bk-rum-otele/references/capabilities.md +175 -83
- package/skills/bk-rum-otele/references/configuration.md +226 -151
- package/skills/bk-rum-otele/references/data-model.md +157 -24
- package/skills/bk-rum-otele/references/errors-security.md +168 -0
- package/skills/bk-rum-otele/references/extensions.md +237 -0
- package/skills/bk-rum-otele/references/framework-integration.md +318 -75
- package/skills/bk-rum-otele/references/getting-started.md +186 -70
- package/skills/bk-rum-otele/references/network.md +258 -0
- package/skills/bk-rum-otele/references/performance.md +198 -0
- package/skills/bk-rum-otele/references/privacy.md +236 -67
- package/skills/bk-rum-otele/references/production.md +266 -0
- package/skills/bk-rum-otele/references/session-context.md +185 -0
- package/skills/bk-rum-otele/references/telemetry-reference.md +500 -51
- package/skills/bk-rum-otele/references/transport-sampling.md +321 -32
- package/skills/bk-rum-otele/references/troubleshooting.md +341 -151
- package/skills/bk-rum-otele/references/views-routing.md +211 -0
- package/skills/bk-rum-otele/references/concepts.md +0 -60
- package/skills/bk-rum-otele/references/custom-plugin.md +0 -170
- package/skills/bk-rum-otele/references/plugins-basic.md +0 -135
- package/skills/bk-rum-otele/references/plugins-error-security.md +0 -86
- package/skills/bk-rum-otele/references/plugins-experience.md +0 -124
- package/skills/bk-rum-otele/references/plugins-network.md +0 -32
- package/skills/bk-rum-otele/references/plugins.md +0 -62
package/dist/index.js
CHANGED
|
@@ -2,16 +2,15 @@ import { SpanKind as e, SpanStatusCode as t, context as n, propagation as r, tra
|
|
|
2
2
|
import { ZoneContextManager as a } from "@opentelemetry/context-zone";
|
|
3
3
|
import { W3CTraceContextPropagator as o } from "@opentelemetry/core";
|
|
4
4
|
import { OTLPTraceExporter as s } from "@opentelemetry/exporter-trace-otlp-http";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { WebTracerProvider as p } from "@opentelemetry/sdk-trace-web";
|
|
5
|
+
import { resourceFromAttributes as c } from "@opentelemetry/resources";
|
|
6
|
+
import { BatchSpanProcessor as l, SamplingDecision as u, SimpleSpanProcessor as d } from "@opentelemetry/sdk-trace-base";
|
|
7
|
+
import { WebTracerProvider as f } from "@opentelemetry/sdk-trace-web";
|
|
9
8
|
//#region package.json
|
|
10
|
-
var
|
|
9
|
+
var p = "0.0.23", m = (e) => {
|
|
11
10
|
let t = 5381;
|
|
12
11
|
for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n);
|
|
13
12
|
return (t >>> 0).toString(36);
|
|
14
|
-
},
|
|
13
|
+
}, h = (e) => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`, g = {
|
|
15
14
|
actionFrustrationType: "action.frustration.type",
|
|
16
15
|
actionId: "action.id",
|
|
17
16
|
actionLoadingTime: "action.loading_time",
|
|
@@ -26,11 +25,6 @@ var m = "0.0.22-beta.1", h = (e) => typeof crypto < "u" && typeof crypto.randomU
|
|
|
26
25
|
deviceLogicalProcessorCount: "device.logical_processor_count",
|
|
27
26
|
deviceMemoryGib: "device.memory_gib",
|
|
28
27
|
deviceType: "device.type",
|
|
29
|
-
eventId: "event.id",
|
|
30
|
-
eventPhase: "event.phase",
|
|
31
|
-
eventTimestamp: "event.timestamp",
|
|
32
|
-
eventType: "event.type",
|
|
33
|
-
errorType: "error_type",
|
|
34
28
|
longTaskBlockingDuration: "long_task.blocking_duration",
|
|
35
29
|
longTaskDuration: "long_task.duration",
|
|
36
30
|
longTaskEntryType: "long_task.entry_type",
|
|
@@ -38,7 +32,8 @@ var m = "0.0.22-beta.1", h = (e) => typeof crypto < "u" && typeof crypto.randomU
|
|
|
38
32
|
longTaskStartTime: "long_task.start_time",
|
|
39
33
|
networkEffectiveType: "network.effective_type",
|
|
40
34
|
nextHopProtocol: "resource.protocol",
|
|
41
|
-
|
|
35
|
+
outcomeReason: "outcome.reason",
|
|
36
|
+
outcomeType: "outcome.type",
|
|
42
37
|
rumSchemaVersion: "rum.schema.version",
|
|
43
38
|
serviceName: "service.name",
|
|
44
39
|
serviceVersion: "service.version",
|
|
@@ -46,9 +41,9 @@ var m = "0.0.22-beta.1", h = (e) => typeof crypto < "u" && typeof crypto.randomU
|
|
|
46
41
|
sessionHasReplay: "session.has_replay",
|
|
47
42
|
sessionId: "session.id",
|
|
48
43
|
sessionSampleRate: "session.sample_rate",
|
|
44
|
+
sessionPhase: "session.phase",
|
|
49
45
|
sessionStartTime: "session.start_time",
|
|
50
46
|
sessionType: "session.type",
|
|
51
|
-
spanSubtype: "span_subtype",
|
|
52
47
|
spanType: "span_type",
|
|
53
48
|
userId: "user.id",
|
|
54
49
|
vitalMetric: "vital.metric",
|
|
@@ -63,43 +58,46 @@ var m = "0.0.22-beta.1", h = (e) => typeof crypto < "u" && typeof crypto.randomU
|
|
|
63
58
|
viewLoadingTime: "view.loading_time",
|
|
64
59
|
viewLoadingType: "view.loading_type",
|
|
65
60
|
viewName: "view.name",
|
|
61
|
+
viewPhase: "view.phase",
|
|
62
|
+
viewSource: "view.source",
|
|
66
63
|
viewStartedAt: "view.started_at",
|
|
67
64
|
viewUrl: "view.url",
|
|
68
65
|
viewUrlPathGroup: "view.url_path_group",
|
|
69
|
-
viewVersion: "view.version"
|
|
66
|
+
viewVersion: "view.version",
|
|
67
|
+
websocketPhase: "websocket.phase"
|
|
70
68
|
};
|
|
71
69
|
//#endregion
|
|
72
70
|
//#region \0@oxc-project+runtime@0.128.0/helpers/typeof.js
|
|
73
|
-
function
|
|
71
|
+
function _(e) {
|
|
74
72
|
"@babel/helpers - typeof";
|
|
75
|
-
return
|
|
73
|
+
return _ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
76
74
|
return typeof e;
|
|
77
75
|
} : function(e) {
|
|
78
76
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
79
|
-
},
|
|
77
|
+
}, _(e);
|
|
80
78
|
}
|
|
81
79
|
//#endregion
|
|
82
80
|
//#region \0@oxc-project+runtime@0.128.0/helpers/toPrimitive.js
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
81
|
+
function v(e, t) {
|
|
82
|
+
if (_(e) != "object" || !e) return e;
|
|
85
83
|
var n = e[Symbol.toPrimitive];
|
|
86
84
|
if (n !== void 0) {
|
|
87
85
|
var r = n.call(e, t || "default");
|
|
88
|
-
if (
|
|
86
|
+
if (_(r) != "object") return r;
|
|
89
87
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
90
88
|
}
|
|
91
89
|
return (t === "string" ? String : Number)(e);
|
|
92
90
|
}
|
|
93
91
|
//#endregion
|
|
94
92
|
//#region \0@oxc-project+runtime@0.128.0/helpers/toPropertyKey.js
|
|
95
|
-
function
|
|
96
|
-
var t =
|
|
97
|
-
return
|
|
93
|
+
function y(e) {
|
|
94
|
+
var t = v(e, "string");
|
|
95
|
+
return _(t) == "symbol" ? t : t + "";
|
|
98
96
|
}
|
|
99
97
|
//#endregion
|
|
100
98
|
//#region \0@oxc-project+runtime@0.128.0/helpers/defineProperty.js
|
|
101
|
-
function
|
|
102
|
-
return (t =
|
|
99
|
+
function b(e, t, n) {
|
|
100
|
+
return (t = y(t)) in e ? Object.defineProperty(e, t, {
|
|
103
101
|
value: n,
|
|
104
102
|
enumerable: !0,
|
|
105
103
|
configurable: !0,
|
|
@@ -108,7 +106,7 @@ function x(e, t, n) {
|
|
|
108
106
|
}
|
|
109
107
|
//#endregion
|
|
110
108
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectSpread2.js
|
|
111
|
-
function
|
|
109
|
+
function x(e, t) {
|
|
112
110
|
var n = Object.keys(e);
|
|
113
111
|
if (Object.getOwnPropertySymbols) {
|
|
114
112
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -118,12 +116,12 @@ function S(e, t) {
|
|
|
118
116
|
}
|
|
119
117
|
return n;
|
|
120
118
|
}
|
|
121
|
-
function
|
|
119
|
+
function S(e) {
|
|
122
120
|
for (var t = 1; t < arguments.length; t++) {
|
|
123
121
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
124
|
-
t % 2 ?
|
|
125
|
-
|
|
126
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
122
|
+
t % 2 ? x(Object(n), !0).forEach(function(t) {
|
|
123
|
+
b(e, t, n[t]);
|
|
124
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : x(Object(n)).forEach(function(t) {
|
|
127
125
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
128
126
|
});
|
|
129
127
|
}
|
|
@@ -131,7 +129,7 @@ function C(e) {
|
|
|
131
129
|
}
|
|
132
130
|
//#endregion
|
|
133
131
|
//#region src/plugins/device.ts
|
|
134
|
-
var
|
|
132
|
+
var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () => navigator.userAgentData, te = (e) => {
|
|
135
133
|
for (let [t, n] of [
|
|
136
134
|
["Edge", /Edg\/([\d.]+)/],
|
|
137
135
|
["Chrome", /Chrome\/([\d.]+)/],
|
|
@@ -148,10 +146,10 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
148
146
|
name: "Other",
|
|
149
147
|
version: void 0
|
|
150
148
|
};
|
|
151
|
-
},
|
|
149
|
+
}, ne = (e, t) => {
|
|
152
150
|
let n = `${t == null ? "" : t} ${e}`;
|
|
153
151
|
return /iphone|ipad|ipod/i.test(n) ? "iOS" : /android/i.test(n) ? "Android" : /mac/i.test(n) ? "macOS" : /win/i.test(n) ? "Windows" : /linux/i.test(n) ? "Linux" : "Other";
|
|
154
|
-
},
|
|
152
|
+
}, re = (e) => {
|
|
155
153
|
let t = null;
|
|
156
154
|
try {
|
|
157
155
|
t = window.localStorage.getItem(e);
|
|
@@ -162,7 +160,7 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
162
160
|
window.localStorage.setItem(e, n);
|
|
163
161
|
} catch (e) {}
|
|
164
162
|
return n;
|
|
165
|
-
},
|
|
163
|
+
}, ie = () => {
|
|
166
164
|
var e, t;
|
|
167
165
|
return typeof window > "u" ? {} : {
|
|
168
166
|
"browser.viewport.width": window.innerWidth,
|
|
@@ -170,8 +168,8 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
170
168
|
"browser.screen.width": (e = window.screen) == null ? void 0 : e.width,
|
|
171
169
|
"browser.screen.height": (t = window.screen) == null ? void 0 : t.height
|
|
172
170
|
};
|
|
173
|
-
},
|
|
174
|
-
let e =
|
|
171
|
+
}, ae = () => {
|
|
172
|
+
let e = T();
|
|
175
173
|
return e ? {
|
|
176
174
|
"network.effective_type": e.effectiveType,
|
|
177
175
|
"network.connection_type": e.type,
|
|
@@ -179,40 +177,40 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
179
177
|
"network.rtt": e.rtt,
|
|
180
178
|
"network.save_data": e.saveData
|
|
181
179
|
} : {};
|
|
182
|
-
},
|
|
180
|
+
}, oe = () => {
|
|
183
181
|
if (typeof navigator > "u") return {};
|
|
184
|
-
let e =
|
|
182
|
+
let e = ee(), t = navigator.userAgent, n = te(t), r = ne(t, e == null ? void 0 : e.platform), i = e != null && e.mobile || /mobi|android|iphone|ipad|ipod/i.test(t) ? "mobile" : "desktop";
|
|
185
183
|
return {
|
|
186
|
-
[
|
|
187
|
-
[
|
|
188
|
-
[
|
|
189
|
-
[
|
|
190
|
-
[
|
|
191
|
-
[
|
|
184
|
+
[g.deviceMemoryGib]: navigator.deviceMemory,
|
|
185
|
+
[g.deviceLogicalProcessorCount]: navigator.hardwareConcurrency,
|
|
186
|
+
[g.browserName]: n.name,
|
|
187
|
+
[g.browserVersion]: n.version,
|
|
188
|
+
[g.deviceType]: i,
|
|
189
|
+
[g.osName]: r
|
|
192
190
|
};
|
|
193
|
-
},
|
|
191
|
+
}, se = (e, t) => {
|
|
194
192
|
let n;
|
|
195
193
|
return () => {
|
|
196
194
|
n !== void 0 && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
197
195
|
n = void 0, e();
|
|
198
196
|
}, t);
|
|
199
197
|
};
|
|
200
|
-
},
|
|
198
|
+
}, ce = (e = {}) => {
|
|
201
199
|
let t = [];
|
|
202
200
|
return {
|
|
203
201
|
name: "device",
|
|
204
202
|
init(n) {
|
|
205
203
|
var r;
|
|
206
|
-
let i = (r = e.storageKey) == null ? `${
|
|
207
|
-
if (n.setRuntimeAttributes(
|
|
208
|
-
let o =
|
|
209
|
-
n.setRuntimeAttributes(
|
|
210
|
-
},
|
|
204
|
+
let i = (r = e.storageKey) == null ? `${C}_${m(n.config.application.name)}` : r, a = typeof window > "u" || e.persistentId !== !0 ? h("device") : re(i);
|
|
205
|
+
if (n.setRuntimeAttributes(S(S(S({ "device.id": a }, n.config.tracking.device === !1 ? oe() : {}), ie()), ae())), typeof window > "u") return;
|
|
206
|
+
let o = se(() => {
|
|
207
|
+
n.setRuntimeAttributes(ie());
|
|
208
|
+
}, w);
|
|
211
209
|
window.addEventListener("resize", o), window.addEventListener("orientationchange", o), t.push(() => window.removeEventListener("resize", o), () => window.removeEventListener("orientationchange", o));
|
|
212
|
-
let s =
|
|
210
|
+
let s = T();
|
|
213
211
|
if (s && typeof s.addEventListener == "function") {
|
|
214
212
|
let e = () => {
|
|
215
|
-
n.setRuntimeAttributes(
|
|
213
|
+
n.setRuntimeAttributes(ae());
|
|
216
214
|
};
|
|
217
215
|
s.addEventListener("change", e), t.push(() => {
|
|
218
216
|
var t;
|
|
@@ -227,48 +225,49 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
227
225
|
}
|
|
228
226
|
}
|
|
229
227
|
};
|
|
230
|
-
},
|
|
228
|
+
}, le = (e) => e.trim().replace(/\/+$/, ""), ue = (e) => {
|
|
231
229
|
var t;
|
|
232
|
-
let n = e.token || e.headers ?
|
|
230
|
+
let n = e.token || e.headers ? S(S({}, e.token ? { Authorization: `Bearer ${e.token}` } : {}), (t = e.headers) == null ? {} : t) : void 0;
|
|
233
231
|
return {
|
|
234
232
|
concurrencyLimit: e.concurrencyLimit,
|
|
235
|
-
endpoint: `${
|
|
233
|
+
endpoint: `${le(e.endpoint)}/v1/rum`,
|
|
236
234
|
headers: n,
|
|
237
235
|
timeoutMillis: e.timeoutMillis
|
|
238
236
|
};
|
|
239
|
-
},
|
|
237
|
+
}, de = (e) => typeof e != "number" || !Number.isFinite(e) ? 1 : Math.max(0, Math.min(1, e)), fe = (e) => e, pe = (e) => {
|
|
238
|
+
if (!e) return e;
|
|
240
239
|
try {
|
|
241
240
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
242
241
|
return t.username = "", t.password = "", t.search = "", t.hash = "", t.href;
|
|
243
242
|
} catch (t) {
|
|
244
243
|
return e.replace(/[?#].*$/, "");
|
|
245
244
|
}
|
|
246
|
-
},
|
|
245
|
+
}, me = (e) => {
|
|
247
246
|
try {
|
|
248
247
|
return new URL(e, typeof location > "u" ? "http://localhost" : location.href).pathname || "/";
|
|
249
248
|
} catch (t) {
|
|
250
249
|
return e || "/";
|
|
251
250
|
}
|
|
252
|
-
},
|
|
251
|
+
}, he = (e) => {
|
|
253
252
|
var t;
|
|
254
253
|
return {
|
|
255
254
|
environment: (t = e.environment) == null ? "production" : t,
|
|
256
255
|
name: e.name,
|
|
257
256
|
version: e.version
|
|
258
257
|
};
|
|
259
|
-
},
|
|
260
|
-
[
|
|
261
|
-
[
|
|
262
|
-
}, e.version ? { [
|
|
263
|
-
[
|
|
258
|
+
}, ge = (e, t, n) => S(S(S({ [g.deploymentEnvironmentName]: e.environment }, t === !1 ? {} : oe()), {}, {
|
|
259
|
+
[g.rumSchemaVersion]: "3",
|
|
260
|
+
[g.serviceName]: e.name
|
|
261
|
+
}, e.version ? { [g.serviceVersion]: e.version } : {}), {}, {
|
|
262
|
+
[g.sessionSampleRate]: n,
|
|
264
263
|
"telemetry.sdk.language": "webjs",
|
|
265
264
|
"telemetry.sdk.name": "@blueking/open-telemetry",
|
|
266
|
-
"telemetry.sdk.version":
|
|
267
|
-
}),
|
|
265
|
+
"telemetry.sdk.version": p
|
|
266
|
+
}), _e = (e) => {
|
|
268
267
|
var t;
|
|
269
268
|
if (!e) throw Error("[bk-ot] transport is required.");
|
|
270
269
|
if (!((t = e.endpoint) != null && t.trim())) throw Error("[bk-ot] transport.endpoint is required.");
|
|
271
|
-
},
|
|
270
|
+
}, ve = (e) => {
|
|
272
271
|
var t, n, r, i, a, o, s, c, l, u, d;
|
|
273
272
|
return {
|
|
274
273
|
beforeSend: (t = e.tracking) == null ? void 0 : t.beforeSend,
|
|
@@ -280,16 +279,16 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
280
279
|
getCustomAttributes: (o = (s = e.context) == null || (s = s.attributes) == null ? void 0 : s.custom) == null ? (() => ({})) : o,
|
|
281
280
|
getViewPathGroup: (t) => {
|
|
282
281
|
var n, r, i, a;
|
|
283
|
-
return (n = typeof ((r = e.tracking) == null ? void 0 : r.view) == "object" ? (i = (a = e.tracking.view).getPathGroup) == null ? void 0 : i.call(a, t) : void 0) == null ?
|
|
282
|
+
return (n = typeof ((r = e.tracking) == null ? void 0 : r.view) == "object" ? (i = (a = e.tracking.view).getPathGroup) == null ? void 0 : i.call(a, t) : void 0) == null ? me(t) : n;
|
|
284
283
|
},
|
|
285
|
-
redactAttributes: (c = (l = e.privacy) == null ? void 0 : l.redactAttributes) == null ?
|
|
286
|
-
redactUrl: (u = (d = e.privacy) == null ? void 0 : d.redactUrl) == null ?
|
|
284
|
+
redactAttributes: (c = (l = e.privacy) == null ? void 0 : l.redactAttributes) == null ? fe : c,
|
|
285
|
+
redactUrl: (u = (d = e.privacy) == null ? void 0 : d.redactUrl) == null ? pe : u
|
|
287
286
|
};
|
|
288
|
-
},
|
|
287
|
+
}, ye = (e) => {
|
|
289
288
|
var t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g;
|
|
290
289
|
if (!(!((t = e.application) == null || (t = t.name) == null) && t.trim())) throw Error("[bk-ot] application.name is required.");
|
|
291
|
-
|
|
292
|
-
let _ =
|
|
290
|
+
_e(e.transport);
|
|
291
|
+
let _ = he(e.application), v = typeof ((n = e.tracking) == null ? void 0 : n.view) == "object" ? e.tracking.view : void 0, y = ve(e), b = de((r = e.session) == null ? void 0 : r.sampleRate);
|
|
293
292
|
return {
|
|
294
293
|
application: _,
|
|
295
294
|
autoStart: (i = e.autoStart) == null ? !0 : i,
|
|
@@ -300,13 +299,13 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
300
299
|
plugins: [...(l = (u = e.extensions) == null ? void 0 : u.plugins) == null ? [] : l]
|
|
301
300
|
},
|
|
302
301
|
hooks: y,
|
|
303
|
-
resourceAttributes: y.redactAttributes(
|
|
304
|
-
session:
|
|
302
|
+
resourceAttributes: y.redactAttributes(ge(_, (d = e.tracking) == null ? void 0 : d.device, b)),
|
|
303
|
+
session: S(S({}, e.session), {}, { sampleRate: b }),
|
|
305
304
|
spanBatch: e.transport.batch,
|
|
306
305
|
spanProcessor: (f = e.transport.processor) == null ? "batch" : f,
|
|
307
306
|
tracking: (p = e.tracking) == null ? {} : p,
|
|
308
307
|
trackingConsent: (m = (h = e.privacy) == null ? void 0 : h.trackingConsent) == null ? "granted" : m,
|
|
309
|
-
transport:
|
|
308
|
+
transport: ue(e.transport),
|
|
310
309
|
user: (g = e.context) == null ? void 0 : g.user,
|
|
311
310
|
view: {
|
|
312
311
|
excludedActivityUrls: v == null ? void 0 : v.excludedActivityUrls,
|
|
@@ -317,7 +316,7 @@ var w = "BK_RUM_DEVICE_ID", T = 250, ee = () => navigator.connection, te = () =>
|
|
|
317
316
|
};
|
|
318
317
|
//#endregion
|
|
319
318
|
//#region \0@oxc-project+runtime@0.128.0/helpers/asyncToGenerator.js
|
|
320
|
-
function
|
|
319
|
+
function be(e, t, n, r, i, a, o) {
|
|
321
320
|
try {
|
|
322
321
|
var s = e[a](o), c = s.value;
|
|
323
322
|
} catch (e) {
|
|
@@ -332,10 +331,10 @@ function E(e) {
|
|
|
332
331
|
return new Promise(function(r, i) {
|
|
333
332
|
var a = e.apply(t, n);
|
|
334
333
|
function o(e) {
|
|
335
|
-
|
|
334
|
+
be(a, r, i, o, s, "next", e);
|
|
336
335
|
}
|
|
337
336
|
function s(e) {
|
|
338
|
-
|
|
337
|
+
be(a, r, i, o, s, "throw", e);
|
|
339
338
|
}
|
|
340
339
|
o(void 0);
|
|
341
340
|
});
|
|
@@ -343,9 +342,9 @@ function E(e) {
|
|
|
343
342
|
}
|
|
344
343
|
//#endregion
|
|
345
344
|
//#region src/core/plugin.ts
|
|
346
|
-
var
|
|
345
|
+
var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !== !1, Se = (e) => e, Ce = class {
|
|
347
346
|
constructor(e) {
|
|
348
|
-
|
|
347
|
+
b(this, "plugins", void 0), b(this, "startedPlugins", []), this.plugins = e;
|
|
349
348
|
}
|
|
350
349
|
flush() {
|
|
351
350
|
var e = this;
|
|
@@ -370,7 +369,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
370
369
|
start(e) {
|
|
371
370
|
var t = this;
|
|
372
371
|
return E(function* () {
|
|
373
|
-
for (let r of t.plugins) if (
|
|
372
|
+
for (let r of t.plugins) if (xe(r, e.config)) try {
|
|
374
373
|
yield r.init(e), t.startedPlugins.push(r);
|
|
375
374
|
} catch (t) {
|
|
376
375
|
if (e.config.debug) {
|
|
@@ -380,38 +379,38 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
380
379
|
}
|
|
381
380
|
})();
|
|
382
381
|
}
|
|
383
|
-
}, D = "bk.rum.sampled",
|
|
382
|
+
}, D = "bk.rum.sampled", we = (e) => {
|
|
384
383
|
let t = 2166136261;
|
|
385
384
|
for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
386
385
|
return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
|
|
387
|
-
},
|
|
386
|
+
}, Te = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : we(`${e.name}\0${n}`) < t.sampleRate, Ee = () => typeof window > "u" ? "http://localhost" : window.location.origin, O = (e) => {
|
|
388
387
|
try {
|
|
389
|
-
return new URL(e,
|
|
388
|
+
return new URL(e, Ee()).href;
|
|
390
389
|
} catch (t) {
|
|
391
390
|
return e;
|
|
392
391
|
}
|
|
393
|
-
},
|
|
394
|
-
let n = (e) =>
|
|
392
|
+
}, De = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, Oe = (e, t) => {
|
|
393
|
+
let n = (e) => De(e.replace(/[?#].*$/, ""));
|
|
395
394
|
return n(e) === n(t);
|
|
396
|
-
},
|
|
395
|
+
}, ke = (e, t) => Oe(O(t), O(e.transport.endpoint)), k = (e, t) => ke(e, t), Ae = (e, t) => typeof e == "function" ? e(t) : typeof e == "string" ? t.includes(e) : (e.lastIndex = 0, e.test(t)), A = (e, t) => (Array.isArray(e) ? e : e ? [e] : []).some((e) => Ae(e, t)), je = (e) => typeof e.tracking.request == "object" ? e.tracking.request : void 0, Me = (e, t) => {
|
|
397
396
|
var n;
|
|
398
|
-
return k(e, t) || A((n =
|
|
399
|
-
},
|
|
397
|
+
return k(e, t) || A((n = je(e)) == null ? void 0 : n.excludedUrls, O(t));
|
|
398
|
+
}, Ne = (e, t) => {
|
|
400
399
|
var n;
|
|
401
|
-
return A((n =
|
|
402
|
-
},
|
|
403
|
-
for (let n of
|
|
400
|
+
return A((n = je(e)) == null ? void 0 : n.allowedTracingUrls, O(t));
|
|
401
|
+
}, Pe = ["http.url", "url.full"], Fe = "bk.rum.request.discard", Ie = (e) => {
|
|
402
|
+
for (let n of Pe) {
|
|
404
403
|
var t;
|
|
405
404
|
let r = (t = e.attributes) == null ? void 0 : t[n];
|
|
406
405
|
if (typeof r == "string") return r;
|
|
407
406
|
}
|
|
408
|
-
},
|
|
409
|
-
let t = e == null ? void 0 : e[
|
|
407
|
+
}, Le = (e) => {
|
|
408
|
+
let t = e == null ? void 0 : e[g.sessionId];
|
|
410
409
|
return typeof t == "string" && t.length > 0;
|
|
411
|
-
},
|
|
412
|
-
let t = e == null ? void 0 : e[
|
|
410
|
+
}, Re = (e) => {
|
|
411
|
+
let t = e == null ? void 0 : e[g.viewId];
|
|
413
412
|
return typeof t == "string" && t.length > 0;
|
|
414
|
-
},
|
|
413
|
+
}, ze = (e) => (e == null ? void 0 : e["bk.rum.sampled"]) === !0 && Le(e) && Re(e), Be = class {
|
|
415
414
|
constructor(e, t, n) {
|
|
416
415
|
this.inner = e, this.config = t, this.getRuntimeAttributes = n;
|
|
417
416
|
}
|
|
@@ -419,8 +418,8 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
419
418
|
return this.inner.forceFlush();
|
|
420
419
|
}
|
|
421
420
|
onEnd(e) {
|
|
422
|
-
let t =
|
|
423
|
-
if (!(e.attributes["bk.rum.request.discard"] === !0 || t &&
|
|
421
|
+
let t = Ie(e);
|
|
422
|
+
if (!(e.attributes["bk.rum.request.discard"] === !0 || t && ke(this.config, t) || !ze(e.attributes) && !(e.name === "browser.session" && e.attributes["bk.rum.sampled"] === !0 && Le(e.attributes)))) {
|
|
424
423
|
delete e.attributes[D];
|
|
425
424
|
try {
|
|
426
425
|
var n, r;
|
|
@@ -445,9 +444,9 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
445
444
|
shutdown() {
|
|
446
445
|
return this.inner.shutdown();
|
|
447
446
|
}
|
|
448
|
-
},
|
|
447
|
+
}, Ve = new Set([...Object.values(g), D]), He = class {
|
|
449
448
|
constructor(e = {}, t) {
|
|
450
|
-
|
|
449
|
+
b(this, "actionHistory", []), b(this, "attributes", {}), b(this, "queuedViewCommands", []), b(this, "recordAssociation", (e, t, n, r) => {
|
|
451
450
|
let i = e.at(-1);
|
|
452
451
|
if (i && i.endedAt === void 0 && (i.endedAt = Math.max(i.startedAt, n)), r) {
|
|
453
452
|
let r = {};
|
|
@@ -461,19 +460,19 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
461
460
|
});
|
|
462
461
|
}
|
|
463
462
|
e.length > 100 && e.splice(0, e.length - 100);
|
|
464
|
-
}),
|
|
463
|
+
}), b(this, "sessionHistory", []), b(this, "sessionLifecycleListeners", /* @__PURE__ */ new Set()), b(this, "setOptionalAttribute", (e, t) => {
|
|
465
464
|
if (t === void 0) {
|
|
466
465
|
delete this.attributes[e];
|
|
467
466
|
return;
|
|
468
467
|
}
|
|
469
468
|
this.attributes[e] = t;
|
|
470
|
-
}),
|
|
469
|
+
}), b(this, "user", {}), b(this, "view", {}), b(this, "viewAttributeKeys", /* @__PURE__ */ new Set()), b(this, "viewChangeListeners", /* @__PURE__ */ new Set()), b(this, "viewCommandListeners", /* @__PURE__ */ new Set()), b(this, "viewHistory", []), b(this, "viewScopedAttributeKeys", /* @__PURE__ */ new Set()), b(this, "dispatchViewCommand", (e) => {
|
|
471
470
|
if (this.viewCommandListeners.size === 0) {
|
|
472
471
|
this.queuedViewCommands.push(e);
|
|
473
472
|
return;
|
|
474
473
|
}
|
|
475
474
|
this.viewCommandListeners.forEach((t) => t(e));
|
|
476
|
-
}),
|
|
475
|
+
}), b(this, "getAttributes", () => S({}, this.attributes)), b(this, "getAttributesAt", (e) => {
|
|
477
476
|
if (!Number.isFinite(e)) return this.getAttributes();
|
|
478
477
|
let t = this.getAttributes(), n = (n, r) => {
|
|
479
478
|
for (let e of r) delete t[e];
|
|
@@ -481,16 +480,16 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
481
480
|
i && Object.assign(t, i.attributes);
|
|
482
481
|
};
|
|
483
482
|
return n(this.sessionHistory, [
|
|
484
|
-
|
|
485
|
-
|
|
483
|
+
g.sessionId,
|
|
484
|
+
g.sessionHasReplay,
|
|
486
485
|
D
|
|
487
|
-
]), n(this.viewHistory, this.viewScopedAttributeKeys), n(this.actionHistory, [
|
|
488
|
-
}),
|
|
486
|
+
]), n(this.viewHistory, this.viewScopedAttributeKeys), n(this.actionHistory, [g.actionId]), t;
|
|
487
|
+
}), b(this, "getUser", () => S({}, this.user)), b(this, "getView", () => S({}, this.view)), b(this, "isSessionActive", () => typeof this.attributes[g.sessionId] == "string"), b(this, "isViewActive", () => typeof this.attributes[g.viewId] == "string"), b(this, "notifySessionLifecycle", (e) => {
|
|
489
488
|
this.sessionLifecycleListeners.forEach((t) => t(e));
|
|
490
|
-
}),
|
|
489
|
+
}), b(this, "onSessionLifecycle", (e) => (this.sessionLifecycleListeners.add(e), () => this.sessionLifecycleListeners.delete(e))), b(this, "onViewChange", (e) => (this.viewChangeListeners.add(e), this.view.id && e(this.getView()), () => this.viewChangeListeners.delete(e))), b(this, "onViewCommand", (e) => {
|
|
491
490
|
for (this.viewCommandListeners.add(e); this.queuedViewCommands.length;) e(this.queuedViewCommands.shift());
|
|
492
491
|
return () => this.viewCommandListeners.delete(e);
|
|
493
|
-
}),
|
|
492
|
+
}), b(this, "setAttributes", (e, t = Date.now()) => {
|
|
494
493
|
for (let [t, n] of Object.entries(e)) {
|
|
495
494
|
if (n === void 0) {
|
|
496
495
|
delete this.attributes[t];
|
|
@@ -498,33 +497,33 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
498
497
|
}
|
|
499
498
|
this.attributes[t] = n;
|
|
500
499
|
}
|
|
501
|
-
if (
|
|
502
|
-
|
|
503
|
-
|
|
500
|
+
if (g.sessionId in e && this.recordAssociation(this.sessionHistory, [
|
|
501
|
+
g.sessionId,
|
|
502
|
+
g.sessionHasReplay,
|
|
504
503
|
D
|
|
505
|
-
], t, typeof this.attributes[
|
|
506
|
-
let e = this.attributes[
|
|
507
|
-
this.recordAssociation(this.actionHistory, [
|
|
504
|
+
], t, typeof this.attributes[g.sessionId] == "string"), g.actionId in e) {
|
|
505
|
+
let e = this.attributes[g.actionId];
|
|
506
|
+
this.recordAssociation(this.actionHistory, [g.actionId], t, Array.isArray(e) ? e.length > 0 : typeof e == "string");
|
|
508
507
|
}
|
|
509
|
-
}),
|
|
510
|
-
if (this.user =
|
|
508
|
+
}), b(this, "setUser", (e) => {
|
|
509
|
+
if (this.user = S(S({}, this.user), e), "id" in e) {
|
|
511
510
|
if (e.id === void 0) {
|
|
512
|
-
delete this.attributes[
|
|
511
|
+
delete this.attributes[g.userId];
|
|
513
512
|
return;
|
|
514
513
|
}
|
|
515
|
-
this.attributes[
|
|
514
|
+
this.attributes[g.userId] = e.id;
|
|
516
515
|
}
|
|
517
|
-
}),
|
|
516
|
+
}), b(this, "setView", (e, t = ((t) => (t = e.startedAt) == null ? Date.now() : t)()) => {
|
|
518
517
|
var n;
|
|
519
518
|
this.viewAttributeKeys.forEach((e) => delete this.attributes[e]), this.viewAttributeKeys.clear();
|
|
520
519
|
let r = {};
|
|
521
|
-
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 ||
|
|
522
|
-
this.view =
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
520
|
+
for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 || Ve.has(t) || (r[t] = i, this.attributes[t] = i, this.viewAttributeKeys.add(t), this.viewScopedAttributeKeys.add(t));
|
|
521
|
+
this.view = S(S({}, e), {}, { attributes: r }), this.setOptionalAttribute(g.viewId, e.id), this.setOptionalAttribute(g.viewUrl, e.url), this.setOptionalAttribute(g.viewUrlPathGroup, e.urlPathGroup), this.setOptionalAttribute(g.viewLoadingType, e.loadingType), this.setOptionalAttribute(g.viewName, e.name), [
|
|
522
|
+
g.viewId,
|
|
523
|
+
g.viewUrl,
|
|
524
|
+
g.viewUrlPathGroup,
|
|
525
|
+
g.viewLoadingType,
|
|
526
|
+
g.viewName
|
|
528
527
|
].forEach((e) => this.viewScopedAttributeKeys.add(e)), this.recordAssociation(this.viewHistory, this.viewScopedAttributeKeys, t, typeof e.id == "string" && e.id.length > 0), this.viewChangeListeners.forEach((e) => e(this.getView()));
|
|
529
528
|
}), this.setAttributes(e), t && this.setUser(t);
|
|
530
529
|
}
|
|
@@ -537,15 +536,17 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
537
536
|
}, M = {
|
|
538
537
|
action: "action",
|
|
539
538
|
custom: "custom",
|
|
540
|
-
document: "document",
|
|
541
539
|
error: "error",
|
|
542
|
-
|
|
540
|
+
longTask: "long_task",
|
|
543
541
|
resource: "resource",
|
|
544
|
-
route: "route",
|
|
545
542
|
session: "session",
|
|
546
543
|
vital: "vital",
|
|
544
|
+
view: "view",
|
|
547
545
|
websocket: "websocket"
|
|
548
|
-
},
|
|
546
|
+
}, Ue = (e) => e === 408 || e === 504 ? j.timeout : typeof e == "number" && e >= 400 ? j.error : j.success, We = (e) => {
|
|
547
|
+
if (e === 408 || e === 504) return "network_timeout";
|
|
548
|
+
if (!(typeof e != "number" || e < 400)) return e >= 500 ? "http_5xx" : "http_4xx";
|
|
549
|
+
}, Ge = (e) => e === "good" ? j.success : j.warning, Ke = (e) => {
|
|
549
550
|
if (!e) return {};
|
|
550
551
|
try {
|
|
551
552
|
let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
|
|
@@ -556,39 +557,36 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
556
557
|
} catch (e) {
|
|
557
558
|
return {};
|
|
558
559
|
}
|
|
559
|
-
}, N = ({
|
|
560
|
-
[
|
|
561
|
-
[
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
errorType: n ? "network" : typeof r == "number" ? Ge(r) : "none",
|
|
568
|
-
result: s,
|
|
569
|
-
spanSubtype: e,
|
|
560
|
+
}, N = ({ outcome: e = j.success, outcomeReason: t, spanType: n }) => S({
|
|
561
|
+
[g.spanType]: n,
|
|
562
|
+
[g.outcomeType]: e
|
|
563
|
+
}, t ? { [g.outcomeReason]: t } : {}), qe = ({ initiatorType: e = "other", method: t, outcome: n, transferSize: r, url: i }) => {
|
|
564
|
+
let a = Ke(i), o = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, s = (n == null ? void 0 : n.type) === "abort" ? j.abort : (n == null ? void 0 : n.type) === "timeout" ? j.timeout : (n == null ? void 0 : n.type) === "network_error" ? j.error : typeof o == "number" ? Ue(o) : j.success, c = (n == null ? void 0 : n.type) === "timeout" ? "network_timeout" : (n == null ? void 0 : n.type) === "network_error" ? "network" : typeof o == "number" ? We(o) : void 0, l = t == null ? void 0 : t.toUpperCase();
|
|
565
|
+
return S(S(S(S(S(S({}, N({
|
|
566
|
+
outcome: s,
|
|
567
|
+
outcomeReason: c,
|
|
570
568
|
spanType: M.resource
|
|
571
|
-
})),
|
|
572
|
-
},
|
|
569
|
+
})), a.serverAddress ? { "server.address": a.serverAddress } : {}), a.serverPort === void 0 ? {} : { "server.port": a.serverPort }), {}, { "resource.type": e }, l ? { "http.request.method": l } : {}), typeof r == "number" ? { "resource.size": r } : {}), typeof o == "number" ? { "http.response.status_code": o } : {});
|
|
570
|
+
}, Je = 100, Ye = 100, Xe = 1e3, Ze = 100, Qe = 1e4, $e = "data-bk-action-name", et = 100, tt = 10, P = (e) => e.replace(/\s+/g, " ").trim().slice(0, et), F = (e) => {
|
|
573
571
|
var t;
|
|
574
572
|
if (e.parentElement) return e.parentElement;
|
|
575
573
|
let n = (t = e.getRootNode) == null ? void 0 : t.call(e);
|
|
576
574
|
return typeof ShadowRoot < "u" && n instanceof ShadowRoot ? n.host : null;
|
|
577
|
-
},
|
|
575
|
+
}, nt = (e, t) => {
|
|
578
576
|
let n = e;
|
|
579
577
|
for (; n;) {
|
|
580
578
|
let e = n.getAttribute(t);
|
|
581
579
|
if (e) return P(e);
|
|
582
580
|
n = F(n);
|
|
583
581
|
}
|
|
584
|
-
},
|
|
582
|
+
}, rt = (e) => {
|
|
585
583
|
var t;
|
|
586
584
|
return e.isContentEditable ? "" : P((t = e.textContent) == null ? "" : t);
|
|
587
585
|
}, it = (e) => {
|
|
588
586
|
var t, n;
|
|
589
587
|
let r = e, i = (t = r.labels) == null ? void 0 : t[0];
|
|
590
588
|
if (i) {
|
|
591
|
-
let e =
|
|
589
|
+
let e = rt(i);
|
|
592
590
|
if (e) return e;
|
|
593
591
|
}
|
|
594
592
|
let a = e.tagName.toLowerCase(), o = (n = e.getAttribute("type")) == null ? void 0 : n.toLowerCase();
|
|
@@ -602,7 +600,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
602
600
|
if (e) return e;
|
|
603
601
|
}
|
|
604
602
|
if (a === "button" || a === "label" || e.getAttribute("role") === "button") {
|
|
605
|
-
let t =
|
|
603
|
+
let t = rt(e);
|
|
606
604
|
if (t) return t;
|
|
607
605
|
}
|
|
608
606
|
for (let t of [
|
|
@@ -616,12 +614,12 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
616
614
|
let n = P((c = e.getAttribute(t)) == null ? "" : c);
|
|
617
615
|
if (n) return n;
|
|
618
616
|
}
|
|
619
|
-
}, at = (e, t =
|
|
620
|
-
let r =
|
|
617
|
+
}, at = (e, t = $e, n = !1) => {
|
|
618
|
+
let r = nt(e, t);
|
|
621
619
|
if (r) return r;
|
|
622
620
|
if (!n) return e.tagName.toLowerCase();
|
|
623
621
|
let i = e, a = 0;
|
|
624
|
-
for (; i && a <=
|
|
622
|
+
for (; i && a <= tt;) {
|
|
625
623
|
let e = i.tagName.toLowerCase();
|
|
626
624
|
if (e === "body" || e === "html" || e === "head") break;
|
|
627
625
|
let t = it(i);
|
|
@@ -629,10 +627,10 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
629
627
|
if (e === "form") break;
|
|
630
628
|
i = F(i), a += 1;
|
|
631
629
|
}
|
|
632
|
-
for (i = e, a = 0; i && a <=
|
|
630
|
+
for (i = e, a = 0; i && a <= tt;) {
|
|
633
631
|
let e = i.tagName.toLowerCase();
|
|
634
632
|
if (e === "body" || e === "html" || e === "head") break;
|
|
635
|
-
let t =
|
|
633
|
+
let t = rt(i);
|
|
636
634
|
if (t) return t;
|
|
637
635
|
if (e === "form") break;
|
|
638
636
|
i = F(i), a += 1;
|
|
@@ -669,53 +667,47 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
669
667
|
}
|
|
670
668
|
return !1;
|
|
671
669
|
}, ut = (e = {}) => {
|
|
672
|
-
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute ||
|
|
673
|
-
s == null || s.setRuntimeAttributes({ [
|
|
670
|
+
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || $e, a = ct(e.maxDuration, Qe), o = [], s, c = () => {
|
|
671
|
+
s == null || s.setRuntimeAttributes({ [g.actionId]: n.size ? [...n.keys()] : void 0 });
|
|
674
672
|
}, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !lt(e.target), u = (e) => {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
let n = [
|
|
673
|
+
if (!r.delete(e) || !s || !e.completed) return;
|
|
674
|
+
clearTimeout(e.reportTimer), e.hadError && e.frustrations.add("error_click"), l(e) && e.frustrations.add("dead_click");
|
|
675
|
+
let t = [
|
|
679
676
|
"rage_click",
|
|
680
677
|
"dead_click",
|
|
681
678
|
"error_click"
|
|
682
|
-
].filter((t) => e.frustrations.has(t)), { endTime:
|
|
683
|
-
s.startSpan("action.click",
|
|
684
|
-
|
|
685
|
-
result: c ? j.warning : j.success,
|
|
686
|
-
spanSubtype: "click",
|
|
679
|
+
].filter((t) => e.frustrations.has(t)), { endTime: n, hasLoadingTime: i } = e.completed, a = Math.max(0, n - e.startTime), o = e.hadError || t.length > 0;
|
|
680
|
+
s.startSpan("action.click", S(S(S(S(S({}, s.config.hooks.getPageAttributes()), N({
|
|
681
|
+
outcome: o ? j.warning : j.success,
|
|
687
682
|
spanType: M.action
|
|
688
683
|
})), e.runtimeAttributes), {}, {
|
|
689
|
-
[
|
|
690
|
-
[
|
|
691
|
-
[
|
|
692
|
-
[
|
|
693
|
-
[
|
|
694
|
-
|
|
695
|
-
[_.actionTargetName]: e.targetName,
|
|
696
|
-
[_.actionTargetTag]: e.targetTag
|
|
697
|
-
}, n.length ? { [_.actionFrustrationType]: n } : {}), a ? { [_.actionLoadingTime]: o } : {}), { startTime: e.startTime }).end(a ? i : e.startTime);
|
|
684
|
+
[g.actionId]: e.id,
|
|
685
|
+
[g.actionType]: "click",
|
|
686
|
+
[g.actionName]: `Click on ${e.targetName}`,
|
|
687
|
+
[g.actionTargetName]: e.targetName,
|
|
688
|
+
[g.actionTargetTag]: e.targetTag
|
|
689
|
+
}, t.length ? { [g.actionFrustrationType]: t } : {}), i ? { [g.actionLoadingTime]: a } : {}), { startTime: e.startTime }).end(i ? n : e.startTime);
|
|
698
690
|
}, d = (e, t, i) => {
|
|
699
691
|
if (!n.delete(e.id) || !s) return;
|
|
700
692
|
clearTimeout(e.validationTimer), clearTimeout(e.quietTimer), clearTimeout(e.maxDurationTimer), c(), e.completed = {
|
|
701
693
|
endTime: t,
|
|
702
694
|
hasLoadingTime: i
|
|
703
695
|
}, r.add(e);
|
|
704
|
-
let a = Math.max(0, e.startTime +
|
|
696
|
+
let a = Math.max(0, e.startTime + Xe - Date.now());
|
|
705
697
|
e.reportTimer = setTimeout(() => u(e), a);
|
|
706
698
|
}, f = () => {
|
|
707
699
|
[...r].forEach(u);
|
|
708
700
|
}, p = (e) => {
|
|
709
701
|
if (clearTimeout(e.quietTimer), !e.hadActivity || e.pendingRequests.size) return;
|
|
710
|
-
let t = Math.max(0, e.lastActivityTime +
|
|
702
|
+
let t = Math.max(0, e.lastActivityTime + Ye - Date.now());
|
|
711
703
|
e.quietTimer = setTimeout(() => d(e, e.lastActivityTime, !0), t);
|
|
712
704
|
}, m = (e, t) => {
|
|
713
705
|
e.hadActivity = !0, e.lastActivityTime = Math.max(e.lastActivityTime, t), p(e);
|
|
714
|
-
},
|
|
706
|
+
}, _ = (e, t) => t >= e.startTime && t <= e.startTime + a, v = (e) => {
|
|
715
707
|
for (let i of n.values()) {
|
|
716
708
|
if (e.type === "request_start") {
|
|
717
709
|
var t;
|
|
718
|
-
if (e.url && A(s == null || (t = s.config.view) == null ? void 0 : t.excludedActivityUrls, e.url) || !
|
|
710
|
+
if (e.url && A(s == null || (t = s.config.view) == null ? void 0 : t.excludedActivityUrls, e.url) || !_(i, e.time)) continue;
|
|
719
711
|
i.pendingRequests.add(e.id), m(i, e.time);
|
|
720
712
|
continue;
|
|
721
713
|
}
|
|
@@ -731,28 +723,23 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
731
723
|
continue;
|
|
732
724
|
}
|
|
733
725
|
if (e.type === "dom_mutation" || e.type === "window_open") {
|
|
734
|
-
|
|
726
|
+
_(i, e.time) && m(i, e.time);
|
|
735
727
|
continue;
|
|
736
728
|
}
|
|
737
|
-
e.type === "error" &&
|
|
729
|
+
e.type === "error" && _(i, e.time) && (i.hadError = !0, m(i, e.time));
|
|
738
730
|
}
|
|
739
731
|
}, y = (e = Date.now()) => {
|
|
740
732
|
[...n.values()].forEach((t) => d(t, e, t.hadActivity));
|
|
741
733
|
}, b = (e, t) => {
|
|
742
734
|
let n = "clientX" in t && typeof t.clientX == "number" ? t.clientX : 0, r = "clientY" in t && typeof t.clientY == "number" ? t.clientY : 0;
|
|
743
|
-
o = o.filter((t) => e.startTime - t.action.startTime <=
|
|
744
|
-
let i = o.at(-1), a = o.some((e) => e.action.userActivity.scroll || e.action.userActivity.selection), s = (i == null ? void 0 : i.target) === e.target && Math.hypot(i.x - n, i.y - r) <=
|
|
745
|
-
|
|
735
|
+
o = o.filter((t) => e.startTime - t.action.startTime <= Xe);
|
|
736
|
+
let i = o.at(-1), a = o.some((e) => e.action.userActivity.scroll || e.action.userActivity.selection), s = (i == null ? void 0 : i.target) === e.target && Math.hypot(i.x - n, i.y - r) <= Ze;
|
|
737
|
+
(a || i && !s) && (o = []), o.push({
|
|
746
738
|
action: e,
|
|
747
739
|
target: e.target,
|
|
748
740
|
x: n,
|
|
749
741
|
y: r
|
|
750
|
-
}), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <=
|
|
751
|
-
let t = o.slice(-3).map((e) => e.action);
|
|
752
|
-
t.slice(0, -1).forEach((e) => {
|
|
753
|
-
e.discardedByRage = !0;
|
|
754
|
-
}), e.frustrations.add("rage_click"), e.rageSources = t, o = [];
|
|
755
|
-
}
|
|
742
|
+
}), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <= Xe && (o.slice(-3).map((e) => e.action).forEach((e) => e.frustrations.add("rage_click")), o = []);
|
|
756
743
|
};
|
|
757
744
|
return {
|
|
758
745
|
name: "action",
|
|
@@ -786,7 +773,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
786
773
|
},
|
|
787
774
|
validationTimer: setTimeout(() => {
|
|
788
775
|
u.hadActivity || d(u, u.startTime, !1);
|
|
789
|
-
},
|
|
776
|
+
}, Je)
|
|
790
777
|
};
|
|
791
778
|
n.set(s, u), b(u, t), c();
|
|
792
779
|
};
|
|
@@ -807,12 +794,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
807
794
|
...r,
|
|
808
795
|
...o.map((e) => e.action)
|
|
809
796
|
]).forEach((t) => {
|
|
810
|
-
|
|
811
|
-
var n;
|
|
812
|
-
(n = t.rageSources) == null || n.slice(0, -1).forEach((e) => {
|
|
813
|
-
e.discardedByRage = !1;
|
|
814
|
-
}), t.rageSources = void 0;
|
|
815
|
-
}
|
|
797
|
+
t.userActivity[e] = !0, e !== "input" && t.frustrations.delete("rage_click");
|
|
816
798
|
});
|
|
817
799
|
}, C = () => S("input"), w = () => S("scroll"), T = () => S("selection");
|
|
818
800
|
window.addEventListener("input", C, u), window.addEventListener("scroll", w, u), document.addEventListener("selectionchange", T, u), t.push(() => window.removeEventListener("input", C, u), () => window.removeEventListener("scroll", w, u), () => document.removeEventListener("selectionchange", T, u));
|
|
@@ -901,7 +883,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
901
883
|
".spinner",
|
|
902
884
|
".skeleton",
|
|
903
885
|
".bk-loading"
|
|
904
|
-
],
|
|
886
|
+
], I = [
|
|
905
887
|
[.2, .2],
|
|
906
888
|
[.5, .2],
|
|
907
889
|
[.8, .2],
|
|
@@ -930,34 +912,25 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
930
912
|
let n = document.elementFromPoint(e, t);
|
|
931
913
|
return n ? [n] : [];
|
|
932
914
|
}, Dt = (e, t) => {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
rootFound: !1,
|
|
940
|
-
score: 1,
|
|
941
|
-
validCount: L.length
|
|
942
|
-
};
|
|
943
|
-
let r = 0, i = 0, a = "";
|
|
944
|
-
for (let [e, o] of L) {
|
|
945
|
-
let s = Et(window.innerWidth * e, window.innerHeight * o);
|
|
946
|
-
if (e === .5 && o === .5 && (a = Ct(s[0])), s.some((e) => wt(e, t))) {
|
|
947
|
-
i += 1;
|
|
915
|
+
var n;
|
|
916
|
+
let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a = !!r, o = 0, s = 0, c = "";
|
|
917
|
+
for (let [e, n] of I) {
|
|
918
|
+
let r = Et(window.innerWidth * e, window.innerHeight * n);
|
|
919
|
+
if (e === .5 && n === .5 && (c = Ct(r[0])), r.some((e) => wt(e, t))) {
|
|
920
|
+
s += 1;
|
|
948
921
|
continue;
|
|
949
922
|
}
|
|
950
|
-
|
|
923
|
+
r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && Tt(e)) || (o += 1);
|
|
951
924
|
}
|
|
952
|
-
let
|
|
925
|
+
let l = I.length - s;
|
|
953
926
|
return {
|
|
954
|
-
centerElement:
|
|
955
|
-
emptyCount:
|
|
956
|
-
ignoredCount:
|
|
957
|
-
reason: "empty_viewport",
|
|
958
|
-
rootFound:
|
|
959
|
-
score:
|
|
960
|
-
validCount:
|
|
927
|
+
centerElement: c,
|
|
928
|
+
emptyCount: o,
|
|
929
|
+
ignoredCount: s,
|
|
930
|
+
reason: a ? "empty_viewport" : "missing_root",
|
|
931
|
+
rootFound: a,
|
|
932
|
+
score: l ? o / l : 0,
|
|
933
|
+
validCount: l
|
|
961
934
|
};
|
|
962
935
|
}, Ot = (e = {}) => {
|
|
963
936
|
var t;
|
|
@@ -972,10 +945,9 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
972
945
|
if (s !== t || c === t || !e.isSampled()) return;
|
|
973
946
|
c = t;
|
|
974
947
|
let r = Date.now();
|
|
975
|
-
e.startSpan("browser.blank_screen",
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
spanSubtype: n.reason,
|
|
948
|
+
e.startSpan("browser.blank_screen", S(S({}, N({
|
|
949
|
+
outcome: j.error,
|
|
950
|
+
outcomeReason: "blank_screen",
|
|
979
951
|
spanType: M.error
|
|
980
952
|
})), {}, {
|
|
981
953
|
"blank_screen.center_element": n.centerElement,
|
|
@@ -985,11 +957,8 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
985
957
|
"blank_screen.reason": n.reason,
|
|
986
958
|
"blank_screen.root_found": n.rootFound,
|
|
987
959
|
"blank_screen.root_selector": i,
|
|
988
|
-
"blank_screen.sample_count":
|
|
989
|
-
"blank_screen.valid_sample_count": n.validCount
|
|
990
|
-
[_.eventId]: h("event"),
|
|
991
|
-
[_.eventTimestamp]: r,
|
|
992
|
-
[_.eventType]: "error"
|
|
960
|
+
"blank_screen.sample_count": I.length,
|
|
961
|
+
"blank_screen.valid_sample_count": n.validCount
|
|
993
962
|
}), { startTime: r }).end(r);
|
|
994
963
|
}, m = (t) => {
|
|
995
964
|
if (s !== t || c === t || document.visibilityState === "hidden") return;
|
|
@@ -1013,53 +982,53 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1013
982
|
}
|
|
1014
983
|
n.validCount && n.score >= a && p(t, n);
|
|
1015
984
|
}, r));
|
|
1016
|
-
},
|
|
985
|
+
}, h = (r) => {
|
|
1017
986
|
t(), !(document.visibilityState === "hidden" || !e.isSampled()) && (u = setTimeout(() => m(r), n));
|
|
1018
987
|
};
|
|
1019
988
|
d = e.onViewChange((n) => {
|
|
1020
989
|
if (n.id !== s && (t(), l == null || l(), l = void 0, s = n.id, c = void 0, n.id)) {
|
|
1021
990
|
let t = n.id;
|
|
1022
991
|
l = ht(e, Date.now(), () => {
|
|
1023
|
-
l = void 0,
|
|
992
|
+
l = void 0, h(t);
|
|
1024
993
|
});
|
|
1025
994
|
}
|
|
1026
995
|
});
|
|
1027
|
-
let
|
|
1028
|
-
document.visibilityState === "hidden" ? t() : s && c !== s &&
|
|
996
|
+
let g = () => {
|
|
997
|
+
document.visibilityState === "hidden" ? t() : s && c !== s && h(s);
|
|
1029
998
|
};
|
|
1030
|
-
document.addEventListener("visibilitychange",
|
|
999
|
+
document.addEventListener("visibilitychange", g), f = () => document.removeEventListener("visibilitychange", g);
|
|
1031
1000
|
},
|
|
1032
1001
|
shutdown() {
|
|
1033
1002
|
clearTimeout(u), u = void 0, d(), l == null || l(), l = void 0, f == null || f(), f = void 0, s = void 0, c = void 0;
|
|
1034
1003
|
}
|
|
1035
1004
|
};
|
|
1036
|
-
}, kt = 100, At = 200,
|
|
1037
|
-
let t =
|
|
1038
|
-
t >= 0 &&
|
|
1039
|
-
},
|
|
1005
|
+
}, kt = 100, At = 200, L = [], jt = (e) => e.replace(/#.*$/, ""), Mt = (e) => {
|
|
1006
|
+
let t = L.indexOf(e);
|
|
1007
|
+
t >= 0 && L.splice(t, 1), e.timer !== void 0 && clearTimeout(e.timer);
|
|
1008
|
+
}, R = (e, t) => {
|
|
1040
1009
|
let n = e.callback;
|
|
1041
1010
|
Mt(e), e.callback = void 0, n == null || n(t);
|
|
1042
1011
|
}, Nt = (e) => {
|
|
1043
|
-
let t = performance.timeOrigin + e.startTime, n =
|
|
1044
|
-
n && (n.entry = e, n.callback &&
|
|
1012
|
+
let t = performance.timeOrigin + e.startTime, n = L.filter((n) => !n.entry && jt(n.url) === jt(e.name) && t >= n.startTime - 50).sort((e, n) => Math.abs(e.startTime - t) - Math.abs(n.startTime - t))[0];
|
|
1013
|
+
n && (n.entry = e, n.callback && R(n, e));
|
|
1045
1014
|
}, Pt = (e, t = Date.now()) => {
|
|
1046
1015
|
let n = {
|
|
1047
1016
|
startTime: t,
|
|
1048
1017
|
url: e
|
|
1049
1018
|
};
|
|
1050
|
-
return
|
|
1051
|
-
cancel: () =>
|
|
1019
|
+
return L.push(n), L.length > kt && R(L[0]), {
|
|
1020
|
+
cancel: () => R(n),
|
|
1052
1021
|
complete: (e) => {
|
|
1053
1022
|
if (n.callback = e, n.entry) {
|
|
1054
|
-
|
|
1023
|
+
R(n, n.entry);
|
|
1055
1024
|
return;
|
|
1056
1025
|
}
|
|
1057
|
-
n.timer = setTimeout(() =>
|
|
1026
|
+
n.timer = setTimeout(() => R(n), At);
|
|
1058
1027
|
}
|
|
1059
1028
|
};
|
|
1060
|
-
}, Ft = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0,
|
|
1061
|
-
|
|
1062
|
-
},
|
|
1029
|
+
}, Ft = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, It = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), z = (e, t, n, r, i) => {
|
|
1030
|
+
It(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
|
|
1031
|
+
}, Lt = (e) => {
|
|
1063
1032
|
let t = {}, n = [
|
|
1064
1033
|
e.startTime,
|
|
1065
1034
|
e.fetchStart,
|
|
@@ -1071,17 +1040,17 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1071
1040
|
e.responseStart,
|
|
1072
1041
|
e.responseEnd
|
|
1073
1042
|
];
|
|
1074
|
-
return !n.every(Number.isFinite) || !
|
|
1075
|
-
},
|
|
1043
|
+
return !n.every(Number.isFinite) || !It(...n) ? t : (z(t, "first_byte", e.startTime, e.requestStart, e.responseStart), z(t, "download", e.startTime, e.responseStart, e.responseEnd), e.workerStart > 0 && e.workerStart < e.fetchStart && z(t, "worker", e.startTime, e.workerStart, e.fetchStart), e.fetchStart < e.domainLookupEnd && z(t, "dns", e.startTime, e.domainLookupStart, e.domainLookupEnd), e.fetchStart < e.connectEnd && (z(t, "connect", e.startTime, e.connectStart, e.connectEnd), e.connectStart <= e.secureConnectionStart && e.secureConnectionStart <= e.connectEnd && z(t, "ssl", e.startTime, e.secureConnectionStart, e.connectEnd)), e.redirectEnd > e.startTime && It(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) && z(t, "redirect", e.startTime, e.redirectStart, e.redirectEnd), t);
|
|
1044
|
+
}, Rt = (e) => e.duration === 0 && e.responseEnd > e.startTime ? e.responseEnd - e.startTime : e.duration, zt = (e) => {
|
|
1076
1045
|
let t = typeof e.deliveryType == "string" ? e.deliveryType || "other" : void 0;
|
|
1077
|
-
return
|
|
1078
|
-
[
|
|
1079
|
-
[
|
|
1080
|
-
},
|
|
1046
|
+
return S(S(S(S({
|
|
1047
|
+
[g.cacheHit]: Ft(e),
|
|
1048
|
+
[g.nextHopProtocol]: e.nextHopProtocol
|
|
1049
|
+
}, Lt(e)), t ? { "resource.delivery_type": t } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), {}, {
|
|
1081
1050
|
"resource.encoded_body_size": e.encodedBodySize,
|
|
1082
1051
|
"resource.decoded_body_size": e.decodedBodySize
|
|
1083
1052
|
});
|
|
1084
|
-
},
|
|
1053
|
+
}, Bt = (t = !0) => {
|
|
1085
1054
|
let n;
|
|
1086
1055
|
return {
|
|
1087
1056
|
name: "resource",
|
|
@@ -1095,18 +1064,16 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1095
1064
|
return;
|
|
1096
1065
|
}
|
|
1097
1066
|
if (n.duration < 0) return;
|
|
1098
|
-
let i = r.config.hooks.redactUrl(n.name), a =
|
|
1099
|
-
t && r.isSampled() && r.startSpan("browser.resource",
|
|
1067
|
+
let i = r.config.hooks.redactUrl(n.name), a = Rt(n), o = performance.timeOrigin + n.startTime, s = o + a;
|
|
1068
|
+
t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()), qe({
|
|
1100
1069
|
initiatorType: n.initiatorType || "other",
|
|
1101
|
-
|
|
1070
|
+
outcome: typeof n.responseStatus == "number" ? {
|
|
1071
|
+
statusCode: n.responseStatus,
|
|
1072
|
+
type: "response"
|
|
1073
|
+
} : void 0,
|
|
1102
1074
|
transferSize: n.transferSize,
|
|
1103
1075
|
url: i
|
|
1104
|
-
})), {}, {
|
|
1105
|
-
[_.eventId]: h("event"),
|
|
1106
|
-
[_.eventTimestamp]: o,
|
|
1107
|
-
[_.eventType]: "resource",
|
|
1108
|
-
"url.full": i
|
|
1109
|
-
}, Rt(n)), {
|
|
1076
|
+
})), {}, { "url.full": i }, zt(n)), {
|
|
1110
1077
|
kind: e.CLIENT,
|
|
1111
1078
|
startTime: o
|
|
1112
1079
|
}).end(s), r.notifyActivity({
|
|
@@ -1131,26 +1098,31 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1131
1098
|
n == null || n.disconnect(), n = void 0;
|
|
1132
1099
|
}
|
|
1133
1100
|
};
|
|
1134
|
-
},
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1101
|
+
}, Vt = (e) => typeof e.config.tracking.request == "object" ? e.config.tracking.request : void 0, Ht = (e) => typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : "", Ut = (e, t) => {
|
|
1102
|
+
let n = e.signal;
|
|
1103
|
+
return Ht(n == null ? void 0 : n.reason) === "TimeoutError" || Ht(t) === "TimeoutError" ? {
|
|
1104
|
+
error: t,
|
|
1105
|
+
type: "timeout"
|
|
1106
|
+
} : n != null && n.aborted || Ht(t) === "AbortError" ? { type: "abort" } : {
|
|
1107
|
+
error: t,
|
|
1108
|
+
type: "network_error"
|
|
1109
|
+
};
|
|
1110
|
+
}, Wt = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
|
|
1111
|
+
statusCode: t.status,
|
|
1112
|
+
type: "response"
|
|
1113
|
+
}, Gt = (e) => e.type === "network_error" || e.type === "timeout" || e.type === "response" && typeof e.statusCode == "number" && e.statusCode >= 400, Kt = (e) => typeof e == "string" || e instanceof URL ? O(String(e)) : O(e.url), qt = (e, t) => {
|
|
1142
1114
|
var n;
|
|
1143
1115
|
return ((n = t == null ? void 0 : t.method) == null ? typeof Request < "u" && e instanceof Request ? e.method : "GET" : n).toUpperCase();
|
|
1144
|
-
},
|
|
1116
|
+
}, Jt = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, Yt = (e, t, a) => {
|
|
1145
1117
|
var o;
|
|
1146
1118
|
let s = typeof Request < "u" && e instanceof Request ? e.headers : void 0, c = new Headers((o = t == null ? void 0 : t.headers) == null ? s : o);
|
|
1147
|
-
return r.inject(i.setSpan(n.active(), a), c, { set: (e, t, n) => e.set(t, n) }),
|
|
1148
|
-
},
|
|
1119
|
+
return r.inject(i.setSpan(n.active(), a), c, { set: (e, t, n) => e.set(t, n) }), S(S({}, t), {}, { headers: c });
|
|
1120
|
+
}, Xt = (e, t) => {
|
|
1149
1121
|
let a = {};
|
|
1150
1122
|
r.inject(i.setSpan(n.active(), t), a);
|
|
1151
1123
|
for (let [t, n] of Object.entries(a)) e.setRequestHeader(t, n);
|
|
1152
|
-
},
|
|
1153
|
-
if (
|
|
1124
|
+
}, Zt = (e, t) => k(e.config, t) || A(e.config.view.excludedActivityUrls, t), Qt = (e, t) => {
|
|
1125
|
+
if (Zt(e, t)) return () => {};
|
|
1154
1126
|
let n = h("request");
|
|
1155
1127
|
e.notifyActivity({
|
|
1156
1128
|
id: n,
|
|
@@ -1166,56 +1138,51 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1166
1138
|
type: "request_end"
|
|
1167
1139
|
}));
|
|
1168
1140
|
};
|
|
1169
|
-
},
|
|
1141
|
+
}, $t = (e, t) => e.isSampled() ? Pt(t) : {
|
|
1170
1142
|
cancel() {},
|
|
1171
1143
|
complete(e) {
|
|
1172
1144
|
e();
|
|
1173
1145
|
}
|
|
1174
|
-
},
|
|
1146
|
+
}, en = (t, n, r) => {
|
|
1175
1147
|
var i, a;
|
|
1176
1148
|
let o = (i = r.startedAt) == null ? Date.now() : i;
|
|
1177
|
-
return t.startSpan("browser.resource",
|
|
1149
|
+
return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), qe({
|
|
1178
1150
|
initiatorType: n,
|
|
1179
1151
|
method: r.method,
|
|
1180
1152
|
url: (a = r.url) == null ? "" : a
|
|
1181
|
-
})), {}, {
|
|
1182
|
-
[_.eventId]: h("event"),
|
|
1183
|
-
[_.eventTimestamp]: o,
|
|
1184
|
-
[_.eventType]: "resource"
|
|
1185
|
-
}, r.url ? { "url.full": t.config.hooks.redactUrl(r.url) } : {}), {
|
|
1153
|
+
})), r.url ? { "url.full": t.config.hooks.redactUrl(r.url) } : {}), {
|
|
1186
1154
|
kind: e.CLIENT,
|
|
1187
1155
|
startTime: o
|
|
1188
1156
|
});
|
|
1189
|
-
},
|
|
1190
|
-
let
|
|
1191
|
-
attributes:
|
|
1157
|
+
}, tn = (e, n, r, i, a, o = {}) => {
|
|
1158
|
+
let s = o.url, c = s ? e.config.hooks.redactUrl(s) : void 0, l = o.method, u = {
|
|
1159
|
+
attributes: S(S(S({}, e.config.hooks.getPageAttributes()), qe({
|
|
1192
1160
|
initiatorType: r,
|
|
1193
1161
|
method: l,
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
})), s ? { "url.full": s } : {}),
|
|
1162
|
+
outcome: a,
|
|
1163
|
+
url: c == null ? "" : c
|
|
1164
|
+
})), c ? { "url.full": c } : {}),
|
|
1198
1165
|
resource: {
|
|
1199
1166
|
method: l,
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
url:
|
|
1167
|
+
outcome: a,
|
|
1168
|
+
transport: r,
|
|
1169
|
+
url: c
|
|
1203
1170
|
},
|
|
1204
1171
|
type: "resource"
|
|
1205
1172
|
}, d = !0;
|
|
1206
1173
|
try {
|
|
1207
1174
|
var f, p;
|
|
1208
|
-
d = (f =
|
|
1175
|
+
d = (f = Vt(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
|
|
1209
1176
|
} catch (t) {
|
|
1210
1177
|
var m;
|
|
1211
1178
|
e.config.debug && ((m = globalThis.console) == null || m.warn("[bk-ot] request.beforeSend failed:", t));
|
|
1212
1179
|
}
|
|
1213
1180
|
if (n.setAttributes(e.applyRedact(u.attributes)), d === !1) {
|
|
1214
|
-
n.setAttribute(
|
|
1181
|
+
n.setAttribute(Fe, !0);
|
|
1215
1182
|
return;
|
|
1216
1183
|
}
|
|
1217
|
-
(
|
|
1218
|
-
},
|
|
1184
|
+
Gt(a) && n.setStatus({ code: t.ERROR });
|
|
1185
|
+
}, nn = (e) => {
|
|
1219
1186
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1220
1187
|
return {
|
|
1221
1188
|
name: "request",
|
|
@@ -1225,31 +1192,42 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1225
1192
|
if (typeof window.fetch == "function") {
|
|
1226
1193
|
let r = window.fetch, i = /* @__PURE__ */ function() {
|
|
1227
1194
|
var t = E(function* (t, i) {
|
|
1228
|
-
let a =
|
|
1229
|
-
if (!e.isSampled() ||
|
|
1195
|
+
let a = Kt(t);
|
|
1196
|
+
if (!e.isSampled() || Me(e.config, a)) return r.call(this, t, i);
|
|
1230
1197
|
let o = {
|
|
1231
|
-
method:
|
|
1198
|
+
method: qt(t, i),
|
|
1232
1199
|
startedAt: Date.now(),
|
|
1233
1200
|
url: a
|
|
1234
|
-
}, s =
|
|
1235
|
-
|
|
1201
|
+
}, s = en(e, "fetch", o), c = $t(e, a), l = Qt(e, a), u = Jt(t, i), d = Ne(e.config, a) ? Yt(t, i, s) : i, f = !1, p = (t, r = Date.now()) => {
|
|
1202
|
+
if (!f) {
|
|
1203
|
+
if (f = !0, n.delete(m), t) {
|
|
1204
|
+
s.setAttributes(e.applyRedact(zt(t))), s.end(performance.timeOrigin + t.startTime + Rt(t));
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1207
|
+
s.end(r);
|
|
1208
|
+
}
|
|
1236
1209
|
}, m = () => {
|
|
1237
1210
|
c.cancel(), p();
|
|
1238
1211
|
};
|
|
1239
1212
|
n.add(m);
|
|
1240
1213
|
try {
|
|
1241
|
-
let n = yield r.call(this, t, d);
|
|
1242
|
-
|
|
1214
|
+
let n = yield r.call(this, t, d), i = S(S({}, n.status > 0 ? { statusCode: n.status } : {}), {}, { type: "response" });
|
|
1215
|
+
tn(e, s, "fetch", {
|
|
1243
1216
|
request: u,
|
|
1244
1217
|
response: n,
|
|
1245
1218
|
type: "fetch"
|
|
1246
|
-
},
|
|
1219
|
+
}, i, o);
|
|
1220
|
+
let a = Date.now();
|
|
1221
|
+
return c.complete((e) => p(e, a)), n;
|
|
1247
1222
|
} catch (t) {
|
|
1248
|
-
|
|
1223
|
+
let n = Ut(u, t);
|
|
1224
|
+
tn(e, s, "fetch", {
|
|
1249
1225
|
error: t,
|
|
1250
1226
|
request: u,
|
|
1251
1227
|
type: "fetch"
|
|
1252
|
-
}, o), t instanceof Error && s.recordException(t)
|
|
1228
|
+
}, n, o), n.type !== "abort" && t instanceof Error && s.recordException(t);
|
|
1229
|
+
let r = Date.now();
|
|
1230
|
+
throw c.complete((e) => p(e, r)), t;
|
|
1253
1231
|
} finally {
|
|
1254
1232
|
l();
|
|
1255
1233
|
}
|
|
@@ -1271,28 +1249,40 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1271
1249
|
}, s = function(t) {
|
|
1272
1250
|
var i;
|
|
1273
1251
|
let o = (i = r.get(this)) == null ? {} : i;
|
|
1274
|
-
if (!e.isSampled() || !o.url ||
|
|
1252
|
+
if (!e.isSampled() || !o.url || Me(e.config, o.url)) return a.call(this, t);
|
|
1275
1253
|
o.startedAt = Date.now();
|
|
1276
|
-
let s =
|
|
1277
|
-
|
|
1278
|
-
let u = !1, d = () => {
|
|
1279
|
-
c.cancel(), !
|
|
1254
|
+
let s = en(e, "xhr", o), c = $t(e, o.url), l = Qt(e, o.url);
|
|
1255
|
+
Ne(e.config, o.url) && Xt(this, s);
|
|
1256
|
+
let u = !1, d = !1, f = () => {}, p = () => {
|
|
1257
|
+
f(), c.cancel(), !d && (d = !0, n.delete(p), l(), s.end());
|
|
1280
1258
|
};
|
|
1281
|
-
n.add(
|
|
1282
|
-
let
|
|
1283
|
-
u ||
|
|
1284
|
-
|
|
1259
|
+
n.add(p);
|
|
1260
|
+
let m = (t) => {
|
|
1261
|
+
if (u || d) return;
|
|
1262
|
+
u = !0, f();
|
|
1263
|
+
let r = Wt(t, this);
|
|
1264
|
+
tn(e, s, "xhr", {
|
|
1285
1265
|
type: "xhr",
|
|
1286
1266
|
xhr: this
|
|
1287
|
-
}, o), l()
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1267
|
+
}, r, o), l();
|
|
1268
|
+
let i = Date.now();
|
|
1269
|
+
c.complete((t) => {
|
|
1270
|
+
if (!d) {
|
|
1271
|
+
if (d = !0, n.delete(p), t) {
|
|
1272
|
+
s.setAttributes(e.applyRedact(zt(t))), s.end(performance.timeOrigin + t.startTime + Rt(t));
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1275
|
+
s.end(i);
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
}, h = () => m("abort"), g = () => m("error"), _ = () => m("load"), v = () => m("timeout");
|
|
1279
|
+
f = () => {
|
|
1280
|
+
this.removeEventListener("abort", h), this.removeEventListener("error", g), this.removeEventListener("load", _), this.removeEventListener("timeout", v);
|
|
1281
|
+
}, this.addEventListener("abort", h, { once: !0 }), this.addEventListener("error", g, { once: !0 }), this.addEventListener("load", _, { once: !0 }), this.addEventListener("timeout", v, { once: !0 });
|
|
1292
1282
|
try {
|
|
1293
1283
|
return a.call(this, t);
|
|
1294
1284
|
} catch (e) {
|
|
1295
|
-
throw e instanceof Error && s.recordException(e),
|
|
1285
|
+
throw e instanceof Error && s.recordException(e), m("error"), e;
|
|
1296
1286
|
}
|
|
1297
1287
|
};
|
|
1298
1288
|
XMLHttpRequest.prototype.open = o, XMLHttpRequest.prototype.send = s, t.push(() => {
|
|
@@ -1307,9 +1297,9 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1307
1297
|
for (; t.length;) (e = t.pop()) == null || e();
|
|
1308
1298
|
}
|
|
1309
1299
|
};
|
|
1310
|
-
},
|
|
1311
|
-
if (t) return
|
|
1312
|
-
},
|
|
1300
|
+
}, rn = /^https?:|^\/\//i, an = (e, t) => {
|
|
1301
|
+
if (t) return rn.test(t) ? e(t) : t;
|
|
1302
|
+
}, on = () => {
|
|
1313
1303
|
let e;
|
|
1314
1304
|
return {
|
|
1315
1305
|
name: "csp-violation",
|
|
@@ -1317,11 +1307,10 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1317
1307
|
if (typeof window > "u" || typeof document > "u") return;
|
|
1318
1308
|
let n = (e) => {
|
|
1319
1309
|
if (!t.isSampled()) return;
|
|
1320
|
-
let n = Date.now(), r =
|
|
1321
|
-
t.startSpan("csp.violation",
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
spanSubtype: "csp",
|
|
1310
|
+
let n = Date.now(), r = an(t.config.hooks.redactUrl, e.blockedURI), i = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0;
|
|
1311
|
+
t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()), N({
|
|
1312
|
+
outcome: j.error,
|
|
1313
|
+
outcomeReason: "csp",
|
|
1325
1314
|
spanType: M.error
|
|
1326
1315
|
})), {}, {
|
|
1327
1316
|
"csp.blocked_uri": r,
|
|
@@ -1333,9 +1322,6 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1333
1322
|
"csp.column_number": e.columnNumber,
|
|
1334
1323
|
"csp.status_code": e.statusCode,
|
|
1335
1324
|
"csp.original_policy": e.originalPolicy,
|
|
1336
|
-
[_.eventId]: h("event"),
|
|
1337
|
-
[_.eventTimestamp]: n,
|
|
1338
|
-
[_.eventType]: "error",
|
|
1339
1325
|
"error.source": "csp"
|
|
1340
1326
|
}), { startTime: n }).end(n);
|
|
1341
1327
|
};
|
|
@@ -1345,7 +1331,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1345
1331
|
e == null || e(), e = void 0;
|
|
1346
1332
|
}
|
|
1347
1333
|
};
|
|
1348
|
-
},
|
|
1334
|
+
}, sn = (e) => {
|
|
1349
1335
|
if (e instanceof Error) return e.message;
|
|
1350
1336
|
if (typeof e == "string") return e;
|
|
1351
1337
|
try {
|
|
@@ -1353,9 +1339,9 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1353
1339
|
} catch (t) {
|
|
1354
1340
|
return String(e);
|
|
1355
1341
|
}
|
|
1356
|
-
},
|
|
1342
|
+
}, cn = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o }) => {
|
|
1357
1343
|
if (!e.isSampled()) return;
|
|
1358
|
-
let s = Date.now(), c =
|
|
1344
|
+
let s = Date.now(), c = sn(n);
|
|
1359
1345
|
e.notifyActivity({
|
|
1360
1346
|
time: s,
|
|
1361
1347
|
type: "error"
|
|
@@ -1363,15 +1349,10 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1363
1349
|
let l = n instanceof Error ? n : {
|
|
1364
1350
|
message: c,
|
|
1365
1351
|
name: r == null ? a : r
|
|
1366
|
-
}, u =
|
|
1367
|
-
|
|
1368
|
-
result: j.error,
|
|
1369
|
-
spanSubtype: rn(a),
|
|
1352
|
+
}, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), N({
|
|
1353
|
+
outcome: j.error,
|
|
1370
1354
|
spanType: M.error
|
|
1371
1355
|
})), {}, {
|
|
1372
|
-
[_.eventId]: h("event"),
|
|
1373
|
-
[_.eventTimestamp]: s,
|
|
1374
|
-
[_.eventType]: "error",
|
|
1375
1356
|
"error.message": c,
|
|
1376
1357
|
"error.handled": !1,
|
|
1377
1358
|
"error.source": a
|
|
@@ -1380,7 +1361,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1380
1361
|
code: t.ERROR,
|
|
1381
1362
|
message: c
|
|
1382
1363
|
}), d.end();
|
|
1383
|
-
},
|
|
1364
|
+
}, ln = () => {
|
|
1384
1365
|
let e = [];
|
|
1385
1366
|
return {
|
|
1386
1367
|
name: "error",
|
|
@@ -1389,19 +1370,19 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1389
1370
|
let n = (e) => {
|
|
1390
1371
|
var n;
|
|
1391
1372
|
let r = !e.error && !e.filename && e.message === "Script error.";
|
|
1392
|
-
|
|
1373
|
+
cn({
|
|
1393
1374
|
context: t,
|
|
1394
1375
|
spanName: "browser.error",
|
|
1395
1376
|
source: "window.error",
|
|
1396
1377
|
error: (n = e.error) == null ? e.message : n,
|
|
1397
|
-
extra:
|
|
1378
|
+
extra: S({
|
|
1398
1379
|
"code.filepath": e.filename,
|
|
1399
1380
|
"code.lineno": e.lineno,
|
|
1400
1381
|
"code.column": e.colno
|
|
1401
1382
|
}, r ? { "error.cross_origin": !0 } : {})
|
|
1402
1383
|
});
|
|
1403
1384
|
}, r = (e) => {
|
|
1404
|
-
|
|
1385
|
+
cn({
|
|
1405
1386
|
context: t,
|
|
1406
1387
|
spanName: "browser.unhandledrejection",
|
|
1407
1388
|
source: "unhandledrejection",
|
|
@@ -1413,7 +1394,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1413
1394
|
let n = e.target;
|
|
1414
1395
|
if (!(n instanceof Element)) return;
|
|
1415
1396
|
let r = n, i = r.src || r.href || n.currentSrc || "";
|
|
1416
|
-
|
|
1397
|
+
cn({
|
|
1417
1398
|
context: t,
|
|
1418
1399
|
spanName: "browser.resource_error",
|
|
1419
1400
|
source: "resource",
|
|
@@ -1434,11 +1415,7 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1434
1415
|
}
|
|
1435
1416
|
}
|
|
1436
1417
|
};
|
|
1437
|
-
},
|
|
1438
|
-
var n;
|
|
1439
|
-
let r = (n = e.attribution) == null ? void 0 : n[0];
|
|
1440
|
-
return r != null && r.containerSrc ? t(r.containerSrc) : (r == null ? void 0 : r.containerName) || (r == null ? void 0 : r.name) || e.name || "unknown";
|
|
1441
|
-
}, dn = (e, t) => ({
|
|
1418
|
+
}, un = 50, dn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, B = (e) => Number.isFinite(e) ? e : void 0, fn = (e, t) => S(S(S(S(S({}, e.containerId ? { "long_task.attribution.container_id": e.containerId } : {}), e.containerName ? { "long_task.attribution.container_name": e.containerName } : {}), e.containerSrc ? { "long_task.attribution.container_src": t(e.containerSrc) } : {}), e.containerType ? { "long_task.attribution.container_type": e.containerType } : {}), e.name ? { "long_task.attribution.name": e.name } : {}), pn = (e, t) => ({
|
|
1442
1419
|
"long_task.script.duration": e.duration,
|
|
1443
1420
|
"long_task.script.execution_start": e.executionStart,
|
|
1444
1421
|
"long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
|
|
@@ -1450,8 +1427,8 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1450
1427
|
"long_task.script.source_url": e.sourceURL ? t(e.sourceURL) : "",
|
|
1451
1428
|
"long_task.script.start_time": e.startTime,
|
|
1452
1429
|
"long_task.script.window_attribution": e.windowAttribution
|
|
1453
|
-
}),
|
|
1454
|
-
let t =
|
|
1430
|
+
}), mn = (e = {}) => {
|
|
1431
|
+
let t = dn(e.threshold, un), n, r, i = [];
|
|
1455
1432
|
return {
|
|
1456
1433
|
name: "long-task",
|
|
1457
1434
|
init(e) {
|
|
@@ -1462,22 +1439,16 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1462
1439
|
let c = (n) => {
|
|
1463
1440
|
var r, i;
|
|
1464
1441
|
if (!e.isSampled() || !Number.isFinite(n.duration) || n.duration < t) return;
|
|
1465
|
-
let a = n.entryType === "long-animation-frame", o = a ? n : void 0, s = (r = o == null ? void 0 : o.scripts) == null ? [] : r, c = h("long-task"), l = performance.timeOrigin + n.startTime, u = l + n.duration, d = a ? "long-animation-frame" : "long-task", f = a
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
})), {}, {
|
|
1471
|
-
[_.longTaskBlockingDuration]: (i = o == null ? void 0 : o.blockingDuration) == null ? n.duration : i,
|
|
1472
|
-
[_.longTaskDuration]: n.duration,
|
|
1473
|
-
[_.longTaskEntryType]: d,
|
|
1474
|
-
[_.longTaskId]: c,
|
|
1475
|
-
[_.eventId]: h("event"),
|
|
1476
|
-
[_.eventTimestamp]: l,
|
|
1477
|
-
[_.eventType]: "long_task"
|
|
1478
|
-
}, f ? { "long_task.attribution": f } : {}), ln(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), ln(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), ln(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), o ? { [_.longTaskStartTime]: o.startTime } : {}), { startTime: l });
|
|
1442
|
+
let a = n.entryType === "long-animation-frame", o = a ? n : void 0, s = (r = o == null ? void 0 : o.scripts) == null ? [] : r, c = h("long-task"), l = performance.timeOrigin + n.startTime, u = l + n.duration, d = a ? "long-animation-frame" : "long-task", f = a || (i = n.attribution) == null ? [] : i, p = e.startSpan("browser.long_task", S(S(S(S(S(S(S({}, e.config.hooks.getPageAttributes()), N({ spanType: M.longTask })), B(o == null ? void 0 : o.blockingDuration) === void 0 ? {} : { [g.longTaskBlockingDuration]: o.blockingDuration }), {}, {
|
|
1443
|
+
[g.longTaskDuration]: n.duration,
|
|
1444
|
+
[g.longTaskEntryType]: d,
|
|
1445
|
+
[g.longTaskId]: c,
|
|
1446
|
+
"long_task.name": n.name
|
|
1447
|
+
}, B(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), B(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), B(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), o ? { [g.longTaskStartTime]: o.startTime } : {}), { startTime: l });
|
|
1479
1448
|
s.forEach((t) => {
|
|
1480
|
-
p.addEvent("long_task.script", e.applyRedact(
|
|
1449
|
+
p.addEvent("long_task.script", e.applyRedact(pn(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
|
|
1450
|
+
}), f.forEach((t, n) => {
|
|
1451
|
+
p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n }, fn(t, e.config.hooks.redactUrl))), l);
|
|
1481
1452
|
}), p.end(u), e.notifyActivity({
|
|
1482
1453
|
endTime: u,
|
|
1483
1454
|
startTime: l,
|
|
@@ -1504,43 +1475,43 @@ var Se = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1504
1475
|
n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
|
|
1505
1476
|
}
|
|
1506
1477
|
};
|
|
1507
|
-
},
|
|
1508
|
-
let n =
|
|
1509
|
-
|
|
1478
|
+
}, V = /* @__PURE__ */ new Set(), H = "", U, W, G = !1, K = () => typeof location > "u" ? "" : location.href, q = (e, t) => {
|
|
1479
|
+
let n = K();
|
|
1480
|
+
H = n;
|
|
1510
1481
|
let r = {
|
|
1511
1482
|
fromUrl: t,
|
|
1512
1483
|
source: e,
|
|
1513
1484
|
toUrl: n
|
|
1514
1485
|
};
|
|
1515
|
-
for (let e of Array.from(
|
|
1516
|
-
}, pn = () => {
|
|
1517
|
-
J("popstate", U || q());
|
|
1518
|
-
}, mn = () => {
|
|
1519
|
-
J("hashchange", U || q());
|
|
1486
|
+
for (let e of Array.from(V)) e(r);
|
|
1520
1487
|
}, hn = () => {
|
|
1521
|
-
|
|
1522
|
-
|
|
1488
|
+
q("popstate", H || K());
|
|
1489
|
+
}, gn = () => {
|
|
1490
|
+
q("hashchange", H || K());
|
|
1491
|
+
}, _n = () => {
|
|
1492
|
+
G || typeof window > "u" || typeof history > "u" || (G = !0, H = K(), U = history.pushState, W = history.replaceState, history.pushState = function(e, t, n) {
|
|
1493
|
+
let r = H || K(), i = U == null ? void 0 : U.apply(this, [
|
|
1523
1494
|
e,
|
|
1524
1495
|
t,
|
|
1525
1496
|
n
|
|
1526
1497
|
]);
|
|
1527
|
-
return
|
|
1498
|
+
return q("pushState", r), i;
|
|
1528
1499
|
}, history.replaceState = function(e, t, n) {
|
|
1529
|
-
let r =
|
|
1500
|
+
let r = H || K(), i = W == null ? void 0 : W.apply(this, [
|
|
1530
1501
|
e,
|
|
1531
1502
|
t,
|
|
1532
1503
|
n
|
|
1533
1504
|
]);
|
|
1534
|
-
return
|
|
1535
|
-
}, window.addEventListener("popstate",
|
|
1536
|
-
},
|
|
1537
|
-
!
|
|
1538
|
-
},
|
|
1539
|
-
|
|
1505
|
+
return q("replaceState", r), i;
|
|
1506
|
+
}, window.addEventListener("popstate", hn), window.addEventListener("hashchange", gn));
|
|
1507
|
+
}, vn = () => {
|
|
1508
|
+
!G || typeof window > "u" || typeof history > "u" || (U && (history.pushState = U), W && (history.replaceState = W), window.removeEventListener("popstate", hn), window.removeEventListener("hashchange", gn), U = void 0, W = void 0, G = !1, H = "");
|
|
1509
|
+
}, yn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (_n(), V.add(e), () => {
|
|
1510
|
+
V.delete(e), V.size === 0 && vn();
|
|
1540
1511
|
});
|
|
1541
1512
|
//#endregion
|
|
1542
1513
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
|
|
1543
|
-
function
|
|
1514
|
+
function bn(e, t) {
|
|
1544
1515
|
if (e == null) return {};
|
|
1545
1516
|
var n = {};
|
|
1546
1517
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -1551,9 +1522,9 @@ function vn(e, t) {
|
|
|
1551
1522
|
}
|
|
1552
1523
|
//#endregion
|
|
1553
1524
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
|
|
1554
|
-
function
|
|
1525
|
+
function xn(e, t) {
|
|
1555
1526
|
if (e == null) return {};
|
|
1556
|
-
var n, r, i =
|
|
1527
|
+
var n, r, i = bn(e, t);
|
|
1557
1528
|
if (Object.getOwnPropertySymbols) {
|
|
1558
1529
|
var a = Object.getOwnPropertySymbols(e);
|
|
1559
1530
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -1562,18 +1533,18 @@ function yn(e, t) {
|
|
|
1562
1533
|
}
|
|
1563
1534
|
//#endregion
|
|
1564
1535
|
//#region src/plugins/page-view.ts
|
|
1565
|
-
var
|
|
1536
|
+
var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () => typeof location > "u" ? "" : location.href, Tn = () => {
|
|
1566
1537
|
if (typeof performance > "u") return {};
|
|
1567
1538
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1568
1539
|
if (!e) return {};
|
|
1569
1540
|
let t = {}, n = (e, n) => {
|
|
1570
1541
|
Number.isFinite(n) && n > 0 && (t[e] = n);
|
|
1571
1542
|
};
|
|
1572
|
-
return n(
|
|
1573
|
-
},
|
|
1543
|
+
return n(g.viewFirstByte, e.responseStart), n(g.viewDomInteractive, e.domInteractive), n(g.viewDomContentLoaded, e.domContentLoadedEventEnd), n(g.viewDomComplete, e.domComplete), n(g.viewLoadEvent, e.loadEventEnd), t;
|
|
1544
|
+
}, En = (e) => {
|
|
1574
1545
|
let t = e.indexOf("?");
|
|
1575
1546
|
return t < 0 ? e : e.slice(0, t);
|
|
1576
|
-
},
|
|
1547
|
+
}, Dn = (e) => {
|
|
1577
1548
|
let t = e.slice(1);
|
|
1578
1549
|
if (!t || typeof document > "u" || typeof document.getElementById != "function") return !1;
|
|
1579
1550
|
try {
|
|
@@ -1581,58 +1552,55 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1581
1552
|
} catch (e) {
|
|
1582
1553
|
return !!document.getElementById(t);
|
|
1583
1554
|
}
|
|
1584
|
-
},
|
|
1555
|
+
}, On = (e, t) => {
|
|
1585
1556
|
try {
|
|
1586
1557
|
let n = typeof location > "u" ? "http://localhost" : location.href, r = new URL(e, n), i = new URL(t, n);
|
|
1587
|
-
return r.pathname !== i.pathname || !
|
|
1558
|
+
return r.pathname !== i.pathname || !Dn(i.hash) && En(r.hash) !== En(i.hash);
|
|
1588
1559
|
} catch (n) {
|
|
1589
1560
|
return e !== t;
|
|
1590
1561
|
}
|
|
1591
|
-
},
|
|
1562
|
+
}, kn = () => {
|
|
1592
1563
|
let e = [];
|
|
1593
1564
|
return {
|
|
1594
1565
|
name: "page-view",
|
|
1595
1566
|
init(t) {
|
|
1596
1567
|
if (typeof window > "u") return;
|
|
1597
|
-
let n, r, i = (e = Date.now()) => t.setView({}, e),
|
|
1598
|
-
e.version += 1, t.startSpan("browser.view",
|
|
1599
|
-
[
|
|
1600
|
-
[
|
|
1601
|
-
[
|
|
1602
|
-
[_.eventType]: "view",
|
|
1603
|
-
[_.viewStartedAt]: e.startedAt,
|
|
1604
|
-
[_.viewVersion]: e.version
|
|
1568
|
+
let n, r, i, a = (e = Date.now()) => t.setView({}, e), o = (e, n, r = Date.now(), i) => {
|
|
1569
|
+
e.version += 1, t.startSpan("browser.view", S(S(S(S(S({}, t.config.hooks.getPageAttributes()), e.attributes), e.snapshotAttributes), {}, {
|
|
1570
|
+
[g.viewPhase]: n,
|
|
1571
|
+
[g.viewStartedAt]: e.startedAt,
|
|
1572
|
+
[g.viewVersion]: e.version
|
|
1605
1573
|
}, i ? { "view.end_reason": i } : {}), e.loadingTime === void 0 ? {} : {
|
|
1606
|
-
[
|
|
1574
|
+
[g.viewLoadingTime]: e.loadingTime,
|
|
1607
1575
|
"view.loading_time.source": e.loadingTimeSource
|
|
1608
1576
|
}), {
|
|
1609
1577
|
contextTime: r,
|
|
1610
1578
|
startTime: r
|
|
1611
1579
|
}).end(r);
|
|
1612
|
-
},
|
|
1613
|
-
var
|
|
1580
|
+
}, s = (e, t = !0, r = Date.now()) => {
|
|
1581
|
+
var i;
|
|
1614
1582
|
if (!n) {
|
|
1615
|
-
t &&
|
|
1583
|
+
t && a(r);
|
|
1616
1584
|
return;
|
|
1617
1585
|
}
|
|
1618
|
-
let s =
|
|
1619
|
-
(
|
|
1586
|
+
let s = S({}, n);
|
|
1587
|
+
(i = n.stopLoadingTime) == null || i.call(n), o(n, "end", r, e), n = void 0, t && a(r);
|
|
1620
1588
|
let { stopLoadingTime: c } = s;
|
|
1621
|
-
return
|
|
1622
|
-
},
|
|
1589
|
+
return xn(s, Sn);
|
|
1590
|
+
}, c = (e, t, r) => {
|
|
1623
1591
|
if (n !== e || !Number.isFinite(t) || t < 0) return;
|
|
1624
|
-
let i =
|
|
1625
|
-
[
|
|
1592
|
+
let i = S(S({}, e.loadingType === "initial_load" ? Tn() : {}), {}, {
|
|
1593
|
+
[g.viewLoadingTime]: t,
|
|
1626
1594
|
"view.loading_time.source": r
|
|
1627
1595
|
});
|
|
1628
|
-
Object.assign(e.snapshotAttributes, i), e.loadingTime = t, e.loadingTimeSource = r,
|
|
1629
|
-
},
|
|
1596
|
+
Object.assign(e.snapshotAttributes, i), e.loadingTime = t, e.loadingTimeSource = r, o(e, "update");
|
|
1597
|
+
}, l = (e) => {
|
|
1630
1598
|
if (!t.config.view.loadingTime || document.visibilityState === "hidden") return;
|
|
1631
|
-
let r = !1, i, a = e.loadingType !== "initial_load", o,
|
|
1599
|
+
let r = !1, i, a = e.loadingType !== "initial_load", o, s, l = !1, u, d = () => {
|
|
1632
1600
|
var t;
|
|
1633
1601
|
if (l || !r || !a || n !== e) return;
|
|
1634
|
-
let
|
|
1635
|
-
|
|
1602
|
+
let s = [i, o].filter((e) => e !== void 0);
|
|
1603
|
+
s.length && c(e, Math.max(...s), "auto"), (t = e.stopLoadingTime) == null || t.call(e), e.stopLoadingTime = void 0;
|
|
1636
1604
|
}, f = () => {
|
|
1637
1605
|
var t, n;
|
|
1638
1606
|
let r = (t = (n = performance).getEntriesByType) == null ? void 0 : t.call(n, "navigation")[0];
|
|
@@ -1644,7 +1612,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1644
1612
|
n === e && (f(), a = !0, d());
|
|
1645
1613
|
});
|
|
1646
1614
|
};
|
|
1647
|
-
window.addEventListener("load", t, { once: !0 }),
|
|
1615
|
+
window.addEventListener("load", t, { once: !0 }), s = () => window.removeEventListener("load", t);
|
|
1648
1616
|
}
|
|
1649
1617
|
let p = ht(t, e.startedAt, (t) => {
|
|
1650
1618
|
r = !0, t.hadActivity && (i = Math.max(0, t.endTime - e.startedAt)), d();
|
|
@@ -1653,61 +1621,57 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1653
1621
|
document.visibilityState === "hidden" && (l = !0, (t = e.stopLoadingTime) == null || t.call(e), e.stopLoadingTime = void 0);
|
|
1654
1622
|
};
|
|
1655
1623
|
document.addEventListener("visibilitychange", m), u = () => document.removeEventListener("visibilitychange", m), e.stopLoadingTime = () => {
|
|
1656
|
-
p(),
|
|
1624
|
+
p(), s == null || s(), s = void 0, u == null || u(), u = void 0;
|
|
1657
1625
|
}, d();
|
|
1658
|
-
},
|
|
1626
|
+
}, u = (e) => {
|
|
1659
1627
|
let n = t.applyRedact(e == null ? {} : e);
|
|
1660
|
-
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !
|
|
1661
|
-
},
|
|
1662
|
-
var
|
|
1628
|
+
return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !Cn.has(e)));
|
|
1629
|
+
}, d = (e, r, i, a = ((e) => (e = n == null ? void 0 : n.rawUrl) == null ? "" : e)()) => {
|
|
1630
|
+
var c, d;
|
|
1663
1631
|
if (!t.isSessionActive()) return;
|
|
1664
|
-
let f = (
|
|
1665
|
-
|
|
1666
|
-
let v = h("view"), y = t.config.hooks.redactUrl(f), b = t.config.hooks.redactUrl(
|
|
1632
|
+
let f = (c = e.url) == null ? wn() : c, p = t.config.hooks.getViewPathGroup(f), m = (d = e.name) == null ? p : d, _ = u(e.attributes);
|
|
1633
|
+
s(r, !1);
|
|
1634
|
+
let v = h("view"), y = t.config.hooks.redactUrl(f), b = t.config.hooks.redactUrl(a), x = i === "initial_load", C = x && typeof performance < "u" ? performance.timeOrigin : Date.now(), w = x ? Tn() : {};
|
|
1667
1635
|
t.setView({
|
|
1668
|
-
attributes:
|
|
1636
|
+
attributes: _,
|
|
1669
1637
|
id: v,
|
|
1670
1638
|
loadingType: i,
|
|
1671
1639
|
name: m,
|
|
1672
|
-
startedAt:
|
|
1640
|
+
startedAt: C,
|
|
1673
1641
|
url: y,
|
|
1674
1642
|
urlPathGroup: p
|
|
1675
|
-
},
|
|
1676
|
-
attributes:
|
|
1643
|
+
}, C), n = {
|
|
1644
|
+
attributes: _,
|
|
1677
1645
|
version: 0,
|
|
1678
1646
|
id: v,
|
|
1679
1647
|
loadingType: i,
|
|
1680
1648
|
name: m,
|
|
1681
1649
|
rawUrl: f,
|
|
1682
|
-
snapshotAttributes:
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
[
|
|
1688
|
-
[_.viewName]: m,
|
|
1689
|
-
[_.viewUrl]: y,
|
|
1690
|
-
[_.viewUrlPathGroup]: p,
|
|
1691
|
-
[_.viewLoadingType]: i,
|
|
1650
|
+
snapshotAttributes: S(S(S(S(S({}, _), t.config.hooks.getPageAttributes()), w), N({ spanType: M.view })), {}, {
|
|
1651
|
+
[g.viewId]: v,
|
|
1652
|
+
[g.viewName]: m,
|
|
1653
|
+
[g.viewUrl]: y,
|
|
1654
|
+
[g.viewUrlPathGroup]: p,
|
|
1655
|
+
[g.viewLoadingType]: i,
|
|
1692
1656
|
"url.previous": b,
|
|
1693
|
-
|
|
1657
|
+
[g.viewSource]: r
|
|
1694
1658
|
}, x ? { "document.referrer": t.config.hooks.redactUrl(document.referrer || "") } : {}),
|
|
1695
|
-
startedAt:
|
|
1659
|
+
startedAt: C,
|
|
1696
1660
|
url: y,
|
|
1697
1661
|
urlPathGroup: p
|
|
1698
|
-
},
|
|
1699
|
-
},
|
|
1662
|
+
}, o(n, "start", C), l(n);
|
|
1663
|
+
}, f = t.onViewCommand((e) => {
|
|
1700
1664
|
if (e.type === "start") {
|
|
1701
|
-
|
|
1665
|
+
d(e.options, "manual", n ? "route_change" : "initial_load");
|
|
1702
1666
|
return;
|
|
1703
1667
|
}
|
|
1704
1668
|
if (n) {
|
|
1705
1669
|
if (e.type === "set_loading_time") {
|
|
1706
1670
|
var r;
|
|
1707
|
-
(r = n.stopLoadingTime) == null || r.call(n), n.stopLoadingTime = void 0,
|
|
1671
|
+
(r = n.stopLoadingTime) == null || r.call(n), n.stopLoadingTime = void 0, c(n, Math.max(0, e.time - n.startedAt), "manual");
|
|
1708
1672
|
return;
|
|
1709
1673
|
}
|
|
1710
|
-
n.name !== e.name && (n.name = e.name, n.snapshotAttributes[
|
|
1674
|
+
n.name !== e.name && (n.name = e.name, n.snapshotAttributes[g.viewName] = e.name, t.setView({
|
|
1711
1675
|
attributes: n.attributes,
|
|
1712
1676
|
id: n.id,
|
|
1713
1677
|
loadingType: n.loadingType,
|
|
@@ -1715,28 +1679,44 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1715
1679
|
startedAt: n.startedAt,
|
|
1716
1680
|
url: n.url,
|
|
1717
1681
|
urlPathGroup: n.urlPathGroup
|
|
1718
|
-
}),
|
|
1682
|
+
}), o(n, "update"));
|
|
1719
1683
|
}
|
|
1720
|
-
}),
|
|
1721
|
-
t.config.view.tracking === "auto" && (n ||
|
|
1722
|
-
|
|
1684
|
+
}), p = () => {};
|
|
1685
|
+
t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p = yn((e) => {
|
|
1686
|
+
On(e.fromUrl, e.toUrl) && d({}, e.source, "route_change", e.fromUrl);
|
|
1723
1687
|
}));
|
|
1724
|
-
let
|
|
1725
|
-
e.persisted
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1688
|
+
let m = (e) => {
|
|
1689
|
+
if (e.persisted) {
|
|
1690
|
+
r = s("bfcache");
|
|
1691
|
+
return;
|
|
1692
|
+
}
|
|
1693
|
+
r = void 0, s("pagehide");
|
|
1694
|
+
}, _ = (e) => {
|
|
1695
|
+
if (e.persisted && t.config.view.tracking === "auto") {
|
|
1696
|
+
let e = r;
|
|
1697
|
+
if (r = void 0, !t.isSessionActive()) {
|
|
1698
|
+
i = e;
|
|
1699
|
+
return;
|
|
1700
|
+
}
|
|
1701
|
+
d(e ? {
|
|
1702
|
+
attributes: e.attributes,
|
|
1703
|
+
name: e.name,
|
|
1704
|
+
url: e.rawUrl
|
|
1705
|
+
} : {}, "bfCache", "bf_cache", e == null ? void 0 : e.rawUrl);
|
|
1706
|
+
}
|
|
1707
|
+
}, v = t.onSessionLifecycle((e) => {
|
|
1729
1708
|
if (e.type === "expired") {
|
|
1730
|
-
|
|
1709
|
+
var t;
|
|
1710
|
+
i = (t = s("session_expired", !0, e.expiredAt)) == null ? r : t, r = void 0;
|
|
1731
1711
|
return;
|
|
1732
1712
|
}
|
|
1733
|
-
|
|
1734
|
-
attributes:
|
|
1735
|
-
name:
|
|
1736
|
-
url:
|
|
1737
|
-
}, "sessionRenewal", "session_renewal",
|
|
1713
|
+
i && (d({
|
|
1714
|
+
attributes: i.attributes,
|
|
1715
|
+
name: i.name,
|
|
1716
|
+
url: i.rawUrl
|
|
1717
|
+
}, "sessionRenewal", "session_renewal", i.rawUrl), i = void 0);
|
|
1738
1718
|
});
|
|
1739
|
-
window.addEventListener("pagehide",
|
|
1719
|
+
window.addEventListener("pagehide", m), window.addEventListener("pageshow", _), e.push(p, v, f, () => window.removeEventListener("pagehide", m), () => window.removeEventListener("pageshow", _), () => s("shutdown"));
|
|
1740
1720
|
},
|
|
1741
1721
|
shutdown() {
|
|
1742
1722
|
for (; e.length;) {
|
|
@@ -1745,7 +1725,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1745
1725
|
}
|
|
1746
1726
|
}
|
|
1747
1727
|
};
|
|
1748
|
-
},
|
|
1728
|
+
}, An = 5e3, J = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, jn = (e, t, n, r) => ({
|
|
1749
1729
|
expiresAt: Math.min(t + n, t + r),
|
|
1750
1730
|
id: e,
|
|
1751
1731
|
startedAt: t,
|
|
@@ -1753,19 +1733,19 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1753
1733
|
}), Y = (e, t, n) => {
|
|
1754
1734
|
if (t >= e.startedAt + n) return "maxLifetime";
|
|
1755
1735
|
if (t >= e.expiresAt) return "inactivity";
|
|
1756
|
-
},
|
|
1736
|
+
}, Mn = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), Nn = (e, t, n) => {
|
|
1757
1737
|
if (!e) return null;
|
|
1758
1738
|
try {
|
|
1759
1739
|
let r = JSON.parse(e);
|
|
1760
|
-
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 &&
|
|
1740
|
+
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 && J(r.startedAt) && r.startedAt <= t + An && J(r.expiresAt) && r.expiresAt >= r.startedAt && r.expiresAt <= r.startedAt + n || r.status === "expired" && typeof r.previousId == "string" && r.previousId.length > 0 && (r.reason === "inactivity" || r.reason === "maxLifetime") && J(r.expiredAt) && r.expiredAt <= t + An) return r;
|
|
1761
1741
|
} catch (e) {}
|
|
1762
1742
|
return null;
|
|
1763
|
-
},
|
|
1743
|
+
}, Pn = 900 * 1e3, X = 14400 * 1e3, Fn = 1e3, In = 6e4, Ln = [
|
|
1764
1744
|
"click",
|
|
1765
1745
|
"keydown",
|
|
1766
1746
|
"scroll",
|
|
1767
1747
|
"touchstart"
|
|
1768
|
-
],
|
|
1748
|
+
], Rn = /* @__PURE__ */ new Map(), zn = (e) => {
|
|
1769
1749
|
let t = typeof window < "u", n = () => {
|
|
1770
1750
|
var n;
|
|
1771
1751
|
if (t) try {
|
|
@@ -1773,47 +1753,41 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1773
1753
|
} catch (e) {
|
|
1774
1754
|
t = !1;
|
|
1775
1755
|
}
|
|
1776
|
-
return (n =
|
|
1756
|
+
return (n = Rn.get(e)) == null ? null : n;
|
|
1777
1757
|
};
|
|
1778
1758
|
return n(), {
|
|
1779
1759
|
isLocalStorage: () => t,
|
|
1780
1760
|
read: n,
|
|
1781
1761
|
write: (n) => {
|
|
1782
1762
|
let r = JSON.stringify(n);
|
|
1783
|
-
if (
|
|
1763
|
+
if (Rn.set(e, r), t) try {
|
|
1784
1764
|
window.localStorage.setItem(e, r);
|
|
1785
1765
|
} catch (e) {
|
|
1786
1766
|
t = !1;
|
|
1787
1767
|
}
|
|
1788
1768
|
}
|
|
1789
1769
|
};
|
|
1790
|
-
},
|
|
1770
|
+
}, Bn = (e, t) => {
|
|
1791
1771
|
let n = "";
|
|
1792
1772
|
try {
|
|
1793
1773
|
n = new URL(e).host;
|
|
1794
1774
|
} catch (t) {
|
|
1795
1775
|
n = e;
|
|
1796
1776
|
}
|
|
1797
|
-
return `bk_ot_session__${
|
|
1798
|
-
},
|
|
1799
|
-
e.startSpan("browser.session",
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
[
|
|
1804
|
-
[
|
|
1805
|
-
[_.eventTimestamp]: i,
|
|
1806
|
-
[_.eventType]: "session",
|
|
1807
|
-
[_.sessionHasReplay]: !1,
|
|
1808
|
-
[_.sessionId]: n,
|
|
1809
|
-
[_.sessionStartTime]: r,
|
|
1810
|
-
[_.sessionType]: "user",
|
|
1777
|
+
return `bk_ot_session__${m(`${t}\0${n || "default"}`)}`;
|
|
1778
|
+
}, Vn = (e, t, n, r, i, a, o) => {
|
|
1779
|
+
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()), N({ spanType: M.session })), {}, {
|
|
1780
|
+
[g.sessionPhase]: t,
|
|
1781
|
+
[g.sessionHasReplay]: !1,
|
|
1782
|
+
[g.sessionId]: n,
|
|
1783
|
+
[g.sessionStartTime]: r,
|
|
1784
|
+
[g.sessionType]: "user",
|
|
1811
1785
|
"session.lifecycle.reason": a
|
|
1812
1786
|
}, o ? { "session.previous_id": o } : {}), {
|
|
1813
1787
|
contextTime: i,
|
|
1814
1788
|
startTime: i
|
|
1815
1789
|
}).end(i);
|
|
1816
|
-
},
|
|
1790
|
+
}, Hn = (e = {}) => {
|
|
1817
1791
|
let t = [];
|
|
1818
1792
|
return {
|
|
1819
1793
|
name: "session",
|
|
@@ -1822,14 +1796,14 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1822
1796
|
if (typeof window > "u" || typeof document > "u") {
|
|
1823
1797
|
let e = Date.now(), t = h("session");
|
|
1824
1798
|
n.setRuntimeAttributes({
|
|
1825
|
-
[
|
|
1826
|
-
[
|
|
1827
|
-
[
|
|
1828
|
-
[
|
|
1799
|
+
[g.sessionHasReplay]: !1,
|
|
1800
|
+
[g.sessionId]: t,
|
|
1801
|
+
[g.sessionStartTime]: e,
|
|
1802
|
+
[g.sessionType]: "user"
|
|
1829
1803
|
}, e);
|
|
1830
1804
|
return;
|
|
1831
1805
|
}
|
|
1832
|
-
let i = (r = e.storageKey) == null ?
|
|
1806
|
+
let i = (r = e.storageKey) == null ? Bn(n.config.transport.endpoint, n.config.application.name) : r, a = zn(i), o = typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), s, c, l, u = (e = Date.now()) => Nn(a.read(), e, X), d = () => {
|
|
1833
1807
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
1834
1808
|
}, f = (e, t = Date.now()) => {
|
|
1835
1809
|
var r;
|
|
@@ -1839,11 +1813,11 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1839
1813
|
id: i,
|
|
1840
1814
|
reason: e,
|
|
1841
1815
|
type: "expired"
|
|
1842
|
-
}),
|
|
1843
|
-
[
|
|
1844
|
-
[
|
|
1845
|
-
[
|
|
1846
|
-
[
|
|
1816
|
+
}), Vn(n, "end", i, (r = c) == null ? t : r, t, e), d(), s = void 0, c = void 0, n.setRuntimeAttributes({
|
|
1817
|
+
[g.sessionHasReplay]: void 0,
|
|
1818
|
+
[g.sessionId]: void 0,
|
|
1819
|
+
[g.sessionStartTime]: void 0,
|
|
1820
|
+
[g.sessionType]: void 0
|
|
1847
1821
|
}, t), n.flush());
|
|
1848
1822
|
}, p = () => {
|
|
1849
1823
|
let e = Date.now(), t = u(e);
|
|
@@ -1875,13 +1849,13 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1875
1849
|
d();
|
|
1876
1850
|
let t = Math.min(e.expiresAt, e.startedAt + X);
|
|
1877
1851
|
l = setTimeout(p, Math.max(0, t - Date.now()));
|
|
1878
|
-
},
|
|
1852
|
+
}, _ = (e, t) => {
|
|
1879
1853
|
let r = e.id !== s;
|
|
1880
1854
|
s = e.id, c = e.startedAt, n.setRuntimeAttributes({
|
|
1881
|
-
[
|
|
1882
|
-
[
|
|
1883
|
-
[
|
|
1884
|
-
[
|
|
1855
|
+
[g.sessionHasReplay]: !1,
|
|
1856
|
+
[g.sessionId]: e.id,
|
|
1857
|
+
[g.sessionStartTime]: e.startedAt,
|
|
1858
|
+
[g.sessionType]: "user"
|
|
1885
1859
|
}, Math.min(e.startedAt, o)), m(e), r && t && n.notifySessionLifecycle({
|
|
1886
1860
|
id: e.id,
|
|
1887
1861
|
previousId: t.previousId,
|
|
@@ -1892,17 +1866,17 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1892
1866
|
}, v = (e = !1) => {
|
|
1893
1867
|
let t = Date.now(), r = u(t);
|
|
1894
1868
|
if ((r == null ? void 0 : r.status) === "active" && !Y(r, t, X)) {
|
|
1895
|
-
let e =
|
|
1896
|
-
a.write(e),
|
|
1869
|
+
let e = Mn(r, t, Pn, X);
|
|
1870
|
+
a.write(e), _(e, s ? void 0 : { reason: "shared" });
|
|
1897
1871
|
return;
|
|
1898
1872
|
}
|
|
1899
|
-
let i = (r == null ? void 0 : r.status) === "expired" ? r.previousId : r == null ? void 0 : r.id, o = (r == null ? void 0 : r.status) === "expired" ? r.reason : r ? Y(r, t, X) : e ? "init" : void 0, c =
|
|
1900
|
-
a.write(c),
|
|
1873
|
+
let i = (r == null ? void 0 : r.status) === "expired" ? r.previousId : r == null ? void 0 : r.id, o = (r == null ? void 0 : r.status) === "expired" ? r.reason : r ? Y(r, t, X) : e ? "init" : void 0, c = jn(h("session"), t, Pn, X);
|
|
1874
|
+
a.write(c), _(c, {
|
|
1901
1875
|
previousId: i,
|
|
1902
1876
|
reason: o == null ? "init" : o
|
|
1903
1877
|
});
|
|
1904
1878
|
let l = o == null ? "init" : o;
|
|
1905
|
-
|
|
1879
|
+
Vn(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
|
|
1906
1880
|
}, y = () => {
|
|
1907
1881
|
if (!s) return;
|
|
1908
1882
|
let e = Date.now(), t = u(e);
|
|
@@ -1910,31 +1884,31 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1910
1884
|
p();
|
|
1911
1885
|
return;
|
|
1912
1886
|
}
|
|
1913
|
-
let n =
|
|
1914
|
-
a.write(n),
|
|
1887
|
+
let n = Mn(t, e, Pn, X);
|
|
1888
|
+
a.write(n), _(n);
|
|
1915
1889
|
};
|
|
1916
1890
|
v(!0);
|
|
1917
1891
|
let b = 0, x = () => {
|
|
1918
1892
|
let e = Date.now();
|
|
1919
|
-
e - b <
|
|
1893
|
+
e - b < Fn || (b = e, v());
|
|
1920
1894
|
}, S = {
|
|
1921
1895
|
capture: !0,
|
|
1922
1896
|
passive: !0
|
|
1923
1897
|
};
|
|
1924
|
-
|
|
1925
|
-
|
|
1898
|
+
Ln.forEach((e) => window.addEventListener(e, x, S)), t.push(() => {
|
|
1899
|
+
Ln.forEach((e) => window.removeEventListener(e, x, S));
|
|
1926
1900
|
});
|
|
1927
1901
|
let C = () => {
|
|
1928
1902
|
document.visibilityState === "visible" && y();
|
|
1929
1903
|
};
|
|
1930
1904
|
document.addEventListener("visibilitychange", C);
|
|
1931
|
-
let w = window.setInterval(C,
|
|
1905
|
+
let w = window.setInterval(C, In);
|
|
1932
1906
|
t.push(() => {
|
|
1933
1907
|
document.removeEventListener("visibilitychange", C), window.clearInterval(w);
|
|
1934
1908
|
});
|
|
1935
1909
|
let T = (e) => {
|
|
1936
1910
|
if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
|
|
1937
|
-
let t = Date.now(), n =
|
|
1911
|
+
let t = Date.now(), n = Nn(e.newValue, t, X);
|
|
1938
1912
|
if ((n == null ? void 0 : n.status) === "active" && n.id === s && !Y(n, t, X)) {
|
|
1939
1913
|
m(n);
|
|
1940
1914
|
return;
|
|
@@ -1947,25 +1921,25 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1947
1921
|
for (var e; t.length;) (e = t.pop()) == null || e();
|
|
1948
1922
|
}
|
|
1949
1923
|
};
|
|
1950
|
-
},
|
|
1951
|
-
if (typeof performance > "u") return
|
|
1924
|
+
}, Un = "unknown", Wn = 10, Gn = 6e4, Kn = 5e3, qn = 1e3, Jn = (e, t) => !!t && e === t, Yn = (e) => e ? e.replace(/_/g, "-") : Un, Xn = () => {
|
|
1925
|
+
if (typeof performance > "u") return Un;
|
|
1952
1926
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1953
|
-
return
|
|
1954
|
-
},
|
|
1927
|
+
return Yn(e == null ? void 0 : e.type);
|
|
1928
|
+
}, Zn = (e, t) => {
|
|
1955
1929
|
let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
|
|
1956
1930
|
return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
|
|
1957
1931
|
}, Z = (e) => {
|
|
1958
1932
|
var t, n, r;
|
|
1959
1933
|
if (!(typeof Element > "u" || !(e instanceof Element))) return (t = (n = (r = e.getAttribute("data-bk-action-name")) == null ? e.getAttribute("aria-label") : r) == null ? e.getAttribute("name") : n) == null ? e.tagName.toLowerCase() : t;
|
|
1960
|
-
},
|
|
1934
|
+
}, Qn = () => {
|
|
1961
1935
|
if (typeof performance > "u") return;
|
|
1962
1936
|
let e = performance.interactionCount;
|
|
1963
1937
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
1964
|
-
},
|
|
1938
|
+
}, $n = (e, t) => {
|
|
1965
1939
|
var n, r;
|
|
1966
1940
|
let i = (n = t.value) == null ? 0 : n;
|
|
1967
1941
|
if (!(t.hadRecentInput || !Number.isFinite(i))) {
|
|
1968
|
-
if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >=
|
|
1942
|
+
if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= qn || t.startTime - e.clsWindowStart >= Kn) {
|
|
1969
1943
|
var a;
|
|
1970
1944
|
e.clsWindowStart = t.startTime, e.clsWindowValue = i, e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = Z((a = t.sources) == null || (a = a[0]) == null ? void 0 : a.node);
|
|
1971
1945
|
} else if (e.clsWindowValue += i, i > e.clsWindowLargestShiftValue) {
|
|
@@ -1974,12 +1948,12 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1974
1948
|
}
|
|
1975
1949
|
e.clsWindowEnd = t.startTime, e.clsWindowValue > e.cls && (e.cls = Math.round(e.clsWindowValue * 1e4) / 1e4, e.largestShiftValue = e.clsWindowLargestShiftValue, e.largestShiftTarget = e.clsWindowLargestShiftTarget);
|
|
1976
1950
|
}
|
|
1977
|
-
},
|
|
1951
|
+
}, er = (e, t) => {
|
|
1978
1952
|
var n, r;
|
|
1979
1953
|
if (!t.interactionId || !Number.isFinite(t.duration)) return;
|
|
1980
1954
|
e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
|
|
1981
1955
|
let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
|
|
1982
|
-
duration: Math.min(t.duration,
|
|
1956
|
+
duration: Math.min(t.duration, Gn),
|
|
1983
1957
|
inputDelay: Math.max(0, i - t.startTime),
|
|
1984
1958
|
interactionId: t.interactionId,
|
|
1985
1959
|
interactionTarget: Z(t.target),
|
|
@@ -1987,18 +1961,14 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
1987
1961
|
presentationDelay: Math.max(0, t.startTime + t.duration - a),
|
|
1988
1962
|
processingDuration: Math.max(0, a - i)
|
|
1989
1963
|
}, s = e.inpCandidates.findIndex((e) => e.interactionId === t.interactionId);
|
|
1990
|
-
s >= 0 ? o.duration > e.inpCandidates[s].duration && (e.inpCandidates[s] = o) : e.inpCandidates.push(o), e.inpCandidates.sort((e, t) => t.duration - e.duration).splice(
|
|
1991
|
-
},
|
|
1992
|
-
let t =
|
|
1964
|
+
s >= 0 ? o.duration > e.inpCandidates[s].duration && (e.inpCandidates[s] = o) : e.inpCandidates.push(o), e.inpCandidates.sort((e, t) => t.duration - e.duration).splice(Wn);
|
|
1965
|
+
}, tr = (e) => {
|
|
1966
|
+
let t = Qn(), n = t !== void 0 && e.interactionCountAtStart !== void 0 ? Math.max(0, t - e.interactionCountAtStart) : e.interactionIdMin === Infinity ? 0 : (e.interactionIdMax - e.interactionIdMin) / 7 + 1;
|
|
1993
1967
|
if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
|
|
1994
|
-
}, tr = (e, t) => {
|
|
1995
|
-
var n;
|
|
1996
|
-
return {
|
|
1997
|
-
"rum.navigation.type": (n = e.navigationType) == null ? t : n,
|
|
1998
|
-
[_.vitalMetric]: e.name.toLowerCase(),
|
|
1999
|
-
[_.vitalRating]: e.rating
|
|
2000
|
-
};
|
|
2001
1968
|
}, nr = (e, t) => {
|
|
1969
|
+
var n;
|
|
1970
|
+
return { "rum.navigation.type": (n = e.navigationType) == null ? t : n };
|
|
1971
|
+
}, rr = (e, t) => {
|
|
2002
1972
|
var n;
|
|
2003
1973
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
2004
1974
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
@@ -2022,7 +1992,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2022
1992
|
default: break;
|
|
2023
1993
|
}
|
|
2024
1994
|
return i;
|
|
2025
|
-
},
|
|
1995
|
+
}, ir = () => {
|
|
2026
1996
|
let e, t = !1;
|
|
2027
1997
|
return {
|
|
2028
1998
|
name: "web-vitals",
|
|
@@ -2040,23 +2010,18 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2040
2010
|
return;
|
|
2041
2011
|
}
|
|
2042
2012
|
if (t) return;
|
|
2043
|
-
let { onFCP: a, onLCP: o, onTTFB: s } = r, c =
|
|
2013
|
+
let { onFCP: a, onLCP: o, onTTFB: s } = r, c = Xn(), l = (e, t, r, i = r == null ? Date.now() : r) => {
|
|
2044
2014
|
if (!n.isSampled()) return;
|
|
2045
2015
|
let a = e.name.toLowerCase();
|
|
2046
|
-
n.startSpan("browser.web_vital",
|
|
2047
|
-
|
|
2048
|
-
result: Ke(e.rating),
|
|
2049
|
-
spanSubtype: a,
|
|
2016
|
+
n.startSpan("browser.web_vital", S(S(S(S(S({}, n.config.hooks.getPageAttributes()), t), nr(e, c)), N({
|
|
2017
|
+
outcome: Ge(e.rating),
|
|
2050
2018
|
spanType: M.vital
|
|
2051
2019
|
})), {}, {
|
|
2052
|
-
[
|
|
2053
|
-
[
|
|
2054
|
-
[
|
|
2055
|
-
[_.eventId]: h("event"),
|
|
2056
|
-
[_.eventTimestamp]: i,
|
|
2057
|
-
[_.eventType]: "vital",
|
|
2020
|
+
[g.vitalMetric]: a,
|
|
2021
|
+
[g.vitalValue]: e.value,
|
|
2022
|
+
[g.vitalRating]: e.rating,
|
|
2058
2023
|
"vital.id": e.id
|
|
2059
|
-
},
|
|
2024
|
+
}, rr(e, n.config.hooks.redactUrl)), {
|
|
2060
2025
|
contextTime: r,
|
|
2061
2026
|
startTime: i
|
|
2062
2027
|
}).end(i);
|
|
@@ -2066,7 +2031,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2066
2031
|
l(e, i === void 0 ? n.getRuntimeAttributes() : n.getRuntimeAttributesAt(i), i);
|
|
2067
2032
|
}, d, f, p, m = (e, t, n) => {
|
|
2068
2033
|
l(e, t, n, Date.now());
|
|
2069
|
-
},
|
|
2034
|
+
}, _ = () => {
|
|
2070
2035
|
let e = d;
|
|
2071
2036
|
if (!e || !n.isSampled()) return;
|
|
2072
2037
|
m({
|
|
@@ -2078,10 +2043,10 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2078
2043
|
id: h("vital"),
|
|
2079
2044
|
name: "CLS",
|
|
2080
2045
|
navigationType: c,
|
|
2081
|
-
rating:
|
|
2046
|
+
rating: Zn("CLS", e.cls),
|
|
2082
2047
|
value: e.cls
|
|
2083
2048
|
}, e.runtimeAttributes, e.startedAt);
|
|
2084
|
-
let t =
|
|
2049
|
+
let t = tr(e);
|
|
2085
2050
|
t && m({
|
|
2086
2051
|
attribution: {
|
|
2087
2052
|
inputDelay: t.inputDelay,
|
|
@@ -2094,26 +2059,26 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2094
2059
|
id: h("vital"),
|
|
2095
2060
|
name: "INP",
|
|
2096
2061
|
navigationType: c,
|
|
2097
|
-
rating:
|
|
2062
|
+
rating: Zn("INP", t.duration),
|
|
2098
2063
|
value: t.duration
|
|
2099
2064
|
}, e.runtimeAttributes, e.startedAt);
|
|
2100
2065
|
}, v = n.onViewChange((e) => {
|
|
2101
2066
|
var t;
|
|
2102
2067
|
let r = d;
|
|
2103
|
-
if (r &&
|
|
2104
|
-
r.runtimeAttributes =
|
|
2105
|
-
[
|
|
2106
|
-
[
|
|
2107
|
-
[
|
|
2108
|
-
[
|
|
2068
|
+
if (r && Jn(r.id, e.id)) {
|
|
2069
|
+
r.runtimeAttributes = S(S({}, r.runtimeAttributes), {}, {
|
|
2070
|
+
[g.viewId]: e.id,
|
|
2071
|
+
[g.viewName]: e.name,
|
|
2072
|
+
[g.viewUrl]: e.url,
|
|
2073
|
+
[g.viewUrlPathGroup]: e.urlPathGroup
|
|
2109
2074
|
});
|
|
2110
2075
|
return;
|
|
2111
2076
|
}
|
|
2112
|
-
|
|
2077
|
+
_(), d = e.id ? {
|
|
2113
2078
|
cls: 0,
|
|
2114
2079
|
clsWindowLargestShiftValue: 0,
|
|
2115
2080
|
clsWindowValue: 0,
|
|
2116
|
-
interactionCountAtStart:
|
|
2081
|
+
interactionCountAtStart: Qn(),
|
|
2117
2082
|
interactionIdMax: 0,
|
|
2118
2083
|
interactionIdMin: Infinity,
|
|
2119
2084
|
inpCandidates: [],
|
|
@@ -2126,12 +2091,12 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2126
2091
|
if (typeof PerformanceObserver < "u") {
|
|
2127
2092
|
var y, b;
|
|
2128
2093
|
(y = PerformanceObserver.supportedEntryTypes) != null && y.includes("layout-shift") && (p = new PerformanceObserver((e) => {
|
|
2129
|
-
if (d) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < d.startedAt ||
|
|
2094
|
+
if (d) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < d.startedAt || $n(d, t);
|
|
2130
2095
|
}), p.observe({
|
|
2131
2096
|
buffered: !0,
|
|
2132
2097
|
type: "layout-shift"
|
|
2133
2098
|
})), (b = PerformanceObserver.supportedEntryTypes) != null && b.includes("event") && (f = new PerformanceObserver((e) => {
|
|
2134
|
-
if (d) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < d.startedAt || !t.interactionId || !Number.isFinite(t.duration) ||
|
|
2099
|
+
if (d) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < d.startedAt || !t.interactionId || !Number.isFinite(t.duration) || er(d, t);
|
|
2135
2100
|
}), f.observe({
|
|
2136
2101
|
buffered: !0,
|
|
2137
2102
|
durationThreshold: 40,
|
|
@@ -2139,7 +2104,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2139
2104
|
}));
|
|
2140
2105
|
}
|
|
2141
2106
|
a(u), o(u), s(u), e = () => {
|
|
2142
|
-
|
|
2107
|
+
_(), d = void 0, v(), p == null || p.disconnect(), f == null || f.disconnect();
|
|
2143
2108
|
};
|
|
2144
2109
|
})();
|
|
2145
2110
|
},
|
|
@@ -2147,7 +2112,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2147
2112
|
t = !0, e == null || e(), e = void 0;
|
|
2148
2113
|
}
|
|
2149
2114
|
};
|
|
2150
|
-
},
|
|
2115
|
+
}, ar = (e, t) => {
|
|
2151
2116
|
let n = {
|
|
2152
2117
|
"network.protocol.name": "websocket",
|
|
2153
2118
|
"url.full": t(e)
|
|
@@ -2157,20 +2122,16 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2157
2122
|
n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
|
|
2158
2123
|
} catch (e) {}
|
|
2159
2124
|
return n;
|
|
2160
|
-
},
|
|
2161
|
-
let a = h("websocket"), o =
|
|
2125
|
+
}, or = (t, n, r, i) => {
|
|
2126
|
+
let a = h("websocket"), o = ar(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
|
|
2162
2127
|
if (i() || !n.isSampled()) return;
|
|
2163
2128
|
let c = t === "error";
|
|
2164
|
-
n.startSpan("browser.websocket",
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
spanSubtype: t,
|
|
2129
|
+
n.startSpan("browser.websocket", S(S(S({}, o), N({
|
|
2130
|
+
outcome: c ? j.error : j.success,
|
|
2131
|
+
outcomeReason: c ? "network" : void 0,
|
|
2168
2132
|
spanType: M.websocket
|
|
2169
2133
|
})), {}, {
|
|
2170
|
-
[
|
|
2171
|
-
[_.eventPhase]: t,
|
|
2172
|
-
[_.eventTimestamp]: r,
|
|
2173
|
-
[_.eventType]: "websocket",
|
|
2134
|
+
[g.websocketPhase]: t,
|
|
2174
2135
|
"websocket.connection.id": a
|
|
2175
2136
|
}, s), {
|
|
2176
2137
|
kind: e.CLIENT,
|
|
@@ -2188,7 +2149,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2188
2149
|
"websocket.close.was_clean": e.wasClean
|
|
2189
2150
|
});
|
|
2190
2151
|
});
|
|
2191
|
-
},
|
|
2152
|
+
}, sr = () => {
|
|
2192
2153
|
let e, t, n = !1;
|
|
2193
2154
|
return {
|
|
2194
2155
|
name: "websocket",
|
|
@@ -2199,35 +2160,35 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2199
2160
|
let a = Reflect.construct(e, t, i);
|
|
2200
2161
|
if (n || !r.isSampled()) return a;
|
|
2201
2162
|
let o = t[0] == null ? "" : String(t[0]);
|
|
2202
|
-
return o && !k(r.config, o) &&
|
|
2163
|
+
return o && !k(r.config, o) && or(a, r, o, () => n), a;
|
|
2203
2164
|
} }), window.WebSocket = t;
|
|
2204
2165
|
},
|
|
2205
2166
|
shutdown() {
|
|
2206
2167
|
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
2207
2168
|
}
|
|
2208
2169
|
};
|
|
2209
|
-
},
|
|
2170
|
+
}, cr = class {
|
|
2210
2171
|
constructor() {
|
|
2211
|
-
|
|
2172
|
+
b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
|
|
2212
2173
|
this.listeners.forEach((t) => t(e));
|
|
2213
|
-
}),
|
|
2174
|
+
}), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
|
|
2214
2175
|
}
|
|
2215
|
-
},
|
|
2176
|
+
}, lr = (e) => ({
|
|
2216
2177
|
url: e.endpoint,
|
|
2217
2178
|
headers: e.headers,
|
|
2218
2179
|
concurrencyLimit: e.concurrencyLimit,
|
|
2219
2180
|
timeoutMillis: e.timeoutMillis
|
|
2220
|
-
}),
|
|
2181
|
+
}), ur = "bk-rum", dr = class {
|
|
2221
2182
|
constructor(e) {
|
|
2222
2183
|
this.isSampled = e;
|
|
2223
2184
|
}
|
|
2224
2185
|
shouldSample() {
|
|
2225
|
-
return { decision: this.isSampled() ?
|
|
2186
|
+
return { decision: this.isSampled() ? u.RECORD_AND_SAMPLED : u.NOT_RECORD };
|
|
2226
2187
|
}
|
|
2227
2188
|
toString() {
|
|
2228
2189
|
return "RumSessionSampler";
|
|
2229
2190
|
}
|
|
2230
|
-
}, Q,
|
|
2191
|
+
}, Q, fr = () => {
|
|
2231
2192
|
if (Q) Q.users += 1;
|
|
2232
2193
|
else {
|
|
2233
2194
|
let e = new a().enable(), t = n.setGlobalContextManager(e);
|
|
@@ -2242,28 +2203,28 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2242
2203
|
return () => {
|
|
2243
2204
|
e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && n.disable(), Q.ownsPropagator && r.disable(), Q = void 0));
|
|
2244
2205
|
};
|
|
2245
|
-
},
|
|
2206
|
+
}, pr = (e, t) => t ? new Proxy(e, { get(e, t, n) {
|
|
2246
2207
|
if (t === "export") return (t, n) => {
|
|
2247
2208
|
var r;
|
|
2248
2209
|
return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
|
|
2249
2210
|
};
|
|
2250
2211
|
let r = Reflect.get(e, t, n);
|
|
2251
2212
|
return typeof r == "function" ? r.bind(e) : r;
|
|
2252
|
-
} }) : e,
|
|
2253
|
-
|
|
2254
|
-
...$(e.tracking.device, !0,
|
|
2213
|
+
} }) : e, mr = (e) => [nn(e.tracking.request)], hr = (e) => [
|
|
2214
|
+
Hn(e.session),
|
|
2215
|
+
...$(e.tracking.device, !0, ce),
|
|
2255
2216
|
pt(),
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
],
|
|
2259
|
-
...$(e.error, !0,
|
|
2260
|
-
...$(e.webVitals, !0,
|
|
2217
|
+
kn(),
|
|
2218
|
+
Bt(gr(e.tracking.resource, !0))
|
|
2219
|
+
], gr = (e, t) => e === void 0 ? t : e !== !1, _r = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => gr(e, t) ? [n(_r(e))] : [], vr = (e) => [
|
|
2220
|
+
...$(e.error, !0, ln),
|
|
2221
|
+
...$(e.webVitals, !0, ir),
|
|
2261
2222
|
...$(e.blankScreen, !0, Ot),
|
|
2262
2223
|
...$(e.action, !0, ut),
|
|
2263
|
-
...$(e.websocket, !1,
|
|
2264
|
-
...$(e.longTask, !1,
|
|
2265
|
-
...$(e.cspViolation, !1,
|
|
2266
|
-
],
|
|
2224
|
+
...$(e.websocket, !1, sr),
|
|
2225
|
+
...$(e.longTask, !1, mn),
|
|
2226
|
+
...$(e.cspViolation, !1, on)
|
|
2227
|
+
], yr = class {
|
|
2267
2228
|
assertBeforeStart(e) {
|
|
2268
2229
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
2269
2230
|
}
|
|
@@ -2293,20 +2254,20 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2293
2254
|
}
|
|
2294
2255
|
createPluginManager() {
|
|
2295
2256
|
var e;
|
|
2296
|
-
return new
|
|
2257
|
+
return new Ce([
|
|
2258
|
+
...hr(this.config),
|
|
2297
2259
|
...mr(this.config),
|
|
2298
|
-
...
|
|
2299
|
-
..._r(this.config.tracking),
|
|
2260
|
+
...vr(this.config.tracking),
|
|
2300
2261
|
...(e = this.config.extensions.plugins) == null ? [] : e
|
|
2301
2262
|
]);
|
|
2302
2263
|
}
|
|
2303
2264
|
constructor(n) {
|
|
2304
2265
|
var r = this;
|
|
2305
|
-
|
|
2266
|
+
b(this, "activityObserver", new cr()), b(this, "flushProviders", E(function* () {
|
|
2306
2267
|
yield r.tracerProvider.forceFlush();
|
|
2307
|
-
})),
|
|
2268
|
+
})), b(this, "phase", "idle"), b(this, "pluginManager", void 0), b(this, "registeredInstrumentations", void 0), b(this, "releaseOtelGlobals", void 0), b(this, "runtimeContext", void 0), b(this, "sampled", !1), b(this, "startCollection", E(function* () {
|
|
2308
2269
|
if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
|
|
2309
|
-
r.releaseOtelGlobals =
|
|
2270
|
+
r.releaseOtelGlobals = fr();
|
|
2310
2271
|
let e = r.createPluginManager();
|
|
2311
2272
|
r.pluginManager = e;
|
|
2312
2273
|
try {
|
|
@@ -2317,47 +2278,39 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2317
2278
|
for (yield e.shutdown(), r.pluginManager = void 0; r.registeredInstrumentations.length;) (n = r.registeredInstrumentations.pop()) == null || (i = n.disable) == null || i.call(n);
|
|
2318
2279
|
throw (a = r.releaseOtelGlobals) == null || a.call(r), r.releaseOtelGlobals = void 0, t;
|
|
2319
2280
|
}
|
|
2320
|
-
})),
|
|
2281
|
+
})), b(this, "stopCollection", function() {
|
|
2321
2282
|
var e = E(function* (e) {
|
|
2322
2283
|
var t, n, i;
|
|
2323
2284
|
let a = r.pluginManager;
|
|
2324
2285
|
if (a) {
|
|
2325
2286
|
for (yield a.shutdown(), r.pluginManager = void 0; r.registeredInstrumentations.length;) (t = r.registeredInstrumentations.pop()) == null || (n = t.disable) == null || n.call(t);
|
|
2326
2287
|
r.setRuntimeAttributes({
|
|
2327
|
-
[
|
|
2328
|
-
[
|
|
2288
|
+
[g.sessionHasReplay]: void 0,
|
|
2289
|
+
[g.sessionId]: void 0
|
|
2329
2290
|
}), e && (yield r.flushProviders()), (i = r.releaseOtelGlobals) == null || i.call(r), r.releaseOtelGlobals = void 0;
|
|
2330
2291
|
}
|
|
2331
2292
|
});
|
|
2332
2293
|
return function(t) {
|
|
2333
2294
|
return e.apply(this, arguments);
|
|
2334
2295
|
};
|
|
2335
|
-
}()),
|
|
2296
|
+
}()), b(this, "teardownCallbacks", []), b(this, "tracerProvider", void 0), b(this, "applyRedact", (e) => this.config.hooks.redactAttributes(e)), b(this, "config", void 0), b(this, "flush", E(function* () {
|
|
2336
2297
|
var e;
|
|
2337
2298
|
yield (e = r.pluginManager) == null ? void 0 : e.flush(), yield r.flushProviders();
|
|
2338
|
-
})),
|
|
2299
|
+
})), b(this, "getRuntimeAttributes", () => this.runtimeContext.getAttributes()), b(this, "getRuntimeAttributesAt", (e) => this.runtimeContext.getAttributesAt(e)), b(this, "isSampled", () => this.sampled), b(this, "isSessionActive", () => this.runtimeContext.isSessionActive()), b(this, "isViewActive", () => this.runtimeContext.isViewActive()), b(this, "notifySessionLifecycle", (e) => {
|
|
2339
2300
|
this.runtimeContext.notifySessionLifecycle(e);
|
|
2340
|
-
}),
|
|
2341
|
-
e.length && (
|
|
2342
|
-
|
|
2343
|
-
tracerProvider: this.tracerProvider
|
|
2301
|
+
}), b(this, "onSessionLifecycle", (e) => this.runtimeContext.onSessionLifecycle(e)), b(this, "registerInstrumentations", (e) => {
|
|
2302
|
+
e.length && (e.forEach((e) => {
|
|
2303
|
+
e.setTracerProvider(this.tracerProvider), e.getConfig().enabled || e.enable();
|
|
2344
2304
|
}), this.registeredInstrumentations.push(...e));
|
|
2345
|
-
}),
|
|
2305
|
+
}), b(this, "reportAction", ({ attributes: e = {}, name: t }) => {
|
|
2346
2306
|
if (!this.isSampled()) return;
|
|
2347
2307
|
let n = h("action"), r = Date.now();
|
|
2348
|
-
this.startSpan("action.custom",
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
})), {}, {
|
|
2353
|
-
[_.actionId]: n,
|
|
2354
|
-
[_.actionName]: t,
|
|
2355
|
-
[_.actionType]: "custom",
|
|
2356
|
-
[_.eventId]: h("event"),
|
|
2357
|
-
[_.eventTimestamp]: r,
|
|
2358
|
-
[_.eventType]: "action"
|
|
2308
|
+
this.startSpan("action.custom", S(S(S(S({}, this.config.hooks.getPageAttributes()), e), N({ spanType: M.action })), {}, {
|
|
2309
|
+
[g.actionId]: n,
|
|
2310
|
+
[g.actionName]: t,
|
|
2311
|
+
[g.actionType]: "custom"
|
|
2359
2312
|
}), { startTime: r }).end(r);
|
|
2360
|
-
}),
|
|
2313
|
+
}), b(this, "reportCustomEvent", ({ attributes: e = {}, error: n, name: r }) => {
|
|
2361
2314
|
if (!this.isSampled()) {
|
|
2362
2315
|
if (this.config.debug) {
|
|
2363
2316
|
var i;
|
|
@@ -2365,48 +2318,41 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2365
2318
|
}
|
|
2366
2319
|
return;
|
|
2367
2320
|
}
|
|
2368
|
-
let a = Date.now(), o = this.startSpan(`custom.${r}`,
|
|
2369
|
-
|
|
2370
|
-
result: n ? j.error : j.success,
|
|
2371
|
-
spanSubtype: r,
|
|
2321
|
+
let a = Date.now(), o = this.startSpan(`custom.${r}`, S(S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e), N({
|
|
2322
|
+
outcome: n ? j.error : j.success,
|
|
2372
2323
|
spanType: M.custom
|
|
2373
|
-
})),
|
|
2374
|
-
[_.eventId]: h("event"),
|
|
2375
|
-
[_.eventTimestamp]: a,
|
|
2376
|
-
[_.eventType]: "custom",
|
|
2377
|
-
"rum.custom.name": r
|
|
2378
|
-
}), { startTime: a });
|
|
2324
|
+
})), {}, { "rum.custom.name": r }), { startTime: a });
|
|
2379
2325
|
n && (o.recordException(n), o.setStatus({
|
|
2380
2326
|
code: t.ERROR,
|
|
2381
2327
|
message: n.message
|
|
2382
2328
|
})), o.end(a);
|
|
2383
|
-
}),
|
|
2384
|
-
let n =
|
|
2385
|
-
if (
|
|
2386
|
-
let t = e[
|
|
2387
|
-
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ?
|
|
2329
|
+
}), b(this, "setRuntimeAttributes", (e, t) => {
|
|
2330
|
+
let n = S({}, e);
|
|
2331
|
+
if (g.sessionId in e) {
|
|
2332
|
+
let t = e[g.sessionId];
|
|
2333
|
+
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? Te(this.config, t) : !1, n[D] = this.sampled;
|
|
2388
2334
|
}
|
|
2389
2335
|
this.runtimeContext.setAttributes(n, t);
|
|
2390
|
-
}),
|
|
2336
|
+
}), b(this, "setTrackingConsent", function() {
|
|
2391
2337
|
var e = E(function* (e) {
|
|
2392
2338
|
r.config.trackingConsent !== e && (r.config.trackingConsent = e, r.phase === "started" && (e === "granted" ? yield r.startCollection() : yield r.stopCollection(!0)));
|
|
2393
2339
|
});
|
|
2394
2340
|
return function(t) {
|
|
2395
2341
|
return e.apply(this, arguments);
|
|
2396
2342
|
};
|
|
2397
|
-
}()),
|
|
2343
|
+
}()), b(this, "setUser", (e) => {
|
|
2398
2344
|
this.runtimeContext.setUser(e);
|
|
2399
|
-
}),
|
|
2345
|
+
}), b(this, "setViewLoadingTime", () => {
|
|
2400
2346
|
this.isSampled() && this.runtimeContext.dispatchViewCommand({
|
|
2401
2347
|
time: Date.now(),
|
|
2402
2348
|
type: "set_loading_time"
|
|
2403
2349
|
});
|
|
2404
|
-
}),
|
|
2350
|
+
}), b(this, "setViewName", (e) => {
|
|
2405
2351
|
this.isSampled() && this.runtimeContext.dispatchViewCommand({
|
|
2406
2352
|
name: e,
|
|
2407
2353
|
type: "set_name"
|
|
2408
2354
|
});
|
|
2409
|
-
}),
|
|
2355
|
+
}), b(this, "shutdown", E(function* () {
|
|
2410
2356
|
if (r.phase !== "stopped") {
|
|
2411
2357
|
for (yield r.stopCollection(!1), yield r.flushProviders(); r.teardownCallbacks.length;) {
|
|
2412
2358
|
var e;
|
|
@@ -2414,7 +2360,7 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2414
2360
|
}
|
|
2415
2361
|
yield r.tracerProvider.shutdown(), r.phase = "stopped";
|
|
2416
2362
|
}
|
|
2417
|
-
})),
|
|
2363
|
+
})), b(this, "start", E(function* () {
|
|
2418
2364
|
if (!(r.phase === "started" || r.phase === "starting")) {
|
|
2419
2365
|
if (r.phase === "stopped") throw Error("[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.");
|
|
2420
2366
|
if (!r.config.enabled) {
|
|
@@ -2440,40 +2386,40 @@ var bn = ["stopLoadingTime"], xn = new Set([...Object.values(_), D]), Sn = () =>
|
|
|
2440
2386
|
}
|
|
2441
2387
|
r.phase = "started";
|
|
2442
2388
|
}
|
|
2443
|
-
})),
|
|
2389
|
+
})), b(this, "startSpan", (t, n = {}, r) => {
|
|
2444
2390
|
var i, a;
|
|
2445
2391
|
if (!this.isSampled()) return this.tracer.startSpan(t);
|
|
2446
2392
|
let o = (i = r == null ? void 0 : r.contextTime) == null ? typeof (r == null ? void 0 : r.startTime) == "number" ? r.startTime : void 0 : i, s = o === void 0 ? this.getRuntimeAttributes() : this.runtimeContext.getAttributesAt(o);
|
|
2447
2393
|
return this.tracer.startSpan(t, {
|
|
2448
2394
|
kind: (a = r == null ? void 0 : r.kind) == null ? e.INTERNAL : a,
|
|
2449
2395
|
startTime: r == null ? void 0 : r.startTime,
|
|
2450
|
-
attributes: this.applyRedact(
|
|
2396
|
+
attributes: this.applyRedact(S(S({}, s), n))
|
|
2451
2397
|
});
|
|
2452
|
-
}),
|
|
2398
|
+
}), b(this, "startView", (e = {}) => {
|
|
2453
2399
|
this.isSampled() && this.runtimeContext.dispatchViewCommand({
|
|
2454
2400
|
options: e,
|
|
2455
2401
|
type: "start"
|
|
2456
2402
|
});
|
|
2457
|
-
}),
|
|
2403
|
+
}), b(this, "tracer", void 0), b(this, "use", (e) => {
|
|
2458
2404
|
var t;
|
|
2459
2405
|
return this.assertBeforeStart("use"), (t = this.config.extensions.plugins) == null || t.push(e), this;
|
|
2460
|
-
}),
|
|
2406
|
+
}), b(this, "useInstrumentation", (e) => {
|
|
2461
2407
|
var t;
|
|
2462
2408
|
return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
|
|
2463
|
-
}), this.config =
|
|
2464
|
-
let i =
|
|
2465
|
-
let e =
|
|
2466
|
-
return [new
|
|
2409
|
+
}), this.config = ye(n), this.runtimeContext = new He({ [D]: !1 }, this.config.user);
|
|
2410
|
+
let i = c(this.config.resourceAttributes), a = (() => {
|
|
2411
|
+
let e = pr(new s(lr(this.config.transport)), this.config.debug);
|
|
2412
|
+
return [new Be(this.config.spanProcessor === "simple" ? new d(e) : new l(e, this.config.spanBatch), this.config, () => this.applyRedact(S(S({}, this.runtimeContext.getAttributes()), this.config.hooks.getPageAttributes())))];
|
|
2467
2413
|
})();
|
|
2468
|
-
this.tracerProvider = new
|
|
2414
|
+
this.tracerProvider = new f({
|
|
2469
2415
|
resource: i,
|
|
2470
|
-
sampler: new
|
|
2416
|
+
sampler: new dr(this.isSampled),
|
|
2471
2417
|
spanProcessors: a
|
|
2472
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
2418
|
+
}), this.tracer = this.tracerProvider.getTracer(ur), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
|
|
2473
2419
|
var t;
|
|
2474
2420
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
2475
2421
|
});
|
|
2476
2422
|
}
|
|
2477
2423
|
};
|
|
2478
2424
|
//#endregion
|
|
2479
|
-
export {
|
|
2425
|
+
export { yr as BkOpenTelemetry, dt as EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE, Be as FilteringSpanProcessor, g as RUM_ATTRIBUTES, j as RUM_SPAN_OUTCOME, M as RUM_SPAN_TYPE, He as RumRuntimeContext, N as buildRumSpanAttributes, ut as createActionPlugin, Ot as createBlankScreenPlugin, nn as createCommonInstrumentationsPlugin, on as createCspViolationPlugin, ce as createDevicePlugin, ln as createErrorPlugin, mn as createLongTaskPlugin, Se as createPlugin, Bt as createResourcePlugin, Hn as createSessionPlugin, sr as createWebSocketPlugin, ir as createWebVitalsPlugin, ye as resolveConfig };
|