@sentry/browser 10.52.0 → 10.53.1

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 (507) hide show
  1. package/build/npm/cjs/dev/client.js +7 -7
  2. package/build/npm/cjs/dev/client.js.map +1 -1
  3. package/build/npm/cjs/dev/diagnose-sdk.js +3 -3
  4. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
  5. package/build/npm/cjs/dev/eventbuilder.js +23 -23
  6. package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
  7. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
  8. package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
  9. package/build/npm/cjs/dev/helpers.js +10 -10
  10. package/build/npm/cjs/dev/helpers.js.map +1 -1
  11. package/build/npm/cjs/dev/index.js +84 -84
  12. package/build/npm/cjs/dev/integrations/breadcrumbs.js +29 -29
  13. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
  14. package/build/npm/cjs/dev/integrations/browserapierrors.js +16 -16
  15. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
  16. package/build/npm/cjs/dev/integrations/browsersession.js +9 -9
  17. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
  18. package/build/npm/cjs/dev/integrations/contextlines.js +5 -5
  19. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
  20. package/build/npm/cjs/dev/integrations/culturecontext.js +3 -3
  21. package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
  22. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +2 -2
  23. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  24. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +5 -5
  25. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  26. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +7 -7
  27. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  28. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -5
  29. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  30. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +7 -7
  31. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  32. package/build/npm/cjs/dev/integrations/globalhandlers.js +16 -16
  33. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
  34. package/build/npm/cjs/dev/integrations/graphqlClient.js +9 -9
  35. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  36. package/build/npm/cjs/dev/integrations/httpclient.js +14 -14
  37. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  38. package/build/npm/cjs/dev/integrations/httpcontext.js +3 -3
  39. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  40. package/build/npm/cjs/dev/integrations/linkederrors.js +3 -3
  41. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
  42. package/build/npm/cjs/dev/integrations/reportingobserver.js +7 -7
  43. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
  44. package/build/npm/cjs/dev/integrations/spanstreaming.js +10 -10
  45. package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
  46. package/build/npm/cjs/dev/integrations/spotlight.js +6 -6
  47. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  48. package/build/npm/cjs/dev/integrations/view-hierarchy.js +3 -3
  49. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
  50. package/build/npm/cjs/dev/integrations/webWorker.js +18 -18
  51. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
  52. package/build/npm/cjs/dev/profiling/UIProfiler.js +43 -33
  53. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
  54. package/build/npm/cjs/dev/profiling/index.js +7 -7
  55. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  56. package/build/npm/cjs/dev/profiling/integration.js +20 -18
  57. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  58. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +14 -11
  59. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
  60. package/build/npm/cjs/dev/profiling/utils.js +39 -68
  61. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  62. package/build/npm/cjs/dev/report-dialog.js +7 -7
  63. package/build/npm/cjs/dev/report-dialog.js.map +1 -1
  64. package/build/npm/cjs/dev/sdk.js +8 -8
  65. package/build/npm/cjs/dev/sdk.js.map +1 -1
  66. package/build/npm/cjs/dev/stack-parsers.js +10 -10
  67. package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
  68. package/build/npm/cjs/dev/tracing/backgroundtab.js +7 -7
  69. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  70. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +52 -52
  71. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  72. package/build/npm/cjs/dev/tracing/linkedTraces.js +11 -11
  73. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  74. package/build/npm/cjs/dev/tracing/reportPageLoaded.js +2 -2
  75. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
  76. package/build/npm/cjs/dev/tracing/request.js +28 -28
  77. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  78. package/build/npm/cjs/dev/tracing/setActiveSpan.js +5 -5
  79. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
  80. package/build/npm/cjs/dev/transports/fetch.js +3 -3
  81. package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
  82. package/build/npm/cjs/dev/transports/offline.js +5 -5
  83. package/build/npm/cjs/dev/transports/offline.js.map +1 -1
  84. package/build/npm/cjs/dev/userfeedback.js +3 -3
  85. package/build/npm/cjs/dev/userfeedback.js.map +1 -1
  86. package/build/npm/cjs/dev/utils/detectBrowserExtension.js +3 -3
  87. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
  88. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +3 -3
  89. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
  90. package/build/npm/cjs/prod/client.js +7 -7
  91. package/build/npm/cjs/prod/client.js.map +1 -1
  92. package/build/npm/cjs/prod/diagnose-sdk.js +3 -3
  93. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
  94. package/build/npm/cjs/prod/eventbuilder.js +23 -23
  95. package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
  96. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
  97. package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
  98. package/build/npm/cjs/prod/helpers.js +10 -10
  99. package/build/npm/cjs/prod/helpers.js.map +1 -1
  100. package/build/npm/cjs/prod/index.js +84 -84
  101. package/build/npm/cjs/prod/integrations/breadcrumbs.js +29 -29
  102. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
  103. package/build/npm/cjs/prod/integrations/browserapierrors.js +16 -16
  104. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
  105. package/build/npm/cjs/prod/integrations/browsersession.js +9 -9
  106. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
  107. package/build/npm/cjs/prod/integrations/contextlines.js +5 -5
  108. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
  109. package/build/npm/cjs/prod/integrations/culturecontext.js +3 -3
  110. package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
  111. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +2 -2
  112. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  113. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +5 -5
  114. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  115. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +7 -7
  116. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  117. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -5
  118. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  119. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +7 -7
  120. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  121. package/build/npm/cjs/prod/integrations/globalhandlers.js +16 -16
  122. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
  123. package/build/npm/cjs/prod/integrations/graphqlClient.js +9 -9
  124. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  125. package/build/npm/cjs/prod/integrations/httpclient.js +14 -14
  126. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  127. package/build/npm/cjs/prod/integrations/httpcontext.js +3 -3
  128. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  129. package/build/npm/cjs/prod/integrations/linkederrors.js +3 -3
  130. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
  131. package/build/npm/cjs/prod/integrations/reportingobserver.js +7 -7
  132. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
  133. package/build/npm/cjs/prod/integrations/spanstreaming.js +10 -10
  134. package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
  135. package/build/npm/cjs/prod/integrations/spotlight.js +6 -6
  136. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  137. package/build/npm/cjs/prod/integrations/view-hierarchy.js +3 -3
  138. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
  139. package/build/npm/cjs/prod/integrations/webWorker.js +18 -18
  140. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
  141. package/build/npm/cjs/prod/profiling/UIProfiler.js +43 -33
  142. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
  143. package/build/npm/cjs/prod/profiling/index.js +7 -7
  144. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  145. package/build/npm/cjs/prod/profiling/integration.js +20 -18
  146. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  147. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +14 -11
  148. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
  149. package/build/npm/cjs/prod/profiling/utils.js +39 -68
  150. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  151. package/build/npm/cjs/prod/report-dialog.js +7 -7
  152. package/build/npm/cjs/prod/report-dialog.js.map +1 -1
  153. package/build/npm/cjs/prod/sdk.js +8 -8
  154. package/build/npm/cjs/prod/sdk.js.map +1 -1
  155. package/build/npm/cjs/prod/stack-parsers.js +10 -10
  156. package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
  157. package/build/npm/cjs/prod/tracing/backgroundtab.js +7 -7
  158. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  159. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +52 -52
  160. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  161. package/build/npm/cjs/prod/tracing/linkedTraces.js +11 -11
  162. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  163. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +2 -2
  164. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
  165. package/build/npm/cjs/prod/tracing/request.js +28 -28
  166. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  167. package/build/npm/cjs/prod/tracing/setActiveSpan.js +5 -5
  168. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
  169. package/build/npm/cjs/prod/transports/fetch.js +3 -3
  170. package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
  171. package/build/npm/cjs/prod/transports/offline.js +5 -5
  172. package/build/npm/cjs/prod/transports/offline.js.map +1 -1
  173. package/build/npm/cjs/prod/userfeedback.js +3 -3
  174. package/build/npm/cjs/prod/userfeedback.js.map +1 -1
  175. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +3 -3
  176. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
  177. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +3 -3
  178. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
  179. package/build/npm/esm/dev/client.js +1 -1
  180. package/build/npm/esm/dev/client.js.map +1 -1
  181. package/build/npm/esm/dev/diagnose-sdk.js +1 -1
  182. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
  183. package/build/npm/esm/dev/eventbuilder.js +1 -1
  184. package/build/npm/esm/dev/eventbuilder.js.map +1 -1
  185. package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
  186. package/build/npm/esm/dev/feedbackSync.js.map +1 -1
  187. package/build/npm/esm/dev/helpers.js +1 -1
  188. package/build/npm/esm/dev/helpers.js.map +1 -1
  189. package/build/npm/esm/dev/index.js +1 -1
  190. package/build/npm/esm/dev/integrations/breadcrumbs.js +1 -1
  191. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
  192. package/build/npm/esm/dev/integrations/browserapierrors.js +1 -1
  193. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
  194. package/build/npm/esm/dev/integrations/browsersession.js +1 -1
  195. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
  196. package/build/npm/esm/dev/integrations/contextlines.js +1 -1
  197. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
  198. package/build/npm/esm/dev/integrations/culturecontext.js +1 -1
  199. package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
  200. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -1
  201. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  202. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +1 -1
  203. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  204. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +1 -1
  205. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  206. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +1 -1
  207. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  208. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +1 -1
  209. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  210. package/build/npm/esm/dev/integrations/globalhandlers.js +1 -1
  211. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
  212. package/build/npm/esm/dev/integrations/graphqlClient.js +1 -1
  213. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  214. package/build/npm/esm/dev/integrations/httpclient.js +1 -1
  215. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  216. package/build/npm/esm/dev/integrations/httpcontext.js +1 -1
  217. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  218. package/build/npm/esm/dev/integrations/linkederrors.js +1 -1
  219. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
  220. package/build/npm/esm/dev/integrations/reportingobserver.js +1 -1
  221. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
  222. package/build/npm/esm/dev/integrations/spanstreaming.js +1 -1
  223. package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
  224. package/build/npm/esm/dev/integrations/spotlight.js +1 -1
  225. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  226. package/build/npm/esm/dev/integrations/view-hierarchy.js +1 -1
  227. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
  228. package/build/npm/esm/dev/integrations/webWorker.js +1 -1
  229. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
  230. package/build/npm/esm/dev/package.json +1 -1
  231. package/build/npm/esm/dev/profiling/UIProfiler.js +12 -2
  232. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
  233. package/build/npm/esm/dev/profiling/index.js +1 -1
  234. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  235. package/build/npm/esm/dev/profiling/integration.js +9 -7
  236. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  237. package/build/npm/esm/dev/profiling/startProfileForSpan.js +5 -2
  238. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
  239. package/build/npm/esm/dev/profiling/utils.js +6 -36
  240. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  241. package/build/npm/esm/dev/report-dialog.js +1 -1
  242. package/build/npm/esm/dev/report-dialog.js.map +1 -1
  243. package/build/npm/esm/dev/sdk.js +1 -1
  244. package/build/npm/esm/dev/sdk.js.map +1 -1
  245. package/build/npm/esm/dev/stack-parsers.js +1 -1
  246. package/build/npm/esm/dev/stack-parsers.js.map +1 -1
  247. package/build/npm/esm/dev/tracing/backgroundtab.js +1 -1
  248. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  249. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +1 -1
  250. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  251. package/build/npm/esm/dev/tracing/linkedTraces.js +2 -2
  252. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  253. package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -1
  254. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
  255. package/build/npm/esm/dev/tracing/request.js +1 -1
  256. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  257. package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -1
  258. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
  259. package/build/npm/esm/dev/transports/fetch.js +1 -1
  260. package/build/npm/esm/dev/transports/fetch.js.map +1 -1
  261. package/build/npm/esm/dev/transports/offline.js +1 -1
  262. package/build/npm/esm/dev/transports/offline.js.map +1 -1
  263. package/build/npm/esm/dev/userfeedback.js +1 -1
  264. package/build/npm/esm/dev/userfeedback.js.map +1 -1
  265. package/build/npm/esm/dev/utils/detectBrowserExtension.js +1 -1
  266. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
  267. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +1 -1
  268. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
  269. package/build/npm/esm/prod/client.js +1 -1
  270. package/build/npm/esm/prod/client.js.map +1 -1
  271. package/build/npm/esm/prod/diagnose-sdk.js +1 -1
  272. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
  273. package/build/npm/esm/prod/eventbuilder.js +1 -1
  274. package/build/npm/esm/prod/eventbuilder.js.map +1 -1
  275. package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
  276. package/build/npm/esm/prod/feedbackSync.js.map +1 -1
  277. package/build/npm/esm/prod/helpers.js +1 -1
  278. package/build/npm/esm/prod/helpers.js.map +1 -1
  279. package/build/npm/esm/prod/index.js +1 -1
  280. package/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
  281. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
  282. package/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
  283. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
  284. package/build/npm/esm/prod/integrations/browsersession.js +1 -1
  285. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
  286. package/build/npm/esm/prod/integrations/contextlines.js +1 -1
  287. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
  288. package/build/npm/esm/prod/integrations/culturecontext.js +1 -1
  289. package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
  290. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -1
  291. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  292. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +1 -1
  293. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  294. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +1 -1
  295. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  296. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +1 -1
  297. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  298. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +1 -1
  299. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  300. package/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
  301. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
  302. package/build/npm/esm/prod/integrations/graphqlClient.js +1 -1
  303. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  304. package/build/npm/esm/prod/integrations/httpclient.js +1 -1
  305. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  306. package/build/npm/esm/prod/integrations/httpcontext.js +1 -1
  307. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  308. package/build/npm/esm/prod/integrations/linkederrors.js +1 -1
  309. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
  310. package/build/npm/esm/prod/integrations/reportingobserver.js +1 -1
  311. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
  312. package/build/npm/esm/prod/integrations/spanstreaming.js +1 -1
  313. package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
  314. package/build/npm/esm/prod/integrations/spotlight.js +1 -1
  315. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  316. package/build/npm/esm/prod/integrations/view-hierarchy.js +1 -1
  317. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
  318. package/build/npm/esm/prod/integrations/webWorker.js +1 -1
  319. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
  320. package/build/npm/esm/prod/package.json +1 -1
  321. package/build/npm/esm/prod/profiling/UIProfiler.js +12 -2
  322. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
  323. package/build/npm/esm/prod/profiling/index.js +1 -1
  324. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  325. package/build/npm/esm/prod/profiling/integration.js +9 -7
  326. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  327. package/build/npm/esm/prod/profiling/startProfileForSpan.js +5 -2
  328. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
  329. package/build/npm/esm/prod/profiling/utils.js +6 -36
  330. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  331. package/build/npm/esm/prod/report-dialog.js +1 -1
  332. package/build/npm/esm/prod/report-dialog.js.map +1 -1
  333. package/build/npm/esm/prod/sdk.js +1 -1
  334. package/build/npm/esm/prod/sdk.js.map +1 -1
  335. package/build/npm/esm/prod/stack-parsers.js +1 -1
  336. package/build/npm/esm/prod/stack-parsers.js.map +1 -1
  337. package/build/npm/esm/prod/tracing/backgroundtab.js +1 -1
  338. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  339. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +1 -1
  340. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  341. package/build/npm/esm/prod/tracing/linkedTraces.js +2 -2
  342. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  343. package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -1
  344. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
  345. package/build/npm/esm/prod/tracing/request.js +1 -1
  346. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  347. package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -1
  348. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
  349. package/build/npm/esm/prod/transports/fetch.js +1 -1
  350. package/build/npm/esm/prod/transports/fetch.js.map +1 -1
  351. package/build/npm/esm/prod/transports/offline.js +1 -1
  352. package/build/npm/esm/prod/transports/offline.js.map +1 -1
  353. package/build/npm/esm/prod/userfeedback.js +1 -1
  354. package/build/npm/esm/prod/userfeedback.js.map +1 -1
  355. package/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
  356. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
  357. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +1 -1
  358. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
  359. package/build/npm/types/client.d.ts +2 -2
  360. package/build/npm/types/client.d.ts.map +1 -1
  361. package/build/npm/types/eventbuilder.d.ts +1 -1
  362. package/build/npm/types/eventbuilder.d.ts.map +1 -1
  363. package/build/npm/types/exports.d.ts +3 -3
  364. package/build/npm/types/exports.d.ts.map +1 -1
  365. package/build/npm/types/feedbackAsync.d.ts +2 -7
  366. package/build/npm/types/feedbackAsync.d.ts.map +1 -1
  367. package/build/npm/types/feedbackSync.d.ts +2 -7
  368. package/build/npm/types/feedbackSync.d.ts.map +1 -1
  369. package/build/npm/types/helpers.d.ts +2 -2
  370. package/build/npm/types/helpers.d.ts.map +1 -1
  371. package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
  372. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  373. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
  374. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  375. package/build/npm/types/index.bundle.tracing.d.ts +1 -1
  376. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  377. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +2 -2
  378. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  379. package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -1
  380. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  381. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -1
  382. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  383. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  384. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  385. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
  386. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  387. package/build/npm/types/index.d.ts +3 -3
  388. package/build/npm/types/index.d.ts.map +1 -1
  389. package/build/npm/types/integrations/contextlines.d.ts +1 -1
  390. package/build/npm/types/integrations/contextlines.d.ts.map +1 -1
  391. package/build/npm/types/integrations/globalhandlers.d.ts +1 -1
  392. package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
  393. package/build/npm/types/integrations/view-hierarchy.d.ts +1 -1
  394. package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
  395. package/build/npm/types/integrations/webWorker.d.ts +1 -1
  396. package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
  397. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +1 -1
  398. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -1
  399. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
  400. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -1
  401. package/build/npm/types/integrations-bundle/index.dedupe.d.ts +1 -1
  402. package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -1
  403. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +1 -1
  404. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -1
  405. package/build/npm/types/integrations-bundle/index.feedback.d.ts +1 -1
  406. package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -1
  407. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
  408. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -1
  409. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
  410. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -1
  411. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
  412. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -1
  413. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
  414. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -1
  415. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
  416. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -1
  417. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +1 -1
  418. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -1
  419. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +1 -1
  420. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -1
  421. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  422. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -1
  423. package/build/npm/types/profiling/UIProfiler.d.ts +1 -1
  424. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
  425. package/build/npm/types/profiling/index.d.ts +1 -1
  426. package/build/npm/types/profiling/index.d.ts.map +1 -1
  427. package/build/npm/types/profiling/integration.d.ts.map +1 -1
  428. package/build/npm/types/profiling/startProfileForSpan.d.ts +1 -1
  429. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -1
  430. package/build/npm/types/profiling/utils.d.ts +3 -5
  431. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  432. package/build/npm/types/report-dialog.d.ts +1 -1
  433. package/build/npm/types/report-dialog.d.ts.map +1 -1
  434. package/build/npm/types/sdk.d.ts +1 -1
  435. package/build/npm/types/sdk.d.ts.map +1 -1
  436. package/build/npm/types/stack-parsers.d.ts +1 -1
  437. package/build/npm/types/stack-parsers.d.ts.map +1 -1
  438. package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -1
  439. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  440. package/build/npm/types/tracing/linkedTraces.d.ts +2 -2
  441. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
  442. package/build/npm/types/tracing/reportPageLoaded.d.ts +1 -1
  443. package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -1
  444. package/build/npm/types/tracing/request.d.ts +1 -1
  445. package/build/npm/types/tracing/request.d.ts.map +1 -1
  446. package/build/npm/types/tracing/setActiveSpan.d.ts +1 -1
  447. package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -1
  448. package/build/npm/types/transports/fetch.d.ts +1 -1
  449. package/build/npm/types/transports/fetch.d.ts.map +1 -1
  450. package/build/npm/types/transports/offline.d.ts +1 -1
  451. package/build/npm/types/transports/offline.d.ts.map +1 -1
  452. package/build/npm/types/transports/types.d.ts +1 -1
  453. package/build/npm/types/transports/types.d.ts.map +1 -1
  454. package/build/npm/types/userfeedback.d.ts +1 -1
  455. package/build/npm/types/userfeedback.d.ts.map +1 -1
  456. package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
  457. package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
  458. package/build/npm/types-ts3.8/client.d.ts +2 -2
  459. package/build/npm/types-ts3.8/eventbuilder.d.ts +1 -1
  460. package/build/npm/types-ts3.8/exports.d.ts +3 -3
  461. package/build/npm/types-ts3.8/feedbackAsync.d.ts +2 -7
  462. package/build/npm/types-ts3.8/feedbackSync.d.ts +2 -7
  463. package/build/npm/types-ts3.8/helpers.d.ts +2 -2
  464. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +1 -1
  465. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +1 -1
  466. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -1
  467. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +2 -2
  468. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -1
  469. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -1
  470. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  471. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
  472. package/build/npm/types-ts3.8/index.d.ts +3 -3
  473. package/build/npm/types-ts3.8/integrations/contextlines.d.ts +1 -1
  474. package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +1 -1
  475. package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +1 -1
  476. package/build/npm/types-ts3.8/integrations/webWorker.d.ts +1 -1
  477. package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +1 -1
  478. package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
  479. package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +1 -1
  480. package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +1 -1
  481. package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +1 -1
  482. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
  483. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
  484. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
  485. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
  486. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
  487. package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +1 -1
  488. package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +1 -1
  489. package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  490. package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +1 -1
  491. package/build/npm/types-ts3.8/profiling/index.d.ts +1 -1
  492. package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +1 -1
  493. package/build/npm/types-ts3.8/profiling/utils.d.ts +3 -5
  494. package/build/npm/types-ts3.8/report-dialog.d.ts +1 -1
  495. package/build/npm/types-ts3.8/sdk.d.ts +1 -1
  496. package/build/npm/types-ts3.8/stack-parsers.d.ts +1 -1
  497. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +1 -1
  498. package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +2 -2
  499. package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +1 -1
  500. package/build/npm/types-ts3.8/tracing/request.d.ts +1 -1
  501. package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +1 -1
  502. package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
  503. package/build/npm/types-ts3.8/transports/offline.d.ts +1 -1
  504. package/build/npm/types-ts3.8/transports/types.d.ts +1 -1
  505. package/build/npm/types-ts3.8/userfeedback.d.ts +1 -1
  506. package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +1 -1
  507. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../src/profiling/utils.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n Client,\n ContinuousThreadCpuProfile,\n DebugImage,\n Envelope,\n Event,\n EventEnvelope,\n Profile,\n ProfileChunk,\n Span,\n ThreadCpuProfile,\n} from '@sentry/core';\nimport {\n browserPerformanceTimeOrigin,\n debug,\n DEFAULT_ENVIRONMENT,\n forEachEnvelopeItem,\n getClient,\n getDebugImagesForResources,\n GLOBAL_OBJ,\n spanToJSON,\n timestampInSeconds,\n uuid4,\n} from '@sentry/core';\nimport type { BrowserOptions } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile, JSSelfProfiler, JSSelfProfilerConstructor, JSSelfProfileStack } from './jsSelfProfiling';\n\nconst MS_TO_NS = 1e6;\n\n// Checking if we are in Main or Worker thread: `self` (not `window`) is the `globalThis` in Web Workers and `importScripts` are only available in Web Workers\nconst isMainThread = 'window' in GLOBAL_OBJ && GLOBAL_OBJ.window === GLOBAL_OBJ && typeof importScripts === 'undefined';\n\n// Setting ID to 0 as we cannot get an ID from Web Workers\nexport const PROFILER_THREAD_ID_STRING = String(0);\nexport const PROFILER_THREAD_NAME = isMainThread ? 'main' : 'worker';\n\n// We force make this optional to be on the safe side...\nconst navigator = WINDOW.navigator as typeof WINDOW.navigator | undefined;\n\n// Machine properties (eval only once)\nlet OS_PLATFORM = '';\nlet OS_PLATFORM_VERSION = '';\nlet OS_ARCH = '';\nlet OS_BROWSER = navigator?.userAgent || '';\nlet OS_MODEL = '';\nconst OS_LOCALE = navigator?.language || navigator?.languages?.[0] || '';\n\ntype UAData = {\n platform?: string;\n architecture?: string;\n model?: string;\n platformVersion?: string;\n fullVersionList?: {\n brand: string;\n version: string;\n }[];\n};\n\ninterface UserAgentData {\n getHighEntropyValues: (keys: string[]) => Promise<UAData>;\n}\n\nfunction isUserAgentData(data: unknown): data is UserAgentData {\n return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;\n}\n\n// @ts-expect-error userAgentData is not part of the navigator interface yet\nconst userAgentData = navigator?.userAgentData;\n\nif (isUserAgentData(userAgentData)) {\n userAgentData\n .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])\n .then((ua: UAData) => {\n OS_PLATFORM = ua.platform || '';\n OS_ARCH = ua.architecture || '';\n OS_MODEL = ua.model || '';\n OS_PLATFORM_VERSION = ua.platformVersion || '';\n\n if (ua.fullVersionList?.length) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1]!;\n OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;\n }\n })\n .catch(e => void e);\n}\n\nfunction isProcessedJSSelfProfile(profile: ThreadCpuProfile | JSSelfProfile): profile is JSSelfProfile {\n return !('thread_metadata' in profile);\n}\n\n// Enriches the profile with threadId of the current thread.\n// This is done in node as we seem to not be able to get the info from C native code.\n/**\n *\n */\nexport function enrichWithThreadInformation(profile: ThreadCpuProfile | JSSelfProfile): ThreadCpuProfile {\n if (!isProcessedJSSelfProfile(profile)) {\n return profile;\n }\n\n return convertJSSelfProfileToSampledFormat(profile);\n}\n\n// Profile is marked as optional because it is deleted from the metadata\n// by the integration before the event is processed by other integrations.\nexport interface ProfiledEvent extends Event {\n sdkProcessingMetadata: {\n profile?: JSSelfProfile;\n };\n}\n\nfunction getTraceId(event: Event): string {\n const traceId: unknown = event.contexts?.trace?.trace_id;\n // Log a warning if the profile has an invalid traceId (should be uuidv4).\n // All profiles and transactions are rejected if this is the case and we want to\n // warn users that this is happening if they enable debug flag\n if (typeof traceId === 'string' && traceId.length !== 32) {\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);\n }\n }\n if (typeof traceId !== 'string') {\n return '';\n }\n\n return traceId;\n}\n/**\n * Creates a profiling event envelope from a Sentry event. If profile does not pass\n * validation, returns null.\n * @param event\n * @param dsn\n * @param metadata\n * @param tunnel\n * @returns {EventEnvelope | null}\n */\n\n/**\n * Creates a profiling event envelope from a Sentry event.\n */\nexport function createProfilePayload(\n profile_id: string,\n start_timestamp: number | undefined,\n processed_profile: JSSelfProfile,\n event: ProfiledEvent,\n): Profile {\n if (event.type !== 'transaction') {\n // createProfilingEventEnvelope should only be called for transactions,\n // we type guard this behavior with isProfiledTransactionEvent.\n throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');\n }\n\n if (processed_profile === undefined || processed_profile === null) {\n throw new TypeError(\n `Cannot construct profiling event envelope without a valid profile. Got ${processed_profile} instead.`,\n );\n }\n\n const traceId = getTraceId(event);\n const enrichedThreadProfile = enrichWithThreadInformation(processed_profile);\n const transactionStartMs = start_timestamp\n ? start_timestamp\n : typeof event.start_timestamp === 'number'\n ? event.start_timestamp * 1000\n : timestampInSeconds() * 1000;\n const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : timestampInSeconds() * 1000;\n\n const profile: Profile = {\n event_id: profile_id,\n timestamp: new Date(transactionStartMs).toISOString(),\n platform: 'javascript',\n version: '1',\n release: event.release || '',\n environment: event.environment || DEFAULT_ENVIRONMENT,\n runtime: {\n name: 'javascript',\n version: WINDOW.navigator.userAgent,\n },\n os: {\n name: OS_PLATFORM,\n version: OS_PLATFORM_VERSION,\n build_number: OS_BROWSER,\n },\n device: {\n locale: OS_LOCALE,\n model: OS_MODEL,\n manufacturer: OS_BROWSER,\n architecture: OS_ARCH,\n is_emulator: false,\n },\n debug_meta: {\n images: applyDebugMetadata(processed_profile.resources),\n },\n profile: enrichedThreadProfile,\n transactions: [\n {\n name: event.transaction || '',\n id: event.event_id || uuid4(),\n trace_id: traceId,\n active_thread_id: PROFILER_THREAD_ID_STRING,\n relative_start_ns: '0',\n relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),\n },\n ],\n };\n\n return profile;\n}\n\n/**\n * Create a profile chunk envelope item\n */\nexport function createProfileChunkPayload(\n jsSelfProfile: JSSelfProfile,\n client: Client,\n profilerId?: string,\n): ProfileChunk {\n // only == to catch null and undefined\n if (jsSelfProfile == null) {\n throw new TypeError(\n `Cannot construct profiling event envelope without a valid profile. Got ${jsSelfProfile} instead.`,\n );\n }\n\n const continuousProfile = convertToContinuousProfile(jsSelfProfile);\n\n const options = client.getOptions();\n const sdk = client.getSdkMetadata?.()?.sdk;\n\n return {\n chunk_id: uuid4(),\n client_sdk: {\n name: sdk?.name ?? 'sentry.javascript.browser',\n version: sdk?.version ?? '0.0.0',\n },\n profiler_id: profilerId || uuid4(),\n platform: 'javascript',\n version: '2',\n release: options.release ?? '',\n environment: options.environment ?? 'production',\n debug_meta: {\n // function name obfuscation\n images: applyDebugMetadata(jsSelfProfile.resources),\n },\n profile: continuousProfile,\n };\n}\n\n/**\n * Validate a profile chunk against the Sample Format V2 requirements.\n * https://develop.sentry.dev/sdk/telemetry/profiles/sample-format-v2/\n * - Presence of samples, stacks, frames\n * - Required metadata fields\n */\nexport function validateProfileChunk(chunk: ProfileChunk): { valid: true } | { reason: string } {\n try {\n // Required metadata\n if (!chunk || typeof chunk !== 'object') {\n return { reason: 'chunk is not an object' };\n }\n\n // profiler_id and chunk_id must be 32 lowercase hex chars\n const isHex32 = (val: unknown): boolean => typeof val === 'string' && /^[a-f0-9]{32}$/.test(val);\n if (!isHex32(chunk.profiler_id)) {\n return { reason: 'missing or invalid profiler_id' };\n }\n if (!isHex32(chunk.chunk_id)) {\n return { reason: 'missing or invalid chunk_id' };\n }\n\n if (!chunk.client_sdk) {\n return { reason: 'missing client_sdk metadata' };\n }\n\n // Profile data must have frames, stacks, samples\n const profile = chunk.profile as { frames?: unknown[]; stacks?: unknown[]; samples?: unknown[] } | undefined;\n if (!profile) {\n return { reason: 'missing profile data' };\n }\n\n if (!Array.isArray(profile.frames) || !profile.frames.length) {\n return { reason: 'profile has no frames' };\n }\n if (!Array.isArray(profile.stacks) || !profile.stacks.length) {\n return { reason: 'profile has no stacks' };\n }\n if (!Array.isArray(profile.samples) || !profile.samples.length) {\n return { reason: 'profile has no samples' };\n }\n\n return { valid: true };\n } catch (e) {\n return { reason: `unknown validation error: ${e}` };\n }\n}\n\n/**\n * Convert from JSSelfProfile format to ContinuousThreadCpuProfile format.\n */\nfunction convertToContinuousProfile(input: {\n frames: { name: string; resourceId?: number; line?: number; column?: number }[];\n stacks: { frameId: number; parentId?: number }[];\n samples: { timestamp: number; stackId?: number }[];\n resources: string[];\n}): ContinuousThreadCpuProfile {\n // Frames map 1:1 by index; fill only when present to avoid sparse writes\n const frames: ContinuousThreadCpuProfile['frames'] = [];\n for (let i = 0; i < input.frames.length; i++) {\n const frame = input.frames[i];\n if (!frame) {\n continue;\n }\n frames[i] = {\n function: frame.name,\n abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,\n lineno: frame.line,\n colno: frame.column,\n };\n }\n\n // Build stacks by following parent links, top->down order (root last)\n const stacks: ContinuousThreadCpuProfile['stacks'] = [];\n for (let i = 0; i < input.stacks.length; i++) {\n const stackHead = input.stacks[i];\n if (!stackHead) {\n continue;\n }\n const list: number[] = [];\n let current: { frameId: number; parentId?: number } | undefined = stackHead;\n while (current) {\n list.push(current.frameId);\n current = current.parentId === undefined ? undefined : input.stacks[current.parentId];\n }\n stacks[i] = list;\n }\n\n // Align timestamps to SDK time origin to match span/event timelines\n const perfOrigin = browserPerformanceTimeOrigin();\n const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0;\n const adjustForOriginChange = origin - (perfOrigin || origin);\n\n const samples: ContinuousThreadCpuProfile['samples'] = [];\n for (let i = 0; i < input.samples.length; i++) {\n const sample = input.samples[i];\n if (!sample) {\n continue;\n }\n // Convert ms to seconds epoch-based timestamp\n const timestampSeconds = (origin + (sample.timestamp - adjustForOriginChange)) / 1000;\n samples[i] = {\n stack_id: sample.stackId ?? 0,\n thread_id: PROFILER_THREAD_ID_STRING,\n timestamp: timestampSeconds,\n };\n }\n\n return {\n frames,\n stacks,\n samples,\n thread_metadata: { [PROFILER_THREAD_ID_STRING]: { name: PROFILER_THREAD_NAME } },\n };\n}\n\n/**\n *\n */\nexport function isProfiledTransactionEvent(event: Event): event is ProfiledEvent {\n return !!event.sdkProcessingMetadata?.profile;\n}\n\n/*\n See packages/browser-utils/src/browser/router.ts\n*/\n/**\n *\n */\nexport function isAutomatedPageLoadSpan(span: Span): boolean {\n return spanToJSON(span).op === 'pageload';\n}\n\n/**\n * Converts a JSSelfProfile to a our sampled format.\n * Does not currently perform stack indexing.\n */\nexport function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profile['profile'] {\n let EMPTY_STACK_ID: undefined | number = undefined;\n let STACK_ID = 0;\n\n // Initialize the profile that we will fill with data\n const profile: Profile['profile'] = {\n samples: [],\n stacks: [],\n frames: [],\n thread_metadata: {\n [PROFILER_THREAD_ID_STRING]: { name: PROFILER_THREAD_NAME },\n },\n };\n\n const firstSample = input.samples[0];\n if (!firstSample) {\n return profile;\n }\n\n // We assert samples.length > 0 above and timestamp should always be present\n const start = firstSample.timestamp;\n // The JS SDK might change it's time origin based on some heuristic (see See packages/utils/src/time.ts)\n // when that happens, we need to ensure we are correcting the profile timings so the two timelines stay in sync.\n // Since JS self profiling time origin is always initialized to performance.timeOrigin, we need to adjust for\n // the drift between the SDK selected value and our profile time origin.\n const perfOrigin = browserPerformanceTimeOrigin();\n const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0;\n const adjustForOriginChange = origin - (perfOrigin || origin);\n\n input.samples.forEach((jsSample, i) => {\n // If sample has no stack, add an empty sample\n if (jsSample.stackId === undefined) {\n if (EMPTY_STACK_ID === undefined) {\n EMPTY_STACK_ID = STACK_ID;\n profile.stacks[EMPTY_STACK_ID] = [];\n STACK_ID++;\n }\n\n profile['samples'][i] = {\n // convert ms timestamp to ns\n elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0),\n stack_id: EMPTY_STACK_ID,\n thread_id: PROFILER_THREAD_ID_STRING,\n };\n return;\n }\n\n let stackTop: JSSelfProfileStack | undefined = input.stacks[jsSample.stackId];\n\n // Functions in top->down order (root is last)\n // We follow the stackTop.parentId trail and collect each visited frameId\n const stack: number[] = [];\n\n while (stackTop) {\n stack.push(stackTop.frameId);\n\n const frame = input.frames[stackTop.frameId];\n\n // If our frame has not been indexed yet, index it\n if (frame && profile.frames[stackTop.frameId] === undefined) {\n profile.frames[stackTop.frameId] = {\n function: frame.name,\n abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,\n lineno: frame.line,\n colno: frame.column,\n };\n }\n\n stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];\n }\n\n const sample: Profile['profile']['samples'][0] = {\n // convert ms timestamp to ns\n elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0),\n stack_id: STACK_ID,\n thread_id: PROFILER_THREAD_ID_STRING,\n };\n\n profile['stacks'][STACK_ID] = stack;\n profile['samples'][i] = sample;\n STACK_ID++;\n });\n\n return profile;\n}\n\n/**\n * Adds items to envelope if they are not already present - mutates the envelope.\n * @param envelope\n */\nexport function addProfilesToEnvelope(envelope: EventEnvelope, profiles: Profile[]): Envelope {\n if (!profiles.length) {\n return envelope;\n }\n\n for (const profile of profiles) {\n envelope[1].push([{ type: 'profile' }, profile]);\n }\n return envelope;\n}\n\n/**\n * Finds transactions with profile_id context in the envelope\n * @param envelope\n * @returns\n */\nexport function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[] {\n const events: Event[] = [];\n\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type !== 'transaction') {\n return;\n }\n\n for (let j = 1; j < item.length; j++) {\n const event = item[j] as Event;\n\n if (event?.contexts?.profile?.profile_id) {\n events.push(item[j] as Event);\n }\n }\n });\n\n return events;\n}\n\n/**\n * Applies debug meta data to an event from a list of paths to resources (sourcemaps)\n */\nexport function applyDebugMetadata(resource_paths: ReadonlyArray<string>): DebugImage[] {\n const client = getClient();\n const options = client?.getOptions();\n const stackParser = options?.stackParser;\n\n if (!stackParser) {\n return [];\n }\n\n return getDebugImagesForResources(stackParser, resource_paths);\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nexport function isValidSampleRate(rate: unknown): boolean {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n if ((typeof rate !== 'number' && typeof rate !== 'boolean') || (typeof rate === 'number' && isNaN(rate))) {\n DEBUG_BUILD &&\n debug.warn(\n `[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // Boolean sample rates are always valid\n if (rate === true || rate === false) {\n return true;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD && debug.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nfunction isValidProfile(profile: JSSelfProfile): profile is JSSelfProfile & { profile_id: string } {\n if (profile.samples.length < 2) {\n if (DEBUG_BUILD) {\n // Log a warning if the profile has less than 2 samples so users can know why\n // they are not seeing any profiling data and we cant avoid the back and forth\n // of asking them to provide us with a dump of the profile data.\n debug.log('[Profiling] Discarding profile because it contains less than 2 samples');\n }\n return false;\n }\n\n if (!profile.frames.length) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] Discarding profile because it contains no frames');\n }\n return false;\n }\n\n return true;\n}\n\n// Keep a flag value to avoid re-initializing the profiler constructor. If it fails\n// once, it will always fail and this allows us to early return.\nlet PROFILING_CONSTRUCTOR_FAILED: boolean = false;\nexport const MAX_PROFILE_DURATION_MS = 30_000;\n\n/**\n * Check if profiler constructor is available.\n * @param maybeProfiler\n */\nfunction isJSProfilerSupported(maybeProfiler: unknown): maybeProfiler is typeof JSSelfProfilerConstructor {\n return typeof maybeProfiler === 'function';\n}\n\n/**\n * Starts the profiler and returns the profiler instance.\n */\nexport function startJSSelfProfile(): JSSelfProfiler | undefined {\n // Feature support check first\n const JSProfilerConstructor = WINDOW.Profiler;\n\n if (!isJSProfilerSupported(JSProfilerConstructor)) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.');\n }\n return;\n }\n\n // From initial testing, it seems that the minimum value for sampleInterval is 10ms.\n const samplingIntervalMS = 10;\n // Start the profiler\n const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);\n\n // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.\n // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens\n // as we risk breaking the user's application, so just disable profiling and log an error.\n try {\n return new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });\n } catch (_e) {\n if (DEBUG_BUILD) {\n debug.log(\n \"[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.\",\n );\n debug.log('[Profiling] Disabling profiling for current user session.');\n }\n PROFILING_CONSTRUCTOR_FAILED = true;\n }\n\n return;\n}\n\n/**\n * Determine if a profile should be profiled.\n */\nexport function shouldProfileSpanLegacy(span: Span): boolean {\n // If constructor failed once, it will always fail, so we can early return.\n if (PROFILING_CONSTRUCTOR_FAILED) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] Profiling has been disabled for the duration of the current user session.');\n }\n return false;\n }\n\n if (!span.isRecording()) {\n DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');\n return false;\n }\n\n const client = getClient();\n const options = client?.getOptions();\n if (!options) {\n DEBUG_BUILD && debug.log('[Profiling] Profiling disabled, no options found.');\n return false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const profilesSampleRate = (options as BrowserOptions).profilesSampleRate as\n | BrowserOptions['profilesSampleRate']\n | boolean;\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(profilesSampleRate)) {\n DEBUG_BUILD && debug.warn('[Profiling] Discarding profile because of invalid sample rate.');\n return false;\n }\n\n // if the function returned 0 (or false), or if `profileSampleRate` is 0, it's a sign the profile should be dropped\n if (!profilesSampleRate) {\n DEBUG_BUILD &&\n debug.log(\n '[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0',\n );\n return false;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n const sampled = profilesSampleRate === true ? true : Math.random() < profilesSampleRate;\n // Check if we should sample this profile\n if (!sampled) {\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(\n profilesSampleRate,\n )})`,\n );\n return false;\n }\n\n return true;\n}\n\n/**\n * Determine if a profile should be created for the current session.\n */\nexport function shouldProfileSession(options: BrowserOptions): boolean {\n // If constructor failed once, it will always fail, so we can early return.\n if (PROFILING_CONSTRUCTOR_FAILED) {\n if (DEBUG_BUILD) {\n debug.log(\n '[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.',\n );\n }\n return false;\n }\n\n if (options.profileLifecycle !== 'trace' && options.profileLifecycle !== 'manual') {\n DEBUG_BUILD && debug.warn('[Profiling] Session not sampled. Invalid `profileLifecycle` option.');\n return false;\n }\n\n // Session sampling: profileSessionSampleRate gates whether profiling is enabled for this session\n const profileSessionSampleRate = options.profileSessionSampleRate;\n\n if (!isValidSampleRate(profileSessionSampleRate)) {\n DEBUG_BUILD && debug.warn('[Profiling] Discarding profile because of invalid profileSessionSampleRate.');\n return false;\n }\n\n if (!profileSessionSampleRate) {\n DEBUG_BUILD &&\n debug.log('[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0');\n return false;\n }\n\n return Math.random() <= profileSessionSampleRate;\n}\n\n/**\n * Checks if legacy profiling is configured.\n */\nexport function hasLegacyProfiling(options: BrowserOptions): boolean {\n // eslint-disable-next-line deprecation/deprecation\n return typeof options.profilesSampleRate !== 'undefined';\n}\n\n/**\n * Creates a profiling envelope item, if the profile does not pass validation, returns null.\n * @param event\n * @returns {Profile | null}\n */\nexport function createProfilingEvent(\n profile_id: string,\n start_timestamp: number | undefined,\n profile: JSSelfProfile,\n event: ProfiledEvent,\n): Profile | null {\n if (!isValidProfile(profile)) {\n return null;\n }\n\n return createProfilePayload(profile_id, start_timestamp, profile, event);\n}\n\n// TODO (v8): We need to obtain profile ids in @sentry-internal/tracing,\n// but we don't have access to this map because importing this map would\n// cause a circular dependency. We need to resolve this in v8.\nconst PROFILE_MAP: Map<string, JSSelfProfile> = new Map();\n/**\n *\n */\nexport function getActiveProfilesCount(): number {\n return PROFILE_MAP.size;\n}\n\n/**\n * Retrieves profile from global cache and removes it.\n */\nexport function takeProfileFromGlobalCache(profile_id: string): JSSelfProfile | undefined {\n const profile = PROFILE_MAP.get(profile_id);\n if (profile) {\n PROFILE_MAP.delete(profile_id);\n }\n return profile;\n}\n/**\n * Adds profile to global cache and evicts the oldest profile if the cache is full.\n */\nexport function addProfileToGlobalCache(profile_id: string, profile: JSSelfProfile): void {\n PROFILE_MAP.set(profile_id, profile);\n\n if (PROFILE_MAP.size > 30) {\n const last = PROFILE_MAP.keys().next().value;\n if (last !== undefined) {\n PROFILE_MAP.delete(last);\n }\n }\n}\n\n/**\n * Attaches the profiled thread information to the event's trace context.\n */\nexport function attachProfiledThreadToEvent(event: Event): Event {\n if (!event?.contexts?.profile) {\n return event;\n }\n\n if (!event.contexts) {\n return event;\n }\n\n // Only mutate the trace context when it already has a trace_id — that\n // guarantees `applySpanToEvent` has already run, and we are not creating a partial trace context from scratch.\n if (event.contexts.trace?.trace_id) {\n event.contexts.trace = {\n ...event.contexts.trace,\n data: {\n ...(event.contexts.trace.data ?? {}),\n ['thread.id']: PROFILER_THREAD_ID_STRING,\n ['thread.name']: PROFILER_THREAD_NAME,\n },\n };\n }\n\n // Attach thread info to individual spans so that spans can be associated with the profiled thread on the UI even if contexts are missing.\n event.spans?.forEach(span => {\n span.data = {\n ...(span.data || {}),\n ['thread.id']: PROFILER_THREAD_ID_STRING,\n ['thread.name']: PROFILER_THREAD_NAME,\n };\n });\n\n return event;\n}\n"],"names":["GLOBAL_OBJ","WINDOW","DEBUG_BUILD","debug","timestampInSeconds","DEFAULT_ENVIRONMENT","uuid4","browserPerformanceTimeOrigin","spanToJSON","forEachEnvelopeItem","getClient","getDebugImagesForResources"],"mappings":";;;;;;AA8BA,MAAM,QAAA,GAAW,GAAG;;AAEpB;AACA,MAAM,YAAA,GAAe,QAAA,IAAYA,mBAAcA,eAAU,CAAC,MAAA,KAAWA,eAAA,IAAc,OAAO,aAAA,KAAkB,W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AA,CAAA,MAAA,CAAA,IAAA,CAAA;AACA,IAAA;AACA,EAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,2BAAA,CAAA,KAAA,EAAA;AACA,EAAA,IAAA,CAAA,KAAA,EAAA,QAAA,EAAA,OAAA,EAAA;AACA,IAAA,OAAA,KAAA;AACA,EAAA;;AAEA,EAAA,IAAA,CAAA,KAAA,CAAA,QAAA,EAAA;AACA,IAAA,OAAA,KAAA;AACA,EAAA;;AAEA;AACA;AACA,EAAA,IAAA,KAAA,CAAA,QAAA,CAAA,KAAA,EAAA,QAAA,EAAA;AACA,IAAA,KAAA,CAAA,QAAA,CAAA,KAAA,GAAA;AACA,MAAA,GAAA,KAAA,CAAA,QAAA,CAAA,KAAA;AACA,MAAA,IAAA,EAAA;AACA,QAAA,IAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA,IAAA,IAAA,EAAA,CAAA;AACA,QAAA,CAAA,WAAA,GAAA,yBAAA;AACA,QAAA,CAAA,aAAA,GAAA,oBAAA;AACA,OAAA;AACA,KAAA;AACA,EAAA;;AAEA;AACA,EAAA,KAAA,CAAA,KAAA,EAAA,OAAA,CAAA,IAAA,IAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA;AACA,MAAA,IAAA,IAAA,CAAA,IAAA,IAAA,EAAA,CAAA;AACA,MAAA,CAAA,WAAA,GAAA,yBAAA;AACA,MAAA,CAAA,aAAA,GAAA,oBAAA;AACA,KAAA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,OAAA,KAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/profiling/utils.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n Client,\n ContinuousThreadCpuProfile,\n DebugImage,\n Envelope,\n Event,\n EventEnvelope,\n Profile,\n ProfileChunk,\n Span,\n ThreadCpuProfile,\n} from '@sentry/core/browser';\nimport {\n browserPerformanceTimeOrigin,\n debug,\n DEFAULT_ENVIRONMENT,\n forEachEnvelopeItem,\n getClient,\n getDebugImagesForResources,\n GLOBAL_OBJ,\n spanToJSON,\n timestampInSeconds,\n uuid4,\n} from '@sentry/core/browser';\nimport type { BrowserOptions } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile, JSSelfProfiler, JSSelfProfilerConstructor, JSSelfProfileStack } from './jsSelfProfiling';\n\nconst MS_TO_NS = 1e6;\n\n// Checking if we are in Main or Worker thread: `self` (not `window`) is the `globalThis` in Web Workers and `importScripts` are only available in Web Workers\nconst isMainThread = 'window' in GLOBAL_OBJ && GLOBAL_OBJ.window === GLOBAL_OBJ && typeof importScripts === 'undefined';\n\n// Setting ID to 0 as we cannot get an ID from Web Workers\nexport const PROFILER_THREAD_ID_STRING = String(0);\nexport const PROFILER_THREAD_NAME = isMainThread ? 'main' : 'worker';\n\n// We force make this optional to be on the safe side...\nconst navigator = WINDOW.navigator as typeof WINDOW.navigator | undefined;\n\n// Machine properties (eval only once)\nlet OS_PLATFORM = '';\nlet OS_PLATFORM_VERSION = '';\nlet OS_ARCH = '';\nlet OS_BROWSER = navigator?.userAgent || '';\nlet OS_MODEL = '';\nconst OS_LOCALE = navigator?.language || navigator?.languages?.[0] || '';\n\ntype UAData = {\n platform?: string;\n architecture?: string;\n model?: string;\n platformVersion?: string;\n fullVersionList?: {\n brand: string;\n version: string;\n }[];\n};\n\ninterface UserAgentData {\n getHighEntropyValues: (keys: string[]) => Promise<UAData>;\n}\n\nfunction isUserAgentData(data: unknown): data is UserAgentData {\n return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;\n}\n\n// @ts-expect-error userAgentData is not part of the navigator interface yet\nconst userAgentData = navigator?.userAgentData;\n\nif (isUserAgentData(userAgentData)) {\n userAgentData\n .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])\n .then((ua: UAData) => {\n OS_PLATFORM = ua.platform || '';\n OS_ARCH = ua.architecture || '';\n OS_MODEL = ua.model || '';\n OS_PLATFORM_VERSION = ua.platformVersion || '';\n\n if (ua.fullVersionList?.length) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1]!;\n OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;\n }\n })\n .catch(e => void e);\n}\n\nfunction isProcessedJSSelfProfile(profile: ThreadCpuProfile | JSSelfProfile): profile is JSSelfProfile {\n return !('thread_metadata' in profile);\n}\n\n// Enriches the profile with threadId of the current thread.\n// This is done in node as we seem to not be able to get the info from C native code.\n/**\n *\n */\nexport function enrichWithThreadInformation(profile: ThreadCpuProfile | JSSelfProfile): ThreadCpuProfile {\n if (!isProcessedJSSelfProfile(profile)) {\n return profile;\n }\n\n return convertJSSelfProfileToSampledFormat(profile);\n}\n\n// Profile is marked as optional because it is deleted from the metadata\n// by the integration before the event is processed by other integrations.\nexport interface ProfiledEvent extends Event {\n sdkProcessingMetadata: {\n profile?: JSSelfProfile;\n };\n}\n\nfunction getTraceId(event: Event): string {\n const traceId: unknown = event.contexts?.trace?.trace_id;\n // Log a warning if the profile has an invalid traceId (should be uuidv4).\n // All profiles and transactions are rejected if this is the case and we want to\n // warn users that this is happening if they enable debug flag\n if (typeof traceId === 'string' && traceId.length !== 32) {\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);\n }\n }\n if (typeof traceId !== 'string') {\n return '';\n }\n\n return traceId;\n}\n/**\n * Creates a profiling event envelope from a Sentry event. If profile does not pass\n * validation, returns null.\n * @param event\n * @param dsn\n * @param metadata\n * @param tunnel\n * @returns {EventEnvelope | null}\n */\n\n/**\n * Creates a profiling event envelope from a Sentry event.\n */\nexport function createProfilePayload(\n profile_id: string,\n start_timestamp: number | undefined,\n processed_profile: JSSelfProfile,\n event: ProfiledEvent,\n): Profile {\n if (event.type !== 'transaction') {\n // createProfilingEventEnvelope should only be called for transactions,\n // we type guard this behavior with isProfiledTransactionEvent.\n throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');\n }\n\n if (processed_profile === undefined || processed_profile === null) {\n throw new TypeError(\n `Cannot construct profiling event envelope without a valid profile. Got ${processed_profile} instead.`,\n );\n }\n\n const traceId = getTraceId(event);\n const enrichedThreadProfile = enrichWithThreadInformation(processed_profile);\n const transactionStartMs = start_timestamp\n ? start_timestamp\n : typeof event.start_timestamp === 'number'\n ? event.start_timestamp * 1000\n : timestampInSeconds() * 1000;\n const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : timestampInSeconds() * 1000;\n\n const profile: Profile = {\n event_id: profile_id,\n timestamp: new Date(transactionStartMs).toISOString(),\n platform: 'javascript',\n version: '1',\n release: event.release || '',\n environment: event.environment || DEFAULT_ENVIRONMENT,\n runtime: {\n name: 'javascript',\n version: WINDOW.navigator.userAgent,\n },\n os: {\n name: OS_PLATFORM,\n version: OS_PLATFORM_VERSION,\n build_number: OS_BROWSER,\n },\n device: {\n locale: OS_LOCALE,\n model: OS_MODEL,\n manufacturer: OS_BROWSER,\n architecture: OS_ARCH,\n is_emulator: false,\n },\n debug_meta: {\n images: applyDebugMetadata(processed_profile.resources),\n },\n profile: enrichedThreadProfile,\n transactions: [\n {\n name: event.transaction || '',\n id: event.event_id || uuid4(),\n trace_id: traceId,\n active_thread_id: PROFILER_THREAD_ID_STRING,\n relative_start_ns: '0',\n relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),\n },\n ],\n };\n\n return profile;\n}\n\n/**\n * Create a profile chunk envelope item\n */\nexport function createProfileChunkPayload(\n jsSelfProfile: JSSelfProfile,\n client: Client,\n profilerId?: string,\n): ProfileChunk {\n // only == to catch null and undefined\n if (jsSelfProfile == null) {\n throw new TypeError(\n `Cannot construct profiling event envelope without a valid profile. Got ${jsSelfProfile} instead.`,\n );\n }\n\n const continuousProfile = convertToContinuousProfile(jsSelfProfile);\n\n const options = client.getOptions();\n const sdk = client.getSdkMetadata?.()?.sdk;\n\n return {\n chunk_id: uuid4(),\n client_sdk: {\n name: sdk?.name ?? 'sentry.javascript.browser',\n version: sdk?.version ?? '0.0.0',\n },\n profiler_id: profilerId || uuid4(),\n platform: 'javascript',\n version: '2',\n release: options.release ?? '',\n environment: options.environment ?? 'production',\n debug_meta: {\n // function name obfuscation\n images: applyDebugMetadata(jsSelfProfile.resources),\n },\n profile: continuousProfile,\n };\n}\n\n/**\n * Validate a profile chunk against the Sample Format V2 requirements.\n * https://develop.sentry.dev/sdk/telemetry/profiles/sample-format-v2/\n * - Presence of samples, stacks, frames\n * - Required metadata fields\n */\nexport function validateProfileChunk(chunk: ProfileChunk): { valid: true } | { reason: string } {\n try {\n // Required metadata\n if (!chunk || typeof chunk !== 'object') {\n return { reason: 'chunk is not an object' };\n }\n\n // profiler_id and chunk_id must be 32 lowercase hex chars\n const isHex32 = (val: unknown): boolean => typeof val === 'string' && /^[a-f0-9]{32}$/.test(val);\n if (!isHex32(chunk.profiler_id)) {\n return { reason: 'missing or invalid profiler_id' };\n }\n if (!isHex32(chunk.chunk_id)) {\n return { reason: 'missing or invalid chunk_id' };\n }\n\n if (!chunk.client_sdk) {\n return { reason: 'missing client_sdk metadata' };\n }\n\n // Profile data must have frames, stacks, samples\n const profile = chunk.profile as { frames?: unknown[]; stacks?: unknown[]; samples?: unknown[] } | undefined;\n if (!profile) {\n return { reason: 'missing profile data' };\n }\n\n if (!Array.isArray(profile.frames) || !profile.frames.length) {\n return { reason: 'profile has no frames' };\n }\n if (!Array.isArray(profile.stacks) || !profile.stacks.length) {\n return { reason: 'profile has no stacks' };\n }\n if (!Array.isArray(profile.samples) || !profile.samples.length) {\n return { reason: 'profile has no samples' };\n }\n\n return { valid: true };\n } catch (e) {\n return { reason: `unknown validation error: ${e}` };\n }\n}\n\n/**\n * Convert from JSSelfProfile format to ContinuousThreadCpuProfile format.\n */\nfunction convertToContinuousProfile(input: {\n frames: { name: string; resourceId?: number; line?: number; column?: number }[];\n stacks: { frameId: number; parentId?: number }[];\n samples: { timestamp: number; stackId?: number }[];\n resources: string[];\n}): ContinuousThreadCpuProfile {\n // Frames map 1:1 by index; fill only when present to avoid sparse writes\n const frames: ContinuousThreadCpuProfile['frames'] = [];\n for (let i = 0; i < input.frames.length; i++) {\n const frame = input.frames[i];\n if (!frame) {\n continue;\n }\n frames[i] = {\n function: frame.name,\n abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,\n lineno: frame.line,\n colno: frame.column,\n };\n }\n\n // Build stacks by following parent links, top->down order (root last)\n const stacks: ContinuousThreadCpuProfile['stacks'] = [];\n for (let i = 0; i < input.stacks.length; i++) {\n const stackHead = input.stacks[i];\n if (!stackHead) {\n continue;\n }\n const list: number[] = [];\n let current: { frameId: number; parentId?: number } | undefined = stackHead;\n while (current) {\n list.push(current.frameId);\n current = current.parentId === undefined ? undefined : input.stacks[current.parentId];\n }\n stacks[i] = list;\n }\n\n // Align timestamps to SDK time origin to match span/event timelines\n const perfOrigin = browserPerformanceTimeOrigin();\n const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0;\n const adjustForOriginChange = origin - (perfOrigin || origin);\n\n const samples: ContinuousThreadCpuProfile['samples'] = [];\n for (let i = 0; i < input.samples.length; i++) {\n const sample = input.samples[i];\n if (!sample) {\n continue;\n }\n // Convert ms to seconds epoch-based timestamp\n const timestampSeconds = (origin + (sample.timestamp - adjustForOriginChange)) / 1000;\n samples[i] = {\n stack_id: sample.stackId ?? 0,\n thread_id: PROFILER_THREAD_ID_STRING,\n timestamp: timestampSeconds,\n };\n }\n\n return {\n frames,\n stacks,\n samples,\n thread_metadata: { [PROFILER_THREAD_ID_STRING]: { name: PROFILER_THREAD_NAME } },\n };\n}\n\n/**\n *\n */\nexport function isProfiledTransactionEvent(event: Event): event is ProfiledEvent {\n return !!event.sdkProcessingMetadata?.profile;\n}\n\n/*\n See packages/browser-utils/src/browser/router.ts\n*/\n/**\n *\n */\nexport function isAutomatedPageLoadSpan(span: Span): boolean {\n return spanToJSON(span).op === 'pageload';\n}\n\n/**\n * Converts a JSSelfProfile to a our sampled format.\n * Does not currently perform stack indexing.\n */\nexport function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): Profile['profile'] {\n let EMPTY_STACK_ID: undefined | number = undefined;\n let STACK_ID = 0;\n\n // Initialize the profile that we will fill with data\n const profile: Profile['profile'] = {\n samples: [],\n stacks: [],\n frames: [],\n thread_metadata: {\n [PROFILER_THREAD_ID_STRING]: { name: PROFILER_THREAD_NAME },\n },\n };\n\n const firstSample = input.samples[0];\n if (!firstSample) {\n return profile;\n }\n\n // We assert samples.length > 0 above and timestamp should always be present\n const start = firstSample.timestamp;\n // The JS SDK might change it's time origin based on some heuristic (see See packages/utils/src/time.ts)\n // when that happens, we need to ensure we are correcting the profile timings so the two timelines stay in sync.\n // Since JS self profiling time origin is always initialized to performance.timeOrigin, we need to adjust for\n // the drift between the SDK selected value and our profile time origin.\n const perfOrigin = browserPerformanceTimeOrigin();\n const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0;\n const adjustForOriginChange = origin - (perfOrigin || origin);\n\n input.samples.forEach((jsSample, i) => {\n // If sample has no stack, add an empty sample\n if (jsSample.stackId === undefined) {\n if (EMPTY_STACK_ID === undefined) {\n EMPTY_STACK_ID = STACK_ID;\n profile.stacks[EMPTY_STACK_ID] = [];\n STACK_ID++;\n }\n\n profile['samples'][i] = {\n // convert ms timestamp to ns\n elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0),\n stack_id: EMPTY_STACK_ID,\n thread_id: PROFILER_THREAD_ID_STRING,\n };\n return;\n }\n\n let stackTop: JSSelfProfileStack | undefined = input.stacks[jsSample.stackId];\n\n // Functions in top->down order (root is last)\n // We follow the stackTop.parentId trail and collect each visited frameId\n const stack: number[] = [];\n\n while (stackTop) {\n stack.push(stackTop.frameId);\n\n const frame = input.frames[stackTop.frameId];\n\n // If our frame has not been indexed yet, index it\n if (frame && profile.frames[stackTop.frameId] === undefined) {\n profile.frames[stackTop.frameId] = {\n function: frame.name,\n abs_path: typeof frame.resourceId === 'number' ? input.resources[frame.resourceId] : undefined,\n lineno: frame.line,\n colno: frame.column,\n };\n }\n\n stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];\n }\n\n const sample: Profile['profile']['samples'][0] = {\n // convert ms timestamp to ns\n elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start) * MS_TO_NS).toFixed(0),\n stack_id: STACK_ID,\n thread_id: PROFILER_THREAD_ID_STRING,\n };\n\n profile['stacks'][STACK_ID] = stack;\n profile['samples'][i] = sample;\n STACK_ID++;\n });\n\n return profile;\n}\n\n/**\n * Adds items to envelope if they are not already present - mutates the envelope.\n * @param envelope\n */\nexport function addProfilesToEnvelope(envelope: EventEnvelope, profiles: Profile[]): Envelope {\n if (!profiles.length) {\n return envelope;\n }\n\n for (const profile of profiles) {\n envelope[1].push([{ type: 'profile' }, profile]);\n }\n return envelope;\n}\n\n/**\n * Finds transactions with profile_id context in the envelope\n * @param envelope\n * @returns\n */\nexport function findProfiledTransactionsFromEnvelope(envelope: Envelope): Event[] {\n const events: Event[] = [];\n\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type !== 'transaction') {\n return;\n }\n\n for (let j = 1; j < item.length; j++) {\n const event = item[j] as Event;\n\n if (event?.contexts?.profile?.profile_id) {\n events.push(item[j] as Event);\n }\n }\n });\n\n return events;\n}\n\n/**\n * Applies debug meta data to an event from a list of paths to resources (sourcemaps)\n */\nexport function applyDebugMetadata(resource_paths: ReadonlyArray<string>): DebugImage[] {\n const client = getClient();\n const options = client?.getOptions();\n const stackParser = options?.stackParser;\n\n if (!stackParser) {\n return [];\n }\n\n return getDebugImagesForResources(stackParser, resource_paths);\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nexport function isValidSampleRate(rate: unknown): boolean {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n if ((typeof rate !== 'number' && typeof rate !== 'boolean') || (typeof rate === 'number' && isNaN(rate))) {\n DEBUG_BUILD &&\n debug.warn(\n `[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // Boolean sample rates are always valid\n if (rate === true || rate === false) {\n return true;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD && debug.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nfunction isValidProfile(profile: JSSelfProfile): profile is JSSelfProfile & { profile_id: string } {\n if (profile.samples.length < 2) {\n if (DEBUG_BUILD) {\n // Log a warning if the profile has less than 2 samples so users can know why\n // they are not seeing any profiling data and we cant avoid the back and forth\n // of asking them to provide us with a dump of the profile data.\n debug.log('[Profiling] Discarding profile because it contains less than 2 samples');\n }\n return false;\n }\n\n if (!profile.frames.length) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] Discarding profile because it contains no frames');\n }\n return false;\n }\n\n return true;\n}\n\n// Keep a flag value to avoid re-initializing the profiler constructor. If it fails\n// once, it will always fail and this allows us to early return.\nlet PROFILING_CONSTRUCTOR_FAILED: boolean = false;\nexport const MAX_PROFILE_DURATION_MS = 30_000;\n\n/**\n * Check if profiler constructor is available.\n * @param maybeProfiler\n */\nfunction isJSProfilerSupported(maybeProfiler: unknown): maybeProfiler is typeof JSSelfProfilerConstructor {\n return typeof maybeProfiler === 'function';\n}\n\n/**\n * Starts the profiler and returns the profiler instance.\n */\nexport function startJSSelfProfile(): JSSelfProfiler | undefined {\n // Feature support check first\n const JSProfilerConstructor = WINDOW.Profiler;\n\n if (!isJSProfilerSupported(JSProfilerConstructor)) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.');\n }\n return;\n }\n\n // From initial testing, it seems that the minimum value for sampleInterval is 10ms.\n const samplingIntervalMS = 10;\n // Start the profiler\n const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);\n\n // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.\n // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens\n // as we risk breaking the user's application, so just disable profiling and log an error.\n try {\n return new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });\n } catch (_e) {\n if (DEBUG_BUILD) {\n debug.log(\n \"[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.\",\n );\n debug.log('[Profiling] Disabling profiling for current user session.');\n }\n PROFILING_CONSTRUCTOR_FAILED = true;\n }\n\n return;\n}\n\n/**\n * Determine if a profile should be profiled.\n */\nexport function shouldProfileSpanLegacy(span: Span): boolean {\n // If constructor failed once, it will always fail, so we can early return.\n if (PROFILING_CONSTRUCTOR_FAILED) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] Profiling has been disabled for the duration of the current user session.');\n }\n return false;\n }\n\n if (!span.isRecording()) {\n DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');\n return false;\n }\n\n const client = getClient();\n const options = client?.getOptions();\n if (!options) {\n DEBUG_BUILD && debug.log('[Profiling] Profiling disabled, no options found.');\n return false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const profilesSampleRate = (options as BrowserOptions).profilesSampleRate as\n | BrowserOptions['profilesSampleRate']\n | boolean;\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(profilesSampleRate)) {\n DEBUG_BUILD && debug.warn('[Profiling] Discarding profile because of invalid sample rate.');\n return false;\n }\n\n // if the function returned 0 (or false), or if `profileSampleRate` is 0, it's a sign the profile should be dropped\n if (!profilesSampleRate) {\n DEBUG_BUILD &&\n debug.log(\n '[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0',\n );\n return false;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n const sampled = profilesSampleRate === true ? true : Math.random() < profilesSampleRate;\n // Check if we should sample this profile\n if (!sampled) {\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(\n profilesSampleRate,\n )})`,\n );\n return false;\n }\n\n return true;\n}\n\n/**\n * Determine if a profile should be created for the current session.\n */\nexport function shouldProfileSession(options: BrowserOptions): boolean {\n // If constructor failed once, it will always fail, so we can early return.\n if (PROFILING_CONSTRUCTOR_FAILED) {\n if (DEBUG_BUILD) {\n debug.log(\n '[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.',\n );\n }\n return false;\n }\n\n if (options.profileLifecycle !== 'trace' && options.profileLifecycle !== 'manual') {\n DEBUG_BUILD && debug.warn('[Profiling] Session not sampled. Invalid `profileLifecycle` option.');\n return false;\n }\n\n // Session sampling: profileSessionSampleRate gates whether profiling is enabled for this session\n const profileSessionSampleRate = options.profileSessionSampleRate;\n\n if (!isValidSampleRate(profileSessionSampleRate)) {\n DEBUG_BUILD && debug.warn('[Profiling] Discarding profile because of invalid profileSessionSampleRate.');\n return false;\n }\n\n if (!profileSessionSampleRate) {\n DEBUG_BUILD &&\n debug.log('[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0');\n return false;\n }\n\n return Math.random() <= profileSessionSampleRate;\n}\n\n/**\n * Checks if legacy profiling is configured.\n */\nexport function hasLegacyProfiling(options: BrowserOptions): boolean {\n // eslint-disable-next-line deprecation/deprecation\n return typeof options.profilesSampleRate !== 'undefined';\n}\n\n/**\n * Creates a profiling envelope item, if the profile does not pass validation, returns null.\n * @param event\n * @returns {Profile | null}\n */\nexport function createProfilingEvent(\n profile_id: string,\n start_timestamp: number | undefined,\n profile: JSSelfProfile,\n event: ProfiledEvent,\n): Profile | null {\n if (!isValidProfile(profile)) {\n return null;\n }\n\n return createProfilePayload(profile_id, start_timestamp, profile, event);\n}\n\n// TODO (v8): We need to obtain profile ids in @sentry-internal/tracing,\n// but we don't have access to this map because importing this map would\n// cause a circular dependency. We need to resolve this in v8.\nconst PROFILE_MAP: Map<string, JSSelfProfile> = new Map();\n/**\n *\n */\nexport function getActiveProfilesCount(): number {\n return PROFILE_MAP.size;\n}\n\n/**\n * Retrieves profile from global cache and removes it.\n */\nexport function takeProfileFromGlobalCache(profile_id: string): JSSelfProfile | undefined {\n const profile = PROFILE_MAP.get(profile_id);\n if (profile) {\n PROFILE_MAP.delete(profile_id);\n }\n return profile;\n}\n/**\n * Adds profile to global cache and evicts the oldest profile if the cache is full.\n */\nexport function addProfileToGlobalCache(profile_id: string, profile: JSSelfProfile): void {\n PROFILE_MAP.set(profile_id, profile);\n\n if (PROFILE_MAP.size > 30) {\n const last = PROFILE_MAP.keys().next().value;\n if (last !== undefined) {\n PROFILE_MAP.delete(last);\n }\n }\n}\n\nexport const PROFILED_ROOT_SPANS = new WeakSet<Span>();\n\nexport function setThreadAttributes(span: Span): void {\n span.setAttribute('thread.id', PROFILER_THREAD_ID_STRING);\n span.setAttribute('thread.name', PROFILER_THREAD_NAME);\n}\n"],"names":["GLOBAL_OBJ","WINDOW","DEBUG_BUILD","debug","timestampInSeconds","DEFAULT_ENVIRONMENT","uuid4","browserPerformanceTimeOrigin","spanToJSON","forEachEnvelopeItem","getClient","getDebugImagesForResources"],"mappings":";;;;;;AA8BA,MAAM,QAAA,GAAW,GAAG;;AAEpB;AACA,MAAM,YAAA,GAAe,QAAA,IAAYA,sBAAcA,kBAAU,CAAC,MAAA,KAAWA,kBAAA,IAAc,OAAO,aAAA,KAAkB,WAAW;;AAEvH;MACa,yBAAA,GAA4B,MAAM,CAAC,CAAC;MACpC,oBAAA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;;AAEA,MAAA,mBAAA,GAAA,IAAA,OAAA;;AAEA,SAAA,mBAAA,CAAA,IAAA,EAAA;AACA,EAAA,IAAA,CAAA,YAAA,CAAA,WAAA,EAAA,yBAAA,CAAA;AACA,EAAA,IAAA,CAAA,YAAA,CAAA,aAAA,EAAA,oBAAA,CAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const core = require('@sentry/core');
3
+ const browser = require('@sentry/core/browser');
4
4
  const debugBuild = require('./debug-build.js');
5
5
  const helpers = require('./helpers.js');
6
6
 
@@ -15,16 +15,16 @@ function showReportDialog(options = {}) {
15
15
 
16
16
  // doesn't work without a document (React Native)
17
17
  if (!injectionPoint) {
18
- debugBuild.DEBUG_BUILD && core.debug.error('[showReportDialog] Global document not defined');
18
+ debugBuild.DEBUG_BUILD && browser.debug.error('[showReportDialog] Global document not defined');
19
19
  return;
20
20
  }
21
21
 
22
- const scope = core.getCurrentScope();
23
- const client = core.getClient();
22
+ const scope = browser.getCurrentScope();
23
+ const client = browser.getClient();
24
24
  const dsn = client?.getDsn();
25
25
 
26
26
  if (!dsn) {
27
- debugBuild.DEBUG_BUILD && core.debug.error('[showReportDialog] DSN not configured');
27
+ debugBuild.DEBUG_BUILD && browser.debug.error('[showReportDialog] DSN not configured');
28
28
  return;
29
29
  }
30
30
 
@@ -34,13 +34,13 @@ function showReportDialog(options = {}) {
34
34
  ...scope.getUser(),
35
35
  ...options.user,
36
36
  },
37
- eventId: options.eventId || core.lastEventId(),
37
+ eventId: options.eventId || browser.lastEventId(),
38
38
  };
39
39
 
40
40
  const script = helpers.WINDOW.document.createElement('script');
41
41
  script.async = true;
42
42
  script.crossOrigin = 'anonymous';
43
- script.src = core.getReportDialogEndpoint(dsn, mergedOptions);
43
+ script.src = browser.getReportDialogEndpoint(dsn, mergedOptions);
44
44
 
45
45
  const { onLoad, onClose } = mergedOptions;
46
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"report-dialog.js","sources":["../../../../src/report-dialog.ts"],"sourcesContent":["import type { ReportDialogOptions } from '@sentry/core';\nimport { debug, getClient, getCurrentScope, getReportDialogEndpoint, lastEventId } from '@sentry/core';\nimport { DEBUG_BUILD } from './debug-build';\nimport { WINDOW } from './helpers';\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the current scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n const optionalDocument = WINDOW.document as Document | undefined;\n const injectionPoint = optionalDocument?.head || optionalDocument?.body;\n\n // doesn't work without a document (React Native)\n if (!injectionPoint) {\n DEBUG_BUILD && debug.error('[showReportDialog] Global document not defined');\n return;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n const dsn = client?.getDsn();\n\n if (!dsn) {\n DEBUG_BUILD && debug.error('[showReportDialog] DSN not configured');\n return;\n }\n\n const mergedOptions = {\n ...options,\n user: {\n ...scope.getUser(),\n ...options.user,\n },\n eventId: options.eventId || lastEventId(),\n };\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, mergedOptions);\n\n const { onLoad, onClose } = mergedOptions;\n\n if (onLoad) {\n script.onload = onLoad;\n }\n\n if (onClose) {\n const reportDialogClosedMessageHandler = (event: MessageEvent): void => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n injectionPoint.appendChild(script);\n}\n"],"names":["WINDOW","DEBUG_BUILD","debug","getCurrentScope","getClient","lastEventId","getReportDialogEndpoint"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,OAAO,GAAwB,EAAE,EAAQ;AAC1E,EAAE,MAAM,gBAAA,GAAmBA,cAAM,C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AAgC,EAAE;AAC3D,QAAQ,IAAI;AACZ,UAAU,OAAO,EAAE;AACnB,QAAQ,UAAU;AAClB,UAAUN,cAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,gCAAgC,CAAC;AACjF,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;AACL,IAAIA,cAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,gCAAgC,CAAC;AACxE,EAAE;;AAEF,EAAE,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC;AACpC;;;;"}
1
+ {"version":3,"file":"report-dialog.js","sources":["../../../../src/report-dialog.ts"],"sourcesContent":["import type { ReportDialogOptions } from '@sentry/core/browser';\nimport { debug, getClient, getCurrentScope, getReportDialogEndpoint, lastEventId } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from './debug-build';\nimport { WINDOW } from './helpers';\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the current scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}): void {\n const optionalDocument = WINDOW.document as Document | undefined;\n const injectionPoint = optionalDocument?.head || optionalDocument?.body;\n\n // doesn't work without a document (React Native)\n if (!injectionPoint) {\n DEBUG_BUILD && debug.error('[showReportDialog] Global document not defined');\n return;\n }\n\n const scope = getCurrentScope();\n const client = getClient();\n const dsn = client?.getDsn();\n\n if (!dsn) {\n DEBUG_BUILD && debug.error('[showReportDialog] DSN not configured');\n return;\n }\n\n const mergedOptions = {\n ...options,\n user: {\n ...scope.getUser(),\n ...options.user,\n },\n eventId: options.eventId || lastEventId(),\n };\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, mergedOptions);\n\n const { onLoad, onClose } = mergedOptions;\n\n if (onLoad) {\n script.onload = onLoad;\n }\n\n if (onClose) {\n const reportDialogClosedMessageHandler = (event: MessageEvent): void => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n injectionPoint.appendChild(script);\n}\n"],"names":["WINDOW","DEBUG_BUILD","debug","getCurrentScope","getClient","lastEventId","getReportDialogEndpoint"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,OAAO,GAAwB,EAAE,EAAQ;AAC1E,EAAE,MAAM,gBAAA,GAAmBA,cAAM,CAAC,QAAA;AAClC,EAAE,MAAM,iBAAiB,gBAAgB,EAAE,IAAA,IAAQ,gBAAgB,EAAE,IAAI;;AAEzE;AACA,EAAE,IAAI,CAAC,cAAc,EAAE;AACvB,IAAIC,0BAAeC,aAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC;AAChF,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,KAAA,GAAQC,uBAAe,EAAE;AACjC,EAAE,MAAM,MAAA,GAASC,iBAAS,EAAE;AAC5B,EAAE,MAAM,GAAA,GAAM,MAAM,EAAE,MAAM,EAAE;;AAE9B,EAAE,IAAI,CAAC,GAAG,EAAE;AACZ,IAAIH,0BAAeC,aAAK,CAAC,KAAK,CAAC,uCAAuC,CAAC;AACvE,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,gBAAgB;AACxB,IAAI,GAAG,OAAO;AACd,IAAI,IAAI,EAAE;AACV,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE;AACxB,MAAM,GAAG,OAAO,CAAC,IAAI;AACrB,KAAK;AACL,IAAI,OAAO,EAAE,OAAO,CAAC,WAAWG,mBAAW,EAAE;AAC7C,GAAG;;AAEH,EAAE,MAAM,MAAA,GAASL,cAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;AACxD,EAAE,MAAM,CAAC,KAAA,GAAQ,IAAI;AACrB,EAAE,MAAM,CAAC,WAAA,GAAc,WAAW;AAClC,EAAE,MAAM,CAAC,GAAA,GAAMM,+BAAuB,CAAC,GAAG,EAAE,aAAa,CAAC;;AAE1D,EAAE,MAAM,EAAE,MAAM,EAAE,OAAA,EAAQ,GAAI,aAAa;;AAE3C,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,MAAM,CAAC,MAAA,GAAS,MAAM;AAC1B,EAAE;;AAEF,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,MAAM,gCAAA,GAAmC,CAAC,KAAK,KAAyB;AAC5E,MAAM,IAAI,KAAK,CAAC,IAAA,KAAS,gCAAgC,EAAE;AAC3D,QAAQ,IAAI;AACZ,UAAU,OAAO,EAAE;AACnB,QAAQ,UAAU;AAClB,UAAUN,cAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,gCAAgC,CAAC;AACjF,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;AACL,IAAIA,cAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,gCAAgC,CAAC;AACxE,EAAE;;AAEF,EAAE,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC;AACpC;;;;"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const core = require('@sentry/core');
3
+ const browser = require('@sentry/core/browser');
4
4
  const client = require('./client.js');
5
5
  const breadcrumbs = require('./integrations/breadcrumbs.js');
6
6
  const browserapierrors = require('./integrations/browserapierrors.js');
@@ -23,14 +23,14 @@ function getDefaultIntegrations(_options) {
23
23
  return [
24
24
  // TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`
25
25
  // eslint-disable-next-line deprecation/deprecation
26
- core.inboundFiltersIntegration(),
27
- core.functionToStringIntegration(),
28
- core.conversationIdIntegration(),
26
+ browser.inboundFiltersIntegration(),
27
+ browser.functionToStringIntegration(),
28
+ browser.conversationIdIntegration(),
29
29
  browserapierrors.browserApiErrorsIntegration(),
30
30
  breadcrumbs.breadcrumbsIntegration(),
31
31
  globalhandlers.globalHandlersIntegration(),
32
32
  linkederrors.linkedErrorsIntegration(),
33
- core.dedupeIntegration(),
33
+ browser.dedupeIntegration(),
34
34
  httpcontext.httpContextIntegration(),
35
35
  culturecontext.cultureContextIntegration(),
36
36
  browsersession.browserSessionIntegration(),
@@ -103,14 +103,14 @@ function init(options = {}) {
103
103
  const clientOptions = {
104
104
  ...options,
105
105
  enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,
106
- stackParser: core.stackParserFromStackParserOptions(options.stackParser || stackParsers.defaultStackParser),
107
- integrations: core.getIntegrationsToSetup({
106
+ stackParser: browser.stackParserFromStackParserOptions(options.stackParser || stackParsers.defaultStackParser),
107
+ integrations: browser.getIntegrationsToSetup({
108
108
  integrations: options.integrations,
109
109
  defaultIntegrations,
110
110
  }),
111
111
  transport: options.transport || fetch.makeFetchTransport,
112
112
  };
113
- return core.initAndBind(client.BrowserClient, clientOptions);
113
+ return browser.initAndBind(client.BrowserClient, clientOptions);
114
114
  }
115
115
 
116
116
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sources":["../../../../src/sdk.ts"],"sourcesContent":["import type { Client, Integration, Options } from '@sentry/core';\nimport {\n conversationIdIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n getIntegrationsToSetup,\n inboundFiltersIntegration,\n initAndBind,\n stackParserFromStackParserOptions,\n} from '@sentry/core';\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs';\nimport { browserApiErrorsIntegration } from './integrations/browserapierrors';\nimport { browserSessionIntegration } from './integrations/browsersession';\nimport { cultureContextIntegration } from './integrations/culturecontext';\nimport { globalHandlersIntegration } from './integrations/globalhandlers';\nimport { httpContextIntegration } from './integrations/httpcontext';\nimport { linkedErrorsIntegration } from './integrations/linkederrors';\nimport { spotlightBrowserIntegration } from './integrations/spotlight';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport } from './transports/fetch';\nimport { checkAndWarnIfIsEmbeddedBrowserExtension } from './utils/detectBrowserExtension';\n\n/** Get the default integrations for the browser SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n /**\n * Note: Please make sure this stays in sync with Angular SDK, which re-exports\n * `getDefaultIntegrations` but with an adjusted set of integrations.\n */\n return [\n // TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`\n // eslint-disable-next-line deprecation/deprecation\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n conversationIdIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n cultureContextIntegration(),\n browserSessionIntegration(),\n ];\n}\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): Client | undefined {\n const shouldDisableBecauseIsBrowserExtenstion =\n !options.skipBrowserExtensionCheck && checkAndWarnIfIsEmbeddedBrowserExtension();\n\n let defaultIntegrations =\n options.defaultIntegrations == null ? getDefaultIntegrations(options) : options.defaultIntegrations;\n\n /* rollup-include-development-only */\n if (options.spotlight) {\n if (!defaultIntegrations) {\n defaultIntegrations = [];\n }\n const args = typeof options.spotlight === 'string' ? { sidecarUrl: options.spotlight } : undefined;\n defaultIntegrations.push(spotlightBrowserIntegration(args));\n }\n /* rollup-include-development-only-end */\n\n const clientOptions: BrowserClientOptions = {\n ...options,\n enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup({\n integrations: options.integrations,\n defaultIntegrations,\n }),\n transport: options.transport || makeFetchTransport,\n };\n return initAndBind(BrowserClient, clientOptions);\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n"],"names":["inboundFiltersIntegration","functionToStringIntegration","conversationIdIntegration","browserApiErrorsIntegration","breadcrumbsIntegration","globalHandlersIntegration","linkedErrorsIntegration","dedupeIntegration","httpContextIntegration","cultureContextIntegration","browserSessionIntegration","checkAndWarnIfIsEmbeddedBrowserExtension","spotlightBrowserIntegration","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","makeFetchTransport","initAndBind","BrowserClient"],"mappings":";;;;;;;;;;;;;;;;AAwBA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE;AACA;AACA;AACA;AACA,EAAE,OAAO;AACT;AACA;AACA,IAAIA,8BAAyB,EAAE;AAC/B,IAAIC,gCAA2B,EAAE;AACjC,IAAIC,8BAAyB,EAAE;AAC/B,IAAIC,4CAA2B,EAAE;AACjC,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,wCAAyB,EAAE;AAC/B,IAAIC,oCAAuB,EAAE;AAC7B,IAAIC,sBAAiB,EAAE;AACvB,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,wCAAyB,EAAE;AAC/B,IAAIC,wCAAyB,EAAE;AAC/B,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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ACA;;AAEA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,QAAQ,EAAoB;AACnD,EAAE,QAAQ,EAAE;AACZ;;;;;;;"}
1
+ {"version":3,"file":"sdk.js","sources":["../../../../src/sdk.ts"],"sourcesContent":["import type { Client, Integration, Options } from '@sentry/core/browser';\nimport {\n conversationIdIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n getIntegrationsToSetup,\n inboundFiltersIntegration,\n initAndBind,\n stackParserFromStackParserOptions,\n} from '@sentry/core/browser';\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs';\nimport { browserApiErrorsIntegration } from './integrations/browserapierrors';\nimport { browserSessionIntegration } from './integrations/browsersession';\nimport { cultureContextIntegration } from './integrations/culturecontext';\nimport { globalHandlersIntegration } from './integrations/globalhandlers';\nimport { httpContextIntegration } from './integrations/httpcontext';\nimport { linkedErrorsIntegration } from './integrations/linkederrors';\nimport { spotlightBrowserIntegration } from './integrations/spotlight';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport } from './transports/fetch';\nimport { checkAndWarnIfIsEmbeddedBrowserExtension } from './utils/detectBrowserExtension';\n\n/** Get the default integrations for the browser SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n /**\n * Note: Please make sure this stays in sync with Angular SDK, which re-exports\n * `getDefaultIntegrations` but with an adjusted set of integrations.\n */\n return [\n // TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`\n // eslint-disable-next-line deprecation/deprecation\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n conversationIdIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n cultureContextIntegration(),\n browserSessionIntegration(),\n ];\n}\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): Client | undefined {\n const shouldDisableBecauseIsBrowserExtenstion =\n !options.skipBrowserExtensionCheck && checkAndWarnIfIsEmbeddedBrowserExtension();\n\n let defaultIntegrations =\n options.defaultIntegrations == null ? getDefaultIntegrations(options) : options.defaultIntegrations;\n\n /* rollup-include-development-only */\n if (options.spotlight) {\n if (!defaultIntegrations) {\n defaultIntegrations = [];\n }\n const args = typeof options.spotlight === 'string' ? { sidecarUrl: options.spotlight } : undefined;\n defaultIntegrations.push(spotlightBrowserIntegration(args));\n }\n /* rollup-include-development-only-end */\n\n const clientOptions: BrowserClientOptions = {\n ...options,\n enabled: shouldDisableBecauseIsBrowserExtenstion ? false : options.enabled,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup({\n integrations: options.integrations,\n defaultIntegrations,\n }),\n transport: options.transport || makeFetchTransport,\n };\n return initAndBind(BrowserClient, clientOptions);\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n callback();\n}\n"],"names":["inboundFiltersIntegration","functionToStringIntegration","conversationIdIntegration","browserApiErrorsIntegration","breadcrumbsIntegration","globalHandlersIntegration","linkedErrorsIntegration","dedupeIntegration","httpContextIntegration","cultureContextIntegration","browserSessionIntegration","checkAndWarnIfIsEmbeddedBrowserExtension","spotlightBrowserIntegration","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","makeFetchTransport","initAndBind","BrowserClient"],"mappings":";;;;;;;;;;;;;;;;AAwBA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE;AACA;AACA;AACA;AACA,EAAE,OAAO;AACT;AACA;AACA,IAAIA,iCAAyB,EAAE;AAC/B,IAAIC,mCAA2B,EAAE;AACjC,IAAIC,iCAAyB,EAAE;AAC/B,IAAIC,4CAA2B,EAAE;AACjC,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,wCAAyB,EAAE;AAC/B,IAAIC,oCAAuB,EAAE;AAC7B,IAAIC,yBAAiB,EAAE;AACvB,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,wCAAyB,EAAE;AAC/B,IAAIC,wCAAyB,EAAE;AAC/B,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAAmB,EAAE,EAAsB;AACvE,EAAE,MAAM,uCAAA;AACR,IAAI,CAAC,OAAO,CAAC,6BAA6BC,+DAAwC,EAAE;;AAEpF,EAAE,IAAI,mBAAA;AACN,IAAI,OAAO,CAAC,mBAAA,IAAuB,IAAA,GAAO,sBAAsB,CAAQ,CAAA,GAAI,OAAO,CAAC,mBAAmB;;AAEvG;AACA,EAAE,IAAI,OAAO,CAAC,SAAS,EAAE;AACzB,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC9B,MAAM,mBAAA,GAAsB,EAAE;AAC9B,IAAI;AACJ,IAAI,MAAM,IAAA,GAAO,OAAO,OAAO,CAAC,cAAc,QAAA,GAAW,EAAE,UAAU,EAAE,OAAO,CAAC,SAAA,EAAU,GAAI,SAAS;AACtG,IAAI,mBAAmB,CAAC,IAAI,CAACC,qCAA2B,CAAC,IAAI,CAAC,CAAC;AAC/D,EAAE;AACF;;AAEA,EAAE,MAAM,aAAa,GAAyB;AAC9C,IAAI,GAAG,OAAO;AACd,IAAI,OAAO,EAAE,uCAAA,GAA0C,QAAQ,OAAO,CAAC,OAAO;AAC9E,IAAI,WAAW,EAAEC,yCAAiC,CAAC,OAAO,CAAC,WAAA,IAAeC,+BAAkB,CAAC;AAC7F,IAAI,YAAY,EAAEC,8BAAsB,CAAC;AACzC,MAAM,YAAY,EAAE,OAAO,CAAC,YAAY;AACxC,MAAM,mBAAmB;AACzB,KAAK,CAAC;AACN,IAAI,SAAS,EAAE,OAAO,CAAC,SAAA,IAAaC,wBAAkB;AACtD,GAAG;AACH,EAAE,OAAOC,mBAAW,CAACC,oBAAa,EAAE,aAAa,CAAC;AAClD;;AAEA;AACA;AACA;AACA;AACO,SAAS,SAAS,GAAS;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,QAAQ,EAAoB;AACnD,EAAE,QAAQ,EAAE;AACZ;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const core = require('@sentry/core');
3
+ const browser = require('@sentry/core/browser');
4
4
 
5
5
  const OPERA10_PRIORITY = 10;
6
6
  const OPERA11_PRIORITY = 20;
@@ -11,7 +11,7 @@ const GECKO_PRIORITY = 50;
11
11
  function createFrame(filename, func, lineno, colno) {
12
12
  const frame = {
13
13
  filename,
14
- function: func === '<anonymous>' ? core.UNKNOWN_FUNCTION : func,
14
+ function: func === '<anonymous>' ? browser.UNKNOWN_FUNCTION : func,
15
15
  in_app: true, // All browser frames are considered in_app
16
16
  };
17
17
 
@@ -58,7 +58,7 @@ const chromeStackParserFn = line => {
58
58
 
59
59
  if (noFnParts) {
60
60
  const [, filename, line, col] = noFnParts;
61
- return createFrame(filename, core.UNKNOWN_FUNCTION, +line, +col);
61
+ return createFrame(filename, browser.UNKNOWN_FUNCTION, +line, +col);
62
62
  }
63
63
 
64
64
  const parts = chromeRegex.exec(line) ;
@@ -79,7 +79,7 @@ const chromeStackParserFn = line => {
79
79
 
80
80
  // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
81
81
  // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
82
- const [func, filename] = extractSafariExtensionDetails(parts[1] || core.UNKNOWN_FUNCTION, parts[2]);
82
+ const [func, filename] = extractSafariExtensionDetails(parts[1] || browser.UNKNOWN_FUNCTION, parts[2]);
83
83
 
84
84
  return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);
85
85
  }
@@ -114,7 +114,7 @@ const gecko = line => {
114
114
  }
115
115
 
116
116
  let filename = parts[3];
117
- let func = parts[1] || core.UNKNOWN_FUNCTION;
117
+ let func = parts[1] || browser.UNKNOWN_FUNCTION;
118
118
  [func, filename] = extractSafariExtensionDetails(func, filename);
119
119
 
120
120
  return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);
@@ -131,7 +131,7 @@ const winjs = line => {
131
131
  const parts = winjsRegex.exec(line) ;
132
132
 
133
133
  return parts
134
- ? createFrame(parts[2], parts[1] || core.UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)
134
+ ? createFrame(parts[2], parts[1] || browser.UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)
135
135
  : undefined;
136
136
  };
137
137
 
@@ -141,7 +141,7 @@ const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$
141
141
 
142
142
  const opera10 = line => {
143
143
  const parts = opera10Regex.exec(line) ;
144
- return parts ? createFrame(parts[2], parts[3] || core.UNKNOWN_FUNCTION, +parts[1]) : undefined;
144
+ return parts ? createFrame(parts[2], parts[3] || browser.UNKNOWN_FUNCTION, +parts[1]) : undefined;
145
145
  };
146
146
 
147
147
  const opera10StackLineParser = [OPERA10_PRIORITY, opera10];
@@ -151,14 +151,14 @@ const opera11Regex =
151
151
 
152
152
  const opera11 = line => {
153
153
  const parts = opera11Regex.exec(line) ;
154
- return parts ? createFrame(parts[5], parts[3] || parts[4] || core.UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
154
+ return parts ? createFrame(parts[5], parts[3] || parts[4] || browser.UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
155
155
  };
156
156
 
157
157
  const opera11StackLineParser = [OPERA11_PRIORITY, opera11];
158
158
 
159
159
  const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser];
160
160
 
161
- const defaultStackParser = core.createStackParser(...defaultStackLineParsers);
161
+ const defaultStackParser = browser.createStackParser(...defaultStackLineParsers);
162
162
 
163
163
  /**
164
164
  * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces.
@@ -186,7 +186,7 @@ const extractSafariExtensionDetails = (func, filename) => {
186
186
 
187
187
  return isSafariExtension || isSafariWebExtension
188
188
  ? [
189
- func.indexOf('@') !== -1 ? (func.split('@')[0] ) : core.UNKNOWN_FUNCTION,
189
+ func.indexOf('@') !== -1 ? (func.split('@')[0] ) : browser.UNKNOWN_FUNCTION,
190
190
  isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,
191
191
  ]
192
192
  : [func, filename];
@@ -1 +1 @@
1
- {"version":3,"file":"stack-parsers.js","sources":["../../../../src/stack-parsers.ts"],"sourcesContent":["// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/core';\nimport { createStackParser, UNKNOWN_FUNCTION } from '@sentry/core';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n const frame: StackFrame = {\n filename,\n function: func === '<anonymous>' ? UNKNOWN_FUNCTION : func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// This regex matches frames that have no function name (ie. are at the top level of a module).\n// For example \"at http://localhost:5000//script.js:1:126\"\n// Frames _with_ function names usually look as follows: \"at commitLayoutEffects (react-dom.development.js:23426:1)\"\nconst chromeRegexNoFnName = /^\\s*at (\\S+?)(?::(\\d+))(?::(\\d+))\\s*$/i;\n\n// This regex matches all the frames that have a function name.\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\n\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// Matches stack frames with data URIs instead of filename so we can still get the function name\n// Example: \"at dynamicFn (data:application/javascript,export function dynamicFn() {...\"\nconst chromeDataUriRegex = /at (.+?) ?\\(data:(.+?),/;\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn: StackLineParserFn = line => {\n const dataUriMatch = line.match(chromeDataUriRegex);\n if (dataUriMatch) {\n return {\n filename: `<data:${dataUriMatch[2]}>`,\n function: dataUriMatch[1],\n };\n }\n\n // If the stack line has no function name, we need to parse it differently\n const noFnParts = chromeRegexNoFnName.exec(line) as null | [string, string, string, string];\n\n if (noFnParts) {\n const [, filename, line, col] = noFnParts;\n return createFrame(filename, UNKNOWN_FUNCTION, +line, +col);\n }\n\n const parts = chromeRegex.exec(line) as null | [string, string, string, string, string];\n\n if (parts) {\n const isEval = parts[2]?.indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]) as null | [string, string, string, string];\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n const parts = geckoREgex.exec(line) as null | [string, string, string, string, string, string];\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]) as null | [string, string, string];\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n const parts = winjsRegex.exec(line) as null | [string, string, string, string, string];\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n const parts = opera10Regex.exec(line) as null | [string, string, string, string];\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n const parts = opera11Regex.exec(line) as null | [string, string, string, string, string, string];\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? (func.split('@')[0] as string) : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` :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CAAA,IAAK,KAAK,CAAC,CAAC,CAAA,IAAKA,qBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,GAAI,SAAS;AAClH,CAAC;;AAEM,MAAM,sBAAsB,GAAoB,CAAC,gBAAgB,EAAE,OAAO;;MAEpE,uBAAA,GAA0B,CAAC,qBAAqB,EAAE,oBAAoB;;MAEtE,kBAAA,GAAqBC,sBAAiB,CAAC,GAAG,uBAAuB;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gCAAgC,CAAC,IAAI,EAAU,QAAQ,KAA+B;AAC5F,EAAE,MAAM,iBAAA,GAAoB,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAA,KAAM,EAAE;AACnE,EAAE,MAAM,oBAAA,GAAuB,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAA,KAAM,EAAE;;AAE1E,EAAE,OAAO,qBAAqB;AAC9B,MAAM;AACN,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAA,KAAM,EAAC,IAAK,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA,KAAeD,qBAAgB;AACpF,QAAQ,oBAAoB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA,GAAA,CAAA,qBAAA,EAAA,QAAA,CAAA,CAAA;AACA;AACA,MAAA,CAAA,IAAA,EAAA,QAAA,CAAA;AACA,CAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"stack-parsers.js","sources":["../../../../src/stack-parsers.ts"],"sourcesContent":["// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/core/browser';\nimport { createStackParser, UNKNOWN_FUNCTION } from '@sentry/core/browser';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n const frame: StackFrame = {\n filename,\n function: func === '<anonymous>' ? UNKNOWN_FUNCTION : func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// This regex matches frames that have no function name (ie. are at the top level of a module).\n// For example \"at http://localhost:5000//script.js:1:126\"\n// Frames _with_ function names usually look as follows: \"at commitLayoutEffects (react-dom.development.js:23426:1)\"\nconst chromeRegexNoFnName = /^\\s*at (\\S+?)(?::(\\d+))(?::(\\d+))\\s*$/i;\n\n// This regex matches all the frames that have a function name.\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\n\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// Matches stack frames with data URIs instead of filename so we can still get the function name\n// Example: \"at dynamicFn (data:application/javascript,export function dynamicFn() {...\"\nconst chromeDataUriRegex = /at (.+?) ?\\(data:(.+?),/;\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn: StackLineParserFn = line => {\n const dataUriMatch = line.match(chromeDataUriRegex);\n if (dataUriMatch) {\n return {\n filename: `<data:${dataUriMatch[2]}>`,\n function: dataUriMatch[1],\n };\n }\n\n // If the stack line has no function name, we need to parse it differently\n const noFnParts = chromeRegexNoFnName.exec(line) as null | [string, string, string, string];\n\n if (noFnParts) {\n const [, filename, line, col] = noFnParts;\n return createFrame(filename, UNKNOWN_FUNCTION, +line, +col);\n }\n\n const parts = chromeRegex.exec(line) as null | [string, string, string, string, string];\n\n if (parts) {\n const isEval = parts[2]?.indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]) as null | [string, string, string, string];\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n const parts = geckoREgex.exec(line) as null | [string, string, string, string, string, string];\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]) as null | [string, string, string];\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n const parts = winjsRegex.exec(line) as null | [string, string, string, string, string];\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n const parts = opera10Regex.exec(line) as null | [string, string, string, string];\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n const parts = opera11Regex.exec(line) as null | [string, string, string, string, string, string];\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? (func.split('@')[0] as string) : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web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IAAK,KAAK,CAAC,CAAC,CAAA,IAAKA,wBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,GAAI,SAAS;AAClH,CAAC;;AAEM,MAAM,sBAAsB,GAAoB,CAAC,gBAAgB,EAAE,OAAO;;MAEpE,uBAAA,GAA0B,CAAC,qBAAqB,EAAE,oBAAoB;;MAEtE,kBAAA,GAAqBC,yBAAiB,CAAC,GAAG,uBAAuB;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gCAAgC,CAAC,IAAI,EAAU,QAAQ,KAA+B;AAC5F,EAAE,MAAM,iBAAA,GAAoB,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAA,KAAM,EAAE;AACnE,EAAE,MAAM,oBAAA,GAAuB,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAA,KAAM,EAAE;;AAE1E,EAAE,OAAO,qBAAqB;AAC9B,MAAM;AACN,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAA,KAAM,EAAC,IAAK,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA,KAAeD,wBAAgB;AACpF,QAAQ,oBAAoB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA,GAAA,CAAA,qBAAA,EAAA,QAAA,CAAA,CAAA;AACA;AACA,MAAA,CAAA,IAAA,EAAA,QAAA,CAAA;AACA,CAAA;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const core = require('@sentry/core');
3
+ const browser = require('@sentry/core/browser');
4
4
  const debugBuild = require('../debug-build.js');
5
5
  const helpers = require('../helpers.js');
6
6
 
@@ -11,26 +11,26 @@ const helpers = require('../helpers.js');
11
11
  function registerBackgroundTabDetection() {
12
12
  if (helpers.WINDOW.document) {
13
13
  helpers.WINDOW.document.addEventListener('visibilitychange', () => {
14
- const activeSpan = core.getActiveSpan();
14
+ const activeSpan = browser.getActiveSpan();
15
15
  if (!activeSpan) {
16
16
  return;
17
17
  }
18
18
 
19
- const rootSpan = core.getRootSpan(activeSpan);
19
+ const rootSpan = browser.getRootSpan(activeSpan);
20
20
 
21
21
  if (helpers.WINDOW.document.hidden && rootSpan) {
22
22
  const cancelledStatus = 'cancelled';
23
23
 
24
- const { op, status } = core.spanToJSON(rootSpan);
24
+ const { op, status } = browser.spanToJSON(rootSpan);
25
25
 
26
26
  if (debugBuild.DEBUG_BUILD) {
27
- core.debug.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`);
27
+ browser.debug.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`);
28
28
  }
29
29
 
30
30
  // We should not set status if it is already set, this prevent important statuses like
31
31
  // error or data loss from being overwritten on transaction.
32
32
  if (!status) {
33
- rootSpan.setStatus({ code: core.SPAN_STATUS_ERROR, message: cancelledStatus });
33
+ rootSpan.setStatus({ code: browser.SPAN_STATUS_ERROR, message: cancelledStatus });
34
34
  }
35
35
 
36
36
  rootSpan.setAttribute('sentry.cancellation_reason', 'document.hidden');
@@ -38,7 +38,7 @@ function registerBackgroundTabDetection() {
38
38
  }
39
39
  });
40
40
  } else {
41
- debugBuild.DEBUG_BUILD && core.debug.warn('[Tracing] Could not set up background tab detection due to lack of global document');
41
+ debugBuild.DEBUG_BUILD && browser.debug.warn('[Tracing] Could not set up background tab detection due to lack of global document');
42
42
  }
43
43
  }
44
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"backgroundtab.js","sources":["../../../../../src/tracing/backgroundtab.ts"],"sourcesContent":["import { debug, getActiveSpan, getRootSpan, SPAN_STATUS_ERROR, spanToJSON } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n const rootSpan = getRootSpan(activeSpan);\n\n if (WINDOW.document.hidden && rootSpan) {\n const cancelledStatus = 'cancelled';\n\n const { op, status } = spanToJSON(rootSpan);\n\n if (DEBUG_BUILD) {\n debug.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`);\n }\n\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!status) {\n rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: cancelledStatus });\n }\n\n rootSpan.setAttribute('sentry.cancellation_reason', 'document.hidden');\n rootSpan.end();\n }\n });\n } else {\n DEBUG_BUILD && debug.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n"],"names":["WINDOW","getActiveSpan","getRootSpan","spanToJSON","DEBUG_BUILD","debug","SPAN_STATUS_ERROR"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,GAAS;AACvD,EAAE,IAAIA,cAAM,CAAC,QAAQ,EAAE;AACvB,IAAIA,cAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM;AAC/D,MAAM,MAAM,UAAA,GAAaC,kBAAa,EAAE;AACxC,MAAM,IAAI,CAAC,UAAU,EAAE;AACvB,QAAQ;AACR,MAAM;;AAEN,MAAM,MAAM,QAAA,GAAWC,gBAAW,CAAC,UAAU,CAAC;;AAE9C,MAAM,IAAIF,cAAM,CAAC,QAAQ,CAAC,MAAA,IAAU,QAAQ,EAAE;AAC9C,QAAQ,MAAM,eAAA,GAAkB,WAAW;;AAE3C,QAAQ,MAAM,EAAE,EAAE,EAAE,MAAA,KAAWG,eAAU,CAAC,QAAQ,CAAC;;AAEnD,QAAQ,IAAIC,sBAAW,EAAE;AACzB,UAAUC,UAAK,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,eAAe,CAAC,2CAA2C,EAAE,EAAE,CAAC,CAAA,CAAA;AACA,QAAA;;AAEA;AACA;AACA,QAAA,IAAA,CAAA,MAAA,EAAA;AACA,UAAA,QAAA,CAAA,SAAA,CAAA,EAAA,IAAA,EAAAC,sBAAA,EAAA,OAAA,EAAA,eAAA,EAAA,CAAA;AACA,QAAA;;AAEA,QAAA,QAAA,CAAA,YAAA,CAAA,4BAAA,EAAA,iBAAA,CAAA;AACA,QAAA,QAAA,CAAA,GAAA,EAAA;AACA,MAAA;AACA,IAAA,CAAA,CAAA;AACA,EAAA,CAAA,MAAA;AACA,IAAAF,sBAAA,IAAAC,UAAA,CAAA,IAAA,CAAA,oFAAA,CAAA;AACA,EAAA;AACA;;;;"}
1
+ {"version":3,"file":"backgroundtab.js","sources":["../../../../../src/tracing/backgroundtab.ts"],"sourcesContent":["import { debug, getActiveSpan, getRootSpan, SPAN_STATUS_ERROR, spanToJSON } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n if (WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n const rootSpan = getRootSpan(activeSpan);\n\n if (WINDOW.document.hidden && rootSpan) {\n const cancelledStatus = 'cancelled';\n\n const { op, status } = spanToJSON(rootSpan);\n\n if (DEBUG_BUILD) {\n debug.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`);\n }\n\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!status) {\n rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: cancelledStatus });\n }\n\n rootSpan.setAttribute('sentry.cancellation_reason', 'document.hidden');\n rootSpan.end();\n }\n });\n } else {\n DEBUG_BUILD && debug.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}\n"],"names":["WINDOW","getActiveSpan","getRootSpan","spanToJSON","DEBUG_BUILD","debug","SPAN_STATUS_ERROR"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,GAAS;AACvD,EAAE,IAAIA,cAAM,CAAC,QAAQ,EAAE;AACvB,IAAIA,cAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM;AAC/D,MAAM,MAAM,UAAA,GAAaC,qBAAa,EAAE;AACxC,MAAM,IAAI,CAAC,UAAU,EAAE;AACvB,QAAQ;AACR,MAAM;;AAEN,MAAM,MAAM,QAAA,GAAWC,mBAAW,CAAC,UAAU,CAAC;;AAE9C,MAAM,IAAIF,cAAM,CAAC,QAAQ,CAAC,MAAA,IAAU,QAAQ,EAAE;AAC9C,QAAQ,MAAM,eAAA,GAAkB,WAAW;;AAE3C,QAAQ,MAAM,EAAE,EAAE,EAAE,MAAA,KAAWG,kBAAU,CAAC,QAAQ,CAAC;;AAEnD,QAAQ,IAAIC,sBAAW,EAAE;AACzB,UAAUC,aAAK,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,eAAe,CAAC,2CAA2C,EAAE,EAAE,CAAC,CAAA,CAAA;AACA,QAAA;;AAEA;AACA;AACA,QAAA,IAAA,CAAA,MAAA,EAAA;AACA,UAAA,QAAA,CAAA,SAAA,CAAA,EAAA,IAAA,EAAAC,yBAAA,EAAA,OAAA,EAAA,eAAA,EAAA,CAAA;AACA,QAAA;;AAEA,QAAA,QAAA,CAAA,YAAA,CAAA,4BAAA,EAAA,iBAAA,CAAA;AACA,QAAA,QAAA,CAAA,GAAA,EAAA;AACA,MAAA;AACA,IAAA,CAAA,CAAA;AACA,EAAA,CAAA,MAAA;AACA,IAAAF,sBAAA,IAAAC,aAAA,CAAA,IAAA,CAAA,oFAAA,CAAA;AACA,EAAA;AACA;;;;"}