@blueking/open-telemetry 0.0.23 → 0.0.24

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