@sentry/browser 10.51.0 → 10.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) 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 +13 -24
  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 +31 -29
  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 +13 -24
  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 +31 -29
  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 +8 -19
  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 +6 -4
  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 +8 -19
  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 +6 -4
  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/spotlight.d.ts +4 -5
  394. package/build/npm/types/integrations/spotlight.d.ts.map +1 -1
  395. package/build/npm/types/integrations/view-hierarchy.d.ts +1 -1
  396. package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
  397. package/build/npm/types/integrations/webWorker.d.ts +1 -1
  398. package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
  399. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +1 -1
  400. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -1
  401. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
  402. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -1
  403. package/build/npm/types/integrations-bundle/index.dedupe.d.ts +1 -1
  404. package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -1
  405. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +1 -1
  406. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -1
  407. package/build/npm/types/integrations-bundle/index.feedback.d.ts +1 -1
  408. package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -1
  409. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
  410. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -1
  411. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
  412. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -1
  413. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
  414. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -1
  415. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
  416. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -1
  417. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
  418. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -1
  419. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +1 -1
  420. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -1
  421. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +1 -1
  422. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -1
  423. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  424. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -1
  425. package/build/npm/types/profiling/UIProfiler.d.ts +1 -1
  426. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
  427. package/build/npm/types/profiling/index.d.ts +1 -1
  428. package/build/npm/types/profiling/index.d.ts.map +1 -1
  429. package/build/npm/types/profiling/integration.d.ts.map +1 -1
  430. package/build/npm/types/profiling/startProfileForSpan.d.ts +1 -1
  431. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -1
  432. package/build/npm/types/profiling/utils.d.ts +3 -5
  433. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  434. package/build/npm/types/report-dialog.d.ts +1 -1
  435. package/build/npm/types/report-dialog.d.ts.map +1 -1
  436. package/build/npm/types/sdk.d.ts +1 -1
  437. package/build/npm/types/sdk.d.ts.map +1 -1
  438. package/build/npm/types/stack-parsers.d.ts +1 -1
  439. package/build/npm/types/stack-parsers.d.ts.map +1 -1
  440. package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -1
  441. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  442. package/build/npm/types/tracing/linkedTraces.d.ts +2 -2
  443. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
  444. package/build/npm/types/tracing/reportPageLoaded.d.ts +1 -1
  445. package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -1
  446. package/build/npm/types/tracing/request.d.ts +1 -1
  447. package/build/npm/types/tracing/request.d.ts.map +1 -1
  448. package/build/npm/types/tracing/setActiveSpan.d.ts +1 -1
  449. package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -1
  450. package/build/npm/types/transports/fetch.d.ts +1 -1
  451. package/build/npm/types/transports/fetch.d.ts.map +1 -1
  452. package/build/npm/types/transports/offline.d.ts +1 -1
  453. package/build/npm/types/transports/offline.d.ts.map +1 -1
  454. package/build/npm/types/transports/types.d.ts +1 -1
  455. package/build/npm/types/transports/types.d.ts.map +1 -1
  456. package/build/npm/types/userfeedback.d.ts +1 -1
  457. package/build/npm/types/userfeedback.d.ts.map +1 -1
  458. package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
  459. package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
  460. package/build/npm/types-ts3.8/client.d.ts +2 -2
  461. package/build/npm/types-ts3.8/eventbuilder.d.ts +1 -1
  462. package/build/npm/types-ts3.8/exports.d.ts +3 -3
  463. package/build/npm/types-ts3.8/feedbackAsync.d.ts +2 -7
  464. package/build/npm/types-ts3.8/feedbackSync.d.ts +2 -7
  465. package/build/npm/types-ts3.8/helpers.d.ts +2 -2
  466. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +1 -1
  467. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +1 -1
  468. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -1
  469. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +2 -2
  470. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -1
  471. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -1
  472. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  473. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
  474. package/build/npm/types-ts3.8/index.d.ts +3 -3
  475. package/build/npm/types-ts3.8/integrations/contextlines.d.ts +1 -1
  476. package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +1 -1
  477. package/build/npm/types-ts3.8/integrations/spotlight.d.ts +4 -5
  478. package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +1 -1
  479. package/build/npm/types-ts3.8/integrations/webWorker.d.ts +1 -1
  480. package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +1 -1
  481. package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
  482. package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +1 -1
  483. package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +1 -1
  484. package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +1 -1
  485. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
  486. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
  487. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
  488. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
  489. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
  490. package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +1 -1
  491. package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +1 -1
  492. package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  493. package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +1 -1
  494. package/build/npm/types-ts3.8/profiling/index.d.ts +1 -1
  495. package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +1 -1
  496. package/build/npm/types-ts3.8/profiling/utils.d.ts +3 -5
  497. package/build/npm/types-ts3.8/report-dialog.d.ts +1 -1
  498. package/build/npm/types-ts3.8/sdk.d.ts +1 -1
  499. package/build/npm/types-ts3.8/stack-parsers.d.ts +1 -1
  500. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +1 -1
  501. package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +2 -2
  502. package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +1 -1
  503. package/build/npm/types-ts3.8/tracing/request.d.ts +1 -1
  504. package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +1 -1
  505. package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
  506. package/build/npm/types-ts3.8/transports/offline.d.ts +1 -1
  507. package/build/npm/types-ts3.8/transports/types.d.ts +1 -1
  508. package/build/npm/types-ts3.8/userfeedback.d.ts +1 -1
  509. package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +1 -1
  510. package/package.json +7 -7
@@ -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 helpers = require('../helpers.js');
5
5
  const fetch = require('./fetch.js');
6
6
 
@@ -108,7 +108,7 @@ function createIndexedDbStore(options) {
108
108
  return {
109
109
  push: async (env) => {
110
110
  try {
111
- const serialized = core.serializeEnvelope(env);
111
+ const serialized = browser.serializeEnvelope(env);
112
112
  await push(getStore(), serialized, options.maxQueueSize || 30);
113
113
  } catch {
114
114
  //
@@ -116,7 +116,7 @@ function createIndexedDbStore(options) {
116
116
  },
117
117
  unshift: async (env) => {
118
118
  try {
119
- const serialized = core.serializeEnvelope(env);
119
+ const serialized = browser.serializeEnvelope(env);
120
120
  await unshift(getStore(), serialized, options.maxQueueSize || 30);
121
121
  } catch {
122
122
  //
@@ -126,7 +126,7 @@ function createIndexedDbStore(options) {
126
126
  try {
127
127
  const deserialized = await shift(getStore());
128
128
  if (deserialized) {
129
- return core.parseEnvelope(deserialized);
129
+ return browser.parseEnvelope(deserialized);
130
130
  }
131
131
  } catch {
132
132
  //
@@ -157,7 +157,7 @@ function makeIndexedDbOfflineTransport(
157
157
  function makeBrowserOfflineTransport(
158
158
  createTransport = fetch.makeFetchTransport,
159
159
  ) {
160
- return makeIndexedDbOfflineTransport(core.makeOfflineTransport(createTransport));
160
+ return makeIndexedDbOfflineTransport(browser.makeOfflineTransport(createTransport));
161
161
  }
162
162
 
163
163
  exports.createStore = createStore;
@@ -1 +1 @@
1
- {"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type { BaseTransportOptions, Envelope, OfflineStore, OfflineTransportOptions, Transport } from '@sentry/core';\nimport { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core';\nimport { WINDOW } from '../helpers';\nimport { makeFetchTransport } from './fetch';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original license:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n // @ts-expect-error - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-expect-error - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the end of the store */\nexport function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an incremented key so that the entries are popped in order\n store.put(value, Math.max(...keys, 0) + 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Insert into the front of the store */\nexport function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an decremented key so that the entries are popped in order\n store.put(value, Math.min(...keys, 0) - 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Pop the oldest value from the store */\nexport function shift(store: Store): Promise<Uint8Array | string | undefined> {\n return store(store => {\n return keys(store).then(keys => {\n const firstKey = keys[0];\n if (firstKey == null) {\n return undefined;\n }\n\n return promisifyRequest(store.get(firstKey)).then(value => {\n store.delete(firstKey);\n return promisifyRequest(store.transaction).then(() => value);\n });\n });\n });\n}\n\nexport interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> {\n /**\n * Name of indexedDb database to store envelopes in\n * Default: 'sentry-offline'\n */\n dbName?: string;\n /**\n * Name of indexedDb object store to store envelopes in\n * Default: 'queue'\n */\n storeName?: string;\n /**\n * Maximum number of envelopes to store\n * Default: 30\n */\n maxQueueSize?: number;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n let store: Store | undefined;\n\n // Lazily create the store only when it's needed\n function getStore(): Store {\n if (store == undefined) {\n store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n }\n\n return store;\n }\n\n return {\n push: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await push(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n unshift: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await unshift(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n shift: async () => {\n try {\n const deserialized = await shift(getStore());\n if (deserialized) {\n return parseEnvelope(deserialized);\n }\n } catch {\n //\n }\n\n return undefined;\n },\n };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return options => {\n const transport = createTransport({ ...options, createStore: createIndexedDbStore });\n\n WINDOW.addEventListener('online', async _ => {\n await transport.flush();\n });\n\n return transport;\n };\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends BaseTransportOptions>(\n createTransport: (options: T) => Transport = makeFetchTransport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n"],"names":["serializeEnvelope","parseEnvelope","WINDOW","makeFetchTransport","makeOfflineTransport"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAAS,gBAAgB,CAAgB,OAAO,EAA8C;AAC9F,EAAE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,KAAK;AAC7C;AACA,IAAI,OAAO,CA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EAAE,WAAW,EAAE,oBAAA,EAAsB,CAAC;;AAExF,IAAIC,cAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,KAAK;AACjD,MAAM,MAAM,SAAS,CAAC,KAAK,EAAE;AAC7B,IAAI,CAAC,CAAC;;AAEN,IAAI,OAAO,SAAS;AACpB,EAAE,CAAC;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,eAAe,GAA8BC,wBAAkB;AACjE,EAA8D;AAC9D,EAAE,OAAO,6BAA6B,CAAIC,yBAAoB,CAAC,eAAe,CAAC,CAAC;AAChF;;;;;;;;"}
1
+ {"version":3,"file":"offline.js","sources":["../../../../../src/transports/offline.ts"],"sourcesContent":["import type {\n BaseTransportOptions,\n Envelope,\n OfflineStore,\n OfflineTransportOptions,\n Transport,\n} from '@sentry/core/browser';\nimport { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\nimport { makeFetchTransport } from './fetch';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original license:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n // @ts-expect-error - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-expect-error - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n\n return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the end of the store */\nexport function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an incremented key so that the entries are popped in order\n store.put(value, Math.max(...keys, 0) + 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Insert into the front of the store */\nexport function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n return store(store => {\n return keys(store).then(keys => {\n if (keys.length >= maxQueueSize) {\n return;\n }\n\n // We insert with an decremented key so that the entries are popped in order\n store.put(value, Math.min(...keys, 0) - 1);\n return promisifyRequest(store.transaction);\n });\n });\n}\n\n/** Pop the oldest value from the store */\nexport function shift(store: Store): Promise<Uint8Array | string | undefined> {\n return store(store => {\n return keys(store).then(keys => {\n const firstKey = keys[0];\n if (firstKey == null) {\n return undefined;\n }\n\n return promisifyRequest(store.get(firstKey)).then(value => {\n store.delete(firstKey);\n return promisifyRequest(store.transaction).then(() => value);\n });\n });\n });\n}\n\nexport interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> {\n /**\n * Name of indexedDb database to store envelopes in\n * Default: 'sentry-offline'\n */\n dbName?: string;\n /**\n * Name of indexedDb object store to store envelopes in\n * Default: 'queue'\n */\n storeName?: string;\n /**\n * Maximum number of envelopes to store\n * Default: 30\n */\n maxQueueSize?: number;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n let store: Store | undefined;\n\n // Lazily create the store only when it's needed\n function getStore(): Store {\n if (store == undefined) {\n store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n }\n\n return store;\n }\n\n return {\n push: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await push(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n unshift: async (env: Envelope) => {\n try {\n const serialized = serializeEnvelope(env);\n await unshift(getStore(), serialized, options.maxQueueSize || 30);\n } catch {\n //\n }\n },\n shift: async () => {\n try {\n const deserialized = await shift(getStore());\n if (deserialized) {\n return parseEnvelope(deserialized);\n }\n } catch {\n //\n }\n\n return undefined;\n },\n };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return options => {\n const transport = createTransport({ ...options, createStore: createIndexedDbStore });\n\n WINDOW.addEventListener('online', async _ => {\n await transport.flush();\n });\n\n return transport;\n };\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends BaseTransportOptions>(\n createTransport: (options: T) => Transport = makeFetchTransport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n"],"names":["serializeEnvelope","parseEnvelope","WINDOW","makeFetchTransport","makeOfflineTransport"],"mappings":";;;;;;AAWA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAAS,gBAAgB,CAAgB,OAAO,EAA8C;AAC9F,EAAE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,KAAK;AAC7C;AACA,IAAI,OAAO,CAAC,UAAA,GAAa,OAAO,CAAC,SAAA,GAAY,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;AAC1E;AACA,I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AM,KAAK;AACjD,MAAM,MAAM,SAAS,CAAC,KAAK,EAAE;AAC7B,IAAI,CAAC,CAAC;;AAEN,IAAI,OAAO,SAAS;AACpB,EAAE,CAAC;AACH;;AAEA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,eAAe,GAA8BC,wBAAkB;AACjE,EAA8D;AAC9D,EAAE,OAAO,6BAA6B,CAAIC,4BAAoB,CAAC,eAAe,CAAC,CAAC;AAChF;;;;;;;;"}
@@ -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
  /**
6
6
  * Creates an envelope from a user feedback.
@@ -24,11 +24,11 @@ function createUserFeedbackEnvelope(
24
24
  version: metadata.sdk.version,
25
25
  },
26
26
  }),
27
- ...(!!tunnel && !!dsn && { dsn: core.dsnToString(dsn) }),
27
+ ...(!!tunnel && !!dsn && { dsn: browser.dsnToString(dsn) }),
28
28
  };
29
29
  const item = createUserFeedbackEnvelopeItem(feedback);
30
30
 
31
- return core.createEnvelope(headers, [item]);
31
+ return browser.createEnvelope(headers, [item]);
32
32
  }
33
33
 
34
34
  function createUserFeedbackEnvelopeItem(feedback) {
@@ -1 +1 @@
1
- {"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core';\nimport { createEnvelope, dsnToString } from '@sentry/core';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP;;AAIE;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAQ,EAAE,OAAO;AACzB,MAAM,GAAG,EAAE;AACX,QAAQ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC/B,QAAQ,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACrC,OAAO;AACP,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAEA,gBAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACvD,GAAG;AACH,EAAE,MAAM,IAAA,GAAO,8BAA8B,CAAC,QAAQ,CAAC;;AAEvD,EAAE,OAAOC,mBAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AACxC;;AAEA,SAAS,8BAA8B,CAAC,QAAQ,EAAkC;AAClF,EAAE,MAAM,eAAe,GAAwB;AAC/C,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG;AACH,EAAE,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC;AACpC;;;;"}
1
+ {"version":3,"file":"userfeedback.js","sources":["../../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/core/browser';\nimport { createEnvelope, dsnToString } from '@sentry/core/browser';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata?.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP;;AAIE;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAQ,EAAE,OAAO;AACzB,MAAM,GAAG,EAAE;AACX,QAAQ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AAC/B,QAAQ,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACrC,OAAO;AACP,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,CAAC,MAAA,IAAU,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAEA,mBAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACvD,GAAG;AACH,EAAE,MAAM,IAAA,GAAO,8BAA8B,CAAC,QAAQ,CAAC;;AAEvD,EAAE,OAAOC,sBAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AACxC;;AAEA,SAAS,8BAA8B,CAAC,QAAQ,EAAkC;AAClF,EAAE,MAAM,eAAe,GAAwB;AAC/C,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG;AACH,EAAE,OAAO,CAAC,eAAe,EAAE,QAAQ,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 debugBuild = require('../debug-build.js');
5
5
  const helpers = require('../helpers.js');
6
6
 
@@ -11,7 +11,7 @@ const helpers = require('../helpers.js');
11
11
  function checkAndWarnIfIsEmbeddedBrowserExtension() {
12
12
  if (_isEmbeddedBrowserExtension()) {
13
13
  if (debugBuild.DEBUG_BUILD) {
14
- core.consoleSandbox(() => {
14
+ browser.consoleSandbox(() => {
15
15
  // eslint-disable-next-line no-console
16
16
  console.error(
17
17
  '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
@@ -45,7 +45,7 @@ function _isEmbeddedBrowserExtension() {
45
45
  return false;
46
46
  }
47
47
 
48
- const href = core.getLocationHref();
48
+ const href = browser.getLocationHref();
49
49
 
50
50
  // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage
51
51
  const isDedicatedExtensionPage =
@@ -1 +1 @@
1
- {"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top &&\n /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\\/\\//.test(href);\n\n return !isDedicatedExtensionPage;\n}\n"],"names":["DEBUG_BUILD","consoleSandbox","WINDOW","getLocationHref"],"mappings":";;;;;;AAeA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAY;AACpE,EAAE,IAAI,2BAA2B,EAAE,EAAE;AACrC,IAAI,IAAIA,sBAAW,EAAE;AACrB,MAAMC,mBAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,KAAK;AACrB,UAAU,mJAAmJ;AAC7J,SAAS;AACT,MAAM,CAAC,CAAC;AACR,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;AAEA,SAAS,2BAA2B,GAAY;AAChD,EAAE,IAAI,OAAOC,cAAM,CAAC,MAAA,KAAW,WAAW,EAAE;AAC5C;AACA,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAUA,cAAA;;AAElB;AACA;AACA,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE;AAClB,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,eAAA,GAAkB,OAAO,CAAC,QAAQ,CAAA,IAAK,OAAO,CAAC,SAAS,CAAC;;AAEjE,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAOC,oBAAe,EAAE;;AAEhC;AACA,EAAE,MAAM,wBAAA;AACR,IAAID,cAAA,KAAWA,cAAM,CAAC,GAAA;AACtB,IAAI,oFAAoF,CAAC,IAAI,CAAC,IAAI,CAAC;;AAEnG,EAAE,OAAO,CAAC,wBAAwB;AAClC;;;;"}
1
+ {"version":3,"file":"detectBrowserExtension.js","sources":["../../../../../src/utils/detectBrowserExtension.ts"],"sourcesContent":["import { consoleSandbox, getLocationHref } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\ntype ExtensionRuntime = {\n runtime?: {\n id?: string;\n };\n};\ntype ExtensionProperties = {\n chrome?: ExtensionRuntime;\n browser?: ExtensionRuntime;\n nw?: unknown;\n};\n\n/**\n * Returns true if the SDK is running in an embedded browser extension.\n * Stand-alone browser extensions (which do not share the same data as the main browser page) are fine.\n */\nexport function checkAndWarnIfIsEmbeddedBrowserExtension(): boolean {\n if (_isEmbeddedBrowserExtension()) {\n if (DEBUG_BUILD) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(\n '[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',\n );\n });\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction _isEmbeddedBrowserExtension(): boolean {\n if (typeof WINDOW.window === 'undefined') {\n // No need to show the error if we're not in a browser window environment (e.g. service workers)\n return false;\n }\n\n const _window = WINDOW as typeof WINDOW & ExtensionProperties;\n\n // Running the SDK in NW.js, which appears like a browser extension but isn't, is also fine\n // see: https://github.com/getsentry/sentry-javascript/issues/12668\n if (_window.nw) {\n return false;\n }\n\n const extensionObject = _window['chrome'] || _window['browser'];\n\n if (!extensionObject?.runtime?.id) {\n return false;\n }\n\n const href = getLocationHref();\n\n // Running the SDK in a dedicated extension page and calling Sentry.init is fine; no risk of data leakage\n const isDedicatedExtensionPage =\n WINDOW === WINDOW.top &&\n /^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\\/\\//.test(href);\n\n return !isDedicatedExtensionPage;\n}\n"],"names":["DEBUG_BUILD","consoleSandbox","WINDOW","getLocationHref"],"mappings":";;;;;;AAeA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAY;AACpE,EAAE,IAAI,2BAA2B,EAAE,EAAE;AACrC,IAAI,IAAIA,sBAAW,EAAE;AACrB,MAAMC,sBAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,KAAK;AACrB,UAAU,mJAAmJ;AAC7J,SAAS;AACT,MAAM,CAAC,CAAC;AACR,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;AAEA,SAAS,2BAA2B,GAAY;AAChD,EAAE,IAAI,OAAOC,cAAM,CAAC,MAAA,KAAW,WAAW,EAAE;AAC5C;AACA,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAUA,cAAA;;AAElB;AACA;AACA,EAAE,IAAI,OAAO,CAAC,EAAE,EAAE;AAClB,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,eAAA,GAAkB,OAAO,CAAC,QAAQ,CAAA,IAAK,OAAO,CAAC,SAAS,CAAC;;AAEjE,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAOC,uBAAe,EAAE;;AAEhC;AACA,EAAE,MAAM,wBAAA;AACR,IAAID,cAAA,KAAWA,cAAM,CAAC,GAAA;AACtB,IAAI,oFAAoF,CAAC,IAAI,CAAC,IAAI,CAAC;;AAEnG,EAAE,OAAO,CAAC,wBAAwB;AAClC;;;;"}
@@ -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 helpers = require('../helpers.js');
5
5
 
6
6
  // Single source of truth: as const array provides both the runtime list and the type.
@@ -111,10 +111,10 @@ async function lazyLoadIntegration(
111
111
  }
112
112
 
113
113
  function getScriptURL(bundle) {
114
- const client = core.getClient();
114
+ const client = browser.getClient();
115
115
  const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';
116
116
 
117
- return new URL(`/${core.SDK_VERSION}/${bundle}.min.js`, baseURL).toString();
117
+ return new URL(`/${browser.SDK_VERSION}/${bundle}.min.js`, baseURL).toString();
118
118
  }
119
119
 
120
120
  exports.lazyLoadIntegration = lazyLoadIntegration;
@@ -1 +1 @@
1
- {"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { getClient, SDK_VERSION } from '@sentry/core';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// Single source of truth: as const array provides both the runtime list and the type.\n// Bundle file names are derived: strip 'Integration' suffix, lowercase.\n// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.\nconst LAZY_LOADABLE_NAMES = [\n 'replayIntegration',\n 'replayCanvasIntegration',\n 'feedbackIntegration',\n 'feedbackModalIntegration',\n 'feedbackScreenshotIntegration',\n 'captureConsoleIntegration',\n 'contextLinesIntegration',\n 'linkedErrorsIntegration',\n 'dedupeIntegration',\n 'extraErrorDataIntegration',\n 'graphqlClientIntegration',\n 'httpClientIntegration',\n 'reportingObserverIntegration',\n 'rewriteFramesIntegration',\n 'browserProfilingIntegration',\n 'moduleMetadataIntegration',\n 'instrumentAnthropicAiClient',\n 'instrumentOpenAiClient',\n 'instrumentGoogleGenAIClient',\n 'instrumentLangGraph',\n 'createLangChainCallbackHandler',\n 'instrumentLangChainEmbeddings',\n] as const;\n\ntype ElementOf<T extends readonly unknown[]> = T[number];\ntype LazyLoadableIntegrationName = ElementOf<typeof LAZY_LOADABLE_NAMES>;\n\nconst HYPHENATED_BUNDLES: Partial<Record<LazyLoadableIntegrationName, string>> = {\n replayCanvasIntegration: 'replay-canvas',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n};\n\nfunction getBundleName(name: string): string {\n return HYPHENATED_BUNDLES[name as LazyLoadableIntegrationName] || name.replace('Integration', '').toLowerCase();\n}\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<LazyLoadableIntegrationName, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: LazyLoadableIntegrationName,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA;AACA;AACA,MAAM,sBAAsB;AAC5B,EAAE,mBAAmB;AACrB,EAAE,yBAAyB;AAC3B,EAAE,qBAAqB;AACvB,EAAE,0BAA0B;AAC5B,EAAE,+BAA+B;AACjC,EAAE,2BAA2B;AAC7B,EAAE,yBAAyB;AAC3B,EAAE,yBAAyB;AAC3B,EAAE,mBAAmB;AACrB,EAAE,2BAA2B;AAC7B,EAAE,0BAA0B;AAC5B,EAAE,uBAAuB;AACzB,EAAE,8BAA8B;AACh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,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAC,cAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAAC,gBAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;AACA;;;;"}
1
+ {"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { getClient, SDK_VERSION } from '@sentry/core/browser';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// Single source of truth: as const array provides both the runtime list and the type.\n// Bundle file names are derived: strip 'Integration' suffix, lowercase.\n// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.\nconst LAZY_LOADABLE_NAMES = [\n 'replayIntegration',\n 'replayCanvasIntegration',\n 'feedbackIntegration',\n 'feedbackModalIntegration',\n 'feedbackScreenshotIntegration',\n 'captureConsoleIntegration',\n 'contextLinesIntegration',\n 'linkedErrorsIntegration',\n 'dedupeIntegration',\n 'extraErrorDataIntegration',\n 'graphqlClientIntegration',\n 'httpClientIntegration',\n 'reportingObserverIntegration',\n 'rewriteFramesIntegration',\n 'browserProfilingIntegration',\n 'moduleMetadataIntegration',\n 'instrumentAnthropicAiClient',\n 'instrumentOpenAiClient',\n 'instrumentGoogleGenAIClient',\n 'instrumentLangGraph',\n 'createLangChainCallbackHandler',\n 'instrumentLangChainEmbeddings',\n] as const;\n\ntype ElementOf<T extends readonly unknown[]> = T[number];\ntype LazyLoadableIntegrationName = ElementOf<typeof LAZY_LOADABLE_NAMES>;\n\nconst HYPHENATED_BUNDLES: Partial<Record<LazyLoadableIntegrationName, string>> = {\n replayCanvasIntegration: 'replay-canvas',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n};\n\nfunction getBundleName(name: string): string {\n return HYPHENATED_BUNDLES[name as LazyLoadableIntegrationName] || name.replace('Integration', '').toLowerCase();\n}\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<LazyLoadableIntegrationName, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: LazyLoadableIntegrationName,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":["WINDOW","getClient","SDK_VERSION"],"mappings":";;;;;AAKA;AACA;AACA;AACA,MAAM,sBAAsB;AAC5B,EAAE,mBAAmB;AACrB,EAAE,yBAAyB;AAC3B,EAAE,qBAAqB;AACvB,EAAE,0BAA0B;AAC5B,EAAE,+BAA+B;AACjC,EAAE,2BAA2B;AAC7B,EAAE,yBAAyB;AAC3B,EAAE,yBAAyB;AAC3B,EAAE,mBAAmB;AACrB,EAAE,2BAA2B;AAC7B,EAAE,0BAA0B;AAC5B,EAAE,uBAAuB;AACzB,EAAE,8BAA8B;AAChC,EAAE,0BAA0B;AAC5B,EAAE,6BAA6B;AAC/B,EAAE,2BAA2B;AAC7B,EAAE,6BAA6B;AAC/B,EAAE,wBAAwB;AAC1B,EAAE,6BAA6B;AAC/B,EAAE,qBAAqB;AACvB,EAAE,gCAAgC;AAClC,EAAE,+BAA+B;AACjC,CAAA;;AAKA,MAAM,kBAAkB,GAAyD;AACjF,EAAE,uBAAuB,EAAE,eAAe;AAC1C,EAAE,wBAAwB,EAAE,gBAAgB;AAC5C,EAAE,6BAA6B,EAAE,qBAAqB;AACtD,CAAC;;AAED,SAAS,aAAa,CAAC,IAAI,EAAkB;AAC7C,EAAE,OAAO,kBAAkB,CAAC,IAAA,EAAK,IAAmC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;AACjH;;AAEA,MAAM,0BAAA,GAA6BA;;AAEnC;;AAEA;AACA;AACA;AACA;AACO,eAAe,mBAAmB;AACzC,EAAE,IAAI;AACN,EAAE,WAA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A,cAAA,CAAA,QAAA,CAAA,IAAA,IAAAA,cAAA,CAAA,QAAA,CAAA,IAAA,IAAA,aAAA,EAAA,aAAA;;AAEA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,MAAA,CAAA,WAAA,CAAA,MAAA,CAAA;AACA,EAAA,CAAA,MAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,oDAAA,EAAA,IAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,IAAA;AACA,IAAA,MAAA,WAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,gCAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,MAAA,aAAA,GAAA,cAAA,CAAA,IAAA,CAAA;;AAEA,EAAA,IAAA,OAAA,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,4BAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,aAAA;AACA;;AAEA,SAAA,YAAA,CAAA,MAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAC,iBAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,IAAA,gCAAA;;AAEA,EAAA,OAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAAAC,mBAAA,CAAA,CAAA,EAAA,MAAA,CAAA,OAAA,CAAA,EAAA,OAAA,CAAA,CAAA,QAAA,EAAA;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 eventbuilder = require('./eventbuilder.js');
5
5
  const helpers = require('./helpers.js');
6
6
 
@@ -14,7 +14,7 @@ const helpers = require('./helpers.js');
14
14
  * @see BrowserOptions for documentation on configuration options.
15
15
  * @see SentryClient for usage documentation.
16
16
  */
17
- class BrowserClient extends core.Client {
17
+ class BrowserClient extends browser.Client {
18
18
  /**
19
19
  * Creates a new Browser SDK instance.
20
20
  *
@@ -22,8 +22,8 @@ class BrowserClient extends core.Client {
22
22
  */
23
23
  constructor(options) {
24
24
  const opts = applyDefaultOptions(options);
25
- const sdkSource = helpers.WINDOW.SENTRY_SDK_SOURCE || core.getSDKSource();
26
- core.applySdkMetadata(opts, 'browser', ['browser'], sdkSource);
25
+ const sdkSource = helpers.WINDOW.SENTRY_SDK_SOURCE || browser.getSDKSource();
26
+ browser.applySdkMetadata(opts, 'browser', ['browser'], sdkSource);
27
27
 
28
28
  // Only allow IP inferral by Relay if sendDefaultPii is true
29
29
  if (opts._metadata?.sdk) {
@@ -57,18 +57,18 @@ class BrowserClient extends core.Client {
57
57
  this._flushOutcomes();
58
58
  }
59
59
  if (enableLogs) {
60
- core._INTERNAL_flushLogsBuffer(this);
60
+ browser._INTERNAL_flushLogsBuffer(this);
61
61
  }
62
62
 
63
63
  if (enableMetrics) {
64
- core._INTERNAL_flushMetricsBuffer(this);
64
+ browser._INTERNAL_flushMetricsBuffer(this);
65
65
  }
66
66
  }
67
67
  });
68
68
  }
69
69
 
70
70
  if (sendDefaultPii) {
71
- this.on('beforeSendSession', core.addAutoIpAddressToSession);
71
+ this.on('beforeSendSession', browser.addAutoIpAddressToSession);
72
72
  }
73
73
  }
74
74
 
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const {\n sendDefaultPii,\n sendClientReports,\n enableLogs,\n _experiments,\n enableMetrics: enableMetricsOption,\n } = this._options;\n\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;\n\n // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\n // todo(v11): Remove the experimental flag\n if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n\n if (enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":["Client","WINDOW","getSDKSource","applySdkMetadata","_INTERNAL_flushLogsBuffer","_INTERNAL_flushMetricsBuffer","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAuBA;AACA;AACA;;AAmDA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsBA,WAAM,CAAuB;AAChE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAYC,cAAM,CAAC,iBAAA,IAAqBC,iBAAY,EAAE;AAChE,IAAIC,qBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D;AACA,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;AAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW;AACpC,QAAQ,QAAQ,EAAE,IAAI,CAAC,iBAAiB,MAAA,GAAS,OAAO;AACxD;AACA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ;AACtC,OAAO;AACP,IAAI;;AAEJ,IAAI,KAAK,CAAC,IAAI,CAAC;;AAEf,IAAI,MAAM;AACV,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,UAAU;AAChB,MAAM,YAAY;AAClB,MAAM,aAAa,EAAE,mBAAmB;AACxC,KAAI,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AC,gBAAgB,CAAC;AAC5G,EAAE;;AAEF;AACA;AACA;AACA,GAAY,aAAa;AACzB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAA+B;AAC/B,IAAI,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE,EAAE;AACF;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAUP,cAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;;"}
1
+ {"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core/browser';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core/browser';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const {\n sendDefaultPii,\n sendClientReports,\n enableLogs,\n _experiments,\n enableMetrics: enableMetricsOption,\n } = this._options;\n\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;\n\n // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\n // todo(v11): Remove the experimental flag\n if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n\n if (enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":["Client","WINDOW","getSDKSource","applySdkMetadata","_INTERNAL_flushLogsBuffer","_INTERNAL_flushMetricsBuffer","addAutoIpAddressToSession","eventFromException","eventFromMessage"],"mappings":";;;;;;AAuBA;AACA;AACA;;AAmDA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsBA,cAAM,CAAuB;AAChE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAYC,cAAM,CAAC,iBAAA,IAAqBC,oBAAY,EAAE;AAChE,IAAIC,wBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D;AACA,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;AAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW;AACpC,QAAQ,QAAQ,EAAE,IAAI,CAAC,iBAAiB,MAAA,GAAS,OAAO;AACxD;AACA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ;AACtC,OAAO;AACP,IAAI;;AAEJ,IAAI,KAAK,CAAC,IAAI,CAAC;;AAEf,IAAI,MAAM;AACV,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,UAAU;AAChB,MAAM,YAAY;AAClB,MAAM,aAAa,EAAE,mBAAmB;AACxC,KAAI,GAAI,IAAI,CAAC,QAAQ;;AAErB;AACA;AACA,IAAI,MAAM,gBAAgB,mBAAA,IAAuB,YAAY,EAAE,aAAA,IAAiB,IAAI;;AAEpF;AACA;AACA,IAAI,IAAIF,cAAM,CAAC,QAAA,KAAa,iBAAA,IAAqB,UAAA,IAAc,aAAa,CAAC,EAAE;AAC/E,MAAMA,cAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM;A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YAAY,EAAE,cAAc,CAAC;AACzE,EAAE;AACF;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAUP,cAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;;"}
@@ -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
  /**
6
6
  * A function to diagnose why the SDK might not be successfully sending data.
@@ -14,7 +14,7 @@ const core = require('@sentry/core');
14
14
  async function diagnoseSdkConnectivity()
15
15
 
16
16
  {
17
- const client = core.getClient();
17
+ const client = browser.getClient();
18
18
 
19
19
  if (!client) {
20
20
  return 'no-client-active';
@@ -38,7 +38,7 @@ async function diagnoseSdkConnectivity()
38
38
  const url = tunnel || defaultUrl;
39
39
 
40
40
  try {
41
- await core.suppressTracing(() =>
41
+ await browser.suppressTracing(() =>
42
42
  // If fetch throws, there is likely an ad blocker active or there are other connective issues.
43
43
  fetch(url, {
44
44
  body: '{}',
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n // Check if a tunnel is configured and use it if available\n const tunnel = client.getOptions().tunnel;\n\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n const defaultUrl =\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7';\n\n const url = tunnel || defaultUrl;\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(url, {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n }),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":["getClient","suppressTracing"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAASA,cAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B,EAAE;;AAEF,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF;AACA,EAAE,MAAM,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM;;AAE3C;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,UAAA;AACR,IAAI,+KAA+K;;AAEnL,EAAE,MAAM,GAAA,GAAM,MAAA,IAAU,UAAU;;AAElC,EAAE,IAAI;AACN,IAAI,MAAMC,oBAAe,CAAC;AAC1B;AACA,MAAM,KAAK,CAAC,GAAG,EAAE;AACjB,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,WAAW,EAAE,MAAM;AAC3B,OAAO,CAAC;AACR,KAAK;AACL,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core/browser';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n // Check if a tunnel is configured and use it if available\n const tunnel = client.getOptions().tunnel;\n\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n const defaultUrl =\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7';\n\n const url = tunnel || defaultUrl;\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(url, {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n }),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":["getClient","suppressTracing"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAASA,iBAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B,EAAE;;AAEF,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF;AACA,EAAE,MAAM,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM;;AAE3C;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,UAAA;AACR,IAAI,+KAA+K;;AAEnL,EAAE,MAAM,GAAA,GAAM,MAAA,IAAU,UAAU;;AAElC,EAAE,IAAI;AACN,IAAI,MAAMC,uBAAe,CAAC;AAC1B;AACA,MAAM,KAAK,CAAC,GAAG,EAAE;AACjB,QAAQ,IAAI,EAAE,IAAI;AAClB,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,IAAI,EAAE,MAAM;AACpB,QAAQ,WAAW,EAAE,MAAM;AAC3B,OAAO,CAAC;AACR,KAAK;AACL,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B,EAAE;AACF;;;;"}
@@ -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
  /**
6
6
  * This function creates an exception from a JavaScript Error
@@ -31,14 +31,14 @@ function eventFromPlainObject(
31
31
  syntheticException,
32
32
  isUnhandledRejection,
33
33
  ) {
34
- const client = core.getClient();
34
+ const client = browser.getClient();
35
35
  const normalizeDepth = client?.getOptions().normalizeDepth;
36
36
 
37
37
  // If we can, we extract an exception from the object properties
38
38
  const errorFromProp = getErrorPropertyFromObject(exception);
39
39
 
40
40
  const extra = {
41
- __serialized__: core.normalizeToSize(exception, normalizeDepth),
41
+ __serialized__: browser.normalizeToSize(exception, normalizeDepth),
42
42
  };
43
43
 
44
44
  if (errorFromProp) {
@@ -54,7 +54,7 @@ function eventFromPlainObject(
54
54
  exception: {
55
55
  values: [
56
56
  {
57
- type: core.isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
57
+ type: browser.isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
58
58
  value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),
59
59
  } ,
60
60
  ],
@@ -190,10 +190,10 @@ function extractMessage(ex) {
190
190
  }
191
191
 
192
192
  if (message.error && typeof message.error.message === 'string') {
193
- return core._INTERNAL_enhanceErrorWithSentryInfo(message.error);
193
+ return browser._INTERNAL_enhanceErrorWithSentryInfo(message.error);
194
194
  }
195
195
 
196
- return core._INTERNAL_enhanceErrorWithSentryInfo(ex);
196
+ return browser._INTERNAL_enhanceErrorWithSentryInfo(ex);
197
197
  }
198
198
 
199
199
  /**
@@ -208,12 +208,12 @@ function eventFromException(
208
208
  ) {
209
209
  const syntheticException = hint?.syntheticException || undefined;
210
210
  const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
211
- core.addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
211
+ browser.addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
212
212
  event.level = 'error';
213
213
  if (hint?.event_id) {
214
214
  event.event_id = hint.event_id;
215
215
  }
216
- return core.resolvedSyncPromise(event);
216
+ return browser.resolvedSyncPromise(event);
217
217
  }
218
218
 
219
219
  /**
@@ -233,7 +233,7 @@ function eventFromMessage(
233
233
  if (hint?.event_id) {
234
234
  event.event_id = hint.event_id;
235
235
  }
236
- return core.resolvedSyncPromise(event);
236
+ return browser.resolvedSyncPromise(event);
237
237
  }
238
238
 
239
239
  /**
@@ -248,7 +248,7 @@ function eventFromUnknownInput(
248
248
  ) {
249
249
  let event;
250
250
 
251
- if (core.isErrorEvent(exception ) && (exception ).error) {
251
+ if (browser.isErrorEvent(exception ) && (exception ).error) {
252
252
  // If it is an ErrorEvent with `error` property, extract it to get actual Error
253
253
  const errorEvent = exception ;
254
254
  return eventFromError(stackParser, errorEvent.error );
@@ -261,16 +261,16 @@ function eventFromUnknownInput(
261
261
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
262
262
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
263
263
  // https://webidl.spec.whatwg.org/#es-DOMException-specialness
264
- if (core.isDOMError(exception) || core.isDOMException(exception )) {
264
+ if (browser.isDOMError(exception) || browser.isDOMException(exception )) {
265
265
  const domException = exception ;
266
266
 
267
267
  if ('stack' in (exception )) {
268
268
  event = eventFromError(stackParser, exception );
269
269
  } else {
270
- const name = domException.name || (core.isDOMError(domException) ? 'DOMError' : 'DOMException');
270
+ const name = domException.name || (browser.isDOMError(domException) ? 'DOMError' : 'DOMException');
271
271
  const message = domException.message ? `${name}: ${domException.message}` : name;
272
272
  event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
273
- core.addExceptionTypeValue(event, message);
273
+ browser.addExceptionTypeValue(event, message);
274
274
  }
275
275
  if ('code' in domException) {
276
276
  // eslint-disable-next-line deprecation/deprecation
@@ -279,17 +279,17 @@ function eventFromUnknownInput(
279
279
 
280
280
  return event;
281
281
  }
282
- if (core.isError(exception)) {
282
+ if (browser.isError(exception)) {
283
283
  // we have a real Error object, do nothing
284
284
  return eventFromError(stackParser, exception);
285
285
  }
286
- if (core.isPlainObject(exception) || core.isEvent(exception)) {
286
+ if (browser.isPlainObject(exception) || browser.isEvent(exception)) {
287
287
  // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
288
288
  // it manually. This will allow us to group events based on top-level keys which is much better than creating a new
289
289
  // group on any key/value change.
290
290
  const objectException = exception;
291
291
  event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);
292
- core.addExceptionMechanism(event, {
292
+ browser.addExceptionMechanism(event, {
293
293
  synthetic: true,
294
294
  });
295
295
  return event;
@@ -305,8 +305,8 @@ function eventFromUnknownInput(
305
305
  //
306
306
  // So bail out and capture it as a simple message:
307
307
  event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);
308
- core.addExceptionTypeValue(event, `${exception}`, undefined);
309
- core.addExceptionMechanism(event, {
308
+ browser.addExceptionTypeValue(event, `${exception}`, undefined);
309
+ browser.addExceptionMechanism(event, {
310
310
  synthetic: true,
311
311
  });
312
312
 
@@ -328,10 +328,10 @@ function eventFromString(
328
328
  values: [{ value: message, stacktrace: { frames } }],
329
329
  };
330
330
  }
331
- core.addExceptionMechanism(event, { synthetic: true });
331
+ browser.addExceptionMechanism(event, { synthetic: true });
332
332
  }
333
333
 
334
- if (core.isParameterizedString(message)) {
334
+ if (browser.isParameterizedString(message)) {
335
335
  const { __sentry_template_string__, __sentry_template_values__ } = message;
336
336
 
337
337
  event.logentry = {
@@ -349,16 +349,16 @@ function getNonErrorObjectExceptionValue(
349
349
  exception,
350
350
  { isUnhandledRejection },
351
351
  ) {
352
- const keys = core.extractExceptionKeysForMessage(exception);
352
+ const keys = browser.extractExceptionKeysForMessage(exception);
353
353
  const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';
354
354
 
355
355
  // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
356
356
  // We still want to try to get a decent message for these cases
357
- if (core.isErrorEvent(exception)) {
357
+ if (browser.isErrorEvent(exception)) {
358
358
  return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``;
359
359
  }
360
360
 
361
- if (core.isEvent(exception)) {
361
+ if (browser.isEvent(exception)) {
362
362
  const className = getObjectClassName(exception);
363
363
  return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`;
364
364
  }