@blueking/open-telemetry 0.0.23 → 0.0.25

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/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.23", m = (e) => {
9
+ var p = "0.0.25", 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.23", 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,13 +28,12 @@ var p = "0.0.23", 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
- rumSchemaVersion: "rum.schema.version",
38
35
  serviceName: "service.name",
39
36
  serviceVersion: "service.version",
40
- osName: "os.name",
41
37
  sessionHasReplay: "session.has_replay",
42
38
  sessionId: "session.id",
43
39
  sessionSampleRate: "session.sample_rate",
@@ -46,6 +42,9 @@ var p = "0.0.23", m = (e) => {
46
42
  sessionType: "session.type",
47
43
  spanType: "span_type",
48
44
  userId: "user.id",
45
+ userAgentName: "user_agent.name",
46
+ userAgentOsName: "user_agent.os.name",
47
+ userAgentVersion: "user_agent.version",
49
48
  vitalMetric: "vital.metric",
50
49
  vitalRating: "vital.rating",
51
50
  vitalValue: "vital.value",
@@ -169,24 +168,22 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
169
168
  "browser.screen.height": (t = window.screen) == null ? void 0 : t.height
170
169
  };
171
170
  }, ae = () => {
171
+ if (typeof navigator > "u") return {};
172
172
  let e = T();
173
- return e ? {
174
- "network.effective_type": e.effectiveType,
175
- "network.connection_type": e.type,
176
- "network.downlink": e.downlink,
177
- "network.rtt": e.rtt,
178
- "network.save_data": e.saveData
179
- } : {};
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
+ };
180
178
  }, oe = () => {
181
179
  if (typeof navigator > "u") return {};
182
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";
183
181
  return {
184
182
  [g.deviceMemoryGib]: navigator.deviceMemory,
185
- [g.deviceLogicalProcessorCount]: navigator.hardwareConcurrency,
186
- [g.browserName]: n.name,
187
- [g.browserVersion]: n.version,
188
183
  [g.deviceType]: i,
189
- [g.osName]: r
184
+ [g.userAgentName]: n.name,
185
+ [g.userAgentVersion]: n.version,
186
+ [g.userAgentOsName]: r
190
187
  };
191
188
  }, se = (e, t) => {
192
189
  let n;
@@ -207,16 +204,15 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
207
204
  n.setRuntimeAttributes(ie());
208
205
  }, w);
209
206
  window.addEventListener("resize", o), window.addEventListener("orientationchange", o), t.push(() => window.removeEventListener("resize", o), () => window.removeEventListener("orientationchange", o));
210
- let s = T();
211
- if (s && typeof s.addEventListener == "function") {
212
- let e = () => {
213
- n.setRuntimeAttributes(ae());
214
- };
215
- s.addEventListener("change", e), t.push(() => {
216
- var t;
217
- (t = s.removeEventListener) == null || t.call(s, "change", e);
218
- });
219
- }
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
+ }));
220
216
  },
221
217
  shutdown() {
222
218
  for (; t.length;) {
@@ -255,10 +251,7 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
255
251
  name: e.name,
256
252
  version: e.version
257
253
  };
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 } : {}), {}, {
254
+ }, ge = (e, t, n) => S(S(S({ [g.deploymentEnvironmentName]: e.environment }, t === !1 ? {} : oe()), {}, { [g.serviceName]: e.name }, e.version ? { [g.serviceVersion]: e.version } : {}), {}, {
262
255
  [g.sessionSampleRate]: n,
263
256
  "telemetry.sdk.language": "webjs",
264
257
  "telemetry.sdk.name": "@blueking/open-telemetry",
@@ -271,10 +264,7 @@ var C = "BK_RUM_DEVICE_ID", w = 250, T = () => navigator.connection, ee = () =>
271
264
  var t, n, r, i, a, o, s, c, l, u, d;
272
265
  return {
273
266
  beforeSend: (t = e.tracking) == null ? void 0 : t.beforeSend,
274
- getPageAttributes: (n = (r = e.context) == null || (r = r.attributes) == null ? void 0 : r.page) == null ? (() => ({
275
- "rum.page.host": typeof window > "u" ? "" : window.location.host,
276
- "rum.page.path": typeof window > "u" ? "" : window.location.pathname
277
- })) : n,
267
+ getPageAttributes: (n = (r = e.context) == null || (r = r.attributes) == null ? void 0 : r.page) == null ? (() => ({})) : n,
278
268
  getErrorAttributes: (i = (a = e.context) == null || (a = a.attributes) == null ? void 0 : a.error) == null ? (() => ({})) : i,
279
269
  getCustomAttributes: (o = (s = e.context) == null || (s = s.attributes) == null ? void 0 : s.custom) == null ? (() => ({})) : o,
280
270
  getViewPathGroup: (t) => {
@@ -379,38 +369,36 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
379
369
  }
380
370
  })();
381
371
  }
382
- }, D = "bk.rum.sampled", we = (e) => {
383
- let t = 2166136261;
384
- for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
385
- return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
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) => {
372
+ }, we = () => typeof window > "u" ? "http://localhost" : window.location.origin, D = (e) => {
387
373
  try {
388
- return new URL(e, Ee()).href;
374
+ return new URL(e, we()).href;
389
375
  } catch (t) {
390
376
  return e;
391
377
  }
392
- }, De = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, Oe = (e, t) => {
393
- let n = (e) => De(e.replace(/[?#].*$/, ""));
378
+ }, Te = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, Ee = (e, t) => {
379
+ let n = (e) => Te(e.replace(/[?#].*$/, ""));
394
380
  return n(e) === n(t);
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) => {
381
+ }, De = (e, t) => Ee(D(t), D(e.transport.endpoint)), O = (e, t) => De(e, t), Oe = (e, t) => typeof e == "function" ? e(t) : typeof e == "string" ? t.includes(e) : (e.lastIndex = 0, e.test(t)), k = (e, t) => (Array.isArray(e) ? e : e ? [e] : []).some((e) => Oe(e, t)), ke = (e) => typeof e.tracking.request == "object" ? e.tracking.request : void 0, Ae = (e, t) => {
396
382
  var n;
397
- return k(e, t) || A((n = je(e)) == null ? void 0 : n.excludedUrls, O(t));
398
- }, Ne = (e, t) => {
383
+ return O(e, t) || k((n = ke(e)) == null ? void 0 : n.excludedUrls, D(t));
384
+ }, je = (e, t) => {
399
385
  var n;
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) {
386
+ return k((n = ke(e)) == null ? void 0 : n.allowedTracingUrls, D(t));
387
+ }, Me = ["http.url", "url.full"], Ne = /* @__PURE__ */ new WeakSet(), Pe = (e) => {
388
+ Ne.add(e);
389
+ }, Fe = (e) => {
390
+ for (let n of Me) {
403
391
  var t;
404
392
  let r = (t = e.attributes) == null ? void 0 : t[n];
405
393
  if (typeof r == "string") return r;
406
394
  }
407
- }, Le = (e) => {
395
+ }, Ie = (e) => {
408
396
  let t = e == null ? void 0 : e[g.sessionId];
409
397
  return typeof t == "string" && t.length > 0;
410
- }, Re = (e) => {
398
+ }, Le = (e) => {
411
399
  let t = e == null ? void 0 : e[g.viewId];
412
400
  return typeof t == "string" && t.length > 0;
413
- }, ze = (e) => (e == null ? void 0 : e["bk.rum.sampled"]) === !0 && Le(e) && Re(e), Be = class {
401
+ }, Re = (e) => Ie(e) && Le(e), ze = class {
414
402
  constructor(e, t, n) {
415
403
  this.inner = e, this.config = t, this.getRuntimeAttributes = n;
416
404
  }
@@ -418,9 +406,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
418
406
  return this.inner.forceFlush();
419
407
  }
420
408
  onEnd(e) {
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)))) {
423
- delete e.attributes[D];
409
+ let t = Fe(e);
410
+ if (!(Ne.delete(e) || t && De(this.config, t) || !Re(e.attributes) && !(e.name === "browser.session" && Ie(e.attributes)))) {
424
411
  try {
425
412
  var n, r;
426
413
  if (((n = this.config.hooks) == null || (r = n.beforeSend) == null ? void 0 : r.call(n, {
@@ -444,7 +431,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
444
431
  shutdown() {
445
432
  return this.inner.shutdown();
446
433
  }
447
- }, Ve = new Set([...Object.values(g), D]), He = class {
434
+ }, Be = new Set(Object.values(g)), Ve = class {
448
435
  constructor(e = {}, t) {
449
436
  b(this, "actionHistory", []), b(this, "attributes", {}), b(this, "queuedViewCommands", []), b(this, "recordAssociation", (e, t, n, r) => {
450
437
  let i = e.at(-1);
@@ -460,7 +447,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
460
447
  });
461
448
  }
462
449
  e.length > 100 && e.splice(0, e.length - 100);
463
- }), b(this, "sessionHistory", []), b(this, "sessionLifecycleListeners", /* @__PURE__ */ new Set()), b(this, "setOptionalAttribute", (e, t) => {
450
+ }), b(this, "sessionHistory", []), b(this, "sampled", !1), b(this, "samplingHistory", []), b(this, "sessionLifecycleListeners", /* @__PURE__ */ new Set()), b(this, "setOptionalAttribute", (e, t) => {
464
451
  if (t === void 0) {
465
452
  delete this.attributes[e];
466
453
  return;
@@ -479,12 +466,11 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
479
466
  let i = [...n].reverse().find((t) => t.startedAt <= e && (t.endedAt === void 0 || e < t.endedAt));
480
467
  i && Object.assign(t, i.attributes);
481
468
  };
482
- return n(this.sessionHistory, [
483
- g.sessionId,
484
- g.sessionHasReplay,
485
- D
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) => {
469
+ return n(this.sessionHistory, [g.sessionId, g.sessionHasReplay]), n(this.viewHistory, this.viewScopedAttributeKeys), n(this.actionHistory, [g.actionId]), t;
470
+ }), b(this, "getUser", () => S({}, this.user)), b(this, "getView", () => S({}, this.view)), b(this, "isSessionActive", () => typeof this.attributes[g.sessionId] == "string"), b(this, "isSessionSampledAt", (e) => {
471
+ var t, n;
472
+ return Number.isFinite(e) ? (t = (n = [...this.samplingHistory].reverse().find((t) => t.startedAt <= e && (t.endedAt === void 0 || e < t.endedAt))) == null ? void 0 : n.sampled) == null ? !1 : t : this.sampled;
473
+ }), b(this, "isViewActive", () => typeof this.attributes[g.viewId] == "string"), b(this, "notifySessionLifecycle", (e) => {
488
474
  this.sessionLifecycleListeners.forEach((t) => t(e));
489
475
  }), 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) => {
490
476
  for (this.viewCommandListeners.add(e); this.queuedViewCommands.length;) e(this.queuedViewCommands.shift());
@@ -497,11 +483,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
497
483
  }
498
484
  this.attributes[t] = n;
499
485
  }
500
- if (g.sessionId in e && this.recordAssociation(this.sessionHistory, [
501
- g.sessionId,
502
- g.sessionHasReplay,
503
- D
504
- ], t, typeof this.attributes[g.sessionId] == "string"), g.actionId in e) {
486
+ if (g.sessionId in e && this.recordAssociation(this.sessionHistory, [g.sessionId, g.sessionHasReplay], t, typeof this.attributes[g.sessionId] == "string"), g.actionId in e) {
505
487
  let e = this.attributes[g.actionId];
506
488
  this.recordAssociation(this.actionHistory, [g.actionId], t, Array.isArray(e) ? e.length > 0 : typeof e == "string");
507
489
  }
@@ -513,11 +495,18 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
513
495
  }
514
496
  this.attributes[g.userId] = e.id;
515
497
  }
498
+ }), b(this, "setSessionSampled", (e, t = Date.now()) => {
499
+ if (e === this.sampled) return;
500
+ let n = this.samplingHistory.at(-1);
501
+ n && n.endedAt === void 0 && (n.endedAt = Math.max(n.startedAt, t)), this.sampled = e, e && this.samplingHistory.push({
502
+ sampled: e,
503
+ startedAt: t
504
+ }), this.samplingHistory.length > 100 && this.samplingHistory.splice(0, this.samplingHistory.length - 100);
516
505
  }), b(this, "setView", (e, t = ((t) => (t = e.startedAt) == null ? Date.now() : t)()) => {
517
506
  var n;
518
507
  this.viewAttributeKeys.forEach((e) => delete this.attributes[e]), this.viewAttributeKeys.clear();
519
508
  let r = {};
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));
509
+ for (let [t, i] of Object.entries((n = e.attributes) == null ? {} : n)) i === void 0 || Be.has(t) || (r[t] = i, this.attributes[t] = i, this.viewAttributeKeys.add(t), this.viewScopedAttributeKeys.add(t));
521
510
  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
511
  g.viewId,
523
512
  g.viewUrl,
@@ -527,13 +516,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
527
516
  ].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()));
528
517
  }), this.setAttributes(e), t && this.setUser(t);
529
518
  }
530
- }, j = {
519
+ }, A = {
531
520
  abort: "abort",
532
521
  error: "error",
533
522
  success: "success",
534
523
  timeout: "timeout",
535
524
  warning: "warning"
536
- }, M = {
525
+ }, j = {
537
526
  action: "action",
538
527
  custom: "custom",
539
528
  error: "error",
@@ -543,10 +532,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
543
532
  vital: "vital",
544
533
  view: "view",
545
534
  websocket: "websocket"
546
- }, Ue = (e) => e === 408 || e === 504 ? j.timeout : typeof e == "number" && e >= 400 ? j.error : j.success, We = (e) => {
535
+ }, He = (e) => e === 408 || e === 504 ? A.timeout : typeof e == "number" && e >= 400 ? A.error : A.success, Ue = (e) => {
547
536
  if (e === 408 || e === 504) return "network_timeout";
548
537
  if (!(typeof e != "number" || e < 400)) return e >= 500 ? "http_5xx" : "http_4xx";
549
- }, Ge = (e) => e === "good" ? j.success : j.warning, Ke = (e) => {
538
+ }, We = (e) => e === "good" ? A.success : A.warning, Ge = (e) => {
550
539
  if (!e) return {};
551
540
  try {
552
541
  let t = new URL(e, typeof location > "u" ? "http://localhost" : location.href);
@@ -557,36 +546,36 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
557
546
  } catch (e) {
558
547
  return {};
559
548
  }
560
- }, N = ({ outcome: e = j.success, outcomeReason: t, spanType: n }) => S({
549
+ }, M = ({ outcome: e = A.success, outcomeReason: t, spanType: n }) => S({
561
550
  [g.spanType]: n,
562
551
  [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,
568
- spanType: M.resource
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) => {
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,
557
+ spanType: j.resource
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 } : {});
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) => {
571
560
  var t;
572
561
  if (e.parentElement) return e.parentElement;
573
562
  let n = (t = e.getRootNode) == null ? void 0 : t.call(e);
574
563
  return typeof ShadowRoot < "u" && n instanceof ShadowRoot ? n.host : null;
575
- }, nt = (e, t) => {
564
+ }, tt = (e, t) => {
576
565
  let n = e;
577
566
  for (; n;) {
578
567
  let e = n.getAttribute(t);
579
- if (e) return P(e);
580
- n = F(n);
568
+ if (e) return N(e);
569
+ n = P(n);
581
570
  }
582
- }, rt = (e) => {
571
+ }, F = (e) => {
583
572
  var t;
584
- return e.isContentEditable ? "" : P((t = e.textContent) == null ? "" : t);
585
- }, it = (e) => {
573
+ return e.isContentEditable ? "" : N((t = e.textContent) == null ? "" : t);
574
+ }, nt = (e) => {
586
575
  var t, n;
587
576
  let r = e, i = (t = r.labels) == null ? void 0 : t[0];
588
577
  if (i) {
589
- let e = rt(i);
578
+ let e = F(i);
590
579
  if (e) return e;
591
580
  }
592
581
  let a = e.tagName.toLowerCase(), o = (n = e.getAttribute("type")) == null ? void 0 : n.toLowerCase();
@@ -596,11 +585,11 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
596
585
  "submit"
597
586
  ].includes(o == null ? "" : o)) {
598
587
  var s;
599
- let e = P((s = r.value) == null ? "" : s);
588
+ let e = N((s = r.value) == null ? "" : s);
600
589
  if (e) return e;
601
590
  }
602
591
  if (a === "button" || a === "label" || e.getAttribute("role") === "button") {
603
- let t = rt(e);
592
+ let t = F(e);
604
593
  if (t) return t;
605
594
  }
606
595
  for (let t of [
@@ -611,39 +600,39 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
611
600
  "placeholder"
612
601
  ]) {
613
602
  var c;
614
- let n = P((c = e.getAttribute(t)) == null ? "" : c);
603
+ let n = N((c = e.getAttribute(t)) == null ? "" : c);
615
604
  if (n) return n;
616
605
  }
617
- }, at = (e, t = $e, n = !1) => {
618
- let r = nt(e, t);
606
+ }, rt = (e, t = Qe, n = !1) => {
607
+ let r = tt(e, t);
619
608
  if (r) return r;
620
609
  if (!n) return e.tagName.toLowerCase();
621
610
  let i = e, a = 0;
622
- for (; i && a <= tt;) {
611
+ for (; i && a <= et;) {
623
612
  let e = i.tagName.toLowerCase();
624
613
  if (e === "body" || e === "html" || e === "head") break;
625
- let t = it(i);
614
+ let t = nt(i);
626
615
  if (t) return t;
627
616
  if (e === "form") break;
628
- i = F(i), a += 1;
617
+ i = P(i), a += 1;
629
618
  }
630
- for (i = e, a = 0; i && a <= tt;) {
619
+ for (i = e, a = 0; i && a <= et;) {
631
620
  let e = i.tagName.toLowerCase();
632
621
  if (e === "body" || e === "html" || e === "head") break;
633
- let t = rt(i);
622
+ let t = F(i);
634
623
  if (t) return t;
635
624
  if (e === "form") break;
636
- i = F(i), a += 1;
625
+ i = P(i), a += 1;
637
626
  }
638
627
  return e.tagName.toLowerCase();
639
- }, ot = (e) => {
628
+ }, it = (e) => {
640
629
  var t;
641
630
  let n = (t = e.composedPath) == null ? void 0 : t.call(e)[0];
642
631
  return n instanceof Element ? n : e.target instanceof Element ? e.target : void 0;
643
- }, st = (e) => {
632
+ }, at = (e) => {
644
633
  let t = e.timeStamp;
645
634
  return !Number.isFinite(t) || t <= 0 ? Date.now() : t > 0xe8d4a51000 ? t : typeof performance > "u" ? Date.now() : performance.timeOrigin + t;
646
- }, ct = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, lt = (e) => {
635
+ }, ot = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, st = (e) => {
647
636
  let t = e;
648
637
  if (t.tagName.toLowerCase() === "label" && t.hasAttribute("for")) {
649
638
  var n;
@@ -663,13 +652,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
663
652
  "submit"
664
653
  ].includes((r = (i = t.getAttribute("type")) == null ? void 0 : i.toLowerCase()) == null ? "text" : r);
665
654
  }
666
- t = F(t);
655
+ t = P(t);
667
656
  }
668
657
  return !1;
669
- }, ut = (e = {}) => {
670
- let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || $e, a = ct(e.maxDuration, Qe), o = [], s, c = () => {
658
+ }, ct = (e = {}) => {
659
+ let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = e.actionNameAttribute || Qe, a = ot(e.maxDuration, Ze), o = [], s, c = () => {
671
660
  s == null || s.setRuntimeAttributes({ [g.actionId]: n.size ? [...n.keys()] : void 0 });
672
- }, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !lt(e.target), u = (e) => {
661
+ }, l = (e) => !e.hadActivity && !e.userActivity.input && !e.userActivity.scroll && !e.userActivity.selection && !st(e.target), u = (e) => {
673
662
  if (!r.delete(e) || !s || !e.completed) return;
674
663
  clearTimeout(e.reportTimer), e.hadError && e.frustrations.add("error_click"), l(e) && e.frustrations.add("dead_click");
675
664
  let t = [
@@ -677,9 +666,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
677
666
  "dead_click",
678
667
  "error_click"
679
668
  ].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,
682
- spanType: M.action
669
+ s.startSpan("action.click", S(S(S(S(S({}, s.config.hooks.getPageAttributes()), M({
670
+ outcome: o ? A.warning : A.success,
671
+ spanType: j.action
683
672
  })), e.runtimeAttributes), {}, {
684
673
  [g.actionId]: e.id,
685
674
  [g.actionType]: "click",
@@ -693,13 +682,13 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
693
682
  endTime: t,
694
683
  hasLoadingTime: i
695
684
  }, r.add(e);
696
- let a = Math.max(0, e.startTime + Xe - Date.now());
685
+ let a = Math.max(0, e.startTime + Ye - Date.now());
697
686
  e.reportTimer = setTimeout(() => u(e), a);
698
687
  }, f = () => {
699
688
  [...r].forEach(u);
700
689
  }, p = (e) => {
701
690
  if (clearTimeout(e.quietTimer), !e.hadActivity || e.pendingRequests.size) return;
702
- let t = Math.max(0, e.lastActivityTime + Ye - Date.now());
691
+ let t = Math.max(0, e.lastActivityTime + Je - Date.now());
703
692
  e.quietTimer = setTimeout(() => d(e, e.lastActivityTime, !0), t);
704
693
  }, m = (e, t) => {
705
694
  e.hadActivity = !0, e.lastActivityTime = Math.max(e.lastActivityTime, t), p(e);
@@ -707,7 +696,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
707
696
  for (let i of n.values()) {
708
697
  if (e.type === "request_start") {
709
698
  var t;
710
- if (e.url && A(s == null || (t = s.config.view) == null ? void 0 : t.excludedActivityUrls, e.url) || !_(i, e.time)) continue;
699
+ if (e.url && k(s == null || (t = s.config.view) == null ? void 0 : t.excludedActivityUrls, e.url) || !_(i, e.time)) continue;
711
700
  i.pendingRequests.add(e.id), m(i, e.time);
712
701
  continue;
713
702
  }
@@ -718,7 +707,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
718
707
  }
719
708
  if (e.type === "long_task" || e.type === "resource") {
720
709
  var r;
721
- if (e.type === "resource" && e.url && A(s == null || (r = s.config.view) == null ? void 0 : r.excludedActivityUrls, e.url) || e.startTime > i.startTime + a || (e.type === "resource" ? e.startTime < i.startTime : e.endTime < i.startTime)) continue;
710
+ if (e.type === "resource" && e.url && k(s == null || (r = s.config.view) == null ? void 0 : r.excludedActivityUrls, e.url) || e.startTime > i.startTime + a || (e.type === "resource" ? e.startTime < i.startTime : e.endTime < i.startTime)) continue;
722
711
  m(i, e.endTime);
723
712
  continue;
724
713
  }
@@ -732,14 +721,14 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
732
721
  [...n.values()].forEach((t) => d(t, e, t.hadActivity));
733
722
  }, b = (e, t) => {
734
723
  let n = "clientX" in t && typeof t.clientX == "number" ? t.clientX : 0, r = "clientY" in t && typeof t.clientY == "number" ? t.clientY : 0;
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;
724
+ o = o.filter((t) => e.startTime - t.action.startTime <= Ye);
725
+ 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) <= Xe;
737
726
  (a || i && !s) && (o = []), o.push({
738
727
  action: e,
739
728
  target: e.target,
740
729
  x: n,
741
730
  y: r
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 = []);
731
+ }), o.length >= 3 && e.startTime - o[o.length - 3].action.startTime <= Ye && (o.slice(-3).map((e) => e.action).forEach((e) => e.frustrations.add("rage_click")), o = []);
743
732
  };
744
733
  return {
745
734
  name: "action",
@@ -751,9 +740,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
751
740
  passive: !0
752
741
  }, p = (t) => {
753
742
  if (!l.isSampled() || "button" in t && typeof t.button == "number" && t.button !== 0) return;
754
- let r = ot(t);
743
+ let r = it(t);
755
744
  if (!r) return;
756
- let o = st(t), s = h("action"), u = {
745
+ let o = at(t), s = h("action"), u = {
757
746
  frustrations: /* @__PURE__ */ new Set(),
758
747
  hadActivity: !1,
759
748
  hadError: !1,
@@ -764,7 +753,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
764
753
  runtimeAttributes: l.getRuntimeAttributes(),
765
754
  startTime: o,
766
755
  target: r,
767
- targetName: at(r, i, e.nameCollection === "text"),
756
+ targetName: rt(r, i, e.nameCollection === "text"),
768
757
  targetTag: r.tagName.toLowerCase(),
769
758
  userActivity: {
770
759
  input: !1,
@@ -773,7 +762,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
773
762
  },
774
763
  validationTimer: setTimeout(() => {
775
764
  u.hadActivity || d(u, u.startTime, !1);
776
- }, Je)
765
+ }, qe)
777
766
  };
778
767
  n.set(s, u), b(u, t), c();
779
768
  };
@@ -807,16 +796,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
807
796
  o = [], s = void 0;
808
797
  }
809
798
  };
810
- }, dt = "data-bk-excluded-activity-mutations", ft = (e) => {
799
+ }, lt = "data-bk-excluded-activity-mutations", ut = (e) => {
811
800
  let t = e.type === "characterData" ? e.target.parentElement : e.target;
812
801
  return t instanceof Element && !!t.closest("[data-bk-excluded-activity-mutations]");
813
- }, pt = () => {
802
+ }, dt = () => {
814
803
  let e, t = [];
815
804
  return {
816
805
  name: "activity",
817
806
  init(n) {
818
807
  if (typeof document < "u" && typeof MutationObserver < "u" && (e = new MutationObserver((e) => {
819
- e.length && !e.every(ft) && n.notifyActivity({
808
+ e.length && !e.every(ut) && n.notifyActivity({
820
809
  time: Date.now(),
821
810
  type: "dom_mutation"
822
811
  });
@@ -840,7 +829,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
840
829
  for (e == null || e.disconnect(), e = void 0; t.length;) (n = t.pop()) == null || n();
841
830
  }
842
831
  };
843
- }, mt = (e, t) => !!(t && A(e.config.view.excludedActivityUrls, t)), ht = (e, t, n) => {
832
+ }, ft = (e, t) => !!(t && k(e.config.view.excludedActivityUrls, t)), pt = (e, t, n) => {
844
833
  let r = /* @__PURE__ */ new Set(), i = !1, a = !1, o = t, s, c = (e) => {
845
834
  i || (i = !0, clearTimeout(f), clearTimeout(s), d(), n(e));
846
835
  }, l = () => {
@@ -853,7 +842,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
853
842
  }, d = e.onActivity((n) => {
854
843
  if (!(n.type === "error" || n.type === "long_task")) {
855
844
  if (n.type === "request_start") {
856
- if (n.time < t || mt(e, n.url)) return;
845
+ if (n.time < t || ft(e, n.url)) return;
857
846
  r.add(n.id), u(n.time);
858
847
  return;
859
848
  }
@@ -863,7 +852,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
863
852
  return;
864
853
  }
865
854
  if (n.type === "resource") {
866
- if (n.endTime < t || mt(e, n.url)) return;
855
+ if (n.endTime < t || ft(e, n.url)) return;
867
856
  u(n.endTime);
868
857
  return;
869
858
  }
@@ -875,7 +864,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
875
864
  return () => {
876
865
  i || (i = !0, clearTimeout(f), clearTimeout(s), d());
877
866
  };
878
- }, gt = 1e3, _t = 200, vt = "body", yt = .8, bt = [
867
+ }, mt = 1e3, ht = 200, gt = "body", _t = .8, vt = [
879
868
  "[data-loading=\"true\"]",
880
869
  "[aria-busy=\"true\"]",
881
870
  ".loading",
@@ -893,34 +882,34 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
893
882
  [.2, .8],
894
883
  [.5, .8],
895
884
  [.8, .8]
896
- ], xt = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, St = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : t, Ct = (e) => {
885
+ ], yt = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, bt = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : t, xt = (e) => {
897
886
  if (!e) return "";
898
887
  let t = e.tagName.toLowerCase();
899
888
  return e.id ? `${t}#${e.id}` : t;
900
- }, wt = (e, t) => t.some((t) => {
889
+ }, St = (e, t) => t.some((t) => {
901
890
  try {
902
891
  return e.matches(t) || !!e.closest(t);
903
892
  } catch (e) {
904
893
  return !1;
905
894
  }
906
- }), Tt = (e) => {
895
+ }), Ct = (e) => {
907
896
  if (typeof getComputedStyle != "function") return !0;
908
897
  let t = getComputedStyle(e);
909
898
  return t.display !== "none" && t.visibility !== "hidden" && Number(t.opacity || 1) > 0;
910
- }, Et = (e, t) => {
899
+ }, wt = (e, t) => {
911
900
  if (typeof document.elementsFromPoint == "function") return document.elementsFromPoint(e, t);
912
901
  let n = document.elementFromPoint(e, t);
913
902
  return n ? [n] : [];
914
- }, Dt = (e, t) => {
903
+ }, Tt = (e, t) => {
915
904
  var n;
916
905
  let r = document.querySelector(e), i = (n = r == null ? document.body : r) == null ? document.documentElement : n, a = !!r, o = 0, s = 0, c = "";
917
906
  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))) {
907
+ let r = wt(window.innerWidth * e, window.innerHeight * n);
908
+ if (e === .5 && n === .5 && (c = xt(r[0])), r.some((e) => St(e, t))) {
920
909
  s += 1;
921
910
  continue;
922
911
  }
923
- r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && Tt(e)) || (o += 1);
912
+ r.some((e) => e !== i && e !== document.body && e !== document.documentElement && i.contains(e) && Ct(e)) || (o += 1);
924
913
  }
925
914
  let l = I.length - s;
926
915
  return {
@@ -932,9 +921,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
932
921
  score: l ? o / l : 0,
933
922
  validCount: l
934
923
  };
935
- }, Ot = (e = {}) => {
924
+ }, Et = (e = {}) => {
936
925
  var t;
937
- let n = xt(e.checkDelay, gt), r = xt(e.confirmationDelay, _t), i = e.rootSelector || vt, a = St(e.threshold, yt), o = [...bt, ...(t = e.ignoreSelectors) == null ? [] : t], s, c, l, u, d = () => {}, f;
926
+ let n = yt(e.checkDelay, mt), r = yt(e.confirmationDelay, ht), i = e.rootSelector || gt, a = bt(e.threshold, _t), o = [...vt, ...(t = e.ignoreSelectors) == null ? [] : t], s, c, l, u, d = () => {}, f;
938
927
  return {
939
928
  name: "blank-screen",
940
929
  init(e) {
@@ -945,10 +934,10 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
945
934
  if (s !== t || c === t || !e.isSampled()) return;
946
935
  c = t;
947
936
  let r = Date.now();
948
- e.startSpan("browser.blank_screen", S(S({}, N({
949
- outcome: j.error,
937
+ e.startSpan("browser.blank_screen", S(S({}, M({
938
+ outcome: A.error,
950
939
  outcomeReason: "blank_screen",
951
- spanType: M.error
940
+ spanType: j.error
952
941
  })), {}, {
953
942
  "blank_screen.center_element": n.centerElement,
954
943
  "blank_screen.empty_ratio": n.score,
@@ -964,7 +953,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
964
953
  if (s !== t || c === t || document.visibilityState === "hidden") return;
965
954
  let n;
966
955
  try {
967
- n = Dt(i, o);
956
+ n = Tt(i, o);
968
957
  } catch (t) {
969
958
  var l;
970
959
  e.config.debug && ((l = globalThis.console) == null || l.warn("[bk-ot][blank-screen] detection failed:", t));
@@ -974,7 +963,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
974
963
  if (s !== t || document.visibilityState === "hidden") return;
975
964
  let n;
976
965
  try {
977
- n = Dt(i, o);
966
+ n = Tt(i, o);
978
967
  } catch (t) {
979
968
  var r;
980
969
  e.config.debug && ((r = globalThis.console) == null || r.warn("[bk-ot][blank-screen] confirmation failed:", t));
@@ -988,7 +977,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
988
977
  d = e.onViewChange((n) => {
989
978
  if (n.id !== s && (t(), l == null || l(), l = void 0, s = n.id, c = void 0, n.id)) {
990
979
  let t = n.id;
991
- l = ht(e, Date.now(), () => {
980
+ l = pt(e, Date.now(), () => {
992
981
  l = void 0, h(t);
993
982
  });
994
983
  }
@@ -1002,33 +991,33 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1002
991
  clearTimeout(u), u = void 0, d(), l == null || l(), l = void 0, f == null || f(), f = void 0, s = void 0, c = void 0;
1003
992
  }
1004
993
  };
1005
- }, kt = 100, At = 200, L = [], jt = (e) => e.replace(/#.*$/, ""), Mt = (e) => {
994
+ }, Dt = 100, Ot = 200, L = [], kt = (e) => e.replace(/#.*$/, ""), At = (e) => {
1006
995
  let t = L.indexOf(e);
1007
996
  t >= 0 && L.splice(t, 1), e.timer !== void 0 && clearTimeout(e.timer);
1008
997
  }, R = (e, t) => {
1009
998
  let n = e.callback;
1010
- Mt(e), e.callback = void 0, n == null || n(t);
1011
- }, Nt = (e) => {
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];
999
+ At(e), e.callback = void 0, n == null || n(t);
1000
+ }, jt = (e) => {
1001
+ let t = performance.timeOrigin + e.startTime, n = L.filter((n) => !n.entry && kt(n.url) === kt(e.name) && t >= n.startTime - 50).sort((e, n) => Math.abs(e.startTime - t) - Math.abs(n.startTime - t))[0];
1013
1002
  n && (n.entry = e, n.callback && R(n, e));
1014
- }, Pt = (e, t = Date.now()) => {
1003
+ }, Mt = (e, t = Date.now()) => {
1015
1004
  let n = {
1016
1005
  startTime: t,
1017
1006
  url: e
1018
1007
  };
1019
- return L.push(n), L.length > kt && R(L[0]), {
1008
+ return L.push(n), L.length > Dt && R(L[0]), {
1020
1009
  cancel: () => R(n),
1021
1010
  complete: (e) => {
1022
1011
  if (n.callback = e, n.entry) {
1023
1012
  R(n, n.entry);
1024
1013
  return;
1025
1014
  }
1026
- n.timer = setTimeout(() => R(n), At);
1015
+ n.timer = setTimeout(() => R(n), Ot);
1027
1016
  }
1028
1017
  };
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) => {
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) => {
1019
+ z(n, r, i) && (e[`resource.${t}.start`] = r - n, e[`resource.${t}.duration`] = i - r);
1020
+ }, Ft = (e) => {
1032
1021
  let t = {}, n = [
1033
1022
  e.startTime,
1034
1023
  e.fetchStart,
@@ -1040,17 +1029,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1040
1029
  e.responseStart,
1041
1030
  e.responseEnd
1042
1031
  ];
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) => {
1045
- let t = typeof e.deliveryType == "string" ? e.deliveryType || "other" : void 0;
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 } : {}), {}, {
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);
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,
1050
1037
  "resource.encoded_body_size": e.encodedBodySize,
1051
- "resource.decoded_body_size": e.decodedBodySize
1038
+ "resource.decoded_body_size": e.decodedBodySize,
1039
+ "resource.transfer_size": e.transferSize
1052
1040
  });
1053
- }, Bt = (t = !0) => {
1041
+ }, Lt = (t = !0) => {
1054
1042
  let n;
1055
1043
  return {
1056
1044
  name: "resource",
@@ -1058,22 +1046,21 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1058
1046
  var i;
1059
1047
  if (typeof PerformanceObserver > "u" || !((i = PerformanceObserver.supportedEntryTypes) != null && i.includes("resource"))) return;
1060
1048
  let a = (n) => {
1061
- if (!r.isSampled() || !n.name || k(r.config, n.name)) return;
1049
+ if (!r.isSampled() || !n.name || O(r.config, n.name)) return;
1062
1050
  if (n.initiatorType === "fetch" || n.initiatorType === "xmlhttprequest") {
1063
- Nt(n);
1051
+ jt(n);
1064
1052
  return;
1065
1053
  }
1066
1054
  if (n.duration < 0) return;
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({
1055
+ let i = r.config.hooks.redactUrl(n.name), a = V(n), o = performance.timeOrigin + n.startTime, s = o + a;
1056
+ t && r.isSampled() && r.startSpan("browser.resource", S(S(S({}, r.config.hooks.getPageAttributes()), Ke({
1069
1057
  initiatorType: n.initiatorType || "other",
1070
1058
  outcome: typeof n.responseStatus == "number" ? {
1071
1059
  statusCode: n.responseStatus,
1072
1060
  type: "response"
1073
1061
  } : void 0,
1074
- transferSize: n.transferSize,
1075
1062
  url: i
1076
- })), {}, { "url.full": i }, zt(n)), {
1063
+ })), {}, { "url.full": i }, It(n)), {
1077
1064
  kind: e.CLIENT,
1078
1065
  startTime: o
1079
1066
  }).end(s), r.notifyActivity({
@@ -1098,31 +1085,31 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1098
1085
  n == null || n.disconnect(), n = void 0;
1099
1086
  }
1100
1087
  };
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) => {
1088
+ }, Rt = (e) => typeof e.config.tracking.request == "object" ? e.config.tracking.request : void 0, zt = (e) => typeof e == "object" && e && "name" in e && typeof e.name == "string" ? e.name : "", Bt = (e, t) => {
1102
1089
  let n = e.signal;
1103
- return Ht(n == null ? void 0 : n.reason) === "TimeoutError" || Ht(t) === "TimeoutError" ? {
1090
+ return zt(n == null ? void 0 : n.reason) === "TimeoutError" || zt(t) === "TimeoutError" ? {
1104
1091
  error: t,
1105
1092
  type: "timeout"
1106
- } : n != null && n.aborted || Ht(t) === "AbortError" ? { type: "abort" } : {
1093
+ } : n != null && n.aborted || zt(t) === "AbortError" ? { type: "abort" } : {
1107
1094
  error: t,
1108
1095
  type: "network_error"
1109
1096
  };
1110
- }, Wt = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
1097
+ }, Vt = (e, t) => e === "abort" ? { type: "abort" } : e === "timeout" ? { type: "timeout" } : e === "error" || t.status === 0 ? { type: "network_error" } : {
1111
1098
  statusCode: t.status,
1112
1099
  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) => {
1100
+ }, Ht = (e) => e.type === "network_error" || e.type === "timeout" || e.type === "response" && typeof e.statusCode == "number" && e.statusCode >= 400, Ut = (e) => typeof e == "string" || e instanceof URL ? D(String(e)) : D(e.url), Wt = (e, t) => {
1114
1101
  var n;
1115
1102
  return ((n = t == null ? void 0 : t.method) == null ? typeof Request < "u" && e instanceof Request ? e.method : "GET" : n).toUpperCase();
1116
- }, Jt = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, Yt = (e, t, a) => {
1103
+ }, Gt = (e, t) => typeof Request < "u" && e instanceof Request ? e : t == null ? {} : t, Kt = (e, t, a) => {
1117
1104
  var o;
1118
1105
  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);
1119
1106
  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) => {
1107
+ }, qt = (e, t) => {
1121
1108
  let a = {};
1122
1109
  r.inject(i.setSpan(n.active(), t), a);
1123
1110
  for (let [t, n] of Object.entries(a)) e.setRequestHeader(t, n);
1124
- }, Zt = (e, t) => k(e.config, t) || A(e.config.view.excludedActivityUrls, t), Qt = (e, t) => {
1125
- if (Zt(e, t)) return () => {};
1111
+ }, Jt = (e, t) => O(e.config, t) || k(e.config.view.excludedActivityUrls, t), Yt = (e, t) => {
1112
+ if (Jt(e, t)) return () => {};
1126
1113
  let n = h("request");
1127
1114
  e.notifyActivity({
1128
1115
  id: n,
@@ -1138,15 +1125,15 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1138
1125
  type: "request_end"
1139
1126
  }));
1140
1127
  };
1141
- }, $t = (e, t) => e.isSampled() ? Pt(t) : {
1128
+ }, Xt = (e, t) => e.isSampled() ? Mt(t) : {
1142
1129
  cancel() {},
1143
1130
  complete(e) {
1144
1131
  e();
1145
1132
  }
1146
- }, en = (t, n, r) => {
1133
+ }, Zt = (t, n, r) => {
1147
1134
  var i, a;
1148
1135
  let o = (i = r.startedAt) == null ? Date.now() : i;
1149
- return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), qe({
1136
+ return t.startSpan("browser.resource", S(S(S({}, t.config.hooks.getPageAttributes()), Ke({
1150
1137
  initiatorType: n,
1151
1138
  method: r.method,
1152
1139
  url: (a = r.url) == null ? "" : a
@@ -1154,9 +1141,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1154
1141
  kind: e.CLIENT,
1155
1142
  startTime: o
1156
1143
  });
1157
- }, tn = (e, n, r, i, a, o = {}) => {
1144
+ }, Qt = (e, n, r, i, a, o = {}) => {
1158
1145
  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({
1146
+ attributes: S(S(S({}, e.config.hooks.getPageAttributes()), Ke({
1160
1147
  initiatorType: r,
1161
1148
  method: l,
1162
1149
  outcome: a,
@@ -1172,17 +1159,17 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1172
1159
  }, d = !0;
1173
1160
  try {
1174
1161
  var f, p;
1175
- d = (f = Vt(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
1162
+ d = (f = Rt(e)) == null || (p = f.beforeSend) == null ? void 0 : p.call(f, u, i);
1176
1163
  } catch (t) {
1177
1164
  var m;
1178
1165
  e.config.debug && ((m = globalThis.console) == null || m.warn("[bk-ot] request.beforeSend failed:", t));
1179
1166
  }
1180
1167
  if (n.setAttributes(e.applyRedact(u.attributes)), d === !1) {
1181
- n.setAttribute(Fe, !0);
1168
+ Pe(n);
1182
1169
  return;
1183
1170
  }
1184
- Gt(a) && n.setStatus({ code: t.ERROR });
1185
- }, nn = (e) => {
1171
+ Ht(a) && n.setStatus({ code: t.ERROR });
1172
+ }, $t = (e) => {
1186
1173
  let t = [], n = /* @__PURE__ */ new Set();
1187
1174
  return {
1188
1175
  name: "request",
@@ -1192,16 +1179,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1192
1179
  if (typeof window.fetch == "function") {
1193
1180
  let r = window.fetch, i = /* @__PURE__ */ function() {
1194
1181
  var t = E(function* (t, i) {
1195
- let a = Kt(t);
1196
- if (!e.isSampled() || Me(e.config, a)) return r.call(this, t, i);
1182
+ let a = Ut(t);
1183
+ if (!e.isSampled() || Ae(e.config, a)) return r.call(this, t, i);
1197
1184
  let o = {
1198
- method: qt(t, i),
1185
+ method: Wt(t, i),
1199
1186
  startedAt: Date.now(),
1200
1187
  url: a
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()) => {
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()) => {
1202
1189
  if (!f) {
1203
1190
  if (f = !0, n.delete(m), t) {
1204
- s.setAttributes(e.applyRedact(zt(t))), s.end(performance.timeOrigin + t.startTime + Rt(t));
1191
+ s.setAttributes(e.applyRedact(It(t))), s.end(performance.timeOrigin + t.startTime + V(t));
1205
1192
  return;
1206
1193
  }
1207
1194
  s.end(r);
@@ -1212,7 +1199,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1212
1199
  n.add(m);
1213
1200
  try {
1214
1201
  let n = yield r.call(this, t, d), i = S(S({}, n.status > 0 ? { statusCode: n.status } : {}), {}, { type: "response" });
1215
- tn(e, s, "fetch", {
1202
+ Qt(e, s, "fetch", {
1216
1203
  request: u,
1217
1204
  response: n,
1218
1205
  type: "fetch"
@@ -1220,8 +1207,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1220
1207
  let a = Date.now();
1221
1208
  return c.complete((e) => p(e, a)), n;
1222
1209
  } catch (t) {
1223
- let n = Ut(u, t);
1224
- tn(e, s, "fetch", {
1210
+ let n = Bt(u, t);
1211
+ Qt(e, s, "fetch", {
1225
1212
  error: t,
1226
1213
  request: u,
1227
1214
  type: "fetch"
@@ -1244,15 +1231,15 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1244
1231
  let r = /* @__PURE__ */ new WeakMap(), i = XMLHttpRequest.prototype.open, a = XMLHttpRequest.prototype.send, o = function(e, t, n = !0, a, o) {
1245
1232
  return r.set(this, {
1246
1233
  method: e.toUpperCase(),
1247
- url: O(String(t))
1234
+ url: D(String(t))
1248
1235
  }), i.call(this, e, String(t), n, a, o);
1249
1236
  }, s = function(t) {
1250
1237
  var i;
1251
1238
  let o = (i = r.get(this)) == null ? {} : i;
1252
- if (!e.isSampled() || !o.url || Me(e.config, o.url)) return a.call(this, t);
1239
+ if (!e.isSampled() || !o.url || Ae(e.config, o.url)) return a.call(this, t);
1253
1240
  o.startedAt = Date.now();
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);
1241
+ let s = Zt(e, "xhr", o), c = Xt(e, o.url), l = Yt(e, o.url);
1242
+ je(e.config, o.url) && qt(this, s);
1256
1243
  let u = !1, d = !1, f = () => {}, p = () => {
1257
1244
  f(), c.cancel(), !d && (d = !0, n.delete(p), l(), s.end());
1258
1245
  };
@@ -1260,8 +1247,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1260
1247
  let m = (t) => {
1261
1248
  if (u || d) return;
1262
1249
  u = !0, f();
1263
- let r = Wt(t, this);
1264
- tn(e, s, "xhr", {
1250
+ let r = Vt(t, this);
1251
+ Qt(e, s, "xhr", {
1265
1252
  type: "xhr",
1266
1253
  xhr: this
1267
1254
  }, r, o), l();
@@ -1269,7 +1256,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1269
1256
  c.complete((t) => {
1270
1257
  if (!d) {
1271
1258
  if (d = !0, n.delete(p), t) {
1272
- s.setAttributes(e.applyRedact(zt(t))), s.end(performance.timeOrigin + t.startTime + Rt(t));
1259
+ s.setAttributes(e.applyRedact(It(t))), s.end(performance.timeOrigin + t.startTime + V(t));
1273
1260
  return;
1274
1261
  }
1275
1262
  s.end(i);
@@ -1297,9 +1284,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1297
1284
  for (; t.length;) (e = t.pop()) == null || e();
1298
1285
  }
1299
1286
  };
1300
- }, rn = /^https?:|^\/\//i, an = (e, t) => {
1301
- if (t) return rn.test(t) ? e(t) : t;
1302
- }, on = () => {
1287
+ }, en = /^https?:|^\/\//i, tn = (e, t) => {
1288
+ if (t) return en.test(t) ? e(t) : t;
1289
+ }, nn = () => {
1303
1290
  let e;
1304
1291
  return {
1305
1292
  name: "csp-violation",
@@ -1307,11 +1294,11 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1307
1294
  if (typeof window > "u" || typeof document > "u") return;
1308
1295
  let n = (e) => {
1309
1296
  if (!t.isSampled()) return;
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,
1297
+ let n = Date.now(), r = tn(t.config.hooks.redactUrl, e.blockedURI), i = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0;
1298
+ t.startSpan("csp.violation", S(S(S({}, t.config.hooks.getPageAttributes()), M({
1299
+ outcome: A.error,
1313
1300
  outcomeReason: "csp",
1314
- spanType: M.error
1301
+ spanType: j.error
1315
1302
  })), {}, {
1316
1303
  "csp.blocked_uri": r,
1317
1304
  "csp.violated_directive": e.violatedDirective,
@@ -1331,7 +1318,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1331
1318
  e == null || e(), e = void 0;
1332
1319
  }
1333
1320
  };
1334
- }, sn = (e) => {
1321
+ }, rn = (e) => {
1335
1322
  if (e instanceof Error) return e.message;
1336
1323
  if (typeof e == "string") return e;
1337
1324
  try {
@@ -1339,9 +1326,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1339
1326
  } catch (t) {
1340
1327
  return String(e);
1341
1328
  }
1342
- }, cn = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o }) => {
1329
+ }, an = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o }) => {
1343
1330
  if (!e.isSampled()) return;
1344
- let s = Date.now(), c = sn(n);
1331
+ let s = Date.now(), c = rn(n);
1345
1332
  e.notifyActivity({
1346
1333
  time: s,
1347
1334
  type: "error"
@@ -1349,9 +1336,9 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1349
1336
  let l = n instanceof Error ? n : {
1350
1337
  message: c,
1351
1338
  name: r == null ? a : r
1352
- }, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), N({
1353
- outcome: j.error,
1354
- spanType: M.error
1339
+ }, u = S(S(S(S({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), M({
1340
+ outcome: A.error,
1341
+ spanType: j.error
1355
1342
  })), {}, {
1356
1343
  "error.message": c,
1357
1344
  "error.handled": !1,
@@ -1361,7 +1348,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1361
1348
  code: t.ERROR,
1362
1349
  message: c
1363
1350
  }), d.end();
1364
- }, ln = () => {
1351
+ }, on = () => {
1365
1352
  let e = [];
1366
1353
  return {
1367
1354
  name: "error",
@@ -1370,7 +1357,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1370
1357
  let n = (e) => {
1371
1358
  var n;
1372
1359
  let r = !e.error && !e.filename && e.message === "Script error.";
1373
- cn({
1360
+ an({
1374
1361
  context: t,
1375
1362
  spanName: "browser.error",
1376
1363
  source: "window.error",
@@ -1382,7 +1369,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1382
1369
  }, r ? { "error.cross_origin": !0 } : {})
1383
1370
  });
1384
1371
  }, r = (e) => {
1385
- cn({
1372
+ an({
1386
1373
  context: t,
1387
1374
  spanName: "browser.unhandledrejection",
1388
1375
  source: "unhandledrejection",
@@ -1394,7 +1381,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1394
1381
  let n = e.target;
1395
1382
  if (!(n instanceof Element)) return;
1396
1383
  let r = n, i = r.src || r.href || n.currentSrc || "";
1397
- cn({
1384
+ an({
1398
1385
  context: t,
1399
1386
  spanName: "browser.resource_error",
1400
1387
  source: "resource",
@@ -1415,7 +1402,7 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1415
1402
  }
1416
1403
  }
1417
1404
  };
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) => ({
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) => ({
1419
1406
  "long_task.script.duration": e.duration,
1420
1407
  "long_task.script.execution_start": e.executionStart,
1421
1408
  "long_task.script.forced_style_and_layout_duration": e.forcedStyleAndLayoutDuration,
@@ -1427,8 +1414,8 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1427
1414
  "long_task.script.source_url": e.sourceURL ? t(e.sourceURL) : "",
1428
1415
  "long_task.script.start_time": e.startTime,
1429
1416
  "long_task.script.window_attribution": e.windowAttribution
1430
- }), mn = (e = {}) => {
1431
- let t = dn(e.threshold, un), n, r, i = [];
1417
+ }), dn = (e = {}) => {
1418
+ let t = cn(e.threshold, sn), n, r, i = [];
1432
1419
  return {
1433
1420
  name: "long-task",
1434
1421
  init(e) {
@@ -1439,16 +1426,16 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1439
1426
  let c = (n) => {
1440
1427
  var r, i;
1441
1428
  if (!e.isSampled() || !Number.isFinite(n.duration) || n.duration < t) return;
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 }), {}, {
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 }), {}, {
1443
1430
  [g.longTaskDuration]: n.duration,
1444
1431
  [g.longTaskEntryType]: d,
1445
1432
  [g.longTaskId]: c,
1446
1433
  "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 });
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 });
1448
1435
  s.forEach((t) => {
1449
- p.addEvent("long_task.script", e.applyRedact(pn(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
1436
+ p.addEvent("long_task.script", e.applyRedact(un(t, e.config.hooks.redactUrl)), performance.timeOrigin + t.startTime);
1450
1437
  }), 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);
1438
+ p.addEvent("long_task.attribution", e.applyRedact(S({ "long_task.attribution.index": n }, ln(t, e.config.hooks.redactUrl))), l);
1452
1439
  }), p.end(u), e.notifyActivity({
1453
1440
  endTime: u,
1454
1441
  startTime: l,
@@ -1475,43 +1462,43 @@ var xe = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
1475
1462
  n == null || n.disconnect(), n = void 0, clearTimeout(r), r = void 0, i = [];
1476
1463
  }
1477
1464
  };
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;
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;
1481
1468
  let r = {
1482
1469
  fromUrl: t,
1483
1470
  source: e,
1484
1471
  toUrl: n
1485
1472
  };
1486
- for (let e of Array.from(V)) e(r);
1487
- }, hn = () => {
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, [
1473
+ for (let e of Array.from(U)) e(r);
1474
+ }, fn = () => {
1475
+ Y("popstate", W || J());
1476
+ }, pn = () => {
1477
+ Y("hashchange", W || J());
1478
+ }, mn = () => {
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, [
1494
1481
  e,
1495
1482
  t,
1496
1483
  n
1497
1484
  ]);
1498
- return q("pushState", r), i;
1485
+ return Y("pushState", r), i;
1499
1486
  }, history.replaceState = function(e, t, n) {
1500
- let r = H || K(), i = W == null ? void 0 : W.apply(this, [
1487
+ let r = W || J(), i = K == null ? void 0 : K.apply(this, [
1501
1488
  e,
1502
1489
  t,
1503
1490
  n
1504
1491
  ]);
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();
1492
+ return Y("replaceState", r), i;
1493
+ }, window.addEventListener("popstate", fn), window.addEventListener("hashchange", pn));
1494
+ }, hn = () => {
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();
1511
1498
  });
1512
1499
  //#endregion
1513
1500
  //#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutPropertiesLoose.js
1514
- function bn(e, t) {
1501
+ function _n(e, t) {
1515
1502
  if (e == null) return {};
1516
1503
  var n = {};
1517
1504
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -1522,9 +1509,9 @@ function bn(e, t) {
1522
1509
  }
1523
1510
  //#endregion
1524
1511
  //#region \0@oxc-project+runtime@0.128.0/helpers/objectWithoutProperties.js
1525
- function xn(e, t) {
1512
+ function vn(e, t) {
1526
1513
  if (e == null) return {};
1527
- var n, r, i = bn(e, t);
1514
+ var n, r, i = _n(e, t);
1528
1515
  if (Object.getOwnPropertySymbols) {
1529
1516
  var a = Object.getOwnPropertySymbols(e);
1530
1517
  for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
@@ -1533,7 +1520,7 @@ function xn(e, t) {
1533
1520
  }
1534
1521
  //#endregion
1535
1522
  //#region src/plugins/page-view.ts
1536
- var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () => typeof location > "u" ? "" : location.href, Tn = () => {
1523
+ var yn = ["stopLoadingTime"], bn = new Set(Object.values(g)), xn = () => typeof location > "u" ? "" : location.href, Sn = () => {
1537
1524
  if (typeof performance > "u") return {};
1538
1525
  let e = performance.getEntriesByType("navigation")[0];
1539
1526
  if (!e) return {};
@@ -1541,10 +1528,10 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1541
1528
  Number.isFinite(n) && n > 0 && (t[e] = n);
1542
1529
  };
1543
1530
  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) => {
1531
+ }, Cn = (e) => {
1545
1532
  let t = e.indexOf("?");
1546
1533
  return t < 0 ? e : e.slice(0, t);
1547
- }, Dn = (e) => {
1534
+ }, wn = (e) => {
1548
1535
  let t = e.slice(1);
1549
1536
  if (!t || typeof document > "u" || typeof document.getElementById != "function") return !1;
1550
1537
  try {
@@ -1552,14 +1539,14 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1552
1539
  } catch (e) {
1553
1540
  return !!document.getElementById(t);
1554
1541
  }
1555
- }, On = (e, t) => {
1542
+ }, Tn = (e, t) => {
1556
1543
  try {
1557
1544
  let n = typeof location > "u" ? "http://localhost" : location.href, r = new URL(e, n), i = new URL(t, n);
1558
- return r.pathname !== i.pathname || !Dn(i.hash) && En(r.hash) !== En(i.hash);
1545
+ return r.pathname !== i.pathname || !wn(i.hash) && Cn(r.hash) !== Cn(i.hash);
1559
1546
  } catch (n) {
1560
1547
  return e !== t;
1561
1548
  }
1562
- }, kn = () => {
1549
+ }, En = () => {
1563
1550
  let e = [];
1564
1551
  return {
1565
1552
  name: "page-view",
@@ -1586,10 +1573,10 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1586
1573
  let s = S({}, n);
1587
1574
  (i = n.stopLoadingTime) == null || i.call(n), o(n, "end", r, e), n = void 0, t && a(r);
1588
1575
  let { stopLoadingTime: c } = s;
1589
- return xn(s, Sn);
1576
+ return vn(s, yn);
1590
1577
  }, c = (e, t, r) => {
1591
1578
  if (n !== e || !Number.isFinite(t) || t < 0) return;
1592
- let i = S(S({}, e.loadingType === "initial_load" ? Tn() : {}), {}, {
1579
+ let i = S(S({}, e.loadingType === "initial_load" ? Sn() : {}), {}, {
1593
1580
  [g.viewLoadingTime]: t,
1594
1581
  "view.loading_time.source": r
1595
1582
  });
@@ -1614,7 +1601,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1614
1601
  };
1615
1602
  window.addEventListener("load", t, { once: !0 }), s = () => window.removeEventListener("load", t);
1616
1603
  }
1617
- let p = ht(t, e.startedAt, (t) => {
1604
+ let p = pt(t, e.startedAt, (t) => {
1618
1605
  r = !0, t.hadActivity && (i = Math.max(0, t.endTime - e.startedAt)), d();
1619
1606
  }), m = () => {
1620
1607
  var t;
@@ -1625,13 +1612,13 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1625
1612
  }, d();
1626
1613
  }, u = (e) => {
1627
1614
  let n = t.applyRedact(e == null ? {} : e);
1628
- return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !Cn.has(e)));
1615
+ return Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0 && !bn.has(e)));
1629
1616
  }, d = (e, r, i, a = ((e) => (e = n == null ? void 0 : n.rawUrl) == null ? "" : e)()) => {
1630
1617
  var c, d;
1631
1618
  if (!t.isSessionActive()) return;
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);
1619
+ let f = (c = e.url) == null ? xn() : c, p = t.config.hooks.getViewPathGroup(f), m = (d = e.name) == null ? p : d, _ = u(e.attributes);
1633
1620
  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() : {};
1621
+ 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 ? Sn() : {};
1635
1622
  t.setView({
1636
1623
  attributes: _,
1637
1624
  id: v,
@@ -1647,7 +1634,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1647
1634
  loadingType: i,
1648
1635
  name: m,
1649
1636
  rawUrl: f,
1650
- snapshotAttributes: S(S(S(S(S({}, _), t.config.hooks.getPageAttributes()), w), N({ spanType: M.view })), {}, {
1637
+ snapshotAttributes: S(S(S(S(S({}, _), t.config.hooks.getPageAttributes()), w), M({ spanType: j.view })), {}, {
1651
1638
  [g.viewId]: v,
1652
1639
  [g.viewName]: m,
1653
1640
  [g.viewUrl]: y,
@@ -1682,8 +1669,8 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1682
1669
  }), o(n, "update"));
1683
1670
  }
1684
1671
  }), 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);
1672
+ t.config.view.tracking === "auto" && (n || d({}, "load", "initial_load"), p = gn((e) => {
1673
+ Tn(e.fromUrl, e.toUrl) && d({}, e.source, "route_change", e.fromUrl);
1687
1674
  }));
1688
1675
  let m = (e) => {
1689
1676
  if (e.persisted) {
@@ -1725,27 +1712,27 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1725
1712
  }
1726
1713
  }
1727
1714
  };
1728
- }, An = 5e3, J = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, jn = (e, t, n, r) => ({
1715
+ }, Dn = 5e3, On = (e) => typeof e == "number" && Number.isFinite(e) && e > 0, kn = (e, t, n, r) => ({
1729
1716
  expiresAt: Math.min(t + n, t + r),
1730
1717
  id: e,
1731
1718
  startedAt: t,
1732
1719
  status: "active"
1733
- }), Y = (e, t, n) => {
1720
+ }), X = (e, t, n) => {
1734
1721
  if (t >= e.startedAt + n) return "maxLifetime";
1735
1722
  if (t >= e.expiresAt) return "inactivity";
1736
- }, Mn = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), Nn = (e, t, n) => {
1723
+ }, An = (e, t, n, r) => S(S({}, e), {}, { expiresAt: Math.min(t + n, e.startedAt + r) }), jn = (e, t, n) => {
1737
1724
  if (!e) return null;
1738
1725
  try {
1739
1726
  let r = JSON.parse(e);
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;
1727
+ 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;
1741
1728
  } catch (e) {}
1742
1729
  return null;
1743
- }, Pn = 900 * 1e3, X = 14400 * 1e3, Fn = 1e3, In = 6e4, Ln = [
1730
+ }, Mn = 900 * 1e3, Z = 14400 * 1e3, Nn = 1e3, Pn = 6e4, Fn = [
1744
1731
  "click",
1745
1732
  "keydown",
1746
1733
  "scroll",
1747
1734
  "touchstart"
1748
- ], Rn = /* @__PURE__ */ new Map(), zn = (e) => {
1735
+ ], In = /* @__PURE__ */ new Map(), Ln = (e) => {
1749
1736
  let t = typeof window < "u", n = () => {
1750
1737
  var n;
1751
1738
  if (t) try {
@@ -1753,21 +1740,21 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1753
1740
  } catch (e) {
1754
1741
  t = !1;
1755
1742
  }
1756
- return (n = Rn.get(e)) == null ? null : n;
1743
+ return (n = In.get(e)) == null ? null : n;
1757
1744
  };
1758
1745
  return n(), {
1759
1746
  isLocalStorage: () => t,
1760
1747
  read: n,
1761
1748
  write: (n) => {
1762
1749
  let r = JSON.stringify(n);
1763
- if (Rn.set(e, r), t) try {
1750
+ if (In.set(e, r), t) try {
1764
1751
  window.localStorage.setItem(e, r);
1765
1752
  } catch (e) {
1766
1753
  t = !1;
1767
1754
  }
1768
1755
  }
1769
1756
  };
1770
- }, Bn = (e, t) => {
1757
+ }, Rn = (e, t) => {
1771
1758
  let n = "";
1772
1759
  try {
1773
1760
  n = new URL(e).host;
@@ -1775,8 +1762,8 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1775
1762
  n = e;
1776
1763
  }
1777
1764
  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 })), {}, {
1765
+ }, zn = (e, t, n, r, i, a, o) => {
1766
+ e.startSpan("browser.session", S(S(S({}, e.config.hooks.getPageAttributes()), M({ spanType: j.session })), {}, {
1780
1767
  [g.sessionPhase]: t,
1781
1768
  [g.sessionHasReplay]: !1,
1782
1769
  [g.sessionId]: n,
@@ -1787,7 +1774,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1787
1774
  contextTime: i,
1788
1775
  startTime: i
1789
1776
  }).end(i);
1790
- }, Hn = (e = {}) => {
1777
+ }, Bn = (e = {}) => {
1791
1778
  let t = [];
1792
1779
  return {
1793
1780
  name: "session",
@@ -1803,7 +1790,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1803
1790
  }, e);
1804
1791
  return;
1805
1792
  }
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 = () => {
1793
+ 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 = () => {
1807
1794
  l !== void 0 && (clearTimeout(l), l = void 0);
1808
1795
  }, f = (e, t = Date.now()) => {
1809
1796
  var r;
@@ -1813,7 +1800,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1813
1800
  id: i,
1814
1801
  reason: e,
1815
1802
  type: "expired"
1816
- }), Vn(n, "end", i, (r = c) == null ? t : r, t, e), d(), s = void 0, c = void 0, n.setRuntimeAttributes({
1803
+ }), zn(n, "end", i, (r = c) == null ? t : r, t, e), d(), s = void 0, c = void 0, n.setRuntimeAttributes({
1817
1804
  [g.sessionHasReplay]: void 0,
1818
1805
  [g.sessionId]: void 0,
1819
1806
  [g.sessionStartTime]: void 0,
@@ -1833,7 +1820,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1833
1820
  f("external", e);
1834
1821
  return;
1835
1822
  }
1836
- let n = Y(t, e, X);
1823
+ let n = X(t, e, Z);
1837
1824
  if (!n) {
1838
1825
  m(t);
1839
1826
  return;
@@ -1847,7 +1834,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1847
1834
  a.write(r), f(n, e);
1848
1835
  }, m = (e) => {
1849
1836
  d();
1850
- let t = Math.min(e.expiresAt, e.startedAt + X);
1837
+ let t = Math.min(e.expiresAt, e.startedAt + Z);
1851
1838
  l = setTimeout(p, Math.max(0, t - Date.now()));
1852
1839
  }, _ = (e, t) => {
1853
1840
  let r = e.id !== s;
@@ -1865,51 +1852,51 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1865
1852
  });
1866
1853
  }, v = (e = !1) => {
1867
1854
  let t = Date.now(), r = u(t);
1868
- if ((r == null ? void 0 : r.status) === "active" && !Y(r, t, X)) {
1869
- let e = Mn(r, t, Pn, X);
1855
+ if ((r == null ? void 0 : r.status) === "active" && !X(r, t, Z)) {
1856
+ let e = An(r, t, Mn, Z);
1870
1857
  a.write(e), _(e, s ? void 0 : { reason: "shared" });
1871
1858
  return;
1872
1859
  }
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);
1860
+ 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);
1874
1861
  a.write(c), _(c, {
1875
1862
  previousId: i,
1876
1863
  reason: o == null ? "init" : o
1877
1864
  });
1878
1865
  let l = o == null ? "init" : o;
1879
- Vn(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
1866
+ zn(n, l === "init" ? "start" : "rotate", c.id, c.startedAt, c.startedAt, l, i);
1880
1867
  }, y = () => {
1881
1868
  if (!s) return;
1882
1869
  let e = Date.now(), t = u(e);
1883
- if ((t == null ? void 0 : t.status) !== "active" || t.id !== s || Y(t, e, X)) {
1870
+ if ((t == null ? void 0 : t.status) !== "active" || t.id !== s || X(t, e, Z)) {
1884
1871
  p();
1885
1872
  return;
1886
1873
  }
1887
- let n = Mn(t, e, Pn, X);
1874
+ let n = An(t, e, Mn, Z);
1888
1875
  a.write(n), _(n);
1889
1876
  };
1890
1877
  v(!0);
1891
1878
  let b = 0, x = () => {
1892
1879
  let e = Date.now();
1893
- e - b < Fn || (b = e, v());
1880
+ e - b < Nn || (b = e, v());
1894
1881
  }, S = {
1895
1882
  capture: !0,
1896
1883
  passive: !0
1897
1884
  };
1898
- Ln.forEach((e) => window.addEventListener(e, x, S)), t.push(() => {
1899
- Ln.forEach((e) => window.removeEventListener(e, x, S));
1885
+ Fn.forEach((e) => window.addEventListener(e, x, S)), t.push(() => {
1886
+ Fn.forEach((e) => window.removeEventListener(e, x, S));
1900
1887
  });
1901
1888
  let C = () => {
1902
1889
  document.visibilityState === "visible" && y();
1903
1890
  };
1904
1891
  document.addEventListener("visibilitychange", C);
1905
- let w = window.setInterval(C, In);
1892
+ let w = window.setInterval(C, Pn);
1906
1893
  t.push(() => {
1907
1894
  document.removeEventListener("visibilitychange", C), window.clearInterval(w);
1908
1895
  });
1909
1896
  let T = (e) => {
1910
1897
  if (!a.isLocalStorage() || e.storageArea !== window.localStorage || e.key !== i) return;
1911
- let t = Date.now(), n = Nn(e.newValue, t, X);
1912
- if ((n == null ? void 0 : n.status) === "active" && n.id === s && !Y(n, t, X)) {
1898
+ let t = Date.now(), n = jn(e.newValue, t, Z);
1899
+ if ((n == null ? void 0 : n.status) === "active" && n.id === s && !X(n, t, Z)) {
1913
1900
  m(n);
1914
1901
  return;
1915
1902
  }
@@ -1921,54 +1908,47 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1921
1908
  for (var e; t.length;) (e = t.pop()) == null || e();
1922
1909
  }
1923
1910
  };
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;
1926
- let e = performance.getEntriesByType("navigation")[0];
1927
- return Yn(e == null ? void 0 : e.type);
1928
- }, Zn = (e, t) => {
1911
+ }, Vn = 10, Hn = 6e4, Un = 5e3, Wn = 1e3, Gn = (e, t) => !!t && e === t, Kn = (e, t) => {
1929
1912
  let [n, r] = e === "CLS" ? [.1, .25] : [200, 500];
1930
1913
  return t <= n ? "good" : t <= r ? "needs-improvement" : "poor";
1931
- }, Z = (e) => {
1914
+ }, qn = (e) => {
1932
1915
  var t, n, r;
1933
1916
  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;
1934
- }, Qn = () => {
1917
+ }, Jn = () => {
1935
1918
  if (typeof performance > "u") return;
1936
1919
  let e = performance.interactionCount;
1937
1920
  return typeof e == "number" && Number.isFinite(e) ? e : void 0;
1938
- }, $n = (e, t) => {
1921
+ }, Yn = (e, t) => {
1939
1922
  var n, r;
1940
1923
  let i = (n = t.value) == null ? 0 : n;
1941
1924
  if (!(t.hadRecentInput || !Number.isFinite(i))) {
1942
- if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= qn || t.startTime - e.clsWindowStart >= Kn) {
1925
+ if (e.clsWindowStart === void 0 || t.startTime - ((r = e.clsWindowEnd) == null ? t.startTime : r) >= Wn || t.startTime - e.clsWindowStart >= Un) {
1943
1926
  var a;
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);
1927
+ 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);
1945
1928
  } else if (e.clsWindowValue += i, i > e.clsWindowLargestShiftValue) {
1946
1929
  var o;
1947
- e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = Z((o = t.sources) == null || (o = o[0]) == null ? void 0 : o.node);
1930
+ e.clsWindowLargestShiftValue = i, e.clsWindowLargestShiftTarget = qn((o = t.sources) == null || (o = o[0]) == null ? void 0 : o.node);
1948
1931
  }
1949
1932
  e.clsWindowEnd = t.startTime, e.clsWindowValue > e.cls && (e.cls = Math.round(e.clsWindowValue * 1e4) / 1e4, e.largestShiftValue = e.clsWindowLargestShiftValue, e.largestShiftTarget = e.clsWindowLargestShiftTarget);
1950
1933
  }
1951
- }, er = (e, t) => {
1934
+ }, Xn = (e, t) => {
1952
1935
  var n, r;
1953
1936
  if (!t.interactionId || !Number.isFinite(t.duration)) return;
1954
1937
  e.interactionIdMin = Math.min(e.interactionIdMin, t.interactionId), e.interactionIdMax = Math.max(e.interactionIdMax, t.interactionId);
1955
1938
  let i = (n = t.processingStart) == null ? t.startTime : n, a = (r = t.processingEnd) == null ? i : r, o = {
1956
- duration: Math.min(t.duration, Gn),
1939
+ duration: Math.min(t.duration, Hn),
1957
1940
  inputDelay: Math.max(0, i - t.startTime),
1958
1941
  interactionId: t.interactionId,
1959
- interactionTarget: Z(t.target),
1942
+ interactionTarget: qn(t.target),
1960
1943
  interactionType: t.name,
1961
1944
  presentationDelay: Math.max(0, t.startTime + t.duration - a),
1962
1945
  processingDuration: Math.max(0, a - i)
1963
1946
  }, s = e.inpCandidates.findIndex((e) => e.interactionId === t.interactionId);
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;
1947
+ 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);
1948
+ }, Zn = (e) => {
1949
+ 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;
1967
1950
  if (e.inpCandidates.length) return e.inpCandidates[Math.min(e.inpCandidates.length - 1, Math.floor(n / 50))];
1968
- }, nr = (e, t) => {
1969
- var n;
1970
- return { "rum.navigation.type": (n = e.navigationType) == null ? t : n };
1971
- }, rr = (e, t) => {
1951
+ }, Qn = (e, t) => {
1972
1952
  var n;
1973
1953
  let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
1974
1954
  t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
@@ -1992,7 +1972,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
1992
1972
  default: break;
1993
1973
  }
1994
1974
  return i;
1995
- }, ir = () => {
1975
+ }, $n = () => {
1996
1976
  let e, t = !1;
1997
1977
  return {
1998
1978
  name: "web-vitals",
@@ -2010,31 +1990,31 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2010
1990
  return;
2011
1991
  }
2012
1992
  if (t) return;
2013
- let { onFCP: a, onLCP: o, onTTFB: s } = r, c = Xn(), l = (e, t, r, i = r == null ? Date.now() : r) => {
1993
+ let { onFCP: a, onLCP: o, onTTFB: s } = r, c = (e, t, r, i = r == null ? Date.now() : r) => {
2014
1994
  if (!n.isSampled()) return;
2015
1995
  let a = e.name.toLowerCase();
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),
2018
- spanType: M.vital
1996
+ n.startSpan("browser.web_vital", S(S(S(S({}, n.config.hooks.getPageAttributes()), t), M({
1997
+ outcome: We(e.rating),
1998
+ spanType: j.vital
2019
1999
  })), {}, {
2020
2000
  [g.vitalMetric]: a,
2021
2001
  [g.vitalValue]: e.value,
2022
2002
  [g.vitalRating]: e.rating,
2023
2003
  "vital.id": e.id
2024
- }, rr(e, n.config.hooks.redactUrl)), {
2004
+ }, Qn(e, n.config.hooks.redactUrl)), {
2025
2005
  contextTime: r,
2026
2006
  startTime: i
2027
2007
  }).end(i);
2028
- }, u = (e) => {
2008
+ }, l = (e) => {
2029
2009
  if (t || !Number.isFinite(e.value) || !n.isSampled()) return;
2030
2010
  let r = e.entries[0], i = r && typeof performance < "u" ? performance.timeOrigin + r.startTime : void 0;
2031
- l(e, i === void 0 ? n.getRuntimeAttributes() : n.getRuntimeAttributesAt(i), i);
2032
- }, d, f, p, m = (e, t, n) => {
2033
- l(e, t, n, Date.now());
2034
- }, _ = () => {
2035
- let e = d;
2011
+ c(e, i === void 0 ? n.getRuntimeAttributes() : n.getRuntimeAttributesAt(i), i);
2012
+ }, u, d, f, p = (e, t, n) => {
2013
+ c(e, t, n, Date.now());
2014
+ }, m = () => {
2015
+ let e = u;
2036
2016
  if (!e || !n.isSampled()) return;
2037
- m({
2017
+ p({
2038
2018
  attribution: {
2039
2019
  largestShiftTarget: e.largestShiftTarget,
2040
2020
  largestShiftValue: e.largestShiftValue
@@ -2042,12 +2022,11 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2042
2022
  entries: [],
2043
2023
  id: h("vital"),
2044
2024
  name: "CLS",
2045
- navigationType: c,
2046
- rating: Zn("CLS", e.cls),
2025
+ rating: Kn("CLS", e.cls),
2047
2026
  value: e.cls
2048
2027
  }, e.runtimeAttributes, e.startedAt);
2049
- let t = tr(e);
2050
- t && m({
2028
+ let t = Zn(e);
2029
+ t && p({
2051
2030
  attribution: {
2052
2031
  inputDelay: t.inputDelay,
2053
2032
  interactionTarget: t.interactionTarget,
@@ -2058,14 +2037,13 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2058
2037
  entries: [],
2059
2038
  id: h("vital"),
2060
2039
  name: "INP",
2061
- navigationType: c,
2062
- rating: Zn("INP", t.duration),
2040
+ rating: Kn("INP", t.duration),
2063
2041
  value: t.duration
2064
2042
  }, e.runtimeAttributes, e.startedAt);
2065
- }, v = n.onViewChange((e) => {
2043
+ }, _ = n.onViewChange((e) => {
2066
2044
  var t;
2067
- let r = d;
2068
- if (r && Jn(r.id, e.id)) {
2045
+ let r = u;
2046
+ if (r && Gn(r.id, e.id)) {
2069
2047
  r.runtimeAttributes = S(S({}, r.runtimeAttributes), {}, {
2070
2048
  [g.viewId]: e.id,
2071
2049
  [g.viewName]: e.name,
@@ -2074,11 +2052,11 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2074
2052
  });
2075
2053
  return;
2076
2054
  }
2077
- _(), d = e.id ? {
2055
+ m(), u = e.id ? {
2078
2056
  cls: 0,
2079
2057
  clsWindowLargestShiftValue: 0,
2080
2058
  clsWindowValue: 0,
2081
- interactionCountAtStart: Qn(),
2059
+ interactionCountAtStart: Jn(),
2082
2060
  interactionIdMax: 0,
2083
2061
  interactionIdMin: Infinity,
2084
2062
  inpCandidates: [],
@@ -2089,22 +2067,22 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2089
2067
  } : void 0;
2090
2068
  });
2091
2069
  if (typeof PerformanceObserver < "u") {
2092
- var y, b;
2093
- (y = PerformanceObserver.supportedEntryTypes) != null && y.includes("layout-shift") && (p = new PerformanceObserver((e) => {
2094
- if (d) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < d.startedAt || $n(d, t);
2095
- }), p.observe({
2070
+ var v, y;
2071
+ (v = PerformanceObserver.supportedEntryTypes) != null && v.includes("layout-shift") && (f = new PerformanceObserver((e) => {
2072
+ if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || Yn(u, t);
2073
+ }), f.observe({
2096
2074
  buffered: !0,
2097
2075
  type: "layout-shift"
2098
- })), (b = PerformanceObserver.supportedEntryTypes) != null && b.includes("event") && (f = new PerformanceObserver((e) => {
2099
- if (d) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < d.startedAt || !t.interactionId || !Number.isFinite(t.duration) || er(d, t);
2100
- }), f.observe({
2076
+ })), (y = PerformanceObserver.supportedEntryTypes) != null && y.includes("event") && (d = new PerformanceObserver((e) => {
2077
+ if (u) for (let t of e.getEntries()) performance.timeOrigin + t.startTime < u.startedAt || !t.interactionId || !Number.isFinite(t.duration) || Xn(u, t);
2078
+ }), d.observe({
2101
2079
  buffered: !0,
2102
2080
  durationThreshold: 40,
2103
2081
  type: "event"
2104
2082
  }));
2105
2083
  }
2106
- a(u), o(u), s(u), e = () => {
2107
- _(), d = void 0, v(), p == null || p.disconnect(), f == null || f.disconnect();
2084
+ a(l), o(l), s(l), e = () => {
2085
+ m(), u = void 0, _(), f == null || f.disconnect(), d == null || d.disconnect();
2108
2086
  };
2109
2087
  })();
2110
2088
  },
@@ -2112,7 +2090,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2112
2090
  t = !0, e == null || e(), e = void 0;
2113
2091
  }
2114
2092
  };
2115
- }, ar = (e, t) => {
2093
+ }, er = (e, t) => {
2116
2094
  let n = {
2117
2095
  "network.protocol.name": "websocket",
2118
2096
  "url.full": t(e)
@@ -2122,14 +2100,14 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2122
2100
  n["server.address"] = t.hostname, t.port && (n["server.port"] = Number(t.port)), n["url.scheme"] = t.protocol.replace(":", "");
2123
2101
  } catch (e) {}
2124
2102
  return n;
2125
- }, or = (t, n, r, i) => {
2126
- let a = h("websocket"), o = ar(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
2103
+ }, tr = (t, n, r, i) => {
2104
+ let a = h("websocket"), o = er(r, n.config.hooks.redactUrl), s = !1, c = (t, r, s = {}) => {
2127
2105
  if (i() || !n.isSampled()) return;
2128
2106
  let c = t === "error";
2129
- n.startSpan("browser.websocket", S(S(S({}, o), N({
2130
- outcome: c ? j.error : j.success,
2107
+ n.startSpan("browser.websocket", S(S(S({}, o), M({
2108
+ outcome: c ? A.error : A.success,
2131
2109
  outcomeReason: c ? "network" : void 0,
2132
- spanType: M.websocket
2110
+ spanType: j.websocket
2133
2111
  })), {}, {
2134
2112
  [g.websocketPhase]: t,
2135
2113
  "websocket.connection.id": a
@@ -2149,7 +2127,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2149
2127
  "websocket.close.was_clean": e.wasClean
2150
2128
  });
2151
2129
  });
2152
- }, sr = () => {
2130
+ }, nr = () => {
2153
2131
  let e, t, n = !1;
2154
2132
  return {
2155
2133
  name: "websocket",
@@ -2160,25 +2138,29 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2160
2138
  let a = Reflect.construct(e, t, i);
2161
2139
  if (n || !r.isSampled()) return a;
2162
2140
  let o = t[0] == null ? "" : String(t[0]);
2163
- return o && !k(r.config, o) && or(a, r, o, () => n), a;
2141
+ return o && !O(r.config, o) && tr(a, r, o, () => n), a;
2164
2142
  } }), window.WebSocket = t;
2165
2143
  },
2166
2144
  shutdown() {
2167
2145
  n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
2168
2146
  }
2169
2147
  };
2170
- }, cr = class {
2148
+ }, rr = class {
2171
2149
  constructor() {
2172
2150
  b(this, "listeners", /* @__PURE__ */ new Set()), b(this, "notify", (e) => {
2173
2151
  this.listeners.forEach((t) => t(e));
2174
2152
  }), b(this, "subscribe", (e) => (this.listeners.add(e), () => this.listeners.delete(e)));
2175
2153
  }
2176
- }, lr = (e) => ({
2154
+ }, ir = (e) => {
2155
+ let t = 2166136261;
2156
+ for (let n = 0; n < e.length; n += 1) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
2157
+ return t += t << 13, t ^= t >>> 7, t += t << 3, t ^= t >>> 17, t += t << 5, (t >>> 0) / 4294967296;
2158
+ }, ar = ({ application: e, session: t }, n) => t.sampleRate <= 0 ? !1 : t.sampleRate >= 1 ? !0 : ir(`${e.name}\0${n}`) < t.sampleRate, or = (e) => ({
2177
2159
  url: e.endpoint,
2178
2160
  headers: e.headers,
2179
2161
  concurrencyLimit: e.concurrencyLimit,
2180
2162
  timeoutMillis: e.timeoutMillis
2181
- }), ur = "bk-rum", dr = class {
2163
+ }), sr = "bk-rum", cr = class {
2182
2164
  constructor(e) {
2183
2165
  this.isSampled = e;
2184
2166
  }
@@ -2188,7 +2170,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2188
2170
  toString() {
2189
2171
  return "RumSessionSampler";
2190
2172
  }
2191
- }, Q, fr = () => {
2173
+ }, Q, lr = () => {
2192
2174
  if (Q) Q.users += 1;
2193
2175
  else {
2194
2176
  let e = new a().enable(), t = n.setGlobalContextManager(e);
@@ -2203,28 +2185,28 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2203
2185
  return () => {
2204
2186
  e || !Q || (e = !0, --Q.users, !(Q.users > 0) && (Q.ownsContext && n.disable(), Q.ownsPropagator && r.disable(), Q = void 0));
2205
2187
  };
2206
- }, pr = (e, t) => t ? new Proxy(e, { get(e, t, n) {
2188
+ }, ur = (e, t) => t ? new Proxy(e, { get(e, t, n) {
2207
2189
  if (t === "export") return (t, n) => {
2208
2190
  var r;
2209
2191
  return (r = globalThis.console) == null || r.log("[bk-ot][rum]", t), e.export(t, n);
2210
2192
  };
2211
2193
  let r = Reflect.get(e, t, n);
2212
2194
  return typeof r == "function" ? r.bind(e) : r;
2213
- } }) : e, mr = (e) => [nn(e.tracking.request)], hr = (e) => [
2214
- Hn(e.session),
2195
+ } }) : e, dr = (e) => [$t(e.tracking.request)], fr = (e) => [
2196
+ Bn(e.session),
2215
2197
  ...$(e.tracking.device, !0, ce),
2216
- pt(),
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),
2222
- ...$(e.blankScreen, !0, Ot),
2223
- ...$(e.action, !0, ut),
2224
- ...$(e.websocket, !1, sr),
2225
- ...$(e.longTask, !1, mn),
2226
- ...$(e.cspViolation, !1, on)
2227
- ], yr = class {
2198
+ dt(),
2199
+ En(),
2200
+ Lt(pr(e.tracking.resource, !0))
2201
+ ], 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) => [
2202
+ ...$(e.error, !0, on),
2203
+ ...$(e.webVitals, !0, $n),
2204
+ ...$(e.blankScreen, !0, Et),
2205
+ ...$(e.action, !0, ct),
2206
+ ...$(e.websocket, !1, nr),
2207
+ ...$(e.longTask, !1, dn),
2208
+ ...$(e.cspViolation, !1, nn)
2209
+ ], gr = class {
2228
2210
  assertBeforeStart(e) {
2229
2211
  if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
2230
2212
  }
@@ -2255,19 +2237,19 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2255
2237
  createPluginManager() {
2256
2238
  var e;
2257
2239
  return new Ce([
2258
- ...hr(this.config),
2259
- ...mr(this.config),
2260
- ...vr(this.config.tracking),
2240
+ ...fr(this.config),
2241
+ ...dr(this.config),
2242
+ ...hr(this.config.tracking),
2261
2243
  ...(e = this.config.extensions.plugins) == null ? [] : e
2262
2244
  ]);
2263
2245
  }
2264
2246
  constructor(n) {
2265
2247
  var r = this;
2266
- b(this, "activityObserver", new cr()), b(this, "flushProviders", E(function* () {
2248
+ b(this, "activityObserver", new rr()), b(this, "flushProviders", E(function* () {
2267
2249
  yield r.tracerProvider.forceFlush();
2268
2250
  })), 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* () {
2269
2251
  if (r.pluginManager || !r.config.enabled || r.config.trackingConsent !== "granted") return;
2270
- r.releaseOtelGlobals = fr();
2252
+ r.releaseOtelGlobals = lr();
2271
2253
  let e = r.createPluginManager();
2272
2254
  r.pluginManager = e;
2273
2255
  try {
@@ -2305,7 +2287,7 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2305
2287
  }), b(this, "reportAction", ({ attributes: e = {}, name: t }) => {
2306
2288
  if (!this.isSampled()) return;
2307
2289
  let n = h("action"), r = Date.now();
2308
- this.startSpan("action.custom", S(S(S(S({}, this.config.hooks.getPageAttributes()), e), N({ spanType: M.action })), {}, {
2290
+ this.startSpan("action.custom", S(S(S(S({}, this.config.hooks.getPageAttributes()), e), M({ spanType: j.action })), {}, {
2309
2291
  [g.actionId]: n,
2310
2292
  [g.actionName]: t,
2311
2293
  [g.actionType]: "custom"
@@ -2318,21 +2300,21 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2318
2300
  }
2319
2301
  return;
2320
2302
  }
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,
2323
- spanType: M.custom
2324
- })), {}, { "rum.custom.name": r }), { startTime: a });
2303
+ let a = Date.now(), o = this.startSpan(`custom.${r}`, S(S(S(S({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), e), M({
2304
+ outcome: n ? A.error : A.success,
2305
+ spanType: j.custom
2306
+ })), { startTime: a });
2325
2307
  n && (o.recordException(n), o.setStatus({
2326
2308
  code: t.ERROR,
2327
2309
  message: n.message
2328
2310
  })), o.end(a);
2329
2311
  }), b(this, "setRuntimeAttributes", (e, t) => {
2330
- let n = S({}, e);
2312
+ let n = S({}, e), r = t == null ? Date.now() : t;
2331
2313
  if (g.sessionId in e) {
2332
2314
  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;
2315
+ this.sampled = this.config.enabled && typeof t == "string" && t.length > 0 ? ar(this.config, t) : !1, this.runtimeContext.setSessionSampled(this.sampled, r);
2334
2316
  }
2335
- this.runtimeContext.setAttributes(n, t);
2317
+ this.runtimeContext.setAttributes(n, r);
2336
2318
  }), b(this, "setTrackingConsent", function() {
2337
2319
  var e = E(function* (e) {
2338
2320
  r.config.trackingConsent !== e && (r.config.trackingConsent = e, r.phase === "started" && (e === "granted" ? yield r.startCollection() : yield r.stopCollection(!0)));
@@ -2388,8 +2370,9 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2388
2370
  }
2389
2371
  })), b(this, "startSpan", (t, n = {}, r) => {
2390
2372
  var i, a;
2391
- if (!this.isSampled()) return this.tracer.startSpan(t);
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);
2373
+ let o = (i = r == null ? void 0 : r.contextTime) == null ? typeof (r == null ? void 0 : r.startTime) == "number" ? r.startTime : void 0 : i;
2374
+ if (!this.isSampled() || o !== void 0 && !this.runtimeContext.isSessionSampledAt(o)) return this.tracer.startSpan(t);
2375
+ let s = o === void 0 ? this.getRuntimeAttributes() : this.runtimeContext.getAttributesAt(o);
2393
2376
  return this.tracer.startSpan(t, {
2394
2377
  kind: (a = r == null ? void 0 : r.kind) == null ? e.INTERNAL : a,
2395
2378
  startTime: r == null ? void 0 : r.startTime,
@@ -2406,20 +2389,20 @@ var Sn = ["stopLoadingTime"], Cn = new Set([...Object.values(g), D]), wn = () =>
2406
2389
  }), b(this, "useInstrumentation", (e) => {
2407
2390
  var t;
2408
2391
  return this.assertBeforeStart("useInstrumentation"), this.config.enabled && ((t = this.config.extensions.instrumentations) == null || t.push(e)), this;
2409
- }), this.config = ye(n), this.runtimeContext = new He({ [D]: !1 }, this.config.user);
2392
+ }), this.config = ye(n), this.runtimeContext = new Ve({}, this.config.user);
2410
2393
  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())))];
2394
+ let e = ur(new s(or(this.config.transport)), this.config.debug);
2395
+ 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())))];
2413
2396
  })();
2414
2397
  this.tracerProvider = new f({
2415
2398
  resource: i,
2416
- sampler: new dr(this.isSampled),
2399
+ sampler: new cr(this.isSampled),
2417
2400
  spanProcessors: a
2418
- }), this.tracer = this.tracerProvider.getTracer(ur), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
2401
+ }), this.tracer = this.tracerProvider.getTracer(sr), this.registeredInstrumentations = [], this.config.autoStart && this.start().catch((e) => {
2419
2402
  var t;
2420
2403
  (t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
2421
2404
  });
2422
2405
  }
2423
2406
  };
2424
2407
  //#endregion
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 };
2408
+ 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 };