@utk09/ui-observability 0.10.0 → 0.12.0

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 (406) hide show
  1. package/CHANGELOG.md +77 -1
  2. package/README.md +323 -113
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-BMdT9mKm.js → batch-BjQUwjA6.js} +5 -6
  5. package/dist/batch-BjQUwjA6.js.map +1 -0
  6. package/dist/{batch-BHXypM1j.cjs → batch-D5LlU4Q9.cjs} +2 -2
  7. package/dist/batch-D5LlU4Q9.cjs.map +1 -0
  8. package/dist/bus/bus.d.ts +48 -47
  9. package/dist/bus/links.d.ts +4 -4
  10. package/dist/bus/validation.d.ts +1 -1
  11. package/dist/bus-D_7pd7RN.cjs +2 -0
  12. package/dist/bus-D_7pd7RN.cjs.map +1 -0
  13. package/dist/{bus-DKfBaica.js → bus-ecxUNTja.js} +105 -109
  14. package/dist/bus-ecxUNTja.js.map +1 -0
  15. package/dist/capture/console.d.ts +10 -10
  16. package/dist/capture/errors.d.ts +6 -6
  17. package/dist/capture/interactions.d.ts +14 -14
  18. package/dist/capture/lifecycle.d.ts +3 -3
  19. package/dist/capture/long-frames.d.ts +6 -6
  20. package/dist/capture/network.d.ts +17 -17
  21. package/dist/capture/profiler-frames.d.ts +44 -0
  22. package/dist/capture/replay-buffer.d.ts +46 -0
  23. package/dist/capture/replay-upload.d.ts +74 -0
  24. package/dist/capture/replay.d.ts +114 -0
  25. package/dist/capture/reports.d.ts +2 -2
  26. package/dist/capture/resource-timing.d.ts +1 -1
  27. package/dist/capture/server-timing.d.ts +3 -3
  28. package/dist/capture/storm.d.ts +3 -3
  29. package/dist/capture/types.d.ts +45 -33
  30. package/dist/capture/unclean-exit.d.ts +8 -8
  31. package/dist/capture/user-timing.d.ts +3 -3
  32. package/dist/capture/web-socket.d.ts +11 -11
  33. package/dist/capture/web-vitals.d.ts +20 -7
  34. package/dist/compression-AJJCMBOa.js +11 -0
  35. package/dist/compression-AJJCMBOa.js.map +1 -0
  36. package/dist/compression-lD9abCcO.cjs +2 -0
  37. package/dist/compression-lD9abCcO.cjs.map +1 -0
  38. package/dist/console-CLz_PvFn.cjs +2 -0
  39. package/dist/console-CLz_PvFn.cjs.map +1 -0
  40. package/dist/{console-BX_0UCV7.js → console-cwgHKXvM.js} +14 -15
  41. package/dist/console-cwgHKXvM.js.map +1 -0
  42. package/dist/constants-Bwl_YtQi.js +349 -0
  43. package/dist/constants-Bwl_YtQi.js.map +1 -0
  44. package/dist/constants-DakMxVB2.cjs +2 -0
  45. package/dist/constants-DakMxVB2.cjs.map +1 -0
  46. package/dist/constants.d.ts +150 -103
  47. package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
  48. package/dist/{context-storage-DxZf4Gfh.js → context-storage-BzkoHzkQ.js} +2 -3
  49. package/dist/context-storage-BzkoHzkQ.js.map +1 -0
  50. package/dist/core/breadcrumbs.d.ts +16 -15
  51. package/dist/core/config.d.ts +3 -3
  52. package/dist/core/context.d.ts +7 -7
  53. package/dist/core/debug-buffer.d.ts +10 -10
  54. package/dist/core/debug-bundle.d.ts +3 -3
  55. package/dist/core/deferred.d.ts +2 -2
  56. package/dist/core/diagnostics.d.ts +24 -21
  57. package/dist/core/drops.d.ts +7 -7
  58. package/dist/core/hold-buffer.d.ts +1 -1
  59. package/dist/core/journey.d.ts +22 -23
  60. package/dist/core/logger.d.ts +22 -21
  61. package/dist/core/measure.d.ts +7 -7
  62. package/dist/core/meter.d.ts +25 -21
  63. package/dist/core/pipeline.d.ts +42 -41
  64. package/dist/core/profile-buckets.d.ts +31 -0
  65. package/dist/core/profiler.d.ts +218 -0
  66. package/dist/core/record.d.ts +23 -23
  67. package/dist/core/remote-rules.d.ts +4 -4
  68. package/dist/core/remote-sampling.d.ts +21 -20
  69. package/dist/core/runtime.d.ts +206 -137
  70. package/dist/core/sampling.d.ts +18 -18
  71. package/dist/core/sender.d.ts +22 -20
  72. package/dist/core/spans.d.ts +5 -5
  73. package/dist/{deadline-5_PecIl5.js → deadline-C4ccAuk5.js} +4 -9
  74. package/dist/deadline-C4ccAuk5.js.map +1 -0
  75. package/dist/deadline-CUGbto-y.cjs +2 -0
  76. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  77. package/dist/{debug-bundle-CZZ6SQQh.js → debug-bundle-BOdYmCeV.js} +12 -6
  78. package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
  79. package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
  80. package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
  81. package/dist/doctor.cjs +1 -1
  82. package/dist/doctor.cjs.map +1 -1
  83. package/dist/doctor.d.ts +16 -6
  84. package/dist/doctor.js +148 -54
  85. package/dist/doctor.js.map +1 -1
  86. package/dist/{emergency-queue-Cs8-i2xw.js → emergency-queue-B9WZxanZ.js} +15 -17
  87. package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
  88. package/dist/{emergency-queue-CQ-9acZf.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
  89. package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
  90. package/dist/{error-like-Ywo5uRHo.js → error-like-B11pB4aL.js} +2 -3
  91. package/dist/error-like-B11pB4aL.js.map +1 -0
  92. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  93. package/dist/{errors-oyxrpHjY.js → errors-D6bwgJtO.js} +5 -6
  94. package/dist/errors-D6bwgJtO.js.map +1 -0
  95. package/dist/{errors-CigX45pL.cjs → errors-DCOCRdSi.cjs} +2 -2
  96. package/dist/errors-DCOCRdSi.cjs.map +1 -0
  97. package/dist/{factory-BkjNzPYL.cjs → factory-DLFDjdLv.cjs} +2 -2
  98. package/dist/factory-DLFDjdLv.cjs.map +1 -0
  99. package/dist/{factory-Bgsky_e0.js → factory-e9Qo3K0z.js} +18 -22
  100. package/dist/factory-e9Qo3K0z.js.map +1 -0
  101. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  102. package/dist/{fixed-window-CtaFHanJ.js → fixed-window-Dq3MLUUv.js} +2 -3
  103. package/dist/fixed-window-Dq3MLUUv.js.map +1 -0
  104. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  105. package/dist/{global-scope-dp2jADRl.js → global-scope-D9I8s-oN.js} +2 -3
  106. package/dist/global-scope-D9I8s-oN.js.map +1 -0
  107. package/dist/{guards-CpvOpJL6.js → guards-Cidk71ME.js} +2 -3
  108. package/dist/guards-Cidk71ME.js.map +1 -0
  109. package/dist/guards-nJ70syPt.cjs.map +1 -1
  110. package/dist/{identity-BMlKGHUM.cjs → identity-BlvlgjrU.cjs} +2 -2
  111. package/dist/identity-BlvlgjrU.cjs.map +1 -0
  112. package/dist/{identity-DOaHdfhT.js → identity-BrQp_5J5.js} +20 -21
  113. package/dist/identity-BrQp_5J5.js.map +1 -0
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.cjs.map +1 -1
  116. package/dist/index.d.ts +112 -79
  117. package/dist/index.js +797 -659
  118. package/dist/index.js.map +1 -1
  119. package/dist/{indexeddb-storage-CaXGJqDD.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
  120. package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
  121. package/dist/{indexeddb-storage-D-lUW_5P.js → indexeddb-storage-DLXQzAGh.js} +5 -6
  122. package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
  123. package/dist/{interactions-CqDNrtIR.js → interactions-B6z2I4tU.js} +10 -11
  124. package/dist/interactions-B6z2I4tU.js.map +1 -0
  125. package/dist/{interactions-8DgxtmgO.cjs → interactions-P6pz08Jn.cjs} +2 -2
  126. package/dist/interactions-P6pz08Jn.cjs.map +1 -0
  127. package/dist/{journey-DgIjhrIc.js → journey-35yCMNFo.js} +21 -21
  128. package/dist/journey-35yCMNFo.js.map +1 -0
  129. package/dist/journey-DAGh5h9k.cjs +2 -0
  130. package/dist/journey-DAGh5h9k.cjs.map +1 -0
  131. package/dist/keys-BHhw_0Wh.cjs.map +1 -1
  132. package/dist/{keys-D5r_GH9q.js → keys-BU9j5YqW.js} +2 -3
  133. package/dist/keys-BU9j5YqW.js.map +1 -0
  134. package/dist/{library-console-g_VU-wzP.cjs → library-console-BFWEuQsl.cjs} +2 -2
  135. package/dist/library-console-BFWEuQsl.cjs.map +1 -0
  136. package/dist/library-console-Dl_Ly6DQ.js +13 -0
  137. package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
  138. package/dist/{library-request-FQaiWjCP.cjs → library-request-Da-CHKzT.cjs} +2 -2
  139. package/dist/library-request-Da-CHKzT.cjs.map +1 -0
  140. package/dist/{library-request-CyC-9IOk.js → library-request-nI6pvI6I.js} +4 -5
  141. package/dist/library-request-nI6pvI6I.js.map +1 -0
  142. package/dist/{lifecycle-C2z_d8OX.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
  143. package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
  144. package/dist/{lifecycle-BLC4VU7c.js → lifecycle-CZ6RRXc6.js} +3 -4
  145. package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
  146. package/dist/{log-record-DKvo-B-d.cjs → log-record-D7bA1RPb.cjs} +2 -2
  147. package/dist/log-record-D7bA1RPb.cjs.map +1 -0
  148. package/dist/{log-record-CndanC-p.js → log-record-DIA6McNr.js} +3 -4
  149. package/dist/log-record-DIA6McNr.js.map +1 -0
  150. package/dist/{long-frames-BQef9rXR.js → long-frames-430_85Da.js} +9 -8
  151. package/dist/long-frames-430_85Da.js.map +1 -0
  152. package/dist/long-frames-Dd8tsi2U.cjs +2 -0
  153. package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
  154. package/dist/models/batch.d.ts +14 -15
  155. package/dist/models/bus.d.ts +24 -24
  156. package/dist/models/config.d.ts +402 -216
  157. package/dist/models/drop.d.ts +13 -11
  158. package/dist/models/health.d.ts +13 -13
  159. package/dist/models/log-record.d.ts +13 -14
  160. package/dist/models/metric.d.ts +82 -17
  161. package/dist/models/plugin.d.ts +13 -13
  162. package/dist/models/replay.d.ts +60 -0
  163. package/dist/models/serializer.d.ts +2 -3
  164. package/dist/models/stats.d.ts +2 -2
  165. package/dist/models/storage.d.ts +12 -11
  166. package/dist/{network-CvkvYzRU.js → network-C7SkLf4v.js} +30 -32
  167. package/dist/network-C7SkLf4v.js.map +1 -0
  168. package/dist/{network-CqnQOqon.cjs → network-pEX3PAJv.cjs} +2 -2
  169. package/dist/network-pEX3PAJv.cjs.map +1 -0
  170. package/dist/openfin-Bxelt0yg.js +7 -0
  171. package/dist/openfin-Bxelt0yg.js.map +1 -0
  172. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  173. package/dist/otlp-2MCrC3kd.cjs +2 -0
  174. package/dist/otlp-2MCrC3kd.cjs.map +1 -0
  175. package/dist/{otlp-CYIL7MOE.js → otlp-COq033e3.js} +26 -35
  176. package/dist/otlp-COq033e3.js.map +1 -0
  177. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  178. package/dist/{patch-CCWfuEY7.js → patch-UdPz1ea8.js} +2 -3
  179. package/dist/patch-UdPz1ea8.js.map +1 -0
  180. package/dist/{platform-KMWkoI-v.cjs → platform-12uR7kBQ.cjs} +2 -2
  181. package/dist/platform-12uR7kBQ.cjs.map +1 -0
  182. package/dist/{platform-wcAkkv9F.js → platform-CVewe4wQ.js} +9 -10
  183. package/dist/platform-CVewe4wQ.js.map +1 -0
  184. package/dist/profiler-BVWIOgnq.js +310 -0
  185. package/dist/profiler-BVWIOgnq.js.map +1 -0
  186. package/dist/profiler-eVCknCzS.cjs +2 -0
  187. package/dist/profiler-eVCknCzS.cjs.map +1 -0
  188. package/dist/profiler-frames-CLXlT_xL.js +86 -0
  189. package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
  190. package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
  191. package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
  192. package/dist/{remote-rules-CH_7PphT.js → remote-rules-BJGDJGwA.js} +29 -30
  193. package/dist/remote-rules-BJGDJGwA.js.map +1 -0
  194. package/dist/{remote-rules-BL8km4xk.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
  195. package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
  196. package/dist/replay-0zAJv9T3.js +338 -0
  197. package/dist/replay-0zAJv9T3.js.map +1 -0
  198. package/dist/replay-DomJpXqW.cjs +2 -0
  199. package/dist/replay-DomJpXqW.cjs.map +1 -0
  200. package/dist/{reports-Bh_-KpZ2.cjs → reports-BsbqmP8h.cjs} +2 -2
  201. package/dist/reports-BsbqmP8h.cjs.map +1 -0
  202. package/dist/{reports-BOKyY3_A.js → reports-BuXekPOS.js} +4 -5
  203. package/dist/reports-BuXekPOS.js.map +1 -0
  204. package/dist/{resource-timing-BROnEJ0E.js → resource-timing-CXGHwFRD.js} +6 -7
  205. package/dist/resource-timing-CXGHwFRD.js.map +1 -0
  206. package/dist/{resource-timing-CbgwNpog.cjs → resource-timing-DkycFGDa.cjs} +2 -2
  207. package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
  208. package/dist/{sampling-ECGVYiDD.cjs → sampling-Dd0wllyq.cjs} +2 -2
  209. package/dist/sampling-Dd0wllyq.cjs.map +1 -0
  210. package/dist/{sampling-BLO_pcV4.js → sampling-UUDbi3K0.js} +11 -12
  211. package/dist/sampling-UUDbi3K0.js.map +1 -0
  212. package/dist/{sanitize-DS0G4_ea.js → sanitize-CNmsD9r3.js} +4 -5
  213. package/dist/sanitize-CNmsD9r3.js.map +1 -0
  214. package/dist/{sanitize-Bsn8HQWC.cjs → sanitize-ChLn97Ch.cjs} +2 -2
  215. package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
  216. package/dist/{select-DWO0-w8_.cjs → select-CTk-K5mG.cjs} +3 -3
  217. package/dist/select-CTk-K5mG.cjs.map +1 -0
  218. package/dist/{select-wqt9Wxio.js → select-DPv_j6wq.js} +64 -67
  219. package/dist/select-DPv_j6wq.js.map +1 -0
  220. package/dist/{sender-BkAVt-Rq.js → sender-15zEsZpr.js} +98 -101
  221. package/dist/sender-15zEsZpr.js.map +1 -0
  222. package/dist/sender-Bfpv9tad.cjs +2 -0
  223. package/dist/sender-Bfpv9tad.cjs.map +1 -0
  224. package/dist/storage/context-storage.d.ts +34 -33
  225. package/dist/storage/emergency-queue.d.ts +9 -9
  226. package/dist/storage/eviction.d.ts +12 -12
  227. package/dist/storage/factory.d.ts +8 -7
  228. package/dist/storage/gap.d.ts +6 -6
  229. package/dist/storage/idb-driver.d.ts +31 -32
  230. package/dist/storage/indexeddb-storage.d.ts +26 -27
  231. package/dist/storage/keys.d.ts +7 -7
  232. package/dist/storage/local-storage.d.ts +38 -38
  233. package/dist/storage/memory-storage.d.ts +21 -22
  234. package/dist/storage/persistence.d.ts +1 -1
  235. package/dist/storage-BA9RqRO-.cjs.map +1 -1
  236. package/dist/{storage-w7Tslvlq.js → storage-DZwed89z.js} +2 -3
  237. package/dist/storage-DZwed89z.js.map +1 -0
  238. package/dist/{storm-DD4cUkoL.js → storm-BTSNTIWI.js} +4 -5
  239. package/dist/storm-BTSNTIWI.js.map +1 -0
  240. package/dist/{storm-DCEsqViG.cjs → storm-D0_qZOEg.cjs} +2 -2
  241. package/dist/storm-D0_qZOEg.cjs.map +1 -0
  242. package/dist/transport/compression.d.ts +2 -2
  243. package/dist/transport/errors.d.ts +7 -7
  244. package/dist/transport/exit-flush.d.ts +39 -39
  245. package/dist/transport/headers.d.ts +2 -2
  246. package/dist/transport/http-transport.d.ts +28 -27
  247. package/dist/transport/memory-transport.d.ts +6 -6
  248. package/dist/transport/retry-engine.d.ts +35 -34
  249. package/dist/transport/serializers/ecs.d.ts +1 -1
  250. package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
  251. package/dist/transport/serializers/otlp-traces.d.ts +1 -1
  252. package/dist/transport/serializers/otlp.d.ts +16 -16
  253. package/dist/transport/serializers/select.d.ts +7 -7
  254. package/dist/transport/status-transport.d.ts +20 -20
  255. package/dist/transport/worker-protocol.d.ts +3 -3
  256. package/dist/{types-BR9t_w28.js → types-BAerHgCq.js} +2 -3
  257. package/dist/types-BAerHgCq.js.map +1 -0
  258. package/dist/types-C7WNpnG1.cjs.map +1 -1
  259. package/dist/{unclean-exit-CwdpbUDg.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
  260. package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
  261. package/dist/{unclean-exit-BYZ5yaSI.js → unclean-exit-Cob_jyTv.js} +3 -4
  262. package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
  263. package/dist/unref-CU9Nyz_9.cjs +2 -0
  264. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  265. package/dist/unref-DgHPQeWv.js +7 -0
  266. package/dist/unref-DgHPQeWv.js.map +1 -0
  267. package/dist/user-timing-CdYqx3PF.cjs +2 -0
  268. package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
  269. package/dist/{user-timing-Di2ra5DB.js → user-timing-DgHubxCI.js} +7 -6
  270. package/dist/user-timing-DgHubxCI.js.map +1 -0
  271. package/dist/utils/console.d.ts +2 -2
  272. package/dist/utils/deadline.d.ts +4 -4
  273. package/dist/utils/error-like.d.ts +7 -7
  274. package/dist/utils/fixed-window.d.ts +9 -8
  275. package/dist/utils/global-scope.d.ts +8 -8
  276. package/dist/utils/guards.d.ts +2 -2
  277. package/dist/utils/identity.d.ts +17 -17
  278. package/dist/utils/library-console.d.ts +4 -4
  279. package/dist/utils/library-request.d.ts +10 -10
  280. package/dist/utils/lock.d.ts +10 -9
  281. package/dist/utils/openfin.d.ts +5 -5
  282. package/dist/utils/patch.d.ts +6 -6
  283. package/dist/utils/platform.d.ts +13 -11
  284. package/dist/utils/sanitize.d.ts +4 -4
  285. package/dist/utils/timer.d.ts +1 -1
  286. package/dist/utils/tracing.d.ts +38 -38
  287. package/dist/utils/unref.d.ts +3 -3
  288. package/dist/{web-socket-DwBNhgre.cjs → web-socket-BTuvYoJI.cjs} +2 -2
  289. package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
  290. package/dist/{web-socket-B-5qqPy7.js → web-socket-DthJuSAg.js} +14 -15
  291. package/dist/web-socket-DthJuSAg.js.map +1 -0
  292. package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
  293. package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
  294. package/dist/web-vitals-CsGCWnUr.js +77 -0
  295. package/dist/web-vitals-CsGCWnUr.js.map +1 -0
  296. package/dist/{worker-protocol-0HMf4-kY.js → worker-protocol-B0_8rWy5.js} +6 -7
  297. package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
  298. package/dist/{worker-protocol-DXekoADQ.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
  299. package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
  300. package/dist/worker-server-4en-Lt-3.cjs +2 -0
  301. package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
  302. package/dist/{worker-server-CKcmX5m5.js → worker-server-Cne9MX9I.js} +25 -26
  303. package/dist/{worker-server-CKcmX5m5.js.map → worker-server-Cne9MX9I.js.map} +1 -1
  304. package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
  305. package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
  306. package/dist/{worker-transport-2220ghFZ.js → worker-transport-C3SjJAEC.js} +64 -65
  307. package/dist/worker-transport-C3SjJAEC.js.map +1 -0
  308. package/package.json +33 -41
  309. package/dist/batch-BHXypM1j.cjs.map +0 -1
  310. package/dist/batch-BMdT9mKm.js.map +0 -1
  311. package/dist/bus-DKfBaica.js.map +0 -1
  312. package/dist/bus-Dea9rVhy.cjs +0 -2
  313. package/dist/bus-Dea9rVhy.cjs.map +0 -1
  314. package/dist/console-BX_0UCV7.js.map +0 -1
  315. package/dist/console-DZEcs7FL.cjs +0 -2
  316. package/dist/console-DZEcs7FL.cjs.map +0 -1
  317. package/dist/constants-CL0ZdI2f.cjs +0 -2
  318. package/dist/constants-CL0ZdI2f.cjs.map +0 -1
  319. package/dist/constants-CU60FG4w.js +0 -305
  320. package/dist/constants-CU60FG4w.js.map +0 -1
  321. package/dist/context-storage-DxZf4Gfh.js.map +0 -1
  322. package/dist/deadline-5_PecIl5.js.map +0 -1
  323. package/dist/deadline-XSnm95pg.cjs +0 -2
  324. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  325. package/dist/debug-bundle-CZZ6SQQh.js.map +0 -1
  326. package/dist/debug-bundle-yRkrU1ny.cjs +0 -2
  327. package/dist/debug-bundle-yRkrU1ny.cjs.map +0 -1
  328. package/dist/emergency-queue-CQ-9acZf.cjs.map +0 -1
  329. package/dist/emergency-queue-Cs8-i2xw.js.map +0 -1
  330. package/dist/error-like-Ywo5uRHo.js.map +0 -1
  331. package/dist/errors-CigX45pL.cjs.map +0 -1
  332. package/dist/errors-oyxrpHjY.js.map +0 -1
  333. package/dist/factory-Bgsky_e0.js.map +0 -1
  334. package/dist/factory-BkjNzPYL.cjs.map +0 -1
  335. package/dist/fixed-window-CtaFHanJ.js.map +0 -1
  336. package/dist/global-scope-dp2jADRl.js.map +0 -1
  337. package/dist/guards-CpvOpJL6.js.map +0 -1
  338. package/dist/identity-BMlKGHUM.cjs.map +0 -1
  339. package/dist/identity-DOaHdfhT.js.map +0 -1
  340. package/dist/indexeddb-storage-CaXGJqDD.cjs.map +0 -1
  341. package/dist/indexeddb-storage-D-lUW_5P.js.map +0 -1
  342. package/dist/interactions-8DgxtmgO.cjs.map +0 -1
  343. package/dist/interactions-CqDNrtIR.js.map +0 -1
  344. package/dist/journey-5tcxEbnG.cjs +0 -2
  345. package/dist/journey-5tcxEbnG.cjs.map +0 -1
  346. package/dist/journey-DgIjhrIc.js.map +0 -1
  347. package/dist/keys-D5r_GH9q.js.map +0 -1
  348. package/dist/library-console-CabK2j2-.js +0 -14
  349. package/dist/library-console-CabK2j2-.js.map +0 -1
  350. package/dist/library-console-g_VU-wzP.cjs.map +0 -1
  351. package/dist/library-request-CyC-9IOk.js.map +0 -1
  352. package/dist/library-request-FQaiWjCP.cjs.map +0 -1
  353. package/dist/lifecycle-BLC4VU7c.js.map +0 -1
  354. package/dist/lifecycle-C2z_d8OX.cjs.map +0 -1
  355. package/dist/log-record-CndanC-p.js.map +0 -1
  356. package/dist/log-record-DKvo-B-d.cjs.map +0 -1
  357. package/dist/long-frames-BQef9rXR.js.map +0 -1
  358. package/dist/long-frames-CV5ZG2cx.cjs +0 -2
  359. package/dist/long-frames-CV5ZG2cx.cjs.map +0 -1
  360. package/dist/network-CqnQOqon.cjs.map +0 -1
  361. package/dist/network-CvkvYzRU.js.map +0 -1
  362. package/dist/openfin-BwEN0uj4.js +0 -8
  363. package/dist/openfin-BwEN0uj4.js.map +0 -1
  364. package/dist/otlp-CYIL7MOE.js.map +0 -1
  365. package/dist/otlp-RVbkNQRh.cjs +0 -2
  366. package/dist/otlp-RVbkNQRh.cjs.map +0 -1
  367. package/dist/patch-CCWfuEY7.js.map +0 -1
  368. package/dist/platform-KMWkoI-v.cjs.map +0 -1
  369. package/dist/platform-wcAkkv9F.js.map +0 -1
  370. package/dist/remote-rules-BL8km4xk.cjs.map +0 -1
  371. package/dist/remote-rules-CH_7PphT.js.map +0 -1
  372. package/dist/reports-BOKyY3_A.js.map +0 -1
  373. package/dist/reports-Bh_-KpZ2.cjs.map +0 -1
  374. package/dist/resource-timing-BROnEJ0E.js.map +0 -1
  375. package/dist/resource-timing-CbgwNpog.cjs.map +0 -1
  376. package/dist/sampling-BLO_pcV4.js.map +0 -1
  377. package/dist/sampling-ECGVYiDD.cjs.map +0 -1
  378. package/dist/sanitize-Bsn8HQWC.cjs.map +0 -1
  379. package/dist/sanitize-DS0G4_ea.js.map +0 -1
  380. package/dist/select-DWO0-w8_.cjs.map +0 -1
  381. package/dist/select-wqt9Wxio.js.map +0 -1
  382. package/dist/sender-BkAVt-Rq.js.map +0 -1
  383. package/dist/sender-D82PxlCY.cjs +0 -2
  384. package/dist/sender-D82PxlCY.cjs.map +0 -1
  385. package/dist/storage-w7Tslvlq.js.map +0 -1
  386. package/dist/storm-DCEsqViG.cjs.map +0 -1
  387. package/dist/storm-DD4cUkoL.js.map +0 -1
  388. package/dist/types-BR9t_w28.js.map +0 -1
  389. package/dist/unclean-exit-BYZ5yaSI.js.map +0 -1
  390. package/dist/unclean-exit-CwdpbUDg.cjs.map +0 -1
  391. package/dist/user-timing-C1kB3JEg.cjs +0 -2
  392. package/dist/user-timing-C1kB3JEg.cjs.map +0 -1
  393. package/dist/user-timing-Di2ra5DB.js.map +0 -1
  394. package/dist/web-socket-B-5qqPy7.js.map +0 -1
  395. package/dist/web-socket-DwBNhgre.cjs.map +0 -1
  396. package/dist/web-vitals-Bflr5jSA.js +0 -53
  397. package/dist/web-vitals-Bflr5jSA.js.map +0 -1
  398. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  399. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  400. package/dist/worker-protocol-0HMf4-kY.js.map +0 -1
  401. package/dist/worker-protocol-DXekoADQ.cjs.map +0 -1
  402. package/dist/worker-server-BQK5z2yl.cjs +0 -2
  403. package/dist/worker-server-BQK5z2yl.cjs.map +0 -1
  404. package/dist/worker-transport-2220ghFZ.js.map +0 -1
  405. package/dist/worker-transport-Dj2yCQN5.cjs +0 -2
  406. package/dist/worker-transport-Dj2yCQN5.cjs.map +0 -1
@@ -9,12 +9,12 @@ export interface BatchTransport {
9
9
  /**
10
10
  * Sends one batch.
11
11
  * @param batch Batch to send.
12
- * @param onKeepalive Runs when a request of the batch starts with keepalive.
13
- * @throws TransportError when the batch is not accepted.
12
+ * @param onKeepalive Runs when one of the batch's requests starts with keepalive.
13
+ * @throws TransportError when the batch isn't accepted.
14
14
  */
15
15
  send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
16
16
  /**
17
- * Returns the remaining throttle delay of the endpoint of a batch.
17
+ * Returns the remaining throttle delay for a batch's endpoint.
18
18
  * @param batch Batch to send.
19
19
  * @returns Milliseconds until the throttle ends, or 0.
20
20
  */
@@ -38,12 +38,12 @@ export declare abstract class StatusTransport implements BatchTransport {
38
38
  private readonly onClock;
39
39
  /** Abort controller shared by the requests of this delivery context. */
40
40
  protected readonly cancellation: AbortController;
41
- /** Cancels work of this context. A custom transport receives the same abort signal. */
41
+ /** Cancels this context's work. A custom transport receives the same abort signal. */
42
42
  stop(): void;
43
43
  /**
44
- * Checks the batch context after each asynchronous step and before a send.
44
+ * Checks the batch context after every asynchronous step and before a send.
45
45
  * @param batch Batch to check.
46
- * @throws TransportError if the context stopped or the context id does not match.
46
+ * @throws TransportError if the context stopped or the context id doesn't match.
47
47
  */
48
48
  protected assertContext(batch: LogBatch): void;
49
49
  /**
@@ -54,8 +54,8 @@ export declare abstract class StatusTransport implements BatchTransport {
54
54
  */
55
55
  protected untilCancelled<T>(work: Promise<T>): Promise<T>;
56
56
  /**
57
- * Epoch time in milliseconds when the server throttle ends, for each endpoint. A 429 from
58
- * metricsEndpoint must not stop the log batches.
57
+ * Epoch time in milliseconds when the server throttle ends, per endpoint, so that a 429 from
58
+ * metricsEndpoint doesn't stop the log batches.
59
59
  */
60
60
  private readonly throttledUntil;
61
61
  /** Epoch time in milliseconds when the server last accepted a batch, or null. */
@@ -63,20 +63,20 @@ export declare abstract class StatusTransport implements BatchTransport {
63
63
  /**
64
64
  * @param config Active configuration instance.
65
65
  * @param diagnostics Diagnostics reporter.
66
- * @param onSampling Receives the sampling rules of an accepted batch, before validation.
67
- * @param onLoss Receives the records of a batch that the serializer cannot encode.
68
- * @param onClock Receives the clock offset of an accepted batch, in milliseconds.
66
+ * @param onSampling Receives an accepted batch's sampling rules, before validation.
67
+ * @param onLoss Receives the records of a batch that the serializer can't encode.
68
+ * @param onClock Receives an accepted batch's clock offset, in milliseconds.
69
69
  */
70
70
  constructor(config: ResolvedConfig, diagnostics: Diagnostics, onSampling?: (raw: unknown) => void, onLoss?: LossReporter, onClock?: (offsetMs: number) => void);
71
71
  /**
72
72
  * Sends one batch.
73
73
  * @param batch Batch to send.
74
- * @param onKeepalive Runs when a request of the batch starts with keepalive.
75
- * @throws TransportError when the batch is not accepted.
74
+ * @param onKeepalive Runs when one of the batch's requests starts with keepalive.
75
+ * @throws TransportError when the batch isn't accepted.
76
76
  */
77
77
  abstract send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
78
78
  /**
79
- * Returns the remaining throttle delay of the endpoint of a batch, in milliseconds.
79
+ * Returns the remaining throttle delay for a batch's endpoint, in milliseconds.
80
80
  * @param batch Batch to send.
81
81
  * @returns Milliseconds remaining in throttle window, or 0 if unthrottled.
82
82
  */
@@ -88,21 +88,21 @@ export declare abstract class StatusTransport implements BatchTransport {
88
88
  lastSendAt(): number | null;
89
89
  /**
90
90
  * Serializes a batch with the configured serializer. A metrics batch gets the OTLP metrics
91
- * format. It reports a serializer that throws.
91
+ * format. Reports a serializer that throws.
92
92
  * @param batch Batch to serialize.
93
93
  * @returns The serialized batch, or undefined if the serializer threw.
94
94
  */
95
95
  protected serialize(batch: LogBatch): SerializedBatch | undefined;
96
96
  /**
97
- * Records an accepted batch. It ends the server throttle of the endpoint of the batch.
97
+ * Records an accepted batch and ends the server throttle for that batch's endpoint.
98
98
  * @param kind Kind of the accepted batch.
99
- * @param sampling Sampling rules of the answer, as text or as an object.
100
- * @param date Date header of the answer. It is null when the server does not expose it.
99
+ * @param sampling The answer's sampling rules, as text or as an object.
100
+ * @param date The answer's Date header. Null when the server doesn't expose it.
101
101
  */
102
102
  protected accept(kind: BatchKind, sampling: unknown, date: unknown): void;
103
103
  /**
104
- * Converts a status code that is not 2xx into a classified TransportError.
105
- * @param status Status code of the answer.
104
+ * Converts a non-2xx status code into a classified TransportError.
105
+ * @param status The answer's status code.
106
106
  * @param batchId Identifier of the rejected batch.
107
107
  * @param kind Kind of the rejected batch. A throttle applies only to its endpoint.
108
108
  * @param hints Delay, size limit and advice that come with the answer.
@@ -22,13 +22,13 @@ export interface WorkerResponse {
22
22
  maxBytes?: number;
23
23
  compressionFailed?: boolean;
24
24
  }
25
- /** A worker failure has no app exception text. */
25
+ /** A worker failure never carries app exception text. */
26
26
  export type WorkerResult = WorkerResponse | {
27
27
  failure: "serialize" | "network" | "timeout" | "protocol";
28
28
  };
29
- /** Makes a versioned message for the private channel. */
29
+ /** Builds a versioned message for the private channel. */
30
30
  export declare function workerMessage(type: string, fields?: Record<string, unknown>): Record<string, unknown>;
31
- /** Tests the protocol and the exact library version. */
31
+ /** Checks the protocol and the exact library version. */
32
32
  export declare function isWorkerMessage(value: unknown): value is Record<string, unknown>;
33
33
  /** Validates a result before it changes the main transport state. */
34
34
  export declare function isWorkerResult(value: unknown): value is WorkerResult;
@@ -1,8 +1,7 @@
1
- //#region src/capture/types.ts
1
+ // src/capture/types.ts
2
2
  function e(e, t) {
3
3
  return typeof e == "string" && t.some((t) => typeof t == "string" ? e.includes(t) : t.test(e));
4
4
  }
5
- //#endregion
6
5
  export { e as t };
7
6
 
8
- //# sourceMappingURL=types-BR9t_w28.js.map
7
+ //# sourceMappingURL=types-BAerHgCq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BAerHgCq.js","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, the logger abstraction and helpers for the auto-capture modules.\n\nimport type { BreadcrumbBuffer } from \"../core/breadcrumbs\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport type { SpanData } from \"../core/spans\";\nimport type { ResolvedConfig } from \"../models/config\";\nimport type { LogRecord, MetricType } from \"../models/log-record\";\nimport type { InstrumentDef, MetricAttributes } from \"../models/metric\";\nimport type { TraceEngine } from \"../utils/tracing\";\n\n/**\n * The logging interface the auto-capture modules use. Referring to the runtime class here\n * would create an import cycle, because the runtime installs the capture modules.\n */\nexport interface CaptureLogger {\n /**\n * Logs an error event, with the error or reason behind it.\n * @param message Error description.\n * @param error The caught error or reason.\n * @param payload Optional attributes.\n */\n error(message: string, error?: unknown, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a warning event.\n * @param message Warning description.\n * @param payload Optional attributes.\n */\n warn(message: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a single lifecycle or user event.\n * @param name Event identifier.\n * @param payload Optional attributes.\n */\n logEvent(name: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a numeric metric measurement.\n * @param name Metric name.\n * @param value The measurement.\n * @param unit Unit of measurement.\n * @param type Metric type.\n * @param attrs Optional metric attributes.\n */\n logMetric(\n name: string,\n value: number,\n unit?: string,\n type?: MetricType,\n attrs?: Record<string, unknown>,\n ): void;\n\n /**\n * Logs a debug message.\n * @param message Debug message.\n * @param payload Optional attributes.\n */\n debug(message: string, payload?: Record<string, unknown>): void;\n}\n\n/**\n * Capture work that runs once per document, not once per install. A reconfigure\n * builds new capture instances, so instance state can't hold these flags.\n * web-vitals has no unsubscribe, and a second subscription would report every\n * metric twice.\n */\nexport interface CaptureOnce {\n /** True once the web-vitals reporters are subscribed. */\n webVitals: boolean;\n /** True once navigation timing has been reported. */\n navigationTiming: boolean;\n /** True after the first long frame install. Only that install reads buffered frames. */\n longFrames: boolean;\n /** True once we've read the previous page's alive marker. */\n uncleanExit: boolean;\n /** True after the first user timing install. Only that install reads buffered entries. */\n userTiming: boolean;\n /** True after the first resource timing install. Later installs skip buffered entries. */\n resourceTiming?: boolean;\n /** Page state and when it started. A reinstall keeps them, so it logs no false transition. */\n lifecycle?: { state: string; enteredAt: number };\n /** Set once the frame phases capture has reported a browser without long animation frames. */\n framePhases?: boolean;\n /** Set once the profiler's frame pacing has reported a context without frame callbacks. */\n framePacing?: boolean;\n /** Set once session replay has reported why it can't record in this document. */\n replay?: boolean;\n}\n\n/** Runtime dependencies shared by all auto-capture instances. */\nexport interface CaptureContext {\n /** False while the runtime is stopping or changing its security context. */\n isActive?: () => boolean;\n /** Active runtime configuration. */\n config: ResolvedConfig;\n /** Diagnostics reporter for capture faults. */\n diagnostics: Diagnostics;\n /** Logger for the telemetry the captures record. */\n logger: CaptureLogger;\n /** Breadcrumb buffer. */\n breadcrumbs: BreadcrumbBuffer;\n /** Active trace context provider. */\n tracing: TraceEngine;\n /** Guards for capture work that a reinstall must not repeat. */\n once: CaptureOnce;\n /** Adds a value to one of the runtime's counters or histograms. */\n recordMetric: (def: InstrumentDef, value: number, attributes?: MetricAttributes) => void;\n /** Records a span. The runtime drops it when spans are off. */\n recordSpan: (span: SpanData) => void;\n /** Returns the current session id. */\n sessionId: () => string;\n /** Sets or clears the hook that receives every ERROR and FATAL record from the runtime. */\n onError?: (hook: ((record: LogRecord) => void) | undefined) => void;\n /** Sets an ambient attribute on every later record. Undefined removes it. */\n setContext?: (key: string, value: string | undefined) => void;\n /** True after startReplay(), false after stopReplay(), undefined if neither was called. */\n replayConsent?: () => boolean | undefined;\n}\n\n/** Lifecycle interface for the browser instrumentation modules. */\nexport interface Capture {\n /** Module identifier used in diagnostics. */\n readonly name: string;\n /**\n * Attaches the instrumentation listeners and patches the target APIs. Patching an\n * already patched function adds a second wrapper and doubles every record, so a\n * second call must do nothing.\n */\n install(): void;\n /** Restores the native APIs and removes the listeners. */\n uninstall(): void;\n}\n\n/**\n * Checks whether a URL matches any of the substring or regular expression patterns.\n * @param url URL to test. A value that isn't a string matches nothing.\n * @param patterns Substrings and regular expressions to test against.\n * @returns True if any pattern matches the URL.\n */\nexport function matchesAny(url: unknown, patterns: (string | RegExp)[]): boolean {\n // Guard against a URL that isn't a string. includes() on it would throw inside the host's call.\n if (typeof url !== \"string\") {\n return false;\n }\n\n return patterns.some((pattern) =>\n typeof pattern === \"string\" ? url.includes(pattern) : pattern.test(url),\n );\n}\n"],"mappings":";AA8IA,SAAgBA,EAAW,GAAc,GAAwC;CAM/E,OAJI,OAAOC,KAAQ,YAIZC,EAAS,MAAM,MACpB,OAAOC,KAAY,WAAWF,EAAI,SAASE,CAAO,IAAIA,EAAQ,KAAKF,CAAG,CACxE;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"types-C7WNpnG1.cjs","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, logger abstractions, and utility helpers for auto-capture modules.\n\nimport type { BreadcrumbBuffer } from \"../core/breadcrumbs\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport type { SpanData } from \"../core/spans\";\nimport type { ResolvedConfig } from \"../models/config\";\nimport type { MetricType } from \"../models/log-record\";\nimport type { InstrumentDef, MetricAttributes } from \"../models/metric\";\nimport type { TraceEngine } from \"../utils/tracing\";\n\n/**\n * Logging interface that auto-capture modules use. A reference to the runtime class\n * here causes an import cycle. The runtime installs the capture modules.\n */\nexport interface CaptureLogger {\n /**\n * Logs an error event with an associated error instance or reason.\n * @param message Error description.\n * @param error Caught error instance or reason.\n * @param payload Optional attributes.\n */\n error(message: string, error?: unknown, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a warning event.\n * @param message Warning description.\n * @param payload Optional attributes.\n */\n warn(message: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a discrete lifecycle or user event.\n * @param name Event identifier.\n * @param payload Optional attributes.\n */\n logEvent(name: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a numerical metric measurement.\n * @param name Metric name.\n * @param value Numerical measurement.\n * @param unit Unit of measurement.\n * @param type Metric type classification.\n * @param attrs Optional metric attributes.\n */\n logMetric(\n name: string,\n value: number,\n unit?: string,\n type?: MetricType,\n attrs?: Record<string, unknown>,\n ): void;\n\n /**\n * Logs a diagnostic debug message.\n * @param message Debug message.\n * @param payload Optional attributes.\n */\n debug(message: string, payload?: Record<string, unknown>): void;\n}\n\n/**\n * Capture work that runs one time for each document, not one time for each\n * install. A reconfigure builds new capture instances. Thus instance state\n * cannot hold these flags. web-vitals has no unsubscribe. A second subscription\n * reports each metric two times.\n */\nexport interface CaptureOnce {\n /** True after the library subscribes the web-vitals reporters. */\n webVitals: boolean;\n /** True after the library reports navigation timing. */\n navigationTiming: boolean;\n /** True after the first long frame install. Only that install reads buffered frames. */\n longFrames: boolean;\n /** True after the library reads the alive marker of the previous page. */\n uncleanExit: boolean;\n /** True after the first user timing install. Only that install reads buffered entries. */\n userTiming: boolean;\n /** True after the first resource timing install. Later installs exclude buffered entries. */\n resourceTiming?: boolean;\n /** Page state and its start time. A reinstall keeps them and logs no false transition. */\n lifecycle?: { state: string; enteredAt: number };\n}\n\n/** Shared runtime dependencies provided to auto-capture instances. */\nexport interface CaptureContext {\n /** False while the runtime stops or changes its security context. */\n isActive?: () => boolean;\n /** Active runtime configuration. */\n config: ResolvedConfig;\n /** Diagnostics reporter for capture faults. */\n diagnostics: Diagnostics;\n /** Logger instance for recorded telemetry. */\n logger: CaptureLogger;\n /** Buffer for recording contextual breadcrumbs. */\n breadcrumbs: BreadcrumbBuffer;\n /** Active trace context provider. */\n tracing: TraceEngine;\n /** Guards for the capture work that a reinstall must not repeat. */\n once: CaptureOnce;\n /** Adds a value to a counter or a histogram of the runtime. */\n recordMetric: (def: InstrumentDef, value: number, attributes?: MetricAttributes) => void;\n /** Records a span. The runtime drops it when spans are off. */\n recordSpan: (span: SpanData) => void;\n /** Gives the session id in force. */\n sessionId: () => string;\n}\n\n/** Lifecycle interface for browser instrumentation modules. */\nexport interface Capture {\n /** Module identifier used in diagnostics. */\n readonly name: string;\n /**\n * Attaches instrumentation listeners and patches target APIs. A second patch on a\n * patched function adds a second wrapper and doubles each record. A second call\n * must do nothing.\n */\n install(): void;\n /** Restores native APIs and removes registered listeners. */\n uninstall(): void;\n}\n\n/**\n * Tests if a URL matches any string substring or regular expression pattern.\n * @param url Target URL to test. A value that is not a string matches nothing.\n * @param patterns Substrings and regular expressions to test against.\n * @returns True if any pattern matches the URL.\n */\nexport function matchesAny(url: unknown, patterns: (string | RegExp)[]): boolean {\n // Guard against a URL that is not a string. includes() on it throws in the call of the host.\n if (typeof url !== \"string\") {\n return false;\n }\n\n return patterns.some((pattern) =>\n typeof pattern === \"string\" ? url.includes(pattern) : pattern.test(url),\n );\n}\n"],"mappings":"AAkIA,SAAgBA,EAAW,EAAc,EAAwC,CAM/E,OAJI,OAAOC,GAAQ,UAIZC,EAAS,KAAM,GACpB,OAAOC,GAAY,SAAWF,EAAI,SAASE,CAAO,EAAIA,EAAQ,KAAKF,CAAG,CACxE,CACF"}
1
+ {"version":3,"file":"types-C7WNpnG1.cjs","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, the logger abstraction and helpers for the auto-capture modules.\n\nimport type { BreadcrumbBuffer } from \"../core/breadcrumbs\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport type { SpanData } from \"../core/spans\";\nimport type { ResolvedConfig } from \"../models/config\";\nimport type { LogRecord, MetricType } from \"../models/log-record\";\nimport type { InstrumentDef, MetricAttributes } from \"../models/metric\";\nimport type { TraceEngine } from \"../utils/tracing\";\n\n/**\n * The logging interface the auto-capture modules use. Referring to the runtime class here\n * would create an import cycle, because the runtime installs the capture modules.\n */\nexport interface CaptureLogger {\n /**\n * Logs an error event, with the error or reason behind it.\n * @param message Error description.\n * @param error The caught error or reason.\n * @param payload Optional attributes.\n */\n error(message: string, error?: unknown, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a warning event.\n * @param message Warning description.\n * @param payload Optional attributes.\n */\n warn(message: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a single lifecycle or user event.\n * @param name Event identifier.\n * @param payload Optional attributes.\n */\n logEvent(name: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a numeric metric measurement.\n * @param name Metric name.\n * @param value The measurement.\n * @param unit Unit of measurement.\n * @param type Metric type.\n * @param attrs Optional metric attributes.\n */\n logMetric(\n name: string,\n value: number,\n unit?: string,\n type?: MetricType,\n attrs?: Record<string, unknown>,\n ): void;\n\n /**\n * Logs a debug message.\n * @param message Debug message.\n * @param payload Optional attributes.\n */\n debug(message: string, payload?: Record<string, unknown>): void;\n}\n\n/**\n * Capture work that runs once per document, not once per install. A reconfigure\n * builds new capture instances, so instance state can't hold these flags.\n * web-vitals has no unsubscribe, and a second subscription would report every\n * metric twice.\n */\nexport interface CaptureOnce {\n /** True once the web-vitals reporters are subscribed. */\n webVitals: boolean;\n /** True once navigation timing has been reported. */\n navigationTiming: boolean;\n /** True after the first long frame install. Only that install reads buffered frames. */\n longFrames: boolean;\n /** True once we've read the previous page's alive marker. */\n uncleanExit: boolean;\n /** True after the first user timing install. Only that install reads buffered entries. */\n userTiming: boolean;\n /** True after the first resource timing install. Later installs skip buffered entries. */\n resourceTiming?: boolean;\n /** Page state and when it started. A reinstall keeps them, so it logs no false transition. */\n lifecycle?: { state: string; enteredAt: number };\n /** Set once the frame phases capture has reported a browser without long animation frames. */\n framePhases?: boolean;\n /** Set once the profiler's frame pacing has reported a context without frame callbacks. */\n framePacing?: boolean;\n /** Set once session replay has reported why it can't record in this document. */\n replay?: boolean;\n}\n\n/** Runtime dependencies shared by all auto-capture instances. */\nexport interface CaptureContext {\n /** False while the runtime is stopping or changing its security context. */\n isActive?: () => boolean;\n /** Active runtime configuration. */\n config: ResolvedConfig;\n /** Diagnostics reporter for capture faults. */\n diagnostics: Diagnostics;\n /** Logger for the telemetry the captures record. */\n logger: CaptureLogger;\n /** Breadcrumb buffer. */\n breadcrumbs: BreadcrumbBuffer;\n /** Active trace context provider. */\n tracing: TraceEngine;\n /** Guards for capture work that a reinstall must not repeat. */\n once: CaptureOnce;\n /** Adds a value to one of the runtime's counters or histograms. */\n recordMetric: (def: InstrumentDef, value: number, attributes?: MetricAttributes) => void;\n /** Records a span. The runtime drops it when spans are off. */\n recordSpan: (span: SpanData) => void;\n /** Returns the current session id. */\n sessionId: () => string;\n /** Sets or clears the hook that receives every ERROR and FATAL record from the runtime. */\n onError?: (hook: ((record: LogRecord) => void) | undefined) => void;\n /** Sets an ambient attribute on every later record. Undefined removes it. */\n setContext?: (key: string, value: string | undefined) => void;\n /** True after startReplay(), false after stopReplay(), undefined if neither was called. */\n replayConsent?: () => boolean | undefined;\n}\n\n/** Lifecycle interface for the browser instrumentation modules. */\nexport interface Capture {\n /** Module identifier used in diagnostics. */\n readonly name: string;\n /**\n * Attaches the instrumentation listeners and patches the target APIs. Patching an\n * already patched function adds a second wrapper and doubles every record, so a\n * second call must do nothing.\n */\n install(): void;\n /** Restores the native APIs and removes the listeners. */\n uninstall(): void;\n}\n\n/**\n * Checks whether a URL matches any of the substring or regular expression patterns.\n * @param url URL to test. A value that isn't a string matches nothing.\n * @param patterns Substrings and regular expressions to test against.\n * @returns True if any pattern matches the URL.\n */\nexport function matchesAny(url: unknown, patterns: (string | RegExp)[]): boolean {\n // Guard against a URL that isn't a string. includes() on it would throw inside the host's call.\n if (typeof url !== \"string\") {\n return false;\n }\n\n return patterns.some((pattern) =>\n typeof pattern === \"string\" ? url.includes(pattern) : pattern.test(url),\n );\n}\n"],"mappings":"AA8IA,SAAgBA,EAAW,EAAc,EAAwC,CAM/E,OAJI,OAAOC,GAAQ,UAIZC,EAAS,KAAM,GACpB,OAAOC,GAAY,SAAWF,EAAI,SAASE,CAAO,EAAIA,EAAQ,KAAKF,CAAG,CACxE,CACF,C"}
@@ -1,2 +1,2 @@
1
- const e=require("./constants-CL0ZdI2f.cjs");function t(e){let t=e===null?null:JSON.parse(e);if(typeof t!=`object`||!t)return null;let{sessionId:n,at:r,visibility:i}=t;return typeof n==`string`&&Number.isFinite(r)&&typeof i==`string`?{sessionId:n,at:r,visibility:i}:null}var n=class{ctx;name=`uncleanExit`;installed=!1;timer;closing=!1;constructor(e){this.ctx=e}install(){this.installed||typeof document>`u`||window.parent!==window||(this.ctx.config.identity===`memory`?this.ctx.diagnostics.report(`capture.install_failed`,`capture.uncleanExit needs sessionStorage. identity: "memory" turns it off.`):(this.installed=!0,this.ctx.once.uncleanExit||(this.ctx.once.uncleanExit=!0,window.opener||this.reportPrevious()),this.mark(),addEventListener(`pagehide`,this.onPageHide),addEventListener(`pageshow`,this.onPageShow),document.addEventListener(`visibilitychange`,this.mark),this.timer=setInterval(this.mark,e.r)))}uninstall(){this.installed&&(this.installed=!1,removeEventListener(`pagehide`,this.onPageHide),removeEventListener(`pageshow`,this.onPageShow),document.removeEventListener(`visibilitychange`,this.mark),clearInterval(this.timer),this.clear())}reportPrevious(){let n=this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not read the alive marker in sessionStorage.`,()=>t(sessionStorage.getItem(e.n)));n&&this.ctx.logger.warn(`ui.unclean_exit`,{"exit.session_id":n.sessionId,"exit.last_seen_ms":n.at,"exit.visibility":n.visibility,"exit.discarded":document.wasDiscarded===!0})}mark=()=>{if(this.closing)return;let t={sessionId:this.ctx.sessionId(),at:Date.now(),visibility:document.visibilityState};this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not write the alive marker to sessionStorage.`,()=>{sessionStorage.setItem(e.n,JSON.stringify(t))})};clear(){this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not remove the alive marker from sessionStorage.`,()=>{sessionStorage.removeItem(e.n)})}onPageHide=()=>{this.closing=!0,this.clear()};onPageShow=e=>{e.persisted&&(this.closing=!1,this.mark())}};exports.UncleanExitCapture=n;
2
- //# sourceMappingURL=unclean-exit-CwdpbUDg.cjs.map
1
+ const e=require("./constants-DakMxVB2.cjs");function t(e){let t=e===null?null:JSON.parse(e);if(typeof t!=`object`||!t)return null;let{sessionId:n,at:r,visibility:i}=t;return typeof n==`string`&&Number.isFinite(r)&&typeof i==`string`?{sessionId:n,at:r,visibility:i}:null}var n=class{ctx;name=`uncleanExit`;installed=!1;timer;closing=!1;constructor(e){this.ctx=e}install(){this.installed||typeof document>`u`||window.parent!==window||(this.ctx.config.identity===`memory`?this.ctx.diagnostics.report(`capture.install_failed`,`capture.uncleanExit needs sessionStorage. identity: "memory" turns it off.`):(this.installed=!0,this.ctx.once.uncleanExit||(this.ctx.once.uncleanExit=!0,window.opener||this.reportPrevious()),this.mark(),addEventListener(`pagehide`,this.onPageHide),addEventListener(`pageshow`,this.onPageShow),document.addEventListener(`visibilitychange`,this.mark),this.timer=setInterval(this.mark,e.r)))}uninstall(){this.installed&&(this.installed=!1,removeEventListener(`pagehide`,this.onPageHide),removeEventListener(`pageshow`,this.onPageShow),document.removeEventListener(`visibilitychange`,this.mark),clearInterval(this.timer),this.clear())}reportPrevious(){let n=this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not read the alive marker in sessionStorage.`,()=>t(sessionStorage.getItem(e.n)));n&&this.ctx.logger.warn(`ui.unclean_exit`,{"exit.session_id":n.sessionId,"exit.last_seen_ms":n.at,"exit.visibility":n.visibility,"exit.discarded":document.wasDiscarded===!0})}mark=()=>{if(this.closing)return;let t={sessionId:this.ctx.sessionId(),at:Date.now(),visibility:document.visibilityState};this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not write the alive marker to sessionStorage.`,()=>{sessionStorage.setItem(e.n,JSON.stringify(t))})};clear(){this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not remove the alive marker from sessionStorage.`,()=>{sessionStorage.removeItem(e.n)})}onPageHide=()=>{this.closing=!0,this.clear()};onPageShow=e=>{e.persisted&&(this.closing=!1,this.mark())}};exports.UncleanExitCapture=n;
2
+ //# sourceMappingURL=unclean-exit-ClGzrc2A.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unclean-exit-ClGzrc2A.cjs","names":["ALIVE_UPDATE_MS","ALIVE_KEY","require_constants","readMarker","value","text","sessionId","at","visibility","UncleanExitCapture","ctx","marker","event"],"sources":["../src/capture/unclean-exit.ts"],"sourcesContent":["// src/capture/unclean-exit.ts\n//\n// Detects a page in this tab that ended without a clean close, for example after a crash. The\n// top document keeps a marker in sessionStorage and a clean close removes it, so if the tab's\n// next page finds a marker, it reports it.\n\nimport { ALIVE_KEY, ALIVE_UPDATE_MS } from \"../constants\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Marker left by a page that is alive. */\ninterface AliveMarker {\n /** The page's session id. */\n sessionId: string;\n /** When the marker was last updated, in epoch milliseconds. */\n at: number;\n /** The page's visibility at the last update. */\n visibility: string;\n}\n\n/** A document with the flag the browser sets on a page it discarded to free memory. */\ninterface DiscardDocument {\n wasDiscarded?: boolean;\n}\n\n/**\n * Reads a marker from its sessionStorage text.\n * @param text Stored text, or null when there is no marker.\n * @returns The marker, or null if there is none or it has the wrong shape.\n * @throws SyntaxError for text that isn't JSON. The caller reports it.\n */\nfunction readMarker(text: string | null): AliveMarker | null {\n const value: unknown = text === null ? null : JSON.parse(text);\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n\n const { sessionId, at, visibility } = value as Partial<Record<keyof AliveMarker, unknown>>;\n const valid =\n typeof sessionId === \"string\" && Number.isFinite(at) && typeof visibility === \"string\";\n\n return valid ? { sessionId, at: at as number, visibility } : null;\n}\n\n/** Reports the previous page's unclean exit, and maintains this page's marker. */\nexport class UncleanExitCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"uncleanExit\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /** Timer that updates the marker. */\n private timer: ReturnType<typeof setInterval> | undefined;\n\n /** True after pagehide. Needed because the browser fires visibilitychange after pagehide. */\n private closing = false;\n\n /**\n * @param ctx Capture context with the config, diagnostics, logger and session id.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports the previous page's marker once, then starts maintaining this page's own. */\n install(): void {\n // Only the top document keeps the marker, because a same-origin frame shares its\n // sessionStorage.\n if (this.installed || typeof document === \"undefined\" || window.parent !== window) {\n return;\n }\n\n // The marker holds the session id, and memory identity writes nothing to the device.\n if (this.ctx.config.identity === \"memory\") {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n 'capture.uncleanExit needs sessionStorage. identity: \"memory\" turns it off.',\n );\n return;\n }\n this.installed = true;\n\n if (!this.ctx.once.uncleanExit) {\n this.ctx.once.uncleanExit = true;\n // A popup copies its live opener's sessionStorage, so that marker isn't a crash.\n if (!window.opener) {\n this.reportPrevious();\n }\n }\n\n this.mark();\n addEventListener(\"pagehide\", this.onPageHide);\n addEventListener(\"pageshow\", this.onPageShow);\n document.addEventListener(\"visibilitychange\", this.mark);\n this.timer = setInterval(this.mark, ALIVE_UPDATE_MS);\n }\n\n /** Removes the listeners, the timer and the marker, since the capture stopped without a crash. */\n uninstall(): void {\n if (!this.installed) {\n return;\n }\n this.installed = false;\n\n removeEventListener(\"pagehide\", this.onPageHide);\n removeEventListener(\"pageshow\", this.onPageShow);\n document.removeEventListener(\"visibilitychange\", this.mark);\n clearInterval(this.timer);\n this.clear();\n }\n\n /** Logs WARN `ui.unclean_exit` if this tab's previous page left its marker behind. */\n private reportPrevious(): void {\n const marker = this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not read the alive marker in sessionStorage.\",\n () => readMarker(sessionStorage.getItem(ALIVE_KEY)),\n );\n if (!marker) {\n return;\n }\n\n this.ctx.logger.warn(\"ui.unclean_exit\", {\n \"exit.session_id\": marker.sessionId,\n \"exit.last_seen_ms\": marker.at,\n \"exit.visibility\": marker.visibility,\n \"exit.discarded\": (document as DiscardDocument).wasDiscarded === true,\n });\n }\n\n /** Writes this page's marker with the current time and visibility. */\n private readonly mark = (): void => {\n if (this.closing) {\n return;\n }\n\n const marker: AliveMarker = {\n sessionId: this.ctx.sessionId(),\n at: Date.now(),\n visibility: document.visibilityState,\n };\n\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not write the alive marker to sessionStorage.\",\n () => {\n sessionStorage.setItem(ALIVE_KEY, JSON.stringify(marker));\n },\n );\n };\n\n /** Removes this page's marker. */\n private clear(): void {\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not remove the alive marker from sessionStorage.\",\n () => {\n sessionStorage.removeItem(ALIVE_KEY);\n },\n );\n }\n\n /** A clean close removes the marker. The page may still live on in the back-forward cache. */\n private readonly onPageHide = (): void => {\n this.closing = true;\n this.clear();\n };\n\n /** A page that comes back from the back-forward cache is alive again. */\n private readonly onPageShow = (event: Event): void => {\n if ((event as PageTransitionEvent).persisted) {\n this.closing = false;\n this.mark();\n }\n };\n}\n"],"mappings":"A,4CA8BA,SAASG,EAAW,EAAyC,CAC3D,IAAMC,EAAiBC,IAAS,KAAO,KAAO,KAAK,MAAMA,CAAI,EAC7D,GAAI,OAAOD,GAAU,WAAYA,EAC/B,OAAO,KAGT,GAAM,CAAE,YAAW,KAAI,cAAeA,EAItC,OAFE,OAAOE,GAAc,UAAY,OAAO,SAASC,CAAE,GAAK,OAAOC,GAAe,SAEjE,CAAE,YAAe,KAAc,YAAW,EAAI,IAC/D,CAGA,IAAaC,EAAb,KAAmD,CAgBpB,IAd7B,KAAgB,cAGhB,UAAoB,GAGpB,MAGA,QAAkB,GAKlB,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CAGV,KAAK,WAAa,OAAO,SAAa,KAAe,OAAO,SAAW,SAKvE,KAAK,IAAI,OAAO,WAAa,SAC/B,KAAK,IAAI,YAAY,OACnB,yBACA,4EACF,GAGF,KAAK,UAAY,GAEZ,KAAK,IAAI,KAAK,cACjB,KAAK,IAAI,KAAK,YAAc,GAEvB,OAAO,QACV,KAAK,eAAe,GAIxB,KAAK,KAAK,EACV,iBAAiB,WAAY,KAAK,UAAU,EAC5C,iBAAiB,WAAY,KAAK,UAAU,EAC5C,SAAS,iBAAiB,mBAAoB,KAAK,IAAI,EACvD,KAAK,MAAQ,YAAY,KAAK,KAAMV,EAAAA,CAAe,GACrD,CAGA,WAAkB,CACX,KAAK,YAGV,KAAK,UAAY,GAEjB,oBAAoB,WAAY,KAAK,UAAU,EAC/C,oBAAoB,WAAY,KAAK,UAAU,EAC/C,SAAS,oBAAoB,mBAAoB,KAAK,IAAI,EAC1D,cAAc,KAAK,KAAK,EACxB,KAAK,MAAM,EACb,CAGA,gBAA+B,CAC7B,IAAMW,EAAS,KAAK,IAAI,YAAY,MAClC,sBACA,qEACMR,EAAW,eAAe,QAAQF,EAAAA,CAAS,CAAC,CACpD,EACKU,GAIL,KAAK,IAAI,OAAO,KAAK,kBAAmB,CACtC,kBAAmBA,EAAO,UAC1B,oBAAqBA,EAAO,GAC5B,kBAAmBA,EAAO,WAC1B,iBAAmB,SAA6B,eAAiB,EACnE,CAAC,CACH,CAGA,SAAoC,CAClC,GAAI,KAAK,QACP,OAGF,IAAMA,EAAsB,CAC1B,UAAW,KAAK,IAAI,UAAU,EAC9B,GAAI,KAAK,IAAI,EACb,WAAY,SAAS,eACvB,EAEA,KAAK,IAAI,YAAY,MACnB,sBACA,sEACM,CACJ,eAAe,QAAQV,EAAAA,EAAW,KAAK,UAAUU,CAAM,CAAC,CAC1D,CACF,CACF,EAGA,OAAsB,CACpB,KAAK,IAAI,YAAY,MACnB,sBACA,yEACM,CACJ,eAAe,WAAWV,EAAAA,CAAS,CACrC,CACF,CACF,CAGA,eAA0C,CACxC,KAAK,QAAU,GACf,KAAK,MAAM,CACb,EAGA,WAA+B,GAAuB,CAC/CW,EAA8B,YACjC,KAAK,QAAU,GACf,KAAK,KAAK,EAEd,CACF,E"}
@@ -1,5 +1,5 @@
1
- import { n as e, r as t } from "./constants-CU60FG4w.js";
2
- //#region src/capture/unclean-exit.ts
1
+ import { n as e, r as t } from "./constants-Bwl_YtQi.js";
2
+ // src/capture/unclean-exit.ts
3
3
  function n(e) {
4
4
  let t = e === null ? null : JSON.parse(e);
5
5
  if (typeof t != "object" || !t) return null;
@@ -57,7 +57,6 @@ var r = class {
57
57
  e.persisted && (this.closing = !1, this.mark());
58
58
  };
59
59
  };
60
- //#endregion
61
60
  export { r as UncleanExitCapture };
62
61
 
63
- //# sourceMappingURL=unclean-exit-BYZ5yaSI.js.map
62
+ //# sourceMappingURL=unclean-exit-Cob_jyTv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unclean-exit-Cob_jyTv.js","names":["ALIVE_KEY","ALIVE_UPDATE_MS","readMarker","value","text","sessionId","at","visibility","UncleanExitCapture","ctx","marker","event"],"sources":["../src/capture/unclean-exit.ts"],"sourcesContent":["// src/capture/unclean-exit.ts\n//\n// Detects a page in this tab that ended without a clean close, for example after a crash. The\n// top document keeps a marker in sessionStorage and a clean close removes it, so if the tab's\n// next page finds a marker, it reports it.\n\nimport { ALIVE_KEY, ALIVE_UPDATE_MS } from \"../constants\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Marker left by a page that is alive. */\ninterface AliveMarker {\n /** The page's session id. */\n sessionId: string;\n /** When the marker was last updated, in epoch milliseconds. */\n at: number;\n /** The page's visibility at the last update. */\n visibility: string;\n}\n\n/** A document with the flag the browser sets on a page it discarded to free memory. */\ninterface DiscardDocument {\n wasDiscarded?: boolean;\n}\n\n/**\n * Reads a marker from its sessionStorage text.\n * @param text Stored text, or null when there is no marker.\n * @returns The marker, or null if there is none or it has the wrong shape.\n * @throws SyntaxError for text that isn't JSON. The caller reports it.\n */\nfunction readMarker(text: string | null): AliveMarker | null {\n const value: unknown = text === null ? null : JSON.parse(text);\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n\n const { sessionId, at, visibility } = value as Partial<Record<keyof AliveMarker, unknown>>;\n const valid =\n typeof sessionId === \"string\" && Number.isFinite(at) && typeof visibility === \"string\";\n\n return valid ? { sessionId, at: at as number, visibility } : null;\n}\n\n/** Reports the previous page's unclean exit, and maintains this page's marker. */\nexport class UncleanExitCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"uncleanExit\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /** Timer that updates the marker. */\n private timer: ReturnType<typeof setInterval> | undefined;\n\n /** True after pagehide. Needed because the browser fires visibilitychange after pagehide. */\n private closing = false;\n\n /**\n * @param ctx Capture context with the config, diagnostics, logger and session id.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports the previous page's marker once, then starts maintaining this page's own. */\n install(): void {\n // Only the top document keeps the marker, because a same-origin frame shares its\n // sessionStorage.\n if (this.installed || typeof document === \"undefined\" || window.parent !== window) {\n return;\n }\n\n // The marker holds the session id, and memory identity writes nothing to the device.\n if (this.ctx.config.identity === \"memory\") {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n 'capture.uncleanExit needs sessionStorage. identity: \"memory\" turns it off.',\n );\n return;\n }\n this.installed = true;\n\n if (!this.ctx.once.uncleanExit) {\n this.ctx.once.uncleanExit = true;\n // A popup copies its live opener's sessionStorage, so that marker isn't a crash.\n if (!window.opener) {\n this.reportPrevious();\n }\n }\n\n this.mark();\n addEventListener(\"pagehide\", this.onPageHide);\n addEventListener(\"pageshow\", this.onPageShow);\n document.addEventListener(\"visibilitychange\", this.mark);\n this.timer = setInterval(this.mark, ALIVE_UPDATE_MS);\n }\n\n /** Removes the listeners, the timer and the marker, since the capture stopped without a crash. */\n uninstall(): void {\n if (!this.installed) {\n return;\n }\n this.installed = false;\n\n removeEventListener(\"pagehide\", this.onPageHide);\n removeEventListener(\"pageshow\", this.onPageShow);\n document.removeEventListener(\"visibilitychange\", this.mark);\n clearInterval(this.timer);\n this.clear();\n }\n\n /** Logs WARN `ui.unclean_exit` if this tab's previous page left its marker behind. */\n private reportPrevious(): void {\n const marker = this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not read the alive marker in sessionStorage.\",\n () => readMarker(sessionStorage.getItem(ALIVE_KEY)),\n );\n if (!marker) {\n return;\n }\n\n this.ctx.logger.warn(\"ui.unclean_exit\", {\n \"exit.session_id\": marker.sessionId,\n \"exit.last_seen_ms\": marker.at,\n \"exit.visibility\": marker.visibility,\n \"exit.discarded\": (document as DiscardDocument).wasDiscarded === true,\n });\n }\n\n /** Writes this page's marker with the current time and visibility. */\n private readonly mark = (): void => {\n if (this.closing) {\n return;\n }\n\n const marker: AliveMarker = {\n sessionId: this.ctx.sessionId(),\n at: Date.now(),\n visibility: document.visibilityState,\n };\n\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not write the alive marker to sessionStorage.\",\n () => {\n sessionStorage.setItem(ALIVE_KEY, JSON.stringify(marker));\n },\n );\n };\n\n /** Removes this page's marker. */\n private clear(): void {\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not remove the alive marker from sessionStorage.\",\n () => {\n sessionStorage.removeItem(ALIVE_KEY);\n },\n );\n }\n\n /** A clean close removes the marker. The page may still live on in the back-forward cache. */\n private readonly onPageHide = (): void => {\n this.closing = true;\n this.clear();\n };\n\n /** A page that comes back from the back-forward cache is alive again. */\n private readonly onPageShow = (event: Event): void => {\n if ((event as PageTransitionEvent).persisted) {\n this.closing = false;\n this.mark();\n }\n };\n}\n"],"mappings":";;AA8BA,SAASE,EAAW,GAAyC;CAC3D,IAAMC,IAAiBC,MAAS,OAAO,OAAO,KAAK,MAAMA,CAAI;CAC7D,IAAI,OAAOD,KAAU,aAAYA,GAC/B,OAAO;CAGT,IAAM,EAAE,cAAW,OAAI,kBAAeA;CAItC,OAFE,OAAOE,KAAc,YAAY,OAAO,SAASC,CAAE,KAAK,OAAOC,KAAe,WAEjE;EAAE;EAAe;EAAc;CAAW,IAAI;AAC/D;AAGA,IAAaC,IAAb,MAAmD;CAgBpB;CAd7B,OAAgB;CAGhB,YAAoB;CAGpB;CAGA,UAAkB;CAKlB,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EAGd,AAAI,KAAK,aAAa,OAAO,WAAa,OAAe,OAAO,WAAW,WAKvE,KAAK,IAAI,OAAO,aAAa,WAC/B,KAAK,IAAI,YAAY,OACnB,0BACA,8EACF,KAGF,KAAK,YAAY,IAEZ,KAAK,IAAI,KAAK,gBACjB,KAAK,IAAI,KAAK,cAAc,IAEvB,OAAO,UACV,KAAK,eAAe,IAIxB,KAAK,KAAK,GACV,iBAAiB,YAAY,KAAK,UAAU,GAC5C,iBAAiB,YAAY,KAAK,UAAU,GAC5C,SAAS,iBAAiB,oBAAoB,KAAK,IAAI,GACvD,KAAK,QAAQ,YAAY,KAAK,MAAMR,CAAe;CACrD;CAGA,YAAkB;EAChB,AAAK,KAAK,cAGV,KAAK,YAAY,IAEjB,oBAAoB,YAAY,KAAK,UAAU,GAC/C,oBAAoB,YAAY,KAAK,UAAU,GAC/C,SAAS,oBAAoB,oBAAoB,KAAK,IAAI,GAC1D,cAAc,KAAK,KAAK,GACxB,KAAK,MAAM;CACb;CAGA,iBAA+B;EAC7B,IAAMS,IAAS,KAAK,IAAI,YAAY,MAClC,uBACA,wEACMR,EAAW,eAAe,QAAQF,CAAS,CAAC,CACpD;EACA,AAAKU,KAIL,KAAK,IAAI,OAAO,KAAK,mBAAmB;GACtC,mBAAmBA,EAAO;GAC1B,qBAAqBA,EAAO;GAC5B,mBAAmBA,EAAO;GAC1B,kBAAmB,SAA6B,iBAAiB;EACnE,CAAC;CACH;CAGA,aAAoC;EAClC,IAAI,KAAK,SACP;EAGF,IAAMA,IAAsB;GAC1B,WAAW,KAAK,IAAI,UAAU;GAC9B,IAAI,KAAK,IAAI;GACb,YAAY,SAAS;EACvB;EAEA,KAAK,IAAI,YAAY,MACnB,uBACA,yEACM;GACJ,eAAe,QAAQV,GAAW,KAAK,UAAUU,CAAM,CAAC;EAC1D,CACF;CACF;CAGA,QAAsB;EACpB,KAAK,IAAI,YAAY,MACnB,uBACA,4EACM;GACJ,eAAe,WAAWV,CAAS;EACrC,CACF;CACF;CAGA,mBAA0C;EAExC,AADA,KAAK,UAAU,IACf,KAAK,MAAM;CACb;CAGA,cAA+B,MAAuB;EACpD,AAAKW,EAA8B,cACjC,KAAK,UAAU,IACf,KAAK,KAAK;CAEd;AACF"}
@@ -0,0 +1,2 @@
1
+ function e(e){typeof e!=`number`&&e.unref?.()}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
2
+ //# sourceMappingURL=unref-CU9Nyz_9.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unref-CU9Nyz_9.cjs","names":["unrefTimer","timer"],"sources":["../src/utils/unref.ts"],"sourcesContent":["// src/utils/unref.ts\n//\n// Unreferences timer handles in Node and browser environments. A pending timer\n// keeps a Node process alive under SSR and in tests.\n\n/** A timer handle. A number in a browser, a Timeout object in Node. */\nexport type TimerHandle = number | { unref?: () => void };\n\n/**\n * Unreferences a timer handle, so a pending timer doesn't keep a Node.js process alive.\n * @param timer The timer handle returned by setTimeout.\n */\nexport function unrefTimer(timer: TimerHandle): void {\n if (typeof timer !== \"number\") {\n timer.unref?.();\n }\n}\n"],"mappings":"AAYA,SAAgBA,EAAW,EAA0B,CAC/C,OAAOC,GAAU,UACnBA,EAAM,QAAQ,CAElB,C"}
@@ -0,0 +1,7 @@
1
+ // src/utils/unref.ts
2
+ function e(e) {
3
+ typeof e != "number" && e.unref?.();
4
+ }
5
+ export { e as t };
6
+
7
+ //# sourceMappingURL=unref-DgHPQeWv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unref-DgHPQeWv.js","names":["unrefTimer","timer"],"sources":["../src/utils/unref.ts"],"sourcesContent":["// src/utils/unref.ts\n//\n// Unreferences timer handles in Node and browser environments. A pending timer\n// keeps a Node process alive under SSR and in tests.\n\n/** A timer handle. A number in a browser, a Timeout object in Node. */\nexport type TimerHandle = number | { unref?: () => void };\n\n/**\n * Unreferences a timer handle, so a pending timer doesn't keep a Node.js process alive.\n * @param timer The timer handle returned by setTimeout.\n */\nexport function unrefTimer(timer: TimerHandle): void {\n if (typeof timer !== \"number\") {\n timer.unref?.();\n }\n}\n"],"mappings":";AAYA,SAAgBA,EAAW,GAA0B;CACnD,AAAI,OAAOC,KAAU,YACnBA,EAAM,QAAQ;AAElB"}
@@ -0,0 +1,2 @@
1
+ const e=require("./platform-12uR7kBQ.cjs"),t=require("./types-C7WNpnG1.cjs");var n={name:`ui.user_timing.duration`,kind:`histogram`,unit:`ms`,boundaries:[1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4]},r=class{ctx;name=`userTiming`;observer;constructor(e){this.ctx=e}install(){if(this.observer)return;let{once:e}=this.ctx,t=!e.userTiming;e.userTiming=!0;let n=typeof PerformanceObserver>`u`?void 0:PerformanceObserver.supportedEntryTypes;n?.includes(`measure`)?(this.observer=new PerformanceObserver(e=>{this.ctx.diagnostics.guard(`capture.record_failed`,`The library could not record a user timing entry.`,()=>{this.record(e.getEntries())})}),this.observer.observe({type:`measure`,buffered:t}),n.includes(`mark`)&&this.observer.observe({type:`mark`,buffered:t})):t&&this.ctx.diagnostics.report(`capture.install_failed`,`The browser does not report User Timing entries. The user timing capture is off.`)}uninstall(){this.observer?.disconnect(),this.observer=void 0}record(r){if(this.ctx.isActive?.()===!1)return;let{fullUrls:i,userTimingInclude:a}=this.ctx.config.capture;for(let o of r){if(a.length>0&&!t.t(o.name,a))continue;let r=e.i(o.name,i);o.entryType===`measure`?this.ctx.recordMetric(n,o.duration,{"user_timing.name":r}):this.ctx.breadcrumbs.push({t:Math.round(performance.timeOrigin+o.startTime),category:`event`,message:r.slice(0,this.ctx.config.limits.maxBodyChars)})}}};exports.UserTimingCapture=r;
2
+ //# sourceMappingURL=user-timing-CdYqx3PF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-timing-CdYqx3PF.cjs","names":["matchesAny","recordedUrl","require_platform","require_types","USER_TIMING_DURATION","UserTimingCapture","ctx","first","once","supported","list","entry","entries","userTimingInclude","name","fullUrls"],"sources":["../src/capture/user-timing.ts"],"sourcesContent":["// src/capture/user-timing.ts\n//\n// Records the app's marks and measures from the User Timing API. A measure goes into a\n// histogram, and a mark adds a breadcrumb.\n\nimport type { InstrumentDef } from \"../models/metric\";\nimport { recordedUrl } from \"../utils/platform\";\nimport { type Capture, type CaptureContext, matchesAny } from \"./types\";\n\n/** Histogram of the app's measures, in milliseconds. */\nconst USER_TIMING_DURATION: InstrumentDef = {\n name: \"ui.user_timing.duration\",\n kind: \"histogram\",\n unit: \"ms\",\n boundaries: [1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000],\n};\n\n/** Observes the app's marks and measures. */\nexport class UserTimingCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"userTiming\";\n\n /** Observer for the mark and measure entries. */\n private observer: PerformanceObserver | undefined;\n\n /**\n * @param ctx Capture context with the config, the meter and the breadcrumbs.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Observes marks and measures. Only the first install in a document reads buffered entries. */\n install(): void {\n if (this.observer) {\n return;\n }\n\n const { once } = this.ctx;\n const first = !once.userTiming;\n once.userTiming = true;\n\n // Older browsers have no supportedEntryTypes, and the capture stays off there.\n const supported: readonly string[] | undefined =\n typeof PerformanceObserver === \"undefined\"\n ? undefined\n : PerformanceObserver.supportedEntryTypes;\n if (!supported?.includes(\"measure\")) {\n if (first) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The browser does not report User Timing entries. The user timing capture is off.\",\n );\n }\n return;\n }\n\n this.observer = new PerformanceObserver((list) => {\n // The browser calls this directly, so anything we throw is an uncaught error on the page.\n this.ctx.diagnostics.guard(\n \"capture.record_failed\",\n \"The library could not record a user timing entry.\",\n () => {\n this.record(list.getEntries());\n },\n );\n });\n // Buffered entries include the marks and measures made before this chunk loaded.\n this.observer.observe({ type: \"measure\", buffered: first });\n if (supported.includes(\"mark\")) {\n this.observer.observe({ type: \"mark\", buffered: first });\n }\n }\n\n /** Disconnects the observer. */\n uninstall(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n /**\n * Records the entries whose name `userTimingInclude` selects.\n * @param entries Mark and measure entries.\n */\n private record(entries: PerformanceEntryList): void {\n if (this.ctx.isActive?.() === false) {\n return;\n }\n\n const { fullUrls, userTimingInclude } = this.ctx.config.capture;\n for (const entry of entries) {\n if (userTimingInclude.length > 0 && !matchesAny(entry.name, userTimingInclude)) {\n continue;\n }\n\n // A third-party script can write any name, so a name can hold a URL with a token.\n const name = recordedUrl(entry.name, fullUrls);\n if (entry.entryType === \"measure\") {\n this.ctx.recordMetric(USER_TIMING_DURATION, entry.duration, { \"user_timing.name\": name });\n } else {\n this.ctx.breadcrumbs.push({\n // A buffered entry reaches the observer late, and the trail needs the mark's own time.\n t: Math.round(performance.timeOrigin + entry.startTime),\n category: \"event\",\n message: name.slice(0, this.ctx.config.limits.maxBodyChars),\n });\n }\n }\n }\n}\n"],"mappings":"A,6EAUA,IAAMI,EAAsC,CAC1C,KAAM,0BACN,KAAM,YACN,KAAM,KACN,WAAY,CAAC,EAAG,EAAG,GAAI,GAAI,GAAI,IAAK,IAAK,IAAK,IAAM,KAAM,IAAM,GAAK,CACvE,EAGaC,EAAb,KAAkD,CAUnB,IAR7B,KAAgB,aAGhB,SAKA,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CACd,GAAI,KAAK,SACP,OAGF,GAAM,CAAE,QAAS,KAAK,IAChBC,EAAQ,CAACC,EAAK,WACpB,EAAK,WAAa,GAGlB,IAAMC,EACJ,OAAO,oBAAwB,IAC3B,IAAA,GACA,oBAAoB,oBACrBA,GAAW,SAAS,SAAS,GAUlC,KAAK,SAAW,IAAI,oBAAqB,GAAS,CAEhD,KAAK,IAAI,YAAY,MACnB,wBACA,wDACM,CACJ,KAAK,OAAOC,EAAK,WAAW,CAAC,CAC/B,CACF,CACF,CAAC,EAED,KAAK,SAAS,QAAQ,CAAE,KAAM,UAAW,SAAUH,CAAM,CAAC,EACtDE,EAAU,SAAS,MAAM,GAC3B,KAAK,SAAS,QAAQ,CAAE,KAAM,OAAQ,SAAUF,CAAM,CAAC,GAtBnDA,GACF,KAAK,IAAI,YAAY,OACnB,yBACA,kFACF,CAoBN,CAGA,WAAkB,CAChB,KAAK,UAAU,WAAW,EAC1B,KAAK,SAAW,IAAA,EAClB,CAMA,OAAe,EAAqC,CAClD,GAAI,KAAK,IAAI,WAAW,IAAM,GAC5B,OAGF,GAAM,CAAE,WAAU,qBAAsB,KAAK,IAAI,OAAO,QACxD,IAAK,IAAMI,KAASC,EAAS,CAC3B,GAAIC,EAAkB,OAAS,GAAK,CAACb,EAAAA,EAAWW,EAAM,KAAME,CAAiB,EAC3E,SAIF,IAAMC,EAAOb,EAAAA,EAAYU,EAAM,KAAMI,CAAQ,EACzCJ,EAAM,YAAc,UACtB,KAAK,IAAI,aAAaP,EAAsBO,EAAM,SAAU,CAAE,mBAAoBG,CAAK,CAAC,EAExF,KAAK,IAAI,YAAY,KAAK,CAExB,EAAG,KAAK,MAAM,YAAY,WAAaH,EAAM,SAAS,EACtD,SAAU,QACV,QAASG,EAAK,MAAM,EAAG,KAAK,IAAI,OAAO,OAAO,YAAY,CAC5D,CAAC,CAEL,CACF,CACF,E"}
@@ -1,6 +1,6 @@
1
- import { i as e } from "./platform-wcAkkv9F.js";
2
- import { t } from "./types-BR9t_w28.js";
3
- //#region src/capture/user-timing.ts
1
+ import { i as e } from "./platform-CVewe4wQ.js";
2
+ import { t } from "./types-BAerHgCq.js";
3
+ // src/capture/user-timing.ts
4
4
  var n = {
5
5
  name: "ui.user_timing.duration",
6
6
  kind: "histogram",
@@ -32,7 +32,9 @@ var n = {
32
32
  e.userTiming = !0;
33
33
  let n = typeof PerformanceObserver > "u" ? void 0 : PerformanceObserver.supportedEntryTypes;
34
34
  n?.includes("measure") ? (this.observer = new PerformanceObserver((e) => {
35
- this.record(e.getEntries());
35
+ this.ctx.diagnostics.guard("capture.record_failed", "The library could not record a user timing entry.", () => {
36
+ this.record(e.getEntries());
37
+ });
36
38
  }), this.observer.observe({
37
39
  type: "measure",
38
40
  buffered: t
@@ -58,7 +60,6 @@ var n = {
58
60
  }
59
61
  }
60
62
  };
61
- //#endregion
62
63
  export { r as UserTimingCapture };
63
64
 
64
- //# sourceMappingURL=user-timing-Di2ra5DB.js.map
65
+ //# sourceMappingURL=user-timing-DgHubxCI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-timing-DgHubxCI.js","names":["recordedUrl","USER_TIMING_DURATION","UserTimingCapture","ctx","first","once","supported","list","entry","entries","userTimingInclude","matchesAny","name","fullUrls"],"sources":["../src/capture/user-timing.ts"],"sourcesContent":["// src/capture/user-timing.ts\n//\n// Records the app's marks and measures from the User Timing API. A measure goes into a\n// histogram, and a mark adds a breadcrumb.\n\nimport type { InstrumentDef } from \"../models/metric\";\nimport { recordedUrl } from \"../utils/platform\";\nimport { type Capture, type CaptureContext, matchesAny } from \"./types\";\n\n/** Histogram of the app's measures, in milliseconds. */\nconst USER_TIMING_DURATION: InstrumentDef = {\n name: \"ui.user_timing.duration\",\n kind: \"histogram\",\n unit: \"ms\",\n boundaries: [1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000],\n};\n\n/** Observes the app's marks and measures. */\nexport class UserTimingCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"userTiming\";\n\n /** Observer for the mark and measure entries. */\n private observer: PerformanceObserver | undefined;\n\n /**\n * @param ctx Capture context with the config, the meter and the breadcrumbs.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Observes marks and measures. Only the first install in a document reads buffered entries. */\n install(): void {\n if (this.observer) {\n return;\n }\n\n const { once } = this.ctx;\n const first = !once.userTiming;\n once.userTiming = true;\n\n // Older browsers have no supportedEntryTypes, and the capture stays off there.\n const supported: readonly string[] | undefined =\n typeof PerformanceObserver === \"undefined\"\n ? undefined\n : PerformanceObserver.supportedEntryTypes;\n if (!supported?.includes(\"measure\")) {\n if (first) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The browser does not report User Timing entries. The user timing capture is off.\",\n );\n }\n return;\n }\n\n this.observer = new PerformanceObserver((list) => {\n // The browser calls this directly, so anything we throw is an uncaught error on the page.\n this.ctx.diagnostics.guard(\n \"capture.record_failed\",\n \"The library could not record a user timing entry.\",\n () => {\n this.record(list.getEntries());\n },\n );\n });\n // Buffered entries include the marks and measures made before this chunk loaded.\n this.observer.observe({ type: \"measure\", buffered: first });\n if (supported.includes(\"mark\")) {\n this.observer.observe({ type: \"mark\", buffered: first });\n }\n }\n\n /** Disconnects the observer. */\n uninstall(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n /**\n * Records the entries whose name `userTimingInclude` selects.\n * @param entries Mark and measure entries.\n */\n private record(entries: PerformanceEntryList): void {\n if (this.ctx.isActive?.() === false) {\n return;\n }\n\n const { fullUrls, userTimingInclude } = this.ctx.config.capture;\n for (const entry of entries) {\n if (userTimingInclude.length > 0 && !matchesAny(entry.name, userTimingInclude)) {\n continue;\n }\n\n // A third-party script can write any name, so a name can hold a URL with a token.\n const name = recordedUrl(entry.name, fullUrls);\n if (entry.entryType === \"measure\") {\n this.ctx.recordMetric(USER_TIMING_DURATION, entry.duration, { \"user_timing.name\": name });\n } else {\n this.ctx.breadcrumbs.push({\n // A buffered entry reaches the observer late, and the trail needs the mark's own time.\n t: Math.round(performance.timeOrigin + entry.startTime),\n category: \"event\",\n message: name.slice(0, this.ctx.config.limits.maxBodyChars),\n });\n }\n }\n }\n}\n"],"mappings":";;;AAUA,IAAMC,IAAsC;CAC1C,MAAM;CACN,MAAM;CACN,MAAM;CACN,YAAY;EAAC;EAAG;EAAG;EAAI;EAAI;EAAI;EAAK;EAAK;EAAK;EAAM;EAAM;EAAM;CAAK;AACvE,GAGaC,IAAb,MAAkD;CAUnB;CAR7B,OAAgB;CAGhB;CAKA,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EACd,IAAI,KAAK,UACP;EAGF,IAAM,EAAE,YAAS,KAAK,KAChBC,IAAQ,CAACC,EAAK;EACpB,EAAK,aAAa;EAGlB,IAAMC,IACJ,OAAO,sBAAwB,MAC3B,KAAA,IACA,oBAAoB;EAC1B,AAAKA,GAAW,SAAS,SAAS,KAUlC,KAAK,WAAW,IAAI,qBAAqB,MAAS;GAEhD,KAAK,IAAI,YAAY,MACnB,yBACA,2DACM;IACJ,KAAK,OAAOC,EAAK,WAAW,CAAC;GAC/B,CACF;EACF,CAAC,GAED,KAAK,SAAS,QAAQ;GAAE,MAAM;GAAW,UAAUH;EAAM,CAAC,GACtDE,EAAU,SAAS,MAAM,KAC3B,KAAK,SAAS,QAAQ;GAAE,MAAM;GAAQ,UAAUF;EAAM,CAAC,KAtBnDA,KACF,KAAK,IAAI,YAAY,OACnB,0BACA,kFACF;CAoBN;CAGA,YAAkB;EAEhB,AADA,KAAK,UAAU,WAAW,GAC1B,KAAK,WAAW,KAAA;CAClB;CAMA,OAAe,GAAqC;EAClD,IAAI,KAAK,IAAI,WAAW,MAAM,IAC5B;EAGF,IAAM,EAAE,aAAU,yBAAsB,KAAK,IAAI,OAAO;EACxD,KAAK,IAAMI,KAASC,GAAS;GAC3B,IAAIC,EAAkB,SAAS,KAAK,CAACC,EAAWH,EAAM,MAAME,CAAiB,GAC3E;GAIF,IAAME,IAAOZ,EAAYQ,EAAM,MAAMK,CAAQ;GAC7C,AAAIL,EAAM,cAAc,YACtB,KAAK,IAAI,aAAaP,GAAsBO,EAAM,UAAU,EAAE,oBAAoBI,EAAK,CAAC,IAExF,KAAK,IAAI,YAAY,KAAK;IAExB,GAAG,KAAK,MAAM,YAAY,aAAaJ,EAAM,SAAS;IACtD,UAAU;IACV,SAASI,EAAK,MAAM,GAAG,KAAK,IAAI,OAAO,OAAO,YAAY;GAC5D,CAAC;EAEL;CACF;AACF"}
@@ -10,7 +10,7 @@ export declare class ConsoleSink {
10
10
  /**
11
11
  * @param settings Console level and styles. A null level prints nothing.
12
12
  * @param diagnostics Diagnostics reporter.
13
- * @param limits Size limits of the printed payload. They are the record limits.
13
+ * @param limits Size limits for the printed payload. Same as the record limits.
14
14
  */
15
15
  constructor(settings: ResolvedConsole, diagnostics: Diagnostics, limits?: SanitizeLimits);
16
16
  /**
@@ -19,7 +19,7 @@ export declare class ConsoleSink {
19
19
  */
20
20
  update(settings: ResolvedConsole): void;
21
21
  /**
22
- * Tests if a level clears the console threshold.
22
+ * Checks whether a level clears the console threshold.
23
23
  * @param level Severity level of the record.
24
24
  * @returns True if the sink prints this level.
25
25
  */
@@ -1,4 +1,4 @@
1
- /** Error of a promise that did not settle before its deadline. */
1
+ /** The error for a promise that didn't settle before its deadline. */
2
2
  export declare class DeadlineError extends Error {
3
3
  /**
4
4
  * @param ms Deadline in milliseconds.
@@ -6,9 +6,9 @@ export declare class DeadlineError extends Error {
6
6
  constructor(ms: number);
7
7
  }
8
8
  /**
9
- * Rejects when a promise does not settle within a deadline.
10
- * @param work Promise to bound.
9
+ * Rejects when a promise doesn't settle within a deadline.
10
+ * @param work The promise to bound.
11
11
  * @param ms Deadline in milliseconds.
12
- * @returns The value of the promise, or a rejection after the deadline.
12
+ * @returns The promise's value, or a rejection after the deadline.
13
13
  */
14
14
  export declare function withDeadline<T>(work: Promise<T>, ms: number): Promise<T>;
@@ -1,13 +1,13 @@
1
- /** Standard fields of an error. The library writes the other own fields as error data. */
1
+ /** The standard error fields. Any other own field is written as error data. */
2
2
  export declare const ERROR_OWN_KEYS: ReadonlySet<string>;
3
3
  /**
4
- * Tests if a value is a field that error data keeps. An object field, for example the
5
- * config of an AxiosError, holds credentials and request bodies.
4
+ * Checks whether a value is a field that error data keeps. An object field, such as an
5
+ * AxiosError's config, holds credentials and request bodies.
6
6
  * @param value Field value.
7
7
  * @returns True for a string, a number or a boolean.
8
8
  */
9
9
  export declare function isDataField(value: unknown): boolean;
10
- /** The fields of an error that the library reads. */
10
+ /** The error fields that the library reads. */
11
11
  export interface ErrorLike {
12
12
  /** Error class name, for example "TypeError". */
13
13
  name: string;
@@ -17,9 +17,9 @@ export interface ErrorLike {
17
17
  stack?: string;
18
18
  }
19
19
  /**
20
- * Tests if a value has the shape of an error.
21
- * A getter on a hostile value can throw. Call this function inside a diagnostics guard.
22
- * @param value Value to test.
20
+ * Checks whether a value has the shape of an error. A getter on a hostile value can throw, so
21
+ * call this inside a diagnostics guard.
22
+ * @param value The value to check.
23
23
  * @returns True for an object with a string name, a string message and a string or no stack.
24
24
  */
25
25
  export declare function isErrorLike(value: unknown): value is ErrorLike;
@@ -7,18 +7,19 @@ export interface StormWindow {
7
7
  }
8
8
  /**
9
9
  * Counts one event in a fixed window.
10
- * @param window Window state to change.
11
- * @param limit Maximum events in each window.
12
- * @param windowMs Length of the window, in milliseconds.
10
+ * @param window The window state to update.
11
+ * @param limit Maximum events per window.
12
+ * @param windowMs Window length in milliseconds.
13
13
  * @returns False when the window has no allowance left. The caller must drop the event.
14
14
  */
15
15
  export declare function countInWindow(window: StormWindow, limit: number, windowMs: number): boolean;
16
16
  /**
17
- * Tells if a fixed window has ended. The bus uses the same rule to expire its source entries.
17
+ * Checks whether a fixed window has ended. The bus uses the same rule to expire its source
18
+ * entries.
18
19
  * @param window Window state.
19
- * @param windowMs Length of the window, in milliseconds.
20
- * @param now Current epoch time, in milliseconds.
21
- * @returns True after the window length, or when the clock moved back. Without the second
22
- * check, a clock that moves back keeps the window open.
20
+ * @param windowMs Window length in milliseconds.
21
+ * @param now Current epoch time in milliseconds.
22
+ * @returns True once the window length has passed, or when the clock moved back. Without the
23
+ * second check, a clock that moves back would keep the window open.
23
24
  */
24
25
  export declare function windowEnded(window: StormWindow, windowMs: number, now: number): boolean;
@@ -1,20 +1,20 @@
1
- /** Scope that a function runs inside. */
1
+ /** A scope that a function runs inside. */
2
2
  export interface GlobalScope {
3
3
  /**
4
- * Runs a function inside the scope. The scope covers only the synchronous part of the function.
5
- * @param fn Function to run.
6
- * @returns The return value of the function.
4
+ * Runs a function inside the scope. Only the synchronous part of the function is covered.
5
+ * @param fn The function to run.
6
+ * @returns The function's return value.
7
7
  */
8
8
  run<T>(fn: () => T): T;
9
9
  /**
10
- * Tests if a scope is open.
11
- * @returns True while a function runs inside the scope.
10
+ * Checks whether a scope is open.
11
+ * @returns True while a function is running inside the scope.
12
12
  */
13
13
  open(): boolean;
14
14
  }
15
15
  /**
16
- * Makes a scope whose count is on a global symbol.
17
- * @param key Key of the global symbol.
16
+ * Creates a scope whose count lives on a global symbol.
17
+ * @param key The global symbol's key.
18
18
  * @returns The scope.
19
19
  */
20
20
  export declare function globalScope(key: string): GlobalScope;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Tests if a value is an object that is not null and not an array.
3
- * @param value Value to test.
2
+ * Checks whether a value is a non-null object that isn't an array.
3
+ * @param value The value to check.
4
4
  * @returns True for an object with string keys.
5
5
  */
6
6
  export declare function isObject(value: unknown): value is Record<string, unknown>;
@@ -35,31 +35,31 @@ export interface IdentityStores {
35
35
  /** Store that lasts for one tab. */
36
36
  session(): KeyValueStore;
37
37
  }
38
- /** Stores that write to the browser. The `identity: "storage"` option uses them. */
38
+ /** Stores that write to the browser. Used by the `identity: "storage"` option. */
39
39
  export declare const BROWSER_STORES: IdentityStores;
40
40
  /**
41
- * Creates stores that keep values in memory only. The `identity: "memory"` option uses them.
41
+ * Creates stores that keep values in memory only. Used by the `identity: "memory"` option.
42
42
  * @returns Stores that write nothing to the browser.
43
43
  */
44
44
  export declare function memoryStores(): IdentityStores;
45
45
  /**
46
- * Generates a random lowercase hexadecimal string of the specified byte length.
47
- * It uses crypto.getRandomValues when it is available. If not, it uses Math.random.
46
+ * Generates a random lowercase hexadecimal string of the given byte length. Uses
47
+ * crypto.getRandomValues when it is available, and Math.random otherwise.
48
48
  * @param byteLength Number of random bytes to generate.
49
49
  * @returns Hexadecimal string of length byteLength * 2.
50
50
  */
51
51
  export declare function randomHex(byteLength: number): string;
52
52
  /**
53
- * Generates a unique identifier string using crypto.randomUUID or randomHex fallback.
54
- * @param diagnostics Diagnostics reporter. It counts a blocked crypto.randomUUID call.
55
- * @returns UUID or random hex identifier.
53
+ * Generates a unique identifier with crypto.randomUUID, falling back to randomHex.
54
+ * @param diagnostics Diagnostics reporter. Counts a blocked crypto.randomUUID call.
55
+ * @returns A UUID or a random hex identifier.
56
56
  */
57
57
  export declare function newId(diagnostics: Diagnostics): string;
58
58
  /**
59
- * Resolves or initializes session, tab, and context identifiers for the active realm.
59
+ * Resolves or initializes the session, tab, and context identifiers for the active realm.
60
60
  * @param diagnostics Diagnostics reporter.
61
61
  * @param stores Identity stores.
62
- * @returns Populated Identity object.
62
+ * @returns The populated Identity object.
63
63
  */
64
64
  export declare function resolveIdentity(diagnostics: Diagnostics, stores?: IdentityStores, idleMs?: number): Identity;
65
65
  /**
@@ -70,9 +70,9 @@ export declare function resolveIdentity(diagnostics: Diagnostics, stores?: Ident
70
70
  */
71
71
  export declare function persistTabId(tabId: string, diagnostics: Diagnostics, stores: IdentityStores): void;
72
72
  /**
73
- * Writes the last-seen timestamp of the session. `SESSION_TOUCH_MS` sets the throttle.
74
- * The instance keeps the throttle state, not the module. Two runtimes in one document
75
- * must not block the session writes of each other.
73
+ * Writes the session's last-seen timestamp, throttled by `SESSION_TOUCH_MS`. The throttle
74
+ * state lives on the instance, not the module, so two runtimes in one document don't block
75
+ * each other's session writes.
76
76
  */
77
77
  export declare class SessionTouch {
78
78
  private diagnostics;
@@ -87,18 +87,18 @@ export declare class SessionTouch {
87
87
  */
88
88
  constructor(diagnostics: Diagnostics, stores?: IdentityStores, touchMs?: number, idleMs?: number);
89
89
  /**
90
- * Writes the session activity time to the local store. It writes one time in each throttle window.
91
- * @param sessionId Active session identifier.
90
+ * Writes the session activity time to the local store, at most once per throttle window.
91
+ * @param sessionId The active session identifier.
92
92
  */
93
93
  touch(sessionId: string): void;
94
94
  /**
95
- * Reads the live session id in the local store.
95
+ * Reads the live session id from the local store.
96
96
  * @returns The stored session id, or undefined if no session is live.
97
97
  */
98
98
  stored(): string | undefined;
99
99
  /**
100
- * Writes a new session id to the local store now. The throttle does not apply.
101
- * @param sessionId New session identifier.
100
+ * Writes a new session id to the local store right away, bypassing the throttle.
101
+ * @param sessionId The new session identifier.
102
102
  */
103
103
  restart(sessionId: string): void;
104
104
  /**
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Runs a function inside the library console scope.
3
- * @param fn Function that writes to the console.
4
- * @returns The return value of the function.
3
+ * @param fn The function that writes to the console.
4
+ * @returns The function's return value.
5
5
  */
6
6
  export declare function runAsLibraryConsole<T>(fn: () => T): T;
7
7
  /**
8
- * Tests if a library console scope is open.
9
- * @returns True while the library writes to the console.
8
+ * Checks whether a library console scope is open.
9
+ * @returns True while the library is writing to the console.
10
10
  */
11
11
  export declare function isLibraryConsole(): boolean;