@depup/datadog__browser-rum 6.31.0-depup.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 (688) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +25 -0
  3. package/bundle/chunks/profiler-9f1c1103f1ef0aa98257-datadog-rum.js +1 -0
  4. package/bundle/chunks/recorder-926b641c6ef51d09a378-datadog-rum.js +1 -0
  5. package/bundle/datadog-rum.js +1 -0
  6. package/changes.json +5 -0
  7. package/cjs/boot/isBrowserSupported.d.ts +4 -0
  8. package/cjs/boot/isBrowserSupported.js +17 -0
  9. package/cjs/boot/isBrowserSupported.js.map +1 -0
  10. package/cjs/boot/lazyLoadProfiler.d.ts +3 -0
  11. package/cjs/boot/lazyLoadProfiler.js +56 -0
  12. package/cjs/boot/lazyLoadProfiler.js.map +1 -0
  13. package/cjs/boot/lazyLoadRecorder.d.ts +3 -0
  14. package/cjs/boot/lazyLoadRecorder.js +56 -0
  15. package/cjs/boot/lazyLoadRecorder.js.map +1 -0
  16. package/cjs/boot/postStartStrategy.d.ts +33 -0
  17. package/cjs/boot/postStartStrategy.js +98 -0
  18. package/cjs/boot/postStartStrategy.js.map +1 -0
  19. package/cjs/boot/preStartStrategy.d.ts +6 -0
  20. package/cjs/boot/preStartStrategy.js +24 -0
  21. package/cjs/boot/preStartStrategy.js.map +1 -0
  22. package/cjs/boot/profilerApi.d.ts +2 -0
  23. package/cjs/boot/profilerApi.js +52 -0
  24. package/cjs/boot/profilerApi.js.map +1 -0
  25. package/cjs/boot/recorderApi.d.ts +3 -0
  26. package/cjs/boot/recorderApi.js +71 -0
  27. package/cjs/boot/recorderApi.js.map +1 -0
  28. package/cjs/boot/startRecording.d.ts +6 -0
  29. package/cjs/boot/startRecording.js +45 -0
  30. package/cjs/boot/startRecording.js.map +1 -0
  31. package/cjs/domain/deflate/deflateEncoder.d.ts +3 -0
  32. package/cjs/domain/deflate/deflateEncoder.js +110 -0
  33. package/cjs/domain/deflate/deflateEncoder.js.map +1 -0
  34. package/cjs/domain/deflate/deflateWorker.d.ts +29 -0
  35. package/cjs/domain/deflate/deflateWorker.js +105 -0
  36. package/cjs/domain/deflate/deflateWorker.js.map +1 -0
  37. package/cjs/domain/deflate/index.d.ts +3 -0
  38. package/cjs/domain/deflate/index.js +11 -0
  39. package/cjs/domain/deflate/index.js.map +1 -0
  40. package/cjs/domain/getSessionReplayLink.d.ts +2 -0
  41. package/cjs/domain/getSessionReplayLink.js +35 -0
  42. package/cjs/domain/getSessionReplayLink.js.map +1 -0
  43. package/cjs/domain/profiling/actionHistory.d.ts +10 -0
  44. package/cjs/domain/profiling/actionHistory.js +49 -0
  45. package/cjs/domain/profiling/actionHistory.js.map +1 -0
  46. package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
  47. package/cjs/domain/profiling/longTaskHistory.js +28 -0
  48. package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
  49. package/cjs/domain/profiling/profiler.d.ts +7 -0
  50. package/cjs/domain/profiling/profiler.js +267 -0
  51. package/cjs/domain/profiling/profiler.js.map +1 -0
  52. package/cjs/domain/profiling/profilingContext.d.ts +6 -0
  53. package/cjs/domain/profiling/profilingContext.js +31 -0
  54. package/cjs/domain/profiling/profilingContext.js.map +1 -0
  55. package/cjs/domain/profiling/profilingSupported.d.ts +1 -0
  56. package/cjs/domain/profiling/profilingSupported.js +11 -0
  57. package/cjs/domain/profiling/profilingSupported.js.map +1 -0
  58. package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
  59. package/cjs/domain/profiling/test-utils/mockedTrace.js +57 -0
  60. package/cjs/domain/profiling/test-utils/mockedTrace.js.map +1 -0
  61. package/cjs/domain/profiling/transport/assembly.d.ts +7 -0
  62. package/cjs/domain/profiling/transport/assembly.js +45 -0
  63. package/cjs/domain/profiling/transport/assembly.js.map +1 -0
  64. package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
  65. package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +63 -0
  66. package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
  67. package/cjs/domain/profiling/types/index.d.ts +2 -0
  68. package/cjs/domain/profiling/types/index.js +3 -0
  69. package/cjs/domain/profiling/types/index.js.map +1 -0
  70. package/cjs/domain/profiling/types/profilerApi.types.d.ts +58 -0
  71. package/cjs/domain/profiling/types/profilerApi.types.js +5 -0
  72. package/cjs/domain/profiling/types/profilerApi.types.js.map +1 -0
  73. package/cjs/domain/profiling/types/rumProfiler.types.d.ts +55 -0
  74. package/cjs/domain/profiling/types/rumProfiler.types.js +3 -0
  75. package/cjs/domain/profiling/types/rumProfiler.types.js.map +1 -0
  76. package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
  77. package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +7 -0
  78. package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
  79. package/cjs/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
  80. package/cjs/domain/profiling/utils/getDefaultViewName.js +14 -0
  81. package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -0
  82. package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
  83. package/cjs/domain/profiling/utils/getNumberOfSamples.js +19 -0
  84. package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
  85. package/cjs/domain/profiling/vitalHistory.d.ts +10 -0
  86. package/cjs/domain/profiling/vitalHistory.js +42 -0
  87. package/cjs/domain/profiling/vitalHistory.js.map +1 -0
  88. package/cjs/domain/record/assembly.d.ts +3 -0
  89. package/cjs/domain/record/assembly.js +16 -0
  90. package/cjs/domain/record/assembly.js.map +1 -0
  91. package/cjs/domain/record/elementsScrollPositions.d.ts +10 -0
  92. package/cjs/domain/record/elementsScrollPositions.js +23 -0
  93. package/cjs/domain/record/elementsScrollPositions.js.map +1 -0
  94. package/cjs/domain/record/eventsUtils.d.ts +2 -0
  95. package/cjs/domain/record/eventsUtils.js +15 -0
  96. package/cjs/domain/record/eventsUtils.js.map +1 -0
  97. package/cjs/domain/record/index.d.ts +6 -0
  98. package/cjs/domain/record/index.js +17 -0
  99. package/cjs/domain/record/index.js.map +1 -0
  100. package/cjs/domain/record/internalApi.d.ts +22 -0
  101. package/cjs/domain/record/internalApi.js +55 -0
  102. package/cjs/domain/record/internalApi.js.map +1 -0
  103. package/cjs/domain/record/itemIds.d.ts +40 -0
  104. package/cjs/domain/record/itemIds.js +58 -0
  105. package/cjs/domain/record/itemIds.js.map +1 -0
  106. package/cjs/domain/record/mutationBatch.d.ts +12 -0
  107. package/cjs/domain/record/mutationBatch.js +44 -0
  108. package/cjs/domain/record/mutationBatch.js.map +1 -0
  109. package/cjs/domain/record/record.d.ts +16 -0
  110. package/cjs/domain/record/record.js +88 -0
  111. package/cjs/domain/record/record.js.map +1 -0
  112. package/cjs/domain/record/record.types.d.ts +18 -0
  113. package/cjs/domain/record/record.types.js +3 -0
  114. package/cjs/domain/record/record.types.js.map +1 -0
  115. package/cjs/domain/record/recordingScope.d.ts +24 -0
  116. package/cjs/domain/record/recordingScope.js +29 -0
  117. package/cjs/domain/record/recordingScope.js.map +1 -0
  118. package/cjs/domain/record/serialization/changeEncoder.d.ts +22 -0
  119. package/cjs/domain/record/serialization/changeEncoder.js +59 -0
  120. package/cjs/domain/record/serialization/changeEncoder.js.map +1 -0
  121. package/cjs/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
  122. package/cjs/domain/record/serialization/conversions/changeConverter.js +216 -0
  123. package/cjs/domain/record/serialization/conversions/changeConverter.js.map +1 -0
  124. package/cjs/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
  125. package/cjs/domain/record/serialization/conversions/changeDecoder.js +137 -0
  126. package/cjs/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
  127. package/cjs/domain/record/serialization/conversions/index.d.ts +7 -0
  128. package/cjs/domain/record/serialization/conversions/index.js +11 -0
  129. package/cjs/domain/record/serialization/conversions/index.js.map +1 -0
  130. package/cjs/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
  131. package/cjs/domain/record/serialization/conversions/mutationLog.js +36 -0
  132. package/cjs/domain/record/serialization/conversions/mutationLog.js.map +1 -0
  133. package/cjs/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
  134. package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js +53 -0
  135. package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
  136. package/cjs/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
  137. package/cjs/domain/record/serialization/conversions/renderOptions.js +12 -0
  138. package/cjs/domain/record/serialization/conversions/renderOptions.js.map +1 -0
  139. package/cjs/domain/record/serialization/conversions/stringTable.d.ts +5 -0
  140. package/cjs/domain/record/serialization/conversions/stringTable.js +22 -0
  141. package/cjs/domain/record/serialization/conversions/stringTable.js.map +1 -0
  142. package/cjs/domain/record/serialization/conversions/vDocument.d.ts +23 -0
  143. package/cjs/domain/record/serialization/conversions/vDocument.js +176 -0
  144. package/cjs/domain/record/serialization/conversions/vDocument.js.map +1 -0
  145. package/cjs/domain/record/serialization/conversions/vNode.d.ts +66 -0
  146. package/cjs/domain/record/serialization/conversions/vNode.js +285 -0
  147. package/cjs/domain/record/serialization/conversions/vNode.js.map +1 -0
  148. package/cjs/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
  149. package/cjs/domain/record/serialization/conversions/vStyleSheet.js +29 -0
  150. package/cjs/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
  151. package/cjs/domain/record/serialization/experimentalFeatures.d.ts +2 -0
  152. package/cjs/domain/record/serialization/experimentalFeatures.js +16 -0
  153. package/cjs/domain/record/serialization/experimentalFeatures.js.map +1 -0
  154. package/cjs/domain/record/serialization/index.d.ts +17 -0
  155. package/cjs/domain/record/serialization/index.js +37 -0
  156. package/cjs/domain/record/serialization/index.js.map +1 -0
  157. package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
  158. package/cjs/domain/record/serialization/insertionCursor.js +68 -0
  159. package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
  160. package/cjs/domain/record/serialization/serialization.types.d.ts +24 -0
  161. package/cjs/domain/record/serialization/serialization.types.js +3 -0
  162. package/cjs/domain/record/serialization/serialization.types.js.map +1 -0
  163. package/cjs/domain/record/serialization/serializationStats.d.ts +12 -0
  164. package/cjs/domain/record/serialization/serializationStats.js +32 -0
  165. package/cjs/domain/record/serialization/serializationStats.js.map +1 -0
  166. package/cjs/domain/record/serialization/serializationTransaction.d.ts +96 -0
  167. package/cjs/domain/record/serialization/serializationTransaction.js +103 -0
  168. package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -0
  169. package/cjs/domain/record/serialization/serializationUtils.d.ts +18 -0
  170. package/cjs/domain/record/serialization/serializationUtils.js +88 -0
  171. package/cjs/domain/record/serialization/serializationUtils.js.map +1 -0
  172. package/cjs/domain/record/serialization/serializeAttribute.d.ts +4 -0
  173. package/cjs/domain/record/serialization/serializeAttribute.js +42 -0
  174. package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -0
  175. package/cjs/domain/record/serialization/serializeAttributes.d.ts +7 -0
  176. package/cjs/domain/record/serialization/serializeAttributes.js +167 -0
  177. package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -0
  178. package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
  179. package/cjs/domain/record/serialization/serializeFullSnapshot.js +34 -0
  180. package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
  181. package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
  182. package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js +13 -0
  183. package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
  184. package/cjs/domain/record/serialization/serializeMutations.d.ts +11 -0
  185. package/cjs/domain/record/serialization/serializeMutations.js +262 -0
  186. package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
  187. package/cjs/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
  188. package/cjs/domain/record/serialization/serializeMutationsAsChange.js +204 -0
  189. package/cjs/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
  190. package/cjs/domain/record/serialization/serializeNode.d.ts +7 -0
  191. package/cjs/domain/record/serialization/serializeNode.js +154 -0
  192. package/cjs/domain/record/serialization/serializeNode.js.map +1 -0
  193. package/cjs/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
  194. package/cjs/domain/record/serialization/serializeNodeAsChange.js +153 -0
  195. package/cjs/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
  196. package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
  197. package/cjs/domain/record/serialization/serializeStyleSheets.js +30 -0
  198. package/cjs/domain/record/serialization/serializeStyleSheets.js.map +1 -0
  199. package/cjs/domain/record/serializationVerifier.d.ts +18 -0
  200. package/cjs/domain/record/serializationVerifier.js +126 -0
  201. package/cjs/domain/record/serializationVerifier.js.map +1 -0
  202. package/cjs/domain/record/shadowRootsController.d.ts +11 -0
  203. package/cjs/domain/record/shadowRootsController.js +45 -0
  204. package/cjs/domain/record/shadowRootsController.js.map +1 -0
  205. package/cjs/domain/record/startFullSnapshots.d.ts +10 -0
  206. package/cjs/domain/record/startFullSnapshots.js +50 -0
  207. package/cjs/domain/record/startFullSnapshots.js.map +1 -0
  208. package/cjs/domain/record/trackers/index.d.ts +12 -0
  209. package/cjs/domain/record/trackers/index.js +27 -0
  210. package/cjs/domain/record/trackers/index.js.map +1 -0
  211. package/cjs/domain/record/trackers/trackFocus.d.ts +5 -0
  212. package/cjs/domain/record/trackers/trackFocus.js +15 -0
  213. package/cjs/domain/record/trackers/trackFocus.js.map +1 -0
  214. package/cjs/domain/record/trackers/trackFrustration.d.ts +6 -0
  215. package/cjs/domain/record/trackers/trackFrustration.js +31 -0
  216. package/cjs/domain/record/trackers/trackFrustration.js.map +1 -0
  217. package/cjs/domain/record/trackers/trackInput.d.ts +4 -0
  218. package/cjs/domain/record/trackers/trackInput.js +104 -0
  219. package/cjs/domain/record/trackers/trackInput.js.map +1 -0
  220. package/cjs/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
  221. package/cjs/domain/record/trackers/trackMediaInteraction.js +29 -0
  222. package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -0
  223. package/cjs/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
  224. package/cjs/domain/record/trackers/trackMouseInteraction.js +59 -0
  225. package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -0
  226. package/cjs/domain/record/trackers/trackMove.d.ts +9 -0
  227. package/cjs/domain/record/trackers/trackMove.js +55 -0
  228. package/cjs/domain/record/trackers/trackMove.js.map +1 -0
  229. package/cjs/domain/record/trackers/trackMutation.d.ts +13 -0
  230. package/cjs/domain/record/trackers/trackMutation.js +41 -0
  231. package/cjs/domain/record/trackers/trackMutation.js.map +1 -0
  232. package/cjs/domain/record/trackers/trackScroll.d.ts +5 -0
  233. package/cjs/domain/record/trackers/trackScroll.js +48 -0
  234. package/cjs/domain/record/trackers/trackScroll.js.map +1 -0
  235. package/cjs/domain/record/trackers/trackStyleSheet.d.ts +6 -0
  236. package/cjs/domain/record/trackers/trackStyleSheet.js +89 -0
  237. package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -0
  238. package/cjs/domain/record/trackers/trackViewEnd.d.ts +5 -0
  239. package/cjs/domain/record/trackers/trackViewEnd.js +20 -0
  240. package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -0
  241. package/cjs/domain/record/trackers/trackViewportResize.d.ts +6 -0
  242. package/cjs/domain/record/trackers/trackViewportResize.js +46 -0
  243. package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -0
  244. package/cjs/domain/record/trackers/tracker.types.d.ts +3 -0
  245. package/cjs/domain/record/trackers/tracker.types.js +3 -0
  246. package/cjs/domain/record/trackers/tracker.types.js.map +1 -0
  247. package/cjs/domain/record/viewports.d.ts +20 -0
  248. package/cjs/domain/record/viewports.js +60 -0
  249. package/cjs/domain/record/viewports.js.map +1 -0
  250. package/cjs/domain/replayStats.d.ts +8 -0
  251. package/cjs/domain/replayStats.js +60 -0
  252. package/cjs/domain/replayStats.js.map +1 -0
  253. package/cjs/domain/scriptLoadingError.d.ts +6 -0
  254. package/cjs/domain/scriptLoadingError.js +26 -0
  255. package/cjs/domain/scriptLoadingError.js.map +1 -0
  256. package/cjs/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
  257. package/cjs/domain/segmentCollection/buildReplayPayload.js +26 -0
  258. package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -0
  259. package/cjs/domain/segmentCollection/index.d.ts +4 -0
  260. package/cjs/domain/segmentCollection/index.js +11 -0
  261. package/cjs/domain/segmentCollection/index.js.map +1 -0
  262. package/cjs/domain/segmentCollection/segment.d.ts +16 -0
  263. package/cjs/domain/segmentCollection/segment.js +82 -0
  264. package/cjs/domain/segmentCollection/segment.js.map +1 -0
  265. package/cjs/domain/segmentCollection/segmentCollection.d.ts +31 -0
  266. package/cjs/domain/segmentCollection/segmentCollection.js +113 -0
  267. package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -0
  268. package/cjs/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
  269. package/cjs/domain/segmentCollection/startSegmentTelemetry.js +52 -0
  270. package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
  271. package/cjs/domain/startRecordBridge.d.ts +5 -0
  272. package/cjs/domain/startRecordBridge.js +17 -0
  273. package/cjs/domain/startRecordBridge.js.map +1 -0
  274. package/cjs/domain/startRecorderInitTelemetry.d.ts +15 -0
  275. package/cjs/domain/startRecorderInitTelemetry.js +55 -0
  276. package/cjs/domain/startRecorderInitTelemetry.js.map +1 -0
  277. package/cjs/entries/internal.d.ts +11 -0
  278. package/cjs/entries/internal.js +28 -0
  279. package/cjs/entries/internal.js.map +1 -0
  280. package/cjs/entries/internalSynthetics.d.ts +2 -0
  281. package/cjs/entries/internalSynthetics.js +27 -0
  282. package/cjs/entries/internalSynthetics.js.map +1 -0
  283. package/cjs/entries/main.d.ts +23 -0
  284. package/cjs/entries/main.js +35 -0
  285. package/cjs/entries/main.js.map +1 -0
  286. package/cjs/types/index.d.ts +3 -0
  287. package/cjs/types/index.js +18 -0
  288. package/cjs/types/index.js.map +1 -0
  289. package/cjs/types/profiling.d.ts +296 -0
  290. package/cjs/types/profiling.js +6 -0
  291. package/cjs/types/profiling.js.map +1 -0
  292. package/cjs/types/sessionReplay.d.ts +934 -0
  293. package/cjs/types/sessionReplay.js +6 -0
  294. package/cjs/types/sessionReplay.js.map +1 -0
  295. package/cjs/types/sessionReplayConstants.d.ts +71 -0
  296. package/cjs/types/sessionReplayConstants.js +67 -0
  297. package/cjs/types/sessionReplayConstants.js.map +1 -0
  298. package/esm/boot/isBrowserSupported.d.ts +4 -0
  299. package/esm/boot/isBrowserSupported.js +14 -0
  300. package/esm/boot/isBrowserSupported.js.map +1 -0
  301. package/esm/boot/lazyLoadProfiler.d.ts +3 -0
  302. package/esm/boot/lazyLoadProfiler.js +19 -0
  303. package/esm/boot/lazyLoadProfiler.js.map +1 -0
  304. package/esm/boot/lazyLoadRecorder.d.ts +3 -0
  305. package/esm/boot/lazyLoadRecorder.js +19 -0
  306. package/esm/boot/lazyLoadRecorder.js.map +1 -0
  307. package/esm/boot/postStartStrategy.d.ts +33 -0
  308. package/esm/boot/postStartStrategy.js +95 -0
  309. package/esm/boot/postStartStrategy.js.map +1 -0
  310. package/esm/boot/preStartStrategy.d.ts +6 -0
  311. package/esm/boot/preStartStrategy.js +21 -0
  312. package/esm/boot/preStartStrategy.js.map +1 -0
  313. package/esm/boot/profilerApi.d.ts +2 -0
  314. package/esm/boot/profilerApi.js +49 -0
  315. package/esm/boot/profilerApi.js.map +1 -0
  316. package/esm/boot/recorderApi.d.ts +3 -0
  317. package/esm/boot/recorderApi.js +68 -0
  318. package/esm/boot/recorderApi.js.map +1 -0
  319. package/esm/boot/startRecording.d.ts +6 -0
  320. package/esm/boot/startRecording.js +42 -0
  321. package/esm/boot/startRecording.js.map +1 -0
  322. package/esm/domain/deflate/deflateEncoder.d.ts +3 -0
  323. package/esm/domain/deflate/deflateEncoder.js +107 -0
  324. package/esm/domain/deflate/deflateEncoder.js.map +1 -0
  325. package/esm/domain/deflate/deflateWorker.d.ts +29 -0
  326. package/esm/domain/deflate/deflateWorker.js +97 -0
  327. package/esm/domain/deflate/deflateWorker.js.map +1 -0
  328. package/esm/domain/deflate/index.d.ts +3 -0
  329. package/esm/domain/deflate/index.js +3 -0
  330. package/esm/domain/deflate/index.js.map +1 -0
  331. package/esm/domain/getSessionReplayLink.d.ts +2 -0
  332. package/esm/domain/getSessionReplayLink.js +32 -0
  333. package/esm/domain/getSessionReplayLink.js.map +1 -0
  334. package/esm/domain/profiling/actionHistory.d.ts +10 -0
  335. package/esm/domain/profiling/actionHistory.js +45 -0
  336. package/esm/domain/profiling/actionHistory.js.map +1 -0
  337. package/esm/domain/profiling/longTaskHistory.d.ts +11 -0
  338. package/esm/domain/profiling/longTaskHistory.js +24 -0
  339. package/esm/domain/profiling/longTaskHistory.js.map +1 -0
  340. package/esm/domain/profiling/profiler.d.ts +7 -0
  341. package/esm/domain/profiling/profiler.js +263 -0
  342. package/esm/domain/profiling/profiler.js.map +1 -0
  343. package/esm/domain/profiling/profilingContext.d.ts +6 -0
  344. package/esm/domain/profiling/profilingContext.js +28 -0
  345. package/esm/domain/profiling/profilingContext.js.map +1 -0
  346. package/esm/domain/profiling/profilingSupported.d.ts +1 -0
  347. package/esm/domain/profiling/profilingSupported.js +8 -0
  348. package/esm/domain/profiling/profilingSupported.js.map +1 -0
  349. package/esm/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
  350. package/esm/domain/profiling/test-utils/mockedTrace.js +54 -0
  351. package/esm/domain/profiling/test-utils/mockedTrace.js.map +1 -0
  352. package/esm/domain/profiling/transport/assembly.d.ts +7 -0
  353. package/esm/domain/profiling/transport/assembly.js +42 -0
  354. package/esm/domain/profiling/transport/assembly.js.map +1 -0
  355. package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
  356. package/esm/domain/profiling/transport/buildProfileEventAttributes.js +60 -0
  357. package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
  358. package/esm/domain/profiling/types/index.d.ts +2 -0
  359. package/esm/domain/profiling/types/index.js +2 -0
  360. package/esm/domain/profiling/types/index.js.map +1 -0
  361. package/esm/domain/profiling/types/profilerApi.types.d.ts +58 -0
  362. package/esm/domain/profiling/types/profilerApi.types.js +4 -0
  363. package/esm/domain/profiling/types/profilerApi.types.js.map +1 -0
  364. package/esm/domain/profiling/types/rumProfiler.types.d.ts +55 -0
  365. package/esm/domain/profiling/types/rumProfiler.types.js +2 -0
  366. package/esm/domain/profiling/types/rumProfiler.types.js.map +1 -0
  367. package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
  368. package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +3 -0
  369. package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
  370. package/esm/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
  371. package/esm/domain/profiling/utils/getDefaultViewName.js +11 -0
  372. package/esm/domain/profiling/utils/getDefaultViewName.js.map +1 -0
  373. package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
  374. package/esm/domain/profiling/utils/getNumberOfSamples.js +16 -0
  375. package/esm/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
  376. package/esm/domain/profiling/vitalHistory.d.ts +10 -0
  377. package/esm/domain/profiling/vitalHistory.js +38 -0
  378. package/esm/domain/profiling/vitalHistory.js.map +1 -0
  379. package/esm/domain/record/assembly.d.ts +3 -0
  380. package/esm/domain/record/assembly.js +13 -0
  381. package/esm/domain/record/assembly.js.map +1 -0
  382. package/esm/domain/record/elementsScrollPositions.d.ts +10 -0
  383. package/esm/domain/record/elementsScrollPositions.js +20 -0
  384. package/esm/domain/record/elementsScrollPositions.js.map +1 -0
  385. package/esm/domain/record/eventsUtils.d.ts +2 -0
  386. package/esm/domain/record/eventsUtils.js +11 -0
  387. package/esm/domain/record/eventsUtils.js.map +1 -0
  388. package/esm/domain/record/index.d.ts +6 -0
  389. package/esm/domain/record/index.js +5 -0
  390. package/esm/domain/record/index.js.map +1 -0
  391. package/esm/domain/record/internalApi.d.ts +22 -0
  392. package/esm/domain/record/internalApi.js +51 -0
  393. package/esm/domain/record/internalApi.js.map +1 -0
  394. package/esm/domain/record/itemIds.d.ts +40 -0
  395. package/esm/domain/record/itemIds.js +52 -0
  396. package/esm/domain/record/itemIds.js.map +1 -0
  397. package/esm/domain/record/mutationBatch.d.ts +12 -0
  398. package/esm/domain/record/mutationBatch.js +40 -0
  399. package/esm/domain/record/mutationBatch.js.map +1 -0
  400. package/esm/domain/record/record.d.ts +16 -0
  401. package/esm/domain/record/record.js +52 -0
  402. package/esm/domain/record/record.js.map +1 -0
  403. package/esm/domain/record/record.types.d.ts +18 -0
  404. package/esm/domain/record/record.types.js +2 -0
  405. package/esm/domain/record/record.types.js.map +1 -0
  406. package/esm/domain/record/recordingScope.d.ts +24 -0
  407. package/esm/domain/record/recordingScope.js +26 -0
  408. package/esm/domain/record/recordingScope.js.map +1 -0
  409. package/esm/domain/record/serialization/changeEncoder.d.ts +22 -0
  410. package/esm/domain/record/serialization/changeEncoder.js +56 -0
  411. package/esm/domain/record/serialization/changeEncoder.js.map +1 -0
  412. package/esm/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
  413. package/esm/domain/record/serialization/conversions/changeConverter.js +213 -0
  414. package/esm/domain/record/serialization/conversions/changeConverter.js.map +1 -0
  415. package/esm/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
  416. package/esm/domain/record/serialization/conversions/changeDecoder.js +134 -0
  417. package/esm/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
  418. package/esm/domain/record/serialization/conversions/index.d.ts +7 -0
  419. package/esm/domain/record/serialization/conversions/index.js +4 -0
  420. package/esm/domain/record/serialization/conversions/index.js.map +1 -0
  421. package/esm/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
  422. package/esm/domain/record/serialization/conversions/mutationLog.js +33 -0
  423. package/esm/domain/record/serialization/conversions/mutationLog.js.map +1 -0
  424. package/esm/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
  425. package/esm/domain/record/serialization/conversions/nodeIdRemapper.js +49 -0
  426. package/esm/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
  427. package/esm/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
  428. package/esm/domain/record/serialization/conversions/renderOptions.js +9 -0
  429. package/esm/domain/record/serialization/conversions/renderOptions.js.map +1 -0
  430. package/esm/domain/record/serialization/conversions/stringTable.d.ts +5 -0
  431. package/esm/domain/record/serialization/conversions/stringTable.js +19 -0
  432. package/esm/domain/record/serialization/conversions/stringTable.js.map +1 -0
  433. package/esm/domain/record/serialization/conversions/vDocument.d.ts +23 -0
  434. package/esm/domain/record/serialization/conversions/vDocument.js +173 -0
  435. package/esm/domain/record/serialization/conversions/vDocument.js.map +1 -0
  436. package/esm/domain/record/serialization/conversions/vNode.d.ts +66 -0
  437. package/esm/domain/record/serialization/conversions/vNode.js +282 -0
  438. package/esm/domain/record/serialization/conversions/vNode.js.map +1 -0
  439. package/esm/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
  440. package/esm/domain/record/serialization/conversions/vStyleSheet.js +26 -0
  441. package/esm/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
  442. package/esm/domain/record/serialization/experimentalFeatures.d.ts +2 -0
  443. package/esm/domain/record/serialization/experimentalFeatures.js +12 -0
  444. package/esm/domain/record/serialization/experimentalFeatures.js.map +1 -0
  445. package/esm/domain/record/serialization/index.d.ts +17 -0
  446. package/esm/domain/record/serialization/index.js +14 -0
  447. package/esm/domain/record/serialization/index.js.map +1 -0
  448. package/esm/domain/record/serialization/insertionCursor.d.ts +57 -0
  449. package/esm/domain/record/serialization/insertionCursor.js +64 -0
  450. package/esm/domain/record/serialization/insertionCursor.js.map +1 -0
  451. package/esm/domain/record/serialization/serialization.types.d.ts +24 -0
  452. package/esm/domain/record/serialization/serialization.types.js +2 -0
  453. package/esm/domain/record/serialization/serialization.types.js.map +1 -0
  454. package/esm/domain/record/serialization/serializationStats.d.ts +12 -0
  455. package/esm/domain/record/serialization/serializationStats.js +27 -0
  456. package/esm/domain/record/serialization/serializationStats.js.map +1 -0
  457. package/esm/domain/record/serialization/serializationTransaction.d.ts +96 -0
  458. package/esm/domain/record/serialization/serializationTransaction.js +99 -0
  459. package/esm/domain/record/serialization/serializationTransaction.js.map +1 -0
  460. package/esm/domain/record/serialization/serializationUtils.d.ts +18 -0
  461. package/esm/domain/record/serialization/serializationUtils.js +80 -0
  462. package/esm/domain/record/serialization/serializationUtils.js.map +1 -0
  463. package/esm/domain/record/serialization/serializeAttribute.d.ts +4 -0
  464. package/esm/domain/record/serialization/serializeAttribute.js +38 -0
  465. package/esm/domain/record/serialization/serializeAttribute.js.map +1 -0
  466. package/esm/domain/record/serialization/serializeAttributes.d.ts +7 -0
  467. package/esm/domain/record/serialization/serializeAttributes.js +161 -0
  468. package/esm/domain/record/serialization/serializeAttributes.js.map +1 -0
  469. package/esm/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
  470. package/esm/domain/record/serialization/serializeFullSnapshot.js +31 -0
  471. package/esm/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
  472. package/esm/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
  473. package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js +10 -0
  474. package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
  475. package/esm/domain/record/serialization/serializeMutations.d.ts +11 -0
  476. package/esm/domain/record/serialization/serializeMutations.js +257 -0
  477. package/esm/domain/record/serialization/serializeMutations.js.map +1 -0
  478. package/esm/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
  479. package/esm/domain/record/serialization/serializeMutationsAsChange.js +201 -0
  480. package/esm/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
  481. package/esm/domain/record/serialization/serializeNode.d.ts +7 -0
  482. package/esm/domain/record/serialization/serializeNode.js +149 -0
  483. package/esm/domain/record/serialization/serializeNode.js.map +1 -0
  484. package/esm/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
  485. package/esm/domain/record/serialization/serializeNodeAsChange.js +150 -0
  486. package/esm/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
  487. package/esm/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
  488. package/esm/domain/record/serialization/serializeStyleSheets.js +27 -0
  489. package/esm/domain/record/serialization/serializeStyleSheets.js.map +1 -0
  490. package/esm/domain/record/serializationVerifier.d.ts +18 -0
  491. package/esm/domain/record/serializationVerifier.js +123 -0
  492. package/esm/domain/record/serializationVerifier.js.map +1 -0
  493. package/esm/domain/record/shadowRootsController.d.ts +11 -0
  494. package/esm/domain/record/shadowRootsController.js +41 -0
  495. package/esm/domain/record/shadowRootsController.js.map +1 -0
  496. package/esm/domain/record/startFullSnapshots.d.ts +10 -0
  497. package/esm/domain/record/startFullSnapshots.js +46 -0
  498. package/esm/domain/record/startFullSnapshots.js.map +1 -0
  499. package/esm/domain/record/trackers/index.d.ts +12 -0
  500. package/esm/domain/record/trackers/index.js +12 -0
  501. package/esm/domain/record/trackers/index.js.map +1 -0
  502. package/esm/domain/record/trackers/trackFocus.d.ts +5 -0
  503. package/esm/domain/record/trackers/trackFocus.js +12 -0
  504. package/esm/domain/record/trackers/trackFocus.js.map +1 -0
  505. package/esm/domain/record/trackers/trackFrustration.d.ts +6 -0
  506. package/esm/domain/record/trackers/trackFrustration.js +28 -0
  507. package/esm/domain/record/trackers/trackFrustration.js.map +1 -0
  508. package/esm/domain/record/trackers/trackInput.d.ts +4 -0
  509. package/esm/domain/record/trackers/trackInput.js +101 -0
  510. package/esm/domain/record/trackers/trackInput.js.map +1 -0
  511. package/esm/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
  512. package/esm/domain/record/trackers/trackMediaInteraction.js +26 -0
  513. package/esm/domain/record/trackers/trackMediaInteraction.js.map +1 -0
  514. package/esm/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
  515. package/esm/domain/record/trackers/trackMouseInteraction.js +56 -0
  516. package/esm/domain/record/trackers/trackMouseInteraction.js.map +1 -0
  517. package/esm/domain/record/trackers/trackMove.d.ts +9 -0
  518. package/esm/domain/record/trackers/trackMove.js +51 -0
  519. package/esm/domain/record/trackers/trackMove.js.map +1 -0
  520. package/esm/domain/record/trackers/trackMutation.d.ts +13 -0
  521. package/esm/domain/record/trackers/trackMutation.js +38 -0
  522. package/esm/domain/record/trackers/trackMutation.js.map +1 -0
  523. package/esm/domain/record/trackers/trackScroll.d.ts +5 -0
  524. package/esm/domain/record/trackers/trackScroll.js +45 -0
  525. package/esm/domain/record/trackers/trackScroll.js.map +1 -0
  526. package/esm/domain/record/trackers/trackStyleSheet.d.ts +6 -0
  527. package/esm/domain/record/trackers/trackStyleSheet.js +85 -0
  528. package/esm/domain/record/trackers/trackStyleSheet.js.map +1 -0
  529. package/esm/domain/record/trackers/trackViewEnd.d.ts +5 -0
  530. package/esm/domain/record/trackers/trackViewEnd.js +17 -0
  531. package/esm/domain/record/trackers/trackViewEnd.js.map +1 -0
  532. package/esm/domain/record/trackers/trackViewportResize.d.ts +6 -0
  533. package/esm/domain/record/trackers/trackViewportResize.js +42 -0
  534. package/esm/domain/record/trackers/trackViewportResize.js.map +1 -0
  535. package/esm/domain/record/trackers/tracker.types.d.ts +3 -0
  536. package/esm/domain/record/trackers/tracker.types.js +2 -0
  537. package/esm/domain/record/trackers/tracker.types.js.map +1 -0
  538. package/esm/domain/record/viewports.d.ts +20 -0
  539. package/esm/domain/record/viewports.js +55 -0
  540. package/esm/domain/record/viewports.js.map +1 -0
  541. package/esm/domain/replayStats.d.ts +8 -0
  542. package/esm/domain/replayStats.js +51 -0
  543. package/esm/domain/replayStats.js.map +1 -0
  544. package/esm/domain/scriptLoadingError.d.ts +6 -0
  545. package/esm/domain/scriptLoadingError.js +23 -0
  546. package/esm/domain/scriptLoadingError.js.map +1 -0
  547. package/esm/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
  548. package/esm/domain/segmentCollection/buildReplayPayload.js +23 -0
  549. package/esm/domain/segmentCollection/buildReplayPayload.js.map +1 -0
  550. package/esm/domain/segmentCollection/index.d.ts +4 -0
  551. package/esm/domain/segmentCollection/index.js +4 -0
  552. package/esm/domain/segmentCollection/index.js.map +1 -0
  553. package/esm/domain/segmentCollection/segment.d.ts +16 -0
  554. package/esm/domain/segmentCollection/segment.js +46 -0
  555. package/esm/domain/segmentCollection/segment.js.map +1 -0
  556. package/esm/domain/segmentCollection/segmentCollection.d.ts +31 -0
  557. package/esm/domain/segmentCollection/segmentCollection.js +106 -0
  558. package/esm/domain/segmentCollection/segmentCollection.js.map +1 -0
  559. package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
  560. package/esm/domain/segmentCollection/startSegmentTelemetry.js +49 -0
  561. package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
  562. package/esm/domain/startRecordBridge.d.ts +5 -0
  563. package/esm/domain/startRecordBridge.js +14 -0
  564. package/esm/domain/startRecordBridge.js.map +1 -0
  565. package/esm/domain/startRecorderInitTelemetry.d.ts +15 -0
  566. package/esm/domain/startRecorderInitTelemetry.js +52 -0
  567. package/esm/domain/startRecorderInitTelemetry.js.map +1 -0
  568. package/esm/entries/internal.d.ts +11 -0
  569. package/esm/entries/internal.js +4 -0
  570. package/esm/entries/internal.js.map +1 -0
  571. package/esm/entries/internalSynthetics.d.ts +2 -0
  572. package/esm/entries/internalSynthetics.js +23 -0
  573. package/esm/entries/internalSynthetics.js.map +1 -0
  574. package/esm/entries/main.d.ts +23 -0
  575. package/esm/entries/main.js +31 -0
  576. package/esm/entries/main.js.map +1 -0
  577. package/esm/types/index.d.ts +3 -0
  578. package/esm/types/index.js +2 -0
  579. package/esm/types/index.js.map +1 -0
  580. package/esm/types/profiling.d.ts +296 -0
  581. package/esm/types/profiling.js +5 -0
  582. package/esm/types/profiling.js.map +1 -0
  583. package/esm/types/sessionReplay.d.ts +934 -0
  584. package/esm/types/sessionReplay.js +5 -0
  585. package/esm/types/sessionReplay.js.map +1 -0
  586. package/esm/types/sessionReplayConstants.d.ts +71 -0
  587. package/esm/types/sessionReplayConstants.js +64 -0
  588. package/esm/types/sessionReplayConstants.js.map +1 -0
  589. package/internal/package.json +6 -0
  590. package/internal-synthetics/package.json +6 -0
  591. package/package.json +52 -0
  592. package/src/boot/isBrowserSupported.ts +14 -0
  593. package/src/boot/lazyLoadProfiler.ts +20 -0
  594. package/src/boot/lazyLoadRecorder.ts +20 -0
  595. package/src/boot/postStartStrategy.ts +176 -0
  596. package/src/boot/preStartStrategy.ts +34 -0
  597. package/src/boot/profilerApi.ts +82 -0
  598. package/src/boot/recorderApi.ts +113 -0
  599. package/src/boot/startRecording.ts +70 -0
  600. package/src/domain/deflate/deflateEncoder.ts +144 -0
  601. package/src/domain/deflate/deflateWorker.ts +152 -0
  602. package/src/domain/deflate/index.ts +9 -0
  603. package/src/domain/getSessionReplayLink.ts +40 -0
  604. package/src/domain/profiling/actionHistory.ts +65 -0
  605. package/src/domain/profiling/longTaskHistory.ts +40 -0
  606. package/src/domain/profiling/profiler.ts +366 -0
  607. package/src/domain/profiling/profilingContext.ts +39 -0
  608. package/src/domain/profiling/profilingSupported.ts +10 -0
  609. package/src/domain/profiling/test-utils/mockedTrace.ts +58 -0
  610. package/src/domain/profiling/transport/assembly.ts +63 -0
  611. package/src/domain/profiling/transport/buildProfileEventAttributes.ts +106 -0
  612. package/src/domain/profiling/types/index.ts +2 -0
  613. package/src/domain/profiling/types/profilerApi.types.ts +87 -0
  614. package/src/domain/profiling/types/rumProfiler.types.ts +62 -0
  615. package/src/domain/profiling/utils/getCustomOrDefaultViewName.ts +4 -0
  616. package/src/domain/profiling/utils/getDefaultViewName.ts +12 -0
  617. package/src/domain/profiling/utils/getNumberOfSamples.ts +17 -0
  618. package/src/domain/profiling/vitalHistory.ts +58 -0
  619. package/src/domain/record/assembly.ts +19 -0
  620. package/src/domain/record/elementsScrollPositions.ts +28 -0
  621. package/src/domain/record/eventsUtils.ts +12 -0
  622. package/src/domain/record/index.ts +12 -0
  623. package/src/domain/record/internalApi.ts +84 -0
  624. package/src/domain/record/itemIds.ts +97 -0
  625. package/src/domain/record/mutationBatch.ts +47 -0
  626. package/src/domain/record/record.ts +90 -0
  627. package/src/domain/record/record.types.ts +22 -0
  628. package/src/domain/record/recordingScope.ts +58 -0
  629. package/src/domain/record/serialization/changeEncoder.ts +89 -0
  630. package/src/domain/record/serialization/conversions/changeConverter.ts +277 -0
  631. package/src/domain/record/serialization/conversions/changeDecoder.ts +192 -0
  632. package/src/domain/record/serialization/conversions/index.ts +7 -0
  633. package/src/domain/record/serialization/conversions/mutationLog.ts +56 -0
  634. package/src/domain/record/serialization/conversions/nodeIdRemapper.ts +69 -0
  635. package/src/domain/record/serialization/conversions/renderOptions.ts +14 -0
  636. package/src/domain/record/serialization/conversions/stringTable.ts +25 -0
  637. package/src/domain/record/serialization/conversions/vDocument.ts +239 -0
  638. package/src/domain/record/serialization/conversions/vNode.ts +417 -0
  639. package/src/domain/record/serialization/conversions/vStyleSheet.ts +47 -0
  640. package/src/domain/record/serialization/experimentalFeatures.ts +15 -0
  641. package/src/domain/record/serialization/index.ts +21 -0
  642. package/src/domain/record/serialization/insertionCursor.ts +131 -0
  643. package/src/domain/record/serialization/serialization.types.ts +38 -0
  644. package/src/domain/record/serialization/serializationStats.ts +43 -0
  645. package/src/domain/record/serialization/serializationTransaction.ts +255 -0
  646. package/src/domain/record/serialization/serializationUtils.ts +103 -0
  647. package/src/domain/record/serialization/serializeAttribute.ts +55 -0
  648. package/src/domain/record/serialization/serializeAttributes.ts +194 -0
  649. package/src/domain/record/serialization/serializeFullSnapshot.ts +46 -0
  650. package/src/domain/record/serialization/serializeFullSnapshotAsChange.ts +33 -0
  651. package/src/domain/record/serialization/serializeMutations.ts +395 -0
  652. package/src/domain/record/serialization/serializeMutationsAsChange.ts +298 -0
  653. package/src/domain/record/serialization/serializeNode.ts +229 -0
  654. package/src/domain/record/serialization/serializeNodeAsChange.ts +237 -0
  655. package/src/domain/record/serialization/serializeStyleSheets.ts +36 -0
  656. package/src/domain/record/serializationVerifier.ts +208 -0
  657. package/src/domain/record/shadowRootsController.ts +62 -0
  658. package/src/domain/record/startFullSnapshots.ts +92 -0
  659. package/src/domain/record/trackers/index.ts +12 -0
  660. package/src/domain/record/trackers/trackFocus.ts +16 -0
  661. package/src/domain/record/trackers/trackFrustration.ts +39 -0
  662. package/src/domain/record/trackers/trackInput.ts +128 -0
  663. package/src/domain/record/trackers/trackMediaInteraction.ts +43 -0
  664. package/src/domain/record/trackers/trackMouseInteraction.ts +74 -0
  665. package/src/domain/record/trackers/trackMove.ts +78 -0
  666. package/src/domain/record/trackers/trackMutation.ts +74 -0
  667. package/src/domain/record/trackers/trackScroll.ts +61 -0
  668. package/src/domain/record/trackers/trackStyleSheet.ts +117 -0
  669. package/src/domain/record/trackers/trackViewEnd.ts +27 -0
  670. package/src/domain/record/trackers/trackViewportResize.ts +69 -0
  671. package/src/domain/record/trackers/tracker.types.ts +3 -0
  672. package/src/domain/record/viewports.ts +68 -0
  673. package/src/domain/replayStats.ts +61 -0
  674. package/src/domain/scriptLoadingError.ts +36 -0
  675. package/src/domain/segmentCollection/buildReplayPayload.ts +52 -0
  676. package/src/domain/segmentCollection/index.ts +4 -0
  677. package/src/domain/segmentCollection/segment.ts +79 -0
  678. package/src/domain/segmentCollection/segmentCollection.ts +200 -0
  679. package/src/domain/segmentCollection/startSegmentTelemetry.ts +91 -0
  680. package/src/domain/startRecordBridge.ts +17 -0
  681. package/src/domain/startRecorderInitTelemetry.ts +90 -0
  682. package/src/entries/internal.ts +18 -0
  683. package/src/entries/internalSynthetics.ts +24 -0
  684. package/src/entries/main.ts +96 -0
  685. package/src/types/index.ts +3 -0
  686. package/src/types/profiling.ts +298 -0
  687. package/src/types/sessionReplay.ts +990 -0
  688. package/src/types/sessionReplayConstants.ts +130 -0
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeInTransaction = exports.serializeChangesInTransaction = exports.aggregateSerializationStats = exports.updateSerializationStats = exports.createSerializationStats = exports.serializeAttribute = exports.serializeNodeAsChange = exports.serializeNode = exports.serializeMutationsAsChange = exports.serializeMutations = exports.serializeFullSnapshotAsChange = exports.serializeFullSnapshot = exports.getElementInputValue = exports.createRootInsertionCursor = exports.createChildInsertionCursor = exports.isIncrementalSnapshotChangeRecordsEnabled = exports.isFullSnapshotChangeRecordsEnabled = exports.createIdentityNodeIdRemapper = exports.createCopyingNodeIdRemapper = exports.createChangeConverter = void 0;
4
+ var conversions_1 = require("./conversions");
5
+ Object.defineProperty(exports, "createChangeConverter", { enumerable: true, get: function () { return conversions_1.createChangeConverter; } });
6
+ Object.defineProperty(exports, "createCopyingNodeIdRemapper", { enumerable: true, get: function () { return conversions_1.createCopyingNodeIdRemapper; } });
7
+ Object.defineProperty(exports, "createIdentityNodeIdRemapper", { enumerable: true, get: function () { return conversions_1.createIdentityNodeIdRemapper; } });
8
+ var experimentalFeatures_1 = require("./experimentalFeatures");
9
+ Object.defineProperty(exports, "isFullSnapshotChangeRecordsEnabled", { enumerable: true, get: function () { return experimentalFeatures_1.isFullSnapshotChangeRecordsEnabled; } });
10
+ Object.defineProperty(exports, "isIncrementalSnapshotChangeRecordsEnabled", { enumerable: true, get: function () { return experimentalFeatures_1.isIncrementalSnapshotChangeRecordsEnabled; } });
11
+ var insertionCursor_1 = require("./insertionCursor");
12
+ Object.defineProperty(exports, "createChildInsertionCursor", { enumerable: true, get: function () { return insertionCursor_1.createChildInsertionCursor; } });
13
+ Object.defineProperty(exports, "createRootInsertionCursor", { enumerable: true, get: function () { return insertionCursor_1.createRootInsertionCursor; } });
14
+ var serializationUtils_1 = require("./serializationUtils");
15
+ Object.defineProperty(exports, "getElementInputValue", { enumerable: true, get: function () { return serializationUtils_1.getElementInputValue; } });
16
+ var serializeFullSnapshot_1 = require("./serializeFullSnapshot");
17
+ Object.defineProperty(exports, "serializeFullSnapshot", { enumerable: true, get: function () { return serializeFullSnapshot_1.serializeFullSnapshot; } });
18
+ var serializeFullSnapshotAsChange_1 = require("./serializeFullSnapshotAsChange");
19
+ Object.defineProperty(exports, "serializeFullSnapshotAsChange", { enumerable: true, get: function () { return serializeFullSnapshotAsChange_1.serializeFullSnapshotAsChange; } });
20
+ var serializeMutations_1 = require("./serializeMutations");
21
+ Object.defineProperty(exports, "serializeMutations", { enumerable: true, get: function () { return serializeMutations_1.serializeMutations; } });
22
+ var serializeMutationsAsChange_1 = require("./serializeMutationsAsChange");
23
+ Object.defineProperty(exports, "serializeMutationsAsChange", { enumerable: true, get: function () { return serializeMutationsAsChange_1.serializeMutationsAsChange; } });
24
+ var serializeNode_1 = require("./serializeNode");
25
+ Object.defineProperty(exports, "serializeNode", { enumerable: true, get: function () { return serializeNode_1.serializeNode; } });
26
+ var serializeNodeAsChange_1 = require("./serializeNodeAsChange");
27
+ Object.defineProperty(exports, "serializeNodeAsChange", { enumerable: true, get: function () { return serializeNodeAsChange_1.serializeNodeAsChange; } });
28
+ var serializeAttribute_1 = require("./serializeAttribute");
29
+ Object.defineProperty(exports, "serializeAttribute", { enumerable: true, get: function () { return serializeAttribute_1.serializeAttribute; } });
30
+ var serializationStats_1 = require("./serializationStats");
31
+ Object.defineProperty(exports, "createSerializationStats", { enumerable: true, get: function () { return serializationStats_1.createSerializationStats; } });
32
+ Object.defineProperty(exports, "updateSerializationStats", { enumerable: true, get: function () { return serializationStats_1.updateSerializationStats; } });
33
+ Object.defineProperty(exports, "aggregateSerializationStats", { enumerable: true, get: function () { return serializationStats_1.aggregateSerializationStats; } });
34
+ var serializationTransaction_1 = require("./serializationTransaction");
35
+ Object.defineProperty(exports, "serializeChangesInTransaction", { enumerable: true, get: function () { return serializationTransaction_1.serializeChangesInTransaction; } });
36
+ Object.defineProperty(exports, "serializeInTransaction", { enumerable: true, get: function () { return serializationTransaction_1.serializeInTransaction; } });
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/index.ts"],"names":[],"mappings":";;;AACA,6CAAgH;AAAvG,oHAAA,qBAAqB,OAAA;AAAE,0HAAA,2BAA2B,OAAA;AAAE,2HAAA,4BAA4B,OAAA;AACzF,+DAAsH;AAA7G,0IAAA,kCAAkC,OAAA;AAAE,iJAAA,yCAAyC,OAAA;AACtF,qDAAyF;AAAhF,6HAAA,0BAA0B,OAAA;AAAE,4HAAA,yBAAyB,OAAA;AAC9D,2DAA2D;AAAlD,0HAAA,oBAAoB,OAAA;AAC7B,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,iFAA+E;AAAtE,8IAAA,6BAA6B,OAAA;AACtC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,2EAAyE;AAAhE,wIAAA,0BAA0B,OAAA;AACnC,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,2DAAsH;AAA7G,8HAAA,wBAAwB,OAAA;AAAE,8HAAA,wBAAwB,OAAA;AAAE,iIAAA,2BAA2B,OAAA;AAExF,uEAAqH;AAA5G,yIAAA,6BAA6B,OAAA;AAAE,kIAAA,sBAAsB,OAAA"}
@@ -0,0 +1,57 @@
1
+ import type { InsertionPoint } from '../../../types';
2
+ import type { NodeId, NodeIds } from '../itemIds';
3
+ /**
4
+ * InsertionCursor tracks the point at which the next node will be inserted during
5
+ * Change-style DOM serialization.
6
+ *
7
+ * When a new node is added to the document, we use an InsertionPoint to encode its
8
+ * position. There are often multiple equally-valid ways to express the same insertion
9
+ * point; we generally want to favor encodings that use as few characters as possible (to
10
+ * reduce uncompressed size) and that are as repetitive as possible (to reduce compressed
11
+ * size). InsertionCursor's purpose is to heuristically pick an efficient encoding based
12
+ * on the nodes we've recently serialized, while doing as little work as possible. The
13
+ * results are not optimal, but should be close to it in most situations.
14
+ *
15
+ * At the beginning of the serialization process, use a factory function like
16
+ * createRootInsertionCursor() to create a new cursor with an appropriate initial
17
+ * position.
18
+ *
19
+ * When visiting a node, the expected usage pattern is as follows:
20
+ * 1. Call advance() to get a node id and insertion point for the node.
21
+ * 2. Serialize the node.
22
+ * 3. If the node has no children, we're done; continue to the node's next
23
+ * sibling and apply this algorithm again.
24
+ * 4. Otherwise, call descend() to move the cursor into the node's child list.
25
+ * 5. Recursively apply this algorithm.
26
+ * 6. Call ascend() to move the cursor out of the node's child list. We're done;
27
+ * continue to the node's next sibling and apply this algorithm again.
28
+ */
29
+ export interface InsertionCursor {
30
+ /**
31
+ * Given the node id for a new node, returns the InsertionPoint for that node.
32
+ * Updates the cursor to point to the new node's next sibling.
33
+ */
34
+ advance(node: Node): {
35
+ nodeId: NodeId;
36
+ insertionPoint: InsertionPoint;
37
+ };
38
+ /**
39
+ * Ascends out of the current child list and updates the cursor to point to the parent
40
+ * node's next sibling.
41
+ */
42
+ ascend(): void;
43
+ /**
44
+ * Descends into the child list of the last node we inserted and updates the cursor to
45
+ * point to the node's first child.
46
+ */
47
+ descend(): void;
48
+ }
49
+ /** Returns an InsertionCursor which starts positioned at the root of the document. */
50
+ export declare function createRootInsertionCursor(nodeIds: NodeIds): InsertionCursor;
51
+ /**
52
+ * Returns an InsertionCursor which starts positioned in the child list of the given
53
+ * parent node. If a next sibling is provided, the cursor points to the position
54
+ * immediately before the next sibling; otherwise, the cursor points to the end of the
55
+ * child list.
56
+ */
57
+ export declare function createChildInsertionCursor(parentId: NodeId, nextSiblingId: NodeId | undefined, nodeIds: NodeIds): InsertionCursor;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRootInsertionCursor = createRootInsertionCursor;
4
+ exports.createChildInsertionCursor = createChildInsertionCursor;
5
+ /** Returns an InsertionCursor which starts positioned at the root of the document. */
6
+ function createRootInsertionCursor(nodeIds) {
7
+ return createInsertionCursor(undefined, undefined, nodeIds);
8
+ }
9
+ /**
10
+ * Returns an InsertionCursor which starts positioned in the child list of the given
11
+ * parent node. If a next sibling is provided, the cursor points to the position
12
+ * immediately before the next sibling; otherwise, the cursor points to the end of the
13
+ * child list.
14
+ */
15
+ function createChildInsertionCursor(parentId, nextSiblingId, nodeIds) {
16
+ return createInsertionCursor(parentId, nextSiblingId, nodeIds);
17
+ }
18
+ function createInsertionCursor(parentId, nextSiblingId, nodeIds) {
19
+ let cursor = {
20
+ container: undefined,
21
+ parentId,
22
+ previousSiblingId: undefined,
23
+ nextSiblingId,
24
+ };
25
+ const computeInsertionPoint = (nodeId) => {
26
+ if (cursor.previousSiblingId === nodeId - 1) {
27
+ // Use an AppendAfterPreviousInsertionPoint. (i.e., 0)
28
+ return 0;
29
+ }
30
+ if (cursor.nextSiblingId !== undefined) {
31
+ // Use an InsertBeforeInsertionPoint. We identify the next sibling using a
32
+ // negative integer indicating the difference between the new node's id and its next
33
+ // sibling's id.
34
+ return cursor.nextSiblingId - nodeId;
35
+ }
36
+ if (cursor.parentId !== undefined) {
37
+ // Use an AppendChildInsertionPoint. We identify the parent node using a positive
38
+ // integer indicating the difference between the new node's id and its parent's id.
39
+ return nodeId - cursor.parentId;
40
+ }
41
+ // There's no parent. Use a RootInsertionPoint. (i.e., null)
42
+ return null;
43
+ };
44
+ return {
45
+ advance(node) {
46
+ const nodeId = nodeIds.getOrInsert(node);
47
+ const insertionPoint = computeInsertionPoint(nodeId);
48
+ cursor.previousSiblingId = nodeId;
49
+ return { nodeId, insertionPoint };
50
+ },
51
+ ascend() {
52
+ if (cursor.container) {
53
+ cursor = cursor.container;
54
+ }
55
+ },
56
+ descend() {
57
+ if (cursor.previousSiblingId !== undefined) {
58
+ cursor = {
59
+ container: cursor,
60
+ parentId: cursor.previousSiblingId,
61
+ previousSiblingId: undefined,
62
+ nextSiblingId: undefined,
63
+ };
64
+ }
65
+ },
66
+ };
67
+ }
68
+ //# sourceMappingURL=insertionCursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertionCursor.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/insertionCursor.ts"],"names":[],"mappings":";;AAkDA,8DAEC;AAQD,gEAMC;AAjBD,sFAAsF;AACtF,SAAgB,yBAAyB,CAAC,OAAgB;IACxD,OAAO,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,QAAgB,EAChB,aAAiC,EACjC,OAAgB;IAEhB,OAAO,qBAAqB,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAA;AAChE,CAAC;AAED,SAAS,qBAAqB,CAC5B,QAA4B,EAC5B,aAAiC,EACjC,OAAgB;IAShB,IAAI,MAAM,GAAoB;QAC5B,SAAS,EAAE,SAAS;QACpB,QAAQ;QACR,iBAAiB,EAAE,SAAS;QAC5B,aAAa;KACd,CAAA;IAED,MAAM,qBAAqB,GAAG,CAAC,MAAc,EAAkB,EAAE;QAC/D,IAAI,MAAM,CAAC,iBAAiB,KAAK,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5C,sDAAsD;YACtD,OAAO,CAAC,CAAA;QACV,CAAC;QACD,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,0EAA0E;YAC1E,oFAAoF;YACpF,gBAAgB;YAChB,OAAO,MAAM,CAAC,aAAa,GAAG,MAAM,CAAA;QACtC,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClC,iFAAiF;YACjF,mFAAmF;YACnF,OAAO,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAA;QACjC,CAAC;QACD,4DAA4D;QAC5D,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,OAAO;QACL,OAAO,CAAC,IAAU;YAChB,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YACxC,MAAM,cAAc,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;YACpD,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAA;YACjC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;QACnC,CAAC;QACD,MAAM;YACJ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,OAAO;YACL,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;gBAC3C,MAAM,GAAG;oBACP,SAAS,EAAE,MAAM;oBACjB,QAAQ,EAAE,MAAM,CAAC,iBAAiB;oBAClC,iBAAiB,EAAE,SAAS;oBAC5B,aAAa,EAAE,SAAS;iBACzB,CAAA;YACH,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { NodePrivacyLevel } from '@datadog/browser-rum-core';
2
+ export type ParentNodePrivacyLevel = typeof NodePrivacyLevel.ALLOW | typeof NodePrivacyLevel.MASK | typeof NodePrivacyLevel.MASK_USER_INPUT | typeof NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED;
3
+ /**
4
+ * Virtual attributes. These attributes appear in the serialized attribute map of
5
+ * elements, but they're not actually derived from the DOM; they're used to represent
6
+ * metadata about the element they're attached to.
7
+ */
8
+ export interface VirtualAttributes {
9
+ /**
10
+ * For <style> and <link> elements, the rules in the element's stylesheet, extracted
11
+ * from the CSSOM.
12
+ */
13
+ _cssText?: string;
14
+ /** For <audio> and <video> elements, the playback state of the element's media. */
15
+ rr_mediaState?: 'paused' | 'played';
16
+ /** For elements which are scroll containers, the element's X scroll position, if non-zero. */
17
+ rr_scrollLeft?: number;
18
+ /** For elements which are scroll containers, the element's Y scroll position, if non-zero. */
19
+ rr_scrollTop?: number;
20
+ /** For HIDDEN elements, the width of the element's bounding client rect. */
21
+ rr_width?: string;
22
+ /** For HIDDEN elements, the height of the element's bounding client rect. */
23
+ rr_height?: string;
24
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=serialization.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialization.types.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serialization.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export interface SerializationMetric {
2
+ count: number;
3
+ max: number;
4
+ sum: number;
5
+ }
6
+ export interface SerializationStats {
7
+ cssText: SerializationMetric;
8
+ serializationDuration: SerializationMetric;
9
+ }
10
+ export declare function createSerializationStats(): SerializationStats;
11
+ export declare function updateSerializationStats(stats: SerializationStats, metric: keyof SerializationStats, value: number): void;
12
+ export declare function aggregateSerializationStats(aggregateStats: SerializationStats, stats: SerializationStats): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSerializationStats = createSerializationStats;
4
+ exports.updateSerializationStats = updateSerializationStats;
5
+ exports.aggregateSerializationStats = aggregateSerializationStats;
6
+ function createSerializationStats() {
7
+ return {
8
+ cssText: {
9
+ count: 0,
10
+ max: 0,
11
+ sum: 0,
12
+ },
13
+ serializationDuration: {
14
+ count: 0,
15
+ max: 0,
16
+ sum: 0,
17
+ },
18
+ };
19
+ }
20
+ function updateSerializationStats(stats, metric, value) {
21
+ stats[metric].count += 1;
22
+ stats[metric].max = Math.max(stats[metric].max, value);
23
+ stats[metric].sum += value;
24
+ }
25
+ function aggregateSerializationStats(aggregateStats, stats) {
26
+ for (const metric of ['cssText', 'serializationDuration']) {
27
+ aggregateStats[metric].count += stats[metric].count;
28
+ aggregateStats[metric].max = Math.max(aggregateStats[metric].max, stats[metric].max);
29
+ aggregateStats[metric].sum += stats[metric].sum;
30
+ }
31
+ }
32
+ //# sourceMappingURL=serializationStats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializationStats.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationStats.ts"],"names":[],"mappings":";;AAWA,4DAaC;AAED,4DAQC;AAED,kEAMC;AA/BD,SAAgB,wBAAwB;IACtC,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP;KACF,CAAA;AACH,CAAC;AAED,SAAgB,wBAAwB,CACtC,KAAyB,EACzB,MAAgC,EAChC,KAAa;IAEb,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;IACxB,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAA;AAC5B,CAAC;AAED,SAAgB,2BAA2B,CAAC,cAAkC,EAAE,KAAyB;IACvG,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAU,EAAE,CAAC;QACnE,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAA;QACnD,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAA;QACpF,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAA;IACjD,CAAC;AACH,CAAC"}
@@ -0,0 +1,96 @@
1
+ import type { TimeStamp } from '@datadog/browser-core';
2
+ import type { AddCDataSectionNodeChange, AddDocTypeNodeChange, AddDocumentFragmentNodeChange, AddDocumentNodeChange, AddElementNodeChange, AddNodeChange, AddShadowRootNodeChange, AddTextNodeChange, AttributeChange, BrowserRecord, InsertionPoint, MediaInteractionType, StyleSheetMediaList, StyleSheetRules } from '../../../types';
3
+ import type { NodeId, StyleSheetId } from '../itemIds';
4
+ import type { EmitRecordCallback, EmitStatsCallback } from '../record.types';
5
+ import type { RecordingScope } from '../recordingScope';
6
+ import type { SerializationStats } from './serializationStats';
7
+ export type SerializationTransactionCallback = (transaction: SerializationTransaction) => void;
8
+ export declare const enum SerializationKind {
9
+ INITIAL_FULL_SNAPSHOT = 0,
10
+ SUBSEQUENT_FULL_SNAPSHOT = 1,
11
+ INCREMENTAL_SNAPSHOT = 2
12
+ }
13
+ /**
14
+ * A serialization transaction is used to build and emit a sequence of session replay
15
+ * records containing a serialized snapshot of the DOM.
16
+ */
17
+ export interface SerializationTransaction {
18
+ /** Add a record to the transaction. It will be emitted when the transaction ends. */
19
+ add(record: BrowserRecord): void;
20
+ /**
21
+ * Add a metric to the transaction's statistics. The aggregated statistics will be
22
+ * emitted when the transaction ends.
23
+ */
24
+ addMetric(metric: keyof SerializationStats, value: number): void;
25
+ /**
26
+ * Assign and return an id to the given node. If the node has previously been assigned
27
+ * an id, the existing id will be reused.
28
+ */
29
+ assignId(node: Node): NodeId;
30
+ /** The kind of serialization being performed in this transaction. */
31
+ kind: SerializationKind;
32
+ /**
33
+ * A set used to track nodes which have been serialized in the current transaction. If
34
+ * undefined, this feature is disabled; this is the default state in new transactions
35
+ * for performance reasons. Set the property to a non-undefined value if you need this
36
+ * capability.
37
+ */
38
+ serializedNodeIds?: Set<NodeId>;
39
+ /** The recording scope in which this transaction is occurring. */
40
+ scope: RecordingScope;
41
+ }
42
+ /**
43
+ * Perform serialization within a transaction. At the end of the transaction, the
44
+ * generated records and statistics will be emitted.
45
+ */
46
+ export declare function serializeInTransaction(kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, serialize: SerializationTransactionCallback): void;
47
+ type AddNodeParams<NodeChange extends AddNodeChange> = NodeChange extends [any, any, ...infer Params] ? Params : never;
48
+ export type ChangeSerializationTransactionCallback = (transaction: ChangeSerializationTransaction) => void;
49
+ /**
50
+ * ChangeSerializationTransaction is used to build and emit a BrowserChangeRecord
51
+ * containing a serialized snapshot of the DOM. Unlike SerializationTransaction, it
52
+ * doesn't support emitting arbitrary BrowserRecords; instead, the builder methods it
53
+ * exposes are used to construct a single BrowserChangeRecord which is emitted at the end
54
+ * of the transaction.
55
+ */
56
+ export interface ChangeSerializationTransaction {
57
+ /**
58
+ * Add a metric to the transaction's statistics. The aggregated statistics will be
59
+ * emitted when the transaction ends.
60
+ */
61
+ addMetric(metric: keyof SerializationStats, value: number): void;
62
+ /** Add a node to the document at the given insertion point. */
63
+ addNode(pos: InsertionPoint, nodeName: '#cdata-section', ...params: AddNodeParams<AddCDataSectionNodeChange>): void;
64
+ addNode(pos: InsertionPoint, nodeName: '#doctype', ...params: AddNodeParams<AddDocTypeNodeChange>): void;
65
+ addNode(pos: InsertionPoint, nodeName: '#document', ...params: AddNodeParams<AddDocumentNodeChange>): void;
66
+ addNode(pos: InsertionPoint, nodeName: '#document-fragment', ...params: AddNodeParams<AddDocumentFragmentNodeChange>): void;
67
+ addNode(pos: InsertionPoint, nodeName: '#shadow-root', ...params: AddNodeParams<AddShadowRootNodeChange>): void;
68
+ addNode(pos: InsertionPoint, nodeName: '#text', ...params: AddNodeParams<AddTextNodeChange>): void;
69
+ addNode(pos: InsertionPoint, nodeName: Exclude<string, `#${string}`>, ...params: AddNodeParams<AddElementNodeChange>): void;
70
+ addNode(pos: InsertionPoint, nodeName: string, ...params: AddNodeParams<AddNodeChange>): void;
71
+ /** Add a stylesheet to the document. */
72
+ addStyleSheet(rules: StyleSheetRules, mediaList?: StyleSheetMediaList, disabled?: boolean): void;
73
+ /**
74
+ * Attach one or more stylesheets to a <link>, <style>, #document, #document-fragment,
75
+ * or #shadow-root node.
76
+ */
77
+ attachStyleSheets(nodeId: NodeId, sheetIds: StyleSheetId[]): void;
78
+ /** Remove a node from the document. */
79
+ removeNode(nodeId: NodeId): void;
80
+ /** Set a node's attributes to the given values. */
81
+ setAttributes(change: AttributeChange): void;
82
+ /** Set the media playback state of an <audio> or <video> element. */
83
+ setMediaPlaybackState(nodeId: NodeId, state: MediaInteractionType): void;
84
+ /** Set the given node's scroll position in CSS pixels. */
85
+ setScrollPosition(nodeId: NodeId, x: number, y: number): void;
86
+ /** Set the given node's size in CSS pixels. */
87
+ setSize(nodeId: NodeId, width: number, height: number): void;
88
+ /** Set the given node's text content. */
89
+ setText(nodeId: NodeId, content: string): void;
90
+ /** The kind of serialization being performed in this transaction. */
91
+ kind: SerializationKind;
92
+ /** The recording scope in which this transaction is occurring. */
93
+ scope: RecordingScope;
94
+ }
95
+ export declare function serializeChangesInTransaction(kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, timestamp: TimeStamp, serialize: ChangeSerializationTransactionCallback): void;
96
+ export {};
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeInTransaction = serializeInTransaction;
4
+ exports.serializeChangesInTransaction = serializeChangesInTransaction;
5
+ const browser_core_1 = require("@datadog/browser-core");
6
+ const types_1 = require("../../../types");
7
+ const serializationStats_1 = require("./serializationStats");
8
+ const changeEncoder_1 = require("./changeEncoder");
9
+ /**
10
+ * Perform serialization within a transaction. At the end of the transaction, the
11
+ * generated records and statistics will be emitted.
12
+ */
13
+ function serializeInTransaction(kind, emitRecord, emitStats, scope, serialize) {
14
+ const records = [];
15
+ const stats = (0, serializationStats_1.createSerializationStats)();
16
+ const transaction = {
17
+ add(record) {
18
+ records.push(record);
19
+ },
20
+ addMetric(metric, value) {
21
+ (0, serializationStats_1.updateSerializationStats)(stats, metric, value);
22
+ },
23
+ assignId(node) {
24
+ const id = scope.nodeIds.getOrInsert(node);
25
+ if (transaction.serializedNodeIds) {
26
+ transaction.serializedNodeIds.add(id);
27
+ }
28
+ return id;
29
+ },
30
+ kind,
31
+ scope,
32
+ };
33
+ const start = (0, browser_core_1.timeStampNow)();
34
+ serialize(transaction);
35
+ (0, serializationStats_1.updateSerializationStats)(stats, 'serializationDuration', (0, browser_core_1.elapsed)(start, (0, browser_core_1.timeStampNow)()));
36
+ for (const record of records) {
37
+ emitRecord(record);
38
+ }
39
+ emitStats(stats);
40
+ }
41
+ function serializeChangesInTransaction(kind, emitRecord, emitStats, scope, timestamp, serialize) {
42
+ const encoder = (0, changeEncoder_1.createChangeEncoder)(scope.stringIds);
43
+ const stats = (0, serializationStats_1.createSerializationStats)();
44
+ const transaction = {
45
+ addMetric(metric, value) {
46
+ (0, serializationStats_1.updateSerializationStats)(stats, metric, value);
47
+ },
48
+ addNode(...change) {
49
+ encoder.add(types_1.ChangeType.AddNode, change);
50
+ },
51
+ addStyleSheet(rules, mediaList, disabled) {
52
+ if (disabled) {
53
+ encoder.add(types_1.ChangeType.AddStyleSheet, [rules, mediaList || [], disabled]);
54
+ }
55
+ else if (mediaList) {
56
+ encoder.add(types_1.ChangeType.AddStyleSheet, [rules, mediaList]);
57
+ }
58
+ else {
59
+ encoder.add(types_1.ChangeType.AddStyleSheet, [rules]);
60
+ }
61
+ },
62
+ attachStyleSheets(nodeId, sheetIds) {
63
+ const change = [nodeId];
64
+ for (const sheetId of sheetIds) {
65
+ change.push(sheetId);
66
+ }
67
+ encoder.add(types_1.ChangeType.AttachedStyleSheets, change);
68
+ },
69
+ removeNode(nodeId) {
70
+ encoder.add(types_1.ChangeType.RemoveNode, nodeId);
71
+ },
72
+ setAttributes(change) {
73
+ encoder.add(types_1.ChangeType.Attribute, change);
74
+ },
75
+ setMediaPlaybackState(nodeId, state) {
76
+ encoder.add(types_1.ChangeType.MediaPlaybackState, [nodeId, state]);
77
+ },
78
+ setScrollPosition(nodeId, x, y) {
79
+ encoder.add(types_1.ChangeType.ScrollPosition, [nodeId, x, y]);
80
+ },
81
+ setSize(nodeId, width, height) {
82
+ encoder.add(types_1.ChangeType.Size, [nodeId, width, height]);
83
+ },
84
+ setText(nodeId, content) {
85
+ encoder.add(types_1.ChangeType.Text, [nodeId, content]);
86
+ },
87
+ kind,
88
+ scope,
89
+ };
90
+ const start = (0, browser_core_1.timeStampNow)();
91
+ serialize(transaction);
92
+ (0, serializationStats_1.updateSerializationStats)(stats, 'serializationDuration', (0, browser_core_1.elapsed)(start, (0, browser_core_1.timeStampNow)()));
93
+ const changes = encoder.flush();
94
+ if (changes.length > 0) {
95
+ emitRecord({
96
+ data: changes,
97
+ type: types_1.RecordType.Change,
98
+ timestamp,
99
+ });
100
+ }
101
+ emitStats(stats);
102
+ }
103
+ //# sourceMappingURL=serializationTransaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializationTransaction.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationTransaction.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import type { NodePrivacyLevel } from '@datadog/browser-rum-core';
2
+ /**
3
+ * Get the element "value" to be serialized as an attribute or an input update record. It respects
4
+ * the input privacy mode of the element.
5
+ * PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.
6
+ */
7
+ export declare function getElementInputValue(element: Element, nodePrivacyLevel: NodePrivacyLevel): string | undefined;
8
+ export declare const URL_IN_CSS_REF: RegExp;
9
+ export declare const ABSOLUTE_URL: RegExp;
10
+ export declare const DATA_URI: RegExp;
11
+ export declare function switchToAbsoluteUrl(cssText: string, cssHref: string | null): string;
12
+ export declare function getValidTagName(tagName: string): string;
13
+ /**
14
+ * Returns the tag name of the given element, normalized to ensure a consistent lowercase
15
+ * representation regardless of whether the element is HTML, XHTML, or SVG.
16
+ */
17
+ export declare function normalizedTagName(element: Element): string;
18
+ export declare function censoredImageForSize(width: number, height: number): string;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DATA_URI = exports.ABSOLUTE_URL = exports.URL_IN_CSS_REF = void 0;
4
+ exports.getElementInputValue = getElementInputValue;
5
+ exports.switchToAbsoluteUrl = switchToAbsoluteUrl;
6
+ exports.getValidTagName = getValidTagName;
7
+ exports.normalizedTagName = normalizedTagName;
8
+ exports.censoredImageForSize = censoredImageForSize;
9
+ const browser_core_1 = require("@datadog/browser-core");
10
+ const browser_rum_core_1 = require("@datadog/browser-rum-core");
11
+ /**
12
+ * Get the element "value" to be serialized as an attribute or an input update record. It respects
13
+ * the input privacy mode of the element.
14
+ * PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.
15
+ */
16
+ function getElementInputValue(element, nodePrivacyLevel) {
17
+ /*
18
+ BROWSER SPEC NOTE: <input>, <select>
19
+ For some <input> elements, the `value` is an exceptional property/attribute that has the
20
+ value synced between el.value and el.getAttribute()
21
+ input[type=button,checkbox,hidden,image,radio,reset,submit]
22
+ */
23
+ const tagName = element.tagName;
24
+ const value = element.value;
25
+ if ((0, browser_rum_core_1.shouldMaskNode)(element, nodePrivacyLevel)) {
26
+ const type = element.type;
27
+ if (tagName === 'INPUT' && (type === 'button' || type === 'submit' || type === 'reset')) {
28
+ // Overrule `MASK` privacy level for button-like element values, as they are used during replay
29
+ // to display their label. They can still be hidden via the "hidden" privacy attribute or class name.
30
+ return value;
31
+ }
32
+ else if (!value || tagName === 'OPTION') {
33
+ // <Option> value provides no benefit
34
+ return;
35
+ }
36
+ return browser_rum_core_1.CENSORED_STRING_MARK;
37
+ }
38
+ if (tagName === 'OPTION' || tagName === 'SELECT') {
39
+ return element.value;
40
+ }
41
+ if (tagName !== 'INPUT' && tagName !== 'TEXTAREA') {
42
+ return;
43
+ }
44
+ return value;
45
+ }
46
+ exports.URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm;
47
+ exports.ABSOLUTE_URL = /^[A-Za-z]+:|^\/\//;
48
+ exports.DATA_URI = /^["']?data:.*,/i;
49
+ function switchToAbsoluteUrl(cssText, cssHref) {
50
+ return cssText.replace(exports.URL_IN_CSS_REF, (matchingSubstring, singleQuote, urlWrappedInSingleQuotes, doubleQuote, urlWrappedInDoubleQuotes, urlNotWrappedInQuotes) => {
51
+ const url = urlWrappedInSingleQuotes || urlWrappedInDoubleQuotes || urlNotWrappedInQuotes;
52
+ if (!cssHref || !url || exports.ABSOLUTE_URL.test(url) || exports.DATA_URI.test(url)) {
53
+ return matchingSubstring;
54
+ }
55
+ const quote = singleQuote || doubleQuote || '';
56
+ return `url(${quote}${makeUrlAbsolute(url, cssHref)}${quote})`;
57
+ });
58
+ }
59
+ function makeUrlAbsolute(url, baseUrl) {
60
+ try {
61
+ return (0, browser_core_1.buildUrl)(url, baseUrl).href;
62
+ }
63
+ catch (_a) {
64
+ return url;
65
+ }
66
+ }
67
+ const TAG_NAME_REGEX = /[^a-z1-6-_]/;
68
+ function getValidTagName(tagName) {
69
+ const processedTagName = tagName.toLowerCase().trim();
70
+ if (TAG_NAME_REGEX.test(processedTagName)) {
71
+ // if the tag name is odd and we cannot extract
72
+ // anything from the string, then we return a
73
+ // generic div
74
+ return 'div';
75
+ }
76
+ return processedTagName;
77
+ }
78
+ /**
79
+ * Returns the tag name of the given element, normalized to ensure a consistent lowercase
80
+ * representation regardless of whether the element is HTML, XHTML, or SVG.
81
+ */
82
+ function normalizedTagName(element) {
83
+ return element.tagName.toLowerCase();
84
+ }
85
+ function censoredImageForSize(width, height) {
86
+ return `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${width}' height='${height}' style='background-color:silver'%3E%3C/svg%3E`;
87
+ }
88
+ //# sourceMappingURL=serializationUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializationUtils.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationUtils.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import { NodePrivacyLevel } from '@datadog/browser-rum-core';
2
+ import type { RumConfiguration } from '@datadog/browser-rum-core';
3
+ export declare const MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 1000000;
4
+ export declare function serializeAttribute(element: Element, nodePrivacyLevel: NodePrivacyLevel, attributeName: string, configuration: RumConfiguration): string | null;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = void 0;
4
+ exports.serializeAttribute = serializeAttribute;
5
+ const browser_rum_core_1 = require("@datadog/browser-rum-core");
6
+ const serializationUtils_1 = require("./serializationUtils");
7
+ // TODO: temporarily bump the Session Replay limit to 1Mb for dataUrls
8
+ // This limit should be removed after [PANA-2843] is implemented
9
+ exports.MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 1000000;
10
+ function serializeAttribute(element, nodePrivacyLevel, attributeName, configuration) {
11
+ if (nodePrivacyLevel === browser_rum_core_1.NodePrivacyLevel.HIDDEN) {
12
+ // dup condition for direct access case
13
+ return null;
14
+ }
15
+ const attributeValue = element.getAttribute(attributeName);
16
+ const tagName = element.tagName;
17
+ if ((0, browser_rum_core_1.shouldMaskAttribute)(tagName, attributeName, attributeValue, nodePrivacyLevel, configuration)) {
18
+ // mask image URLs
19
+ if (tagName === 'IMG') {
20
+ // generate image with similar dimension than the original to have the same rendering behaviour
21
+ const image = element;
22
+ if (image.naturalWidth > 0) {
23
+ return (0, serializationUtils_1.censoredImageForSize)(image.naturalWidth, image.naturalHeight);
24
+ }
25
+ const { width, height } = element.getBoundingClientRect();
26
+ if (width > 0 || height > 0) {
27
+ return (0, serializationUtils_1.censoredImageForSize)(width, height);
28
+ }
29
+ // if we can't get the image size, fallback to the censored image
30
+ return browser_rum_core_1.CENSORED_IMG_MARK;
31
+ }
32
+ if (tagName === 'SOURCE') {
33
+ return browser_rum_core_1.CENSORED_IMG_MARK;
34
+ }
35
+ return browser_rum_core_1.CENSORED_STRING_MARK;
36
+ }
37
+ if (!attributeValue) {
38
+ return attributeValue;
39
+ }
40
+ return (0, browser_rum_core_1.sanitizeIfLongDataUrl)(attributeValue, exports.MAX_ATTRIBUTE_VALUE_CHAR_LENGTH);
41
+ }
42
+ //# sourceMappingURL=serializeAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializeAttribute.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializeAttribute.ts"],"names":[],"mappings":";;;AAcA,gDAwCC;AAtDD,gEAMkC;AAElC,6DAA2D;AAE3D,sEAAsE;AACtE,gEAAgE;AACnD,QAAA,+BAA+B,GAAG,OAAS,CAAA;AAExD,SAAgB,kBAAkB,CAChC,OAAgB,EAChB,gBAAkC,EAClC,aAAqB,EACrB,aAA+B;IAE/B,IAAI,gBAAgB,KAAK,mCAAgB,CAAC,MAAM,EAAE,CAAC;QACjD,uCAAuC;QACvC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;IAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC/B,IAAI,IAAA,sCAAmB,EAAC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAE,CAAC;QACjG,kBAAkB;QAClB,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;YACtB,+FAA+F;YAC/F,MAAM,KAAK,GAAG,OAA2B,CAAA;YACzC,IAAI,KAAK,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;gBAC3B,OAAO,IAAA,yCAAoB,EAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;YACtE,CAAC;YACD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAA;YACzD,IAAI,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,OAAO,IAAA,yCAAoB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YAC5C,CAAC;YACD,iEAAiE;YACjE,OAAO,oCAAiB,CAAA;QAC1B,CAAC;QACD,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YACzB,OAAO,oCAAiB,CAAA;QAC1B,CAAC;QAED,OAAO,uCAAoB,CAAA;IAC7B,CAAC;IAED,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,cAAc,CAAA;IACvB,CAAC;IAED,OAAO,IAAA,wCAAqB,EAAC,cAAc,EAAE,uCAA+B,CAAC,CAAA;AAC/E,CAAC"}