@cimulate/copilot-widget 1.58.2 → 1.60.1

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.
@@ -66,8 +66,12 @@ const Ee = { namespace: "sf.instrumentation", name: "PayloadDiags", pbjsSchema:
66
66
  } }, Payload: { fields: { payload: { id: 2, type: "bytes" }, schemaName: { id: 1, type: "string" } } } } } } } } } }, Re = { namespace: "sf.instrumentation", name: "Network", pbjsSchema: { nested: { sf: { nested: { instrumentation: { nested: { Network: { fields: { mtd: { id: 1, type: "string" }, url: { id: 2, type: "string" } } } } } } } } } }, Pe = { namespace: "sf.instrumentation", name: "Activity", pbjsSchema: { nested: { sf: { nested: { instrumentation: { nested: { Activity: { reserved: [[5, 5], [7, 7]], fields: { stopReason: { id: 6, type: "string" }, externalParentId: { id: 17, type: "string" }, isRoot: { id: 8, type: "bool" }, isExternal: { id: 16, type: "bool" }, isSampled: { id: 11, type: "bool" }, preRootId: { id: 9, type: "string" }, parentId: { id: 13, type: "string" }, duration: { id: 3, type: "double" }, timerOverridden: {
67
67
  id: 12,
68
68
  type: "uint32"
69
- }, isRerooted: { id: 15, type: "bool" }, name: { options: { "(meta.max_length)": 25 }, id: 2, type: "string" }, traceIdSource: { id: 14, type: "string" }, id: { id: 1, type: "string" }, userPayload: { id: 4, type: "Payload" }, errorCount: { id: 10, type: "uint32" } } }, Payload: { fields: { payload: { id: 2, type: "bytes" }, schemaName: { id: 1, type: "string" } } } } } } } } } }, Q = { namespace: "sf.instrumentation", name: "Simple", pbjsSchema: { nested: { sf: { nested: { instrumentation: { nested: { Simple: { fields: { text: { options: { "(meta.max_length)": 25 }, id: 1, type: "string" } } } } } } } } } }, xe = { namespace: "sf.instrumentation", name: "Error", pbjsSchema: { nested: { sf: { nested: { instrumentation: { nested: { Error: { reserved: [[5, 5], [7, 7]], fields: { activityId: { id: 6, type: "string" }, stack: { id: 3, type: "string" }, name: { id: 1, type: "string" }, message: { options: { "(meta.max_length)": 200 }, id: 2, type: "string" }, userPayload: { id: 4, type: "Payload" } } }, Payload: { fields: { payload: { id: 2, type: "bytes" }, schemaName: { id: 1, type: "string" } } } } } } } } } }, Te = /* @__PURE__ */ Symbol("o11y.stampTenantClass");
70
- class Oe {
69
+ }, isRerooted: { id: 15, type: "bool" }, name: { options: { "(meta.max_length)": 25 }, id: 2, type: "string" }, traceIdSource: { id: 14, type: "string" }, id: { id: 1, type: "string" }, userPayload: { id: 4, type: "Payload" }, errorCount: { id: 10, type: "uint32" } } }, Payload: { fields: { payload: { id: 2, type: "bytes" }, schemaName: { id: 1, type: "string" } } } } } } } } } }, Q = { namespace: "sf.instrumentation", name: "Simple", pbjsSchema: { nested: { sf: { nested: { instrumentation: { nested: { Simple: { fields: { text: { options: { "(meta.max_length)": 25 }, id: 1, type: "string" } } } } } } } } } }, xe = { namespace: "sf.instrumentation", name: "Error", pbjsSchema: { nested: { sf: { nested: { instrumentation: { nested: { Error: { reserved: [[5, 5], [7, 7]], fields: { activityId: { id: 6, type: "string" }, stack: { id: 3, type: "string" }, name: { id: 1, type: "string" }, message: { options: { "(meta.max_length)": 200 }, id: 2, type: "string" }, userPayload: { id: 4, type: "Payload" } } }, Payload: { fields: { payload: { id: 2, type: "bytes" }, schemaName: { id: 1, type: "string" } } } } } } } } } }, Te = { namespace: "sf.pdp", name: "PdpEvent", pbjsSchema: { nested: { sf: { nested: { pdp: { nested: { PdpEvent: { oneofs: { _eventVolume: { oneof: ["eventVolume"] } }, fields: { contextName: { id: 5, type: "string" }, componentId: { id: 2, type: "string" }, productFeatureId: { id: 3, type: "string" }, channel: { id: 7, type: "string" }, eventName: { id: 1, type: "string" }, contextValue: { id: 6, type: "string" }, subType: { id: 8, type: "string" }, eventVolume: {
70
+ options: { proto3_optional: !0 },
71
+ id: 4,
72
+ type: "int32"
73
+ } } } } } } } } } }, Oe = /* @__PURE__ */ Symbol("o11y.stampTenantClass");
74
+ class Ne {
71
75
  get isBusy() {
72
76
  return this._isOk ? this._busyCount > 0 : void 0;
73
77
  }
@@ -81,10 +85,10 @@ class Oe {
81
85
  this._isOk && (this._busyCount > 0 ? (this._busyCount -= 1, this._busyCount || this._doneCallback()) : (this._isOk = !1, this._overDoneCallback()));
82
86
  }
83
87
  }
84
- const Ne = 300;
85
- class Le {
88
+ const Le = 300;
89
+ class De {
86
90
  constructor(e) {
87
- this._taskers = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._busyCheckers = /* @__PURE__ */ new Map(), this._logThreshold = Ne, this._endedTasks = new Array(), this._pollableReport = new Array(), o.requireArgumentIfDefined(e == null ? void 0 : e.logThreshold, "options.logThreshold", "number") && (this._logThreshold = e.logThreshold), o.requireArgumentIfDefined(e == null ? void 0 : e.reportListener, "options.reportListener", "function") && (this._reportListener = e.reportListener), o.requireArgumentIfDefined(e == null ? void 0 : e.errorListener, "options.errorListener", "function") && (this._errorListener = e.errorListener);
91
+ this._taskers = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._busyCheckers = /* @__PURE__ */ new Map(), this._logThreshold = Le, this._endedTasks = new Array(), this._pollableReport = new Array(), o.requireArgumentIfDefined(e == null ? void 0 : e.logThreshold, "options.logThreshold", "number") && (this._logThreshold = e.logThreshold), o.requireArgumentIfDefined(e == null ? void 0 : e.reportListener, "options.reportListener", "function") && (this._reportListener = e.reportListener), o.requireArgumentIfDefined(e == null ? void 0 : e.errorListener, "options.errorListener", "function") && (this._errorListener = e.errorListener);
88
92
  }
89
93
  requestIdleDetectedCallback(e) {
90
94
  o.requireArgument(e, "callback", "function"), this._listeners.size === 0 && (this._firstCallbackTime = o.time().perfNow), this._listeners.add(e), this._checkIfLoaded();
@@ -129,7 +133,7 @@ class Le {
129
133
  o.requireArgument(e, "name", "string"), o.requireArgument(t, "isBusyChecker", "function"), this._busyCheckers.set(t, e);
130
134
  }
131
135
  _addTasker(e, t) {
132
- const r = new Oe(e, t, () => {
136
+ const r = new Ne(e, t, () => {
133
137
  this._taskers.get(r).end = o.time().perfNow, this._reportTaskEnded(r), this._checkIfLoaded();
134
138
  }, () => {
135
139
  var i;
@@ -225,7 +229,7 @@ class Le {
225
229
  };
226
230
  }
227
231
  }
228
- const De = { namespace: "sfcore.performance", name: "ResourceTiming", pbjsSchema: { nested: { sfcore: { nested: { performance: { nested: { ResourceTiming: { oneofs: {
232
+ const qe = { namespace: "sfcore.performance", name: "ResourceTiming", pbjsSchema: { nested: { sfcore: { nested: { performance: { nested: { ResourceTiming: { oneofs: {
229
233
  _xhrDelay: { oneof: ["xhrDelay"] },
230
234
  _renderBlockingStatus: { oneof: ["renderBlockingStatus"] },
231
235
  _firstInterimResponseStart: { oneof: ["firstInterimResponseStart"] },
@@ -244,7 +248,7 @@ const De = { namespace: "sfcore.performance", name: "ResourceTiming", pbjsSchema
244
248
  }, responseStatus: { options: { proto3_optional: !0 }, id: 23, type: "uint32" }, redirectEnd: { id: 9, type: "double" }, transferSize: { id: 20, type: "uint32" }, srvDuration: { options: { proto3_optional: !0 }, id: 26, type: "double" }, dbDuration: { options: { proto3_optional: !0 }, id: 25, type: "double" }, connectStart: { id: 13, type: "double" }, secureConnectionStart: { id: 14, type: "double" }, name: { id: 1, type: "string" }, nextHopProtocol: { id: 5, type: "string" }, initiatorType: {
245
249
  id: 4,
246
250
  type: "string"
247
- } } } } } } } } } }, qe = { namespace: "sfcore.performance", name: "NavigationTiming", pbjsSchema: { nested: { sfcore: { nested: { performance: { nested: { NavigationTiming: { oneofs: {
251
+ } } } } } } } } } }, He = { namespace: "sfcore.performance", name: "NavigationTiming", pbjsSchema: { nested: { sfcore: { nested: { performance: { nested: { NavigationTiming: { oneofs: {
248
252
  _xhrDelay: { oneof: ["xhrDelay"] },
249
253
  _renderBlockingStatus: { oneof: ["renderBlockingStatus"] },
250
254
  _firstInterimResponseStart: { oneof: ["firstInterimResponseStart"] },
@@ -307,7 +311,7 @@ const De = { namespace: "sfcore.performance", name: "ResourceTiming", pbjsSchema
307
311
  type: "double"
308
312
  }
309
313
  } } } } } } } } };
310
- class He {
314
+ class Me {
311
315
  constructor(e) {
312
316
  this._fuzzyKeyRange = e, this._map = /* @__PURE__ */ new Map(), o.requireArgument(e, "_fuzzyKeyRange", "number");
313
317
  }
@@ -333,8 +337,8 @@ class He {
333
337
  this._map.clear();
334
338
  }
335
339
  }
336
- const Me = ["fetch", "xmlhttprequest"];
337
- class Be {
340
+ const Be = ["fetch", "xmlhttprequest"];
341
+ class Fe {
338
342
  constructor(e, t, r, i, s) {
339
343
  if (this._instr = e, this._skipUrls = r, this._logPerformanceActivityName = i, this._boundObserverCallback = this._logPerformanceEntries.bind(this), this._boundNavigationTimingEventCallback = (n) => {
340
344
  this._logNavigationEntries(n);
@@ -350,7 +354,7 @@ class Be {
350
354
  this._logLevel = 0;
351
355
  else
352
356
  throw new Error(`Invalid log level: ${s}`);
353
- this._fuzzyMapper = new He(t);
357
+ this._fuzzyMapper = new Me(t);
354
358
  }
355
359
  get isStarted() {
356
360
  return this._isStarted;
@@ -404,7 +408,7 @@ class Be {
404
408
  }
405
409
  _shouldInclude(e) {
406
410
  var t;
407
- return ((t = this._skipUrls) === null || t === void 0 ? void 0 : t.some((i) => i instanceof RegExp ? i.test(e.name) : e.name === i)) ? !1 : this._logLevel === 1 ? !0 : Me.indexOf(e.initiatorType) >= 0 || e.entryType === "navigation";
411
+ return ((t = this._skipUrls) === null || t === void 0 ? void 0 : t.some((i) => i instanceof RegExp ? i.test(e.name) : e.name === i)) ? !1 : this._logLevel === 1 ? !0 : Be.indexOf(e.initiatorType) >= 0 || e.entryType === "navigation";
408
412
  }
409
413
  _calculateXhrDelay(e, t) {
410
414
  if (t) {
@@ -450,7 +454,7 @@ class Be {
450
454
  unloadEventEnd: r.unloadEventEnd,
451
455
  logEvent: e.type
452
456
  };
453
- this._logActivity(qe, Object.assign(i, s));
457
+ this._logActivity(He, Object.assign(i, s));
454
458
  }
455
459
  break;
456
460
  }
@@ -463,12 +467,12 @@ class Be {
463
467
  Object.assign(s, {
464
468
  srvReqId: i == null ? void 0 : i.requestId,
465
469
  xhrDelay: this._calculateXhrDelay(r, i)
466
- }), s.responseStatus === void 0 && (s.responseStatus = i == null ? void 0 : i.responseStatus), this._logActivity(De, s, i == null ? void 0 : i.activityId, i == null ? void 0 : i.errorCount);
470
+ }), s.responseStatus === void 0 && (s.responseStatus = i == null ? void 0 : i.responseStatus), this._logActivity(qe, s, i == null ? void 0 : i.activityId, i == null ? void 0 : i.errorCount);
467
471
  }
468
472
  }
469
473
  }
470
474
  }
471
- const Fe = 32, Ue = 16, J = 16, je = "traceparent", Xe = "b3", ae = "X-B3-TraceId", de = "X-B3-SpanId", le = "X-B3-Sampled", ue = "X-B3-ParentSpanId", Z = "X-SFDC-Request-Id", ze = "baggage", Ve = "fetch", $e = "xhr_send", Ge = "perf-timing", Ke = 50, Ye = [
475
+ const je = 32, Ue = 16, J = 16, Xe = "traceparent", Ve = "b3", ae = "X-B3-TraceId", de = "X-B3-SpanId", le = "X-B3-Sampled", ue = "X-B3-ParentSpanId", Z = "X-SFDC-Request-Id", ze = "baggage", $e = "fetch", Ge = "xhr_send", Ke = "perf-timing", Ye = 50, We = [
472
476
  ze,
473
477
  ae,
474
478
  de,
@@ -502,7 +506,7 @@ class d {
502
506
  return;
503
507
  }
504
508
  Object.entries(e).forEach(([t]) => {
505
- Ye.includes(t) || delete e[t];
509
+ We.includes(t) || delete e[t];
506
510
  }), d._userHeaders = e;
507
511
  }
508
512
  static getHeaders(e, t, r, i) {
@@ -510,15 +514,15 @@ class d {
510
514
  const s = i == null ? void 0 : i.useB3Headers, n = {};
511
515
  if (e === void 0)
512
516
  return n;
513
- e = this._conformTextAsId(e, (i == null ? void 0 : i.traceIdEffectiveLength) !== void 0 ? i.traceIdEffectiveLength : s ? Ue : Fe), t = this._conformTextAsId(t, J);
517
+ e = this._conformTextAsId(e, (i == null ? void 0 : i.traceIdEffectiveLength) !== void 0 ? i.traceIdEffectiveLength : s ? Ue : je), t = this._conformTextAsId(t, J);
514
518
  const a = i && i.parentSpanId !== void 0 && this._conformTextAsId(i.parentSpanId, J) || void 0;
515
- return s ? (i == null ? void 0 : i.useCompactHeader) ? n[Xe] = this._getB3CompactFormat(e, t, r, a) : (n[ae] = e, n[de] = t, a !== void 0 && (n[ue] = a), r !== void 0 && (n[le] = r ? "1" : "0")) : n[je] = this._getW3CompactFormat(e, t, r), n;
519
+ return s ? (i == null ? void 0 : i.useCompactHeader) ? n[Ve] = this._getB3CompactFormat(e, t, r, a) : (n[ae] = e, n[de] = t, a !== void 0 && (n[ue] = a), r !== void 0 && (n[le] = r ? "1" : "0")) : n[Xe] = this._getW3CompactFormat(e, t, r), n;
516
520
  }
517
521
  _disableNetworkInstrumentation() {
518
522
  d._isNetworkInstrumentationEnabled && (d._originalFetch && (d._global.fetch = d._originalFetch, d._originalFetch = void 0), d._originalXhr && (d._global.XMLHttpRequest = d._originalXhr, d._originalXhr = void 0), d._originalXhrOpen && (d._global.XMLHttpRequest.prototype.open = d._originalXhrOpen, d._originalXhrOpen = void 0), d._originalXhrSetRequestHeader && (d._global.XMLHttpRequest.prototype.setRequestHeader = d._originalXhrSetRequestHeader, d._originalXhrSetRequestHeader = void 0), d._originalXhrSend && (d._global.XMLHttpRequest.prototype.send = d._originalXhrSend, d._originalXhrSend = void 0), d._performanceObservability && (d._performanceObservability.stop(), d._performanceObservability = void 0), d._isNetworkInstrumentationEnabled = !1);
519
523
  }
520
- _enableNetworkInstrumentation(e, t, r, i, s, n, a, u, h, f) {
521
- typeof d._global.fetch == "function" && (this._overrideFetch(e, t, r, i, s, n, h), d._isNetworkInstrumentationEnabled = !0), typeof d._global.XMLHttpRequest == "function" && (this._overrideXhr(e, t, r, i, s, n, h), d._isNetworkInstrumentationEnabled = !0), a && (d._performanceObservability = new Be(e, f, h, u, a === !0 ? "full" : a), d._performanceObservability.start(), d._isNetworkInstrumentationEnabled = !0);
524
+ _enableNetworkInstrumentation(e, t, r, i, s, n, a, u, h, p) {
525
+ typeof d._global.fetch == "function" && (this._overrideFetch(e, t, r, i, s, n, h), d._isNetworkInstrumentationEnabled = !0), typeof d._global.XMLHttpRequest == "function" && (this._overrideXhr(e, t, r, i, s, n, h), d._isNetworkInstrumentationEnabled = !0), a && (d._performanceObservability = new Fe(e, p, h, u, a === !0 ? "full" : a), d._performanceObservability.start(), d._isNetworkInstrumentationEnabled = !0);
522
526
  }
523
527
  static _getTraceHeaders(e, t, r, i, s) {
524
528
  let n;
@@ -560,14 +564,14 @@ class d {
560
564
  }
561
565
  _overrideFetch(e, t, r, i, s, n, a) {
562
566
  d._originalFetch = d._global.fetch;
563
- const u = (h, f, ..._) => B(this, null, function* () {
567
+ const u = (h, p, ..._) => B(this, null, function* () {
564
568
  var m;
565
- let c, p, g, C, $, H = !1, R;
569
+ let c, f, g, C, $, H = !1, R;
566
570
  try {
567
- n == null || n.add(), C = f == null ? void 0 : f.method;
568
- const y = f == null ? void 0 : f.o11y, M = y == null ? void 0 : y.skipInstr;
571
+ n == null || n.add(), C = p == null ? void 0 : p.method;
572
+ const y = p == null ? void 0 : p.o11y, M = y == null ? void 0 : y.skipInstr;
569
573
  if (H = M || d._shouldSkipUrl(a, h), !H)
570
- c = e.startActivity(r || Ve);
574
+ c = e.startActivity(r || $e);
571
575
  else if (M) {
572
576
  d._reqIndex += 1;
573
577
  try {
@@ -580,22 +584,22 @@ class d {
580
584
  } catch (b) {
581
585
  }
582
586
  }
583
- if (f == null || delete f.o11y, p = h == null ? void 0 : h.toString(), g = o.tryGetAbsoluteUrl(p), i) {
584
- h instanceof Request && (C || (C = h.method), p = h.url, g = o.tryGetAbsoluteUrl(p));
587
+ if (p == null || delete p.o11y, f = h == null ? void 0 : h.toString(), g = o.tryGetAbsoluteUrl(f), i) {
588
+ h instanceof Request && (C || (C = h.method), f = h.url, g = o.tryGetAbsoluteUrl(f));
585
589
  const b = d._getTraceHeaders(c, e, s, C, g);
586
- !this._applyTraceHeaders(h, f, b) && f === void 0 && (f = {
590
+ !this._applyTraceHeaders(h, p, b) && p === void 0 && (p = {
587
591
  headers: b
588
592
  });
589
593
  }
590
- return $ = o.perfNow(), R = yield d._originalFetch.call(d._global, h, f, ..._), R;
594
+ return $ = o.perfNow(), R = yield d._originalFetch.call(d._global, h, p, ..._), R;
591
595
  } catch (y) {
592
596
  throw t && !H && (c ? c.error(y) : e.error(y)), y;
593
597
  } finally {
594
598
  try {
595
- const y = d._endActivity(c, p, C);
599
+ const y = d._endActivity(c, f, C);
596
600
  if (!((m = d._performanceObservability) === null || m === void 0) && m.isStarted) {
597
601
  const b = {
598
- requestId: d._extractHeader(Z, h, f),
602
+ requestId: d._extractHeader(Z, h, p),
599
603
  activityDuration: y,
600
604
  activityId: c == null ? void 0 : c.getId(),
601
605
  errorCount: c == null ? void 0 : c.getErrorCount(),
@@ -620,61 +624,61 @@ class d {
620
624
  }
621
625
  _overrideXhr(e, t, r, i, s, n, a) {
622
626
  d._originalXhr = d._global.XMLHttpRequest, d._originalXhrOpen = d._originalXhr.prototype.open, d._originalXhrSetRequestHeader = d._originalXhr.prototype.setRequestHeader, d._originalXhrSend = d._originalXhr.prototype.send;
623
- function u(f, _) {
627
+ function u(p, _) {
624
628
  var m;
625
- const c = I.get(f);
629
+ const c = I.get(p);
626
630
  if (c) {
627
- const p = c.activity, g = d._endActivity(p, c.url, c.method);
631
+ const f = c.activity, g = d._endActivity(f, c.url, c.method);
628
632
  !_ && (!((m = d._performanceObservability) === null || m === void 0) && m.isStarted) && d._performanceObservability.addEntry(c.absoluteUrl, c.sendTime, {
629
633
  requestId: c.requestId,
630
634
  activityDuration: g,
631
- activityId: p == null ? void 0 : p.getId(),
632
- errorCount: p == null ? void 0 : p.getErrorCount(),
633
- responseStatus: f.status
635
+ activityId: f == null ? void 0 : f.getId(),
636
+ errorCount: f == null ? void 0 : f.getErrorCount(),
637
+ responseStatus: p.status
634
638
  });
635
639
  }
636
640
  }
637
- d._originalXhr.prototype.open = function(f, _, m, c, p) {
641
+ d._originalXhr.prototype.open = function(p, _, m, c, f) {
638
642
  const g = {
639
- method: f,
643
+ method: p,
640
644
  url: _ == null ? void 0 : _.toString()
641
645
  };
642
646
  I.set(this, g), g.absoluteUrl = o.tryGetAbsoluteUrl(g.url), g.suspendInstrumentation = d._shouldSkipUrl(a, g.absoluteUrl), d._originalXhrOpen.apply(this, arguments);
643
- }, d._originalXhr.prototype.setRequestHeader = function(f, _) {
647
+ }, d._originalXhr.prototype.setRequestHeader = function(p, _) {
644
648
  var m;
645
- if (((m = f == null ? void 0 : f.toLowerCase) === null || m === void 0 ? void 0 : m.call(f)) === Z.toLowerCase()) {
649
+ if (((m = p == null ? void 0 : p.toLowerCase) === null || m === void 0 ? void 0 : m.call(p)) === Z.toLowerCase()) {
646
650
  const c = I.get(this);
647
651
  c && (c.requestId = _);
648
652
  }
649
653
  d._originalXhrSetRequestHeader.apply(this, arguments);
650
- }, d._originalXhr.prototype.send = function(...f) {
654
+ }, d._originalXhr.prototype.send = function(...p) {
651
655
  let _;
652
656
  const m = this;
653
657
  let c = I.get(m);
654
658
  c || (c = {}, I.set(m, c));
655
659
  try {
656
- if (n == null || n.add(), c.suspendInstrumentation || (c.activity = _ = e.startActivity(r || $e)), i) {
657
- const p = d._getTraceHeaders(_, e, s, c.method, c.absoluteUrl);
658
- Object.entries(p).forEach((g) => {
660
+ if (n == null || n.add(), c.suspendInstrumentation || (c.activity = _ = e.startActivity(r || Ge)), i) {
661
+ const f = d._getTraceHeaders(_, e, s, c.method, c.absoluteUrl);
662
+ Object.entries(f).forEach((g) => {
659
663
  m.setRequestHeader(g[0], g[1]);
660
664
  });
661
665
  }
662
- c.sendTime = o.perfNow(), d._originalXhrSend.call(this, ...f);
663
- } catch (p) {
664
- throw t && !(c != null && c.suspendInstrumentation) && (_ ? _.error(p) : e.error(p)), u(m, !0), n == null || n.done(), p;
666
+ c.sendTime = o.perfNow(), d._originalXhrSend.call(this, ...p);
667
+ } catch (f) {
668
+ throw t && !(c != null && c.suspendInstrumentation) && (_ ? _.error(f) : e.error(f)), u(m, !0), n == null || n.done(), f;
665
669
  }
666
670
  };
667
671
  const h = new Proxy(d._originalXhr, {
668
- construct(f) {
669
- const _ = new f();
672
+ construct(p) {
673
+ const _ = new p();
670
674
  return _.addEventListener("load", () => {
671
675
  u(_), n == null || n.done();
672
676
  }), _.addEventListener("error", (m) => {
673
677
  const c = I.get(_) || {};
674
678
  try {
675
679
  if (t && !(c != null && c.suspendInstrumentation)) {
676
- const p = new Error("XHR Network-Level Error"), g = c == null ? void 0 : c.activity;
677
- g ? g.error(p) : e.error(p);
680
+ const f = new Error("XHR Network-Level Error"), g = c == null ? void 0 : c.activity;
681
+ g ? g.error(f) : e.error(f);
678
682
  }
679
683
  u(_);
680
684
  } finally {
@@ -694,7 +698,7 @@ class d {
694
698
  if (o.requireArgument(e, "options", ["boolean", "object"]), this._disableNetworkInstrumentation(), e) {
695
699
  const r = typeof e == "object" ? e : {};
696
700
  let i;
697
- o.definedValueOrDefault(r.useTasker, !0) && (i = (t = this._idleDetector) === null || t === void 0 ? void 0 : t.declareNotifierTaskMulti("o11y network")), this._enableNetworkInstrumentation(o.definedValueOrDefault(r.instrumentation, this._instr), o.definedValueOrDefault(r.logErrors, !0), r.activityName, o.definedValueOrDefault(r.useTracing, !0), r.tracingHeadersOptions, i, o.definedValueOrDefault(r.logPerformance, !0), o.definedValueOrDefault(r.logPerformanceActivityName, Ge), o.definedValueOrDefault(r.skipUrls, []), o.definedValueOrDefault(r.fuzzyMapRange, Ke));
701
+ o.definedValueOrDefault(r.useTasker, !0) && (i = (t = this._idleDetector) === null || t === void 0 ? void 0 : t.declareNotifierTaskMulti("o11y network")), this._enableNetworkInstrumentation(o.definedValueOrDefault(r.instrumentation, this._instr), o.definedValueOrDefault(r.logErrors, !0), r.activityName, o.definedValueOrDefault(r.useTracing, !0), r.tracingHeadersOptions, i, o.definedValueOrDefault(r.logPerformance, !0), o.definedValueOrDefault(r.logPerformanceActivityName, Ke), o.definedValueOrDefault(r.skipUrls, []), o.definedValueOrDefault(r.fuzzyMapRange, Ye));
698
702
  }
699
703
  }
700
704
  resetRequestCounter() {
@@ -735,16 +739,16 @@ var v;
735
739
  (function(l) {
736
740
  l[l.none = 0] = "none", l[l.start = 1] = "start", l[l.stop = 2] = "stop", l[l.both = 3] = "both";
737
741
  })(v || (v = {}));
738
- const We = "timedout", Qe = "terminated", V = "discarded", T = {
739
- timedout: We,
740
- terminated: Qe,
741
- discarded: V
742
+ const Qe = "timedout", Je = "terminated", z = "discarded", T = {
743
+ timedout: Qe,
744
+ terminated: Je,
745
+ discarded: z
742
746
  };
743
747
  class w {
744
- constructor(e, t, r, i, s, n, a, u, h, f, _) {
748
+ constructor(e, t, r, i, s, n, a, u, h, p, _) {
745
749
  var m, c;
746
- this._name = e, this._rootId = t, this._onStopped = r, this._onError = i, this._isSampled = a, this._noRerooting = h, this._isExternal = f, this._parentActivity = _, this._isRoot = !1, this._errorCount = 0, this._timerOverridden = v.none;
747
- const { tsNow: p, perfNow: g } = o.time();
750
+ this._name = e, this._rootId = t, this._onStopped = r, this._onError = i, this._isSampled = a, this._noRerooting = h, this._isExternal = p, this._parentActivity = _, this._isRoot = !1, this._errorCount = 0, this._timerOverridden = v.none;
751
+ const { tsNow: f, perfNow: g } = o.time();
748
752
  if (w._count += 1, this._id = n || o.generateUniqueId(), this._usePerf = typeof performance != "undefined" && typeof performance.mark == "function" && typeof performance.measure == "function", this._usePerf) {
749
753
  this._perfName = `${this._name}__${w._count}`, this._perfId = `${this._name}__${this.id}`;
750
754
  try {
@@ -753,7 +757,7 @@ class w {
753
757
  this._usePerf = !1;
754
758
  }
755
759
  }
756
- this._startTimestamp = p, this._startPerfTime = g, this._overrideTimer(u), s > 0 && (this._timer = setTimeout(() => {
760
+ this._startTimestamp = f, this._startPerfTime = g, this._overrideTimer(u), s > 0 && (this._timer = setTimeout(() => {
757
761
  this._stopReason = this._stopReason || T.timedout, this.stop();
758
762
  }, s)), this._safety = new oe(), this._externalParentActivity = !((m = this._parentActivity) === null || m === void 0) && m.isExternal() ? this._parentActivity : (c = this._parentActivity) === null || c === void 0 ? void 0 : c.getExternalParentActivity();
759
763
  }
@@ -872,10 +876,10 @@ class w {
872
876
  }
873
877
  }
874
878
  w._count = 0;
875
- const Je = new Array(16).fill(0).join("");
876
- class Ze {
879
+ const Ze = new Array(16).fill(0).join("");
880
+ class et {
877
881
  getId() {
878
- return Je;
882
+ return Ze;
879
883
  }
880
884
  getRootId() {
881
885
  }
@@ -910,8 +914,8 @@ class Ze {
910
914
  getExternalParentActivity() {
911
915
  }
912
916
  }
913
- const et = Object.freeze(new Ze());
914
- class tt {
917
+ const tt = Object.freeze(new et());
918
+ class rt {
915
919
  getInstrumentedEventData(e, t, r, i) {
916
920
  var s;
917
921
  const n = {
@@ -964,7 +968,7 @@ class tt {
964
968
  };
965
969
  }
966
970
  }
967
- const rt = new tt(), F = rt;
971
+ const it = new rt(), F = it;
968
972
  class ce {
969
973
  constructor(e, t, r, i, s, n, a, u) {
970
974
  this._name = e, this._ownerName = t, this._ownerAppName = r, this._tags = i, this._buckets = s, this._values = new Array(), this._createdOn = n === void 0 ? o.time().tsNow : n, a !== void 0 && (this._lastUpdatedOn = a), u !== void 0 && (this._values = u);
@@ -1049,7 +1053,7 @@ class he {
1049
1053
  return this._tags;
1050
1054
  }
1051
1055
  }
1052
- class U {
1056
+ class j {
1053
1057
  constructor(e) {
1054
1058
  if (this._map = /* @__PURE__ */ new Map(), typeof e == "number" && e > 0) {
1055
1059
  this._maxSize = Math.ceil(e);
@@ -1081,9 +1085,9 @@ var E;
1081
1085
  (function(l) {
1082
1086
  l[l.Counter = 0] = "Counter", l[l.Percentile = 1] = "Percentile", l[l.BucketHistogram = 2] = "BucketHistogram";
1083
1087
  })(E || (E = {}));
1084
- class fe {
1088
+ class pe {
1085
1089
  constructor(e, t) {
1086
- this._ownerName = e, this._getOwnerAppName = t, this._upCounters = new U(ee), this._valueRecorders = new U(te), this._bucketHistograms = new U(re);
1090
+ this._ownerName = e, this._getOwnerAppName = t, this._upCounters = new j(ee), this._valueRecorders = new j(te), this._bucketHistograms = new j(re);
1087
1091
  }
1088
1092
  incrementCounter(e, t, r = !1, i = {}) {
1089
1093
  this._tagError(i, r), this._upCounter(e, i).increment(t);
@@ -1135,14 +1139,14 @@ class fe {
1135
1139
  };
1136
1140
  }
1137
1141
  }
1138
- class it {
1142
+ class st {
1139
1143
  constructor() {
1140
1144
  this.isMock = !0;
1141
1145
  }
1142
1146
  }
1143
- const st = void 0, O = ["`"], pe = {
1147
+ const nt = void 0, O = ["`"], fe = {
1144
1148
  internalError: "o11y-error"
1145
- }, j = Object.freeze(Array.from(Object.values(pe))), X = /* @__PURE__ */ new WeakMap();
1149
+ }, U = Object.freeze(Array.from(Object.values(fe))), X = /* @__PURE__ */ new WeakMap();
1146
1150
  class P {
1147
1151
  constructor(e, t) {
1148
1152
  this._nextGen = e, this._name = t, this._onActivityStoppedCallback = this._handleActivityStop.bind(this), this._onActivityErrorCallback = this._handleActivityError.bind(this);
@@ -1156,15 +1160,15 @@ class P {
1156
1160
  this._simpleTextMaxLength = r ? r["(meta.max_length)"] : Se;
1157
1161
  }
1158
1162
  _initMetrics() {
1159
- return new fe(this.name, () => this._nextGen.appName || P.defaultAppName);
1163
+ return new pe(this.name, () => this._nextGen.appName || P.defaultAppName);
1160
1164
  }
1161
1165
  _incrementError(e = 1) {
1162
- this._metrics.incrementCounter(pe.internalError, e, !0);
1166
+ this._metrics.incrementCounter(fe.internalError, e, !0);
1163
1167
  }
1164
1168
  get name() {
1165
1169
  return this._name;
1166
1170
  }
1167
- [Te](e, t, r) {
1171
+ [Oe](e, t, r) {
1168
1172
  const i = this[e];
1169
1173
  if (typeof i == "function") {
1170
1174
  X.set(this, r);
@@ -1196,6 +1200,11 @@ class P {
1196
1200
  s != null && s.payload && this._logInternal(this.name, s.schema, s.payload, i, this._getEffectiveRootId(r));
1197
1201
  }, { op: "log" });
1198
1202
  }
1203
+ logPdpEvent(e, t) {
1204
+ this._safety.tryCatch(() => {
1205
+ o.requireArgument(e, "pdpEventData", "object"), this.log(Te, e, t);
1206
+ }, { op: "logPdpEvent" });
1207
+ }
1199
1208
  _logInternal(e, t, r, i, s) {
1200
1209
  const n = X.get(this), a = this._nextGen.addLog(e, t, r, i, s, n);
1201
1210
  if (!o.isProduction) {
@@ -1222,8 +1231,8 @@ class P {
1222
1231
  if (e instanceof Error)
1223
1232
  a = e;
1224
1233
  else {
1225
- let f;
1226
- e == null || typeof e.toString != "function" ? f = "UNKNOWN" : f = e.toString(), a = new Error(f);
1234
+ let p;
1235
+ e == null || typeof e.toString != "function" ? p = "UNKNOWN" : p = e.toString(), a = new Error(p);
1227
1236
  }
1228
1237
  const u = this._wrapUserPayload(t, r, !0), h = {
1229
1238
  name: a.name,
@@ -1247,8 +1256,8 @@ class P {
1247
1256
  isRootActivityExternalSampled: t.instrumentationContext.isRootActivityExternalSampled
1248
1257
  }) : s = this._nextGen.getDefaultInstrumentationContext();
1249
1258
  const u = t != null && t.isExternal ? s.isRootActivityExternalSampled : s.isRootActivitySampled;
1250
- return new w(e, s.rootId, this._onActivityStoppedCallback, this._onActivityErrorCallback, st, t == null ? void 0 : t.id, u, t == null ? void 0 : t.perfStartOverride, n, t == null ? void 0 : t.isExternal, i);
1251
- }, et, { op: "startActivity" });
1259
+ return new w(e, s.rootId, this._onActivityStoppedCallback, this._onActivityErrorCallback, nt, t == null ? void 0 : t.id, u, t == null ? void 0 : t.perfStartOverride, n, t == null ? void 0 : t.isExternal, i);
1260
+ }, tt, { op: "startActivity" });
1252
1261
  }
1253
1262
  getRootActivityHistoryEntryByTime(e) {
1254
1263
  let t;
@@ -1275,7 +1284,7 @@ class P {
1275
1284
  };
1276
1285
  }
1277
1286
  _handleActivityStop(e) {
1278
- if (e.stopReason === V)
1287
+ if (e.stopReason === z)
1279
1288
  return;
1280
1289
  if (!e.isRoot && !e.noRerooting) {
1281
1290
  const r = this._nextGen.getRootActivityHistoryEntryByTime(e.startPerfTime);
@@ -1294,15 +1303,15 @@ class P {
1294
1303
  this._safety.tryCatch(() => {
1295
1304
  var n;
1296
1305
  const a = o.time().tsNow;
1297
- o.requireArgument(e, "event", [Event, it]), o.requireArgument(t, "handledBy", [HTMLElement, "object"]);
1306
+ o.requireArgument(e, "event", [Event, st]), o.requireArgument(t, "handledBy", [HTMLElement, "object"]);
1298
1307
  let u;
1299
1308
  t instanceof HTMLElement ? u = t : (t = t, ((n = t.template) === null || n === void 0 ? void 0 : n.host) instanceof HTMLElement ? u = t.template.host : o.requireArgument(void 0, "handledBy"));
1300
- const h = this._wrapUserPayload(r, i, !0), f = this._getEffectiveRootId(s);
1309
+ const h = this._wrapUserPayload(r, i, !0), p = this._getEffectiveRootId(s);
1301
1310
  if (e.type === "click") {
1302
1311
  const _ = e, m = this._nextGen.getClickTracker();
1303
1312
  m && m.markEventHandled(_);
1304
- const c = s == null ? void 0 : s.captureMouseData, p = F.getInstrumentedEventData(c ? 1 : 0, c ? F.getMouseEventData(_) : F.getEventData(_), u, h);
1305
- p.auto = s == null ? void 0 : s._auto, this._logInternal(this.name, we, p, a, f);
1313
+ const c = s == null ? void 0 : s.captureMouseData, f = F.getInstrumentedEventData(c ? 1 : 0, c ? F.getMouseEventData(_) : F.getEventData(_), u, h);
1314
+ f.auto = s == null ? void 0 : s._auto, this._logInternal(this.name, we, f, a, p);
1306
1315
  } else
1307
1316
  throw new Error(o.notImplemented);
1308
1317
  }, { op: "domEvent" });
@@ -1324,17 +1333,17 @@ class P {
1324
1333
  }
1325
1334
  incrementCounter(e, t = 1, r = !1, i = {}) {
1326
1335
  this._safety.tryCatch(() => {
1327
- o.requireArgument(e, "operation", "string"), o.checkForDenyListedValues(e, "operation", j), o.checkForReservedCharacters(e, "operation", O), o.requireArgument(t, "increment", "number"), o.requireArgument(r, "hasError", "boolean"), o.requireArgument(i, "tags", "object"), this._metrics.incrementCounter(e, t, r, this._siftTags(i));
1336
+ o.requireArgument(e, "operation", "string"), o.checkForDenyListedValues(e, "operation", U), o.checkForReservedCharacters(e, "operation", O), o.requireArgument(t, "increment", "number"), o.requireArgument(r, "hasError", "boolean"), o.requireArgument(i, "tags", "object"), this._metrics.incrementCounter(e, t, r, this._siftTags(i));
1328
1337
  }, { op: "incrementCounter" });
1329
1338
  }
1330
1339
  trackValue(e, t, r = !1, i = {}) {
1331
1340
  this._safety.tryCatch(() => {
1332
- o.requireArgument(e, "operation", "string"), o.checkForDenyListedValues(e, "operation", j), o.checkForReservedCharacters(e, "operation", O), o.requireArgument(t, "value", "number"), o.requireArgument(r, "hasError", "boolean"), o.requireArgument(i, "tags", "object"), this._metrics.trackValue(e, t, r, this._siftTags(i));
1341
+ o.requireArgument(e, "operation", "string"), o.checkForDenyListedValues(e, "operation", U), o.checkForReservedCharacters(e, "operation", O), o.requireArgument(t, "value", "number"), o.requireArgument(r, "hasError", "boolean"), o.requireArgument(i, "tags", "object"), this._metrics.trackValue(e, t, r, this._siftTags(i));
1333
1342
  }, { op: "trackValue" });
1334
1343
  }
1335
1344
  bucketValue(e, t, r = [], i = !1, s = {}) {
1336
1345
  this._safety.tryCatch(() => {
1337
- o.requireArgument(e, "operation", "string"), o.checkForDenyListedValues(e, "operation", j), o.checkForReservedCharacters(e, "operation", O), o.requireArgument(t, "value", "number"), o.requireArgument(r, "buckets", Array), Object.entries(r).forEach(([n, a]) => {
1346
+ o.requireArgument(e, "operation", "string"), o.checkForDenyListedValues(e, "operation", U), o.checkForReservedCharacters(e, "operation", O), o.requireArgument(t, "value", "number"), o.requireArgument(r, "buckets", Array), Object.entries(r).forEach(([n, a]) => {
1338
1347
  o.requireArgument(a, `Bucket value for '${n}'`, "number");
1339
1348
  }), o.requireArgument(i, "hasError", "boolean"), o.requireArgument(s, "tags", "object"), this._metrics.bucketValue(e, t, r, i, this._siftTags(s));
1340
1349
  }, { op: "bucketValue" });
@@ -1361,8 +1370,8 @@ class P {
1361
1370
  const u = this._getAsaOptions(r), h = this.startActivity(e, u);
1362
1371
  try {
1363
1372
  return t(h);
1364
- } catch (f) {
1365
- throw h.error(f, (i = r == null ? void 0 : r.errorPayload) === null || i === void 0 ? void 0 : i.schema, (s = r == null ? void 0 : r.errorPayload) === null || s === void 0 ? void 0 : s.payload), f;
1373
+ } catch (p) {
1374
+ throw h.error(p, (i = r == null ? void 0 : r.errorPayload) === null || i === void 0 ? void 0 : i.schema, (s = r == null ? void 0 : r.errorPayload) === null || s === void 0 ? void 0 : s.payload), p;
1366
1375
  } finally {
1367
1376
  h.stop((n = r == null ? void 0 : r.stopPayload) === null || n === void 0 ? void 0 : n.schema, (a = r == null ? void 0 : r.stopPayload) === null || a === void 0 ? void 0 : a.payload, r == null ? void 0 : r.stopOptions);
1368
1377
  }
@@ -1373,8 +1382,8 @@ class P {
1373
1382
  const u = this._getAsaOptions(r), h = this.startActivity(e, u);
1374
1383
  try {
1375
1384
  return yield t(h);
1376
- } catch (f) {
1377
- throw h.error(f, (i = r == null ? void 0 : r.errorPayload) === null || i === void 0 ? void 0 : i.schema, (s = r == null ? void 0 : r.errorPayload) === null || s === void 0 ? void 0 : s.payload), f;
1385
+ } catch (p) {
1386
+ throw h.error(p, (i = r == null ? void 0 : r.errorPayload) === null || i === void 0 ? void 0 : i.schema, (s = r == null ? void 0 : r.errorPayload) === null || s === void 0 ? void 0 : s.payload), p;
1378
1387
  } finally {
1379
1388
  h.stop((n = r == null ? void 0 : r.stopPayload) === null || n === void 0 ? void 0 : n.schema, (a = r == null ? void 0 : r.stopPayload) === null || a === void 0 ? void 0 : a.payload, r == null ? void 0 : r.stopOptions);
1380
1389
  }
@@ -1385,15 +1394,15 @@ class P {
1385
1394
  }
1386
1395
  }
1387
1396
  P.defaultAppName = "APP_NOT_REGISTERED";
1388
- const nt = 0.1, ot = 20;
1389
- class at {
1397
+ const ot = 0.1, at = 20;
1398
+ class dt {
1390
1399
  constructor(e) {
1391
1400
  if (this._historyMap = /* @__PURE__ */ new Map(), this._historyList = new Array(), o.requireArgumentIfDefined(e, "limit", "number")) {
1392
1401
  if (e = Math.ceil(e), e <= 0)
1393
1402
  throw new Error("Limit must be a positive number");
1394
1403
  } else
1395
- e = ot;
1396
- this._graceCount = Math.max(1, Math.floor(e * nt)), this._realLimit = 1 + e + this._graceCount;
1404
+ e = at;
1405
+ this._graceCount = Math.max(1, Math.floor(e * ot)), this._realLimit = 1 + e + this._graceCount;
1397
1406
  }
1398
1407
  add(e) {
1399
1408
  if (this._historyMap.has(e.id))
@@ -1415,7 +1424,7 @@ class at {
1415
1424
  return t;
1416
1425
  }
1417
1426
  }
1418
- class dt extends w {
1427
+ class lt extends w {
1419
1428
  constructor(e, t, r, i, s, n, a, u) {
1420
1429
  super(e, void 0, t, r, void 0, i || o.generateUniqueId(a != null ? a : 32), s, n), this._isRoot = !0, this._isExternalSampled = u;
1421
1430
  }
@@ -1437,10 +1446,10 @@ class dt extends w {
1437
1446
  return r.isRoot = !0, r.preRootId = this.preRootId, r;
1438
1447
  }
1439
1448
  }
1440
- const lt = new Array(32).fill(0).join("");
1441
- class ut {
1449
+ const ut = new Array(32).fill(0).join("");
1450
+ class ct {
1442
1451
  getId() {
1443
- return lt;
1452
+ return ut;
1444
1453
  }
1445
1454
  getRootId() {
1446
1455
  }
@@ -1475,16 +1484,16 @@ class ut {
1475
1484
  getExternalParentActivity() {
1476
1485
  }
1477
1486
  }
1478
- const ct = Object.freeze(new ut());
1479
- class ht extends P {
1487
+ const ht = Object.freeze(new ct());
1488
+ class pt extends P {
1480
1489
  constructor(e, t, r) {
1481
- super(e, t), this._allowMulti = r, this._rootActivityHistory = new at(), this._onRootActivityStoppedCallback = this._handleRootActivityStop.bind(this);
1490
+ super(e, t), this._allowMulti = r, this._rootActivityHistory = new dt(), this._onRootActivityStoppedCallback = this._handleRootActivityStop.bind(this);
1482
1491
  }
1483
1492
  startRootActivity(e, t, r, i, s) {
1484
1493
  return this._safety.tryCatchReturn(() => {
1485
1494
  if (o.requireArgument(e, "name"), (i == null ? void 0 : i.id) !== void 0)
1486
1495
  throw new Error("Cannot specify id for root activity, use rootId argument instead");
1487
- const n = new dt(e, this._onRootActivityStoppedCallback, this._onActivityErrorCallback, t, r, i == null ? void 0 : i.perfStartOverride, this._nextGen.preferredRootIdLength, s);
1496
+ const n = new lt(e, this._onRootActivityStoppedCallback, this._onActivityErrorCallback, t, r, i == null ? void 0 : i.perfStartOverride, this._nextGen.preferredRootIdLength, s);
1488
1497
  if (!this._allowMulti) {
1489
1498
  const a = {
1490
1499
  id: n.getId(),
@@ -1499,11 +1508,11 @@ class ht extends P {
1499
1508
  this._singleRootActivity = n;
1500
1509
  }
1501
1510
  return n;
1502
- }, ct, { op: "startRootActivity" });
1511
+ }, ht, { op: "startRootActivity" });
1503
1512
  }
1504
1513
  _handleRootActivityStop(e) {
1505
1514
  const t = this._rootActivityHistory.findById(e.id);
1506
- if (t && (t.stopPerfTime = e.stopPerfTime, t.startPerfTime = e.startPerfTime), e.stopReason === V)
1515
+ if (t && (t.stopPerfTime = e.stopPerfTime, t.startPerfTime = e.startPerfTime), e.stopReason === z)
1507
1516
  return;
1508
1517
  const r = this._getActivityData(e);
1509
1518
  this._logActivity(r, e.startTimestamp), this._singleRootActivity = void 0;
@@ -1525,14 +1534,14 @@ class ht extends P {
1525
1534
  return (t = (e = this._singleRootActivity) === null || e === void 0 ? void 0 : e.isExternalSampled) !== null && t !== void 0 ? t : !1;
1526
1535
  }
1527
1536
  _initMetrics() {
1528
- return new fe(this.name, () => this.name);
1537
+ return new pe(this.name, () => this.name);
1529
1538
  }
1530
1539
  getRootActivityHistoryEntry(e) {
1531
1540
  return this._rootActivityHistory.findByTime(e);
1532
1541
  }
1533
1542
  }
1534
1543
  const ft = 5;
1535
- class pt {
1544
+ class mt {
1536
1545
  constructor(e, t) {
1537
1546
  this._instr = e, this._doc = t, this._isActive = !1, this._boundClickListener = this._clickListener.bind(this), o.requireArgument(e, "_instr"), o.requireArgument(t, "_doc");
1538
1547
  }
@@ -1572,18 +1581,18 @@ class pt {
1572
1581
  }
1573
1582
  }
1574
1583
  const me = "o11y:receiver";
1575
- var z;
1584
+ var V;
1576
1585
  (function(l) {
1577
1586
  l[l.Unknown = 0] = "Unknown", l[l.Opening = 1] = "Opening";
1578
- })(z || (z = {}));
1579
- class mt {
1587
+ })(V || (V = {}));
1588
+ class _t {
1580
1589
  constructor(e, t, r) {
1581
1590
  this._logCallback = e, this._metricsCallback = t, this._commErrorCallback = r, this._senders = /* @__PURE__ */ new Map(), o.requireArgument(this._logCallback, "_logCallback", "function"), o.requireArgument(this._metricsCallback, "_metricsCallback", "function"), o.requireArgument(this._commErrorCallback, "_commErrorCallback", "function");
1582
1591
  }
1583
1592
  openComms(e) {
1584
1593
  if (o.requireArgument(e, "sender", "object"), !this._senders.has(e)) {
1585
1594
  const t = new MessageChannel(), r = {
1586
- state: z.Opening,
1595
+ state: V.Opening,
1587
1596
  port: t.port1
1588
1597
  };
1589
1598
  this._senders.set(e, r), r.port.onmessage = this._messagePortEventHandler.bind(this), r.port.onmessageerror = this._messagePortErrorHandler.bind(this), e.postMessage({
@@ -1604,7 +1613,7 @@ class mt {
1604
1613
  }
1605
1614
  }
1606
1615
  const _e = "handshake", ge = "log", ve = "metrics";
1607
- class _t {
1616
+ class gt {
1608
1617
  constructor(e, t) {
1609
1618
  this._self = e, this._allowedOrigins = t, this._messageEventHandlerFunc = this._messageEventHandler.bind(this), this._handshakeComplete = !1, this._logBuffer = [], this._metricsBuffer = [], o.requireArgument(this._self, "_self", "object"), o.requireArgumentIfDefined(t, "allowedOrigins", Array), this._self.addEventListener("message", this._messageEventHandlerFunc);
1610
1619
  }
@@ -1627,7 +1636,7 @@ class _t {
1627
1636
  this._logBuffer.forEach((e) => this.sendLog(e)), this._metricsBuffer.forEach((e) => this.sendMetrics(e)), this._logBuffer = void 0, this._metricsBuffer = void 0;
1628
1637
  }
1629
1638
  }
1630
- class gt {
1639
+ class vt {
1631
1640
  constructor() {
1632
1641
  this._upCounters = [], this._valueRecorders = [], this._bucketHistograms = [];
1633
1642
  }
@@ -1645,13 +1654,13 @@ class gt {
1645
1654
  return this._bucketHistograms = this._bucketHistograms.filter((e) => e.getLastUpdatedOn() !== void 0), this._bucketHistograms;
1646
1655
  }
1647
1656
  }
1648
- function vt(l) {
1657
+ function yt(l) {
1649
1658
  return !!l && typeof l == "object" && "envelopeContents" in l && "error" in l;
1650
1659
  }
1651
- const yt = 1e3;
1652
- class bt {
1660
+ const bt = 1e3;
1661
+ class Ct {
1653
1662
  constructor(e, t) {
1654
- this._connector = e, this._pollInterval = yt, o.requireArgument(e, "_connector", "object"), o.requireArgumentIfDefined(t, "_pollInterval", "number") && t > 0 && (this._pollInterval = t);
1663
+ this._connector = e, this._pollInterval = bt, o.requireArgument(e, "_connector", "object"), o.requireArgumentIfDefined(t, "_pollInterval", "number") && t > 0 && (this._pollInterval = t);
1655
1664
  }
1656
1665
  collect(e, t, r) {
1657
1666
  const i = {
@@ -1673,7 +1682,7 @@ class bt {
1673
1682
  (e.upCounters.length || e.valueRecorders.length || e.bucketHistograms.length) && this._connector.sendMetrics(e);
1674
1683
  }
1675
1684
  }
1676
- const ye = 80, Ct = 32, be = "_CUT", It = ye - be.length;
1685
+ const ye = 80, It = 32, be = "_CUT", At = ye - be.length;
1677
1686
  function N() {
1678
1687
  }
1679
1688
  class q {
@@ -1701,10 +1710,10 @@ class q {
1701
1710
  throw new Error("An app has already been registered with instrumentation.");
1702
1711
  if (this._instruments.get(e))
1703
1712
  throw new Error(`The instrumentation name ${e} is already taken`);
1704
- if (x.setOwnerAppName(e), this._initOpMode(t == null ? void 0 : t.operationMode), this._isSender = this._opMode === "sender", this._isReceiver = this._opMode === "receiver", (t == null ? void 0 : t.decimalPoints) !== void 0 && (this._decimalPoints = t.decimalPoints), this._preferredRootIdLength = (r = t == null ? void 0 : t.preferredRootIdLength) !== null && r !== void 0 ? r : Ct, this._clientSessionId = ((i = t == null ? void 0 : t.clientSessionId) === null || i === void 0 ? void 0 : i.toString()) || o.generateUniqueId(), this._appInstr = new ht(this, e, t == null ? void 0 : t.allowMultipleRootActivities), this._instruments.set(e, this._appInstr), this._isSender) {
1705
- const a = new bt(new _t(window, t == null ? void 0 : t.allowedReceiverOrigins), t == null ? void 0 : t.senderMetricsPollingInterval);
1713
+ if (x.setOwnerAppName(e), this._initOpMode(t == null ? void 0 : t.operationMode), this._isSender = this._opMode === "sender", this._isReceiver = this._opMode === "receiver", (t == null ? void 0 : t.decimalPoints) !== void 0 && (this._decimalPoints = t.decimalPoints), this._preferredRootIdLength = (r = t == null ? void 0 : t.preferredRootIdLength) !== null && r !== void 0 ? r : It, this._clientSessionId = ((i = t == null ? void 0 : t.clientSessionId) === null || i === void 0 ? void 0 : i.toString()) || o.generateUniqueId(), this._appInstr = new pt(this, e, t == null ? void 0 : t.allowMultipleRootActivities), this._instruments.set(e, this._appInstr), this._isSender) {
1714
+ const a = new Ct(new gt(window, t == null ? void 0 : t.allowedReceiverOrigins), t == null ? void 0 : t.senderMetricsPollingInterval);
1706
1715
  this.registerLogCollector(a), this.registerMetricsCollector(a);
1707
- } else this._isReceiver && (this._metricsStore = new gt(), this._receiverConnector = new mt((a) => {
1716
+ } else this._isReceiver && (this._metricsStore = new vt(), this._receiverConnector = new _t((a) => {
1708
1717
  a.logMeta.receiverClientSessionId = this._clientSessionId, a.logMeta.receiverRootId = this._appInstr.getSingleRootActivityId(), this._multiplex(a.schema, a.data, a.logMeta);
1709
1718
  }, (a) => {
1710
1719
  this._metricsStore.add(a);
@@ -1715,6 +1724,7 @@ class q {
1715
1724
  const n = new d(this.getInstrumentation("Network"), this._idleDetector);
1716
1725
  return {
1717
1726
  log: this._appInstr.log.bind(this._appInstr),
1727
+ logPdpEvent: this._appInstr.logPdpEvent.bind(this._appInstr),
1718
1728
  error: this._appInstr.error.bind(this._appInstr),
1719
1729
  startActivity: this._appInstr.startActivity.bind(this._appInstr),
1720
1730
  domEvent: this._appInstr.domEvent.bind(this._appInstr),
@@ -1740,7 +1750,7 @@ class q {
1740
1750
  };
1741
1751
  }
1742
1752
  getInstrumentation(e) {
1743
- o.requireArgument(e, "name", "string"), e.length > ye && (e = e.substring(0, It) + be);
1753
+ o.requireArgument(e, "name", "string"), e.length > ye && (e = e.substring(0, At) + be);
1744
1754
  let t = this._instruments.get(e);
1745
1755
  if (!t)
1746
1756
  t = new P(this, e), this._instruments.set(e, t);
@@ -1759,10 +1769,10 @@ class q {
1759
1769
  addLog(e, t, r, i, s, n) {
1760
1770
  var a, u, h;
1761
1771
  L.checkInputs(t, r), this._sequence += 1;
1762
- const f = A.isInternal(t), _ = f && (r != null && r.userPayload) ? r.userPayload.schema : t, m = A.getSchemaId(_);
1772
+ const p = A.isInternal(t), _ = p && (r != null && r.userPayload) ? r.userPayload.schema : t, m = A.getSchemaId(_);
1763
1773
  let c = this._seqBySchema.get(m) || 0;
1764
1774
  c += 1, this._seqBySchema.set(m, c);
1765
- const p = {
1775
+ const f = {
1766
1776
  timestamp: i,
1767
1777
  rootId: s,
1768
1778
  sequence: this._sequence,
@@ -1778,17 +1788,17 @@ class q {
1778
1788
  }, g = {
1779
1789
  schema: t,
1780
1790
  data: r,
1781
- logMeta: p
1791
+ logMeta: f
1782
1792
  };
1783
- if (p.pagePayload = L.getPayloadFromProvider(this.pagePayloadProvider, g), p.appPayload = L.getPayloadFromProvider(this.appPayloadProvider, g), this._isSender || (r = o.clone(r)), typeof this._decimalPoints == "number" && (o.roundNumbersInObject(r, this._decimalPoints), f && o.roundNumbersInObject((a = r.userPayload) === null || a === void 0 ? void 0 : a.payload, this._decimalPoints), o.roundNumbersInObject((u = p.pagePayload) === null || u === void 0 ? void 0 : u.payload, this._decimalPoints), o.roundNumbersInObject((h = p.appPayload) === null || h === void 0 ? void 0 : h.payload, this._decimalPoints)), this._isBufferingEnabled) {
1793
+ if (f.pagePayload = L.getPayloadFromProvider(this.pagePayloadProvider, g), f.appPayload = L.getPayloadFromProvider(this.appPayloadProvider, g), this._isSender || (r = o.clone(r)), typeof this._decimalPoints == "number" && (o.roundNumbersInObject(r, this._decimalPoints), p && o.roundNumbersInObject((a = r.userPayload) === null || a === void 0 ? void 0 : a.payload, this._decimalPoints), o.roundNumbersInObject((u = f.pagePayload) === null || u === void 0 ? void 0 : u.payload, this._decimalPoints), o.roundNumbersInObject((h = f.appPayload) === null || h === void 0 ? void 0 : h.payload, this._decimalPoints)), this._isBufferingEnabled) {
1784
1794
  const C = {
1785
1795
  schema: t,
1786
1796
  data: r,
1787
- logMeta: p
1797
+ logMeta: f
1788
1798
  };
1789
1799
  this._buffer.push(C);
1790
1800
  }
1791
- return this._multiplex(t, r, p), this._sequence;
1801
+ return this._multiplex(t, r, f), this._sequence;
1792
1802
  }
1793
1803
  _multiplex(e, t, r) {
1794
1804
  const i = Array.from(this._logCollectors).filter((s) => {
@@ -1806,7 +1816,7 @@ class q {
1806
1816
  _collect(e, t, r, i) {
1807
1817
  const s = e.collect(t, r, i);
1808
1818
  return !s || typeof s.then != "function" ? "sync" : (Promise.resolve(s).then(() => this._recordCollectorSuccess(e), (n) => {
1809
- vt(n) ? this._recordCollectorSuccess(e) : this._recordCollectorFailure(e, n);
1819
+ yt(n) ? this._recordCollectorSuccess(e) : this._recordCollectorFailure(e, n);
1810
1820
  }), "async");
1811
1821
  }
1812
1822
  _recordCollectorSuccess(e) {
@@ -1835,7 +1845,7 @@ class q {
1835
1845
  };
1836
1846
  }
1837
1847
  activateClickTracker() {
1838
- typeof document != "undefined" && (this._autoClickTracker || (this._autoClickTracker = new pt(this._appInstr, document)), this._autoClickTracker.activate());
1848
+ typeof document != "undefined" && (this._autoClickTracker || (this._autoClickTracker = new mt(this._appInstr, document)), this._autoClickTracker.activate());
1839
1849
  }
1840
1850
  deactivateClickTracker() {
1841
1851
  this._autoClickTracker && (this._autoClickTracker.deactivate(), this._autoClickTracker = void 0);
@@ -1892,7 +1902,7 @@ class q {
1892
1902
  }
1893
1903
  }
1894
1904
  q._collectorFailureLimit = 5;
1895
- class At {
1905
+ class St {
1896
1906
  get _lazyNextGen() {
1897
1907
  return this._nextgen || (this._nextgen = new q(this._idleDetector)), this._nextgen;
1898
1908
  }
@@ -1907,18 +1917,18 @@ class At {
1907
1917
  return this._lazyNextGen.getInstrumentation(e);
1908
1918
  }
1909
1919
  }
1910
- const Tt = o.time.bind(o), St = "sfcore.customCmp.CustomComponentLog", Et = {
1920
+ const Ot = o.time.bind(o), Et = "sfcore.customCmp.CustomComponentLog", kt = {
1911
1921
  Error: "Crimson",
1912
1922
  Activity: "CadetBlue",
1913
1923
  InstrumentedEvent: "DarkOliveGreen",
1914
1924
  O11ySample: "BlueViolet"
1915
- }, kt = {
1925
+ }, wt = {
1916
1926
  Error: "white",
1917
1927
  Activity: "white",
1918
1928
  InstrumentedEvent: "white",
1919
1929
  O11ySample: "white"
1920
1930
  }, ie = "black", se = "Gainsboro";
1921
- class Ot {
1931
+ class Nt {
1922
1932
  constructor(e) {
1923
1933
  this._simpleFilters = /* @__PURE__ */ new Set(), this._regexFilters = [], e && this._log("ConsoleCollector", e);
1924
1934
  }
@@ -1926,12 +1936,12 @@ class Ot {
1926
1936
  const i = A.getSchemaId(e);
1927
1937
  if (!this._shouldLog(i))
1928
1938
  return;
1929
- if (i === St) {
1939
+ if (i === Et) {
1930
1940
  this._logCustom(t);
1931
1941
  return;
1932
1942
  }
1933
1943
  let s, n, a;
1934
- A.isInternal(e) ? (s = e.name, n = kt[e.name] || ie, a = Et[e.name] || se) : s = i, this._log(s, t, r, n, a);
1944
+ A.isInternal(e) ? (s = e.name, n = wt[e.name] || ie, a = kt[e.name] || se) : s = i, this._log(s, t, r, n, a);
1935
1945
  }
1936
1946
  _shouldLog(e) {
1937
1947
  return this._simpleFilters.size == 0 && this._regexFilters.length == 0 ? !0 : this._simpleFilters.has(e) || this._regexFilters.some((t) => t.test(e));
@@ -1960,7 +1970,7 @@ class Ot {
1960
1970
  console.log("%clightning/logger", "color:white;background-color:#00a1e0;font-weight:bold", e || "");
1961
1971
  }
1962
1972
  }
1963
- const Nt = "260.0.0", wt = new Le({
1973
+ const Lt = "260.0.0", Rt = new De({
1964
1974
  logThreshold: 300,
1965
1975
  reportListener: (l) => {
1966
1976
  S == null || S.log(ke, l);
@@ -1968,12 +1978,12 @@ const Nt = "260.0.0", wt = new Le({
1968
1978
  errorListener: (l, e) => {
1969
1979
  S == null || S.error(l, e);
1970
1980
  }
1971
- }), D = new At(wt), Lt = D.registerInstrumentedApp.bind(D), Rt = D.getInstrumentation.bind(D), S = Rt("IdleDetector");
1981
+ }), D = new St(Rt), Dt = D.registerInstrumentedApp.bind(D), Pt = D.getInstrumentation.bind(D), S = Pt("IdleDetector");
1972
1982
  export {
1973
- Ot as ConsoleCollector,
1974
- Nt as _version,
1975
- Rt as getInstrumentation,
1976
- wt as idleDetector,
1977
- Lt as registerInstrumentedApp,
1978
- Tt as time
1983
+ Nt as ConsoleCollector,
1984
+ Lt as _version,
1985
+ Pt as getInstrumentation,
1986
+ Rt as idleDetector,
1987
+ Dt as registerInstrumentedApp,
1988
+ Ot as time
1979
1989
  };