@utk09/ui-observability 0.9.1 → 0.9.3

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +75 -64
  3. package/dist/batch-D5qvsMQ_.cjs +2 -0
  4. package/dist/batch-D5qvsMQ_.cjs.map +1 -0
  5. package/dist/{batch-DEK4bv9N.js → batch-DDgxg16_.js} +7 -4
  6. package/dist/batch-DDgxg16_.js.map +1 -0
  7. package/dist/bus/bus.d.ts +0 -4
  8. package/dist/{bus-HVQ8E72V.js → bus-C6RwKzPW.js} +63 -66
  9. package/dist/bus-C6RwKzPW.js.map +1 -0
  10. package/dist/bus-WPVDFw2y.cjs +2 -0
  11. package/dist/bus-WPVDFw2y.cjs.map +1 -0
  12. package/dist/capture/network.d.ts +2 -0
  13. package/dist/capture/storm.d.ts +2 -7
  14. package/dist/capture/types.d.ts +3 -0
  15. package/dist/{console-DssDxq1B.cjs → console-BSusX_M-.cjs} +2 -2
  16. package/dist/{console-DssDxq1B.cjs.map → console-BSusX_M-.cjs.map} +1 -1
  17. package/dist/{console-C9Y639mn.js → console-Dv5GfaNn.js} +3 -3
  18. package/dist/{console-C9Y639mn.js.map → console-Dv5GfaNn.js.map} +1 -1
  19. package/dist/constants-Cb92egPS.cjs +2 -0
  20. package/dist/constants-Cb92egPS.cjs.map +1 -0
  21. package/dist/{constants-N99w84xy.js → constants-DhH6VI5a.js} +39 -12
  22. package/dist/constants-DhH6VI5a.js.map +1 -0
  23. package/dist/constants.d.ts +28 -3
  24. package/dist/core/breadcrumbs.d.ts +1 -3
  25. package/dist/core/context.d.ts +0 -8
  26. package/dist/core/diagnostics.d.ts +1 -3
  27. package/dist/core/meter.d.ts +45 -0
  28. package/dist/core/pipeline.d.ts +5 -12
  29. package/dist/core/record.d.ts +7 -0
  30. package/dist/core/runtime.d.ts +17 -0
  31. package/dist/core/sampling.d.ts +3 -3
  32. package/dist/core/sender.d.ts +2 -0
  33. package/dist/deadline-CUrH0Hd8.cjs +2 -0
  34. package/dist/deadline-CUrH0Hd8.cjs.map +1 -0
  35. package/dist/deadline-DeqXEliN.js +31 -0
  36. package/dist/deadline-DeqXEliN.js.map +1 -0
  37. package/dist/{errors-CQusIGWJ.js → errors-DCZWcHkd.js} +4 -4
  38. package/dist/{errors-CQusIGWJ.js.map → errors-DCZWcHkd.js.map} +1 -1
  39. package/dist/{errors-BTWuVnHZ.cjs → errors-ERu-su8m.cjs} +3 -3
  40. package/dist/{errors-BTWuVnHZ.cjs.map → errors-ERu-su8m.cjs.map} +1 -1
  41. package/dist/fixed-window-BR0bu32Y.cjs +2 -0
  42. package/dist/fixed-window-BR0bu32Y.cjs.map +1 -0
  43. package/dist/fixed-window-Re7jIRJH.js +9 -0
  44. package/dist/fixed-window-Re7jIRJH.js.map +1 -0
  45. package/dist/{identity-B1GDS1Tb.cjs → identity-C1WLItSl.cjs} +2 -2
  46. package/dist/{identity-B1GDS1Tb.cjs.map → identity-C1WLItSl.cjs.map} +1 -1
  47. package/dist/{identity-D4DPjTM9.js → identity-Di-QXGCC.js} +2 -2
  48. package/dist/{identity-D4DPjTM9.js.map → identity-Di-QXGCC.js.map} +1 -1
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.ts +18 -0
  52. package/dist/index.js +522 -369
  53. package/dist/index.js.map +1 -1
  54. package/dist/indexeddb-storage-DX18p39D.cjs +2 -0
  55. package/dist/indexeddb-storage-DX18p39D.cjs.map +1 -0
  56. package/dist/{indexeddb-storage-B8SGUzSV.js → indexeddb-storage-T9YIYVYC.js} +48 -59
  57. package/dist/indexeddb-storage-T9YIYVYC.js.map +1 -0
  58. package/dist/{interactions-CnjfQgw3.js → interactions-BLH_tX87.js} +2 -2
  59. package/dist/{interactions-CnjfQgw3.js.map → interactions-BLH_tX87.js.map} +1 -1
  60. package/dist/{interactions-CcxrVzpg.cjs → interactions-_hfOerfC.cjs} +2 -2
  61. package/dist/{interactions-CcxrVzpg.cjs.map → interactions-_hfOerfC.cjs.map} +1 -1
  62. package/dist/journey-BRUj0hqD.cjs +2 -0
  63. package/dist/journey-BRUj0hqD.cjs.map +1 -0
  64. package/dist/{journey-DjvDzHyp.js → journey-yALMEWF7.js} +39 -38
  65. package/dist/journey-yALMEWF7.js.map +1 -0
  66. package/dist/library-request-BcAxuwsf.cjs +2 -0
  67. package/dist/library-request-BcAxuwsf.cjs.map +1 -0
  68. package/dist/library-request-CQD4HUiP.js +25 -0
  69. package/dist/library-request-CQD4HUiP.js.map +1 -0
  70. package/dist/{long-frames-BGik_Yhy.cjs → long-frames-D4Bm3Zkz.cjs} +2 -2
  71. package/dist/{long-frames-BGik_Yhy.cjs.map → long-frames-D4Bm3Zkz.cjs.map} +1 -1
  72. package/dist/{long-frames-CZk3XOkH.js → long-frames-DD_Um9_4.js} +3 -3
  73. package/dist/{long-frames-CZk3XOkH.js.map → long-frames-DD_Um9_4.js.map} +1 -1
  74. package/dist/models/batch.d.ts +6 -0
  75. package/dist/models/config.d.ts +23 -0
  76. package/dist/models/metric.d.ts +50 -0
  77. package/dist/network--GoE7_Or.js +211 -0
  78. package/dist/network--GoE7_Or.js.map +1 -0
  79. package/dist/network-DcuS2H1P.cjs +2 -0
  80. package/dist/network-DcuS2H1P.cjs.map +1 -0
  81. package/dist/openfin-BwEN0uj4.js +8 -0
  82. package/dist/openfin-BwEN0uj4.js.map +1 -0
  83. package/dist/openfin-DtH2f7zX.cjs +2 -0
  84. package/dist/openfin-DtH2f7zX.cjs.map +1 -0
  85. package/dist/platform-GaM6h7XM.js +52 -0
  86. package/dist/platform-GaM6h7XM.js.map +1 -0
  87. package/dist/platform-kIL5AZB7.cjs +2 -0
  88. package/dist/platform-kIL5AZB7.cjs.map +1 -0
  89. package/dist/{remote-rules-M-XZ1xbe.js → remote-rules-6ePq8CrI.js} +23 -25
  90. package/dist/remote-rules-6ePq8CrI.js.map +1 -0
  91. package/dist/remote-rules-CI3gbRCL.cjs +2 -0
  92. package/dist/remote-rules-CI3gbRCL.cjs.map +1 -0
  93. package/dist/sampling-C-M8p3FK.cjs +2 -0
  94. package/dist/sampling-C-M8p3FK.cjs.map +1 -0
  95. package/dist/sampling-Ud_WiuU9.js +65 -0
  96. package/dist/sampling-Ud_WiuU9.js.map +1 -0
  97. package/dist/{sanitize-DKp5MRsa.cjs → sanitize--_e4oOPX.cjs} +2 -2
  98. package/dist/{sanitize-DKp5MRsa.cjs.map → sanitize--_e4oOPX.cjs.map} +1 -1
  99. package/dist/{sanitize-Dwj9JCkI.js → sanitize-DP0xDPrt.js} +2 -2
  100. package/dist/{sanitize-Dwj9JCkI.js.map → sanitize-DP0xDPrt.js.map} +1 -1
  101. package/dist/sender-BESHz6my.cjs +3 -0
  102. package/dist/sender-BESHz6my.cjs.map +1 -0
  103. package/dist/{sender-BBY0IcUo.js → sender-BUBWLn5i.js} +425 -290
  104. package/dist/sender-BUBWLn5i.js.map +1 -0
  105. package/dist/storage/gap.d.ts +20 -0
  106. package/dist/storage/indexeddb-storage.d.ts +1 -7
  107. package/dist/storage/keys.d.ts +9 -0
  108. package/dist/storage/local-storage.d.ts +0 -6
  109. package/dist/storage/memory-storage.d.ts +1 -1
  110. package/dist/storm-DhHGHhOc.cjs +2 -0
  111. package/dist/storm-DhHGHhOc.cjs.map +1 -0
  112. package/dist/storm-OD5J6Ylm.js +10 -0
  113. package/dist/storm-OD5J6Ylm.js.map +1 -0
  114. package/dist/transport/custom-transport.d.ts +3 -2
  115. package/dist/transport/exit-flush.d.ts +13 -2
  116. package/dist/transport/http-transport.d.ts +6 -4
  117. package/dist/transport/retry-engine.d.ts +3 -1
  118. package/dist/transport/serializers/otlp-metrics.d.ts +3 -0
  119. package/dist/transport/serializers/otlp.d.ts +30 -0
  120. package/dist/transport/serializers/select.d.ts +20 -4
  121. package/dist/transport/status-transport.d.ts +19 -11
  122. package/dist/utils/fixed-window.d.ts +15 -0
  123. package/dist/utils/guards.d.ts +6 -0
  124. package/dist/utils/library-request.d.ts +12 -0
  125. package/dist/utils/openfin.d.ts +48 -0
  126. package/dist/utils/platform.d.ts +5 -0
  127. package/package.json +2 -3
  128. package/dist/batch-DEK4bv9N.js.map +0 -1
  129. package/dist/batch-DEVFs28i.cjs +0 -2
  130. package/dist/batch-DEVFs28i.cjs.map +0 -1
  131. package/dist/bus-DNFvTkif.cjs +0 -2
  132. package/dist/bus-DNFvTkif.cjs.map +0 -1
  133. package/dist/bus-HVQ8E72V.js.map +0 -1
  134. package/dist/constants-N99w84xy.js.map +0 -1
  135. package/dist/constants-X86IDwkC.cjs +0 -2
  136. package/dist/constants-X86IDwkC.cjs.map +0 -1
  137. package/dist/deadline-5_PecIl5.js +0 -26
  138. package/dist/deadline-5_PecIl5.js.map +0 -1
  139. package/dist/deadline-XSnm95pg.cjs +0 -2
  140. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  141. package/dist/indexeddb-storage-B8SGUzSV.js.map +0 -1
  142. package/dist/indexeddb-storage-ukzC82dm.cjs +0 -2
  143. package/dist/indexeddb-storage-ukzC82dm.cjs.map +0 -1
  144. package/dist/journey-DjvDzHyp.js.map +0 -1
  145. package/dist/journey-DxlfdFJV.cjs +0 -2
  146. package/dist/journey-DxlfdFJV.cjs.map +0 -1
  147. package/dist/library-request-BZ1ekVtl.cjs +0 -2
  148. package/dist/library-request-BZ1ekVtl.cjs.map +0 -1
  149. package/dist/library-request-C8kc5YWv.js +0 -14
  150. package/dist/library-request-C8kc5YWv.js.map +0 -1
  151. package/dist/network-51iicpLl.js +0 -174
  152. package/dist/network-51iicpLl.js.map +0 -1
  153. package/dist/network-jBbjyAJP.cjs +0 -2
  154. package/dist/network-jBbjyAJP.cjs.map +0 -1
  155. package/dist/platform-Cjts-8k8.js +0 -48
  156. package/dist/platform-Cjts-8k8.js.map +0 -1
  157. package/dist/platform-DW3GFIUE.cjs +0 -2
  158. package/dist/platform-DW3GFIUE.cjs.map +0 -1
  159. package/dist/remote-rules-ByS34k4e.cjs +0 -2
  160. package/dist/remote-rules-ByS34k4e.cjs.map +0 -1
  161. package/dist/remote-rules-M-XZ1xbe.js.map +0 -1
  162. package/dist/sampling-BN3Oi6SV.js +0 -63
  163. package/dist/sampling-BN3Oi6SV.js.map +0 -1
  164. package/dist/sampling-b2ck5X98.cjs +0 -2
  165. package/dist/sampling-b2ck5X98.cjs.map +0 -1
  166. package/dist/sender-BBY0IcUo.js.map +0 -1
  167. package/dist/sender-BXoAZKum.cjs +0 -3
  168. package/dist/sender-BXoAZKum.cjs.map +0 -1
  169. package/dist/storm-CKuaBp7i.cjs +0 -2
  170. package/dist/storm-CKuaBp7i.cjs.map +0 -1
  171. package/dist/storm-DhtL2eVr.js +0 -10
  172. package/dist/storm-DhtL2eVr.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,54 +1,55 @@
1
- import { A as e, Bt as t, E as n, Et as r, F as i, Ft as a, Ht as o, I as s, It as c, Jt as l, Lt as u, Mt as d, Nt as f, O as p, P as m, Pt as h, R as g, Rt as _, Ut as ee, Vt as te, Xt as v, _n as ne, a as y, c as re, ct as ie, d as b, dn as ae, dt as oe, en as x, f as se, fn as S, gn as ce, i as le, jt as ue, k as de, l as fe, lt as C, mn as pe, n as me, o as he, p as ge, pn as _e, qt as ve, r as ye, rn as be, s as w, u as T, un as xe, vn as E, x as Se, zt as Ce } from "./constants-N99w84xy.js";
2
- import { n as we, r as Te, t as Ee } from "./error-like-Ywo5uRHo.js";
3
- import { a as D, i as De, n as Oe, o as ke, r as Ae } from "./sampling-BN3Oi6SV.js";
4
- import { a as je, i as Me, n as Ne, o as O, r as k } from "./sanitize-Dwj9JCkI.js";
5
- import { a as Pe, i as Fe, n as Ie, o as A, r as Le, s as Re, t as ze } from "./identity-D4DPjTM9.js";
6
- import { n as Be, r as Ve, t as He } from "./platform-Cjts-8k8.js";
7
- import { n as j, t as Ue } from "./batch-DEK4bv9N.js";
8
- import { n as We } from "./library-request-C8kc5YWv.js";
9
- import { n as Ge, t as Ke } from "./journey-DjvDzHyp.js";
1
+ import { A as e, At as t, Bt as n, Cn as r, D as i, F as a, Ft as o, Gt as s, Ht as c, I as l, It as u, Kt as d, L as f, Lt as p, Qt as m, Rt as h, S as g, Sn as _, Ut as ee, Vt as te, Wt as ne, Zt as re, _n as ie, _t as ae, a as v, c as y, d as b, en as x, f as oe, ft as se, gn as S, hn as ce, i as le, in as ue, j as de, k as C, l as fe, lt as pe, m as me, mn as he, n as w, o as ge, p as T, qt as _e, r as ve, s as E, sn as ye, u as D, ut as O, vn as be, vt as k, xn as xe, yt as Se, z as Ce, zt as we } from "./constants-DhH6VI5a.js";
2
+ import { n as Te, r as Ee, t as De } from "./error-like-Ywo5uRHo.js";
3
+ import { i as Oe, r as ke } from "./deadline-DeqXEliN.js";
4
+ import { a as Ae, i as je, n as Me, o as Ne, r as Pe } from "./sampling-Ud_WiuU9.js";
5
+ import { a as Fe, i as Ie, n as Le, o as A, r as j } from "./sanitize-DP0xDPrt.js";
6
+ import { a as Re, i as ze, n as Be, o as Ve, r as He, s as Ue, t as We } from "./identity-Di-QXGCC.js";
7
+ import { i as Ge, n as Ke, t as qe } from "./platform-GaM6h7XM.js";
8
+ import { r as M, t as Je } from "./batch-DDgxg16_.js";
9
+ import { r as Ye } from "./library-request-CQD4HUiP.js";
10
+ import { n as Xe, t as Ze } from "./journey-yALMEWF7.js";
10
11
  //#region src/utils/timer.ts
11
- function M(e) {
12
- return Math.round((performance.now() - e) * g) / g;
12
+ function N(e) {
13
+ return Math.round((performance.now() - e) * Ce) / Ce;
13
14
  }
14
- function N(e, t, n, r, i) {
15
+ function P(e, t, n, r, i) {
15
16
  e.logMetric(`${t}.duration`, n, "ms", "histogram", {
16
17
  status: r,
17
18
  ...i
18
19
  });
19
20
  }
20
- function qe(e, t, n, r, i) {
21
- let a = M(n);
21
+ function Qe(e, t, n, r, i) {
22
+ let a = N(n);
22
23
  e.error(`${t} failed`, r, {
23
24
  "action.duration_ms": a,
24
25
  status: "FAILURE",
25
26
  ...i
26
- }), N(e, t, a, "FAILURE", i);
27
+ }), P(e, t, a, "FAILURE", i);
27
28
  }
28
- function Je(e, t, n, r) {
29
+ function $e(e, t, n, r) {
29
30
  let i = performance.now();
30
31
  try {
31
32
  let a = n();
32
- return N(e, t, M(i), "SUCCESS", r), a;
33
+ return P(e, t, N(i), "SUCCESS", r), a;
33
34
  } catch (n) {
34
- throw qe(e, t, i, n, r), n;
35
+ throw Qe(e, t, i, n, r), n;
35
36
  }
36
37
  }
37
- async function Ye(e, t, n, r) {
38
+ async function et(e, t, n, r) {
38
39
  let i = performance.now();
39
40
  try {
40
41
  let a = await n();
41
- return N(e, t, M(i), "SUCCESS", r), a;
42
+ return P(e, t, N(i), "SUCCESS", r), a;
42
43
  } catch (n) {
43
- throw qe(e, t, i, n, r), n;
44
+ throw Qe(e, t, i, n, r), n;
44
45
  }
45
46
  }
46
47
  //#endregion
47
48
  //#region src/core/logger.ts
48
- var Xe = [n, be];
49
- function Ze(e, t) {
49
+ var tt = [i, ye];
50
+ function nt(e, t) {
50
51
  let n = t.guard("record.sanitize_failed", "The library could not read the error reason.", () => {
51
- if (!(e instanceof Error) && !Te(e)) return;
52
+ if (!(e instanceof Error) && !Ee(e)) return;
52
53
  let t = Error(e.message);
53
54
  return t.name = e.name, t.stack = e.stack, t;
54
55
  });
@@ -56,38 +57,38 @@ function Ze(e, t) {
56
57
  let r = t.guard("record.sanitize_failed", "The library could not convert the error reason to text.", () => String(e));
57
58
  return Error(r ?? typeof e);
58
59
  }
59
- function Qe(e, t, n) {
60
+ function rt(e, t, n) {
60
61
  return n.guard("record.sanitize_failed", "The library could not read the error reason.", () => e instanceof Error ? e : t) ?? t;
61
62
  }
62
- function $e(e, t) {
63
+ function it(e, t) {
63
64
  if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e == "symbol") return e;
64
65
  if (typeof e == "object" && e) return t.guard("record.sanitize_failed", "The library could not read the properties of the error reason.", () => {
65
- let t = e, n = Te(e), r = {}, i = 0;
66
+ let t = e, n = Ee(e), r = {}, i = 0;
66
67
  for (let e of Object.keys(t)) {
67
68
  let a = t[e];
68
- (!n || !Ee.has(e)) && we(a) && (r[e] = a, i++);
69
+ (!n || !De.has(e)) && Te(a) && (r[e] = a, i++);
69
70
  }
70
71
  return i === 0 ? void 0 : r;
71
72
  });
72
73
  }
73
- function et(e) {
74
- if (typeof e != "object" || !e || Array.isArray(e) || e instanceof Error) return !1;
74
+ function at(e) {
75
+ if (!Oe(e) || e instanceof Error) return !1;
75
76
  let t = Object.getPrototypeOf(e);
76
77
  return t === null || Object.getPrototypeOf(t) === null;
77
78
  }
78
- function tt(e) {
79
- return Xe.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
79
+ function ot(e) {
80
+ return tt.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
80
81
  }
81
- function P(e, t) {
82
+ function F(e, t) {
82
83
  return e === void 0 ? {} : t.guard("record.sanitize_failed", "The library could not read the payload.", () => ({ ...e })) ?? { "uiobs.sanitize_failed": !0 };
83
84
  }
84
- var F = class e {
85
+ var I = class e {
85
86
  bind;
86
87
  namespace;
87
88
  options;
88
89
  levelType;
89
90
  constructor(e, t, n = {}) {
90
- this.bind = e, this.namespace = t, this.options = n, this.levelType = tt(t);
91
+ this.bind = e, this.namespace = t, this.options = n, this.levelType = ot(t);
91
92
  }
92
93
  child(t, n = {}) {
93
94
  return new e(this.bind, `${this.namespace}.${t}`, { scopedContext: {
@@ -119,22 +120,23 @@ var F = class e {
119
120
  logEvent = (e, t) => {
120
121
  this.write("INFO", "event", e, t);
121
122
  };
122
- logMetric = (e, t, n = i, r = "gauge", a) => {
123
+ logMetric = (e, t, n = l, r = "gauge", i) => {
123
124
  if (!Number.isFinite(t)) {
124
125
  this.bind().diagnostics.report("record.dropped_malformed", "The metric value is not a finite number. The library dropped the metric.", { "metric.name": e });
125
126
  return;
126
127
  }
127
- let o = {
128
- ...P(a, this.bind().diagnostics),
128
+ let a = F(i, this.bind().diagnostics), o = {
129
+ ...a,
129
130
  "metric.name": e,
130
131
  "metric.value": t,
131
132
  "metric.unit": n,
132
- "metric.type": r
133
+ "metric.type": r,
134
+ [k.attributeKeys]: Object.keys(a)
133
135
  };
134
136
  this.write("INFO", "metric", e, o, !0);
135
137
  };
136
- timeSync = (e, t, n) => Je(this, e, t, n);
137
- timeAsync = (e, t, n) => Ye(this, e, t, n);
138
+ timeSync = (e, t, n) => $e(this, e, t, n);
139
+ timeAsync = (e, t, n) => et(this, e, t, n);
138
140
  write(e, t, n, r, i = !1) {
139
141
  let a = this.bind();
140
142
  if (a.isDestroyed()) return;
@@ -148,7 +150,7 @@ var F = class e {
148
150
  body: n,
149
151
  namespace: this.namespace,
150
152
  scoped: this.options.scopedContext,
151
- payload: i ? r : P(r, a.diagnostics)
153
+ payload: i ? r : F(r, a.diagnostics)
152
154
  }), c = o ? o.body : s === "sampling" ? n : void 0;
153
155
  t !== "metric" && c !== void 0 && a.breadcrumbs.push({
154
156
  t: Date.now(),
@@ -161,26 +163,26 @@ var F = class e {
161
163
  if (i.isDestroyed()) return;
162
164
  let a = i.builder.isEnabled(e);
163
165
  if (!a && !this.mirrors(i, e)) return;
164
- let o = r === void 0 && (i.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () => et(n)) ?? !1), s = o ? n : r, c = o ? void 0 : n, l = c === void 0 ? void 0 : Ze(c, i.diagnostics), u = l === void 0 ? void 0 : Qe(c, l, i.diagnostics);
166
+ let o = r === void 0 && (i.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () => at(n)) ?? !1), s = o ? n : r, c = o ? void 0 : n, l = c === void 0 ? void 0 : nt(c, i.diagnostics), u = l === void 0 ? void 0 : rt(c, l, i.diagnostics);
165
167
  if (!a) {
166
168
  this.print(i, e, t, s, u, null);
167
169
  return;
168
170
  }
169
- let d = l ? $e(c, i.diagnostics) : void 0, { record: f, dropped: p } = i.builder.build({
171
+ let d = l ? it(c, i.diagnostics) : void 0, { record: f, dropped: p } = i.builder.build({
170
172
  level: e,
171
173
  type: this.levelType,
172
174
  body: t,
173
175
  namespace: this.namespace,
174
176
  scoped: this.options.scopedContext,
175
177
  payload: {
176
- ...P(s, i.diagnostics),
178
+ ...F(s, i.diagnostics),
177
179
  ...l ? {
178
180
  "error.type": l.name,
179
181
  "error.message": l.message,
180
182
  "error.stack_trace": l.stack
181
183
  } : {},
182
- ...d === void 0 ? {} : { [he]: d },
183
- [y]: i.breadcrumbs.snapshot()
184
+ ...d === void 0 ? {} : { [ge]: d },
185
+ [v]: i.breadcrumbs.snapshot()
184
186
  }
185
187
  });
186
188
  this.print(i, e, t, s, u, f, p), i.emit(f);
@@ -191,73 +193,73 @@ var F = class e {
191
193
  mirrors(e, t) {
192
194
  return e.config.enabled && e.console.accepts(t);
193
195
  }
194
- }, nt = {
196
+ }, st = {
195
197
  TRACE: "debug",
196
198
  DEBUG: "debug",
197
199
  INFO: "info",
198
200
  WARN: "warn",
199
201
  ERROR: "error",
200
202
  FATAL: "error"
201
- }, rt = class {
203
+ }, ct = class {
202
204
  settings;
203
205
  diagnostics;
204
206
  limits;
205
- constructor(e, t, n = r) {
206
- this.settings = e, this.diagnostics = t, this.limits = n;
207
+ constructor(e, n, r = t) {
208
+ this.settings = e, this.diagnostics = n, this.limits = r;
207
209
  }
208
210
  update(e) {
209
211
  this.settings = e;
210
212
  }
211
213
  accepts(e) {
212
- return this.settings.level === null || !Object.hasOwn(C, this.settings.level) ? !1 : C[e] >= C[this.settings.level];
214
+ return this.settings.level === null || !Object.hasOwn(O, this.settings.level) ? !1 : O[e] >= O[this.settings.level];
213
215
  }
214
216
  write(e, t, n, r, i) {
215
- if (!this.accepts(t) || typeof console > "u" || je()) return;
216
- let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = nt[t];
217
+ if (!this.accepts(t) || typeof console > "u" || Fe()) return;
218
+ let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = st[t];
217
219
  this.diagnostics.guard("handler.threw", `The library could not print to console.${s}.`, () => {
218
220
  let c = [];
219
- i !== void 0 && c.push(i), r !== void 0 && c.push(Ne(r, this.limits, this.diagnostics)), O(() => {
221
+ i !== void 0 && c.push(i), r !== void 0 && c.push(Le(r, this.limits, this.diagnostics)), A(() => {
220
222
  console[s](a, o.namespace, e, o[t], "", n, ...c);
221
223
  });
222
224
  });
223
225
  }
224
- }, it = class {
226
+ }, lt = class {
225
227
  value = 0;
226
228
  next() {
227
229
  return ++this.value;
228
230
  }
229
- }, at = /^[0-9a-f]{32}$/, ot = /^[0-9a-f]{16}$/, st = /[1-9a-f]/;
230
- function ct(e) {
231
- return at.test(e.traceId) && st.test(e.traceId) && ot.test(e.spanId) && st.test(e.spanId);
231
+ }, ut = /^[0-9a-f]{32}$/, dt = /^[0-9a-f]{16}$/, ft = /[1-9a-f]/;
232
+ function pt(e) {
233
+ return ut.test(e.traceId) && ft.test(e.traceId) && dt.test(e.spanId) && ft.test(e.spanId);
232
234
  }
233
- function lt() {
234
- return A(16);
235
+ function mt() {
236
+ return Ve(16);
235
237
  }
236
- function ut() {
237
- return A(8);
238
+ function ht() {
239
+ return Ve(8);
238
240
  }
239
- function dt() {
241
+ function gt() {
240
242
  return {
241
- traceId: lt(),
242
- spanId: ut(),
243
+ traceId: mt(),
244
+ spanId: ht(),
243
245
  traceFlags: 1,
244
246
  startedAt: Date.now()
245
247
  };
246
248
  }
247
- function ft(e) {
249
+ function _t(e) {
248
250
  return {
249
251
  traceId: e.traceId,
250
252
  spanId: e.spanId,
251
253
  traceFlags: e.traceFlags
252
254
  };
253
255
  }
254
- var pt = class {
256
+ var vt = class {
255
257
  diagnostics;
256
258
  maxAgeMs;
257
259
  load;
258
- ambient = dt();
260
+ ambient = gt();
259
261
  otel;
260
- constructor(e, t = pe, n) {
262
+ constructor(e, t = be, n) {
261
263
  this.diagnostics = e, this.maxAgeMs = t, this.load = n;
262
264
  }
263
265
  async loadOtel() {
@@ -269,7 +271,7 @@ var pt = class {
269
271
  }
270
272
  resolve() {
271
273
  let e = this.activeSpanContext();
272
- return e === void 0 ? (Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"), ft(this.ambient)) : e;
274
+ return e === void 0 ? (Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"), _t(this.ambient)) : e;
273
275
  }
274
276
  activeSpanContext() {
275
277
  let e = this.otel;
@@ -277,7 +279,7 @@ var pt = class {
277
279
  let t = e.trace.getActiveSpan();
278
280
  if (t === void 0) return;
279
281
  let n = t.spanContext();
280
- if (ct(n)) return {
282
+ if (pt(n)) return {
281
283
  traceId: n.traceId,
282
284
  spanId: n.spanId,
283
285
  traceFlags: n.traceFlags
@@ -285,7 +287,7 @@ var pt = class {
285
287
  });
286
288
  }
287
289
  rotate(e) {
288
- return this.ambient = dt(), ft(this.ambient);
290
+ return this.ambient = gt(), _t(this.ambient);
289
291
  }
290
292
  headers() {
291
293
  let e = {}, t = this.otel;
@@ -293,11 +295,11 @@ var pt = class {
293
295
  t.propagation.inject(t.context.active(), e);
294
296
  }), !e.traceparent) {
295
297
  let t = this.resolve(), n = (t.traceFlags & 255).toString(16).padStart(2, "0");
296
- e[_e] = `00-${t.traceId}-${t.spanId}-${n}`;
298
+ e[ie] = `00-${t.traceId}-${t.spanId}-${n}`;
297
299
  }
298
300
  return e;
299
301
  }
300
- }, mt = class {
302
+ }, yt = class {
301
303
  buffer;
302
304
  pointer = 0;
303
305
  filled = !1;
@@ -311,48 +313,45 @@ var pt = class {
311
313
  snapshot() {
312
314
  return (this.filled ? [...this.buffer.slice(this.pointer), ...this.buffer.slice(0, this.pointer)] : this.buffer.slice(0, this.pointer)).filter((e) => e !== void 0);
313
315
  }
314
- clear() {
315
- this.buffer = Array(this.capacity), this.pointer = 0, this.filled = !1;
316
- }
317
- }, ht = Object.keys(C), gt = ["gzip", "none"], _t = [
316
+ }, bt = Object.keys(O), xt = ["gzip", "none"], St = [
318
317
  "omit",
319
318
  "same-origin",
320
319
  "include"
321
- ], vt = [
320
+ ], Ct = [
322
321
  "auto",
323
322
  "indexeddb",
324
323
  "localstorage",
325
324
  "memory",
326
325
  "none"
327
- ], yt = ["storage", "memory"], bt = [
326
+ ], wt = ["storage", "memory"], Tt = [
328
327
  "auto",
329
328
  "sender",
330
329
  "forwarder",
331
330
  "off"
332
- ], xt = [
331
+ ], Et = [
333
332
  "auto",
334
333
  "provider",
335
334
  "client"
336
- ], St = [
335
+ ], Dt = [
337
336
  "auto",
338
337
  "context",
339
338
  "tab",
340
339
  "origin"
341
- ], Ct = [
340
+ ], Ot = [
342
341
  "error",
343
342
  "warn",
344
343
  "info",
345
344
  "log"
346
- ], wt = ["limited", "until-delivered"], Tt = {
345
+ ], kt = ["limited", "until-delivered"], At = {
347
346
  logFlushIntervalMs: [100, 6e4],
348
347
  logBatchSize: [1, 1e3],
349
348
  metricFlushIntervalMs: [100, 6e4],
350
349
  metricBatchSize: [1, 1e3]
351
- }, Et = {
350
+ }, jt = {
352
351
  maxBatches: [1, 5e3],
353
352
  maxAgeMs: [6e4, 6048e5],
354
353
  maxAttempts: [1, 20]
355
- }, Dt = {
354
+ }, Mt = {
356
355
  maxBodyChars: [256, 65536],
357
356
  maxAttributeChars: [256, 65536],
358
357
  maxAttributeCount: [1, 1024],
@@ -360,138 +359,139 @@ var pt = class {
360
359
  maxDepth: [1, 16],
361
360
  maxArrayLength: [1, 1e4],
362
361
  maxNodes: [100, 1e5],
363
- maxRecordBytes: [1024, Se]
364
- }, Ot = [6e4, 864e5], kt = [
362
+ maxRecordBytes: [1024, g]
363
+ }, Nt = [6e4, 864e5], Pt = [
365
364
  "errors",
366
365
  "rejections",
367
366
  "resourceErrors",
368
367
  "fetch",
369
368
  "xhr",
369
+ "httpMetrics",
370
370
  "interactions",
371
371
  "navigation",
372
372
  "webVitals",
373
373
  "longFrames",
374
374
  "fullUrls"
375
- ], At = "null", I = `a level name: ${R(ht)}`, L = `true, false or a list of ${R(Ct)}`, jt = "a list of strings and RegExp patterns", Mt = "a list of origin URLs such as \"https://api.example\" and RegExp patterns", Nt = "a list of origin URLs such as \"https://app.example\". For a sandboxed frame, set bus.mode: \"sender\" in the frame", Pt = "a list of strings";
375
+ ], Ft = "null", L = `a level name: ${R(bt)}`, It = `true, false or a list of ${R(Ot)}`, Lt = "a list of strings and RegExp patterns", Rt = "a list of origin URLs such as \"https://api.example\" and RegExp patterns", zt = "a list of origin URLs such as \"https://app.example\". For a sandboxed frame, set bus.mode: \"sender\" in the frame", Bt = "a list of strings";
376
376
  function R(e) {
377
377
  let t = e.map((e) => `"${e}"`);
378
378
  return `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
379
379
  }
380
- function z(e) {
380
+ function Vt(e) {
381
381
  return typeof e == "string" ? `"${e}"` : typeof e == "function" ? "a function" : typeof e == "object" && e ? "an object" : String(e);
382
382
  }
383
- function B(e, t, n, r, i) {
384
- e.report("config.invalid", `${t} must be ${n}. The value is ${z(r)}. The library keeps ${i}.`);
383
+ function z(e, t, n, r, i) {
384
+ e.report("config.invalid", `${t} must be ${n}. The value is ${Vt(r)}. The library keeps ${i}.`);
385
385
  }
386
- function V(e, t, n, r, i) {
386
+ function B(e, t, n, r, i) {
387
387
  if (t === void 0) return r;
388
388
  let a = n.find((e) => e === t);
389
- return a === void 0 ? (B(i, e, R(n), t, `"${r}"`), r) : a;
389
+ return a === void 0 ? (z(i, e, R(n), t, `"${r}"`), r) : a;
390
390
  }
391
- function H(e, t, n, r) {
392
- return t === void 0 ? n : typeof t == "boolean" ? t : (B(r, e, "true or false", t, String(n)), n);
391
+ function V(e, t, n, r) {
392
+ return t === void 0 ? n : typeof t == "boolean" ? t : (z(r, e, "true or false", t, String(n)), n);
393
393
  }
394
- function Ft(e, t, n, r) {
395
- return t === void 0 ? n : typeof t == "number" && Number.isFinite(t) && t >= 0 ? t : (B(r, e, "a finite number of 0 or more", t, String(n)), n);
394
+ function Ht(e, t, n, r) {
395
+ return t === void 0 ? n : typeof t == "number" && Number.isFinite(t) && t >= 0 ? t : (z(r, e, "a finite number of 0 or more", t, String(n)), n);
396
396
  }
397
- function It(e, t, n, r, i) {
397
+ function Ut(e, t, n, r, i) {
398
398
  if (t === void 0) return r;
399
399
  let [a, o] = n;
400
- return typeof t == "number" && Number.isInteger(t) && t >= a && t <= o ? t : (B(i, e, `an integer from ${String(a)} to ${String(o)}`, t, String(r)), r);
400
+ return typeof t == "number" && Number.isInteger(t) && t >= a && t <= o ? t : (z(i, e, `an integer from ${String(a)} to ${String(o)}`, t, String(r)), r);
401
401
  }
402
- function U(e, t, n, r, i) {
402
+ function H(e, t, n, r, i) {
403
403
  let a = t ?? {}, o = Object.keys(r);
404
- return Object.fromEntries(o.map((t) => [t, It(`${e}.${t}`, a[t], r[t], n[t], i)]));
404
+ return Object.fromEntries(o.map((t) => [t, Ut(`${e}.${t}`, a[t], r[t], n[t], i)]));
405
405
  }
406
- function W(e) {
406
+ function U(e) {
407
407
  if (typeof e != "string") return;
408
408
  let t = e.toUpperCase();
409
- return ht.find((e) => e === t);
409
+ return bt.find((e) => e === t);
410
410
  }
411
- function Lt(e, t, n, r) {
411
+ function Wt(e, t, n, r) {
412
412
  if (t === void 0) return n;
413
- let i = W(t);
414
- return i === void 0 ? (B(r, e, I, t, `"${n}"`), n) : i;
413
+ let i = U(t);
414
+ return i === void 0 ? (z(r, e, L, t, `"${n}"`), n) : i;
415
415
  }
416
- function G(e, t, n, r, i, a) {
416
+ function W(e, t, n, r, i, a) {
417
417
  if (t === void 0) return n;
418
- if (!Array.isArray(t)) return B(a, e, r, t, "the list in force"), n;
418
+ if (!Array.isArray(t)) return z(a, e, r, t, "the list in force"), n;
419
419
  let o = [], s = t;
420
420
  for (let t of s) {
421
421
  let n = i(t);
422
- n === void 0 ? a.report("config.invalid", `The library ignores the ${e} entry ${z(t)}. ${e} must be ${r}.`) : o.push(n);
422
+ n === void 0 ? a.report("config.invalid", `The library ignores the ${e} entry ${Vt(t)}. ${e} must be ${r}.`) : o.push(n);
423
423
  }
424
424
  return o;
425
425
  }
426
- function Rt(e) {
426
+ function Gt(e) {
427
427
  return typeof e == "string" ? e : void 0;
428
428
  }
429
- function zt(e) {
429
+ function Kt(e) {
430
430
  return typeof e == "string" || e instanceof RegExp ? e : void 0;
431
431
  }
432
- function Bt(e) {
433
- return Ct.find((t) => t === e);
432
+ function qt(e) {
433
+ return Ot.find((t) => t === e);
434
434
  }
435
- function Vt(e) {
435
+ function Jt(e) {
436
436
  if (typeof e == "string") try {
437
437
  let { origin: t } = new URL(e);
438
- return t === At ? void 0 : t;
438
+ return t === Ft ? void 0 : t;
439
439
  } catch {
440
440
  return;
441
441
  }
442
442
  }
443
- function Ht(e) {
444
- return e instanceof RegExp ? e : Vt(e);
443
+ function Yt(e) {
444
+ return e instanceof RegExp ? e : Jt(e);
445
445
  }
446
- function Ut(e) {
447
- return typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.values(e).every((e) => typeof e == "string");
446
+ function Xt(e) {
447
+ return Oe(e) ? Object.values(e).every((e) => typeof e == "string") : !1;
448
448
  }
449
- function Wt(e, t, n) {
450
- if (e !== void 0) return typeof e == "function" || Ut(e) ? e : (B(n, "headers", "an object of strings or a function", e, "the headers in force"), t);
449
+ function Zt(e, t, n) {
450
+ if (e !== void 0) return typeof e == "function" || Xt(e) ? e : (z(n, "headers", "an object of strings or a function", e, "the headers in force"), t);
451
451
  }
452
- function Gt(e) {
452
+ function Qt(e) {
453
453
  return typeof e != "object" || !e ? !1 : typeof Reflect.get(e, "serialize") == "function";
454
454
  }
455
- function Kt(e, t, n) {
456
- return e === void 0 ? t ?? "otlp" : e === "otlp" || e === "ecs" || Gt(e) ? e : (n.report("config.invalid", `serializer must be "${v}", "ecs" or an implementation. The library uses "${v}".`), v);
455
+ function $t(e, t, n) {
456
+ return e === void 0 ? t ?? "otlp" : e === "otlp" || e === "ecs" || Qt(e) ? e : (n.report("config.invalid", `serializer must be "${x}", "ecs" or an implementation. The library uses "${x}".`), x);
457
457
  }
458
- var qt = new Set(Object.keys(e));
459
- function Jt(e, t) {
458
+ var en = new Set(Object.keys(de));
459
+ function tn(e, t) {
460
460
  let n = {}, r = Object.entries(e ?? {});
461
- for (let [e, i] of r) qt.has(e) ? typeof i == "string" ? n[e] = i : t.report("config.invalid", `console.styles.${e} must be a string. The library keeps the style in force.`) : t.report("config.invalid", `The library ignores the unknown console.styles key "${e}". Check the spelling.`);
461
+ for (let [e, i] of r) en.has(e) ? typeof i == "string" ? n[e] = i : t.report("config.invalid", `console.styles.${e} must be a string. The library keeps the style in force.`) : t.report("config.invalid", `The library ignores the unknown console.styles key "${e}". Check the spelling.`);
462
462
  return n;
463
463
  }
464
- function Yt(e, t, n) {
464
+ function nn(e, t, n) {
465
465
  if (e === void 0) return t ?? "DEBUG";
466
- let r = W(e);
467
- return r === void 0 ? (B(n, "console.level", I, e, "the console level in force"), t) : r;
466
+ let r = U(e);
467
+ return r === void 0 ? (z(n, "console.level", L, e, "the console level in force"), t) : r;
468
468
  }
469
- function Xt(e, t, n) {
470
- if (e === void 0) return t;
471
- if (e === !1) return {
469
+ function rn(t, n, r) {
470
+ if (t === void 0) return n;
471
+ if (t === !1) return {
472
472
  level: null,
473
- styles: t.styles
473
+ styles: n.styles
474
474
  };
475
- if (e === !0) return {
476
- level: de,
477
- styles: t.styles
475
+ if (t === !0) return {
476
+ level: e,
477
+ styles: n.styles
478
478
  };
479
- if (typeof e == "string") {
480
- let r = W(e);
481
- return r === void 0 ? (B(n, "console", I, e, "the console level in force"), t) : {
482
- level: r,
483
- styles: t.styles
479
+ if (typeof t == "string") {
480
+ let e = U(t);
481
+ return e === void 0 ? (z(r, "console", L, t, "the console level in force"), n) : {
482
+ level: e,
483
+ styles: n.styles
484
484
  };
485
485
  }
486
- return typeof e != "object" || !e ? (n.report("config.invalid", "console must be a boolean, a level or an object. The console settings in force stay."), t) : {
487
- level: Yt(e.level, t.level, n),
486
+ return typeof t != "object" || !t ? (r.report("config.invalid", "console must be a boolean, a level or an object. The console settings in force stay."), n) : {
487
+ level: nn(t.level, n.level, r),
488
488
  styles: {
489
- ...t.styles,
490
- ...Jt(e.styles, n)
489
+ ...n.styles,
490
+ ...tn(t.styles, r)
491
491
  }
492
492
  };
493
493
  }
494
- function Zt(e, t, n) {
494
+ function an(e, t, n) {
495
495
  let r = e ?? {};
496
496
  return {
497
497
  ...t,
@@ -500,101 +500,113 @@ function Zt(e, t, n) {
500
500
  ...t.rates,
501
501
  ...r.rates
502
502
  },
503
- alwaysSampleTypes: G("sampling.alwaysSampleTypes", r.alwaysSampleTypes, t.alwaysSampleTypes, Pt, Rt, n),
504
- remote: H("sampling.remote", r.remote, t.remote, n)
503
+ alwaysSampleTypes: W("sampling.alwaysSampleTypes", r.alwaysSampleTypes, t.alwaysSampleTypes, Bt, Gt, n),
504
+ remote: V("sampling.remote", r.remote, t.remote, n)
505
505
  };
506
506
  }
507
- function Qt(e, t, n) {
507
+ function on(e, t, n) {
508
508
  let r = e ?? {};
509
509
  return {
510
- mode: V("bus.mode", r.mode, bt, t.mode, n),
511
- trustedOrigins: G("bus.trustedOrigins", r.trustedOrigins, t.trustedOrigins, Nt, Vt, n),
512
- openFinRole: V("bus.openFinRole", r.openFinRole, xt, t.openFinRole, n)
510
+ mode: B("bus.mode", r.mode, Tt, t.mode, n),
511
+ trustedOrigins: W("bus.trustedOrigins", r.trustedOrigins, t.trustedOrigins, zt, Jt, n),
512
+ openFinRole: B("bus.openFinRole", r.openFinRole, Et, t.openFinRole, n)
513
513
  };
514
514
  }
515
- function $t(e, t, n) {
515
+ function sn(e, t, n) {
516
516
  let r = e ?? {};
517
517
  return {
518
- scope: V("journey.scope", r.scope, St, t.scope, n),
519
- maxAgeMs: It("journey.maxAgeMs", r.maxAgeMs, Ot, t.maxAgeMs, n)
518
+ scope: B("journey.scope", r.scope, Dt, t.scope, n),
519
+ maxAgeMs: Ut("journey.maxAgeMs", r.maxAgeMs, Nt, t.maxAgeMs, n)
520
520
  };
521
521
  }
522
- function en(e, t, n) {
522
+ function cn(e, t, n) {
523
523
  let r = e ?? {};
524
524
  return {
525
- mode: V("retention.mode", r.mode, wt, t.mode, n),
526
- ...U("retention", r, t, Et, n)
525
+ mode: B("retention.mode", r.mode, kt, t.mode, n),
526
+ ...H("retention", r, t, jt, n)
527
527
  };
528
528
  }
529
- function tn(e, t, n) {
530
- return e === void 0 ? t : typeof e == "boolean" ? e : Array.isArray(e) ? G("capture.console", e, [], L, Bt, n) : (B(n, "capture.console", L, e, "the value in force"), t);
529
+ function ln(e, t, n) {
530
+ return e === void 0 ? t : typeof e == "boolean" ? e : Array.isArray(e) ? W("capture.console", e, [], It, qt, n) : (z(n, "capture.console", It, e, "the value in force"), t);
531
531
  }
532
- function nn(e, t, n) {
532
+ function un(e, t, n) {
533
533
  let r = e ?? {}, i = {
534
534
  ...t,
535
535
  ...r,
536
- console: tn(r.console, t.console, n),
537
- longFrameThresholdMs: Ft("capture.longFrameThresholdMs", r.longFrameThresholdMs, t.longFrameThresholdMs, n),
538
- ignoreUrls: G("capture.ignoreUrls", r.ignoreUrls, t.ignoreUrls, jt, zt, n),
539
- propagateTraceHeaderTo: G("capture.propagateTraceHeaderTo", r.propagateTraceHeaderTo, t.propagateTraceHeaderTo, Mt, Ht, n)
536
+ console: ln(r.console, t.console, n),
537
+ longFrameThresholdMs: Ht("capture.longFrameThresholdMs", r.longFrameThresholdMs, t.longFrameThresholdMs, n),
538
+ ignoreUrls: W("capture.ignoreUrls", r.ignoreUrls, t.ignoreUrls, Lt, Kt, n),
539
+ propagateTraceHeaderTo: W("capture.propagateTraceHeaderTo", r.propagateTraceHeaderTo, t.propagateTraceHeaderTo, Rt, Yt, n)
540
540
  };
541
- for (let e of kt) i[e] = H(`capture.${e}`, r[e], t[e], n);
541
+ for (let e of Pt) i[e] = V(`capture.${e}`, r[e], t[e], n);
542
542
  return i;
543
543
  }
544
- function rn(e, t, n) {
545
- let r = n ?? m, i = {
546
- ...r,
544
+ function dn(e, t, n, r) {
545
+ let i = t;
546
+ if (typeof e == "string" && e !== "") try {
547
+ new URL(e), i = e;
548
+ } catch (t) {
549
+ r.report("config.invalid", `metricsEndpoint is not a valid absolute URL: ${e}. The library keeps the value in force.`, void 0, t);
550
+ }
551
+ else e === "" ? i = "" : e !== void 0 && z(r, "metricsEndpoint", "a URL string", e, "the value in force");
552
+ return i !== "" && n !== "otlp" ? (r.report("config.invalid", `metricsEndpoint needs serializer "${x}". The library sends metric records as log records.`), "") : i;
553
+ }
554
+ function fn(e, t, n) {
555
+ let i = n ?? a, o = {
556
+ ...i,
547
557
  ...e,
548
- endpoint: e.endpoint === void 0 ? r.endpoint : e.endpoint,
549
- enabled: H("enabled", e.enabled, r.enabled, t),
550
- minLevel: Lt("minLevel", e.minLevel, r.minLevel, t),
551
- compression: V("compression", e.compression, gt, r.compression, t),
552
- credentials: V("credentials", e.credentials, _t, r.credentials, t),
553
- headers: "headers" in e ? Wt(e.headers, r.headers, t) : r.headers,
554
- storage: V("storage", e.storage, vt, r.storage, t),
555
- identity: V("identity", e.identity, yt, r.identity, t),
556
- serializer: Kt(e.serializer, n?.serializer, t),
557
- console: Xt(e.console, r.console, t),
558
- sampling: Zt(e.sampling, r.sampling, t),
559
- bus: Qt(e.bus, r.bus, t),
560
- batching: U("batching", e.batching, r.batching, Tt, t),
561
- retention: en(e.retention, r.retention, t),
562
- limits: U("limits", e.limits, r.limits, Dt, t),
563
- journey: $t(e.journey, r.journey, t),
564
- capture: nn(e.capture, r.capture, t)
558
+ endpoint: e.endpoint === void 0 ? i.endpoint : e.endpoint,
559
+ enabled: V("enabled", e.enabled, i.enabled, t),
560
+ minLevel: Wt("minLevel", e.minLevel, i.minLevel, t),
561
+ compression: B("compression", e.compression, xt, i.compression, t),
562
+ credentials: B("credentials", e.credentials, St, i.credentials, t),
563
+ headers: "headers" in e ? Zt(e.headers, i.headers, t) : i.headers,
564
+ storage: B("storage", e.storage, Ct, i.storage, t),
565
+ identity: B("identity", e.identity, wt, i.identity, t),
566
+ serializer: $t(e.serializer, n?.serializer, t),
567
+ console: rn(e.console, i.console, t),
568
+ sampling: an(e.sampling, i.sampling, t),
569
+ bus: on(e.bus, i.bus, t),
570
+ batching: H("batching", e.batching, i.batching, At, t),
571
+ retention: cn(e.retention, i.retention, t),
572
+ limits: H("limits", e.limits, i.limits, Mt, t),
573
+ journey: sn(e.journey, i.journey, t),
574
+ capture: un(e.capture, i.capture, t)
565
575
  };
566
- if (i.transport !== void 0 && typeof i.transport != "function" && (t.report("config.invalid", "transport must be a function. The library ignores the value."), i.transport = r.transport), i.onDrop !== void 0 && typeof i.onDrop != "function" && (t.report("config.invalid", "onDrop must be a function. The library ignores the value."), i.onDrop = r.onDrop), i.transportOnExit !== void 0 && typeof i.transportOnExit != "function" && (t.report("config.invalid", "transportOnExit must be a function. The library ignores the value."), i.transportOnExit = r.transportOnExit), i.endpoint === "") i.transport === void 0 && t.report("config.invalid", "endpoint is missing. The library drops each record. Set endpoint: null for console-only mode.");
567
- else if (i.endpoint !== null) try {
568
- new URL(i.endpoint);
576
+ if (o.metricsEndpoint = dn(e.metricsEndpoint, i.metricsEndpoint, o.serializer, t), o.transport !== void 0 && typeof o.transport != "function" && (t.report("config.invalid", "transport must be a function. The library ignores the value."), o.transport = i.transport), o.onDrop !== void 0 && typeof o.onDrop != "function" && (t.report("config.invalid", "onDrop must be a function. The library ignores the value."), o.onDrop = i.onDrop), o.transportOnExit !== void 0 && typeof o.transportOnExit != "function" && (t.report("config.invalid", "transportOnExit must be a function. The library ignores the value."), o.transportOnExit = i.transportOnExit), o.endpoint === "") o.transport === void 0 && t.report("config.invalid", "endpoint is missing. The library drops each record. Set endpoint: null for console-only mode.");
577
+ else if (o.endpoint !== null) try {
578
+ new URL(o.endpoint);
569
579
  } catch (e) {
570
- t.report("config.invalid", `endpoint is not a valid absolute URL: ${i.endpoint}.`, void 0, e);
571
- }
572
- i.serviceName ||= (t.report("config.invalid", `serviceName is missing. Every record reports service.name as '${E}'.`), E);
573
- let a = i.sampling.defaultRate;
574
- (typeof a != "number" || a < 0 || a > 1) && (t.report("config.invalid", `sampling.defaultRate must be 0..1. The value is ${String(a)}. The library uses 1.`), i.sampling.defaultRate = 1);
575
- let o = i.sampling.remoteMaxRate;
576
- (typeof o != "number" || !(o >= 0 && o <= 1)) && (t.report("config.invalid", `sampling.remoteMaxRate must be 0..1. The value is ${String(o)}. The library uses 1.`), i.sampling.remoteMaxRate = 1);
577
- let s = Object.entries(i.sampling.rates);
578
- for (let [e, n] of s) (typeof n != "number" || n < 0 || n > 1) && (t.report("config.invalid", `sampling.rates["${e}"] must be 0..1. The value is ${String(n)}. The library uses 1.`), i.sampling.rates[e] = 1);
579
- return i.capture.ignoreUrls = i.capture.ignoreUrls.filter((e) => e !== n?.endpoint), i.endpoint && !i.capture.ignoreUrls.includes(i.endpoint) && (i.capture.ignoreUrls = [...i.capture.ignoreUrls, i.endpoint]), an(e, t), i;
580
- }
581
- function an(e, t) {
582
- let n = /* @__PURE__ */ new Set([...Object.keys(m), ...ce]);
580
+ t.report("config.invalid", `endpoint is not a valid absolute URL: ${o.endpoint}.`, void 0, e);
581
+ }
582
+ o.metricsEndpoint !== "" && o.endpoint === null && !o.transport && t.report("config.invalid", "metricsEndpoint needs endpoint or transport. The library sends nothing to metricsEndpoint."), o.serviceName ||= (t.report("config.invalid", `serviceName is missing. Every record reports service.name as '${r}'.`), r);
583
+ let s = o.sampling.defaultRate;
584
+ (typeof s != "number" || s < 0 || s > 1) && (t.report("config.invalid", `sampling.defaultRate must be 0..1. The value is ${String(s)}. The library uses 1.`), o.sampling.defaultRate = 1);
585
+ let c = o.sampling.remoteMaxRate;
586
+ (typeof c != "number" || !(c >= 0 && c <= 1)) && (t.report("config.invalid", `sampling.remoteMaxRate must be 0..1. The value is ${String(c)}. The library uses 1.`), o.sampling.remoteMaxRate = 1);
587
+ let l = Object.entries(o.sampling.rates);
588
+ for (let [e, n] of l) (typeof n != "number" || n < 0 || n > 1) && (t.report("config.invalid", `sampling.rates["${e}"] must be 0..1. The value is ${String(n)}. The library uses 1.`), o.sampling.rates[e] = 1);
589
+ o.capture.ignoreUrls = o.capture.ignoreUrls.filter((e) => e !== n?.endpoint && e !== n?.metricsEndpoint);
590
+ for (let e of [o.endpoint, o.metricsEndpoint]) e && !o.capture.ignoreUrls.includes(e) && (o.capture.ignoreUrls = [...o.capture.ignoreUrls, e]);
591
+ return pn(e, t), o;
592
+ }
593
+ function pn(e, t) {
594
+ let n = /* @__PURE__ */ new Set([...Object.keys(a), ...xe]);
583
595
  for (let r of Object.keys(e)) n.has(r) || t.report("config.invalid", `The library ignores the unknown config key "${r}". Check the spelling.`);
584
- for (let n of p) {
596
+ for (let n of C) {
585
597
  let r = e[n];
586
598
  if (typeof r != "object" || !r) continue;
587
- let i = /* @__PURE__ */ new Set([...Object.keys(m[n]), ...ne[n]]);
599
+ let i = /* @__PURE__ */ new Set([...Object.keys(a[n]), ..._[n]]);
588
600
  for (let e of Object.keys(r)) i.has(e) || t.report("config.invalid", `The library ignores the unknown config key "${n}.${e}". Check the spelling.`);
589
601
  }
590
602
  }
591
- function on(e, t) {
592
- for (let n of Object.keys(t)) p.includes(n) || Object.assign(e, { [n]: t[n] });
593
- for (let n of p) Object.assign(e[n], t[n]);
603
+ function mn(e, t) {
604
+ for (let n of Object.keys(t)) C.includes(n) || Object.assign(e, { [n]: t[n] });
605
+ for (let n of C) Object.assign(e[n], t[n]);
594
606
  }
595
607
  //#endregion
596
608
  //#region src/core/context.ts
597
- var sn = class {
609
+ var hn = class {
598
610
  map = /* @__PURE__ */ new Map();
599
611
  set(e, t) {
600
612
  this.map.set(e, t);
@@ -602,24 +614,18 @@ var sn = class {
602
614
  setMany(e) {
603
615
  for (let [t, n] of Object.entries(e)) this.map.set(t, n);
604
616
  }
605
- get(e) {
606
- return this.map.get(e);
607
- }
608
617
  remove(e) {
609
618
  this.map.delete(e);
610
619
  }
611
- clear() {
612
- this.map.clear();
613
- }
614
620
  getAll() {
615
621
  return Object.fromEntries(this.map);
616
622
  }
617
- }, cn = class {
623
+ }, gn = class {
618
624
  handler;
619
625
  throttleMs;
620
626
  counters = /* @__PURE__ */ new Map();
621
627
  lastEmitted = /* @__PURE__ */ new Map();
622
- constructor(e, t = s) {
628
+ constructor(e, t = f) {
623
629
  this.handler = e, this.throttleMs = t;
624
630
  }
625
631
  setHandler(e) {
@@ -642,12 +648,12 @@ var sn = class {
642
648
  count: i
643
649
  }, { handler: s } = this;
644
650
  if (s) try {
645
- O(() => {
651
+ A(() => {
646
652
  s(o);
647
653
  });
648
654
  } catch (e) {
649
- this.count("handler.threw"), typeof console < "u" && O(() => {
650
- console.warn(`${oe} The onDiagnostic handler threw an error.`, e);
655
+ this.count("handler.threw"), typeof console < "u" && A(() => {
656
+ console.warn(`${se} The onDiagnostic handler threw an error.`, e);
651
657
  });
652
658
  }
653
659
  }
@@ -670,16 +676,13 @@ var sn = class {
670
676
  snapshot() {
671
677
  return Object.fromEntries(this.counters);
672
678
  }
673
- reset() {
674
- this.counters.clear(), this.lastEmitted.clear();
675
- }
676
679
  };
677
680
  //#endregion
678
681
  //#region src/core/drops.ts
679
- function K(e, t) {
682
+ function G(e, t) {
680
683
  e.length < 20 && !e.includes(t) && e.push(t);
681
684
  }
682
- var ln = class {
685
+ var _n = class {
683
686
  config;
684
687
  diagnostics;
685
688
  pending = /* @__PURE__ */ new Map();
@@ -698,12 +701,12 @@ var ln = class {
698
701
  journeyIds: [],
699
702
  actions: []
700
703
  }, this.pending.set(e, r)), r.records += t.length;
701
- for (let e of n) K(r.batchIds, e);
704
+ for (let e of n) G(r.batchIds, e);
702
705
  for (let e of t) {
703
- let t = Ue(e, w);
704
- typeof t == "string" && K(r.journeyIds, t);
705
- let n = j(e) ? e.body : void 0;
706
- typeof n == "string" && K(r.actions, n);
706
+ let t = Je(e, E);
707
+ typeof t == "string" && G(r.journeyIds, t);
708
+ let n = M(e) ? e.body : void 0;
709
+ typeof n == "string" && G(r.actions, n);
707
710
  }
708
711
  this.scheduled || (this.scheduled = !0, queueMicrotask(() => {
709
712
  this.flush();
@@ -717,8 +720,8 @@ var ln = class {
717
720
  if (t) {
718
721
  this.reporting = !0;
719
722
  for (let n of e) this.diagnostics.guard("handler.threw", "The onDrop hook threw an error.", () => {
720
- We(() => {
721
- O(() => {
723
+ Ye(() => {
724
+ A(() => {
722
725
  t(n);
723
726
  });
724
727
  });
@@ -726,7 +729,7 @@ var ln = class {
726
729
  this.reporting = !1;
727
730
  }
728
731
  }
729
- }, un = class {
732
+ }, vn = class {
730
733
  onDrop;
731
734
  held = [];
732
735
  actions = 0;
@@ -740,10 +743,10 @@ var ln = class {
740
743
  return this.held.length;
741
744
  }
742
745
  push(e) {
743
- let t = j(e);
746
+ let t = M(e);
744
747
  if ((t ? this.actions : this.held.length - this.actions) < (t ? 2e3 : 500)) this.actions += +!!t;
745
748
  else {
746
- let e = this.held.findIndex((e) => j(e) === t), [n] = this.held.splice(e, 1);
749
+ let e = this.held.findIndex((e) => M(e) === t), [n] = this.held.splice(e, 1);
747
750
  this.onDrop(n);
748
751
  }
749
752
  this.held.push(e);
@@ -752,15 +755,118 @@ var ln = class {
752
755
  let e = this.held;
753
756
  return this.held = [], this.actions = 0, e;
754
757
  }
755
- }, dn = "error.", fn = [
756
- se,
758
+ }, yn = "overflow", bn = /* @__PURE__ */ new Set([
759
+ b,
760
+ D,
757
761
  w,
758
- re
762
+ T,
763
+ E,
764
+ y,
765
+ fe
766
+ ]);
767
+ function xn(e = {}) {
768
+ let t = {};
769
+ for (let n of Object.keys(e).sort()) {
770
+ if (n.startsWith("metric.") || bn.has(n)) continue;
771
+ let r = e[n];
772
+ (typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) && (t[n] = r);
773
+ }
774
+ return t;
775
+ }
776
+ function Sn(e) {
777
+ if (!Array.isArray(e)) return null;
778
+ let t = Math.min(e.length, 51);
779
+ return Array.from({ length: t }, (t, n) => e[n]);
780
+ }
781
+ function Cn(e) {
782
+ return Array.isArray(e) && e.length <= 50 && e.every((t, n) => typeof t == "number" && Number.isFinite(t) && (n === 0 || t > e[n - 1]));
783
+ }
784
+ function wn(e, t, n) {
785
+ let r = {
786
+ "metric.name": e.name,
787
+ "metric.unit": e.unit,
788
+ "metric.type": e.kind,
789
+ [k.start]: n,
790
+ [k.attributeKeys]: Object.keys(t.attributes)
791
+ };
792
+ return e.kind === "counter" ? (r["metric.value"] = t.sum, r) : {
793
+ ...r,
794
+ [k.count]: t.count,
795
+ [k.sum]: t.sum,
796
+ [k.min]: t.min,
797
+ [k.max]: t.max,
798
+ [k.bounds]: e.boundaries,
799
+ [k.buckets]: t.buckets
800
+ };
801
+ }
802
+ var Tn = class {
803
+ intervalMs;
804
+ emit;
805
+ diagnostics;
806
+ instruments = /* @__PURE__ */ new Map();
807
+ timer = null;
808
+ startedAt = 0;
809
+ constructor(e, t, n) {
810
+ this.intervalMs = e, this.emit = t, this.diagnostics = n;
811
+ }
812
+ record(e, t, n) {
813
+ !Number.isFinite(t) || e.kind === "counter" && t < 0 ? this.diagnostics.report("record.dropped_malformed", `The value of the metric ${e.name} is not valid. The library dropped it.`, { "metric.name": e.name }) : this.diagnostics.guard("record.sanitize_failed", `The library could not read the attributes of the metric ${e.name}.`, () => {
814
+ let r = this.instrumentOf(e);
815
+ r && (this.add(r, t, xn(n)), this.arm());
816
+ });
817
+ }
818
+ collect() {
819
+ this.timer !== null && (clearTimeout(this.timer), this.timer = null);
820
+ let e = `${String(this.startedAt)}000000`, t = [...this.instruments.values()];
821
+ this.instruments.clear();
822
+ for (let { def: n, series: r } of t) for (let t of r.values()) this.emit(n.name, t.attributes, wn(n, t, e));
823
+ }
824
+ instrumentOf(e) {
825
+ let t = this.instruments.get(e.name);
826
+ if (t) return t.def.kind === e.kind ? t : (this.diagnostics.report("record.dropped_malformed", `The metric ${e.name} is a counter and a histogram. The library dropped the value.`, { "metric.name": e.name }), null);
827
+ let n = Sn(e.boundaries), r = Cn(n);
828
+ e.kind === "histogram" && !r && this.diagnostics.report("config.invalid", `The boundaries of the metric ${e.name} must be at most 50 finite numbers in ascending order. The library uses the default boundaries.`);
829
+ let i = {
830
+ def: {
831
+ ...e,
832
+ boundaries: r ? n : [...ae]
833
+ },
834
+ series: /* @__PURE__ */ new Map()
835
+ };
836
+ return this.instruments.set(e.name, i), i;
837
+ }
838
+ add(e, t, n) {
839
+ let r = JSON.stringify(n), i = e.series.get(r), a = n;
840
+ if (!i && e.series.size >= 100 && (r = yn, i = e.series.get(r), a = { [oe]: !0 }), !i) {
841
+ let n = e.def.kind === "histogram" ? e.def.boundaries.length + 1 : 0, o = Array(n).fill(0);
842
+ i = {
843
+ attributes: a,
844
+ count: 0,
845
+ sum: 0,
846
+ min: t,
847
+ max: t,
848
+ buckets: o
849
+ }, e.series.set(r, i);
850
+ }
851
+ if (i.count += 1, i.sum += t, i.min = Math.min(i.min, t), i.max = Math.max(i.max, t), i.buckets.length > 0) {
852
+ let n = e.def.boundaries.findIndex((e) => t <= e);
853
+ i.buckets[n === -1 ? i.buckets.length - 1 : n] += 1;
854
+ }
855
+ }
856
+ arm() {
857
+ this.timer === null && (this.startedAt = Date.now(), this.timer = setTimeout(() => {
858
+ this.collect();
859
+ }, this.intervalMs()), ke(this.timer));
860
+ }
861
+ }, En = "error.", Dn = [
862
+ T,
863
+ E,
864
+ y
759
865
  ];
760
- function q(e) {
866
+ function K(e) {
761
867
  return e;
762
868
  }
763
- var pn = class {
869
+ var On = class {
764
870
  deps;
765
871
  resourceCache = null;
766
872
  constructor(e) {
@@ -772,9 +878,9 @@ var pn = class {
772
878
  isEnabled(e, t) {
773
879
  let { config: n } = this.deps;
774
880
  if (!n.enabled) return !1;
775
- if (t !== void 0 && ie.includes(t)) return !0;
881
+ if (t !== void 0 && pe.includes(t)) return !0;
776
882
  let r = this.deps.remote.sampling?.minLevel() ?? n.minLevel;
777
- return C[e] >= C[r];
883
+ return O[e] >= O[r];
778
884
  }
779
885
  build(e) {
780
886
  let { config: t, diagnostics: n, tracing: r, journey: i, sequence: a, limits: o, remote: s } = this.deps;
@@ -783,72 +889,73 @@ var pn = class {
783
889
  dropped: "level"
784
890
  };
785
891
  let c = r.resolve(), l = i.current();
786
- if (!Ae({
892
+ if (!Pe({
787
893
  level: e.level,
788
894
  type: e.type,
789
895
  namespace: e.namespace,
790
896
  journeyId: l?.id ?? "",
791
- traceId: c.traceId
897
+ traceId: c.traceId,
898
+ aggregated: e.aggregated
792
899
  }, t, s.sampling?.current() ?? null)) return n.count("record.dropped_by_sampling"), {
793
900
  record: null,
794
901
  dropped: "sampling"
795
902
  };
796
- let u = a.next(), d = He(n), f = t.capture.fullUrls ? d : Ve(d), p, m = 0;
903
+ let u = a.next(), d = qe(n), f = t.capture.fullUrls ? d : Ge(d), p, m = 0;
797
904
  try {
798
- let t = k(this.deps.context.getAll(), o, n), r = k(e.scoped ?? {}, o, n), i = k(e.payload ?? {}, o, n);
905
+ let t = j(this.deps.context.getAll(), o, n), r = j(e.scoped ?? {}, o, n), i = j(e.payload ?? {}, o, n);
799
906
  m = t.bytes + r.bytes + i.bytes, p = {
800
- ...q(t.value),
801
- ...q(r.value),
802
- ...q(i.value)
907
+ ...K(t.value),
908
+ ...K(r.value),
909
+ ...K(i.value)
803
910
  };
804
911
  } catch (e) {
805
- n.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), p = { [ge]: !0 };
912
+ n.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), p = { [me]: !0 };
806
913
  }
807
- p[b] = e.type, p[T] = u, p[me] = e.namespace, p[se] = f, l && (p[w] = l.id, p[re] = l.name, l.parentId !== void 0 && (p[fe] = l.parentId));
808
- let h = Me(e.body, o.maxBodyChars);
914
+ Object.assign(p, e.fixed), p[b] = e.type, p[D] = u, p[w] = e.namespace, p[T] = f, l && (p[E] = l.id, p[y] = l.name, l.parentId !== void 0 && (p[fe] = l.parentId));
915
+ let h = Ie(e.body, o.maxBodyChars);
809
916
  h !== e.body && n.count("record.truncated");
810
917
  let g = {
811
- timeUnixNano: ke(),
918
+ timeUnixNano: Ne(),
812
919
  traceId: c.traceId,
813
920
  spanId: c.spanId,
814
921
  traceFlags: c.traceFlags,
815
- severityNumber: x[e.level],
922
+ severityNumber: ue[e.level],
816
923
  severityText: e.level,
817
924
  body: h,
818
925
  attributes: p,
819
926
  resource: this.resource()
820
927
  }, _ = t.redact;
821
928
  if (_) {
822
- let e;
929
+ let t;
823
930
  try {
824
- e = _(g);
931
+ t = _(g);
825
932
  } catch (e) {
826
933
  return n.report("record.dropped_by_redact", "The redact hook threw an error. The library dropped the record.", void 0, e), {
827
934
  record: null,
828
935
  dropped: "redact"
829
936
  };
830
937
  }
831
- if (e === null) return n.count("record.dropped_by_redact"), {
938
+ if (t === null) return n.count("record.dropped_by_redact"), {
832
939
  record: null,
833
940
  dropped: "redact"
834
941
  };
835
- let t = e ?? g;
836
- if (!D(t)) return t === g ? (n.report("record.dropped_malformed", "The redact hook changed the record to a shape that is not a record. The library dropped it."), {
942
+ let r = t ?? g;
943
+ if (!Ae(r)) return r === g ? (n.report("record.dropped_malformed", "The redact hook changed the record to a shape that is not a record. The library dropped it."), {
837
944
  record: null,
838
945
  dropped: "malformed"
839
946
  }) : (n.report("record.dropped_by_redact", "The redact hook returned a value that is not a record. The library dropped the record."), {
840
947
  record: null,
841
948
  dropped: "redact"
842
949
  });
843
- if (De(t.severityText)) {
844
- if (t !== g) {
845
- let e = k(t.attributes, o, n);
950
+ if (je(r.severityText)) {
951
+ if (r !== g) {
952
+ let t = j(r.attributes, o, n);
846
953
  g = {
847
- ...t,
848
- attributes: q(e.value)
849
- }, m = e.bytes;
954
+ ...r,
955
+ attributes: K(t.value)
956
+ }, m = t.bytes, Object.assign(g.attributes, e.fixed);
850
957
  }
851
- g.severityNumber = x[g.severityText];
958
+ g.severityNumber = ue[g.severityText];
852
959
  } else return n.report("record.dropped_malformed", "The redact hook set a severityText that is not a log level. The library dropped the record."), {
853
960
  record: null,
854
961
  dropped: "malformed"
@@ -861,52 +968,52 @@ var pn = class {
861
968
  });
862
969
  let t = {
863
970
  [b]: e.type,
864
- [T]: u,
865
- [me]: e.namespace,
971
+ [D]: u,
972
+ [w]: e.namespace,
866
973
  [le]: !0,
867
- [ye]: m
974
+ [ve]: m
868
975
  };
869
- for (let e of fn) e in g.attributes && (t[e] = g.attributes[e]);
870
- for (let [e, n] of Object.entries(g.attributes)) e.startsWith(dn) && (t[e] = n);
871
- let r = k(t, o, n).bytes;
872
- r > o.maxRecordBytes && "error.data" in t && (Reflect.deleteProperty(t, he), r = k(t, o, n).bytes);
873
- let i = g.attributes[y];
976
+ for (let e of Dn) e in g.attributes && (t[e] = g.attributes[e]);
977
+ for (let [e, n] of Object.entries(g.attributes)) e.startsWith(En) && (t[e] = n);
978
+ let r = j(t, o, n).bytes;
979
+ r > o.maxRecordBytes && "error.data" in t && (Reflect.deleteProperty(t, ge), r = j(t, o, n).bytes);
980
+ let i = g.attributes[v];
874
981
  if (i !== void 0) {
875
- let e = k(i, o, n).bytes;
876
- r + e <= o.maxRecordBytes && (t[y] = i);
982
+ let e = j(i, o, n).bytes;
983
+ r + e <= o.maxRecordBytes && (t[v] = i);
877
984
  }
878
- g.attributes = t;
985
+ Object.assign(t, e.fixed), g.attributes = t;
879
986
  }
880
987
  return { record: g };
881
988
  }
882
989
  resource() {
883
990
  if (this.resourceCache) return this.resourceCache;
884
- let { config: e, identity: n, platform: r } = this.deps;
991
+ let { config: e, identity: t, platform: r } = this.deps;
885
992
  return this.resourceCache = {
886
- [u]: e.serviceName,
887
- [_]: e.serviceVersion,
888
- [f]: e.environment,
889
- [o]: ae,
890
- [ee]: S,
891
- [te]: xe,
993
+ [te]: e.serviceName,
994
+ [c]: e.serviceVersion,
995
+ [p]: e.environment,
996
+ [d]: ce,
997
+ [_e]: S,
998
+ [s]: he,
892
999
  [h]: r.platform,
893
- [Ce]: n.sessionId,
894
- [t]: n.tabId,
895
- [d]: n.contextId,
896
- [ue]: r.userAgent,
897
- ...r.openfinUuid === void 0 ? {} : { [c]: r.openfinUuid },
898
- ...r.openfinName === void 0 ? {} : { [a]: r.openfinName }
1000
+ [ee]: t.sessionId,
1001
+ [ne]: t.tabId,
1002
+ [u]: t.contextId,
1003
+ [o]: r.userAgent,
1004
+ ...r.openfinUuid === void 0 ? {} : { [n]: r.openfinUuid },
1005
+ ...r.openfinName === void 0 ? {} : { [we]: r.openfinName }
899
1006
  }, this.resourceCache;
900
1007
  }
901
- }, mn = {
902
- errors: async () => (await import("./errors-CQusIGWJ.js")).ErrorCapture,
903
- network: async () => (await import("./network-51iicpLl.js")).NetworkCapture,
904
- interactions: async () => (await import("./interactions-CnjfQgw3.js")).InteractionCapture,
1008
+ }, kn = {
1009
+ errors: async () => (await import("./errors-DCZWcHkd.js")).ErrorCapture,
1010
+ network: async () => (await import("./network--GoE7_Or.js")).NetworkCapture,
1011
+ interactions: async () => (await import("./interactions-BLH_tX87.js")).InteractionCapture,
905
1012
  webVitals: async () => (await import("./web-vitals-Bflr5jSA.js")).WebVitalsCapture,
906
- longFrames: async () => (await import("./long-frames-CZk3XOkH.js")).LongFrameCapture,
907
- console: async () => (await import("./console-C9Y639mn.js")).ConsoleCapture
908
- }, J = Symbol.for(ve), Y = Symbol.for(l), hn = ["batching", "retention"];
909
- function gn(e) {
1013
+ longFrames: async () => (await import("./long-frames-DD_Um9_4.js")).LongFrameCapture,
1014
+ console: async () => (await import("./console-Dv5GfaNn.js")).ConsoleCapture
1015
+ }, q = Symbol.for(re), J = Symbol.for(m), An = ["batching", "retention"];
1016
+ function Y(e) {
910
1017
  return JSON.stringify({
911
1018
  ...e,
912
1019
  webVitalsLoader: e.webVitalsLoader !== void 0,
@@ -914,7 +1021,7 @@ function gn(e) {
914
1021
  propagateTraceHeaderTo: e.propagateTraceHeaderTo.map(String)
915
1022
  });
916
1023
  }
917
- function _n(e) {
1024
+ function jn(e) {
918
1025
  return {
919
1026
  ...e,
920
1027
  endpoint: null,
@@ -940,22 +1047,23 @@ var Z = class e {
940
1047
  stores;
941
1048
  identityBuiltAs;
942
1049
  sessionTouch;
943
- context = new sn();
1050
+ context = new hn();
944
1051
  breadcrumbs;
945
1052
  tracing;
946
- sequence = new it();
1053
+ sequence = new lt();
947
1054
  journey;
948
1055
  builder;
949
1056
  remote = { sampling: null };
950
1057
  console;
951
1058
  drops;
1059
+ meter;
952
1060
  bus = null;
953
1061
  busBuilt;
954
1062
  busLoad;
955
1063
  storageBuiltAs;
956
1064
  sender;
957
1065
  senderLoad;
958
- pendingRecords = new un((e) => {
1066
+ pendingRecords = new vn((e) => {
959
1067
  this.dropHeld(e);
960
1068
  });
961
1069
  captures = [];
@@ -965,7 +1073,7 @@ var Z = class e {
965
1073
  navigationTiming: !1,
966
1074
  longFrames: !1
967
1075
  };
968
- bootBuffer = new un((e) => {
1076
+ bootBuffer = new vn((e) => {
969
1077
  this.dropHeld(e);
970
1078
  });
971
1079
  forwardBuffer = [];
@@ -979,12 +1087,12 @@ var Z = class e {
979
1087
  journeyOptions;
980
1088
  tunablesLocked = !0;
981
1089
  constructor(e, t = !1) {
982
- this.degraded = t, this.diagnostics = new cn(e.onDiagnostic), this.platform = Be(this.diagnostics), this.config = rn(e, this.diagnostics), this.identityBuiltAs = this.config.identity, this.stores = this.identityBuiltAs === "memory" ? Le() : ze, this.identity = Re(this.diagnostics, this.stores), this.sessionTouch = new Ie(this.diagnostics, this.stores), this.breadcrumbs = new mt(50), this.tracing = new pt(this.diagnostics, void 0, this.config.otelLoader), this.tracing.loadOtel(), this.limits = { ...this.config.limits }, this.console = new rt(this.config.console, this.diagnostics, this.limits), this.drops = new ln(this.config, this.diagnostics), this.journeyOptions = {
983
- ...Ke,
1090
+ this.degraded = t, this.diagnostics = new gn(e.onDiagnostic), this.platform = Ke(this.diagnostics), this.config = fn(e, this.diagnostics), this.identityBuiltAs = this.config.identity, this.stores = this.identityBuiltAs === "memory" ? He() : We, this.identity = Ue(this.diagnostics, this.stores), this.sessionTouch = new Be(this.diagnostics, this.stores), this.breadcrumbs = new yt(50), this.tracing = new vt(this.diagnostics, void 0, this.config.otelLoader), this.tracing.loadOtel(), this.limits = { ...this.config.limits }, this.console = new ct(this.config.console, this.diagnostics, this.limits), this.drops = new _n(this.config, this.diagnostics), this.journeyOptions = {
1091
+ ...Ze,
984
1092
  maxAgeMs: this.config.journey.maxAgeMs
985
- }, this.journey = new Ge(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
1093
+ }, this.journey = new Xe(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
986
1094
  this.bus?.broadcastJourney(e);
987
- }, this.stores), this.builder = new pn({
1095
+ }, this.stores), this.builder = new On({
988
1096
  remote: this.remote,
989
1097
  config: this.config,
990
1098
  limits: this.limits,
@@ -995,7 +1103,24 @@ var Z = class e {
995
1103
  sequence: this.sequence,
996
1104
  identity: this.identity,
997
1105
  platform: this.platform
1106
+ }), this.meter = new Tn(() => this.config.batching.metricFlushIntervalMs, (e, t, n) => {
1107
+ this.emitPoint(e, t, n);
1108
+ }, this.diagnostics);
1109
+ }
1110
+ recordMetric(e, t, n) {
1111
+ this.destroyed || this.meter.record(e, t, n);
1112
+ }
1113
+ emitPoint(e, t, n) {
1114
+ let { record: r } = this.builder.build({
1115
+ level: "INFO",
1116
+ type: "metric",
1117
+ body: e,
1118
+ namespace: Se,
1119
+ payload: t,
1120
+ fixed: n,
1121
+ aggregated: !0
998
1122
  });
1123
+ this.emit(r);
999
1124
  }
1000
1125
  busAccept = (e, t) => {
1001
1126
  this.destroyed || this.ensureBus().then((n) => {
@@ -1005,7 +1130,7 @@ var Z = class e {
1005
1130
  });
1006
1131
  };
1007
1132
  static pinned() {
1008
- return globalThis[J] ?? null;
1133
+ return globalThis[q] ?? null;
1009
1134
  }
1010
1135
  static current() {
1011
1136
  let t = e.local;
@@ -1016,7 +1141,7 @@ var Z = class e {
1016
1141
  static stopped() {
1017
1142
  let t = e.local;
1018
1143
  if (t?.destroyed) return t;
1019
- let n = globalThis[Y];
1144
+ let n = globalThis[J];
1020
1145
  return n && X(n) ? n : null;
1021
1146
  }
1022
1147
  isDestroyed() {
@@ -1024,7 +1149,7 @@ var Z = class e {
1024
1149
  }
1025
1150
  static configure(t, n = !1) {
1026
1151
  let r = e.local;
1027
- if (r && !r.destroyed) return r.reconfigure(_n(t)), r;
1152
+ if (r && !r.destroyed) return r.reconfigure(jn(t)), r;
1028
1153
  e.local = null;
1029
1154
  let i = e.pinned();
1030
1155
  if (i) {
@@ -1032,10 +1157,10 @@ var Z = class e {
1032
1157
  if (!i.destroyed) return i.reconfigure(t), i;
1033
1158
  }
1034
1159
  let a = new e(t);
1035
- return a.tunablesLocked = !n, globalThis[J] = a, Reflect.deleteProperty(globalThis, Y), a.init(), a;
1160
+ return a.tunablesLocked = !n, globalThis[q] = a, Reflect.deleteProperty(globalThis, J), a.init(), a;
1036
1161
  }
1037
1162
  static startDegraded(t, n) {
1038
- let r = new e(_n(t), !0);
1163
+ let r = new e(jn(t), !0);
1039
1164
  e.local = r;
1040
1165
  let i = typeof n == "string" ? n : "before 0.9.0";
1041
1166
  return r.diagnostics.report("runtime.version_mismatch", `Another copy of the library, version ${i}, owns the page runtime. This copy, version ${S}, runs in console-only mode and installs no capture. Load one version of the library on the page.`, {
@@ -1044,11 +1169,11 @@ var Z = class e {
1044
1169
  }), r.init(), r;
1045
1170
  }
1046
1171
  reconfigure(e) {
1047
- let t = this.keepDestination(e), n = gn(this.config.capture), r = rn(t, this.diagnostics, this.config);
1048
- this.keepStartupTunables(r), on(this.config, r), this.diagnostics.setHandler(this.config.onDiagnostic), this.builder.invalidateResource(), this.console.update(this.config.console), this.keepBuiltStorage(), this.keepBuiltIdentity(), gn(this.config.capture) !== n && this.installCaptures(), this.roleResolved && this.syncSender(), this.diagnostics.report("config.reconfigured", "A later configure() call updated the runtime.");
1172
+ let t = this.keepDestination(e), n = Y(this.config.capture), r = fn(t, this.diagnostics, this.config);
1173
+ this.keepStartupTunables(r), mn(this.config, r), this.diagnostics.setHandler(this.config.onDiagnostic), this.builder.invalidateResource(), this.console.update(this.config.console), this.keepBuiltStorage(), this.keepBuiltIdentity(), Y(this.config.capture) !== n && this.installCaptures(), this.roleResolved && this.syncSender(), this.diagnostics.report("config.reconfigured", "A later configure() call updated the runtime.");
1049
1174
  }
1050
1175
  keepStartupTunables(e) {
1051
- if (this.senderLoad !== void 0 && this.keepSections(e, hn), !this.tunablesLocked) {
1176
+ if (this.senderLoad !== void 0 && this.keepSections(e, An), !this.tunablesLocked) {
1052
1177
  this.tunablesLocked = !0, Object.assign(this.limits, e.limits), this.journeyOptions.maxAgeMs = e.journey.maxAgeMs;
1053
1178
  return;
1054
1179
  }
@@ -1106,7 +1231,7 @@ var Z = class e {
1106
1231
  }
1107
1232
  async buildBus() {
1108
1233
  try {
1109
- let { Bus: e } = await import("./bus-HVQ8E72V.js");
1234
+ let { Bus: e } = await import("./bus-C6RwKzPW.js");
1110
1235
  if (this.destroyed) return null;
1111
1236
  let t = new e(this.config, this.diagnostics, this.platform, this.identity.contextId, this.identity.tabId, {
1112
1237
  onRecords: (e) => {
@@ -1141,12 +1266,15 @@ var Z = class e {
1141
1266
  async buildSender() {
1142
1267
  this.storageBuiltAs = this.config.storage;
1143
1268
  try {
1144
- let { Sender: e } = await import("./sender-BBY0IcUo.js"), t = this.destroyed ? null : await e.create({
1269
+ let { Sender: e } = await import("./sender-BUBWLn5i.js"), t = this.destroyed ? null : await e.create({
1145
1270
  config: this.config,
1146
1271
  diagnostics: this.diagnostics,
1147
1272
  onGap: this.reportGap,
1148
1273
  onLoss: this.reportLoss,
1149
- remote: this.remote
1274
+ remote: this.remote,
1275
+ beforeExit: () => {
1276
+ this.meter.collect();
1277
+ }
1150
1278
  });
1151
1279
  if (!t || this.destroyed) {
1152
1280
  await t?.destroy();
@@ -1160,9 +1288,9 @@ var Z = class e {
1160
1288
  }
1161
1289
  async installCaptures() {
1162
1290
  if (this.degraded) return;
1163
- let e = ++this.captureGeneration, t = this.config.capture, r = [];
1164
- (t.errors || t.rejections || t.resourceErrors) && r.push("errors"), (t.fetch || t.xhr) && r.push("network"), (t.interactions || t.navigation) && r.push("interactions"), t.webVitals && r.push("webVitals"), t.longFrames && r.push("longFrames"), (Array.isArray(t.console) ? t.console.length > 0 : t.console) && r.push("console");
1165
- let i = await Promise.all(r.map((e) => this.loadCapture(e)));
1291
+ let e = ++this.captureGeneration, t = this.config.capture, n = [];
1292
+ (t.errors || t.rejections || t.resourceErrors) && n.push("errors"), (t.fetch || t.xhr) && n.push("network"), (t.interactions || t.navigation) && n.push("interactions"), t.webVitals && n.push("webVitals"), t.longFrames && n.push("longFrames"), (Array.isArray(t.console) ? t.console.length > 0 : t.console) && n.push("console");
1293
+ let r = await Promise.all(n.map((e) => this.loadCapture(e)));
1166
1294
  if (e !== this.captureGeneration || this.destroyed) return;
1167
1295
  this.uninstallCaptures();
1168
1296
  let a = {
@@ -1170,10 +1298,13 @@ var Z = class e {
1170
1298
  diagnostics: this.diagnostics,
1171
1299
  breadcrumbs: this.breadcrumbs,
1172
1300
  tracing: this.tracing,
1173
- logger: new F(() => this, n),
1174
- once: this.captureOnce
1301
+ logger: new I(() => this, i),
1302
+ once: this.captureOnce,
1303
+ recordMetric: (e, t, n) => {
1304
+ this.recordMetric(e, t, n);
1305
+ }
1175
1306
  };
1176
- for (let e of i) e && this.captures.push(new e(a));
1307
+ for (let e of r) e && this.captures.push(new e(a));
1177
1308
  for (let e of this.captures) this.diagnostics.guard("capture.install_failed", `The library could not install the ${e.name} capture.`, () => {
1178
1309
  e.install();
1179
1310
  });
@@ -1185,7 +1316,7 @@ var Z = class e {
1185
1316
  this.captures.length = 0;
1186
1317
  }
1187
1318
  loadCapture(e) {
1188
- return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`, mn[e]);
1319
+ return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`, kn[e]);
1189
1320
  }
1190
1321
  registerWorker(e) {
1191
1322
  this.destroyed || this.constructBus().then((t) => {
@@ -1196,9 +1327,9 @@ var Z = class e {
1196
1327
  }
1197
1328
  async destroy() {
1198
1329
  if (this.destroyed) return;
1199
- this.destroyed = !0, this.uninstallCaptures();
1330
+ this.meter.collect(), this.destroyed = !0, this.uninstallCaptures();
1200
1331
  let t = this.sender?.destroy();
1201
- this.journey.destroy(), this.sendForwarded(), this.bus?.destroy(), this.drops.add("load_failed", this.pendingRecords.take()), await t, await this.senderLoad, e.pinned() === this && (Reflect.deleteProperty(globalThis, J), globalThis[Y] = this);
1332
+ this.journey.destroy(), this.sendForwarded(), this.bus?.destroy(), this.drops.add("load_failed", this.pendingRecords.take()), await t, await this.senderLoad, e.pinned() === this && (Reflect.deleteProperty(globalThis, q), globalThis[J] = this);
1202
1333
  }
1203
1334
  emit(e) {
1204
1335
  e && !this.destroyed && (this.sessionTouch.touch(this.identity.sessionId), this.ready ? this.route(e) : this.bootBuffer.push(e));
@@ -1223,7 +1354,7 @@ var Z = class e {
1223
1354
  }
1224
1355
  ingestForwarded(e) {
1225
1356
  if (!Array.isArray(e)) this.diagnostics.count("record.dropped_malformed");
1226
- else for (let t of e) D(t) ? Oe(t, this.config, this.remote.sampling?.current() ?? null) ? this.deliver(t) : this.diagnostics.count("record.dropped_by_sampling") : this.diagnostics.count("record.dropped_malformed");
1357
+ else for (let t of e) Ae(t) ? Me(t, this.config, this.remote.sampling?.current() ?? null) ? this.deliver(t) : this.diagnostics.count("record.dropped_by_sampling") : this.diagnostics.count("record.dropped_malformed");
1227
1358
  }
1228
1359
  releaseBootBuffer() {
1229
1360
  let e = this.bootBuffer.take(), t = this.journey.current();
@@ -1235,29 +1366,29 @@ var Z = class e {
1235
1366
  reportGap = (e, t) => {
1236
1367
  this.drops.add(e.reason, t.flatMap((e) => e.records), t.map((e) => e.id));
1237
1368
  let n = Date.now();
1238
- n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new F(() => this, be).warn("stored records were dropped before delivery", {
1369
+ n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new I(() => this, ye).warn("stored records were dropped before delivery", {
1239
1370
  "gap.batches": e.batches,
1240
1371
  "gap.records": e.records,
1241
1372
  "gap.reason": e.reason
1242
1373
  }));
1243
1374
  };
1244
1375
  regenerateTabId() {
1245
- let e = Fe(this.diagnostics);
1376
+ let e = ze(this.diagnostics);
1246
1377
  this.diagnostics.report("bus.role_resolved", "Another context uses this tab id. A duplicated tab is the usual cause. The library makes a new tab id.", {
1247
1378
  was: this.identity.tabId,
1248
1379
  now: e
1249
- }), this.identity.tabId = e, Pe(e, this.diagnostics, this.stores), this.builder.invalidateResource();
1380
+ }), this.identity.tabId = e, Re(e, this.diagnostics, this.stores), this.builder.invalidateResource();
1250
1381
  }
1251
1382
  async queueDepth() {
1252
1383
  return await this.senderLoad, await this.sender?.queueDepth() ?? 0;
1253
1384
  }
1254
1385
  async flush() {
1255
- this.ready || await this.started, this.role() === "forwarder" ? this.sendForwarded() : (await this.senderLoad, await this.sender?.flush());
1386
+ this.meter.collect(), this.ready || await this.started, this.role() === "forwarder" ? this.sendForwarded() : (await this.senderLoad, await this.sender?.flush());
1256
1387
  }
1257
1388
  };
1258
1389
  //#endregion
1259
1390
  //#region src/transport/memory-transport.ts
1260
- function vn() {
1391
+ function Mn() {
1261
1392
  let e = [], t = [], n = { status: 200 };
1262
1393
  return {
1263
1394
  transport: (r) => (e.push(r), n.status >= 200 && n.status < 300 && t.push(r), Promise.resolve({ ...n })),
@@ -1276,100 +1407,122 @@ function vn() {
1276
1407
  }
1277
1408
  //#endregion
1278
1409
  //#region src/index.ts
1279
- var yn = /* @__PURE__ */ new Map();
1410
+ var Nn = /* @__PURE__ */ new Map();
1280
1411
  function Q() {
1281
1412
  return (Z.current() ?? Z.stopped()) || Z.configure({}, !0);
1282
1413
  }
1283
- function bn(e) {
1414
+ function Pn(e) {
1284
1415
  Z.configure(e);
1285
1416
  }
1286
- function xn(e, t) {
1287
- if (t) return new F(Q, e, t);
1288
- let n = yn.get(e);
1289
- return n || (n = new F(Q, e), yn.set(e, n)), n;
1417
+ function Fn(e, t) {
1418
+ if (t) return new I(Q, e, t);
1419
+ let n = Nn.get(e);
1420
+ return n || (n = new I(Q, e), Nn.set(e, n)), n;
1290
1421
  }
1291
1422
  function $() {
1292
- return xn("app");
1423
+ return Fn("app");
1293
1424
  }
1294
- function Sn(e, t) {
1425
+ function In(e, t) {
1295
1426
  $().trace(e, t);
1296
1427
  }
1297
- function Cn(e, t) {
1428
+ function Ln(e, t) {
1298
1429
  $().debug(e, t);
1299
1430
  }
1300
- function wn(e, t) {
1431
+ function Rn(e, t) {
1301
1432
  $().info(e, t);
1302
1433
  }
1303
- function Tn(e, t) {
1434
+ function zn(e, t) {
1304
1435
  $().warn(e, t);
1305
1436
  }
1306
- function En(e, t, n) {
1437
+ function Bn(e, t, n) {
1307
1438
  $().error(e, t, n);
1308
1439
  }
1309
- function Dn(e, t, n) {
1440
+ function Vn(e, t, n) {
1310
1441
  $().fatal(e, t, n);
1311
1442
  }
1312
- function On(e, t) {
1443
+ function Hn(e, t) {
1313
1444
  $().logAction(e, t);
1314
1445
  }
1315
- function kn(e, t) {
1446
+ function Un(e, t) {
1316
1447
  $().logEvent(e, t);
1317
1448
  }
1318
- function An(e, t, n, r, i) {
1449
+ function Wn(e, t, n, r, i) {
1319
1450
  $().logMetric(e, t, n, r, i);
1320
1451
  }
1321
- function jn(e, t, n) {
1452
+ function Gn(e, t = {}) {
1453
+ let n = {
1454
+ name: e,
1455
+ kind: "counter",
1456
+ unit: t.unit ?? "count",
1457
+ boundaries: []
1458
+ };
1459
+ return { add: (e, t) => {
1460
+ Q().recordMetric(n, e, t);
1461
+ } };
1462
+ }
1463
+ function Kn(e, t = {}) {
1464
+ let n = {
1465
+ name: e,
1466
+ kind: "histogram",
1467
+ unit: t.unit ?? "count",
1468
+ boundaries: t.boundaries ?? ae
1469
+ };
1470
+ return { record: (e, t) => {
1471
+ Q().recordMetric(n, e, t);
1472
+ } };
1473
+ }
1474
+ function qn(e, t, n) {
1322
1475
  return $().timeSync(e, t, n);
1323
1476
  }
1324
- function Mn(e, t, n) {
1477
+ function Jn(e, t, n) {
1325
1478
  return $().timeAsync(e, t, n);
1326
1479
  }
1327
- function Nn(e, t) {
1480
+ function Yn(e, t) {
1328
1481
  Q().context.set(e, t);
1329
1482
  }
1330
- function Pn(e) {
1483
+ function Xn(e) {
1331
1484
  Q().context.setMany(e);
1332
1485
  }
1333
- function Fn(e) {
1486
+ function Zn(e) {
1334
1487
  Q().context.remove(e);
1335
1488
  }
1336
- function In(e, t) {
1489
+ function Qn(e, t) {
1337
1490
  return Q().journey.start(e, t);
1338
1491
  }
1339
- function Ln() {
1492
+ function $n() {
1340
1493
  Q().journey.end();
1341
1494
  }
1342
- function Rn() {
1495
+ function er() {
1343
1496
  return Q().journey.current();
1344
1497
  }
1345
- function zn() {
1498
+ function tr() {
1346
1499
  return Q().journey.getToken();
1347
1500
  }
1348
- function Bn(e) {
1501
+ function nr(e) {
1349
1502
  return Q().journey.adopt(e, "manual", !0);
1350
1503
  }
1351
- function Vn(e) {
1504
+ function rr(e) {
1352
1505
  Q().registerWorker(e);
1353
1506
  }
1354
- function Hn() {
1507
+ function ir() {
1355
1508
  Q().tracing.rotate("explicit");
1356
1509
  }
1357
- function Un() {
1510
+ function ar() {
1358
1511
  return Q().tracing.headers();
1359
1512
  }
1360
- function Wn() {
1513
+ function or() {
1361
1514
  return Q().flush();
1362
1515
  }
1363
- function Gn() {
1516
+ function sr() {
1364
1517
  return Q().queueDepth();
1365
1518
  }
1366
- function Kn() {
1519
+ function cr() {
1367
1520
  return Q().diagnostics.snapshot();
1368
1521
  }
1369
- async function qn() {
1522
+ async function lr() {
1370
1523
  await Z.current()?.destroy();
1371
1524
  }
1372
1525
  //#endregion
1373
- export { F as OneLogger, Bn as adoptJourney, bn as configure, vn as createMemoryTransport, Rn as currentJourney, Cn as debug, Ln as endJourney, En as error, Dn as fatal, Wn as flush, Kn as getDiagnosticCounters, zn as getJourneyToken, xn as getLogger, Gn as getQueueDepth, Un as getTraceHeaders, wn as info, On as logAction, kn as logEvent, An as logMetric, Vn as registerWorker, Fn as removeContext, Nn as setContext, Pn as setContextMap, qn as shutdown, In as startJourney, Hn as startTrace, Mn as timeAsync, jn as timeSync, Sn as trace, Tn as warn };
1526
+ export { I as OneLogger, nr as adoptJourney, Pn as configure, Gn as counter, Mn as createMemoryTransport, er as currentJourney, Ln as debug, $n as endJourney, Bn as error, Vn as fatal, or as flush, cr as getDiagnosticCounters, tr as getJourneyToken, Fn as getLogger, sr as getQueueDepth, ar as getTraceHeaders, Kn as histogram, Rn as info, Hn as logAction, Un as logEvent, Wn as logMetric, rr as registerWorker, Zn as removeContext, Yn as setContext, Xn as setContextMap, lr as shutdown, Qn as startJourney, ir as startTrace, Jn as timeAsync, qn as timeSync, In as trace, zn as warn };
1374
1527
 
1375
1528
  //# sourceMappingURL=index.js.map