@cloudcare/browser-rum 3.3.6 → 3.3.7

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 (354) hide show
  1. package/README.md +24 -3
  2. package/README.zh.md +19 -3
  3. package/bundle/dataflux-rum.js +1 -1
  4. package/cjs/boot/buildEnv.js +1 -1
  5. package/cjs/boot/buildEnv.js.map +1 -1
  6. package/cjs/boot/perStartRum.js.map +1 -1
  7. package/cjs/boot/recorderApi.js +170 -200
  8. package/cjs/boot/recorderApi.js.map +1 -1
  9. package/cjs/boot/recorderApiStub.js +3 -29
  10. package/cjs/boot/recorderApiStub.js.map +1 -1
  11. package/cjs/boot/rum.entry.js.map +1 -1
  12. package/cjs/boot/rum.js.map +1 -1
  13. package/cjs/boot/rum.slim.entry.js.map +1 -1
  14. package/cjs/boot/rumEntryFactory.js.map +1 -1
  15. package/cjs/boot/rumPublicApi.js.map +1 -1
  16. package/cjs/boot/rumRecorderApiStub.js.map +1 -1
  17. package/cjs/boot/rumSlimConfiguration.js.map +1 -1
  18. package/cjs/boot/sessionReplayPublicApi.js +14 -27
  19. package/cjs/boot/sessionReplayPublicApi.js.map +1 -1
  20. package/cjs/boot/startRecording.js +333 -108
  21. package/cjs/boot/startRecording.js.map +1 -1
  22. package/cjs/constants.js.map +1 -1
  23. package/cjs/domain/assembly.js +1 -7
  24. package/cjs/domain/assembly.js.map +1 -1
  25. package/cjs/domain/configuration.js +31 -43
  26. package/cjs/domain/configuration.js.map +1 -1
  27. package/cjs/domain/contexts/commonContext.js.map +1 -1
  28. package/cjs/domain/contexts/displayContext.js.map +1 -1
  29. package/cjs/domain/contexts/foregroundContexts.js.map +1 -1
  30. package/cjs/domain/contexts/internalContext.js.map +1 -1
  31. package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
  32. package/cjs/domain/contexts/urlContexts.js +10 -1
  33. package/cjs/domain/contexts/urlContexts.js.map +1 -1
  34. package/cjs/domain/contexts/viewContexts.js.map +1 -1
  35. package/cjs/domain/deflate/deflateEncoder.js +517 -39
  36. package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
  37. package/cjs/domain/deflate/deflateWorker.js +194 -115
  38. package/cjs/domain/deflate/deflateWorker.js.map +1 -1
  39. package/cjs/domain/deflate/index.js.map +1 -1
  40. package/cjs/domain/domMutationObservable.js.map +1 -1
  41. package/cjs/domain/encoderStreamId.js.map +1 -1
  42. package/cjs/domain/firstInputPolyfill.js.map +1 -1
  43. package/cjs/domain/initViewportObservable.js.map +1 -1
  44. package/cjs/domain/locationChangeObservable.js.map +1 -1
  45. package/cjs/domain/performanceObservable.js.map +1 -1
  46. package/cjs/domain/performanceUtils.js.map +1 -1
  47. package/cjs/domain/plugins.js.map +1 -1
  48. package/cjs/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
  49. package/cjs/domain/replay/record/canvasCommandCapture.js +968 -167
  50. package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -1
  51. package/cjs/domain/replay/record/canvasCommandObserver.js +1058 -119
  52. package/cjs/domain/replay/record/canvasCommandObserver.js.map +1 -1
  53. package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +61 -37
  54. package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
  55. package/cjs/domain/replay/record/canvasContext.js +63 -0
  56. package/cjs/domain/replay/record/canvasContext.js.map +1 -0
  57. package/cjs/domain/replay/record/canvasContinuousScheduler.js +246 -118
  58. package/cjs/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
  59. package/cjs/domain/replay/record/canvasEncodeBridge.js +539 -87
  60. package/cjs/domain/replay/record/canvasEncodeBridge.js.map +1 -1
  61. package/cjs/domain/replay/record/canvasEncodeWorker.js +50 -32
  62. package/cjs/domain/replay/record/canvasEncodeWorker.js.map +1 -1
  63. package/cjs/domain/replay/record/canvasFrameSignature.js +49 -17
  64. package/cjs/domain/replay/record/canvasFrameSignature.js.map +1 -1
  65. package/cjs/domain/replay/record/canvasMutationRecord.js.map +1 -1
  66. package/cjs/domain/replay/record/canvasObserver.js +295 -59
  67. package/cjs/domain/replay/record/canvasObserver.js.map +1 -1
  68. package/cjs/domain/replay/record/canvasSerializeArgs.js.map +1 -1
  69. package/cjs/domain/replay/record/canvasWebGLPluginHost.js +33 -0
  70. package/cjs/domain/replay/record/canvasWebGLPluginHost.js.map +1 -0
  71. package/cjs/domain/replay/record/elementsScrollPositions.js +3 -0
  72. package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -1
  73. package/cjs/domain/replay/record/index.js.map +1 -1
  74. package/cjs/domain/replay/record/mutationBatch.js +542 -25
  75. package/cjs/domain/replay/record/mutationBatch.js.map +1 -1
  76. package/cjs/domain/replay/record/mutationObserver.js +1900 -191
  77. package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
  78. package/cjs/domain/replay/record/mutationResourceBudget.js +144 -0
  79. package/cjs/domain/replay/record/mutationResourceBudget.js.map +1 -0
  80. package/cjs/domain/replay/record/observers.js +222 -53
  81. package/cjs/domain/replay/record/observers.js.map +1 -1
  82. package/cjs/domain/replay/record/privacy.js +31 -8
  83. package/cjs/domain/replay/record/privacy.js.map +1 -1
  84. package/cjs/domain/replay/record/record.js +3083 -321
  85. package/cjs/domain/replay/record/record.js.map +1 -1
  86. package/cjs/domain/replay/record/serializationUtils.js +426 -26
  87. package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
  88. package/cjs/domain/replay/record/serialize.js +259 -49
  89. package/cjs/domain/replay/record/serialize.js.map +1 -1
  90. package/cjs/domain/replay/record/shadowRootsController.js +875 -21
  91. package/cjs/domain/replay/record/shadowRootsController.js.map +1 -1
  92. package/cjs/domain/replay/record/utils.js.map +1 -1
  93. package/cjs/domain/replay/record/viewports.js.map +1 -1
  94. package/cjs/domain/replay/replayStats.js.map +1 -1
  95. package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
  96. package/cjs/domain/replay/segmentCollection/index.js.map +1 -1
  97. package/cjs/domain/replay/segmentCollection/segment.js +315 -11
  98. package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
  99. package/cjs/domain/replay/segmentCollection/segmentCollection.js +956 -71
  100. package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
  101. package/cjs/domain/replay/startRecordBridge.js.map +1 -1
  102. package/cjs/domain/requestCollection.js.map +1 -1
  103. package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
  104. package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
  105. package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
  106. package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
  107. package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
  108. package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
  109. package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
  110. package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
  111. package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
  112. package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
  113. package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
  114. package/cjs/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
  115. package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
  116. package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
  117. package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
  118. package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
  119. package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
  120. package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
  121. package/cjs/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
  122. package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
  123. package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
  124. package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
  125. package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
  126. package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
  127. package/cjs/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
  128. package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
  129. package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
  130. package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
  131. package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
  132. package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
  133. package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
  134. package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
  135. package/cjs/domain/rumEventsCollection/view/trackViews.js +29 -11
  136. package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
  137. package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
  138. package/cjs/domain/rumSessionManager.js.map +1 -1
  139. package/cjs/domain/tracing/ddtraceTracer.js.map +1 -1
  140. package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
  141. package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
  142. package/cjs/domain/tracing/sampler.js.map +1 -1
  143. package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
  144. package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
  145. package/cjs/domain/tracing/tracer.js +2 -2
  146. package/cjs/domain/tracing/tracer.js.map +1 -1
  147. package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -1
  148. package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
  149. package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
  150. package/cjs/domain/trackEventCounts.js.map +1 -1
  151. package/cjs/domain/usr/index.js.map +1 -1
  152. package/cjs/domain/waitPageActivityEnd.js.map +1 -1
  153. package/cjs/index.js.map +1 -1
  154. package/cjs/transport/startRumBatch.js +3 -1
  155. package/cjs/transport/startRumBatch.js.map +1 -1
  156. package/cjs/transport/startRumEventBridge.js.map +1 -1
  157. package/cjs/types/index.js.map +1 -1
  158. package/cjs/types/sessionReplayConstants.js.map +1 -1
  159. package/esm/boot/buildEnv.js +1 -1
  160. package/esm/boot/buildEnv.js.map +1 -1
  161. package/esm/boot/perStartRum.js.map +1 -1
  162. package/esm/boot/recorderApi.js +172 -202
  163. package/esm/boot/recorderApi.js.map +1 -1
  164. package/esm/boot/recorderApiStub.js +3 -29
  165. package/esm/boot/recorderApiStub.js.map +1 -1
  166. package/esm/boot/rum.entry.js.map +1 -1
  167. package/esm/boot/rum.js.map +1 -1
  168. package/esm/boot/rum.slim.entry.js.map +1 -1
  169. package/esm/boot/rumEntryFactory.js.map +1 -1
  170. package/esm/boot/rumPublicApi.js.map +1 -1
  171. package/esm/boot/rumRecorderApiStub.js.map +1 -1
  172. package/esm/boot/rumSlimConfiguration.js.map +1 -1
  173. package/esm/boot/sessionReplayPublicApi.js +14 -27
  174. package/esm/boot/sessionReplayPublicApi.js.map +1 -1
  175. package/esm/boot/startRecording.js +334 -109
  176. package/esm/boot/startRecording.js.map +1 -1
  177. package/esm/constants.js.map +1 -1
  178. package/esm/domain/assembly.js +1 -7
  179. package/esm/domain/assembly.js.map +1 -1
  180. package/esm/domain/configuration.js +31 -43
  181. package/esm/domain/configuration.js.map +1 -1
  182. package/esm/domain/contexts/commonContext.js.map +1 -1
  183. package/esm/domain/contexts/displayContext.js.map +1 -1
  184. package/esm/domain/contexts/foregroundContexts.js.map +1 -1
  185. package/esm/domain/contexts/internalContext.js.map +1 -1
  186. package/esm/domain/contexts/pageStateHistory.js.map +1 -1
  187. package/esm/domain/contexts/urlContexts.js +11 -2
  188. package/esm/domain/contexts/urlContexts.js.map +1 -1
  189. package/esm/domain/contexts/viewContexts.js.map +1 -1
  190. package/esm/domain/deflate/deflateEncoder.js +517 -39
  191. package/esm/domain/deflate/deflateEncoder.js.map +1 -1
  192. package/esm/domain/deflate/deflateWorker.js +193 -116
  193. package/esm/domain/deflate/deflateWorker.js.map +1 -1
  194. package/esm/domain/deflate/index.js.map +1 -1
  195. package/esm/domain/domMutationObservable.js.map +1 -1
  196. package/esm/domain/encoderStreamId.js.map +1 -1
  197. package/esm/domain/firstInputPolyfill.js.map +1 -1
  198. package/esm/domain/initViewportObservable.js.map +1 -1
  199. package/esm/domain/locationChangeObservable.js.map +1 -1
  200. package/esm/domain/performanceObservable.js.map +1 -1
  201. package/esm/domain/performanceUtils.js.map +1 -1
  202. package/esm/domain/plugins.js.map +1 -1
  203. package/esm/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
  204. package/esm/domain/replay/record/canvasCommandCapture.js +968 -168
  205. package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -1
  206. package/esm/domain/replay/record/canvasCommandObserver.js +1058 -119
  207. package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -1
  208. package/esm/domain/replay/record/canvasCommandSerializeArgs.js +60 -37
  209. package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
  210. package/esm/domain/replay/record/canvasContext.js +50 -0
  211. package/esm/domain/replay/record/canvasContext.js.map +1 -0
  212. package/esm/domain/replay/record/canvasContinuousScheduler.js +246 -118
  213. package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
  214. package/esm/domain/replay/record/canvasEncodeBridge.js +539 -87
  215. package/esm/domain/replay/record/canvasEncodeBridge.js.map +1 -1
  216. package/esm/domain/replay/record/canvasEncodeWorker.js +51 -33
  217. package/esm/domain/replay/record/canvasEncodeWorker.js.map +1 -1
  218. package/esm/domain/replay/record/canvasFrameSignature.js +50 -17
  219. package/esm/domain/replay/record/canvasFrameSignature.js.map +1 -1
  220. package/esm/domain/replay/record/canvasMutationRecord.js.map +1 -1
  221. package/esm/domain/replay/record/canvasObserver.js +295 -59
  222. package/esm/domain/replay/record/canvasObserver.js.map +1 -1
  223. package/esm/domain/replay/record/canvasSerializeArgs.js.map +1 -1
  224. package/esm/domain/replay/record/canvasWebGLPluginHost.js +26 -0
  225. package/esm/domain/replay/record/canvasWebGLPluginHost.js.map +1 -0
  226. package/esm/domain/replay/record/elementsScrollPositions.js +3 -0
  227. package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -1
  228. package/esm/domain/replay/record/index.js.map +1 -1
  229. package/esm/domain/replay/record/mutationBatch.js +541 -25
  230. package/esm/domain/replay/record/mutationBatch.js.map +1 -1
  231. package/esm/domain/replay/record/mutationObserver.js +1892 -195
  232. package/esm/domain/replay/record/mutationObserver.js.map +1 -1
  233. package/esm/domain/replay/record/mutationResourceBudget.js +137 -0
  234. package/esm/domain/replay/record/mutationResourceBudget.js.map +1 -0
  235. package/esm/domain/replay/record/observers.js +224 -55
  236. package/esm/domain/replay/record/observers.js.map +1 -1
  237. package/esm/domain/replay/record/privacy.js +30 -7
  238. package/esm/domain/replay/record/privacy.js.map +1 -1
  239. package/esm/domain/replay/record/record.js +3086 -325
  240. package/esm/domain/replay/record/record.js.map +1 -1
  241. package/esm/domain/replay/record/serializationUtils.js +422 -25
  242. package/esm/domain/replay/record/serializationUtils.js.map +1 -1
  243. package/esm/domain/replay/record/serialize.js +258 -50
  244. package/esm/domain/replay/record/serialize.js.map +1 -1
  245. package/esm/domain/replay/record/shadowRootsController.js +875 -21
  246. package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
  247. package/esm/domain/replay/record/utils.js.map +1 -1
  248. package/esm/domain/replay/record/viewports.js.map +1 -1
  249. package/esm/domain/replay/replayStats.js.map +1 -1
  250. package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
  251. package/esm/domain/replay/segmentCollection/index.js.map +1 -1
  252. package/esm/domain/replay/segmentCollection/segment.js +315 -10
  253. package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
  254. package/esm/domain/replay/segmentCollection/segmentCollection.js +957 -72
  255. package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
  256. package/esm/domain/replay/startRecordBridge.js.map +1 -1
  257. package/esm/domain/requestCollection.js.map +1 -1
  258. package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
  259. package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
  260. package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
  261. package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
  262. package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
  263. package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
  264. package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
  265. package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
  266. package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
  267. package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
  268. package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
  269. package/esm/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
  270. package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
  271. package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
  272. package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
  273. package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
  274. package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
  275. package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
  276. package/esm/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
  277. package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
  278. package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
  279. package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
  280. package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
  281. package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
  282. package/esm/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
  283. package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
  284. package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
  285. package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
  286. package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
  287. package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
  288. package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
  289. package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
  290. package/esm/domain/rumEventsCollection/view/trackViews.js +30 -12
  291. package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
  292. package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
  293. package/esm/domain/rumSessionManager.js.map +1 -1
  294. package/esm/domain/tracing/ddtraceTracer.js.map +1 -1
  295. package/esm/domain/tracing/getDocumentTraceId.js.map +1 -1
  296. package/esm/domain/tracing/jaegerTracer.js.map +1 -1
  297. package/esm/domain/tracing/sampler.js.map +1 -1
  298. package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
  299. package/esm/domain/tracing/traceIdentifier.js.map +1 -1
  300. package/esm/domain/tracing/tracer.js +2 -2
  301. package/esm/domain/tracing/tracer.js.map +1 -1
  302. package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -1
  303. package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
  304. package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
  305. package/esm/domain/trackEventCounts.js.map +1 -1
  306. package/esm/domain/usr/index.js.map +1 -1
  307. package/esm/domain/waitPageActivityEnd.js.map +1 -1
  308. package/esm/index.js.map +1 -1
  309. package/esm/transport/startRumBatch.js +4 -2
  310. package/esm/transport/startRumBatch.js.map +1 -1
  311. package/esm/transport/startRumEventBridge.js.map +1 -1
  312. package/esm/types/index.js.map +1 -1
  313. package/esm/types/sessionReplayConstants.js.map +1 -1
  314. package/package.json +12 -7
  315. package/src/boot/recorderApi.js +247 -220
  316. package/src/boot/recorderApiStub.js +3 -29
  317. package/src/boot/sessionReplayPublicApi.js +15 -28
  318. package/src/boot/startRecording.js +429 -146
  319. package/src/domain/assembly.js +5 -4
  320. package/src/domain/configuration.js +63 -100
  321. package/src/domain/contexts/urlContexts.js +16 -4
  322. package/src/domain/deflate/deflateEncoder.js +699 -43
  323. package/src/domain/deflate/deflateWorker.js +237 -136
  324. package/src/domain/replay/record/canvasCommandCapture.js +1374 -180
  325. package/src/domain/replay/record/canvasCommandObserver.js +1585 -150
  326. package/src/domain/replay/record/canvasCommandSerializeArgs.js +79 -42
  327. package/src/domain/replay/record/canvasContext.js +67 -0
  328. package/src/domain/replay/record/canvasContinuousScheduler.js +379 -143
  329. package/src/domain/replay/record/canvasEncodeBridge.js +691 -106
  330. package/src/domain/replay/record/canvasEncodeWorker.js +67 -43
  331. package/src/domain/replay/record/canvasFrameSignature.js +58 -24
  332. package/src/domain/replay/record/canvasObserver.js +461 -89
  333. package/src/domain/replay/record/canvasWebGLPluginHost.js +43 -0
  334. package/src/domain/replay/record/elementsScrollPositions.js +3 -0
  335. package/src/domain/replay/record/mutationBatch.js +761 -27
  336. package/src/domain/replay/record/mutationObserver.js +2992 -261
  337. package/src/domain/replay/record/mutationResourceBudget.js +191 -0
  338. package/src/domain/replay/record/observers.js +367 -97
  339. package/src/domain/replay/record/privacy.js +34 -12
  340. package/src/domain/replay/record/record.js +4284 -413
  341. package/src/domain/replay/record/serializationUtils.js +587 -28
  342. package/src/domain/replay/record/serialize.js +432 -66
  343. package/src/domain/replay/record/shadowRootsController.js +1108 -30
  344. package/src/domain/replay/segmentCollection/segment.js +441 -11
  345. package/src/domain/replay/segmentCollection/segmentCollection.js +1300 -77
  346. package/src/domain/rumEventsCollection/view/trackViews.js +36 -12
  347. package/src/domain/tracing/tracer.js +4 -5
  348. package/src/transport/startRumBatch.js +6 -1
  349. package/types/index.d.ts +15 -2
  350. package/cjs/domain/replay/record/canvasReplayFixtures.js +0 -105
  351. package/cjs/domain/replay/record/canvasReplayFixtures.js.map +0 -1
  352. package/esm/domain/replay/record/canvasReplayFixtures.js +0 -96
  353. package/esm/domain/replay/record/canvasReplayFixtures.js.map +0 -1
  354. package/src/domain/replay/record/canvasReplayFixtures.js +0 -113
@@ -1,4 +1,4 @@
1
- import { timeStampNow, createHttpRequest, LifeCycleEventType, addTelemetryDebug, ONE_SECOND, canUseEventBridge, assign } from '@cloudcare/browser-core';
1
+ import { timeStampNow, createHttpRequest, LifeCycleEventType, PageExitReason, addTelemetryDebug, ONE_SECOND, canUseEventBridge, assign } from '@cloudcare/browser-core';
2
2
  import { record } from '../domain/replay/record';
3
3
  import { startRecordBridge } from '../domain/replay/startRecordBridge';
4
4
  import { startSegmentCollection, SEGMENT_BYTES_LIMIT } from '../domain/replay/segmentCollection';
@@ -7,11 +7,70 @@ import { deleteOldestStats } from '../domain/replay/replayStats';
7
7
  /* How long to wait for error checkouts */
8
8
  export var BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND;
9
9
  var REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10;
10
- export function startRecording(lifeCycle, configuration, sessionManager, viewContexts, encoder, httpRequest) {
10
+ export function startRecording(lifeCycle, configuration, sessionManager, viewContexts, encoder, httpRequest, onStopped, createHttpRequestOverride, recordOverride) {
11
+ var createHttpRequestImpl = false ? createHttpRequestOverride || createHttpRequest : createHttpRequest;
12
+ var recordImpl = false ? recordOverride || record : record;
11
13
  var cleanupTasks = [];
14
+ var isRecordingStopped = false;
15
+ var isRecordingReady = false;
16
+ var pendingStopRequested = false;
17
+ var pendingStopReason;
18
+ var stoppedNotificationSent = false;
19
+ var flushRecorderBeforePageExit = function flushRecorderBeforePageExit() {};
20
+ var replayResetRequestedBeforeRecorder = false;
21
+ var requestReplayReset = function requestReplayReset() {
22
+ replayResetRequestedBeforeRecorder = true;
23
+ };
24
+ function notifyStopped(flushReason) {
25
+ if (stoppedNotificationSent || !onStopped) {
26
+ return;
27
+ }
28
+ stoppedNotificationSent = true;
29
+ try {
30
+ onStopped(flushReason);
31
+ } catch (error) {
32
+ addTelemetryDebug('Session Replay stopped callback failed.', {
33
+ reason: flushReason,
34
+ error: String(error)
35
+ });
36
+ }
37
+ }
38
+ function stopRecording(flushReason) {
39
+ if (isRecordingStopped) {
40
+ return;
41
+ }
42
+ if (!isRecordingReady) {
43
+ pendingStopRequested = true;
44
+ pendingStopReason = flushReason;
45
+ return;
46
+ }
47
+ isRecordingStopped = true;
48
+ var firstCleanupError;
49
+ cleanupTasks.slice().reverse().forEach(function (task) {
50
+ try {
51
+ task(flushReason);
52
+ } catch (error) {
53
+ if (!firstCleanupError) {
54
+ firstCleanupError = error;
55
+ }
56
+ }
57
+ });
58
+ if (firstCleanupError) {
59
+ addTelemetryDebug('Session Replay cleanup failed.', {
60
+ reason: flushReason,
61
+ error: String(firstCleanupError)
62
+ });
63
+ }
64
+ notifyStopped(flushReason);
65
+ }
12
66
  var lastReplaySegmentFlushForDebug;
13
- var replaySegmentFlushHistoryForDebug = [];
67
+ var replaySegmentFlushHistoryForDebug = false ? [] : undefined;
14
68
  var replaySegmentFlushCount = 0;
69
+ var replayResetCountForDebug = 0;
70
+ var replayResetLastReasonForDebug;
71
+ var areReplaySegmentsLockedForDebug = function areReplaySegmentsLockedForDebug() {
72
+ return false;
73
+ };
15
74
  var reportError = function reportError(error) {
16
75
  lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, {
17
76
  error: error
@@ -20,124 +79,287 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
20
79
  'error.message': error.message
21
80
  });
22
81
  };
23
- var replayRequest = httpRequest || createHttpRequest(configuration.sessionReplayEndPoint, SEGMENT_BYTES_LIMIT, configuration.retryMaxSize, reportError);
24
- var addRecord, _record;
25
- if (!canUseEventBridge()) {
26
- var session = sessionManager.findTrackedSession();
27
- var isRecordErrorSessionReplay = session && session.errorSessionReplayAllowed && !session.sessionHasError;
28
- var segmentCollection = startSegmentCollection(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, encoder, isRecordErrorSessionReplay, {
29
- onSegmentFlushed: function onSegmentFlushed(segmentFlush) {
30
- replaySegmentFlushCount += 1;
31
- lastReplaySegmentFlushForDebug = cloneReplaySegmentFlushForDebug(segmentFlush, replaySegmentFlushCount);
32
- replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug);
33
- if (replaySegmentFlushHistoryForDebug.length > REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT) {
34
- replaySegmentFlushHistoryForDebug.shift();
35
- }
36
- }
37
- });
38
- addRecord = segmentCollection.addRecord;
39
- var flushBufferSegment = segmentCollection.flushBufferSegment;
40
- var unlockSegment = segmentCollection.unlockSegment;
41
- cleanupTasks.push(segmentCollection.stop);
42
- if (isRecordErrorSessionReplay) {
43
- sessionManager.sessionStateUpdateObservable.subscribe(function (_ref) {
44
- var previousState = _ref.previousState,
45
- newState = _ref.newState;
46
- if (!previousState.hasError && newState.hasError) {
47
- isRecordErrorSessionReplay = false;
48
- unlockSegment();
49
- }
50
- });
82
+ try {
83
+ var replayRequest = httpRequest || lifeCycle.$rReplayRequest;
84
+ if (!replayRequest) {
85
+ replayRequest = createHttpRequestImpl(configuration.sessionReplayEndPoint, SEGMENT_BYTES_LIMIT, configuration.retryMaxSize, reportError);
86
+ // Recorder restarts share one bounded retry queue/timer/request state.
87
+ // Old segment finishes can then drain in order without multiplying a
88
+ // 20 MiB queue for every stop/start cycle.
89
+ lifeCycle.$rReplayRequest = replayRequest;
51
90
  }
52
- var lastFullSnapshotEvent = null;
53
- var wrappedEmit = function wrappedEmit(recordData) {
54
- addRecord(recordData);
91
+ var addRecord, addBaselineRecords, _record;
92
+ var stopSegmentCollection;
93
+ var beginMandatoryFullSnapshotRecovery = function beginMandatoryFullSnapshotRecovery() {};
94
+ var discardMandatoryFullSnapshotRecovery = function discardMandatoryFullSnapshotRecovery() {};
95
+ var wasLastEmitBackpressured = function wasLastEmitBackpressured() {};
96
+ if (!canUseEventBridge()) {
97
+ var session = sessionManager.findTrackedSession();
98
+ var isRecordErrorSessionReplay = session && session.errorSessionReplayAllowed && !session.sessionHasError;
99
+ var segmentCollection = startSegmentCollection(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, encoder, isRecordErrorSessionReplay, {
100
+ beforePageExitFlush: function beforePageExitFlush(pageExitEvent) {
101
+ flushRecorderBeforePageExit(pageExitEvent);
102
+ },
103
+ onReplayResetNeeded: function onReplayResetNeeded(reason) {
104
+ if (false) {
105
+ replayResetCountForDebug += 1;
106
+ replayResetLastReasonForDebug = reason;
107
+ }
108
+ requestReplayReset(reason);
109
+ },
110
+ onReplayResetExhausted: function onReplayResetExhausted(reason) {
111
+ stopRecording(reason || 'full_snapshot_failure_limit');
112
+ },
113
+ onSegmentFlushed: false ? function (segmentFlush) {
114
+ replaySegmentFlushCount += 1;
115
+ lastReplaySegmentFlushForDebug = cloneReplaySegmentFlushForDebug(segmentFlush, replaySegmentFlushCount);
116
+ replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug);
117
+ if (replaySegmentFlushHistoryForDebug.length > REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT) {
118
+ replaySegmentFlushHistoryForDebug.shift();
119
+ }
120
+ } : undefined
121
+ });
122
+ addRecord = segmentCollection.addRecord;
123
+ addBaselineRecords = segmentCollection.$rAddBaselineRecords;
124
+ wasLastEmitBackpressured = segmentCollection.$rWasLastAddRecordBackpressured || wasLastEmitBackpressured;
125
+ beginMandatoryFullSnapshotRecovery = segmentCollection.$rBeginMandatoryRecovery || beginMandatoryFullSnapshotRecovery;
126
+ discardMandatoryFullSnapshotRecovery = segmentCollection.$rDiscardMandatoryRecovery || discardMandatoryFullSnapshotRecovery;
127
+ var flushBufferSegment = segmentCollection.flushBufferSegment;
128
+ var unlockSegment = segmentCollection.unlockSegment;
129
+ if (false) {
130
+ areReplaySegmentsLockedForDebug = segmentCollection.isLocked;
131
+ }
132
+ stopSegmentCollection = segmentCollection.stop;
133
+ // Register a provisional cleanup before record() starts. Unexpected
134
+ // recorder initialization failures must not leave segment lifecycle
135
+ // subscriptions and timers alive.
136
+ cleanupTasks.push(stopSegmentCollection);
55
137
  if (isRecordErrorSessionReplay) {
56
- if (recordData.type === RecordType.FullSnapshot) {
57
- lastFullSnapshotEvent = recordData;
58
- } else if (recordData.type === RecordType.IncrementalSnapshot) {
59
- var exceedTime = recordData.timestamp - lastFullSnapshotEvent.timestamp > BUFFER_CHECKOUT_TIME;
60
- // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot
61
- if (exceedTime) {
62
- flushBufferSegment(function () {
63
- deleteOldestStats();
64
- takeSubsequentFullSnapshot();
65
- });
138
+ var sessionStateUpdateSubscription = sessionManager.sessionStateUpdateObservable.subscribe(function (_ref) {
139
+ var previousState = _ref.previousState,
140
+ newState = _ref.newState;
141
+ if (!previousState.hasError && newState.hasError) {
142
+ isRecordErrorSessionReplay = false;
143
+ unlockSegment();
144
+ }
145
+ });
146
+ cleanupTasks.push(sessionStateUpdateSubscription.unsubscribe);
147
+ }
148
+ var lastFullSnapshotEvent = null;
149
+ var wrappedEmit = function wrappedEmit(recordData) {
150
+ var accepted = addRecord(recordData);
151
+ if (accepted !== false && isRecordErrorSessionReplay) {
152
+ if (recordData.type === RecordType.FullSnapshot) {
153
+ lastFullSnapshotEvent = recordData;
154
+ } else if (recordData.type === RecordType.IncrementalSnapshot) {
155
+ var exceedTime = recordData.timestamp - lastFullSnapshotEvent.timestamp > BUFFER_CHECKOUT_TIME;
156
+ // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot
157
+ if (exceedTime) {
158
+ flushBufferSegment(function () {
159
+ deleteOldestStats();
160
+ _takeSubsequentFullSnapshot();
161
+ });
162
+ }
66
163
  }
67
164
  }
165
+ return accepted;
166
+ };
167
+ var wrappedEmitBaseline = function wrappedEmitBaseline(records) {
168
+ var accepted = addBaselineRecords(records);
169
+ if (accepted !== false && isRecordErrorSessionReplay) {
170
+ lastFullSnapshotEvent = records[records.length - 1];
171
+ }
172
+ return accepted;
173
+ };
174
+ _record = recordImpl({
175
+ emit: wrappedEmit,
176
+ $rEmitBaseline: wrappedEmitBaseline,
177
+ configuration: configuration,
178
+ lifeCycle: lifeCycle,
179
+ sessionManager: sessionManager,
180
+ $rWasLastEmitBackpressured: wasLastEmitBackpressured,
181
+ $rOnMandatoryFullSnapshotStarted: beginMandatoryFullSnapshotRecovery,
182
+ $rOnMandatoryFullSnapshotAbandoned: discardMandatoryFullSnapshotRecovery,
183
+ onFullSnapshotFailure: stopRecording
184
+ });
185
+ } else {
186
+ ;
187
+ var _startRecordBridge = startRecordBridge(viewContexts);
188
+ addRecord = _startRecordBridge.addRecord;
189
+ _record = recordImpl({
190
+ emit: addRecord,
191
+ configuration: configuration,
192
+ lifeCycle: lifeCycle,
193
+ sessionManager: sessionManager,
194
+ $rWasLastEmitBackpressured: wasLastEmitBackpressured,
195
+ $rOnMandatoryFullSnapshotStarted: beginMandatoryFullSnapshotRecovery,
196
+ $rOnMandatoryFullSnapshotAbandoned: discardMandatoryFullSnapshotRecovery,
197
+ onFullSnapshotFailure: stopRecording
198
+ });
199
+ }
200
+ if (!_record || typeof _record.stop !== 'function') {
201
+ throw new Error('Session Replay recorder failed to initialize.');
202
+ }
203
+ var stopRecorder = _record.stop;
204
+ if (stopSegmentCollection) {
205
+ // Remove the provisional entry and restore the intended successful-stop
206
+ // ordering below (cleanup tasks run in reverse).
207
+ var provisionalCleanupIndex = cleanupTasks.indexOf(stopSegmentCollection);
208
+ if (provisionalCleanupIndex !== -1) {
209
+ cleanupTasks.splice(provisionalCleanupIndex, 1);
68
210
  }
211
+ }
212
+ cleanupTasks.push(stopSegmentCollection ? function (flushReason) {
213
+ // segmentCollection already invoked beforePageExitFlush while its
214
+ // encoder was writable. Teardown must now discard any unfinished
215
+ // atomic tail instead of doing work that can no longer be sent.
216
+ stopRecorder(flushReason, true);
217
+ } : stopRecorder);
218
+ if (stopSegmentCollection) {
219
+ // Stop the segment collection first (cleanup tasks run in reverse).
220
+ // Its beforePageExitFlush hook can then drain the still-live recorder,
221
+ // including a second unload pass after synchronous encoder backpressure
222
+ // is released, before the observers are torn down.
223
+ cleanupTasks.push(stopSegmentCollection);
224
+ }
225
+ var _takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot;
226
+ var flushScheduledFullSnapshot = _record.flushScheduledFullSnapshot || function () {};
227
+ var flushCanvasCommands = _record.$rFlushCanvasCommands || function () {};
228
+ flushRecorderBeforePageExit = function flushRecorderBeforePageExit(pageExitEvent) {
229
+ if (pageExitEvent && pageExitEvent.reason !== PageExitReason.UNLOADING) {
230
+ // Hidden, frozen, and pagehide states can resume in the same view.
231
+ // Keep an in-progress DOM recovery baseline scheduled so later
232
+ // mutations are never attached to the stale pre-overflow snapshot.
233
+ _record.flushMutations();
234
+ flushCanvasCommands();
235
+ return;
236
+ }
237
+ if (!flushScheduledFullSnapshot()) {
238
+ // The segment is still writable in this hook. Give a paged raw/shadow
239
+ // transaction its final bounded drain before segmentCollection closes;
240
+ // record.stop() runs afterwards and can only discard an unfinished
241
+ // atomic tail.
242
+ _record.flushMutations(true);
243
+ }
244
+ // Keep the command recorder alive until this hook runs: the segment is
245
+ // still writable here, including the second unload pass after synchronous
246
+ // encoder backpressure is released.
247
+ flushCanvasCommands();
69
248
  };
70
- _record = record({
71
- emit: wrappedEmit,
72
- configuration: configuration,
73
- lifeCycle: lifeCycle,
74
- sessionManager: sessionManager
249
+ requestReplayReset = createReplayResetScheduler(_takeSubsequentFullSnapshot, cleanupTasks);
250
+ if (replayResetRequestedBeforeRecorder) {
251
+ requestReplayReset();
252
+ }
253
+ var scheduleSubsequentFullSnapshot = _record.scheduleSubsequentFullSnapshot || _takeSubsequentFullSnapshot;
254
+ var prepareForViewChange = _record.prepareForViewChange || _record.flushMutations;
255
+ var snapshotCanvas = _record.snapshotCanvas;
256
+ var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug;
257
+ var recordingDebug;
258
+ if (false) {
259
+ recordingDebug = {
260
+ getLastAutoCanvasSnapshotResultForDebug: _record.getLastAutoCanvasSnapshotResultForDebug,
261
+ getAutoCanvasSnapshotDebugHistoryForDebug: _record.getAutoCanvasSnapshotDebugHistoryForDebug,
262
+ getLastCanvasMutationForDebug: _record.getLastCanvasMutationForDebug,
263
+ getCanvasMutationHistoryForDebug: _record.getCanvasMutationHistoryForDebug,
264
+ getLastDomMutationForDebug: _record.getLastDomMutationForDebug,
265
+ getDomMutationHistoryForDebug: _record.getDomMutationHistoryForDebug,
266
+ getReplayPerformanceForDebug: function getReplayPerformanceForDebug() {
267
+ return cloneReplayPerformanceForDebug(_record.getReplayPerformanceForDebug ? _record.getReplayPerformanceForDebug() : undefined, replaySegmentFlushCount, replayResetCountForDebug, replayResetLastReasonForDebug, areReplaySegmentsLockedForDebug());
268
+ },
269
+ getLastReplaySegmentFlushForDebug: function getLastReplaySegmentFlushForDebug() {
270
+ return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug);
271
+ },
272
+ getReplaySegmentFlushHistoryForDebug: function getReplaySegmentFlushHistoryForDebug() {
273
+ return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {
274
+ return cloneReplaySegmentFlushForDebug(segmentFlush);
275
+ });
276
+ }
277
+ };
278
+ }
279
+ var flushMutations = _record.flushMutations;
280
+ var subscribeViewEnded = lifeCycle.subscribe(LifeCycleEventType.VIEW_ENDED, function () {
281
+ if (!flushScheduledFullSnapshot(true, true)) {
282
+ // Preserve DOM changes still queued by the native MutationObservers.
283
+ // The next view snapshot has not been scheduled yet, so resetting the
284
+ // observers here would otherwise lose the old view's final state.
285
+ flushMutations();
286
+ }
287
+ // Canvas command batches are frame-scheduled. Publish the old view's
288
+ // final batch before ViewEnd and before VIEW_CREATED resets the canvas
289
+ // baseline for the next replay tree.
290
+ flushCanvasCommands();
291
+ prepareForViewChange();
292
+ addRecord({
293
+ timestamp: timeStampNow(),
294
+ type: RecordType.ViewEnd
295
+ });
75
296
  });
76
- } else {
77
- ;
78
- var _startRecordBridge = startRecordBridge(viewContexts);
79
- addRecord = _startRecordBridge.addRecord;
80
- _record = record({
81
- emit: addRecord,
82
- configuration: configuration,
83
- lifeCycle: lifeCycle,
84
- sessionManager: sessionManager
297
+ cleanupTasks.push(subscribeViewEnded.unsubscribe);
298
+ var scribeViewCreated = lifeCycle.subscribe(LifeCycleEventType.VIEW_CREATED, function (view) {
299
+ scheduleSubsequentFullSnapshot(view.startClocks.timeStamp);
85
300
  });
301
+ cleanupTasks.push(scribeViewCreated.unsubscribe);
302
+ isRecordingReady = true;
303
+ if (pendingStopRequested) {
304
+ stopRecording(pendingStopReason);
305
+ }
306
+ } catch (error) {
307
+ isRecordingReady = true;
308
+ stopRecording('start_failure');
309
+ throw error;
86
310
  }
87
- cleanupTasks.push(_record.stop);
88
- var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot;
89
- var snapshotCanvas = _record.snapshotCanvas;
90
- var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug;
91
- var getLastAutoCanvasSnapshotResultForDebug = _record.getLastAutoCanvasSnapshotResultForDebug;
92
- var getAutoCanvasSnapshotDebugHistoryForDebug = _record.getAutoCanvasSnapshotDebugHistoryForDebug;
93
- var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug;
94
- var getCanvasMutationHistoryForDebug = _record.getCanvasMutationHistoryForDebug;
95
- var getLastDomMutationForDebug = _record.getLastDomMutationForDebug;
96
- var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug;
97
- var getReplayPerformanceForDebug = function getReplayPerformanceForDebug() {
98
- return cloneReplayPerformanceForDebug(_record.getReplayPerformanceForDebug ? _record.getReplayPerformanceForDebug() : undefined, replaySegmentFlushCount);
99
- };
100
- var getLastReplaySegmentFlushForDebug = function getLastReplaySegmentFlushForDebug() {
101
- return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug);
102
- };
103
- var getReplaySegmentFlushHistoryForDebug = function getReplaySegmentFlushHistoryForDebug() {
104
- return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {
105
- return cloneReplaySegmentFlushForDebug(segmentFlush);
106
- });
107
- };
108
- var flushMutations = _record.flushMutations;
109
- var subscribeViewEnded = lifeCycle.subscribe(LifeCycleEventType.VIEW_ENDED, function () {
110
- flushMutations();
111
- addRecord({
112
- timestamp: timeStampNow(),
113
- type: RecordType.ViewEnd
114
- });
115
- });
116
- cleanupTasks.push(subscribeViewEnded.unsubscribe);
117
- var scribeViewCreated = lifeCycle.subscribe(LifeCycleEventType.VIEW_CREATED, function (view) {
118
- takeSubsequentFullSnapshot(view.startClocks.timeStamp);
119
- });
120
- cleanupTasks.push(scribeViewCreated.unsubscribe);
121
- return {
122
- stop: function stop() {
123
- cleanupTasks.forEach(function (task) {
124
- task();
125
- });
311
+ var recording = {
312
+ stop: stopRecording,
313
+ isStopped: function isStopped() {
314
+ return isRecordingStopped;
315
+ },
316
+ // The public/manual snapshot is opportunistic. Internal view, buffer and
317
+ // recovery snapshots keep using the raw non-discardable function above.
318
+ takeSubsequentFullSnapshot: function takeSubsequentFullSnapshot() {
319
+ return _takeSubsequentFullSnapshot(undefined, true);
126
320
  },
127
- takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,
128
321
  snapshotCanvas: snapshotCanvas,
129
322
  getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,
130
- getLastAutoCanvasSnapshotResultForDebug: getLastAutoCanvasSnapshotResultForDebug,
131
- getAutoCanvasSnapshotDebugHistoryForDebug: getAutoCanvasSnapshotDebugHistoryForDebug,
132
- getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,
133
- getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,
134
- getLastDomMutationForDebug: getLastDomMutationForDebug,
135
- getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,
136
- getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,
137
- getReplaySegmentFlushHistoryForDebug: getReplaySegmentFlushHistoryForDebug,
138
- getReplayPerformanceForDebug: getReplayPerformanceForDebug,
139
323
  flushReplayMutationsForDebug: flushMutations
140
324
  };
325
+ if (false) {
326
+ assign(recording, recordingDebug);
327
+ }
328
+ return recording;
329
+ }
330
+ function createReplayResetScheduler(takeSubsequentFullSnapshot, cleanupTasks) {
331
+ var stopped = false;
332
+ var pending = false;
333
+ var lastResetAt = -Infinity;
334
+ var resetTimeoutId;
335
+ var RESET_MIN_INTERVAL = ONE_SECOND;
336
+ function runReset() {
337
+ resetTimeoutId = undefined;
338
+ if (stopped || !pending) {
339
+ return;
340
+ }
341
+ pending = false;
342
+ lastResetAt = Date.now();
343
+ takeSubsequentFullSnapshot();
344
+ }
345
+ cleanupTasks.push(function () {
346
+ stopped = true;
347
+ if (resetTimeoutId !== undefined) {
348
+ clearTimeout(resetTimeoutId);
349
+ resetTimeoutId = undefined;
350
+ }
351
+ });
352
+ return function () {
353
+ if (stopped) {
354
+ return;
355
+ }
356
+ pending = true;
357
+ if (resetTimeoutId !== undefined) {
358
+ return;
359
+ }
360
+ var delay = Math.max(lastResetAt + RESET_MIN_INTERVAL - Date.now(), 0);
361
+ resetTimeoutId = setTimeout(runReset, delay);
362
+ };
141
363
  }
142
364
  function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
143
365
  if (!segmentFlush) {
@@ -155,12 +377,15 @@ function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
155
377
  rawBytesCount: segmentFlush.rawBytesCount
156
378
  };
157
379
  }
158
- function cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {
380
+ function cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount, replayResetCount, replayResetLastReason, replaySegmentsLocked) {
159
381
  if (!stats && typeof replaySegmentFlushCount === 'undefined') {
160
382
  return undefined;
161
383
  }
162
384
  return assign({}, stats || {}, {
163
- replaySegmentFlushCount: replaySegmentFlushCount || 0
385
+ replaySegmentFlushCount: replaySegmentFlushCount || 0,
386
+ replayResetCount: replayResetCount || 0,
387
+ replayResetLastReason: replayResetLastReason,
388
+ replaySegmentsLocked: Boolean(replaySegmentsLocked)
164
389
  });
165
390
  }
166
391
  //# sourceMappingURL=startRecording.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"startRecording.js","names":["timeStampNow","createHttpRequest","LifeCycleEventType","addTelemetryDebug","ONE_SECOND","canUseEventBridge","assign","record","startRecordBridge","startSegmentCollection","SEGMENT_BYTES_LIMIT","RecordType","deleteOldestStats","BUFFER_CHECKOUT_TIME","REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT","startRecording","lifeCycle","configuration","sessionManager","viewContexts","encoder","httpRequest","cleanupTasks","lastReplaySegmentFlushForDebug","replaySegmentFlushHistoryForDebug","replaySegmentFlushCount","reportError","error","notify","RAW_ERROR_COLLECTED","message","replayRequest","sessionReplayEndPoint","retryMaxSize","addRecord","_record","session","findTrackedSession","isRecordErrorSessionReplay","errorSessionReplayAllowed","sessionHasError","segmentCollection","onSegmentFlushed","segmentFlush","cloneReplaySegmentFlushForDebug","push","length","shift","flushBufferSegment","unlockSegment","stop","sessionStateUpdateObservable","subscribe","_ref","previousState","newState","hasError","lastFullSnapshotEvent","wrappedEmit","recordData","type","FullSnapshot","IncrementalSnapshot","exceedTime","timestamp","takeSubsequentFullSnapshot","emit","_startRecordBridge","snapshotCanvas","getSerializedNodeIdForDebug","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getReplayPerformanceForDebug","cloneReplayPerformanceForDebug","undefined","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","map","flushMutations","subscribeViewEnded","VIEW_ENDED","ViewEnd","unsubscribe","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","forEach","task","flushReplayMutationsForDebug","sequence","creationReason","flushReason","recordsCount","recordCountsByType","start","end","indexInView","rawBytesCount","stats"],"sources":["../../src/boot/startRecording.js"],"sourcesContent":["import {\n timeStampNow,\n createHttpRequest,\n LifeCycleEventType,\n addTelemetryDebug,\n ONE_SECOND,\n canUseEventBridge,\n assign\n} from '@cloudcare/browser-core'\nimport { record } from '../domain/replay/record'\nimport { startRecordBridge } from '../domain/replay/startRecordBridge'\nimport {\n startSegmentCollection,\n SEGMENT_BYTES_LIMIT\n} from '../domain/replay/segmentCollection'\nimport { RecordType } from '../types'\nimport { deleteOldestStats } from '../domain/replay/replayStats'\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND\nvar REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10\nexport function startRecording(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n encoder,\n httpRequest\n) {\n var cleanupTasks = []\n var lastReplaySegmentFlushForDebug\n var replaySegmentFlushHistoryForDebug = []\n var replaySegmentFlushCount = 0\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n addTelemetryDebug('Error reported to customer', {\n 'error.message': error.message\n })\n }\n\n var replayRequest =\n httpRequest ||\n createHttpRequest(\n configuration.sessionReplayEndPoint,\n SEGMENT_BYTES_LIMIT,\n configuration.retryMaxSize,\n reportError\n )\n\n let addRecord, _record\n if (!canUseEventBridge()) {\n const session = sessionManager.findTrackedSession()\n let isRecordErrorSessionReplay =\n session && session.errorSessionReplayAllowed && !session.sessionHasError\n var segmentCollection = startSegmentCollection(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n replayRequest,\n encoder,\n isRecordErrorSessionReplay,\n {\n onSegmentFlushed: function (segmentFlush) {\n replaySegmentFlushCount += 1\n lastReplaySegmentFlushForDebug =\n cloneReplaySegmentFlushForDebug(\n segmentFlush,\n replaySegmentFlushCount\n )\n replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug)\n if (\n replaySegmentFlushHistoryForDebug.length >\n REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT\n ) {\n replaySegmentFlushHistoryForDebug.shift()\n }\n }\n }\n )\n addRecord = segmentCollection.addRecord\n let flushBufferSegment = segmentCollection.flushBufferSegment\n let unlockSegment = segmentCollection.unlockSegment\n cleanupTasks.push(segmentCollection.stop)\n if (isRecordErrorSessionReplay) {\n sessionManager.sessionStateUpdateObservable.subscribe(\n ({ previousState, newState }) => {\n if (!previousState.hasError && newState.hasError) {\n isRecordErrorSessionReplay = false\n unlockSegment()\n }\n }\n )\n }\n let lastFullSnapshotEvent = null\n const wrappedEmit = (recordData) => {\n addRecord(recordData)\n if (isRecordErrorSessionReplay) {\n if (recordData.type === RecordType.FullSnapshot) {\n lastFullSnapshotEvent = recordData\n } else if (recordData.type === RecordType.IncrementalSnapshot) {\n const exceedTime =\n recordData.timestamp - lastFullSnapshotEvent.timestamp >\n BUFFER_CHECKOUT_TIME\n // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot\n if (exceedTime) {\n flushBufferSegment(() => {\n deleteOldestStats()\n takeSubsequentFullSnapshot()\n })\n }\n }\n }\n }\n _record = record({\n emit: wrappedEmit,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n } else {\n ;({ addRecord } = startRecordBridge(viewContexts))\n _record = record({\n emit: addRecord,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n }\n cleanupTasks.push(_record.stop)\n var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot\n var snapshotCanvas = _record.snapshotCanvas\n var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug\n var getLastAutoCanvasSnapshotResultForDebug =\n _record.getLastAutoCanvasSnapshotResultForDebug\n var getAutoCanvasSnapshotDebugHistoryForDebug =\n _record.getAutoCanvasSnapshotDebugHistoryForDebug\n var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug\n var getCanvasMutationHistoryForDebug =\n _record.getCanvasMutationHistoryForDebug\n var getLastDomMutationForDebug = _record.getLastDomMutationForDebug\n var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug\n var getReplayPerformanceForDebug = function () {\n return cloneReplayPerformanceForDebug(\n _record.getReplayPerformanceForDebug\n ? _record.getReplayPerformanceForDebug()\n : undefined,\n replaySegmentFlushCount\n )\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug)\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {\n return cloneReplaySegmentFlushForDebug(segmentFlush)\n })\n }\n var flushMutations = _record.flushMutations\n var subscribeViewEnded = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_ENDED,\n function () {\n flushMutations()\n addRecord({\n timestamp: timeStampNow(),\n type: RecordType.ViewEnd\n })\n }\n )\n cleanupTasks.push(subscribeViewEnded.unsubscribe)\n var scribeViewCreated = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_CREATED,\n function (view) {\n takeSubsequentFullSnapshot(view.startClocks.timeStamp)\n }\n )\n cleanupTasks.push(scribeViewCreated.unsubscribe)\n\n return {\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n },\n takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,\n snapshotCanvas: snapshotCanvas,\n getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,\n getLastAutoCanvasSnapshotResultForDebug:\n getLastAutoCanvasSnapshotResultForDebug,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n getAutoCanvasSnapshotDebugHistoryForDebug,\n getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,\n getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,\n getLastDomMutationForDebug: getLastDomMutationForDebug,\n getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,\n getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,\n getReplaySegmentFlushHistoryForDebug:\n getReplaySegmentFlushHistoryForDebug,\n getReplayPerformanceForDebug: getReplayPerformanceForDebug,\n flushReplayMutationsForDebug: flushMutations\n }\n}\n\nfunction cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {\n if (!segmentFlush) {\n return segmentFlush\n }\n\n return {\n sequence: typeof sequence === 'number' ? sequence : segmentFlush.sequence,\n creationReason: segmentFlush.creationReason,\n flushReason: segmentFlush.flushReason,\n recordsCount: segmentFlush.recordsCount,\n recordCountsByType: assign({}, segmentFlush.recordCountsByType),\n start: segmentFlush.start,\n end: segmentFlush.end,\n indexInView: segmentFlush.indexInView,\n rawBytesCount: segmentFlush.rawBytesCount\n }\n}\n\nfunction cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {\n if (!stats && typeof replaySegmentFlushCount === 'undefined') {\n return undefined\n }\n\n return assign({}, stats || {}, {\n replaySegmentFlushCount: replaySegmentFlushCount || 0\n })\n}\n"],"mappings":"AAAA,SACEA,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,EAClBC,iBAAiB,EACjBC,UAAU,EACVC,iBAAiB,EACjBC,MAAM,QACD,yBAAyB;AAChC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SACEC,sBAAsB,EACtBC,mBAAmB,QACd,oCAAoC;AAC3C,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE;AACA,OAAO,IAAMC,oBAAoB,GAAG,EAAE,GAAGT,UAAU;AACnD,IAAIU,kCAAkC,GAAG,EAAE;AAC3C,OAAO,SAASC,cAAcA,CAC5BC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,YAAY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,EAClCA,oCAAoC;IACtCJ,4BAA4B,EAAEA,4BAA4B;IAC1DkB,4BAA4B,EAAEZ;EAChC,CAAC;AACH;AAEA,SAAStC,+BAA+BA,CAACD,YAAY,EAAEoD,QAAQ,EAAE;EAC/D,IAAI,CAACpD,YAAY,EAAE;IACjB,OAAOA,YAAY;EACrB;EAEA,OAAO;IACLoD,QAAQ,EAAE,OAAOA,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGpD,YAAY,CAACoD,QAAQ;IACzEC,cAAc,EAAErD,YAAY,CAACqD,cAAc;IAC3CC,WAAW,EAAEtD,YAAY,CAACsD,WAAW;IACrCC,YAAY,EAAEvD,YAAY,CAACuD,YAAY;IACvCC,kBAAkB,EAAE7F,MAAM,CAAC,CAAC,CAAC,EAAEqC,YAAY,CAACwD,kBAAkB,CAAC;IAC/DC,KAAK,EAAEzD,YAAY,CAACyD,KAAK;IACzBC,GAAG,EAAE1D,YAAY,CAAC0D,GAAG;IACrBC,WAAW,EAAE3D,YAAY,CAAC2D,WAAW;IACrCC,aAAa,EAAE5D,YAAY,CAAC4D;EAC9B,CAAC;AACH;AAEA,SAAS1B,8BAA8BA,CAAC2B,KAAK,EAAE/E,uBAAuB,EAAE;EACtE,IAAI,CAAC+E,KAAK,IAAI,OAAO/E,uBAAuB,KAAK,WAAW,EAAE;IAC5D,OAAOqD,SAAS;EAClB;EAEA,OAAOxE,MAAM,CAAC,CAAC,CAAC,EAAEkG,KAAK,IAAI,CAAC,CAAC,EAAE;IAC7B/E,uBAAuB,EAAEA,uBAAuB,IAAI;EACtD,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"startRecording.js","names":["timeStampNow","createHttpRequest","LifeCycleEventType","PageExitReason","addTelemetryDebug","ONE_SECOND","canUseEventBridge","assign","record","startRecordBridge","startSegmentCollection","SEGMENT_BYTES_LIMIT","RecordType","deleteOldestStats","BUFFER_CHECKOUT_TIME","REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT","startRecording","lifeCycle","configuration","sessionManager","viewContexts","encoder","httpRequest","onStopped","createHttpRequestOverride","recordOverride","createHttpRequestImpl","__BUILD_ENV__REPLAY_DEBUG_ENABLED__","recordImpl","cleanupTasks","isRecordingStopped","isRecordingReady","pendingStopRequested","pendingStopReason","stoppedNotificationSent","flushRecorderBeforePageExit","replayResetRequestedBeforeRecorder","requestReplayReset","notifyStopped","flushReason","error","reason","String","stopRecording","firstCleanupError","slice","reverse","forEach","task","lastReplaySegmentFlushForDebug","replaySegmentFlushHistoryForDebug","undefined","replaySegmentFlushCount","replayResetCountForDebug","replayResetLastReasonForDebug","areReplaySegmentsLockedForDebug","reportError","notify","RAW_ERROR_COLLECTED","message","replayRequest","$rReplayRequest","sessionReplayEndPoint","retryMaxSize","addRecord","addBaselineRecords","_record","stopSegmentCollection","beginMandatoryFullSnapshotRecovery","discardMandatoryFullSnapshotRecovery","wasLastEmitBackpressured","session","findTrackedSession","isRecordErrorSessionReplay","errorSessionReplayAllowed","sessionHasError","segmentCollection","beforePageExitFlush","pageExitEvent","onReplayResetNeeded","onReplayResetExhausted","onSegmentFlushed","segmentFlush","cloneReplaySegmentFlushForDebug","push","length","shift","$rAddBaselineRecords","$rWasLastAddRecordBackpressured","$rBeginMandatoryRecovery","$rDiscardMandatoryRecovery","flushBufferSegment","unlockSegment","isLocked","stop","sessionStateUpdateSubscription","sessionStateUpdateObservable","subscribe","_ref","previousState","newState","hasError","unsubscribe","lastFullSnapshotEvent","wrappedEmit","recordData","accepted","type","FullSnapshot","IncrementalSnapshot","exceedTime","timestamp","takeSubsequentFullSnapshot","wrappedEmitBaseline","records","emit","$rEmitBaseline","$rWasLastEmitBackpressured","$rOnMandatoryFullSnapshotStarted","$rOnMandatoryFullSnapshotAbandoned","onFullSnapshotFailure","_startRecordBridge","Error","stopRecorder","provisionalCleanupIndex","indexOf","splice","flushScheduledFullSnapshot","flushCanvasCommands","$rFlushCanvasCommands","UNLOADING","flushMutations","createReplayResetScheduler","scheduleSubsequentFullSnapshot","prepareForViewChange","snapshotCanvas","getSerializedNodeIdForDebug","recordingDebug","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getReplayPerformanceForDebug","cloneReplayPerformanceForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","map","subscribeViewEnded","VIEW_ENDED","ViewEnd","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","recording","isStopped","flushReplayMutationsForDebug","stopped","pending","lastResetAt","Infinity","resetTimeoutId","RESET_MIN_INTERVAL","runReset","Date","now","clearTimeout","delay","Math","max","setTimeout","sequence","creationReason","recordsCount","recordCountsByType","start","end","indexInView","rawBytesCount","stats","replayResetCount","replayResetLastReason","replaySegmentsLocked","Boolean"],"sources":["../../src/boot/startRecording.js"],"mappings":"AAAA,SACEA,YAAY,EACZC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,EACdC,iBAAiB,EACjBC,UAAU,EACVC,iBAAiB,EACjBC,MAAM,QACD,yBAAyB;AAChC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SACEC,sBAAsB,EACtBC,mBAAmB,QACd,oCAAoC;AAC3C,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE;AACA,OAAO,IAAMC,oBAAoB,GAAG,EAAE,GAAGT,UAAU;AACnD,IAAIU,kCAAkC,GAAG,EAAE;AAE3C,OAAO,SAASC,cAAcA,CAC5BC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,yBAAyB,EACzBC,cAAc,EACd;EACA,IAAIC,qBAAqB,GAAGC,mCAAmC,GAC3DH,yBAAyB,IAAIvB,iBAAiB,GAC9CA,iBAAiB;EACrB,IA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BAAqB,EAAEA,qBAAqB;IAC5CC,oBAAoB,EAAEC,OAAO,CAACD,oBAAoB;EACpD,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["DefaultPrivacyLevel","NodePrivacyLevel","IGNORE","HIDDEN","ALLOW","MASK","MASK_USER_INPUT","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_ALLOW","PRIVACY_ATTR_VALUE_MASK","PRIVACY_ATTR_VALUE_MASK_USER_INPUT","PRIVACY_ATTR_VALUE_HIDDEN","PRIVACY_CLASS_ALLOW","PRIVACY_CLASS_MASK","PRIVACY_CLASS_MASK_USER_INPUT","PRIVACY_CLASS_HIDDEN","CENSORED_STRING_MARK","CENSORED_IMG_MARK","FORM_PRIVATE_TAG_NAMES","INPUT","OUTPUT","TEXTAREA","SELECT","OPTION","DATALIST","OPTGROUP"],"sources":["../src/constants.js"],"sourcesContent":["import { DefaultPrivacyLevel } from '@cloudcare/browser-core'\nexport var NodePrivacyLevel = {\n IGNORE: 'ignore',\n HIDDEN: 'hidden',\n ALLOW: DefaultPrivacyLevel.ALLOW,\n MASK: DefaultPrivacyLevel.MASK,\n MASK_USER_INPUT: DefaultPrivacyLevel.MASK_USER_INPUT\n}\n\nexport var PRIVACY_ATTR_NAME = 'data-gc-privacy'\n\n// Privacy Attrs\nexport var PRIVACY_ATTR_VALUE_ALLOW = 'allow'\nexport var PRIVACY_ATTR_VALUE_MASK = 'mask'\nexport var PRIVACY_ATTR_VALUE_MASK_USER_INPUT = 'mask-user-input'\nexport var PRIVACY_ATTR_VALUE_HIDDEN = 'hidden'\n\n// Privacy Classes - not all customers can set plain HTML attributes, so support classes too\nexport var PRIVACY_CLASS_ALLOW = 'gc-privacy-allow'\nexport var PRIVACY_CLASS_MASK = 'gc-privacy-mask'\nexport var PRIVACY_CLASS_MASK_USER_INPUT = 'gc-privacy-mask-user-input'\nexport var PRIVACY_CLASS_HIDDEN = 'gc-privacy-hidden'\n\n// Private Replacement Templates\nexport var CENSORED_STRING_MARK = '***'\nexport var CENSORED_IMG_MARK =\n 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='\n\nexport var FORM_PRIVATE_TAG_NAMES = {\n INPUT: true,\n OUTPUT: true,\n TEXTAREA: true,\n SELECT: true,\n OPTION: true,\n DATALIST: true,\n OPTGROUP: true\n}\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,OAAO,IAAIC,gBAAgB,GAAG;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAEJ,mBAAmB,CAACI,KAAK;EAChCC,IAAI,EAAEL,mBAAmB,CAACK,IAAI;EAC9BC,eAAe,EAAEN,mBAAmB,CAACM;AACvC,CAAC;AAED,OAAO,IAAIC,iBAAiB,GAAG,iBAAiB;;AAEhD;AACA,OAAO,IAAIC,wBAAwB,GAAG,OAAO;AAC7C,OAAO,IAAIC,uBAAuB,GAAG,MAAM;AAC3C,OAAO,IAAIC,kCAAkC,GAAG,iBAAiB;AACjE,OAAO,IAAIC,yBAAyB,GAAG,QAAQ;;AAE/C;AACA,OAAO,IAAIC,mBAAmB,GAAG,kBAAkB;AACnD,OAAO,IAAIC,kBAAkB,GAAG,iBAAiB;AACjD,OAAO,IAAIC,6BAA6B,GAAG,4BAA4B;AACvE,OAAO,IAAIC,oBAAoB,GAAG,mBAAmB;;AAErD;AACA,OAAO,IAAIC,oBAAoB,GAAG,KAAK;AACvC,OAAO,IAAIC,iBAAiB,GAC1B,oFAAoF;AAEtF,OAAO,IAAIC,sBAAsB,GAAG;EAClCC,KAAK,EAAE,IAAI;EACXC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE;AACZ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["DefaultPrivacyLevel","NodePrivacyLevel","IGNORE","HIDDEN","ALLOW","MASK","MASK_USER_INPUT","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_ALLOW","PRIVACY_ATTR_VALUE_MASK","PRIVACY_ATTR_VALUE_MASK_USER_INPUT","PRIVACY_ATTR_VALUE_HIDDEN","PRIVACY_CLASS_ALLOW","PRIVACY_CLASS_MASK","PRIVACY_CLASS_MASK_USER_INPUT","PRIVACY_CLASS_HIDDEN","CENSORED_STRING_MARK","CENSORED_IMG_MARK","FORM_PRIVATE_TAG_NAMES","INPUT","OUTPUT","TEXTAREA","SELECT","OPTION","DATALIST","OPTGROUP"],"sources":["../src/constants.js"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,OAAO,IAAIC,gBAAgB,GAAG;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAEJ,mBAAmB,CAACI,KAAK;EAChCC,IAAI,EAAEL,mBAAmB,CAACK,IAAI;EAC9BC,eAAe,EAAEN,mBAAmB,CAACM;AACvC,CAAC;AAED,OAAO,IAAIC,iBAAiB,GAAG,iBAAiB;;AAEhD;AACA,OAAO,IAAIC,wBAAwB,GAAG,OAAO;AAC7C,OAAO,IAAIC,uBAAuB,GAAG,MAAM;AAC3C,OAAO,IAAIC,kCAAkC,GAAG,iBAAiB;AACjE,OAAO,IAAIC,yBAAyB,GAAG,QAAQ;;AAE/C;AACA,OAAO,IAAIC,mBAAmB,GAAG,kBAAkB;AACnD,OAAO,IAAIC,kBAAkB,GAAG,iBAAiB;AACjD,OAAO,IAAIC,6BAA6B,GAAG,4BAA4B;AACvE,OAAO,IAAIC,oBAAoB,GAAG,mBAAmB;;AAErD;AACA,OAAO,IAAIC,oBAAoB,GAAG,KAAK;AACvC,OAAO,IAAIC,iBAAiB,GAC1B,oFAAoF;AAEtF,OAAO,IAAIC,sBAAsB,GAAG;EAClCC,KAAK,EAAE,IAAI;EACXC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE;AACZ,CAAC","ignoreList":[]}
@@ -1,9 +1,3 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
1
  import { extend2Lev, withSnakeCaseKeys, timeStampNow, isEmptyObject, LifeCycleEventType, RumEventType, deviceInfo, currentDrift, createEventRateLimiter, limitModification, display, assign, round } from '@cloudcare/browser-core';
8
2
  var SessionType = {
9
3
  SYNTHETICS: 'synthetics',
@@ -22,7 +16,7 @@ var ROOT_MODIFIABLE_FIELD_PATHS = {
22
16
  };
23
17
  var modifiableFieldPathsByEvent = {};
24
18
  export function startRumAssembly(configuration, lifeCycle, sessionManager, userSessionManager, viewContexts, urlContexts, actionContexts, displayContext, getCommonContext, reportError) {
25
- modifiableFieldPathsByEvent[RumEventType.VIEW] = _objectSpread(_objectSpread({}, USER_CUSTOMIZABLE_FIELD_PATHS), VIEW_MODIFIABLE_FIELD_PATHS);
19
+ modifiableFieldPathsByEvent[RumEventType.VIEW] = assign({}, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS);
26
20
  modifiableFieldPathsByEvent[RumEventType.ERROR] = assign({
27
21
  'error.message': 'string',
28
22
  'error.stack': 'string',