@blueking/open-telemetry 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bk-rum.global.js +1 -1
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/index.js +132 -138
- package/dist/index.js.map +1 -1
- package/dist/plugins/device.d.ts +4 -4
- package/dist/plugins/resource.d.ts +5 -3
- package/dist/schema/attributes.d.ts +5 -5
- package/dist/schema/span.d.ts +1 -2
- package/package.json +1 -1
- package/skills/bk-rum-otele/references/network.md +4 -1
- package/skills/bk-rum-otele/references/session-context.md +6 -9
- package/skills/bk-rum-otele/references/telemetry-reference.md +57 -60
- package/skills/bk-rum-otele/references/views-routing.md +2 -4
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { resourceFromAttributes as c } from "@opentelemetry/resources";
|
|
|
6
6
|
import { BatchSpanProcessor as l, SamplingDecision as u, SimpleSpanProcessor as d } from "@opentelemetry/sdk-trace-base";
|
|
7
7
|
import { WebTracerProvider as f } from "@opentelemetry/sdk-trace-web";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var p = "0.0.
|
|
9
|
+
var p = "0.0.26", m = (e) => {
|
|
10
10
|
let t = 5381;
|
|
11
11
|
for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n);
|
|
12
12
|
return (t >>> 0).toString(36);
|
|
@@ -19,10 +19,7 @@ var p = "0.0.24", m = (e) => {
|
|
|
19
19
|
actionTargetTag: "action.target.tag",
|
|
20
20
|
actionType: "action.type",
|
|
21
21
|
deploymentEnvironmentName: "deployment.environment.name",
|
|
22
|
-
browserName: "browser.name",
|
|
23
|
-
browserVersion: "browser.version",
|
|
24
22
|
cacheHit: "resource.cache.hit",
|
|
25
|
-
deviceLogicalProcessorCount: "device.logical_processor_count",
|
|
26
23
|
deviceMemoryGib: "device.memory_gib",
|
|
27
24
|
deviceType: "device.type",
|
|
28
25
|
longTaskBlockingDuration: "long_task.blocking_duration",
|
|
@@ -31,12 +28,12 @@ var p = "0.0.24", m = (e) => {
|
|
|
31
28
|
longTaskId: "long_task.id",
|
|
32
29
|
longTaskStartTime: "long_task.start_time",
|
|
33
30
|
networkEffectiveType: "network.effective_type",
|
|
31
|
+
networkStatus: "network.status",
|
|
34
32
|
nextHopProtocol: "resource.protocol",
|
|
35
33
|
outcomeReason: "outcome.reason",
|
|
36
34
|
outcomeType: "outcome.type",
|
|
37
35
|
serviceName: "service.name",
|
|
38
36
|
serviceVersion: "service.version",
|
|
39
|
-
osName: "os.name",
|
|
40
37
|
sessionHasReplay: "session.has_replay",
|
|
41
38
|
sessionId: "session.id",
|
|
42
39
|
sessionSampleRate: "session.sample_rate",
|
|
@@ -45,6 +42,9 @@ var p = "0.0.24", m = (e) => {
|
|
|
45
42
|
sessionType: "session.type",
|
|
46
43
|
spanType: "span_type",
|
|
47
44
|
userId: "user.id",
|
|
45
|
+
userAgentName: "user_agent.name",
|
|
46
|
+
userAgentOsName: "user_agent.os.name",
|
|
47
|
+
userAgentVersion: "user_agent.version",
|
|
48
48
|
vitalMetric: "vital.metric",
|
|
49
49
|
vitalRating: "vital.rating",
|
|
50
50
|
vitalValue: "vital.value",
|
|
@@ -55,10 +55,10 @@ var p = "0.0.24", m = (e) => {
|
|
|
55
55
|
viewId: "view.id",
|
|
56
56
|
viewLoadEvent: "view.load_event",
|
|
57
57
|
viewLoadingTime: "view.loading_time",
|
|
58
|
+
viewLoadingTimeSource: "view.loading_time_source",
|
|
58
59
|
viewLoadingType: "view.loading_type",
|
|
59
60
|
viewName: "view.name",
|
|
60
61
|
viewPhase: "view.phase",
|
|
61
|
-
viewSource: "view.source",
|
|
62
62
|
viewStartedAt: "view.started_at",
|
|
63
63
|
viewUrl: "view.url",
|
|
64
64
|
viewUrlPathGroup: "view.url_path_group",
|
|
@@ -168,24 +168,22 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
168
168
|
"browser.screen.height": (t = window.screen) == null ? void 0 : t.height
|
|
169
169
|
};
|
|
170
170
|
}, ae = () => {
|
|
171
|
+
if (typeof navigator > "u") return {};
|
|
171
172
|
let e = T();
|
|
172
|
-
return
|
|
173
|
-
|
|
174
|
-
"network.
|
|
175
|
-
"network.
|
|
176
|
-
|
|
177
|
-
"network.save_data": e.saveData
|
|
178
|
-
} : {};
|
|
173
|
+
return {
|
|
174
|
+
[g.networkStatus]: navigator.onLine ? "connected" : "not_connected",
|
|
175
|
+
"network.effective_type": e == null ? void 0 : e.effectiveType,
|
|
176
|
+
"network.connection.type": e == null ? void 0 : e.type
|
|
177
|
+
};
|
|
179
178
|
}, oe = () => {
|
|
180
179
|
if (typeof navigator > "u") return {};
|
|
181
180
|
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";
|
|
182
181
|
return {
|
|
183
182
|
[g.deviceMemoryGib]: navigator.deviceMemory,
|
|
184
|
-
[g.deviceLogicalProcessorCount]: navigator.hardwareConcurrency,
|
|
185
|
-
[g.browserName]: n.name,
|
|
186
|
-
[g.browserVersion]: n.version,
|
|
187
183
|
[g.deviceType]: i,
|
|
188
|
-
[g.
|
|
184
|
+
[g.userAgentName]: n.name,
|
|
185
|
+
[g.userAgentVersion]: n.version,
|
|
186
|
+
[g.userAgentOsName]: r
|
|
189
187
|
};
|
|
190
188
|
}, se = (e, t) => {
|
|
191
189
|
let n;
|
|
@@ -206,16 +204,15 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
|
|
|
206
204
|
n.setRuntimeAttributes(ie());
|
|
207
205
|
}, w);
|
|
208
206
|
window.addEventListener("resize", o), window.addEventListener("orientationchange", o), t.push(() => window.removeEventListener("resize", o), () => window.removeEventListener("orientationchange", o));
|
|
209
|
-
let s =
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
207
|
+
let s = () => {
|
|
208
|
+
n.setRuntimeAttributes(ae());
|
|
209
|
+
};
|
|
210
|
+
window.addEventListener("online", s), window.addEventListener("offline", s), t.push(() => window.removeEventListener("online", s), () => window.removeEventListener("offline", s));
|
|
211
|
+
let c = T();
|
|
212
|
+
c && typeof c.addEventListener == "function" && (c.addEventListener("change", s), t.push(() => {
|
|
213
|
+
var e;
|
|
214
|
+
(e = c.removeEventListener) == null || e.call(c, "change", s);
|
|
215
|
+
}));
|
|
219
216
|
},
|
|
220
217
|
shutdown() {
|
|
221
218
|
for (; t.length;) {
|
|
@@ -552,13 +549,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
552
549
|
}, M = ({ outcome: e = A.success, outcomeReason: t, spanType: n }) => S({
|
|
553
550
|
[g.spanType]: n,
|
|
554
551
|
[g.outcomeType]: e
|
|
555
|
-
}, t ? { [g.outcomeReason]: t } : {}), Ke = ({ initiatorType: e = "other", method: t, outcome: n,
|
|
556
|
-
let
|
|
557
|
-
return S(S(S(S(S(
|
|
558
|
-
outcome:
|
|
559
|
-
outcomeReason:
|
|
552
|
+
}, t ? { [g.outcomeReason]: t } : {}), Ke = ({ initiatorType: e = "other", method: t, outcome: n, url: r }) => {
|
|
553
|
+
let i = Ge(r), a = (n == null ? void 0 : n.type) === "response" && typeof n.statusCode == "number" && n.statusCode > 0 ? n.statusCode : void 0, o = (n == null ? void 0 : n.type) === "abort" ? A.abort : (n == null ? void 0 : n.type) === "timeout" ? A.timeout : (n == null ? void 0 : n.type) === "network_error" ? A.error : typeof a == "number" ? He(a) : A.success, s = (n == null ? void 0 : n.type) === "timeout" ? "network_timeout" : (n == null ? void 0 : n.type) === "network_error" ? "network" : typeof a == "number" ? Ue(a) : void 0, c = t == null ? void 0 : t.toUpperCase();
|
|
554
|
+
return S(S(S(S(S({}, M({
|
|
555
|
+
outcome: o,
|
|
556
|
+
outcomeReason: s,
|
|
560
557
|
spanType: j.resource
|
|
561
|
-
})),
|
|
558
|
+
})), i.serverAddress ? { "server.address": i.serverAddress } : {}), i.serverPort === void 0 ? {} : { "server.port": i.serverPort }), {}, { "resource.type": e }, c ? { "http.request.method": c } : {}), typeof a == "number" ? { "http.response.status_code": a } : {});
|
|
562
559
|
}, qe = 100, Je = 100, Ye = 1e3, Xe = 100, Ze = 1e4, Qe = "data-bk-action-name", $e = 100, et = 10, N = (e) => e.replace(/\s+/g, " ").trim().slice(0, $e), P = (e) => {
|
|
563
560
|
var t;
|
|
564
561
|
if (e.parentElement) return e.parentElement;
|
|
@@ -1018,9 +1015,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1018
1015
|
n.timer = setTimeout(() => R(n), Ot);
|
|
1019
1016
|
}
|
|
1020
1017
|
};
|
|
1021
|
-
}, Nt = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, z = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), B = (e, t, n, r, i) => {
|
|
1018
|
+
}, Nt = (e) => e.deliveryType === "cache" || e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, Pt = (e) => e.transferSize === 0 && e.encodedBodySize === 0 && e.decodedBodySize === 0 && e.requestStart === 0 && e.responseStart === 0 && !e.nextHopProtocol, z = (...e) => e.every((t, n) => n === 0 || e[n - 1] <= t), B = (e, t, n, r, i) => {
|
|
1022
1019
|
z(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
|
|
1023
|
-
},
|
|
1020
|
+
}, Ft = (e) => {
|
|
1024
1021
|
let t = {}, n = [
|
|
1025
1022
|
e.startTime,
|
|
1026
1023
|
e.fetchStart,
|
|
@@ -1033,14 +1030,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1033
1030
|
e.responseEnd
|
|
1034
1031
|
];
|
|
1035
1032
|
return !n.every(Number.isFinite) || !z(...n) ? t : (B(t, "first_byte", e.startTime, e.requestStart, e.responseStart), B(t, "download", e.startTime, e.responseStart, e.responseEnd), e.workerStart > 0 && e.workerStart < e.fetchStart && B(t, "worker", e.startTime, e.workerStart, e.fetchStart), e.fetchStart < e.domainLookupEnd && B(t, "dns", e.startTime, e.domainLookupStart, e.domainLookupEnd), e.fetchStart < e.connectEnd && (B(t, "connect", e.startTime, e.connectStart, e.connectEnd), e.connectStart <= e.secureConnectionStart && e.secureConnectionStart <= e.connectEnd && B(t, "ssl", e.startTime, e.secureConnectionStart, e.connectEnd)), e.redirectEnd > e.startTime && z(e.startTime, e.redirectStart, e.redirectEnd, e.fetchStart) && B(t, "redirect", e.startTime, e.redirectStart, e.redirectEnd), t);
|
|
1036
|
-
},
|
|
1037
|
-
let t = typeof e.deliveryType == "string"
|
|
1038
|
-
return S(S(S(S({
|
|
1039
|
-
|
|
1040
|
-
[g.nextHopProtocol]: e.nextHopProtocol
|
|
1041
|
-
}, Pt(e)), t ? { "resource.delivery_type": t } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), {}, {
|
|
1033
|
+
}, V = (e) => e.duration === 0 && e.responseEnd > e.startTime ? e.responseEnd - e.startTime : e.duration, It = (e) => {
|
|
1034
|
+
let t = Pt(e), n = typeof e.deliveryType == "string" && e.deliveryType ? e.deliveryType : void 0;
|
|
1035
|
+
return S(S(S(S(S({ [g.cacheHit]: Nt(e) }, e.nextHopProtocol ? { [g.nextHopProtocol]: e.nextHopProtocol } : {}), Ft(e)), n ? { "resource.delivery_type": n } : {}), e.renderBlockingStatus ? { "resource.render_blocking_status": e.renderBlockingStatus } : {}), t ? {} : {
|
|
1036
|
+
"resource.size": e.decodedBodySize,
|
|
1042
1037
|
"resource.encoded_body_size": e.encodedBodySize,
|
|
1043
|
-
"resource.decoded_body_size": e.decodedBodySize
|
|
1038
|
+
"resource.decoded_body_size": e.decodedBodySize,
|
|
1039
|
+
"resource.transfer_size": e.transferSize
|
|
1044
1040
|
});
|
|
1045
1041
|
}, Lt = (t = !0) => {
|
|
1046
1042
|
let n;
|
|
@@ -1056,14 +1052,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1056
1052
|
return;
|
|
1057
1053
|
}
|
|
1058
1054
|
if (n.duration < 0) return;
|
|
1059
|
-
let i = r.config.hooks.redactUrl(n.name), a =
|
|
1055
|
+
let i = r.config.hooks.redactUrl(n.name), a = V(n), o = performance.timeOrigin + n.startTime, s = o + a;
|
|
1060
1056
|
t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()), Ke({
|
|
1061
1057
|
initiatorType: n.initiatorType || "other",
|
|
1062
1058
|
outcome: typeof n.responseStatus == "number" ? {
|
|
1063
1059
|
statusCode: n.responseStatus,
|
|
1064
1060
|
type: "response"
|
|
1065
1061
|
} : void 0,
|
|
1066
|
-
transferSize: n.transferSize,
|
|
1067
1062
|
url: i
|
|
1068
1063
|
})), {}, { "url.full": i }, It(n)), {
|
|
1069
1064
|
kind: e.CLIENT,
|
|
@@ -1193,7 +1188,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1193
1188
|
}, s = Zt(e, "fetch", o), c = Xt(e, a), l = Yt(e, a), u = Gt(t, i), d = je(e.config, a) ? Kt(t, i, s) : i, f = !1, p = (t, r = Date.now()) => {
|
|
1194
1189
|
if (!f) {
|
|
1195
1190
|
if (f = !0, n.delete(m), t) {
|
|
1196
|
-
s.setAttributes(e.applyRedact(It(t))), s.end(performance.timeOrigin + t.startTime +
|
|
1191
|
+
s.setAttributes(e.applyRedact(It(t))), s.end(performance.timeOrigin + t.startTime + V(t));
|
|
1197
1192
|
return;
|
|
1198
1193
|
}
|
|
1199
1194
|
s.end(r);
|
|
@@ -1261,7 +1256,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1261
1256
|
c.complete((t) => {
|
|
1262
1257
|
if (!d) {
|
|
1263
1258
|
if (d = !0, n.delete(p), t) {
|
|
1264
|
-
s.setAttributes(e.applyRedact(It(t))), s.end(performance.timeOrigin + t.startTime +
|
|
1259
|
+
s.setAttributes(e.applyRedact(It(t))), s.end(performance.timeOrigin + t.startTime + V(t));
|
|
1265
1260
|
return;
|
|
1266
1261
|
}
|
|
1267
1262
|
s.end(i);
|
|
@@ -1407,7 +1402,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1407
1402
|
}
|
|
1408
1403
|
}
|
|
1409
1404
|
};
|
|
1410
|
-
}, sn = 50, cn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t,
|
|
1405
|
+
}, sn = 50, cn = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, H = (e) => Number.isFinite(e) ? e : void 0, ln = (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 } : {}), un = (e, t) => ({
|
|
1411
1406
|
"long_task.script.duration": e.duration,
|
|
1412
1407
|
"long_task.script.execution_start": e.executionStart,
|
|
1413
1408
|
"long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
|
|
@@ -1431,12 +1426,12 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1431
1426
|
let c = (n) => {
|
|
1432
1427
|
var r, i;
|
|
1433
1428
|
if (!e.isSampled() || !Number.isFinite(n.duration) || n.duration < t) return;
|
|
1434
|
-
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()), M({ spanType: j.longTask })),
|
|
1429
|
+
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()), M({ spanType: j.longTask })), H(o == null ? void 0 : o.blockingDuration) === void 0 ? {} : { [g.longTaskBlockingDuration]: o.blockingDuration }), {}, {
|
|
1435
1430
|
[g.longTaskDuration]: n.duration,
|
|
1436
1431
|
[g.longTaskEntryType]: d,
|
|
1437
1432
|
[g.longTaskId]: c,
|
|
1438
1433
|
"long_task.name": n.name
|
|
1439
|
-
},
|
|
1434
|
+
}, H(o == null ? void 0 : o.firstUIEventTimestamp) === void 0 ? {} : { "long_task.first_ui_event_timestamp": o.firstUIEventTimestamp }), H(o == null ? void 0 : o.renderStart) === void 0 ? {} : { "long_task.render_start": o.renderStart }), H(o == null ? void 0 : o.styleAndLayoutStart) === void 0 ? {} : { "long_task.style_and_layout_start": o.styleAndLayoutStart }), o ? { [g.longTaskStartTime]: o.startTime } : {}), { startTime: l });
|
|
1440
1435
|
s.forEach((t) => {
|
|
1441
1436
|
p.addEvent("long_task.script", e.applyRedact(un(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
|
|
1442
1437
|
}), f.forEach((t, n) => {
|
|
@@ -1467,39 +1462,39 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1467
1462
|
n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
|
|
1468
1463
|
}
|
|
1469
1464
|
};
|
|
1470
|
-
},
|
|
1471
|
-
let n =
|
|
1472
|
-
|
|
1465
|
+
}, U = /* @__PURE__ */ new Set(), W = "", G, K, q = !1, J = () => typeof location > "u" ? "" : location.href, Y = (e, t) => {
|
|
1466
|
+
let n = J();
|
|
1467
|
+
W = n;
|
|
1473
1468
|
let r = {
|
|
1474
1469
|
fromUrl: t,
|
|
1475
1470
|
source: e,
|
|
1476
1471
|
toUrl: n
|
|
1477
1472
|
};
|
|
1478
|
-
for (let e of Array.from(
|
|
1473
|
+
for (let e of Array.from(U)) e(r);
|
|
1479
1474
|
}, fn = () => {
|
|
1480
|
-
|
|
1475
|
+
Y("popstate", W || J());
|
|
1481
1476
|
}, pn = () => {
|
|
1482
|
-
|
|
1477
|
+
Y("hashchange", W || J());
|
|
1483
1478
|
}, mn = () => {
|
|
1484
|
-
|
|
1485
|
-
let r =
|
|
1479
|
+
q || typeof window > "u" || typeof history > "u" || (q = !0, W = J(), G = history.pushState, K = history.replaceState, history.pushState = function(e, t, n) {
|
|
1480
|
+
let r = W || J(), i = G == null ? void 0 : G.apply(this, [
|
|
1486
1481
|
e,
|
|
1487
1482
|
t,
|
|
1488
1483
|
n
|
|
1489
1484
|
]);
|
|
1490
|
-
return
|
|
1485
|
+
return Y("pushState", r), i;
|
|
1491
1486
|
}, history.replaceState = function(e, t, n) {
|
|
1492
|
-
let r =
|
|
1487
|
+
let r = W || J(), i = K == null ? void 0 : K.apply(this, [
|
|
1493
1488
|
e,
|
|
1494
1489
|
t,
|
|
1495
1490
|
n
|
|
1496
1491
|
]);
|
|
1497
|
-
return
|
|
1492
|
+
return Y("replaceState", r), i;
|
|
1498
1493
|
}, window.addEventListener("popstate", fn), window.addEventListener("hashchange", pn));
|
|
1499
1494
|
}, hn = () => {
|
|
1500
|
-
!
|
|
1501
|
-
}, gn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (mn(),
|
|
1502
|
-
|
|
1495
|
+
!q || typeof window > "u" || typeof history > "u" || (G && (history.pushState = G), K && (history.replaceState = K), window.removeEventListener("popstate", fn), window.removeEventListener("hashchange", pn), G = void 0, K = void 0, q = !1, W = "");
|
|
1496
|
+
}, gn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (mn(), U.add(e), () => {
|
|
1497
|
+
U.delete(e), U.size === 0 && hn();
|
|
1503
1498
|
});
|
|
1504
1499
|
//#endregion
|
|
1505
1500
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
|
|
@@ -1564,7 +1559,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1564
1559
|
[g.viewVersion]: e.version
|
|
1565
1560
|
}, i ? { "view.end_reason": i } : {}), e.loadingTime === void 0 ? {} : {
|
|
1566
1561
|
[g.viewLoadingTime]: e.loadingTime,
|
|
1567
|
-
|
|
1562
|
+
[g.viewLoadingTimeSource]: e.loadingTimeSource
|
|
1568
1563
|
}), {
|
|
1569
1564
|
contextTime: r,
|
|
1570
1565
|
startTime: r
|
|
@@ -1583,7 +1578,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1583
1578
|
if (n !== e || !Number.isFinite(t) || t < 0) return;
|
|
1584
1579
|
let i = S(S({}, e.loadingType === "initial_load" ? Sn() : {}), {}, {
|
|
1585
1580
|
[g.viewLoadingTime]: t,
|
|
1586
|
-
|
|
1581
|
+
[g.viewLoadingTimeSource]: r
|
|
1587
1582
|
});
|
|
1588
1583
|
Object.assign(e.snapshotAttributes, i), e.loadingTime = t, e.loadingTimeSource = r, o(e, "update");
|
|
1589
1584
|
}, l = (e) => {
|
|
@@ -1645,8 +1640,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1645
1640
|
[g.viewUrl]: y,
|
|
1646
1641
|
[g.viewUrlPathGroup]: p,
|
|
1647
1642
|
[g.viewLoadingType]: i,
|
|
1648
|
-
"url.previous": b
|
|
1649
|
-
[g.viewSource]: r
|
|
1643
|
+
"url.previous": b
|
|
1650
1644
|
}, x ? { "document.referrer": t.config.hooks.redactUrl(document.referrer || "") } : {}),
|
|
1651
1645
|
startedAt: C,
|
|
1652
1646
|
url: y,
|
|
@@ -1717,7 +1711,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1717
1711
|
}
|
|
1718
1712
|
}
|
|
1719
1713
|
};
|
|
1720
|
-
}, Dn = 5e3,
|
|
1714
|
+
}, Dn = 5e3, On = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, kn = (e, t, n, r) => ({
|
|
1721
1715
|
expiresAt: Math.min(t + n, t + r),
|
|
1722
1716
|
id: e,
|
|
1723
1717
|
startedAt: t,
|
|
@@ -1725,19 +1719,19 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1725
1719
|
}), X = (e, t, n) => {
|
|
1726
1720
|
if (t >= e.startedAt + n) return "maxLifetime";
|
|
1727
1721
|
if (t >= e.expiresAt) return "inactivity";
|
|
1728
|
-
},
|
|
1722
|
+
}, An = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), jn = (e, t, n) => {
|
|
1729
1723
|
if (!e) return null;
|
|
1730
1724
|
try {
|
|
1731
1725
|
let r = JSON.parse(e);
|
|
1732
|
-
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 &&
|
|
1726
|
+
if (r.status === "active" && typeof r.id == "string" && r.id.length > 0 && On(r.startedAt) && r.startedAt <= t + Dn && On(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") && On(r.expiredAt) && r.expiredAt <= t + Dn) return r;
|
|
1733
1727
|
} catch (e) {}
|
|
1734
1728
|
return null;
|
|
1735
|
-
},
|
|
1729
|
+
}, Mn = 900 * 1e3, Z = 14400 * 1e3, Nn = 1e3, Pn = 6e4, Fn = [
|
|
1736
1730
|
"click",
|
|
1737
1731
|
"keydown",
|
|
1738
1732
|
"scroll",
|
|
1739
1733
|
"touchstart"
|
|
1740
|
-
],
|
|
1734
|
+
], In = /* @__PURE__ */ new Map(), Ln = (e) => {
|
|
1741
1735
|
let t = typeof window < "u", n = () => {
|
|
1742
1736
|
var n;
|
|
1743
1737
|
if (t) try {
|
|
@@ -1745,21 +1739,21 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1745
1739
|
} catch (e) {
|
|
1746
1740
|
t = !1;
|
|
1747
1741
|
}
|
|
1748
|
-
return (n =
|
|
1742
|
+
return (n = In.get(e)) == null ? null : n;
|
|
1749
1743
|
};
|
|
1750
1744
|
return n(), {
|
|
1751
1745
|
isLocalStorage: () => t,
|
|
1752
1746
|
read: n,
|
|
1753
1747
|
write: (n) => {
|
|
1754
1748
|
let r = JSON.stringify(n);
|
|
1755
|
-
if (
|
|
1749
|
+
if (In.set(e, r), t) try {
|
|
1756
1750
|
window.localStorage.setItem(e, r);
|
|
1757
1751
|
} catch (e) {
|
|
1758
1752
|
t = !1;
|
|
1759
1753
|
}
|
|
1760
1754
|
}
|
|
1761
1755
|
};
|
|
1762
|
-
},
|
|
1756
|
+
}, Rn = (e, t) => {
|
|
1763
1757
|
let n = "";
|
|
1764
1758
|
try {
|
|
1765
1759
|
n = new URL(e).host;
|
|
@@ -1767,7 +1761,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1767
1761
|
n = e;
|
|
1768
1762
|
}
|
|
1769
1763
|
return `bk_ot_session__${m(`${t}\0${n || "default"}`)}`;
|
|
1770
|
-
},
|
|
1764
|
+
}, zn = (e, t, n, r, i, a, o) => {
|
|
1771
1765
|
e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()), M({ spanType: j.session })), {}, {
|
|
1772
1766
|
[g.sessionPhase]: t,
|
|
1773
1767
|
[g.sessionHasReplay]: !1,
|
|
@@ -1779,7 +1773,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1779
1773
|
contextTime: i,
|
|
1780
1774
|
startTime: i
|
|
1781
1775
|
}).end(i);
|
|
1782
|
-
},
|
|
1776
|
+
}, Bn = (e = {}) => {
|
|
1783
1777
|
let t = [];
|
|
1784
1778
|
return {
|
|
1785
1779
|
name: "session",
|
|
@@ -1795,7 +1789,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1795
1789
|
}, e);
|
|
1796
1790
|
return;
|
|
1797
1791
|
}
|
|
1798
|
-
let i = (r = e.storageKey) == null ?
|
|
1792
|
+
let i = (r = e.storageKey) == null ? Rn(n.config.transport.endpoint, n.config.application.name) : r, a = Ln(i), o = typeof performance < "u" && Number.isFinite(performance.timeOrigin) ? performance.timeOrigin : Date.now(), s, c, l, u = (e = Date.now()) => jn(a.read(), e, Z), d = () => {
|
|
1799
1793
|
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
1800
1794
|
}, f = (e, t = Date.now()) => {
|
|
1801
1795
|
var r;
|
|
@@ -1805,7 +1799,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1805
1799
|
id: i,
|
|
1806
1800
|
reason: e,
|
|
1807
1801
|
type: "expired"
|
|
1808
|
-
}),
|
|
1802
|
+
}), zn(n, "end", i, (r = c) == null ? t : r, t, e), d(), s = void 0, c = void 0, n.setRuntimeAttributes({
|
|
1809
1803
|
[g.sessionHasReplay]: void 0,
|
|
1810
1804
|
[g.sessionId]: void 0,
|
|
1811
1805
|
[g.sessionStartTime]: void 0,
|
|
@@ -1858,17 +1852,17 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1858
1852
|
}, v = (e = !1) => {
|
|
1859
1853
|
let t = Date.now(), r = u(t);
|
|
1860
1854
|
if ((r == null ? void 0 : r.status) === "active" && !X(r, t, Z)) {
|
|
1861
|
-
let e =
|
|
1855
|
+
let e = An(r, t, Mn, Z);
|
|
1862
1856
|
a.write(e), _(e, s ? void 0 : { reason: "shared" });
|
|
1863
1857
|
return;
|
|
1864
1858
|
}
|
|
1865
|
-
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 ? X(r, t, Z) : e ? "init" : void 0, c =
|
|
1859
|
+
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 ? X(r, t, Z) : e ? "init" : void 0, c = kn(h("session"), t, Mn, Z);
|
|
1866
1860
|
a.write(c), _(c, {
|
|
1867
1861
|
previousId: i,
|
|
1868
1862
|
reason: o == null ? "init" : o
|
|
1869
1863
|
});
|
|
1870
1864
|
let l = o == null ? "init" : o;
|
|
1871
|
-
|
|
1865
|
+
zn(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
|
|
1872
1866
|
}, y = () => {
|
|
1873
1867
|
if (!s) return;
|
|
1874
1868
|
let e = Date.now(), t = u(e);
|
|
@@ -1876,31 +1870,31 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1876
1870
|
p();
|
|
1877
1871
|
return;
|
|
1878
1872
|
}
|
|
1879
|
-
let n =
|
|
1873
|
+
let n = An(t, e, Mn, Z);
|
|
1880
1874
|
a.write(n), _(n);
|
|
1881
1875
|
};
|
|
1882
1876
|
v(!0);
|
|
1883
1877
|
let b = 0, x = () => {
|
|
1884
1878
|
let e = Date.now();
|
|
1885
|
-
e - b <
|
|
1879
|
+
e - b < Nn || (b = e, v());
|
|
1886
1880
|
}, S = {
|
|
1887
1881
|
capture: !0,
|
|
1888
1882
|
passive: !0
|
|
1889
1883
|
};
|
|
1890
|
-
|
|
1891
|
-
|
|
1884
|
+
Fn.forEach((e) => window.addEventListener(e, x, S)), t.push(() => {
|
|
1885
|
+
Fn.forEach((e) => window.removeEventListener(e, x, S));
|
|
1892
1886
|
});
|
|
1893
1887
|
let C = () => {
|
|
1894
1888
|
document.visibilityState === "visible" && y();
|
|
1895
1889
|
};
|
|
1896
1890
|
document.addEventListener("visibilitychange", C);
|
|
1897
|
-
let w = window.setInterval(C,
|
|
1891
|
+
let w = window.setInterval(C, Pn);
|
|
1898
1892
|
t.push(() => {
|
|
1899
1893
|
document.removeEventListener("visibilitychange", C), window.clearInterval(w);
|
|
1900
1894
|
});
|
|
1901
1895
|
let T = (e) => {
|
|
1902
1896
|
if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
|
|
1903
|
-
let t = Date.now(), n =
|
|
1897
|
+
let t = Date.now(), n = jn(e.newValue, t, Z);
|
|
1904
1898
|
if ((n == null ? void 0 : n.status) === "active" && n.id === s && !X(n, t, Z)) {
|
|
1905
1899
|
m(n);
|
|
1906
1900
|
return;
|
|
@@ -1913,47 +1907,47 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1913
1907
|
for (var e; t.length;) (e = t.pop()) == null || e();
|
|
1914
1908
|
}
|
|
1915
1909
|
};
|
|
1916
|
-
},
|
|
1910
|
+
}, Vn = 10, Hn = 6e4, Un = 5e3, Wn = 1e3, Gn = (e, t) => !!t && e === t, Kn = (e, t) => {
|
|
1917
1911
|
let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
|
|
1918
1912
|
return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
|
|
1919
|
-
},
|
|
1913
|
+
}, qn = (e) => {
|
|
1920
1914
|
var t, n, r;
|
|
1921
1915
|
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;
|
|
1922
|
-
},
|
|
1916
|
+
}, Jn = () => {
|
|
1923
1917
|
if (typeof performance > "u") return;
|
|
1924
1918
|
let e = performance.interactionCount;
|
|
1925
1919
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
1926
|
-
},
|
|
1920
|
+
}, Yn = (e, t) => {
|
|
1927
1921
|
var n, r;
|
|
1928
1922
|
let i = (n = t.value) == null ? 0 : n;
|
|
1929
1923
|
if (!(t.hadRecentInput || !Number.isFinite(i))) {
|
|
1930
|
-
if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >=
|
|
1924
|
+
if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= Wn || t.startTime - e.clsWindowStart >= Un) {
|
|
1931
1925
|
var a;
|
|
1932
|
-
e.clsWindowStart = t.startTime, e.clsWindowValue = i, e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget =
|
|
1926
|
+
e.clsWindowStart = t.startTime, e.clsWindowValue = i, e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = qn((a = t.sources) == null || (a = a[0]) == null ? void 0 : a.node);
|
|
1933
1927
|
} else if (e.clsWindowValue += i, i > e.clsWindowLargestShiftValue) {
|
|
1934
1928
|
var o;
|
|
1935
|
-
e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget =
|
|
1929
|
+
e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = qn((o = t.sources) == null || (o = o[0]) == null ? void 0 : o.node);
|
|
1936
1930
|
}
|
|
1937
1931
|
e.clsWindowEnd = t.startTime, e.clsWindowValue > e.cls && (e.cls = Math.round(e.clsWindowValue * 1e4) / 1e4, e.largestShiftValue = e.clsWindowLargestShiftValue, e.largestShiftTarget = e.clsWindowLargestShiftTarget);
|
|
1938
1932
|
}
|
|
1939
|
-
},
|
|
1933
|
+
}, Xn = (e, t) => {
|
|
1940
1934
|
var n, r;
|
|
1941
1935
|
if (!t.interactionId || !Number.isFinite(t.duration)) return;
|
|
1942
1936
|
e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
|
|
1943
1937
|
let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
|
|
1944
|
-
duration: Math.min(t.duration,
|
|
1938
|
+
duration: Math.min(t.duration, Hn),
|
|
1945
1939
|
inputDelay: Math.max(0, i - t.startTime),
|
|
1946
1940
|
interactionId: t.interactionId,
|
|
1947
|
-
interactionTarget:
|
|
1941
|
+
interactionTarget: qn(t.target),
|
|
1948
1942
|
interactionType: t.name,
|
|
1949
1943
|
presentationDelay: Math.max(0, t.startTime + t.duration - a),
|
|
1950
1944
|
processingDuration: Math.max(0, a - i)
|
|
1951
1945
|
}, s = e.inpCandidates.findIndex((e) => e.interactionId === t.interactionId);
|
|
1952
|
-
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(
|
|
1953
|
-
},
|
|
1954
|
-
let t =
|
|
1946
|
+
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(Vn);
|
|
1947
|
+
}, Zn = (e) => {
|
|
1948
|
+
let t = Jn(), n = t !== void 0 && e.interactionCountAtStart !== void 0 ? Math.max(0, t - e.interactionCountAtStart) : e.interactionIdMin === Infinity ? 0 : (e.interactionIdMax - e.interactionIdMin) / 7 + 1;
|
|
1955
1949
|
if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
|
|
1956
|
-
},
|
|
1950
|
+
}, Qn = (e, t) => {
|
|
1957
1951
|
var n;
|
|
1958
1952
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
1959
1953
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
@@ -1977,7 +1971,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
1977
1971
|
default: break;
|
|
1978
1972
|
}
|
|
1979
1973
|
return i;
|
|
1980
|
-
},
|
|
1974
|
+
}, $n = () => {
|
|
1981
1975
|
let e, t = !1;
|
|
1982
1976
|
return {
|
|
1983
1977
|
name: "web-vitals",
|
|
@@ -2006,7 +2000,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2006
2000
|
[g.vitalValue]: e.value,
|
|
2007
2001
|
[g.vitalRating]: e.rating,
|
|
2008
2002
|
"vital.id": e.id
|
|
2009
|
-
},
|
|
2003
|
+
}, Qn(e, n.config.hooks.redactUrl)), {
|
|
2010
2004
|
contextTime: r,
|
|
2011
2005
|
startTime: i
|
|
2012
2006
|
}).end(i);
|
|
@@ -2027,10 +2021,10 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2027
2021
|
entries: [],
|
|
2028
2022
|
id: h("vital"),
|
|
2029
2023
|
name: "CLS",
|
|
2030
|
-
rating:
|
|
2024
|
+
rating: Kn("CLS", e.cls),
|
|
2031
2025
|
value: e.cls
|
|
2032
2026
|
}, e.runtimeAttributes, e.startedAt);
|
|
2033
|
-
let t =
|
|
2027
|
+
let t = Zn(e);
|
|
2034
2028
|
t && p({
|
|
2035
2029
|
attribution: {
|
|
2036
2030
|
inputDelay: t.inputDelay,
|
|
@@ -2042,13 +2036,13 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2042
2036
|
entries: [],
|
|
2043
2037
|
id: h("vital"),
|
|
2044
2038
|
name: "INP",
|
|
2045
|
-
rating:
|
|
2039
|
+
rating: Kn("INP", t.duration),
|
|
2046
2040
|
value: t.duration
|
|
2047
2041
|
}, e.runtimeAttributes, e.startedAt);
|
|
2048
2042
|
}, _ = n.onViewChange((e) => {
|
|
2049
2043
|
var t;
|
|
2050
2044
|
let r = u;
|
|
2051
|
-
if (r &&
|
|
2045
|
+
if (r && Gn(r.id, e.id)) {
|
|
2052
2046
|
r.runtimeAttributes = S(S({}, r.runtimeAttributes), {}, {
|
|
2053
2047
|
[g.viewId]: e.id,
|
|
2054
2048
|
[g.viewName]: e.name,
|
|
@@ -2061,7 +2055,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2061
2055
|
cls: 0,
|
|
2062
2056
|
clsWindowLargestShiftValue: 0,
|
|
2063
2057
|
clsWindowValue: 0,
|
|
2064
|
-
interactionCountAtStart:
|
|
2058
|
+
interactionCountAtStart: Jn(),
|
|
2065
2059
|
interactionIdMax: 0,
|
|
2066
2060
|
interactionIdMin: Infinity,
|
|
2067
2061
|
inpCandidates: [],
|
|
@@ -2074,12 +2068,12 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2074
2068
|
if (typeof PerformanceObserver < "u") {
|
|
2075
2069
|
var v, y;
|
|
2076
2070
|
(v = PerformanceObserver.supportedEntryTypes) != null && v.includes("layout-shift") && (f = new PerformanceObserver((e) => {
|
|
2077
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt ||
|
|
2071
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || Yn(u, t);
|
|
2078
2072
|
}), f.observe({
|
|
2079
2073
|
buffered: !0,
|
|
2080
2074
|
type: "layout-shift"
|
|
2081
2075
|
})), (y = PerformanceObserver.supportedEntryTypes) != null && y.includes("event") && (d = new PerformanceObserver((e) => {
|
|
2082
|
-
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) ||
|
|
2076
|
+
if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) || Xn(u, t);
|
|
2083
2077
|
}), d.observe({
|
|
2084
2078
|
buffered: !0,
|
|
2085
2079
|
durationThreshold: 40,
|
|
@@ -2095,7 +2089,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2095
2089
|
t = !0, e == null || e(), e = void 0;
|
|
2096
2090
|
}
|
|
2097
2091
|
};
|
|
2098
|
-
},
|
|
2092
|
+
}, er = (e, t) => {
|
|
2099
2093
|
let n = {
|
|
2100
2094
|
"network.protocol.name": "websocket",
|
|
2101
2095
|
"url.full": t(e)
|
|
@@ -2105,8 +2099,8 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2105
2099
|
n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
|
|
2106
2100
|
} catch (e) {}
|
|
2107
2101
|
return n;
|
|
2108
|
-
},
|
|
2109
|
-
let a = h("websocket"), o =
|
|
2102
|
+
}, tr = (t, n, r, i) => {
|
|
2103
|
+
let a = h("websocket"), o = er(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
|
|
2110
2104
|
if (i() || !n.isSampled()) return;
|
|
2111
2105
|
let c = t === "error";
|
|
2112
2106
|
n.startSpan("browser.websocket", S(S(S({}, o), M({
|
|
@@ -2132,7 +2126,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2132
2126
|
"websocket.close.was_clean": e.wasClean
|
|
2133
2127
|
});
|
|
2134
2128
|
});
|
|
2135
|
-
},
|
|
2129
|
+
}, nr = () => {
|
|
2136
2130
|
let e, t, n = !1;
|
|
2137
2131
|
return {
|
|
2138
2132
|
name: "websocket",
|
|
@@ -2143,29 +2137,29 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2143
2137
|
let a = Reflect.construct(e, t, i);
|
|
2144
2138
|
if (n || !r.isSampled()) return a;
|
|
2145
2139
|
let o = t[0] == null ? "" : String(t[0]);
|
|
2146
|
-
return o && !O(r.config, o) &&
|
|
2140
|
+
return o && !O(r.config, o) && tr(a, r, o, () => n), a;
|
|
2147
2141
|
} }), window.WebSocket = t;
|
|
2148
2142
|
},
|
|
2149
2143
|
shutdown() {
|
|
2150
2144
|
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
2151
2145
|
}
|
|
2152
2146
|
};
|
|
2153
|
-
},
|
|
2147
|
+
}, rr = class {
|
|
2154
2148
|
constructor() {
|
|
2155
2149
|
b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
|
|
2156
2150
|
this.listeners.forEach((t) => t(e));
|
|
2157
2151
|
}), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
|
|
2158
2152
|
}
|
|
2159
|
-
},
|
|
2153
|
+
}, ir = (e) => {
|
|
2160
2154
|
let t = 2166136261;
|
|
2161
2155
|
for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
2162
2156
|
return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
|
|
2163
|
-
},
|
|
2157
|
+
}, ar = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : ir(`${e.name}\0${n}`) < t.sampleRate, or = (e) => ({
|
|
2164
2158
|
url: e.endpoint,
|
|
2165
2159
|
headers: e.headers,
|
|
2166
2160
|
concurrencyLimit: e.concurrencyLimit,
|
|
2167
2161
|
timeoutMillis: e.timeoutMillis
|
|
2168
|
-
}),
|
|
2162
|
+
}), sr = "bk-rum", cr = class {
|
|
2169
2163
|
constructor(e) {
|
|
2170
2164
|
this.isSampled = e;
|
|
2171
2165
|
}
|
|
@@ -2175,7 +2169,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2175
2169
|
toString() {
|
|
2176
2170
|
return "RumSessionSampler";
|
|
2177
2171
|
}
|
|
2178
|
-
}, Q,
|
|
2172
|
+
}, Q, lr = () => {
|
|
2179
2173
|
if (Q) Q.users += 1;
|
|
2180
2174
|
else {
|
|
2181
2175
|
let e = new a().enable(), t = n.setGlobalContextManager(e);
|
|
@@ -2190,28 +2184,28 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2190
2184
|
return () => {
|
|
2191
2185
|
e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && n.disable(), Q.ownsPropagator && r.disable(), Q = void 0));
|
|
2192
2186
|
};
|
|
2193
|
-
},
|
|
2187
|
+
}, ur = (e, t) => t ? new Proxy(e, { get(e, t, n) {
|
|
2194
2188
|
if (t === "export") return (t, n) => {
|
|
2195
2189
|
var r;
|
|
2196
2190
|
return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
|
|
2197
2191
|
};
|
|
2198
2192
|
let r = Reflect.get(e, t, n);
|
|
2199
2193
|
return typeof r == "function" ? r.bind(e) : r;
|
|
2200
|
-
} }) : e,
|
|
2201
|
-
|
|
2194
|
+
} }) : e, dr = (e) => [$t(e.tracking.request)], fr = (e) => [
|
|
2195
|
+
Bn(e.session),
|
|
2202
2196
|
...$(e.tracking.device, !0, ce),
|
|
2203
2197
|
dt(),
|
|
2204
2198
|
En(),
|
|
2205
|
-
Lt(
|
|
2206
|
-
],
|
|
2199
|
+
Lt(pr(e.tracking.resource, !0))
|
|
2200
|
+
], pr = (e, t) => e === void 0 ? t : e !== !1, mr = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => pr(e, t) ? [n(mr(e))] : [], hr = (e) => [
|
|
2207
2201
|
...$(e.error, !0, on),
|
|
2208
|
-
...$(e.webVitals, !0,
|
|
2202
|
+
...$(e.webVitals, !0, $n),
|
|
2209
2203
|
...$(e.blankScreen, !0, Et),
|
|
2210
2204
|
...$(e.action, !0, ct),
|
|
2211
|
-
...$(e.websocket, !1,
|
|
2205
|
+
...$(e.websocket, !1, nr),
|
|
2212
2206
|
...$(e.longTask, !1, dn),
|
|
2213
2207
|
...$(e.cspViolation, !1, nn)
|
|
2214
|
-
],
|
|
2208
|
+
], gr = class {
|
|
2215
2209
|
assertBeforeStart(e) {
|
|
2216
2210
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
2217
2211
|
}
|
|
@@ -2242,19 +2236,19 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2242
2236
|
createPluginManager() {
|
|
2243
2237
|
var e;
|
|
2244
2238
|
return new Ce([
|
|
2239
|
+
...fr(this.config),
|
|
2245
2240
|
...dr(this.config),
|
|
2246
|
-
...
|
|
2247
|
-
...mr(this.config.tracking),
|
|
2241
|
+
...hr(this.config.tracking),
|
|
2248
2242
|
...(e = this.config.extensions.plugins) == null ? [] : e
|
|
2249
2243
|
]);
|
|
2250
2244
|
}
|
|
2251
2245
|
constructor(n) {
|
|
2252
2246
|
var r = this;
|
|
2253
|
-
b(this, "activityObserver", new
|
|
2247
|
+
b(this, "activityObserver", new rr()), b(this, "flushProviders", E(function* () {
|
|
2254
2248
|
yield r.tracerProvider.forceFlush();
|
|
2255
2249
|
})), 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* () {
|
|
2256
2250
|
if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
|
|
2257
|
-
r.releaseOtelGlobals =
|
|
2251
|
+
r.releaseOtelGlobals = lr();
|
|
2258
2252
|
let e = r.createPluginManager();
|
|
2259
2253
|
r.pluginManager = e;
|
|
2260
2254
|
try {
|
|
@@ -2317,7 +2311,7 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2317
2311
|
let n = S({}, e), r = t == null ? Date.now() : t;
|
|
2318
2312
|
if (g.sessionId in e) {
|
|
2319
2313
|
let t = e[g.sessionId];
|
|
2320
|
-
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ?
|
|
2314
|
+
this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? ar(this.config, t) : !1, this.runtimeContext.setSessionSampled(this.sampled, r);
|
|
2321
2315
|
}
|
|
2322
2316
|
this.runtimeContext.setAttributes(n, r);
|
|
2323
2317
|
}), b(this, "setTrackingConsent", function() {
|
|
@@ -2396,18 +2390,18 @@ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof
|
|
|
2396
2390
|
return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
|
|
2397
2391
|
}), this.config = ye(n), this.runtimeContext = new Ve({}, this.config.user);
|
|
2398
2392
|
let i = c(this.config.resourceAttributes), a = (() => {
|
|
2399
|
-
let e =
|
|
2393
|
+
let e = ur(new s(or(this.config.transport)), this.config.debug);
|
|
2400
2394
|
return [new ze(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())))];
|
|
2401
2395
|
})();
|
|
2402
2396
|
this.tracerProvider = new f({
|
|
2403
2397
|
resource: i,
|
|
2404
|
-
sampler: new
|
|
2398
|
+
sampler: new cr(this.isSampled),
|
|
2405
2399
|
spanProcessors: a
|
|
2406
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
2400
|
+
}), this.tracer = this.tracerProvider.getTracer(sr), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
|
|
2407
2401
|
var t;
|
|
2408
2402
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
2409
2403
|
});
|
|
2410
2404
|
}
|
|
2411
2405
|
};
|
|
2412
2406
|
//#endregion
|
|
2413
|
-
export {
|
|
2407
|
+
export { gr as BkOpenTelemetry, lt as EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE, ze as FilteringSpanProcessor, g as RUM_ATTRIBUTES, A as RUM_SPAN_OUTCOME, j as RUM_SPAN_TYPE, Ve as RumRuntimeContext, M as buildRumSpanAttributes, ct as createActionPlugin, Et as createBlankScreenPlugin, $t as createCommonInstrumentationsPlugin, nn as createCspViolationPlugin, ce as createDevicePlugin, on as createErrorPlugin, dn as createLongTaskPlugin, Se as createPlugin, Lt as createResourcePlugin, Bn as createSessionPlugin, nr as createWebSocketPlugin, $n as createWebVitalsPlugin, ye as resolveConfig };
|