@utk09/ui-observability 0.11.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 (383) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +273 -102
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-CL9uWYY3.js → batch-BjQUwjA6.js} +4 -4
  5. package/dist/batch-BjQUwjA6.js.map +1 -0
  6. package/dist/{batch-C8OcWR2L.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-BZ0GldpT.js → bus-ecxUNTja.js} +91 -91
  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-BPZCuSLc.cjs → console-CLz_PvFn.cjs} +2 -2
  39. package/dist/console-CLz_PvFn.cjs.map +1 -0
  40. package/dist/{console-BeCF7n59.js → console-cwgHKXvM.js} +4 -4
  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-BzkoHzkQ.js.map +1 -1
  49. package/dist/core/breadcrumbs.d.ts +16 -15
  50. package/dist/core/config.d.ts +3 -3
  51. package/dist/core/context.d.ts +7 -7
  52. package/dist/core/debug-buffer.d.ts +10 -10
  53. package/dist/core/debug-bundle.d.ts +3 -3
  54. package/dist/core/deferred.d.ts +2 -2
  55. package/dist/core/diagnostics.d.ts +24 -21
  56. package/dist/core/drops.d.ts +7 -7
  57. package/dist/core/hold-buffer.d.ts +1 -1
  58. package/dist/core/journey.d.ts +22 -23
  59. package/dist/core/logger.d.ts +22 -21
  60. package/dist/core/measure.d.ts +7 -7
  61. package/dist/core/meter.d.ts +25 -21
  62. package/dist/core/pipeline.d.ts +42 -41
  63. package/dist/core/profile-buckets.d.ts +31 -0
  64. package/dist/core/profiler.d.ts +218 -0
  65. package/dist/core/record.d.ts +23 -23
  66. package/dist/core/remote-rules.d.ts +4 -4
  67. package/dist/core/remote-sampling.d.ts +21 -20
  68. package/dist/core/runtime.d.ts +206 -137
  69. package/dist/core/sampling.d.ts +18 -18
  70. package/dist/core/sender.d.ts +22 -20
  71. package/dist/core/spans.d.ts +5 -5
  72. package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
  73. package/dist/deadline-C4ccAuk5.js.map +1 -0
  74. package/dist/deadline-CUGbto-y.cjs +2 -0
  75. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  76. package/dist/{debug-bundle-C7UkHZ-q.js → debug-bundle-BOdYmCeV.js} +10 -3
  77. package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
  78. package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
  79. package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
  80. package/dist/doctor.cjs +1 -1
  81. package/dist/doctor.cjs.map +1 -1
  82. package/dist/doctor.d.ts +16 -6
  83. package/dist/doctor.js +147 -52
  84. package/dist/doctor.js.map +1 -1
  85. package/dist/{emergency-queue-Zy6lNafo.js → emergency-queue-B9WZxanZ.js} +4 -4
  86. package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
  87. package/dist/{emergency-queue-CNTRui5t.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
  88. package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
  89. package/dist/error-like-B11pB4aL.js.map +1 -1
  90. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  91. package/dist/{errors-Dh7kef0i.js → errors-D6bwgJtO.js} +3 -3
  92. package/dist/errors-D6bwgJtO.js.map +1 -0
  93. package/dist/{errors-tfEr48bS.cjs → errors-DCOCRdSi.cjs} +2 -2
  94. package/dist/errors-DCOCRdSi.cjs.map +1 -0
  95. package/dist/{factory-CJXVYp0R.cjs → factory-DLFDjdLv.cjs} +2 -2
  96. package/dist/factory-DLFDjdLv.cjs.map +1 -0
  97. package/dist/{factory-BonqI3NL.js → factory-e9Qo3K0z.js} +13 -13
  98. package/dist/factory-e9Qo3K0z.js.map +1 -0
  99. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  100. package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
  101. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  102. package/dist/global-scope-D9I8s-oN.js.map +1 -1
  103. package/dist/guards-Cidk71ME.js.map +1 -1
  104. package/dist/guards-nJ70syPt.cjs.map +1 -1
  105. package/dist/{identity-Cxgj6pZX.cjs → identity-BlvlgjrU.cjs} +2 -2
  106. package/dist/identity-BlvlgjrU.cjs.map +1 -0
  107. package/dist/{identity-DT5VmvXy.js → identity-BrQp_5J5.js} +19 -19
  108. package/dist/identity-BrQp_5J5.js.map +1 -0
  109. package/dist/index.cjs +1 -1
  110. package/dist/index.cjs.map +1 -1
  111. package/dist/index.d.ts +112 -79
  112. package/dist/index.js +783 -635
  113. package/dist/index.js.map +1 -1
  114. package/dist/{indexeddb-storage-CIoW21Xd.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
  115. package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
  116. package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-DLXQzAGh.js} +4 -4
  117. package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
  118. package/dist/{interactions-DTgKy_6K.js → interactions-B6z2I4tU.js} +3 -3
  119. package/dist/interactions-B6z2I4tU.js.map +1 -0
  120. package/dist/{interactions-fEN6FbVo.cjs → interactions-P6pz08Jn.cjs} +2 -2
  121. package/dist/interactions-P6pz08Jn.cjs.map +1 -0
  122. package/dist/{journey-CuJrHzEg.js → journey-35yCMNFo.js} +20 -19
  123. package/dist/journey-35yCMNFo.js.map +1 -0
  124. package/dist/journey-DAGh5h9k.cjs +2 -0
  125. package/dist/journey-DAGh5h9k.cjs.map +1 -0
  126. package/dist/keys-BHhw_0Wh.cjs.map +1 -1
  127. package/dist/keys-BU9j5YqW.js.map +1 -1
  128. package/dist/{library-console-D2GY9Or6.cjs → library-console-BFWEuQsl.cjs} +2 -2
  129. package/dist/library-console-BFWEuQsl.cjs.map +1 -0
  130. package/dist/{library-console-C1m6g1BR.js → library-console-Dl_Ly6DQ.js} +2 -2
  131. package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
  132. package/dist/{library-request-1BX_UlaX.cjs → library-request-Da-CHKzT.cjs} +2 -2
  133. package/dist/library-request-Da-CHKzT.cjs.map +1 -0
  134. package/dist/{library-request-BQBT9N9Q.js → library-request-nI6pvI6I.js} +2 -2
  135. package/dist/library-request-nI6pvI6I.js.map +1 -0
  136. package/dist/{lifecycle-2EtUaRpo.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
  137. package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
  138. package/dist/{lifecycle-BaKx_-32.js → lifecycle-CZ6RRXc6.js} +2 -2
  139. package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
  140. package/dist/{log-record-i9zOTkpQ.cjs → log-record-D7bA1RPb.cjs} +2 -2
  141. package/dist/log-record-D7bA1RPb.cjs.map +1 -0
  142. package/dist/{log-record-CAoGBBf3.js → log-record-DIA6McNr.js} +2 -2
  143. package/dist/log-record-DIA6McNr.js.map +1 -0
  144. package/dist/{long-frames-Czk7IupC.js → long-frames-430_85Da.js} +8 -6
  145. package/dist/long-frames-430_85Da.js.map +1 -0
  146. package/dist/long-frames-Dd8tsi2U.cjs +2 -0
  147. package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
  148. package/dist/models/batch.d.ts +14 -15
  149. package/dist/models/bus.d.ts +24 -24
  150. package/dist/models/config.d.ts +402 -216
  151. package/dist/models/drop.d.ts +13 -11
  152. package/dist/models/health.d.ts +13 -13
  153. package/dist/models/log-record.d.ts +13 -14
  154. package/dist/models/metric.d.ts +82 -17
  155. package/dist/models/plugin.d.ts +13 -13
  156. package/dist/models/replay.d.ts +60 -0
  157. package/dist/models/serializer.d.ts +2 -3
  158. package/dist/models/stats.d.ts +2 -2
  159. package/dist/models/storage.d.ts +12 -11
  160. package/dist/{network-DBNwApoF.js → network-C7SkLf4v.js} +12 -12
  161. package/dist/network-C7SkLf4v.js.map +1 -0
  162. package/dist/{network-xbbuvG_6.cjs → network-pEX3PAJv.cjs} +2 -2
  163. package/dist/network-pEX3PAJv.cjs.map +1 -0
  164. package/dist/openfin-Bxelt0yg.js.map +1 -1
  165. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  166. package/dist/otlp-2MCrC3kd.cjs +2 -0
  167. package/dist/otlp-2MCrC3kd.cjs.map +1 -0
  168. package/dist/{otlp-BTJdIa6F.js → otlp-COq033e3.js} +25 -32
  169. package/dist/otlp-COq033e3.js.map +1 -0
  170. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  171. package/dist/patch-UdPz1ea8.js.map +1 -1
  172. package/dist/{platform-C2Ez5kDc.cjs → platform-12uR7kBQ.cjs} +2 -2
  173. package/dist/platform-12uR7kBQ.cjs.map +1 -0
  174. package/dist/{platform-DkcuXwe-.js → platform-CVewe4wQ.js} +7 -7
  175. package/dist/platform-CVewe4wQ.js.map +1 -0
  176. package/dist/profiler-BVWIOgnq.js +310 -0
  177. package/dist/profiler-BVWIOgnq.js.map +1 -0
  178. package/dist/profiler-eVCknCzS.cjs +2 -0
  179. package/dist/profiler-eVCknCzS.cjs.map +1 -0
  180. package/dist/profiler-frames-CLXlT_xL.js +86 -0
  181. package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
  182. package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
  183. package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
  184. package/dist/{remote-rules-Cfb4K-Nl.js → remote-rules-BJGDJGwA.js} +27 -27
  185. package/dist/remote-rules-BJGDJGwA.js.map +1 -0
  186. package/dist/{remote-rules-vzvk7aKf.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
  187. package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
  188. package/dist/replay-0zAJv9T3.js +338 -0
  189. package/dist/replay-0zAJv9T3.js.map +1 -0
  190. package/dist/replay-DomJpXqW.cjs +2 -0
  191. package/dist/replay-DomJpXqW.cjs.map +1 -0
  192. package/dist/{reports-Dk2YhKIh.cjs → reports-BsbqmP8h.cjs} +2 -2
  193. package/dist/reports-BsbqmP8h.cjs.map +1 -0
  194. package/dist/{reports-TA-zInnq.js → reports-BuXekPOS.js} +3 -3
  195. package/dist/reports-BuXekPOS.js.map +1 -0
  196. package/dist/{resource-timing-BLv3EA2A.js → resource-timing-CXGHwFRD.js} +4 -4
  197. package/dist/resource-timing-CXGHwFRD.js.map +1 -0
  198. package/dist/{resource-timing-Cysw1S1f.cjs → resource-timing-DkycFGDa.cjs} +2 -2
  199. package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
  200. package/dist/{sampling-Ckh2yW9k.cjs → sampling-Dd0wllyq.cjs} +2 -2
  201. package/dist/sampling-Dd0wllyq.cjs.map +1 -0
  202. package/dist/{sampling-C4VV-1MS.js → sampling-UUDbi3K0.js} +9 -9
  203. package/dist/sampling-UUDbi3K0.js.map +1 -0
  204. package/dist/{sanitize-6ymPlVvP.js → sanitize-CNmsD9r3.js} +2 -2
  205. package/dist/sanitize-CNmsD9r3.js.map +1 -0
  206. package/dist/{sanitize-BAWzkZt0.cjs → sanitize-ChLn97Ch.cjs} +2 -2
  207. package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
  208. package/dist/{select-ZF4by-lF.cjs → select-CTk-K5mG.cjs} +3 -3
  209. package/dist/select-CTk-K5mG.cjs.map +1 -0
  210. package/dist/{select-xtQaenIi.js → select-DPv_j6wq.js} +61 -61
  211. package/dist/select-DPv_j6wq.js.map +1 -0
  212. package/dist/{sender-CiMHC9YG.js → sender-15zEsZpr.js} +61 -60
  213. package/dist/sender-15zEsZpr.js.map +1 -0
  214. package/dist/sender-Bfpv9tad.cjs +2 -0
  215. package/dist/sender-Bfpv9tad.cjs.map +1 -0
  216. package/dist/storage/context-storage.d.ts +34 -33
  217. package/dist/storage/emergency-queue.d.ts +9 -9
  218. package/dist/storage/eviction.d.ts +12 -12
  219. package/dist/storage/factory.d.ts +8 -7
  220. package/dist/storage/gap.d.ts +6 -6
  221. package/dist/storage/idb-driver.d.ts +31 -32
  222. package/dist/storage/indexeddb-storage.d.ts +26 -27
  223. package/dist/storage/keys.d.ts +7 -7
  224. package/dist/storage/local-storage.d.ts +38 -38
  225. package/dist/storage/memory-storage.d.ts +21 -22
  226. package/dist/storage/persistence.d.ts +1 -1
  227. package/dist/storage-BA9RqRO-.cjs.map +1 -1
  228. package/dist/storage-DZwed89z.js.map +1 -1
  229. package/dist/{storm-VR024_QN.js → storm-BTSNTIWI.js} +2 -2
  230. package/dist/storm-BTSNTIWI.js.map +1 -0
  231. package/dist/{storm-CYi9Swpx.cjs → storm-D0_qZOEg.cjs} +2 -2
  232. package/dist/storm-D0_qZOEg.cjs.map +1 -0
  233. package/dist/transport/compression.d.ts +2 -2
  234. package/dist/transport/errors.d.ts +7 -7
  235. package/dist/transport/exit-flush.d.ts +39 -39
  236. package/dist/transport/headers.d.ts +2 -2
  237. package/dist/transport/http-transport.d.ts +28 -27
  238. package/dist/transport/memory-transport.d.ts +6 -6
  239. package/dist/transport/retry-engine.d.ts +35 -34
  240. package/dist/transport/serializers/ecs.d.ts +1 -1
  241. package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
  242. package/dist/transport/serializers/otlp-traces.d.ts +1 -1
  243. package/dist/transport/serializers/otlp.d.ts +16 -16
  244. package/dist/transport/serializers/select.d.ts +7 -7
  245. package/dist/transport/status-transport.d.ts +20 -20
  246. package/dist/transport/worker-protocol.d.ts +3 -3
  247. package/dist/types-BAerHgCq.js.map +1 -1
  248. package/dist/types-C7WNpnG1.cjs.map +1 -1
  249. package/dist/{unclean-exit-DFUN57wY.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
  250. package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
  251. package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-Cob_jyTv.js} +2 -2
  252. package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
  253. package/dist/unref-CU9Nyz_9.cjs +2 -0
  254. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  255. package/dist/unref-DgHPQeWv.js +7 -0
  256. package/dist/unref-DgHPQeWv.js.map +1 -0
  257. package/dist/user-timing-CdYqx3PF.cjs +2 -0
  258. package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
  259. package/dist/{user-timing-_jZIhDKI.js → user-timing-DgHubxCI.js} +5 -3
  260. package/dist/user-timing-DgHubxCI.js.map +1 -0
  261. package/dist/utils/console.d.ts +2 -2
  262. package/dist/utils/deadline.d.ts +4 -4
  263. package/dist/utils/error-like.d.ts +7 -7
  264. package/dist/utils/fixed-window.d.ts +9 -8
  265. package/dist/utils/global-scope.d.ts +8 -8
  266. package/dist/utils/guards.d.ts +2 -2
  267. package/dist/utils/identity.d.ts +17 -17
  268. package/dist/utils/library-console.d.ts +4 -4
  269. package/dist/utils/library-request.d.ts +10 -10
  270. package/dist/utils/lock.d.ts +10 -9
  271. package/dist/utils/openfin.d.ts +5 -5
  272. package/dist/utils/patch.d.ts +6 -6
  273. package/dist/utils/platform.d.ts +13 -11
  274. package/dist/utils/sanitize.d.ts +4 -4
  275. package/dist/utils/timer.d.ts +1 -1
  276. package/dist/utils/tracing.d.ts +38 -38
  277. package/dist/utils/unref.d.ts +3 -3
  278. package/dist/{web-socket-BWUoqBh8.cjs → web-socket-BTuvYoJI.cjs} +2 -2
  279. package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
  280. package/dist/{web-socket-CV7yIMnm.js → web-socket-DthJuSAg.js} +4 -4
  281. package/dist/web-socket-DthJuSAg.js.map +1 -0
  282. package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
  283. package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
  284. package/dist/web-vitals-CsGCWnUr.js +77 -0
  285. package/dist/web-vitals-CsGCWnUr.js.map +1 -0
  286. package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-B0_8rWy5.js} +4 -4
  287. package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
  288. package/dist/{worker-protocol-Bai7GAIA.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
  289. package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
  290. package/dist/worker-server-4en-Lt-3.cjs +2 -0
  291. package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
  292. package/dist/{worker-server-Dp5HYm4b.js → worker-server-Cne9MX9I.js} +8 -8
  293. package/dist/{worker-server-Dp5HYm4b.js.map → worker-server-Cne9MX9I.js.map} +1 -1
  294. package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
  295. package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
  296. package/dist/{worker-transport-D6jtgpqN.js → worker-transport-C3SjJAEC.js} +62 -61
  297. package/dist/worker-transport-C3SjJAEC.js.map +1 -0
  298. package/package.json +8 -2
  299. package/dist/batch-C8OcWR2L.cjs.map +0 -1
  300. package/dist/batch-CL9uWYY3.js.map +0 -1
  301. package/dist/bus-BZ0GldpT.js.map +0 -1
  302. package/dist/bus-VWlmM5xs.cjs +0 -2
  303. package/dist/bus-VWlmM5xs.cjs.map +0 -1
  304. package/dist/console-BPZCuSLc.cjs.map +0 -1
  305. package/dist/console-BeCF7n59.js.map +0 -1
  306. package/dist/constants-DqKJH_MP.cjs +0 -2
  307. package/dist/constants-DqKJH_MP.cjs.map +0 -1
  308. package/dist/constants-zyrqveN4.js +0 -304
  309. package/dist/constants-zyrqveN4.js.map +0 -1
  310. package/dist/deadline-BOjOxNHj.js.map +0 -1
  311. package/dist/deadline-XSnm95pg.cjs +0 -2
  312. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  313. package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
  314. package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
  315. package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
  316. package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
  317. package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
  318. package/dist/errors-Dh7kef0i.js.map +0 -1
  319. package/dist/errors-tfEr48bS.cjs.map +0 -1
  320. package/dist/factory-BonqI3NL.js.map +0 -1
  321. package/dist/factory-CJXVYp0R.cjs.map +0 -1
  322. package/dist/identity-Cxgj6pZX.cjs.map +0 -1
  323. package/dist/identity-DT5VmvXy.js.map +0 -1
  324. package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
  325. package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
  326. package/dist/interactions-DTgKy_6K.js.map +0 -1
  327. package/dist/interactions-fEN6FbVo.cjs.map +0 -1
  328. package/dist/journey-CuJrHzEg.js.map +0 -1
  329. package/dist/journey-pffMVMfa.cjs +0 -2
  330. package/dist/journey-pffMVMfa.cjs.map +0 -1
  331. package/dist/library-console-C1m6g1BR.js.map +0 -1
  332. package/dist/library-console-D2GY9Or6.cjs.map +0 -1
  333. package/dist/library-request-1BX_UlaX.cjs.map +0 -1
  334. package/dist/library-request-BQBT9N9Q.js.map +0 -1
  335. package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
  336. package/dist/lifecycle-BaKx_-32.js.map +0 -1
  337. package/dist/log-record-CAoGBBf3.js.map +0 -1
  338. package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
  339. package/dist/long-frames-BVg4i5SC.cjs +0 -2
  340. package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
  341. package/dist/long-frames-Czk7IupC.js.map +0 -1
  342. package/dist/network-DBNwApoF.js.map +0 -1
  343. package/dist/network-xbbuvG_6.cjs.map +0 -1
  344. package/dist/otlp-BDvFrLnc.cjs +0 -2
  345. package/dist/otlp-BDvFrLnc.cjs.map +0 -1
  346. package/dist/otlp-BTJdIa6F.js.map +0 -1
  347. package/dist/platform-C2Ez5kDc.cjs.map +0 -1
  348. package/dist/platform-DkcuXwe-.js.map +0 -1
  349. package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
  350. package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
  351. package/dist/reports-Dk2YhKIh.cjs.map +0 -1
  352. package/dist/reports-TA-zInnq.js.map +0 -1
  353. package/dist/resource-timing-BLv3EA2A.js.map +0 -1
  354. package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
  355. package/dist/sampling-C4VV-1MS.js.map +0 -1
  356. package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
  357. package/dist/sanitize-6ymPlVvP.js.map +0 -1
  358. package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
  359. package/dist/select-ZF4by-lF.cjs.map +0 -1
  360. package/dist/select-xtQaenIi.js.map +0 -1
  361. package/dist/sender-CiMHC9YG.js.map +0 -1
  362. package/dist/sender-D5wBoXA8.cjs +0 -2
  363. package/dist/sender-D5wBoXA8.cjs.map +0 -1
  364. package/dist/storm-CYi9Swpx.cjs.map +0 -1
  365. package/dist/storm-VR024_QN.js.map +0 -1
  366. package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
  367. package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
  368. package/dist/user-timing-C9kfRq3J.cjs +0 -2
  369. package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
  370. package/dist/user-timing-_jZIhDKI.js.map +0 -1
  371. package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
  372. package/dist/web-socket-CV7yIMnm.js.map +0 -1
  373. package/dist/web-vitals-Bq4WFHQo.js +0 -52
  374. package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
  375. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  376. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  377. package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
  378. package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
  379. package/dist/worker-server-BrIYkfoa.cjs +0 -2
  380. package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
  381. package/dist/worker-transport-Bwej4N2e.cjs +0 -2
  382. package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
  383. package/dist/worker-transport-D6jtgpqN.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library-console-BFWEuQsl.cjs","names":["globalScope","LIBRARY_CONSOLE_KEY","require_constants","scope","runAsLibraryConsole","fn","isLibraryConsole"],"sources":["../src/utils/library-console.ts"],"sourcesContent":["// src/utils/library-console.ts\n//\n// Marks the console calls that the library makes itself, so the console capture can skip them.\n// Without the scope, the capture would record every mirrored line again in an endless loop.\n\nimport { LIBRARY_CONSOLE_KEY } from \"../constants\";\nimport { globalScope } from \"./global-scope\";\n\n/** The scope for the library's own console calls. */\nconst scope = globalScope(LIBRARY_CONSOLE_KEY);\n\n/**\n * Runs a function inside the library console scope.\n * @param fn The function that writes to the console.\n * @returns The function's return value.\n */\nexport function runAsLibraryConsole<T>(fn: () => T): T {\n return scope.run(fn);\n}\n\n/**\n * Checks whether a library console scope is open.\n * @returns True while the library is writing to the console.\n */\nexport function isLibraryConsole(): boolean {\n return scope.open();\n}\n"],"mappings":"A,4CASA,IAAMG,E,qCAAQH,CAAAA,CAAAA,EAAYC,EAAAA,EAAmB,EAO7C,SAAgBG,EAAuB,EAAgB,CACrD,OAAOD,EAAM,IAAIE,CAAE,CACrB,CAMA,SAAgBC,GAA4B,CAC1C,OAAOH,EAAM,KAAK,CACpB,C"}
@@ -1,4 +1,4 @@
1
- import { Tt as e } from "./constants-zyrqveN4.js";
1
+ import { Et as e } from "./constants-Bwl_YtQi.js";
2
2
  import { t } from "./global-scope-D9I8s-oN.js";
3
3
  // src/utils/library-console.ts
4
4
  var n = t(e);
@@ -10,4 +10,4 @@ function i() {
10
10
  }
11
11
  export { r as n, i as t };
12
12
 
13
- //# sourceMappingURL=library-console-C1m6g1BR.js.map
13
+ //# sourceMappingURL=library-console-Dl_Ly6DQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library-console-Dl_Ly6DQ.js","names":["LIBRARY_CONSOLE_KEY","scope","globalScope","runAsLibraryConsole","fn","isLibraryConsole"],"sources":["../src/utils/library-console.ts"],"sourcesContent":["// src/utils/library-console.ts\n//\n// Marks the console calls that the library makes itself, so the console capture can skip them.\n// Without the scope, the capture would record every mirrored line again in an endless loop.\n\nimport { LIBRARY_CONSOLE_KEY } from \"../constants\";\nimport { globalScope } from \"./global-scope\";\n\n/** The scope for the library's own console calls. */\nconst scope = globalScope(LIBRARY_CONSOLE_KEY);\n\n/**\n * Runs a function inside the library console scope.\n * @param fn The function that writes to the console.\n * @returns The function's return value.\n */\nexport function runAsLibraryConsole<T>(fn: () => T): T {\n return scope.run(fn);\n}\n\n/**\n * Checks whether a library console scope is open.\n * @returns True while the library is writing to the console.\n */\nexport function isLibraryConsole(): boolean {\n return scope.open();\n}\n"],"mappings":";;;AASA,IAAMC,IAAQC,EAAYF,CAAmB;AAO7C,SAAgBG,EAAuB,GAAgB;CACrD,OAAOF,EAAM,IAAIG,CAAE;AACrB;AAMA,SAAgBC,IAA4B;CAC1C,OAAOJ,EAAM,KAAK;AACpB"}
@@ -1,2 +1,2 @@
1
- const e=require("./constants-DqKJH_MP.cjs");var t=require("./global-scope-BN-Io_yv.cjs").t(e.Dt),n=Symbol.for(e.Ln),r=globalThis,i=()=>r[n]??0;function a(e){return t.run(e)}function o(){return t.open()}async function s(e){r[n]=i()+1;try{return await e()}finally{r[n]=i()-1}}function c(){return i()>0}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
2
- //# sourceMappingURL=library-request-1BX_UlaX.cjs.map
1
+ const e=require("./constants-DakMxVB2.cjs");var t=require("./global-scope-BN-Io_yv.cjs").t(e.Ot),n=Symbol.for(e.Yn),r=globalThis,i=()=>r[n]??0;function a(e){return t.run(e)}function o(){return t.open()}async function s(e){r[n]=i()+1;try{return await e()}finally{r[n]=i()-1}}function c(){return i()>0}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
2
+ //# sourceMappingURL=library-request-Da-CHKzT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library-request-Da-CHKzT.cjs","names":["globalScope","LIBRARY_REQUEST_KEY","TRANSPORT_CALL_KEY","require_constants","scope","calls","store","pending","runAsLibraryRequest","fn","isLibraryRequest","trackTransportCall","isTransportPending"],"sources":["../src/utils/library-request.ts"],"sourcesContent":["// src/utils/library-request.ts\n//\n// Marks the requests that the library starts itself, so network capture can skip them. A\n// captured library request would log a record, the library would send that record with\n// another request, and the loop would never stop.\n\nimport { LIBRARY_REQUEST_KEY, TRANSPORT_CALL_KEY } from \"../constants\";\nimport { globalScope } from \"./global-scope\";\n\n/** The scope for the library's own requests. */\nconst scope = globalScope(LIBRARY_REQUEST_KEY);\n\n/** Global count of custom transport calls that are still waiting for an answer. */\nconst calls = Symbol.for(TRANSPORT_CALL_KEY);\nconst store = globalThis as unknown as Record<symbol, number | undefined>;\nconst pending = (): number => store[calls] ?? 0;\n\n/**\n * Runs a function inside the library request scope. Only the synchronous part of the function\n * is covered, so a request that starts after an await is outside the scope.\n * @param fn The function that starts the request.\n * @returns The function's return value.\n */\nexport function runAsLibraryRequest<T>(fn: () => T): T {\n return scope.run(fn);\n}\n\n/**\n * Checks whether a library request scope is open.\n * @returns True while the library is starting a request.\n */\nexport function isLibraryRequest(): boolean {\n return scope.open();\n}\n\n/**\n * Runs a custom transport call and counts it until it settles. The count includes the time after\n * each await, which the library request scope does not cover.\n * @param fn The function that calls the custom transport.\n * @returns A promise that settles with the call's result.\n */\nexport async function trackTransportCall<T>(fn: () => T | PromiseLike<T>): Promise<T> {\n store[calls] = pending() + 1;\n\n try {\n return await fn();\n } finally {\n store[calls] = pending() - 1;\n }\n}\n\n/**\n * Checks whether a custom transport call is still waiting for an answer.\n * @returns True while a call hasn't settled.\n */\nexport function isTransportPending(): boolean {\n return pending() > 0;\n}\n"],"mappings":"A,4CAUA,IAAMI,E,qCAAQJ,CAAAA,CAAAA,EAAYC,EAAAA,EAAmB,EAGvCI,EAAQ,OAAO,IAAIH,EAAAA,EAAkB,EACrCI,EAAQ,WACRC,MAAwBD,EAAMD,IAAU,EAQ9C,SAAgBG,EAAuB,EAAgB,CACrD,OAAOJ,EAAM,IAAIK,CAAE,CACrB,CAMA,SAAgBC,GAA4B,CAC1C,OAAON,EAAM,KAAK,CACpB,CAQA,eAAsBO,EAAsB,EAA0C,CACpF,EAAMN,GAASE,EAAQ,EAAI,EAE3B,GAAI,CACF,OAAO,MAAME,EAAG,CAClB,QAAU,CACR,EAAMJ,GAASE,EAAQ,EAAI,CAC7B,CACF,CAMA,SAAgBK,GAA8B,CAC5C,OAAOL,EAAQ,EAAI,CACrB,C"}
@@ -1,4 +1,4 @@
1
- import { Dt as e, Ln as t } from "./constants-zyrqveN4.js";
1
+ import { Ot as e, Yn as t } from "./constants-Bwl_YtQi.js";
2
2
  import { t as n } from "./global-scope-D9I8s-oN.js";
3
3
  // src/utils/library-request.ts
4
4
  var r = n(e), i = Symbol.for(t), a = globalThis, o = () => a[i] ?? 0;
@@ -21,4 +21,4 @@ function u() {
21
21
  }
22
22
  export { l as i, u as n, s as r, c as t };
23
23
 
24
- //# sourceMappingURL=library-request-BQBT9N9Q.js.map
24
+ //# sourceMappingURL=library-request-nI6pvI6I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library-request-nI6pvI6I.js","names":["LIBRARY_REQUEST_KEY","TRANSPORT_CALL_KEY","globalScope","scope","calls","store","pending","runAsLibraryRequest","fn","isLibraryRequest","trackTransportCall","isTransportPending"],"sources":["../src/utils/library-request.ts"],"sourcesContent":["// src/utils/library-request.ts\n//\n// Marks the requests that the library starts itself, so network capture can skip them. A\n// captured library request would log a record, the library would send that record with\n// another request, and the loop would never stop.\n\nimport { LIBRARY_REQUEST_KEY, TRANSPORT_CALL_KEY } from \"../constants\";\nimport { globalScope } from \"./global-scope\";\n\n/** The scope for the library's own requests. */\nconst scope = globalScope(LIBRARY_REQUEST_KEY);\n\n/** Global count of custom transport calls that are still waiting for an answer. */\nconst calls = Symbol.for(TRANSPORT_CALL_KEY);\nconst store = globalThis as unknown as Record<symbol, number | undefined>;\nconst pending = (): number => store[calls] ?? 0;\n\n/**\n * Runs a function inside the library request scope. Only the synchronous part of the function\n * is covered, so a request that starts after an await is outside the scope.\n * @param fn The function that starts the request.\n * @returns The function's return value.\n */\nexport function runAsLibraryRequest<T>(fn: () => T): T {\n return scope.run(fn);\n}\n\n/**\n * Checks whether a library request scope is open.\n * @returns True while the library is starting a request.\n */\nexport function isLibraryRequest(): boolean {\n return scope.open();\n}\n\n/**\n * Runs a custom transport call and counts it until it settles. The count includes the time after\n * each await, which the library request scope does not cover.\n * @param fn The function that calls the custom transport.\n * @returns A promise that settles with the call's result.\n */\nexport async function trackTransportCall<T>(fn: () => T | PromiseLike<T>): Promise<T> {\n store[calls] = pending() + 1;\n\n try {\n return await fn();\n } finally {\n store[calls] = pending() - 1;\n }\n}\n\n/**\n * Checks whether a custom transport call is still waiting for an answer.\n * @returns True while a call hasn't settled.\n */\nexport function isTransportPending(): boolean {\n return pending() > 0;\n}\n"],"mappings":";;;AAUA,IAAMG,IAAQD,EAAYF,CAAmB,GAGvCI,IAAQ,OAAO,IAAIH,CAAkB,GACrCI,IAAQ,YACRC,UAAwBD,EAAMD,MAAU;AAQ9C,SAAgBG,EAAuB,GAAgB;CACrD,OAAOJ,EAAM,IAAIK,CAAE;AACrB;AAMA,SAAgBC,IAA4B;CAC1C,OAAON,EAAM,KAAK;AACpB;AAQA,eAAsBO,EAAsB,GAA0C;CACpF,EAAMN,KAASE,EAAQ,IAAI;CAE3B,IAAI;EACF,OAAO,MAAME,EAAG;CAClB,UAAU;EACR,EAAMJ,KAASE,EAAQ,IAAI;CAC7B;AACF;AAMA,SAAgBK,IAA8B;CAC5C,OAAOL,EAAQ,IAAI;AACrB"}
@@ -1,2 +1,2 @@
1
- const e=require("./storm-CYi9Swpx.cjs");var t=class{ctx;name=`lifecycle`;installed=!1;phase={state:``,enteredAt:0};window={start:0,count:0};constructor(e){this.ctx=e}install(){this.installed||(this.installed=!0,this.ctx.once.lifecycle??={state:``,enteredAt:performance.now()},this.phase=this.ctx.once.lifecycle,document.addEventListener(`visibilitychange`,this.onVisibility),document.addEventListener(`freeze`,this.onFreeze),document.addEventListener(`resume`,this.onResume),addEventListener(`pageshow`,this.onPageShow),this.onVisibility())}uninstall(){this.installed=!1,document.removeEventListener(`visibilitychange`,this.onVisibility),document.removeEventListener(`freeze`,this.onFreeze),document.removeEventListener(`resume`,this.onResume),removeEventListener(`pageshow`,this.onPageShow)}onVisibility=()=>{this.transition(document.visibilityState===`hidden`?`hidden`:`visible`)};onFreeze=()=>{this.transition(`frozen`)};onResume=()=>{this.transition(`resumed`)};onPageShow=e=>{e.persisted&&this.transition(`restored`)};transition(t){if(!this.installed||t===this.phase.state)return;let n=performance.now(),r=this.phase.state,i=Math.max(0,n-this.phase.enteredAt);this.phase.state=t,this.phase.enteredAt=n;let{capturePolicy:a}=this.ctx.config;this.ctx.isActive?.()!==!1&&e.t(this.window,a.lifecyclePerWindow,this.ctx.diagnostics,`lifecycle events`,a.windowMs)&&this.ctx.diagnostics.guard(`capture.record_failed`,`The library could not record a lifecycle event.`,()=>{this.ctx.logger.logEvent(`ui.lifecycle`,{"lifecycle.state":t,"lifecycle.previous_state":r,"lifecycle.duration_ms":i})})}};exports.LifecycleCapture=t;
2
- //# sourceMappingURL=lifecycle-2EtUaRpo.cjs.map
1
+ const e=require("./storm-D0_qZOEg.cjs");var t=class{ctx;name=`lifecycle`;installed=!1;phase={state:``,enteredAt:0};window={start:0,count:0};constructor(e){this.ctx=e}install(){this.installed||(this.installed=!0,this.ctx.once.lifecycle??={state:``,enteredAt:performance.now()},this.phase=this.ctx.once.lifecycle,document.addEventListener(`visibilitychange`,this.onVisibility),document.addEventListener(`freeze`,this.onFreeze),document.addEventListener(`resume`,this.onResume),addEventListener(`pageshow`,this.onPageShow),this.onVisibility())}uninstall(){this.installed=!1,document.removeEventListener(`visibilitychange`,this.onVisibility),document.removeEventListener(`freeze`,this.onFreeze),document.removeEventListener(`resume`,this.onResume),removeEventListener(`pageshow`,this.onPageShow)}onVisibility=()=>{this.transition(document.visibilityState===`hidden`?`hidden`:`visible`)};onFreeze=()=>{this.transition(`frozen`)};onResume=()=>{this.transition(`resumed`)};onPageShow=e=>{e.persisted&&this.transition(`restored`)};transition(t){if(!this.installed||t===this.phase.state)return;let n=performance.now(),r=this.phase.state,i=Math.max(0,n-this.phase.enteredAt);this.phase.state=t,this.phase.enteredAt=n;let{capturePolicy:a}=this.ctx.config;this.ctx.isActive?.()!==!1&&e.t(this.window,a.lifecyclePerWindow,this.ctx.diagnostics,`lifecycle events`,a.windowMs)&&this.ctx.diagnostics.guard(`capture.record_failed`,`The library could not record a lifecycle event.`,()=>{this.ctx.logger.logEvent(`ui.lifecycle`,{"lifecycle.state":t,"lifecycle.previous_state":r,"lifecycle.duration_ms":i})})}};exports.LifecycleCapture=t;
2
+ //# sourceMappingURL=lifecycle-BGGOcN4N.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-BGGOcN4N.cjs","names":["allowInWindow","require_storm","LifecycleCapture","ctx","event","state","now","previous","duration","capturePolicy"],"sources":["../src/capture/lifecycle.ts"],"sourcesContent":["import { allowInWindow, type StormWindow } from \"./storm\";\nimport type { Capture, CaptureContext, CaptureOnce } from \"./types\";\n\n/** Records page state changes, each with how long the previous state lasted. */\nexport class LifecycleCapture implements Capture {\n readonly name = \"lifecycle\";\n\n private installed = false;\n\n private phase: NonNullable<CaptureOnce[\"lifecycle\"]> = { state: \"\", enteredAt: 0 };\n\n private readonly window: StormWindow = { start: 0, count: 0 };\n\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Installs the document and back-forward cache listeners. */\n install(): void {\n if (this.installed) {\n return;\n }\n this.installed = true;\n this.ctx.once.lifecycle ??= { state: \"\", enteredAt: performance.now() };\n this.phase = this.ctx.once.lifecycle;\n document.addEventListener(\"visibilitychange\", this.onVisibility);\n document.addEventListener(\"freeze\", this.onFreeze);\n document.addEventListener(\"resume\", this.onResume);\n addEventListener(\"pageshow\", this.onPageShow);\n this.onVisibility();\n }\n\n /** Removes all listeners. */\n uninstall(): void {\n this.installed = false;\n document.removeEventListener(\"visibilitychange\", this.onVisibility);\n document.removeEventListener(\"freeze\", this.onFreeze);\n document.removeEventListener(\"resume\", this.onResume);\n removeEventListener(\"pageshow\", this.onPageShow);\n }\n\n private readonly onVisibility = (): void => {\n this.transition(document.visibilityState === \"hidden\" ? \"hidden\" : \"visible\");\n };\n\n private readonly onFreeze = (): void => {\n this.transition(\"frozen\");\n };\n\n private readonly onResume = (): void => {\n this.transition(\"resumed\");\n };\n\n private readonly onPageShow = (event: PageTransitionEvent): void => {\n if (event.persisted) {\n this.transition(\"restored\");\n }\n };\n\n /** Updates the state even when the rate limit drops its event. */\n private transition(state: string): void {\n if (!this.installed || state === this.phase.state) {\n return;\n }\n\n const now = performance.now();\n const previous = this.phase.state;\n const duration = Math.max(0, now - this.phase.enteredAt);\n this.phase.state = state;\n this.phase.enteredAt = now;\n\n const { capturePolicy } = this.ctx.config;\n if (\n this.ctx.isActive?.() === false ||\n !allowInWindow(\n this.window,\n capturePolicy.lifecyclePerWindow,\n this.ctx.diagnostics,\n \"lifecycle events\",\n capturePolicy.windowMs,\n )\n ) {\n return;\n }\n\n this.ctx.diagnostics.guard(\n \"capture.record_failed\",\n \"The library could not record a lifecycle event.\",\n () => {\n this.ctx.logger.logEvent(\"ui.lifecycle\", {\n \"lifecycle.state\": state,\n \"lifecycle.previous_state\": previous,\n \"lifecycle.duration_ms\": duration,\n });\n },\n );\n }\n}\n"],"mappings":"A,wCAIA,IAAaE,EAAb,KAAiD,CASlB,IAR7B,KAAgB,YAEhB,UAAoB,GAEpB,MAAuD,CAAE,MAAO,GAAI,UAAW,CAAE,EAEjF,OAAuC,CAAE,MAAO,EAAG,MAAO,CAAE,EAE5D,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CACV,KAAK,YAGT,KAAK,UAAY,GACjB,KAAK,IAAI,KAAK,YAAc,CAAE,MAAO,GAAI,UAAW,YAAY,IAAI,CAAE,EACtE,KAAK,MAAQ,KAAK,IAAI,KAAK,UAC3B,SAAS,iBAAiB,mBAAoB,KAAK,YAAY,EAC/D,SAAS,iBAAiB,SAAU,KAAK,QAAQ,EACjD,SAAS,iBAAiB,SAAU,KAAK,QAAQ,EACjD,iBAAiB,WAAY,KAAK,UAAU,EAC5C,KAAK,aAAa,EACpB,CAGA,WAAkB,CAChB,KAAK,UAAY,GACjB,SAAS,oBAAoB,mBAAoB,KAAK,YAAY,EAClE,SAAS,oBAAoB,SAAU,KAAK,QAAQ,EACpD,SAAS,oBAAoB,SAAU,KAAK,QAAQ,EACpD,oBAAoB,WAAY,KAAK,UAAU,CACjD,CAEA,iBAA4C,CAC1C,KAAK,WAAW,SAAS,kBAAoB,SAAW,SAAW,SAAS,CAC9E,EAEA,aAAwC,CACtC,KAAK,WAAW,QAAQ,CAC1B,EAEA,aAAwC,CACtC,KAAK,WAAW,SAAS,CAC3B,EAEA,WAA+B,GAAqC,CAC9DC,EAAM,WACR,KAAK,WAAW,UAAU,CAE9B,EAGA,WAAmB,EAAqB,CACtC,GAAI,CAAC,KAAK,WAAaC,IAAU,KAAK,MAAM,MAC1C,OAGF,IAAMC,EAAM,YAAY,IAAI,EACtBC,EAAW,KAAK,MAAM,MACtBC,EAAW,KAAK,IAAI,EAAGF,EAAM,KAAK,MAAM,SAAS,EACvD,KAAK,MAAM,MAAQD,EACnB,KAAK,MAAM,UAAYC,EAEvB,GAAM,CAAE,iBAAkB,KAAK,IAAI,OAEjC,KAAK,IAAI,WAAW,IAAM,IACzBN,EAAAA,EACC,KAAK,OACLS,EAAc,mBACd,KAAK,IAAI,YACT,mBACAA,EAAc,QAChB,GAKF,KAAK,IAAI,YAAY,MACnB,wBACA,sDACM,CACJ,KAAK,IAAI,OAAO,SAAS,eAAgB,CACvC,kBAAmBJ,EACnB,2BAA4BE,EAC5B,wBAAyBC,CAC3B,CAAC,CACH,CACF,CACF,CACF,E"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "./storm-VR024_QN.js";
1
+ import { t as e } from "./storm-BTSNTIWI.js";
2
2
  // src/capture/lifecycle.ts
3
3
  var t = class {
4
4
  ctx;
@@ -52,4 +52,4 @@ var t = class {
52
52
  };
53
53
  export { t as LifecycleCapture };
54
54
 
55
- //# sourceMappingURL=lifecycle-BaKx_-32.js.map
55
+ //# sourceMappingURL=lifecycle-CZ6RRXc6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-CZ6RRXc6.js","names":["allowInWindow","LifecycleCapture","ctx","event","state","now","previous","duration","capturePolicy"],"sources":["../src/capture/lifecycle.ts"],"sourcesContent":["import { allowInWindow, type StormWindow } from \"./storm\";\nimport type { Capture, CaptureContext, CaptureOnce } from \"./types\";\n\n/** Records page state changes, each with how long the previous state lasted. */\nexport class LifecycleCapture implements Capture {\n readonly name = \"lifecycle\";\n\n private installed = false;\n\n private phase: NonNullable<CaptureOnce[\"lifecycle\"]> = { state: \"\", enteredAt: 0 };\n\n private readonly window: StormWindow = { start: 0, count: 0 };\n\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Installs the document and back-forward cache listeners. */\n install(): void {\n if (this.installed) {\n return;\n }\n this.installed = true;\n this.ctx.once.lifecycle ??= { state: \"\", enteredAt: performance.now() };\n this.phase = this.ctx.once.lifecycle;\n document.addEventListener(\"visibilitychange\", this.onVisibility);\n document.addEventListener(\"freeze\", this.onFreeze);\n document.addEventListener(\"resume\", this.onResume);\n addEventListener(\"pageshow\", this.onPageShow);\n this.onVisibility();\n }\n\n /** Removes all listeners. */\n uninstall(): void {\n this.installed = false;\n document.removeEventListener(\"visibilitychange\", this.onVisibility);\n document.removeEventListener(\"freeze\", this.onFreeze);\n document.removeEventListener(\"resume\", this.onResume);\n removeEventListener(\"pageshow\", this.onPageShow);\n }\n\n private readonly onVisibility = (): void => {\n this.transition(document.visibilityState === \"hidden\" ? \"hidden\" : \"visible\");\n };\n\n private readonly onFreeze = (): void => {\n this.transition(\"frozen\");\n };\n\n private readonly onResume = (): void => {\n this.transition(\"resumed\");\n };\n\n private readonly onPageShow = (event: PageTransitionEvent): void => {\n if (event.persisted) {\n this.transition(\"restored\");\n }\n };\n\n /** Updates the state even when the rate limit drops its event. */\n private transition(state: string): void {\n if (!this.installed || state === this.phase.state) {\n return;\n }\n\n const now = performance.now();\n const previous = this.phase.state;\n const duration = Math.max(0, now - this.phase.enteredAt);\n this.phase.state = state;\n this.phase.enteredAt = now;\n\n const { capturePolicy } = this.ctx.config;\n if (\n this.ctx.isActive?.() === false ||\n !allowInWindow(\n this.window,\n capturePolicy.lifecyclePerWindow,\n this.ctx.diagnostics,\n \"lifecycle events\",\n capturePolicy.windowMs,\n )\n ) {\n return;\n }\n\n this.ctx.diagnostics.guard(\n \"capture.record_failed\",\n \"The library could not record a lifecycle event.\",\n () => {\n this.ctx.logger.logEvent(\"ui.lifecycle\", {\n \"lifecycle.state\": state,\n \"lifecycle.previous_state\": previous,\n \"lifecycle.duration_ms\": duration,\n });\n },\n );\n }\n}\n"],"mappings":";;AAIA,IAAaC,IAAb,MAAiD;CASlB;CAR7B,OAAgB;CAEhB,YAAoB;CAEpB,QAAuD;EAAE,OAAO;EAAI,WAAW;CAAE;CAEjF,SAAuC;EAAE,OAAO;EAAG,OAAO;CAAE;CAE5D,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EACd,AAAI,KAAK,cAGT,KAAK,YAAY,IACjB,KAAK,IAAI,KAAK,cAAc;GAAE,OAAO;GAAI,WAAW,YAAY,IAAI;EAAE,GACtE,KAAK,QAAQ,KAAK,IAAI,KAAK,WAC3B,SAAS,iBAAiB,oBAAoB,KAAK,YAAY,GAC/D,SAAS,iBAAiB,UAAU,KAAK,QAAQ,GACjD,SAAS,iBAAiB,UAAU,KAAK,QAAQ,GACjD,iBAAiB,YAAY,KAAK,UAAU,GAC5C,KAAK,aAAa;CACpB;CAGA,YAAkB;EAKhB,AAJA,KAAK,YAAY,IACjB,SAAS,oBAAoB,oBAAoB,KAAK,YAAY,GAClE,SAAS,oBAAoB,UAAU,KAAK,QAAQ,GACpD,SAAS,oBAAoB,UAAU,KAAK,QAAQ,GACpD,oBAAoB,YAAY,KAAK,UAAU;CACjD;CAEA,qBAA4C;EAC1C,KAAK,WAAW,SAAS,oBAAoB,WAAW,WAAW,SAAS;CAC9E;CAEA,iBAAwC;EACtC,KAAK,WAAW,QAAQ;CAC1B;CAEA,iBAAwC;EACtC,KAAK,WAAW,SAAS;CAC3B;CAEA,cAA+B,MAAqC;EAClE,AAAIC,EAAM,aACR,KAAK,WAAW,UAAU;CAE9B;CAGA,WAAmB,GAAqB;EACtC,IAAI,CAAC,KAAK,aAAaC,MAAU,KAAK,MAAM,OAC1C;EAGF,IAAMC,IAAM,YAAY,IAAI,GACtBC,IAAW,KAAK,MAAM,OACtBC,IAAW,KAAK,IAAI,GAAGF,IAAM,KAAK,MAAM,SAAS;EAEvD,AADA,KAAK,MAAM,QAAQD,GACnB,KAAK,MAAM,YAAYC;EAEvB,IAAM,EAAE,qBAAkB,KAAK,IAAI;EACnC,AACE,KAAK,IAAI,WAAW,MAAM,MACzBL,EACC,KAAK,QACLQ,EAAc,oBACd,KAAK,IAAI,aACT,oBACAA,EAAc,QAChB,KAKF,KAAK,IAAI,YAAY,MACnB,yBACA,yDACM;GACJ,KAAK,IAAI,OAAO,SAAS,gBAAgB;IACvC,mBAAmBJ;IACnB,4BAA4BE;IAC5B,yBAAyBC;GAC3B,CAAC;EACH,CACF;CACF;AACF"}
@@ -1,2 +1,2 @@
1
- const e=require("./constants-DqKJH_MP.cjs");function t(){return`${String(Date.now())}000000`}function n(t){return typeof t==`string`&&Object.hasOwn(e.wt,t)}function r(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.body==`string`&&typeof t.severityText==`string`&&typeof t.timeUnixNano==`string`&&typeof t.attributes==`object`&&t.attributes!==null&&typeof t.resource==`object`&&t.resource!==null}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
2
- //# sourceMappingURL=log-record-i9zOTkpQ.cjs.map
1
+ const e=require("./constants-DakMxVB2.cjs");function t(){return`${String(Date.now())}000000`}function n(t){return typeof t==`string`&&Object.hasOwn(e.Tt,t)}function r(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.body==`string`&&typeof t.severityText==`string`&&typeof t.timeUnixNano==`string`&&typeof t.attributes==`object`&&t.attributes!==null&&typeof t.resource==`object`&&t.resource!==null}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
2
+ //# sourceMappingURL=log-record-D7bA1RPb.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-record-D7bA1RPb.cjs","names":["LEVEL_ORDER","require_constants","nowUnixNano","isLogLevel","value","isLogRecord","record"],"sources":["../src/models/log-record.ts"],"sourcesContent":["// src/models/log-record.ts\n//\n// Shape of one log record, plus helpers for building and validating it.\n//\n// The severity tables live in `src/constants.ts`.\n\nimport { LEVEL_ORDER } from \"../constants\";\n\n/** OpenTelemetry severity levels, in ascending order. */\nexport type LogLevel = \"TRACE\" | \"DEBUG\" | \"INFO\" | \"WARN\" | \"ERROR\" | \"FATAL\";\n\n/**\n * What a record is about. `action` is something a person did, `event` is something the\n * application did, and `metric` is a measurement. `log` is an application log call,\n * `system` is this library's own output and `span` is one span of a trace.\n */\nexport type LogType = \"action\" | \"event\" | \"metric\" | \"log\" | \"system\" | \"span\";\n\n/** Metric value type: level, running total, or distribution. */\nexport type MetricType = \"gauge\" | \"counter\" | \"histogram\";\n\n/** Internal record shape. A serializer converts it to the payload format. */\nexport interface LogRecord {\n /**\n * Event time, nanoseconds since epoch, as a decimal string.\n * @see {@link nowUnixNano}\n */\n timeUnixNano: string;\n /**\n * When this library received the event, if that differs from `timeUnixNano`. A forwarded\n * record, for example, can have a different time.\n */\n observedTimeUnixNano?: string;\n /** Distributed trace id. */\n traceId: string;\n /** Span id within the trace. */\n spanId: string;\n /** OpenTelemetry trace flags. The library uses only the sampled bit. */\n traceFlags: number;\n /** OpenTelemetry severity number for `severityText`. */\n severityNumber: number;\n /** Log level. */\n severityText: LogLevel;\n /** Log message. */\n body: string;\n /** Structured attributes, sanitized and size-capped. */\n attributes: Record<string, unknown>;\n /** Resource attributes, shared by every record from one context. */\n resource: Record<string, unknown>;\n}\n\n/**\n * Returns the current time as a Unix nanosecond timestamp. Appends zeros instead of\n * multiplying, because `Date.now() * 1e6` exceeds `Number.MAX_SAFE_INTEGER` and corrupts\n * digits without an error. The trailing zeros mean unknown precision, not measured digits.\n * @returns Epoch timestamp in nanoseconds, as a decimal string.\n */\nexport function nowUnixNano(): string {\n return `${String(Date.now())}000000`;\n}\n\n/**\n * Checks whether a value is a known log level. The own-key check rejects \"toString\".\n * @param value The value to check.\n * @returns True if `value` is a key of the severity table.\n */\nexport function isLogLevel(value: unknown): value is LogLevel {\n return typeof value === \"string\" && Object.hasOwn(LEVEL_ORDER, value);\n}\n\n/**\n * Checks whether a value has the shape `LogRecord` requires. Use it to validate records from\n * another realm, because a malformed record throws during serialization. Any string is\n * accepted as `severityText`, not only a known level, so an unknown level from a newer\n * version still passes.\n * @param value The value to check.\n * @returns True if `value` has the shape `LogRecord` requires.\n */\nexport function isLogRecord(value: unknown): value is LogRecord {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n // Cast to `Record<string, unknown>`, not `Partial<LogRecord>`. With the partial type the\n // compiler treats these fields as never null, so the checks below would look unnecessary.\n const record = value as Record<string, unknown>;\n return (\n typeof record.body === \"string\" &&\n typeof record.severityText === \"string\" &&\n typeof record.timeUnixNano === \"string\" &&\n typeof record.attributes === \"object\" &&\n record.attributes !== null &&\n typeof record.resource === \"object\" &&\n record.resource !== null\n );\n}\n"],"mappings":"A,4CAyDA,SAAgBE,GAAsB,CACpC,MAAO,GAAG,OAAO,KAAK,IAAI,CAAC,EAAE,OAC/B,CAOA,SAAgBC,EAAW,EAAmC,CAC5D,OAAO,OAAOC,GAAU,UAAY,OAAO,OAAOJ,EAAAA,GAAaI,CAAK,CACtE,CAUA,SAAgBC,EAAY,EAAoC,CAC9D,GAAI,OAAOD,GAAU,WAAYA,EAC/B,MAAO,GAIT,IAAME,EAASF,EACf,OACE,OAAOE,EAAO,MAAS,UACvB,OAAOA,EAAO,cAAiB,UAC/B,OAAOA,EAAO,cAAiB,UAC/B,OAAOA,EAAO,YAAe,UAC7BA,EAAO,aAAe,MACtB,OAAOA,EAAO,UAAa,UAC3BA,EAAO,WAAa,IAExB,C"}
@@ -1,4 +1,4 @@
1
- import { wt as e } from "./constants-zyrqveN4.js";
1
+ import { Tt as e } from "./constants-Bwl_YtQi.js";
2
2
  // src/models/log-record.ts
3
3
  function t() {
4
4
  return `${String(Date.now())}000000`;
@@ -13,4 +13,4 @@ function r(e) {
13
13
  }
14
14
  export { r as n, t as r, n as t };
15
15
 
16
- //# sourceMappingURL=log-record-CAoGBBf3.js.map
16
+ //# sourceMappingURL=log-record-DIA6McNr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-record-DIA6McNr.js","names":["LEVEL_ORDER","nowUnixNano","isLogLevel","value","isLogRecord","record"],"sources":["../src/models/log-record.ts"],"sourcesContent":["// src/models/log-record.ts\n//\n// Shape of one log record, plus helpers for building and validating it.\n//\n// The severity tables live in `src/constants.ts`.\n\nimport { LEVEL_ORDER } from \"../constants\";\n\n/** OpenTelemetry severity levels, in ascending order. */\nexport type LogLevel = \"TRACE\" | \"DEBUG\" | \"INFO\" | \"WARN\" | \"ERROR\" | \"FATAL\";\n\n/**\n * What a record is about. `action` is something a person did, `event` is something the\n * application did, and `metric` is a measurement. `log` is an application log call,\n * `system` is this library's own output and `span` is one span of a trace.\n */\nexport type LogType = \"action\" | \"event\" | \"metric\" | \"log\" | \"system\" | \"span\";\n\n/** Metric value type: level, running total, or distribution. */\nexport type MetricType = \"gauge\" | \"counter\" | \"histogram\";\n\n/** Internal record shape. A serializer converts it to the payload format. */\nexport interface LogRecord {\n /**\n * Event time, nanoseconds since epoch, as a decimal string.\n * @see {@link nowUnixNano}\n */\n timeUnixNano: string;\n /**\n * When this library received the event, if that differs from `timeUnixNano`. A forwarded\n * record, for example, can have a different time.\n */\n observedTimeUnixNano?: string;\n /** Distributed trace id. */\n traceId: string;\n /** Span id within the trace. */\n spanId: string;\n /** OpenTelemetry trace flags. The library uses only the sampled bit. */\n traceFlags: number;\n /** OpenTelemetry severity number for `severityText`. */\n severityNumber: number;\n /** Log level. */\n severityText: LogLevel;\n /** Log message. */\n body: string;\n /** Structured attributes, sanitized and size-capped. */\n attributes: Record<string, unknown>;\n /** Resource attributes, shared by every record from one context. */\n resource: Record<string, unknown>;\n}\n\n/**\n * Returns the current time as a Unix nanosecond timestamp. Appends zeros instead of\n * multiplying, because `Date.now() * 1e6` exceeds `Number.MAX_SAFE_INTEGER` and corrupts\n * digits without an error. The trailing zeros mean unknown precision, not measured digits.\n * @returns Epoch timestamp in nanoseconds, as a decimal string.\n */\nexport function nowUnixNano(): string {\n return `${String(Date.now())}000000`;\n}\n\n/**\n * Checks whether a value is a known log level. The own-key check rejects \"toString\".\n * @param value The value to check.\n * @returns True if `value` is a key of the severity table.\n */\nexport function isLogLevel(value: unknown): value is LogLevel {\n return typeof value === \"string\" && Object.hasOwn(LEVEL_ORDER, value);\n}\n\n/**\n * Checks whether a value has the shape `LogRecord` requires. Use it to validate records from\n * another realm, because a malformed record throws during serialization. Any string is\n * accepted as `severityText`, not only a known level, so an unknown level from a newer\n * version still passes.\n * @param value The value to check.\n * @returns True if `value` has the shape `LogRecord` requires.\n */\nexport function isLogRecord(value: unknown): value is LogRecord {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n // Cast to `Record<string, unknown>`, not `Partial<LogRecord>`. With the partial type the\n // compiler treats these fields as never null, so the checks below would look unnecessary.\n const record = value as Record<string, unknown>;\n return (\n typeof record.body === \"string\" &&\n typeof record.severityText === \"string\" &&\n typeof record.timeUnixNano === \"string\" &&\n typeof record.attributes === \"object\" &&\n record.attributes !== null &&\n typeof record.resource === \"object\" &&\n record.resource !== null\n );\n}\n"],"mappings":";;AAyDA,SAAgBC,IAAsB;CACpC,OAAO,GAAG,OAAO,KAAK,IAAI,CAAC,EAAE;AAC/B;AAOA,SAAgBC,EAAW,GAAmC;CAC5D,OAAO,OAAOC,KAAU,YAAY,OAAO,OAAOH,GAAaG,CAAK;AACtE;AAUA,SAAgBC,EAAY,GAAoC;CAC9D,IAAI,OAAOD,KAAU,aAAYA,GAC/B,OAAO;CAIT,IAAME,IAASF;CACf,OACE,OAAOE,EAAO,QAAS,YACvB,OAAOA,EAAO,gBAAiB,YAC/B,OAAOA,EAAO,gBAAiB,YAC/B,OAAOA,EAAO,cAAe,YAC7BA,EAAO,eAAe,QACtB,OAAOA,EAAO,YAAa,YAC3BA,EAAO,aAAa;AAExB"}
@@ -1,5 +1,5 @@
1
- import { i as e } from "./platform-DkcuXwe-.js";
2
- import { t } from "./storm-VR024_QN.js";
1
+ import { i as e } from "./platform-CVewe4wQ.js";
2
+ import { t } from "./storm-BTSNTIWI.js";
3
3
  // src/capture/long-frames.ts
4
4
  var n = ["long-animation-frame", "longtask"];
5
5
  function r(e) {
@@ -28,7 +28,9 @@ var i = class {
28
28
  if (!t) return;
29
29
  this.ctx.diagnostics.report("capture.install_failed", "The browser does not report long frames. The long frame capture is off.");
30
30
  } else this.threshold = this.readThreshold(), this.observer = new PerformanceObserver((e) => {
31
- for (let t of e.getEntries()) this.record(t);
31
+ this.ctx.diagnostics.guard("capture.record_failed", "The library could not record a long frame.", () => {
32
+ for (let t of e.getEntries()) this.record(t);
33
+ });
32
34
  }), this.observer.observe({
33
35
  type: i,
34
36
  buffered: t
@@ -38,8 +40,8 @@ var i = class {
38
40
  this.observer?.disconnect(), this.observer = void 0;
39
41
  }
40
42
  readThreshold() {
41
- let e = this.ctx.config.capture.longFrameThresholdMs;
42
- return typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : (this.ctx.diagnostics.report("config.invalid", "capture.longFrameThresholdMs must be a number of 0 or more. The library uses 100."), 100);
43
+ let e = this.ctx.config.capture.longFrameMs;
44
+ return typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : (this.ctx.diagnostics.report("config.invalid", "capture.longFrameMs must be a number of 0 or more. The library uses 100."), 100);
43
45
  }
44
46
  record(n) {
45
47
  if (n.duration < this.threshold) return;
@@ -61,4 +63,4 @@ var i = class {
61
63
  };
62
64
  export { i as LongFrameCapture };
63
65
 
64
- //# sourceMappingURL=long-frames-Czk7IupC.js.map
66
+ //# sourceMappingURL=long-frames-430_85Da.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-frames-430_85Da.js","names":["recordedUrl","FRAME_TYPES","longestScript","longest","script","scripts","LongFrameCapture","ctx","first","once","supported","type","name","entry","list","value","allowInWindow","diagnostics","duration","attrs","url","invoker"],"sources":["../src/capture/long-frames.ts"],"sourcesContent":["// src/capture/long-frames.ts\n//\n// Reports long animation frames. A long frame can freeze the page with no user input involved,\n// for example a grid that re-renders 5,000 rows, and INP never shows that.\n\nimport { LONG_FRAME_THRESHOLD_MS } from \"../constants\";\nimport { recordedUrl } from \"../utils/platform\";\nimport { allowInWindow, type StormWindow } from \"./storm\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** The entry types this capture can observe, best first. */\nconst FRAME_TYPES = [\"long-animation-frame\", \"longtask\"];\n\n/** One script in a long animation frame. Some versions of the DOM types don't declare it. */\ninterface FrameScript {\n /** How long the script ran, in milliseconds. */\n duration: number;\n /** What called the script, for example an event listener or a timer. */\n invoker?: string;\n /** URL of the script's source. */\n sourceURL?: string;\n}\n\n/** A long animation frame or a long task. A long task has no blocking time and no scripts. */\ninterface FrameEntry extends PerformanceEntry {\n /** How long the frame blocked input, in milliseconds. */\n blockingDuration?: number;\n /** Scripts that ran in the frame. */\n scripts?: FrameScript[];\n}\n\n/**\n * Finds the script that ran longest in a frame.\n * @param scripts The frame's scripts.\n * @returns The longest script, or undefined if the frame has none.\n */\nfunction longestScript(scripts: FrameScript[] | undefined): FrameScript | undefined {\n let longest: FrameScript | undefined;\n\n for (const script of scripts ?? []) {\n if (!longest || script.duration > longest.duration) {\n longest = script;\n }\n }\n\n return longest;\n}\n\n/** Records every long animation frame as a histogram metric and a breadcrumb. */\nexport class LongFrameCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"long-frames\";\n\n /** Active observer. Undefined while the capture isn't installed. */\n private observer: PerformanceObserver | undefined;\n\n /** This capture's own rate limit, so a frozen tab can't flood the pipeline. */\n private readonly window: StormWindow = { start: 0, count: 0 };\n\n /** Minimum frame duration to record, in milliseconds. */\n private threshold = LONG_FRAME_THRESHOLD_MS;\n\n /**\n * @param ctx Capture context: configuration, diagnostics, logger and breadcrumbs.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Observes the best entry type the browser supports. */\n install(): void {\n if (this.observer) {\n return;\n }\n\n // Only the first install in a document reads buffered frames or reports missing support,\n // so a reinstall after configure() doesn't repeat either.\n const { once } = this.ctx;\n const first = !once.longFrames;\n once.longFrames = 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 const type = FRAME_TYPES.find((name) => supported?.includes(name));\n\n if (type === undefined) {\n if (!first) {\n return;\n }\n\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The browser does not report long frames. The long frame capture is off.\",\n );\n return;\n }\n\n this.threshold = this.readThreshold();\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 long frame.\",\n () => {\n for (const entry of list.getEntries()) {\n this.record(entry);\n }\n },\n );\n });\n\n // Buffered frames include the first render, which happens before this chunk loads.\n this.observer.observe({ type, buffered: first });\n }\n\n /** Disconnects the observer. */\n uninstall(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n /**\n * Reads the threshold from the configuration and reports a value it can't use.\n * @returns Minimum frame duration to record, in milliseconds.\n */\n private readThreshold(): number {\n const value: unknown = this.ctx.config.capture.longFrameMs;\n\n if (typeof value === \"number\" && Number.isFinite(value) && value >= 0) {\n return value;\n }\n\n this.ctx.diagnostics.report(\n \"config.invalid\",\n `capture.longFrameMs must be a number of 0 or more. The library uses ${String(LONG_FRAME_THRESHOLD_MS)}.`,\n );\n return LONG_FRAME_THRESHOLD_MS;\n }\n\n /**\n * Records one frame at or above the threshold.\n * @param entry Long animation frame or long task entry.\n */\n private record(entry: FrameEntry): void {\n if (entry.duration < this.threshold) {\n return;\n }\n\n const { diagnostics } = this.ctx;\n\n if (\n !allowInWindow(\n this.window,\n this.ctx.config.capturePolicy.longFramesPerWindow,\n diagnostics,\n \"long frames\",\n this.ctx.config.capturePolicy.windowMs,\n )\n ) {\n return;\n }\n\n const duration = Math.round(entry.duration);\n const attrs: Record<string, unknown> = { \"frame.type\": entry.entryType };\n\n if (entry.blockingDuration !== undefined) {\n attrs[\"frame.blocking_ms\"] = Math.round(entry.blockingDuration);\n }\n\n const script = longestScript(entry.scripts);\n\n // A signed URL is a credential. Only keep the query when fullUrls is on.\n const url = (value: string): string =>\n recordedUrl(\n value,\n this.ctx.config.capture.fullUrls,\n this.ctx.config.capture.urlTransform,\n diagnostics,\n );\n\n if (script?.invoker) {\n // A script entry's invoker is the script URL. Other invokers, for example\n // \"IMG#hero.onload\", contain a \"#\" that isn't a fragment.\n const { invoker } = script;\n attrs[\"frame.script.invoker\"] = invoker.includes(\"://\") ? url(invoker) : invoker;\n }\n\n if (script?.sourceURL) {\n attrs[\"frame.script.source\"] = url(script.sourceURL);\n }\n\n this.ctx.breadcrumbs.push({\n t: Date.now(),\n category: \"frame\",\n message: `long frame ${String(duration)} ms`,\n });\n this.ctx.logger.logMetric(\"ui.long_frame.duration\", duration, \"ms\", \"histogram\", attrs);\n }\n}\n"],"mappings":";;;AAWA,IAAMC,IAAc,CAAC,wBAAwB,UAAU;AAyBvD,SAASC,EAAc,GAA6D;CAClF,IAAIC;CAEJ,KAAK,IAAMC,KAAUC,KAAW,CAAC,GAC/B,CAAI,CAACF,KAAWC,EAAO,WAAWD,EAAQ,cACxC,IAAUC;CAId,OAAOD;AACT;AAGA,IAAaG,IAAb,MAAiD;CAgBlB;CAd7B,OAAgB;CAGhB;CAGA,SAAuC;EAAE,OAAO;EAAG,OAAO;CAAE;CAG5D,YAAA;CAKA,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EACd,IAAI,KAAK,UACP;EAKF,IAAM,EAAE,YAAS,KAAK,KAChBC,IAAQ,CAACC,EAAK;EACpB,EAAK,aAAa;EAGlB,IAAMC,IACJ,OAAO,sBAAwB,MAC3B,KAAA,IACA,oBAAoB,qBACpBC,IAAOV,EAAY,MAAM,MAASS,GAAW,SAASE,CAAI,CAAC;EAEjE,IAAID,MAAS,KAAA,GAAW;GACtB,IAAI,CAACH,GACH;GAGF,KAAK,IAAI,YAAY,OACnB,0BACA,yEACF;EAEF,OAiBA,AAfA,KAAK,YAAY,KAAK,cAAc,GACpC,KAAK,WAAW,IAAI,qBAAqB,MAAS;GAEhD,KAAK,IAAI,YAAY,MACnB,yBACA,oDACM;IACJ,KAAK,IAAMK,KAASC,EAAK,WAAW,GAClC,KAAK,OAAOD,CAAK;GAErB,CACF;EACF,CAAC,GAGD,KAAK,SAAS,QAAQ;GAAE;GAAM,UAAUL;EAAM,CAAC;CACjD;CAGA,YAAkB;EAEhB,AADA,KAAK,UAAU,WAAW,GAC1B,KAAK,WAAW,KAAA;CAClB;CAMA,gBAAgC;EAC9B,IAAMO,IAAiB,KAAK,IAAI,OAAO,QAAQ;EAU/C,OARI,OAAOA,KAAU,YAAY,OAAO,SAASA,CAAK,KAAKA,KAAS,IAC3DA,KAGT,KAAK,IAAI,YAAY,OACnB,kBACA,0EACF,GACA;CACF;CAMA,OAAe,GAAyB;EACtC,IAAIF,EAAM,WAAW,KAAK,WACxB;EAGF,IAAM,EAAE,mBAAgB,KAAK;EAE7B,IACE,CAACG,EACC,KAAK,QACL,KAAK,IAAI,OAAO,cAAc,qBAC9BC,GACA,eACA,KAAK,IAAI,OAAO,cAAc,QAChC,GAEA;EAGF,IAAMC,IAAW,KAAK,MAAML,EAAM,QAAQ,GACpCM,IAAiC,EAAE,cAAcN,EAAM,UAAU;EAEvE,AAAIA,EAAM,qBAAqB,KAAA,MAC7B,EAAM,uBAAuB,KAAK,MAAMA,EAAM,gBAAgB;EAGhE,IAAMT,IAASF,EAAcW,EAAM,OAAO,GAGpCO,KAAO,MACXpB,EACEe,GACA,KAAK,IAAI,OAAO,QAAQ,UACxB,KAAK,IAAI,OAAO,QAAQ,cACxBE,CACF;EAEF,IAAIb,GAAQ,SAAS;GAGnB,IAAM,EAAE,eAAYA;GACpB,EAAM,0BAA0BiB,EAAQ,SAAS,KAAK,IAAID,EAAIC,CAAO,IAAIA;EAC3E;EAWA,AATIjB,GAAQ,cACV,EAAM,yBAAyBgB,EAAIhB,EAAO,SAAS,IAGrD,KAAK,IAAI,YAAY,KAAK;GACxB,GAAG,KAAK,IAAI;GACZ,UAAU;GACV,SAAS,cAAc,OAAOc,CAAQ,EAAE;EAC1C,CAAC,GACD,KAAK,IAAI,OAAO,UAAU,0BAA0BA,GAAU,MAAM,aAAaC,CAAK;CACxF;AACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("./platform-12uR7kBQ.cjs"),t=require("./storm-D0_qZOEg.cjs");var n=[`long-animation-frame`,`longtask`];function r(e){let t;for(let n of e??[])(!t||n.duration>t.duration)&&(t=n);return t}var i=class{ctx;name=`long-frames`;observer;window={start:0,count:0};threshold=100;constructor(e){this.ctx=e}install(){if(this.observer)return;let{once:e}=this.ctx,t=!e.longFrames;e.longFrames=!0;let r=typeof PerformanceObserver>`u`?void 0:PerformanceObserver.supportedEntryTypes,i=n.find(e=>r?.includes(e));if(i===void 0){if(!t)return;this.ctx.diagnostics.report(`capture.install_failed`,`The browser does not report long frames. The long frame capture is off.`)}else this.threshold=this.readThreshold(),this.observer=new PerformanceObserver(e=>{this.ctx.diagnostics.guard(`capture.record_failed`,`The library could not record a long frame.`,()=>{for(let t of e.getEntries())this.record(t)})}),this.observer.observe({type:i,buffered:t})}uninstall(){this.observer?.disconnect(),this.observer=void 0}readThreshold(){let e=this.ctx.config.capture.longFrameMs;return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:(this.ctx.diagnostics.report(`config.invalid`,`capture.longFrameMs must be a number of 0 or more. The library uses 100.`),100)}record(n){if(n.duration<this.threshold)return;let{diagnostics:i}=this.ctx;if(!t.t(this.window,this.ctx.config.capturePolicy.longFramesPerWindow,i,`long frames`,this.ctx.config.capturePolicy.windowMs))return;let a=Math.round(n.duration),o={"frame.type":n.entryType};n.blockingDuration!==void 0&&(o[`frame.blocking_ms`]=Math.round(n.blockingDuration));let s=r(n.scripts),c=t=>e.i(t,this.ctx.config.capture.fullUrls,this.ctx.config.capture.urlTransform,i);if(s?.invoker){let{invoker:e}=s;o[`frame.script.invoker`]=e.includes(`://`)?c(e):e}s?.sourceURL&&(o[`frame.script.source`]=c(s.sourceURL)),this.ctx.breadcrumbs.push({t:Date.now(),category:`frame`,message:`long frame ${String(a)} ms`}),this.ctx.logger.logMetric(`ui.long_frame.duration`,a,`ms`,`histogram`,o)}};exports.LongFrameCapture=i;
2
+ //# sourceMappingURL=long-frames-Dd8tsi2U.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-frames-Dd8tsi2U.cjs","names":["allowInWindow","recordedUrl","require_platform","require_storm","FRAME_TYPES","longestScript","longest","script","scripts","LongFrameCapture","ctx","first","once","supported","type","name","entry","list","value","diagnostics","duration","attrs","url","invoker"],"sources":["../src/capture/long-frames.ts"],"sourcesContent":["// src/capture/long-frames.ts\n//\n// Reports long animation frames. A long frame can freeze the page with no user input involved,\n// for example a grid that re-renders 5,000 rows, and INP never shows that.\n\nimport { LONG_FRAME_THRESHOLD_MS } from \"../constants\";\nimport { recordedUrl } from \"../utils/platform\";\nimport { allowInWindow, type StormWindow } from \"./storm\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** The entry types this capture can observe, best first. */\nconst FRAME_TYPES = [\"long-animation-frame\", \"longtask\"];\n\n/** One script in a long animation frame. Some versions of the DOM types don't declare it. */\ninterface FrameScript {\n /** How long the script ran, in milliseconds. */\n duration: number;\n /** What called the script, for example an event listener or a timer. */\n invoker?: string;\n /** URL of the script's source. */\n sourceURL?: string;\n}\n\n/** A long animation frame or a long task. A long task has no blocking time and no scripts. */\ninterface FrameEntry extends PerformanceEntry {\n /** How long the frame blocked input, in milliseconds. */\n blockingDuration?: number;\n /** Scripts that ran in the frame. */\n scripts?: FrameScript[];\n}\n\n/**\n * Finds the script that ran longest in a frame.\n * @param scripts The frame's scripts.\n * @returns The longest script, or undefined if the frame has none.\n */\nfunction longestScript(scripts: FrameScript[] | undefined): FrameScript | undefined {\n let longest: FrameScript | undefined;\n\n for (const script of scripts ?? []) {\n if (!longest || script.duration > longest.duration) {\n longest = script;\n }\n }\n\n return longest;\n}\n\n/** Records every long animation frame as a histogram metric and a breadcrumb. */\nexport class LongFrameCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"long-frames\";\n\n /** Active observer. Undefined while the capture isn't installed. */\n private observer: PerformanceObserver | undefined;\n\n /** This capture's own rate limit, so a frozen tab can't flood the pipeline. */\n private readonly window: StormWindow = { start: 0, count: 0 };\n\n /** Minimum frame duration to record, in milliseconds. */\n private threshold = LONG_FRAME_THRESHOLD_MS;\n\n /**\n * @param ctx Capture context: configuration, diagnostics, logger and breadcrumbs.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Observes the best entry type the browser supports. */\n install(): void {\n if (this.observer) {\n return;\n }\n\n // Only the first install in a document reads buffered frames or reports missing support,\n // so a reinstall after configure() doesn't repeat either.\n const { once } = this.ctx;\n const first = !once.longFrames;\n once.longFrames = 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 const type = FRAME_TYPES.find((name) => supported?.includes(name));\n\n if (type === undefined) {\n if (!first) {\n return;\n }\n\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The browser does not report long frames. The long frame capture is off.\",\n );\n return;\n }\n\n this.threshold = this.readThreshold();\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 long frame.\",\n () => {\n for (const entry of list.getEntries()) {\n this.record(entry);\n }\n },\n );\n });\n\n // Buffered frames include the first render, which happens before this chunk loads.\n this.observer.observe({ type, buffered: first });\n }\n\n /** Disconnects the observer. */\n uninstall(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n /**\n * Reads the threshold from the configuration and reports a value it can't use.\n * @returns Minimum frame duration to record, in milliseconds.\n */\n private readThreshold(): number {\n const value: unknown = this.ctx.config.capture.longFrameMs;\n\n if (typeof value === \"number\" && Number.isFinite(value) && value >= 0) {\n return value;\n }\n\n this.ctx.diagnostics.report(\n \"config.invalid\",\n `capture.longFrameMs must be a number of 0 or more. The library uses ${String(LONG_FRAME_THRESHOLD_MS)}.`,\n );\n return LONG_FRAME_THRESHOLD_MS;\n }\n\n /**\n * Records one frame at or above the threshold.\n * @param entry Long animation frame or long task entry.\n */\n private record(entry: FrameEntry): void {\n if (entry.duration < this.threshold) {\n return;\n }\n\n const { diagnostics } = this.ctx;\n\n if (\n !allowInWindow(\n this.window,\n this.ctx.config.capturePolicy.longFramesPerWindow,\n diagnostics,\n \"long frames\",\n this.ctx.config.capturePolicy.windowMs,\n )\n ) {\n return;\n }\n\n const duration = Math.round(entry.duration);\n const attrs: Record<string, unknown> = { \"frame.type\": entry.entryType };\n\n if (entry.blockingDuration !== undefined) {\n attrs[\"frame.blocking_ms\"] = Math.round(entry.blockingDuration);\n }\n\n const script = longestScript(entry.scripts);\n\n // A signed URL is a credential. Only keep the query when fullUrls is on.\n const url = (value: string): string =>\n recordedUrl(\n value,\n this.ctx.config.capture.fullUrls,\n this.ctx.config.capture.urlTransform,\n diagnostics,\n );\n\n if (script?.invoker) {\n // A script entry's invoker is the script URL. Other invokers, for example\n // \"IMG#hero.onload\", contain a \"#\" that isn't a fragment.\n const { invoker } = script;\n attrs[\"frame.script.invoker\"] = invoker.includes(\"://\") ? url(invoker) : invoker;\n }\n\n if (script?.sourceURL) {\n attrs[\"frame.script.source\"] = url(script.sourceURL);\n }\n\n this.ctx.breadcrumbs.push({\n t: Date.now(),\n category: \"frame\",\n message: `long frame ${String(duration)} ms`,\n });\n this.ctx.logger.logMetric(\"ui.long_frame.duration\", duration, \"ms\", \"histogram\", attrs);\n }\n}\n"],"mappings":"A,6EAWA,IAAMI,EAAc,CAAC,uBAAwB,UAAU,EAyBvD,SAASC,EAAc,EAA6D,CAClF,IAAIC,EAEJ,IAAK,IAAMC,KAAUC,GAAW,CAAC,GAC3B,CAACF,GAAWC,EAAO,SAAWD,EAAQ,YACxC,EAAUC,GAId,OAAOD,CACT,CAGA,IAAaG,EAAb,KAAiD,CAgBlB,IAd7B,KAAgB,cAGhB,SAGA,OAAuC,CAAE,MAAO,EAAG,MAAO,CAAE,EAG5D,UAAA,IAKA,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CACd,GAAI,KAAK,SACP,OAKF,GAAM,CAAE,QAAS,KAAK,IAChBC,EAAQ,CAACC,EAAK,WACpB,EAAK,WAAa,GAGlB,IAAMC,EACJ,OAAO,oBAAwB,IAC3B,IAAA,GACA,oBAAoB,oBACpBC,EAAOV,EAAY,KAAM,GAASS,GAAW,SAASE,CAAI,CAAC,EAEjE,GAAID,IAAS,IAAA,GAAW,CACtB,GAAI,CAACH,EACH,OAGF,KAAK,IAAI,YAAY,OACnB,yBACA,yEACF,CAEF,KAEA,MAAK,UAAY,KAAK,cAAc,EACpC,KAAK,SAAW,IAAI,oBAAqB,GAAS,CAEhD,KAAK,IAAI,YAAY,MACnB,wBACA,iDACM,CACJ,IAAK,IAAMK,KAASC,EAAK,WAAW,EAClC,KAAK,OAAOD,CAAK,CAErB,CACF,CACF,CAAC,EAGD,KAAK,SAAS,QAAQ,CAAE,OAAM,SAAUL,CAAM,CAAC,CACjD,CAGA,WAAkB,CAChB,KAAK,UAAU,WAAW,EAC1B,KAAK,SAAW,IAAA,EAClB,CAMA,eAAgC,CAC9B,IAAMO,EAAiB,KAAK,IAAI,OAAO,QAAQ,YAU/C,OARI,OAAOA,GAAU,UAAY,OAAO,SAASA,CAAK,GAAKA,GAAS,EAC3DA,GAGT,KAAK,IAAI,YAAY,OACnB,iBACA,0EACF,EACA,IACF,CAMA,OAAe,EAAyB,CACtC,GAAIF,EAAM,SAAW,KAAK,UACxB,OAGF,GAAM,CAAE,eAAgB,KAAK,IAE7B,GACE,CAAChB,EAAAA,EACC,KAAK,OACL,KAAK,IAAI,OAAO,cAAc,oBAC9BmB,EACA,cACA,KAAK,IAAI,OAAO,cAAc,QAChC,EAEA,OAGF,IAAMC,EAAW,KAAK,MAAMJ,EAAM,QAAQ,EACpCK,EAAiC,CAAE,aAAcL,EAAM,SAAU,EAEnEA,EAAM,mBAAqB,IAAA,KAC7B,EAAM,qBAAuB,KAAK,MAAMA,EAAM,gBAAgB,GAGhE,IAAMT,EAASF,EAAcW,EAAM,OAAO,EAGpCM,EAAO,GACXrB,EAAAA,EACEiB,EACA,KAAK,IAAI,OAAO,QAAQ,SACxB,KAAK,IAAI,OAAO,QAAQ,aACxBC,CACF,EAEF,GAAIZ,GAAQ,QAAS,CAGnB,GAAM,CAAE,WAAYA,EACpB,EAAM,wBAA0BgB,EAAQ,SAAS,KAAK,EAAID,EAAIC,CAAO,EAAIA,CAC3E,CAEIhB,GAAQ,YACV,EAAM,uBAAyBe,EAAIf,EAAO,SAAS,GAGrD,KAAK,IAAI,YAAY,KAAK,CACxB,EAAG,KAAK,IAAI,EACZ,SAAU,QACV,QAAS,cAAc,OAAOa,CAAQ,EAAE,IAC1C,CAAC,EACD,KAAK,IAAI,OAAO,UAAU,yBAA0BA,EAAU,KAAM,YAAaC,CAAK,CACxF,CACF,E"}
@@ -7,9 +7,9 @@ import type { LogRecord } from "./log-record";
7
7
  export interface LogBatch {
8
8
  /** Application namespace that owns this stored batch. */
9
9
  readonly persistenceNamespace?: string;
10
- /** Delivery context id. It does not change. With isolation, a batch without this id stays stored. */
10
+ /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */
11
11
  readonly routingContextId?: string;
12
- /** Deduplication key. It stays the same across retries and reloads. */
12
+ /** Deduplication key. Stays the same across retries and reloads. */
13
13
  id: string;
14
14
  /** Records to deliver, in log order. */
15
15
  records: LogRecord[];
@@ -19,39 +19,38 @@ export interface LogBatch {
19
19
  attempts: number;
20
20
  }
21
21
  /**
22
- * Tells if a value from storage has all fields of a batch. `keyOf` cannot match
23
- * an entry without `id` after delivery. The library then retries that entry with no
24
- * end, and the entry blocks each batch behind it. An entry without `attempts` counts
25
- * as NaN. That count never reaches `maxAttempts`. Thus the library never drops the
26
- * entry as a dead letter.
22
+ * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry
23
+ * without `id` after delivery, so that entry would be retried forever and block every batch
24
+ * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so
25
+ * it would never be dropped as a dead letter.
27
26
  * @param value Parsed storage entry.
28
- * @returns True when each required field is present and has the correct type.
27
+ * @returns True when every required field is present and has the correct type.
29
28
  */
30
29
  export declare function isLogBatch(value: unknown): value is LogBatch;
31
30
  /**
32
- * Splits a batch that the server rejected as too large into two halves.
33
- * Each half gets a new id. Each half keeps the age and attempts of the original batch.
31
+ * Splits a batch that the server rejected as too large into two halves. Each half gets a new
32
+ * id but keeps the original batch's age and attempts.
34
33
  * @param batch The rejected batch.
35
34
  * @param diagnostics Diagnostics reporter for the new batch ids.
36
35
  * @returns Two batches, or `null` if a single record is already over the limit.
37
36
  */
38
37
  export declare function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null;
39
38
  /**
40
- * Reads one attribute of a record. A record from storage can be corrupt. It can be null or have
41
- * no attributes.
39
+ * Reads one attribute of a record. A record from storage can be corrupt, either null or
40
+ * missing its attributes.
42
41
  * @param record Record to read.
43
42
  * @param key Attribute key.
44
43
  * @returns The attribute value, or undefined for a corrupt record.
45
44
  */
46
45
  export declare function attributeOf(record: LogRecord, key: string): unknown;
47
46
  /**
48
- * Tests if a record is an action. A corrupt record from storage is not an action.
49
- * @param record Record to test.
47
+ * Checks whether a record is an action. A corrupt record from storage is not an action.
48
+ * @param record Record to check.
50
49
  * @returns True for an action record.
51
50
  */
52
51
  export declare function isActionRecord(record: LogRecord): boolean;
53
52
  /**
54
- * Returns the total record count of the batches.
53
+ * Counts the records across all batches.
55
54
  * @param batches Batches to measure.
56
55
  * @returns Total record count.
57
56
  */
@@ -1,22 +1,22 @@
1
1
  import { BUS_PROTOCOL, type BUS_TYPE } from "../constants";
2
2
  import type { LogRecord } from "./log-record";
3
- /** Permissions of one child window or worker. The handshake needs no separate permission. */
3
+ /** What one child window or worker may do. The handshake needs no permission of its own. */
4
4
  export type BusPermission = "records" | "journey:read" | "journey:write" | "sampling:read";
5
5
  export interface SourceOptions {
6
- /** Permissions of this source. Without this list, the source can send records only. */
6
+ /** This source's permissions. Without the list, the source can only send records. */
7
7
  permissions?: BusPermission[];
8
8
  }
9
9
  /** Origin and permissions for one child frame registration. */
10
10
  export interface FrameOptions extends SourceOptions {
11
- /** Expected window origin, with its scheme and port. The origin must match exactly. */
11
+ /** Expected window origin, including its scheme and port. Must match exactly. */
12
12
  origin: string;
13
13
  }
14
- /** Delivery role. It tells if this context sends its records or forwards them upstream. */
14
+ /** Delivery role: whether this context sends its own records or forwards them upstream. */
15
15
  export type BusRole = "sender" | "forwarder";
16
16
  /**
17
- * Kind of transport channel. The bus uses it to route incoming and outgoing messages.
18
- * Without it, `receive` cannot tell the channels apart. Then a same-origin iframe
19
- * looks like a duplicated tab.
17
+ * Kind of transport channel, which the bus uses to route incoming and outgoing messages.
18
+ * Without it, `receive` can't tell the channels apart and a same-origin iframe looks like a
19
+ * duplicated tab.
20
20
  */
21
21
  export type LinkKind =
22
22
  /** Synchronous call into a same-origin parent runtime. */
@@ -35,13 +35,13 @@ export type LinkKind =
35
35
  | "worker";
36
36
  /** Origin and transport metadata for an incoming bus message. */
37
37
  export interface MessageSource {
38
- /** Source identity from the transport. The source does not supply it in message.from. */
38
+ /** Source identity as the transport reports it. The source can't supply it in message.from. */
39
39
  peer?: object | string;
40
40
  /** Inbound transport channel kind. */
41
41
  link: LinkKind;
42
42
  /** `event.origin` for `parent` and `children`. Other links use `"same-origin"` or `"openfin"`. */
43
43
  origin: string;
44
- /** Sends an answer to this source only. A link that cannot address one source omits it. */
44
+ /** Replies to this source only. A link that can't address a single source omits it. */
45
45
  reply?: (message: BusMessage) => void;
46
46
  }
47
47
  /** Discriminated union of control and telemetry payload messages. */
@@ -53,9 +53,9 @@ export type BusMessage =
53
53
  tabId: string;
54
54
  }
55
55
  /**
56
- * Handshake response from an upstream owner. The `to` field holds the address.
57
- * A welcome on InterApplicationBus goes to every subscriber. Without an address,
58
- * each waiting view accepts the welcome as its own.
56
+ * Handshake response from an upstream owner, addressed through the `to` field. A welcome on
57
+ * InterApplicationBus reaches every subscriber, so without an address every waiting view
58
+ * would accept the welcome as its own.
59
59
  */
60
60
  | {
61
61
  t: typeof BUS_TYPE.welcome;
@@ -71,15 +71,15 @@ export type BusMessage =
71
71
  records: LogRecord[];
72
72
  routingContextId?: string;
73
73
  }
74
- /** Delivery context update. Only the owner from the handshake can send it to its children. */
74
+ /** Delivery context update. Only the owner from the handshake may send it to its children. */
75
75
  | {
76
76
  t: typeof BUS_TYPE.securityContext;
77
77
  from: string;
78
78
  id: string;
79
79
  }
80
80
  /**
81
- * Journey update, or the answer to a journey question. An answer holds the address of the
82
- * context that asked in `to`. The payload comes from another realm. The receiver parses it.
81
+ * Journey update, or the answer to a journey question. An answer carries the asking
82
+ * context's address in `to`. The payload comes from another realm, so the receiver parses it.
83
83
  */
84
84
  | {
85
85
  t: typeof BUS_TYPE.journey;
@@ -98,15 +98,15 @@ export type BusMessage =
98
98
  from: string;
99
99
  tabId: string;
100
100
  }
101
- /** Request of a forwarder for the remote sampling rules in force. */
101
+ /** A forwarder's request for the current remote sampling rules. */
102
102
  | {
103
103
  t: typeof BUS_TYPE.samplingRequest;
104
104
  from: string;
105
105
  }
106
106
  /**
107
- * Remote sampling rules in the shape of the header, with the remaining TTL. The `to` field
108
- * holds the address of the forwarder that asked. The receiver validates `rules` again.
109
- * Null rules end the copy of the forwarder.
107
+ * Remote sampling rules in the header's shape, with the remaining TTL. `to` holds the address
108
+ * of the forwarder that asked. The receiver validates `rules` again. Null rules end the
109
+ * forwarder's copy.
110
110
  */
111
111
  | {
112
112
  t: typeof BUS_TYPE.sampling;
@@ -128,11 +128,11 @@ export interface BusEnvelope {
128
128
  */
129
129
  export declare function envelope(message: BusMessage): BusEnvelope;
130
130
  /**
131
- * Validates the protocol tag and unpacks a raw payload into a bus message. A
132
- * document gets `message` events from all embedded content on the page. This
133
- * includes analytics tags, video players and extensions. Without the tag check,
134
- * the bus parses a message from a video player as a log record.
131
+ * Validates the protocol tag and unpacks a raw payload into a bus message. A document gets
132
+ * `message` events from all embedded content on the page, including analytics tags, video
133
+ * players and extensions. Without the tag check, the bus would parse a video player's message
134
+ * as a log record.
135
135
  * @param data Raw payload received over a transport link.
136
- * @returns Validated message, or null if payload is invalid or unrecognized.
136
+ * @returns The validated message, or null if the payload is invalid or unrecognized.
137
137
  */
138
138
  export declare function unwrap(data: unknown): BusMessage | null;