@atom8n/n8n-editor-ui 2.2.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 (310) hide show
  1. package/.stylelintcache +1 -0
  2. package/README.md +59 -0
  3. package/biome.jsonc +8 -0
  4. package/build.log +55 -0
  5. package/data/node-popularity.json +3998 -0
  6. package/dist/assets/AddDataTableModal-UINkk54_.js +1555 -0
  7. package/dist/assets/AgentEditorModal-CVww87TJ.js +358 -0
  8. package/dist/assets/Alert-Dy86dyOr.js +102 -0
  9. package/dist/assets/AnimatedSpinner-DmPN4poP.js +15 -0
  10. package/dist/assets/AnnotationTagsDropdown.ee-BJ7N9lek.js +71 -0
  11. package/dist/assets/AuthView-D2LWHrMp.js +106 -0
  12. package/dist/assets/BottomMenu-CIQiK_dJ.js +532 -0
  13. package/dist/assets/CalendarDate-DgQUMbNo.js +875 -0
  14. package/dist/assets/ChangePasswordView-Z6tUkw0u.js +133 -0
  15. package/dist/assets/ChatAgentAvatar-50YBnv3N.js +67 -0
  16. package/dist/assets/ChatFile-xZxmc2nV.js +146 -0
  17. package/dist/assets/ChatLayout-CTE_5SiM.js +96 -0
  18. package/dist/assets/ChatPersonalAgentsView-BGpHk03K.js +149 -0
  19. package/dist/assets/ChatSidebar-BkVwIypC.js +528 -0
  20. package/dist/assets/ChatView-BbbdeU9x.js +1559 -0
  21. package/dist/assets/ChatWorkflowAgentsView-BtunOxlC.js +116 -0
  22. package/dist/assets/CollectionParameter-BdcPG1lu.js +52 -0
  23. package/dist/assets/CommitMonoVariable-ytizKI8U.woff2 +0 -0
  24. package/dist/assets/CommunityNodeUpdateInfo-C37kca4W.js +273 -0
  25. package/dist/assets/CopyInput-DDZVu2iU.js +74 -0
  26. package/dist/assets/CredentialIcon-8YdTTFZ1.js +80 -0
  27. package/dist/assets/CredentialPicker-DWtj314o.js +293 -0
  28. package/dist/assets/CredentialSelectorModal-DTW2fKh0.js +138 -0
  29. package/dist/assets/CredentialsView-BjUchcCu.js +480 -0
  30. package/dist/assets/DataTableActions-DpAkoxg_.js +95 -0
  31. package/dist/assets/DataTableDetailsView-Coq7zdW5.js +41922 -0
  32. package/dist/assets/DataTableView-Cs-BIkzw.js +293 -0
  33. package/dist/assets/DemoFooter-Cga3jvi-.js +65 -0
  34. package/dist/assets/Draggable-vfvXl9Sp.js +105 -0
  35. package/dist/assets/EmptySharedSectionActionBox-DOXZtTCv.js +36 -0
  36. package/dist/assets/EnterpriseEdition.ee-D_rCFexM.js +15 -0
  37. package/dist/assets/EntityNotFound-3dhTRWsE.js +85 -0
  38. package/dist/assets/EntityUnAuthorised-ChJYZakE.js +66 -0
  39. package/dist/assets/ErrorView-zT9cX76a.js +61 -0
  40. package/dist/assets/EvaluationsRootView-C-OVWYnY.js +523 -0
  41. package/dist/assets/EvaluationsView-CJwJTruc.js +469 -0
  42. package/dist/assets/ExecutionsTime-DEQiyozR.js +573 -0
  43. package/dist/assets/ExecutionsView-Bd5Oh8TH.js +791 -0
  44. package/dist/assets/ExternalSecretsProviderConnectionSwitch.ee-C7Ih-uRo.js +191 -0
  45. package/dist/assets/FixedCollectionParameter-CYuTDW9t.js +496 -0
  46. package/dist/assets/ForgotMyPasswordView-Bs_L9P27.js +102 -0
  47. package/dist/assets/InsightsChartAverageRuntime-Bp3VA8_7.js +62 -0
  48. package/dist/assets/InsightsChartFailed-KPaNWoEr.js +52 -0
  49. package/dist/assets/InsightsChartFailureRate-DE6kE3FM.js +54 -0
  50. package/dist/assets/InsightsChartTimeSaved-auABNZlc.js +68 -0
  51. package/dist/assets/InsightsChartTotal-BKzYRKE7.js +56 -0
  52. package/dist/assets/InsightsDashboard-JWx4W6Db.js +473 -0
  53. package/dist/assets/InsightsPaywall-C8zLLKe8.js +63 -0
  54. package/dist/assets/InsightsSummary-cmN1lHDm.js +210 -0
  55. package/dist/assets/InsightsTableWorkflows-CqcC3IbQ.js +203 -0
  56. package/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
  57. package/dist/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
  58. package/dist/assets/ItemsRenderer-DC8WVyMv.js +922 -0
  59. package/dist/assets/KeyboardShortcutTooltip-D8PAK5JP.js +31 -0
  60. package/dist/assets/LogsPanel-BR06u9RK.js +52 -0
  61. package/dist/assets/LogsPanel-C-_acMHp.js +2325 -0
  62. package/dist/assets/MCPConnectWorkflowsModal-3g8_iUa4.js +303 -0
  63. package/dist/assets/MainHeader-DiQc1edn.js +2153 -0
  64. package/dist/assets/MainSidebar-CoPGG5Ea.js +804 -0
  65. package/dist/assets/MigrationRuleDetail-BAxk1Pvl.js +295 -0
  66. package/dist/assets/MigrationRules-IW9lZMpE.js +285 -0
  67. package/dist/assets/Modal-CIzXlZdZ.js +204 -0
  68. package/dist/assets/ModelByIdSelectorModal-DLvBjzJO.js +115 -0
  69. package/dist/assets/NDVEmptyState-33UoX00I.js +19743 -0
  70. package/dist/assets/NodeCreation-BNzbSWSB.js +240 -0
  71. package/dist/assets/NodeCreator-BftgCKx7.js +1288 -0
  72. package/dist/assets/NodeDetailsView-CsoQCpcF.js +1075 -0
  73. package/dist/assets/NodeDetailsViewV2-C_wNQR_3.js +981 -0
  74. package/dist/assets/NodeIcon-B9VW6tX6.js +87 -0
  75. package/dist/assets/NodeSettings-ZwVip6VR.js +1872 -0
  76. package/dist/assets/NodeView-D4WUEvLB.js +2452 -0
  77. package/dist/assets/OAuthConsentView-DlrUqZbT.js +230 -0
  78. package/dist/assets/PageViewLayout-NT1KPFgy.js +12 -0
  79. package/dist/assets/ParameterInputList-sG2nz-Jo.js +38091 -0
  80. package/dist/assets/PrebuiltAgentTemplatesView-Csi5U8dc.js +154 -0
  81. package/dist/assets/ProjectBreadcrumb-C_XiY7sc.js +98 -0
  82. package/dist/assets/ProjectCardBadge-t_hs7vzx.js +209 -0
  83. package/dist/assets/ProjectHeader-Dq5Ihb26.js +549 -0
  84. package/dist/assets/ProjectIcon-DY8gGuHX.js +64 -0
  85. package/dist/assets/ProjectRoleView-Du-KTrAC.js +435 -0
  86. package/dist/assets/ProjectRolesView-DjxM_y4u.js +239 -0
  87. package/dist/assets/ProjectSettings-C6kWuV21.js +966 -0
  88. package/dist/assets/ProjectSharing-CVUgNWAY.js +262 -0
  89. package/dist/assets/ProjectVariables-CJlAo3dv.js +467 -0
  90. package/dist/assets/ProviderSettingsModal-BUFC2ZLv.js +307 -0
  91. package/dist/assets/PushConnectionTracker-DPBnGV0v.js +27 -0
  92. package/dist/assets/ResolversView-3BdkvvYA.js +209 -0
  93. package/dist/assets/ResourceFiltersDropdown-dgyXpcEX.js +159 -0
  94. package/dist/assets/ResourcesListLayout-qBLtomK6.js +631 -0
  95. package/dist/assets/RunDataHtml-BrW0OQra.js +7 -0
  96. package/dist/assets/RunDataHtml-Cleia4Cj.js +40 -0
  97. package/dist/assets/RunDataJson-uxkrhYRK.js +227 -0
  98. package/dist/assets/RunDataJsonActions-DkPk7E8d.js +5007 -0
  99. package/dist/assets/RunDataParsedAiContent-CtPRjig-.js +26 -0
  100. package/dist/assets/RunDataParsedAiContent-WAuqLQ5M.js +192 -0
  101. package/dist/assets/RunDataSearch-YBWUr93C.js +141 -0
  102. package/dist/assets/RunDataTable-DcXaBynW.js +631 -0
  103. package/dist/assets/SamlOnboarding-BTdQ_hr3.js +78 -0
  104. package/dist/assets/SaveButton-D5sQSxIk.js +89 -0
  105. package/dist/assets/SelectedItemsInfo-BHZ-NvF5.js +58 -0
  106. package/dist/assets/SettingsApiView-IfZTMXx1.js +313 -0
  107. package/dist/assets/SettingsChatHubView-gWh2X6vX.js +285 -0
  108. package/dist/assets/SettingsCommunityNodesView-D8VQtpGY.js +349 -0
  109. package/dist/assets/SettingsExternalSecrets-CpMc7mkW.js +233 -0
  110. package/dist/assets/SettingsLdapView-CU5a2MAy.js +2553 -0
  111. package/dist/assets/SettingsLogStreamingView-uojTe-oX.js +375 -0
  112. package/dist/assets/SettingsMCPView-B5Swp1C_.js +1214 -0
  113. package/dist/assets/SettingsPersonalView-Cr3aGood.js +402 -0
  114. package/dist/assets/SettingsSourceControl-DXOvFDEY.js +547 -0
  115. package/dist/assets/SettingsSso-27MfU1HV.js +1032 -0
  116. package/dist/assets/SettingsUsageAndPlan-DqIO-G46.js +419 -0
  117. package/dist/assets/SettingsUsersView-DfHB4_Kh.js +833 -0
  118. package/dist/assets/SettingsView-C4sA7Uny.js +90 -0
  119. package/dist/assets/SetupTemplateFormStep-BmiSzZin.js +258 -0
  120. package/dist/assets/SetupView-VORZ-L_u.js +112 -0
  121. package/dist/assets/SetupWorkflowCredentialsButton-DTmkOAW5.js +73 -0
  122. package/dist/assets/SetupWorkflowFromTemplateView-B9NupdJE.js +286 -0
  123. package/dist/assets/SeverityTag-CX1qTTNA.js +45 -0
  124. package/dist/assets/SigninView-D9_Pm16j.js +358 -0
  125. package/dist/assets/SignoutView-BFsjEAGz.js +19 -0
  126. package/dist/assets/SignupView-Am4ot0QZ.js +137 -0
  127. package/dist/assets/SkeletonAgentCard-C5TL-h8F.js +191 -0
  128. package/dist/assets/TagsDropdown-Bvx_Hd6Q.js +230 -0
  129. package/dist/assets/TemplateCard-CyQ1GuVz.js +105 -0
  130. package/dist/assets/TemplateDetails-CZRusTxE.js +124 -0
  131. package/dist/assets/TemplateList-DKvbwuiY.js +333 -0
  132. package/dist/assets/TemplatesCollectionView-D8dxU8By.js +184 -0
  133. package/dist/assets/TemplatesSearchView-CebC_GLs.js +1230 -0
  134. package/dist/assets/TemplatesView-025CcmIY.js +57 -0
  135. package/dist/assets/TemplatesWorkflowView-C2JfwJAn.js +170 -0
  136. package/dist/assets/TestRunDetailView-Ck78TTWO.js +395 -0
  137. package/dist/assets/TextWithHighlights-BxumwGnv.js +57 -0
  138. package/dist/assets/TimeAgo-C6EN4lCs.js +123 -0
  139. package/dist/assets/ToolsSelectorModal-8QJoUvRL.js +368 -0
  140. package/dist/assets/TriggerPanel-B6pacLkk.js +1225 -0
  141. package/dist/assets/VirtualSchema-B3zGe_8b.js +2402 -0
  142. package/dist/assets/VirtualSchema-Dkh0Cu5z.js +37 -0
  143. package/dist/assets/VueMarkdown-CQqJL9vK.js +28 -0
  144. package/dist/assets/WorkerView-Caznsljo.js +563 -0
  145. package/dist/assets/WorkflowActivationErrorMessage-CGrfPi9O.js +17 -0
  146. package/dist/assets/WorkflowActivator-BINnz0f7.js +362 -0
  147. package/dist/assets/WorkflowExecutionsInfoAccordion-Dg37yEfT.js +166 -0
  148. package/dist/assets/WorkflowExecutionsLandingPage-V2wdubhK.js +93 -0
  149. package/dist/assets/WorkflowExecutionsPreview-DdJaqYV6.js +616 -0
  150. package/dist/assets/WorkflowExecutionsView-DV8ySTfn.js +808 -0
  151. package/dist/assets/WorkflowHistory-GtaBMzIM.js +973 -0
  152. package/dist/assets/WorkflowLocation-CQ9Sq-2y.js +164 -0
  153. package/dist/assets/WorkflowOnboardingView-C49gt0Jr.js +61 -0
  154. package/dist/assets/WorkflowPreview-CXdvv4Nq.js +186 -0
  155. package/dist/assets/WorkflowTagsDropdown-QwbICWjN.js +71 -0
  156. package/dist/assets/WorkflowsView-B-MWIECO.js +3253 -0
  157. package/dist/assets/_MapCache-CcdIl4Ae.js +363 -0
  158. package/dist/assets/_baseOrderBy-N8Be_6z6.js +2989 -0
  159. package/dist/assets/_initCloneObject-viQQyT6o.js +80 -0
  160. package/dist/assets/_plugin-vue_export-helper-BwBpWJRZ.js +6 -0
  161. package/dist/assets/aiTemplatesStarterCollection.store-nL9nePkK.js +656 -0
  162. package/dist/assets/apiKeys.store-BhOFmP2j.js +51 -0
  163. package/dist/assets/assistant.store-CNywgN4S.js +518 -0
  164. package/dist/assets/auth.eventBus-CWXS0Qp7.js +5 -0
  165. package/dist/assets/banners.store-CGEcBTDn.js +195 -0
  166. package/dist/assets/builder.store-Czk2ipDE.js +31417 -0
  167. package/dist/assets/buttons.esm-yintpW2E.js +364 -0
  168. package/dist/assets/chart-CNvyywtJ.js +10958 -0
  169. package/dist/assets/chartjs.utils-BAE52Cv9.js +155 -0
  170. package/dist/assets/chat.store-290YeyrQ.js +865 -0
  171. package/dist/assets/chatPanel.store-NDaawEZL.js +118 -0
  172. package/dist/assets/chunk-6z4oVpB-.js +36 -0
  173. package/dist/assets/col-Cmt4cmuS.js +158 -0
  174. package/dist/assets/constants-C8OH4tTq.js +106256 -0
  175. package/dist/assets/constants-DMrsrpD7.js +32 -0
  176. package/dist/assets/core-B9gt_4yk.js +4 -0
  177. package/dist/assets/core-CP5FY4aX.js +1202 -0
  178. package/dist/assets/core-CRbPymLT.js +9741 -0
  179. package/dist/assets/dataTable.store-DmipQsol.js +207 -0
  180. package/dist/assets/date-picker-2IDsBs2n.js +4115 -0
  181. package/dist/assets/dateFormatter-ik4-9_9r.js +33 -0
  182. package/dist/assets/dateformat-hG8NERse.js +181 -0
  183. package/dist/assets/dialog-lMho1TD8.js +425 -0
  184. package/dist/assets/dist-Cw46Is-h.js +151 -0
  185. package/dist/assets/doppler-B__k0MeW.webp +0 -0
  186. package/dist/assets/element-icons-B-tDfklg.woff +0 -0
  187. package/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
  188. package/dist/assets/empty-BuGRxzl4.js +2210 -0
  189. package/dist/assets/en-CF30SCh2.js +95 -0
  190. package/dist/assets/en-DyO2pPiC.js +2 -0
  191. package/dist/assets/es-BkUFJVtD.js +43338 -0
  192. package/dist/assets/evaluation.constants-GYAwmJnh.js +284 -0
  193. package/dist/assets/executions.store-B9uRYwgv.js +205 -0
  194. package/dist/assets/exports-Crx_gvt_.js +1799 -0
  195. package/dist/assets/externalSecrets.ee.store-BJh4a_6G.js +118 -0
  196. package/dist/assets/fileUtils-CRWqOQje.js +20 -0
  197. package/dist/assets/folders.store-yAFj-5Vl.js +235 -0
  198. package/dist/assets/get-BcEmeOxn.js +2781 -0
  199. package/dist/assets/index-SL8542zQ.js +28372 -0
  200. package/dist/assets/insights.constants-BkJCYJTL.js +55 -0
  201. package/dist/assets/insights.store-BFc3kDUo.js +61 -0
  202. package/dist/assets/insights.utils-CcLXdrrz.js +77 -0
  203. package/dist/assets/isEmpty-C3XXoHqJ.js +35216 -0
  204. package/dist/assets/languageModules-9LyndCqU.js +13862 -0
  205. package/dist/assets/logStreaming.store-IZhWe_VK.js +190 -0
  206. package/dist/assets/mcp.constants-_Jcn7fPq.js +10 -0
  207. package/dist/assets/mcp.store-B9yfcAN9.js +116 -0
  208. package/dist/assets/merge-DhuTk1HM.js +564 -0
  209. package/dist/assets/nodeCreator.store-Bpnrwp2l.js +5444 -0
  210. package/dist/assets/nodeIcon-D6X-ENYt.js +102 -0
  211. package/dist/assets/nodeTransforms-RzcOM0v2.js +42 -0
  212. package/dist/assets/orderBy-Cu9F9DU_.js +15 -0
  213. package/dist/assets/path-browserify-RUt2u7iT.js +328 -0
  214. package/dist/assets/personalizedTemplatesV3.store-BGYp0YBN.js +334 -0
  215. package/dist/assets/pickBy-UI0Jt4wC.js +18 -0
  216. package/dist/assets/preload-helper-dyVz7ck7.js +59 -0
  217. package/dist/assets/radio-CSce3UT0.js +262 -0
  218. package/dist/assets/readyToRun.store-YEMvPUqo.js +626 -0
  219. package/dist/assets/readyToRunWorkflows.store-G3srgIze.js +1319 -0
  220. package/dist/assets/retry-BgHaYzbB.js +23 -0
  221. package/dist/assets/roles.store-CRf_zJTb.js +51 -0
  222. package/dist/assets/router-DNpzz3GH.js +2631 -0
  223. package/dist/assets/sanitize-html-CbW56HUN.js +10758 -0
  224. package/dist/assets/schemaPreview.store-DUgN1yVE.js +113 -0
  225. package/dist/assets/semver-Bk6DGseV.js +1306 -0
  226. package/dist/assets/smartDecimal-DAZl4HKA.js +6 -0
  227. package/dist/assets/sortByProperty-Cn7iGKYu.js +8 -0
  228. package/dist/assets/sourceControl.eventBus-D47xXSc_.js +3 -0
  229. package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
  230. package/dist/assets/sqlite3-opfs-async-proxy-vVtmDGHX.js +461 -0
  231. package/dist/assets/sqlite3-worker1-bundler-friendly-DLarOZDL.js +9405 -0
  232. package/dist/assets/src-jviYSG25.js +55454 -0
  233. package/dist/assets/sso.store-DyApJwhx.js +139 -0
  234. package/dist/assets/style-E3CrYFV8.css +111829 -0
  235. package/dist/assets/table-we1DjFMV.js +3944 -0
  236. package/dist/assets/templateActions-bEDSARw2.js +65 -0
  237. package/dist/assets/templateTransforms-BHWiRbtR.js +43 -0
  238. package/dist/assets/truncate-C0KYt7i3.js +4176 -0
  239. package/dist/assets/typescript.worker-CYqLvLHh.js +152048 -0
  240. package/dist/assets/uniqBy-xDyuCRP0.js +10 -0
  241. package/dist/assets/usage.store-CU5J_nGm.js +100 -0
  242. package/dist/assets/useActions-B1JckIRj.js +255 -0
  243. package/dist/assets/useBeforeUnload-DiDkvI8p.js +40 -0
  244. package/dist/assets/useCanvasMapping-BXT7rGhC.js +12570 -0
  245. package/dist/assets/useCanvasOperations-8ULLtMkY.js +1765 -0
  246. package/dist/assets/useClipboard-DvjhVHqJ.js +39 -0
  247. package/dist/assets/useCommandBar-C4tLJbKt.js +2425 -0
  248. package/dist/assets/useCredentialResolvers-BKeFGJnY.js +78 -0
  249. package/dist/assets/useCustomAgent-DpILEt5e.js +471 -0
  250. package/dist/assets/useDebounce-Br5_1ug-.js +147 -0
  251. package/dist/assets/useExecutionData-M5iKsX6z.js +23 -0
  252. package/dist/assets/useExecutionDebugging-8azMzbnd.js +191 -0
  253. package/dist/assets/useExecutionHelpers-BgRRhpBM.js +91 -0
  254. package/dist/assets/useImportCurlCommand-CKiEmX5P.js +8891 -0
  255. package/dist/assets/useIntersectionObserver-BWMwOueh.js +33 -0
  256. package/dist/assets/useKeybindings-B2jfN6rd.js +62 -0
  257. package/dist/assets/useLogsTreeExpand-sZViUfdM.js +843 -0
  258. package/dist/assets/useMcp-DoMOIfqT.js +27 -0
  259. package/dist/assets/usePageRedirectionHelper-DjkznpX6.js +51 -0
  260. package/dist/assets/usePinnedData-BhZkqttf.js +203 -0
  261. package/dist/assets/usePushConnection-DMS-F_IW.js +513 -0
  262. package/dist/assets/useRecentResources-BVORr7eM.js +118 -0
  263. package/dist/assets/useRunWorkflow-LO7ffLp9.js +950 -0
  264. package/dist/assets/useSettingsItems-BhZXwMZn.js +144 -0
  265. package/dist/assets/useTelemetryContext-V6bv4YRq.js +34 -0
  266. package/dist/assets/useWorkflowActivate-DeSmDXjI.js +152 -0
  267. package/dist/assets/useWorkflowsCache-DtcEEAIR.js +179 -0
  268. package/dist/assets/userRoleProvisioning.store-kkSIdeTo.js +33 -0
  269. package/dist/assets/utils-DI7dLldp.js +54 -0
  270. package/dist/assets/versions.store-B1z2OrLE.js +191 -0
  271. package/dist/assets/vue-CydWIhxN.js +4378 -0
  272. package/dist/assets/vue-json-pretty-CsGX66mG.js +1130 -0
  273. package/dist/assets/vue.runtime.esm-bundler-tP5dCd7J.js +7325 -0
  274. package/dist/assets/xml-B_oj6Mle.js +2060 -0
  275. package/dist/favicon.ico +0 -0
  276. package/dist/index.html +157 -0
  277. package/dist/static/base-path.js +1 -0
  278. package/dist/static/community_package_tooltip_img.png +0 -0
  279. package/dist/static/data-mapping-gif.gif +0 -0
  280. package/dist/static/form-grey.svg +1 -0
  281. package/dist/static/google-auth/disabled.dark.png +0 -0
  282. package/dist/static/google-auth/disabled.png +0 -0
  283. package/dist/static/google-auth/focus.dark.png +0 -0
  284. package/dist/static/google-auth/focus.png +0 -0
  285. package/dist/static/google-auth/normal.dark.png +0 -0
  286. package/dist/static/google-auth/normal.png +0 -0
  287. package/dist/static/google-auth/pressed.dark.png +0 -0
  288. package/dist/static/google-auth/pressed.png +0 -0
  289. package/dist/static/n8n-logo.png +0 -0
  290. package/dist/static/og_image.png +0 -0
  291. package/dist/static/open-ai.svg +1 -0
  292. package/dist/static/openChat.png +0 -0
  293. package/dist/static/posthog.init.js +41 -0
  294. package/dist/static/prefers-color-scheme.css +5 -0
  295. package/dist/static/webhook-icon.svg +1 -0
  296. package/dist/tree-sitter-bash.wasm +0 -0
  297. package/dist/tree-sitter.wasm +0 -0
  298. package/eslint.config.mjs +59 -0
  299. package/index.html +45 -0
  300. package/index.js +0 -0
  301. package/package.json +147 -0
  302. package/postcss.config.cjs +6 -0
  303. package/scripts/fetch-node-popularity.mjs +102 -0
  304. package/stylelint.config.mjs +9 -0
  305. package/tailwind.config.js +8 -0
  306. package/tsconfig.json +36 -0
  307. package/vite/i18n-locales-hmr-helpers.ts +19 -0
  308. package/vite/source-map-js-shim.ts +1 -0
  309. package/vite/vite-plugin-node-popularity.mts +32 -0
  310. package/vite.config.mts +304 -0
@@ -0,0 +1,1799 @@
1
+ import { Dn as init_dist, En as global } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
2
+ var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
3
+ var GLOBAL_OBJ = globalThis;
4
+ var SDK_VERSION = "9.42.1";
5
+ function getMainCarrier() {
6
+ getSentryCarrier(GLOBAL_OBJ);
7
+ return GLOBAL_OBJ;
8
+ }
9
+ function getSentryCarrier(carrier) {
10
+ const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};
11
+ __SENTRY__.version = __SENTRY__.version || "9.42.1";
12
+ return __SENTRY__[SDK_VERSION] = __SENTRY__["9.42.1"] || {};
13
+ }
14
+ function getGlobalSingleton(name, creator, obj = GLOBAL_OBJ) {
15
+ const __SENTRY__ = obj.__SENTRY__ = obj.__SENTRY__ || {};
16
+ const carrier = __SENTRY__[SDK_VERSION] = __SENTRY__["9.42.1"] || {};
17
+ return carrier[name] || (carrier[name] = creator());
18
+ }
19
+ var CONSOLE_LEVELS = [
20
+ "debug",
21
+ "info",
22
+ "warn",
23
+ "error",
24
+ "log",
25
+ "assert",
26
+ "trace"
27
+ ];
28
+ var PREFIX = "Sentry Logger ";
29
+ var originalConsoleMethods = {};
30
+ function consoleSandbox(callback) {
31
+ if (!("console" in GLOBAL_OBJ)) return callback();
32
+ const console$1 = GLOBAL_OBJ.console;
33
+ const wrappedFuncs = {};
34
+ const wrappedLevels = Object.keys(originalConsoleMethods);
35
+ wrappedLevels.forEach((level) => {
36
+ const originalConsoleMethod = originalConsoleMethods[level];
37
+ wrappedFuncs[level] = console$1[level];
38
+ console$1[level] = originalConsoleMethod;
39
+ });
40
+ try {
41
+ return callback();
42
+ } finally {
43
+ wrappedLevels.forEach((level) => {
44
+ console$1[level] = wrappedFuncs[level];
45
+ });
46
+ }
47
+ }
48
+ function enable() {
49
+ _getLoggerSettings().enabled = true;
50
+ }
51
+ function disable() {
52
+ _getLoggerSettings().enabled = false;
53
+ }
54
+ function isEnabled() {
55
+ return _getLoggerSettings().enabled;
56
+ }
57
+ function log(...args) {
58
+ _maybeLog("log", ...args);
59
+ }
60
+ function warn(...args) {
61
+ _maybeLog("warn", ...args);
62
+ }
63
+ function error(...args) {
64
+ _maybeLog("error", ...args);
65
+ }
66
+ function _maybeLog(level, ...args) {
67
+ if (!DEBUG_BUILD) return;
68
+ if (isEnabled()) consoleSandbox(() => {
69
+ GLOBAL_OBJ.console[level](`${PREFIX}[${level}]:`, ...args);
70
+ });
71
+ }
72
+ function _getLoggerSettings() {
73
+ if (!DEBUG_BUILD) return { enabled: false };
74
+ return getGlobalSingleton("loggerSettings", () => ({ enabled: false }));
75
+ }
76
+ var debug = {
77
+ enable,
78
+ disable,
79
+ isEnabled,
80
+ log,
81
+ warn,
82
+ error
83
+ };
84
+ var STACKTRACE_FRAME_LIMIT = 50;
85
+ var UNKNOWN_FUNCTION = "?";
86
+ var WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
87
+ var STRIP_FRAME_REGEXP = /captureMessage|captureException/;
88
+ function createStackParser(...parsers) {
89
+ const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map((p) => p[1]);
90
+ return (stack, skipFirstLines = 0, framesToPop = 0) => {
91
+ const frames = [];
92
+ const lines = stack.split("\n");
93
+ for (let i = skipFirstLines; i < lines.length; i++) {
94
+ const line = lines[i];
95
+ if (line.length > 1024) continue;
96
+ const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line;
97
+ if (cleanedLine.match(/\S*Error: /)) continue;
98
+ for (const parser of sortedParsers) {
99
+ const frame = parser(cleanedLine);
100
+ if (frame) {
101
+ frames.push(frame);
102
+ break;
103
+ }
104
+ }
105
+ if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) break;
106
+ }
107
+ return stripSentryFramesAndReverse(frames.slice(framesToPop));
108
+ };
109
+ }
110
+ function stackParserFromStackParserOptions(stackParser) {
111
+ if (Array.isArray(stackParser)) return createStackParser(...stackParser);
112
+ return stackParser;
113
+ }
114
+ function stripSentryFramesAndReverse(stack) {
115
+ if (!stack.length) return [];
116
+ const localStack = Array.from(stack);
117
+ if (/sentryWrapped/.test(getLastStackFrame(localStack).function || "")) localStack.pop();
118
+ localStack.reverse();
119
+ if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) {
120
+ localStack.pop();
121
+ if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) localStack.pop();
122
+ }
123
+ return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({
124
+ ...frame,
125
+ filename: frame.filename || getLastStackFrame(localStack).filename,
126
+ function: frame.function || "?"
127
+ }));
128
+ }
129
+ function getLastStackFrame(arr) {
130
+ return arr[arr.length - 1] || {};
131
+ }
132
+ var defaultFunctionName = "<anonymous>";
133
+ function getFunctionName(fn) {
134
+ try {
135
+ if (!fn || typeof fn !== "function") return defaultFunctionName;
136
+ return fn.name || defaultFunctionName;
137
+ } catch {
138
+ return defaultFunctionName;
139
+ }
140
+ }
141
+ function getFramesFromEvent(event) {
142
+ const exception = event.exception;
143
+ if (exception) {
144
+ const frames = [];
145
+ try {
146
+ exception.values.forEach((value) => {
147
+ if (value.stacktrace.frames) frames.push(...value.stacktrace.frames);
148
+ });
149
+ return frames;
150
+ } catch {
151
+ return;
152
+ }
153
+ }
154
+ }
155
+ var objectToString = Object.prototype.toString;
156
+ function isError(wat) {
157
+ switch (objectToString.call(wat)) {
158
+ case "[object Error]":
159
+ case "[object Exception]":
160
+ case "[object DOMException]":
161
+ case "[object WebAssembly.Exception]": return true;
162
+ default: return isInstanceOf(wat, Error);
163
+ }
164
+ }
165
+ function isBuiltin(wat, className) {
166
+ return objectToString.call(wat) === `[object ${className}]`;
167
+ }
168
+ function isErrorEvent(wat) {
169
+ return isBuiltin(wat, "ErrorEvent");
170
+ }
171
+ function isDOMError(wat) {
172
+ return isBuiltin(wat, "DOMError");
173
+ }
174
+ function isDOMException(wat) {
175
+ return isBuiltin(wat, "DOMException");
176
+ }
177
+ function isString(wat) {
178
+ return isBuiltin(wat, "String");
179
+ }
180
+ function isParameterizedString(wat) {
181
+ return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat;
182
+ }
183
+ function isPrimitive(wat) {
184
+ return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function";
185
+ }
186
+ function isPlainObject(wat) {
187
+ return isBuiltin(wat, "Object");
188
+ }
189
+ function isEvent(wat) {
190
+ return typeof Event !== "undefined" && isInstanceOf(wat, Event);
191
+ }
192
+ function isElement(wat) {
193
+ return typeof Element !== "undefined" && isInstanceOf(wat, Element);
194
+ }
195
+ function isRegExp(wat) {
196
+ return isBuiltin(wat, "RegExp");
197
+ }
198
+ function isThenable(wat) {
199
+ return Boolean(wat?.then && typeof wat.then === "function");
200
+ }
201
+ function isSyntheticEvent(wat) {
202
+ return isPlainObject(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat;
203
+ }
204
+ function isInstanceOf(wat, base) {
205
+ try {
206
+ return wat instanceof base;
207
+ } catch {
208
+ return false;
209
+ }
210
+ }
211
+ function isVueViewModel(wat) {
212
+ return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue));
213
+ }
214
+ function isRequest(request) {
215
+ return typeof Request !== "undefined" && isInstanceOf(request, Request);
216
+ }
217
+ var WINDOW = GLOBAL_OBJ;
218
+ var DEFAULT_MAX_STRING_LENGTH = 80;
219
+ function htmlTreeAsString(elem, options = {}) {
220
+ if (!elem) return "<unknown>";
221
+ try {
222
+ let currentElem = elem;
223
+ const MAX_TRAVERSE_HEIGHT = 5;
224
+ const out = [];
225
+ let height = 0;
226
+ let len = 0;
227
+ const separator = " > ";
228
+ const sepLength = 3;
229
+ let nextStr;
230
+ const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;
231
+ const maxStringLength = !Array.isArray(options) && options.maxStringLength || DEFAULT_MAX_STRING_LENGTH;
232
+ while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
233
+ nextStr = _htmlElementAsString(currentElem, keyAttrs);
234
+ if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) break;
235
+ out.push(nextStr);
236
+ len += nextStr.length;
237
+ currentElem = currentElem.parentNode;
238
+ }
239
+ return out.reverse().join(separator);
240
+ } catch {
241
+ return "<unknown>";
242
+ }
243
+ }
244
+ function _htmlElementAsString(el, keyAttrs) {
245
+ const elem = el;
246
+ const out = [];
247
+ if (!elem?.tagName) return "";
248
+ if (WINDOW.HTMLElement) {
249
+ if (elem instanceof HTMLElement && elem.dataset) {
250
+ if (elem.dataset["sentryComponent"]) return elem.dataset["sentryComponent"];
251
+ if (elem.dataset["sentryElement"]) return elem.dataset["sentryElement"];
252
+ }
253
+ }
254
+ out.push(elem.tagName.toLowerCase());
255
+ const keyAttrPairs = keyAttrs?.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null;
256
+ if (keyAttrPairs?.length) keyAttrPairs.forEach((keyAttrPair) => {
257
+ out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
258
+ });
259
+ else {
260
+ if (elem.id) out.push(`#${elem.id}`);
261
+ const className = elem.className;
262
+ if (className && isString(className)) {
263
+ const classes = className.split(/\s+/);
264
+ for (const c of classes) out.push(`.${c}`);
265
+ }
266
+ }
267
+ for (const k of [
268
+ "aria-label",
269
+ "type",
270
+ "name",
271
+ "title",
272
+ "alt"
273
+ ]) {
274
+ const attr = elem.getAttribute(k);
275
+ if (attr) out.push(`[${k}="${attr}"]`);
276
+ }
277
+ return out.join("");
278
+ }
279
+ function getLocationHref() {
280
+ try {
281
+ return WINDOW.document.location.href;
282
+ } catch {
283
+ return "";
284
+ }
285
+ }
286
+ function getComponentName(elem) {
287
+ if (!WINDOW.HTMLElement) return null;
288
+ let currentElem = elem;
289
+ const MAX_TRAVERSE_HEIGHT = 5;
290
+ for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {
291
+ if (!currentElem) return null;
292
+ if (currentElem instanceof HTMLElement) {
293
+ if (currentElem.dataset["sentryComponent"]) return currentElem.dataset["sentryComponent"];
294
+ if (currentElem.dataset["sentryElement"]) return currentElem.dataset["sentryElement"];
295
+ }
296
+ currentElem = currentElem.parentNode;
297
+ }
298
+ return null;
299
+ }
300
+ function truncate(str, max = 0) {
301
+ if (typeof str !== "string" || max === 0) return str;
302
+ return str.length <= max ? str : `${str.slice(0, max)}...`;
303
+ }
304
+ function safeJoin(input, delimiter) {
305
+ if (!Array.isArray(input)) return "";
306
+ const output = [];
307
+ for (let i = 0; i < input.length; i++) {
308
+ const value = input[i];
309
+ try {
310
+ if (isVueViewModel(value)) output.push("[VueViewModel]");
311
+ else output.push(String(value));
312
+ } catch {
313
+ output.push("[value cannot be serialized]");
314
+ }
315
+ }
316
+ return output.join(delimiter);
317
+ }
318
+ function isMatchingPattern(value, pattern, requireExactStringMatch = false) {
319
+ if (!isString(value)) return false;
320
+ if (isRegExp(pattern)) return pattern.test(value);
321
+ if (isString(pattern)) return requireExactStringMatch ? value === pattern : value.includes(pattern);
322
+ return false;
323
+ }
324
+ function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) {
325
+ return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch));
326
+ }
327
+ function fill(source, name, replacementFactory) {
328
+ if (!(name in source)) return;
329
+ const original = source[name];
330
+ if (typeof original !== "function") return;
331
+ const wrapped = replacementFactory(original);
332
+ if (typeof wrapped === "function") markFunctionWrapped(wrapped, original);
333
+ try {
334
+ source[name] = wrapped;
335
+ } catch {
336
+ DEBUG_BUILD && debug.log(`Failed to replace method "${name}" in object`, source);
337
+ }
338
+ }
339
+ function addNonEnumerableProperty(obj, name, value) {
340
+ try {
341
+ Object.defineProperty(obj, name, {
342
+ value,
343
+ writable: true,
344
+ configurable: true
345
+ });
346
+ } catch {
347
+ DEBUG_BUILD && debug.log(`Failed to add non-enumerable property "${name}" to object`, obj);
348
+ }
349
+ }
350
+ function markFunctionWrapped(wrapped, original) {
351
+ try {
352
+ wrapped.prototype = original.prototype = original.prototype || {};
353
+ addNonEnumerableProperty(wrapped, "__sentry_original__", original);
354
+ } catch {}
355
+ }
356
+ function getOriginalFunction(func) {
357
+ return func.__sentry_original__;
358
+ }
359
+ function convertToPlainObject(value) {
360
+ if (isError(value)) return {
361
+ message: value.message,
362
+ name: value.name,
363
+ stack: value.stack,
364
+ ...getOwnProperties(value)
365
+ };
366
+ else if (isEvent(value)) {
367
+ const newObj = {
368
+ type: value.type,
369
+ target: serializeEventTarget(value.target),
370
+ currentTarget: serializeEventTarget(value.currentTarget),
371
+ ...getOwnProperties(value)
372
+ };
373
+ if (typeof CustomEvent !== "undefined" && isInstanceOf(value, CustomEvent)) newObj.detail = value.detail;
374
+ return newObj;
375
+ } else return value;
376
+ }
377
+ function serializeEventTarget(target) {
378
+ try {
379
+ return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);
380
+ } catch {
381
+ return "<unknown>";
382
+ }
383
+ }
384
+ function getOwnProperties(obj) {
385
+ if (typeof obj === "object" && obj !== null) {
386
+ const extractedProps = {};
387
+ for (const property in obj) if (Object.prototype.hasOwnProperty.call(obj, property)) extractedProps[property] = obj[property];
388
+ return extractedProps;
389
+ } else return {};
390
+ }
391
+ function extractExceptionKeysForMessage(exception, maxLength = 40) {
392
+ const keys = Object.keys(convertToPlainObject(exception));
393
+ keys.sort();
394
+ const firstKey = keys[0];
395
+ if (!firstKey) return "[object has no keys]";
396
+ if (firstKey.length >= maxLength) return truncate(firstKey, maxLength);
397
+ for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {
398
+ const serialized = keys.slice(0, includedKeys).join(", ");
399
+ if (serialized.length > maxLength) continue;
400
+ if (includedKeys === keys.length) return serialized;
401
+ return truncate(serialized, maxLength);
402
+ }
403
+ return "";
404
+ }
405
+ function getCrypto() {
406
+ const gbl = GLOBAL_OBJ;
407
+ return gbl.crypto || gbl.msCrypto;
408
+ }
409
+ function uuid4(crypto = getCrypto()) {
410
+ let getRandomByte = () => Math.random() * 16;
411
+ try {
412
+ if (crypto?.randomUUID) return crypto.randomUUID().replace(/-/g, "");
413
+ if (crypto?.getRandomValues) getRandomByte = () => {
414
+ const typedArray = new Uint8Array(1);
415
+ crypto.getRandomValues(typedArray);
416
+ return typedArray[0];
417
+ };
418
+ } catch {}
419
+ return "10000000100040008000100000000000".replace(/[018]/g, (c) => (c ^ (getRandomByte() & 15) >> c / 4).toString(16));
420
+ }
421
+ function getFirstException(event) {
422
+ return event.exception?.values?.[0];
423
+ }
424
+ function getEventDescription(event) {
425
+ const { message, event_id: eventId } = event;
426
+ if (message) return message;
427
+ const firstException = getFirstException(event);
428
+ if (firstException) {
429
+ if (firstException.type && firstException.value) return `${firstException.type}: ${firstException.value}`;
430
+ return firstException.type || firstException.value || eventId || "<unknown>";
431
+ }
432
+ return eventId || "<unknown>";
433
+ }
434
+ function addExceptionTypeValue(event, value, type) {
435
+ const exception = event.exception = event.exception || {};
436
+ const values = exception.values = exception.values || [];
437
+ const firstException = values[0] = values[0] || {};
438
+ if (!firstException.value) firstException.value = value || "";
439
+ if (!firstException.type) firstException.type = type || "Error";
440
+ }
441
+ function addExceptionMechanism(event, newMechanism) {
442
+ const firstException = getFirstException(event);
443
+ if (!firstException) return;
444
+ const defaultMechanism = {
445
+ type: "generic",
446
+ handled: true
447
+ };
448
+ const currentMechanism = firstException.mechanism;
449
+ firstException.mechanism = {
450
+ ...defaultMechanism,
451
+ ...currentMechanism,
452
+ ...newMechanism
453
+ };
454
+ if (newMechanism && "data" in newMechanism) {
455
+ const mergedData = {
456
+ ...currentMechanism?.data,
457
+ ...newMechanism.data
458
+ };
459
+ firstException.mechanism.data = mergedData;
460
+ }
461
+ }
462
+ function checkOrSetAlreadyCaught(exception) {
463
+ if (isAlreadyCaptured(exception)) return true;
464
+ try {
465
+ addNonEnumerableProperty(exception, "__sentry_captured__", true);
466
+ } catch {}
467
+ return false;
468
+ }
469
+ function isAlreadyCaptured(exception) {
470
+ try {
471
+ return exception.__sentry_captured__;
472
+ } catch {}
473
+ }
474
+ var ONE_SECOND_IN_MS = 1e3;
475
+ function dateTimestampInSeconds() {
476
+ return Date.now() / ONE_SECOND_IN_MS;
477
+ }
478
+ function createUnixTimestampInSecondsFunc() {
479
+ const { performance } = GLOBAL_OBJ;
480
+ if (!performance?.now || !performance.timeOrigin) return dateTimestampInSeconds;
481
+ const timeOrigin = performance.timeOrigin;
482
+ return () => {
483
+ return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;
484
+ };
485
+ }
486
+ var _cachedTimestampInSeconds;
487
+ function timestampInSeconds() {
488
+ return (_cachedTimestampInSeconds ?? (_cachedTimestampInSeconds = createUnixTimestampInSecondsFunc()))();
489
+ }
490
+ function makeSession(context) {
491
+ const startingTime = timestampInSeconds();
492
+ const session = {
493
+ sid: uuid4(),
494
+ init: true,
495
+ timestamp: startingTime,
496
+ started: startingTime,
497
+ duration: 0,
498
+ status: "ok",
499
+ errors: 0,
500
+ ignoreDuration: false,
501
+ toJSON: () => sessionToJSON(session)
502
+ };
503
+ if (context) updateSession(session, context);
504
+ return session;
505
+ }
506
+ function updateSession(session, context = {}) {
507
+ if (context.user) {
508
+ if (!session.ipAddress && context.user.ip_address) session.ipAddress = context.user.ip_address;
509
+ if (!session.did && !context.did) session.did = context.user.id || context.user.email || context.user.username;
510
+ }
511
+ session.timestamp = context.timestamp || timestampInSeconds();
512
+ if (context.abnormal_mechanism) session.abnormal_mechanism = context.abnormal_mechanism;
513
+ if (context.ignoreDuration) session.ignoreDuration = context.ignoreDuration;
514
+ if (context.sid) session.sid = context.sid.length === 32 ? context.sid : uuid4();
515
+ if (context.init !== void 0) session.init = context.init;
516
+ if (!session.did && context.did) session.did = `${context.did}`;
517
+ if (typeof context.started === "number") session.started = context.started;
518
+ if (session.ignoreDuration) session.duration = void 0;
519
+ else if (typeof context.duration === "number") session.duration = context.duration;
520
+ else {
521
+ const duration = session.timestamp - session.started;
522
+ session.duration = duration >= 0 ? duration : 0;
523
+ }
524
+ if (context.release) session.release = context.release;
525
+ if (context.environment) session.environment = context.environment;
526
+ if (!session.ipAddress && context.ipAddress) session.ipAddress = context.ipAddress;
527
+ if (!session.userAgent && context.userAgent) session.userAgent = context.userAgent;
528
+ if (typeof context.errors === "number") session.errors = context.errors;
529
+ if (context.status) session.status = context.status;
530
+ }
531
+ function closeSession(session, status) {
532
+ let context = {};
533
+ if (status) context = { status };
534
+ else if (session.status === "ok") context = { status: "exited" };
535
+ updateSession(session, context);
536
+ }
537
+ function sessionToJSON(session) {
538
+ return {
539
+ sid: `${session.sid}`,
540
+ init: session.init,
541
+ started: (/* @__PURE__ */ new Date(session.started * 1e3)).toISOString(),
542
+ timestamp: (/* @__PURE__ */ new Date(session.timestamp * 1e3)).toISOString(),
543
+ status: session.status,
544
+ errors: session.errors,
545
+ did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0,
546
+ duration: session.duration,
547
+ abnormal_mechanism: session.abnormal_mechanism,
548
+ attrs: {
549
+ release: session.release,
550
+ environment: session.environment,
551
+ ip_address: session.ipAddress,
552
+ user_agent: session.userAgent
553
+ }
554
+ };
555
+ }
556
+ function merge(initialObj, mergeObj, levels = 2) {
557
+ if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) return mergeObj;
558
+ if (initialObj && Object.keys(mergeObj).length === 0) return initialObj;
559
+ const output = { ...initialObj };
560
+ for (const key in mergeObj) if (Object.prototype.hasOwnProperty.call(mergeObj, key)) output[key] = merge(output[key], mergeObj[key], levels - 1);
561
+ return output;
562
+ }
563
+ function generateTraceId() {
564
+ return uuid4();
565
+ }
566
+ function generateSpanId() {
567
+ return uuid4().substring(16);
568
+ }
569
+ var SCOPE_SPAN_FIELD = "_sentrySpan";
570
+ function _setSpanForScope(scope, span) {
571
+ if (span) addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, span);
572
+ else delete scope[SCOPE_SPAN_FIELD];
573
+ }
574
+ function _getSpanForScope(scope) {
575
+ return scope[SCOPE_SPAN_FIELD];
576
+ }
577
+ var DEFAULT_MAX_BREADCRUMBS = 100;
578
+ var Scope = class Scope {
579
+ constructor() {
580
+ this._notifyingListeners = false;
581
+ this._scopeListeners = [];
582
+ this._eventProcessors = [];
583
+ this._breadcrumbs = [];
584
+ this._attachments = [];
585
+ this._user = {};
586
+ this._tags = {};
587
+ this._extra = {};
588
+ this._contexts = {};
589
+ this._sdkProcessingMetadata = {};
590
+ this._propagationContext = {
591
+ traceId: generateTraceId(),
592
+ sampleRand: Math.random()
593
+ };
594
+ }
595
+ clone() {
596
+ const newScope = new Scope();
597
+ newScope._breadcrumbs = [...this._breadcrumbs];
598
+ newScope._tags = { ...this._tags };
599
+ newScope._extra = { ...this._extra };
600
+ newScope._contexts = { ...this._contexts };
601
+ if (this._contexts.flags) newScope._contexts.flags = { values: [...this._contexts.flags.values] };
602
+ newScope._user = this._user;
603
+ newScope._level = this._level;
604
+ newScope._session = this._session;
605
+ newScope._transactionName = this._transactionName;
606
+ newScope._fingerprint = this._fingerprint;
607
+ newScope._eventProcessors = [...this._eventProcessors];
608
+ newScope._attachments = [...this._attachments];
609
+ newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };
610
+ newScope._propagationContext = { ...this._propagationContext };
611
+ newScope._client = this._client;
612
+ newScope._lastEventId = this._lastEventId;
613
+ _setSpanForScope(newScope, _getSpanForScope(this));
614
+ return newScope;
615
+ }
616
+ setClient(client) {
617
+ this._client = client;
618
+ }
619
+ setLastEventId(lastEventId) {
620
+ this._lastEventId = lastEventId;
621
+ }
622
+ getClient() {
623
+ return this._client;
624
+ }
625
+ lastEventId() {
626
+ return this._lastEventId;
627
+ }
628
+ addScopeListener(callback) {
629
+ this._scopeListeners.push(callback);
630
+ }
631
+ addEventProcessor(callback) {
632
+ this._eventProcessors.push(callback);
633
+ return this;
634
+ }
635
+ setUser(user) {
636
+ this._user = user || {
637
+ email: void 0,
638
+ id: void 0,
639
+ ip_address: void 0,
640
+ username: void 0
641
+ };
642
+ if (this._session) updateSession(this._session, { user });
643
+ this._notifyScopeListeners();
644
+ return this;
645
+ }
646
+ getUser() {
647
+ return this._user;
648
+ }
649
+ setTags(tags) {
650
+ this._tags = {
651
+ ...this._tags,
652
+ ...tags
653
+ };
654
+ this._notifyScopeListeners();
655
+ return this;
656
+ }
657
+ setTag(key, value) {
658
+ this._tags = {
659
+ ...this._tags,
660
+ [key]: value
661
+ };
662
+ this._notifyScopeListeners();
663
+ return this;
664
+ }
665
+ setExtras(extras) {
666
+ this._extra = {
667
+ ...this._extra,
668
+ ...extras
669
+ };
670
+ this._notifyScopeListeners();
671
+ return this;
672
+ }
673
+ setExtra(key, extra) {
674
+ this._extra = {
675
+ ...this._extra,
676
+ [key]: extra
677
+ };
678
+ this._notifyScopeListeners();
679
+ return this;
680
+ }
681
+ setFingerprint(fingerprint) {
682
+ this._fingerprint = fingerprint;
683
+ this._notifyScopeListeners();
684
+ return this;
685
+ }
686
+ setLevel(level) {
687
+ this._level = level;
688
+ this._notifyScopeListeners();
689
+ return this;
690
+ }
691
+ setTransactionName(name) {
692
+ this._transactionName = name;
693
+ this._notifyScopeListeners();
694
+ return this;
695
+ }
696
+ setContext(key, context) {
697
+ if (context === null) delete this._contexts[key];
698
+ else this._contexts[key] = context;
699
+ this._notifyScopeListeners();
700
+ return this;
701
+ }
702
+ setSession(session) {
703
+ if (!session) delete this._session;
704
+ else this._session = session;
705
+ this._notifyScopeListeners();
706
+ return this;
707
+ }
708
+ getSession() {
709
+ return this._session;
710
+ }
711
+ update(captureContext) {
712
+ if (!captureContext) return this;
713
+ const scopeToMerge = typeof captureContext === "function" ? captureContext(this) : captureContext;
714
+ const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = (scopeToMerge instanceof Scope ? scopeToMerge.getScopeData() : isPlainObject(scopeToMerge) ? captureContext : void 0) || {};
715
+ this._tags = {
716
+ ...this._tags,
717
+ ...tags
718
+ };
719
+ this._extra = {
720
+ ...this._extra,
721
+ ...extra
722
+ };
723
+ this._contexts = {
724
+ ...this._contexts,
725
+ ...contexts
726
+ };
727
+ if (user && Object.keys(user).length) this._user = user;
728
+ if (level) this._level = level;
729
+ if (fingerprint.length) this._fingerprint = fingerprint;
730
+ if (propagationContext) this._propagationContext = propagationContext;
731
+ return this;
732
+ }
733
+ clear() {
734
+ this._breadcrumbs = [];
735
+ this._tags = {};
736
+ this._extra = {};
737
+ this._user = {};
738
+ this._contexts = {};
739
+ this._level = void 0;
740
+ this._transactionName = void 0;
741
+ this._fingerprint = void 0;
742
+ this._session = void 0;
743
+ _setSpanForScope(this, void 0);
744
+ this._attachments = [];
745
+ this.setPropagationContext({
746
+ traceId: generateTraceId(),
747
+ sampleRand: Math.random()
748
+ });
749
+ this._notifyScopeListeners();
750
+ return this;
751
+ }
752
+ addBreadcrumb(breadcrumb, maxBreadcrumbs) {
753
+ const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;
754
+ if (maxCrumbs <= 0) return this;
755
+ const mergedBreadcrumb = {
756
+ timestamp: dateTimestampInSeconds(),
757
+ ...breadcrumb,
758
+ message: breadcrumb.message ? truncate(breadcrumb.message, 2048) : breadcrumb.message
759
+ };
760
+ this._breadcrumbs.push(mergedBreadcrumb);
761
+ if (this._breadcrumbs.length > maxCrumbs) {
762
+ this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs);
763
+ this._client?.recordDroppedEvent("buffer_overflow", "log_item");
764
+ }
765
+ this._notifyScopeListeners();
766
+ return this;
767
+ }
768
+ getLastBreadcrumb() {
769
+ return this._breadcrumbs[this._breadcrumbs.length - 1];
770
+ }
771
+ clearBreadcrumbs() {
772
+ this._breadcrumbs = [];
773
+ this._notifyScopeListeners();
774
+ return this;
775
+ }
776
+ addAttachment(attachment) {
777
+ this._attachments.push(attachment);
778
+ return this;
779
+ }
780
+ clearAttachments() {
781
+ this._attachments = [];
782
+ return this;
783
+ }
784
+ getScopeData() {
785
+ return {
786
+ breadcrumbs: this._breadcrumbs,
787
+ attachments: this._attachments,
788
+ contexts: this._contexts,
789
+ tags: this._tags,
790
+ extra: this._extra,
791
+ user: this._user,
792
+ level: this._level,
793
+ fingerprint: this._fingerprint || [],
794
+ eventProcessors: this._eventProcessors,
795
+ propagationContext: this._propagationContext,
796
+ sdkProcessingMetadata: this._sdkProcessingMetadata,
797
+ transactionName: this._transactionName,
798
+ span: _getSpanForScope(this)
799
+ };
800
+ }
801
+ setSDKProcessingMetadata(newData) {
802
+ this._sdkProcessingMetadata = merge(this._sdkProcessingMetadata, newData, 2);
803
+ return this;
804
+ }
805
+ setPropagationContext(context) {
806
+ this._propagationContext = context;
807
+ return this;
808
+ }
809
+ getPropagationContext() {
810
+ return this._propagationContext;
811
+ }
812
+ captureException(exception, hint) {
813
+ const eventId = hint?.event_id || uuid4();
814
+ if (!this._client) {
815
+ DEBUG_BUILD && debug.warn("No client configured on scope - will not capture exception!");
816
+ return eventId;
817
+ }
818
+ const syntheticException = /* @__PURE__ */ new Error("Sentry syntheticException");
819
+ this._client.captureException(exception, {
820
+ originalException: exception,
821
+ syntheticException,
822
+ ...hint,
823
+ event_id: eventId
824
+ }, this);
825
+ return eventId;
826
+ }
827
+ captureMessage(message, level, hint) {
828
+ const eventId = hint?.event_id || uuid4();
829
+ if (!this._client) {
830
+ DEBUG_BUILD && debug.warn("No client configured on scope - will not capture message!");
831
+ return eventId;
832
+ }
833
+ const syntheticException = new Error(message);
834
+ this._client.captureMessage(message, level, {
835
+ originalException: message,
836
+ syntheticException,
837
+ ...hint,
838
+ event_id: eventId
839
+ }, this);
840
+ return eventId;
841
+ }
842
+ captureEvent(event, hint) {
843
+ const eventId = hint?.event_id || uuid4();
844
+ if (!this._client) {
845
+ DEBUG_BUILD && debug.warn("No client configured on scope - will not capture event!");
846
+ return eventId;
847
+ }
848
+ this._client.captureEvent(event, {
849
+ ...hint,
850
+ event_id: eventId
851
+ }, this);
852
+ return eventId;
853
+ }
854
+ _notifyScopeListeners() {
855
+ if (!this._notifyingListeners) {
856
+ this._notifyingListeners = true;
857
+ this._scopeListeners.forEach((callback) => {
858
+ callback(this);
859
+ });
860
+ this._notifyingListeners = false;
861
+ }
862
+ }
863
+ };
864
+ function getDefaultCurrentScope() {
865
+ return getGlobalSingleton("defaultCurrentScope", () => new Scope());
866
+ }
867
+ function getDefaultIsolationScope() {
868
+ return getGlobalSingleton("defaultIsolationScope", () => new Scope());
869
+ }
870
+ var AsyncContextStack = class {
871
+ constructor(scope, isolationScope) {
872
+ let assignedScope;
873
+ if (!scope) assignedScope = new Scope();
874
+ else assignedScope = scope;
875
+ let assignedIsolationScope;
876
+ if (!isolationScope) assignedIsolationScope = new Scope();
877
+ else assignedIsolationScope = isolationScope;
878
+ this._stack = [{ scope: assignedScope }];
879
+ this._isolationScope = assignedIsolationScope;
880
+ }
881
+ withScope(callback) {
882
+ const scope = this._pushScope();
883
+ let maybePromiseResult;
884
+ try {
885
+ maybePromiseResult = callback(scope);
886
+ } catch (e) {
887
+ this._popScope();
888
+ throw e;
889
+ }
890
+ if (isThenable(maybePromiseResult)) return maybePromiseResult.then((res) => {
891
+ this._popScope();
892
+ return res;
893
+ }, (e) => {
894
+ this._popScope();
895
+ throw e;
896
+ });
897
+ this._popScope();
898
+ return maybePromiseResult;
899
+ }
900
+ getClient() {
901
+ return this.getStackTop().client;
902
+ }
903
+ getScope() {
904
+ return this.getStackTop().scope;
905
+ }
906
+ getIsolationScope() {
907
+ return this._isolationScope;
908
+ }
909
+ getStackTop() {
910
+ return this._stack[this._stack.length - 1];
911
+ }
912
+ _pushScope() {
913
+ const scope = this.getScope().clone();
914
+ this._stack.push({
915
+ client: this.getClient(),
916
+ scope
917
+ });
918
+ return scope;
919
+ }
920
+ _popScope() {
921
+ if (this._stack.length <= 1) return false;
922
+ return !!this._stack.pop();
923
+ }
924
+ };
925
+ function getAsyncContextStack() {
926
+ const sentry = getSentryCarrier(getMainCarrier());
927
+ return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope());
928
+ }
929
+ function withScope$1(callback) {
930
+ return getAsyncContextStack().withScope(callback);
931
+ }
932
+ function withSetScope(scope, callback) {
933
+ const stack = getAsyncContextStack();
934
+ return stack.withScope(() => {
935
+ stack.getStackTop().scope = scope;
936
+ return callback(scope);
937
+ });
938
+ }
939
+ function withIsolationScope$1(callback) {
940
+ return getAsyncContextStack().withScope(() => {
941
+ return callback(getAsyncContextStack().getIsolationScope());
942
+ });
943
+ }
944
+ function getStackAsyncContextStrategy() {
945
+ return {
946
+ withIsolationScope: withIsolationScope$1,
947
+ withScope: withScope$1,
948
+ withSetScope,
949
+ withSetIsolationScope: (_isolationScope, callback) => {
950
+ return withIsolationScope$1(callback);
951
+ },
952
+ getCurrentScope: () => getAsyncContextStack().getScope(),
953
+ getIsolationScope: () => getAsyncContextStack().getIsolationScope()
954
+ };
955
+ }
956
+ function getAsyncContextStrategy(carrier) {
957
+ const sentry = getSentryCarrier(carrier);
958
+ if (sentry.acs) return sentry.acs;
959
+ return getStackAsyncContextStrategy();
960
+ }
961
+ function getCurrentScope() {
962
+ return getAsyncContextStrategy(getMainCarrier()).getCurrentScope();
963
+ }
964
+ function getIsolationScope() {
965
+ return getAsyncContextStrategy(getMainCarrier()).getIsolationScope();
966
+ }
967
+ function getGlobalScope() {
968
+ return getGlobalSingleton("globalScope", () => new Scope());
969
+ }
970
+ function withScope(...rest) {
971
+ const acs = getAsyncContextStrategy(getMainCarrier());
972
+ if (rest.length === 2) {
973
+ const [scope, callback] = rest;
974
+ if (!scope) return acs.withScope(callback);
975
+ return acs.withSetScope(scope, callback);
976
+ }
977
+ return acs.withScope(rest[0]);
978
+ }
979
+ function getClient() {
980
+ return getCurrentScope().getClient();
981
+ }
982
+ function getTraceContextFromScope(scope) {
983
+ const { traceId, parentSpanId, propagationSpanId } = scope.getPropagationContext();
984
+ const traceContext = {
985
+ trace_id: traceId,
986
+ span_id: propagationSpanId || generateSpanId()
987
+ };
988
+ if (parentSpanId) traceContext.parent_span_id = parentSpanId;
989
+ return traceContext;
990
+ }
991
+ var SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source";
992
+ var SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = "sentry.sample_rate";
993
+ var SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op";
994
+ var SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin";
995
+ var SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit";
996
+ var SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value";
997
+ var SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = "sentry.custom_span_name";
998
+ var SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id";
999
+ var SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time";
1000
+ var SCOPE_ON_START_SPAN_FIELD = "_sentryScope";
1001
+ var ISOLATION_SCOPE_ON_START_SPAN_FIELD = "_sentryIsolationScope";
1002
+ function setCapturedScopesOnSpan(span, scope, isolationScope) {
1003
+ if (span) {
1004
+ addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope);
1005
+ addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);
1006
+ }
1007
+ }
1008
+ function getCapturedScopesOnSpan(span) {
1009
+ return {
1010
+ scope: span[SCOPE_ON_START_SPAN_FIELD],
1011
+ isolationScope: span[ISOLATION_SCOPE_ON_START_SPAN_FIELD]
1012
+ };
1013
+ }
1014
+ var SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;
1015
+ function baggageHeaderToDynamicSamplingContext(baggageHeader) {
1016
+ const baggageObject = parseBaggageHeader(baggageHeader);
1017
+ if (!baggageObject) return;
1018
+ const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {
1019
+ if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {
1020
+ const nonPrefixedKey = key.slice(7);
1021
+ acc[nonPrefixedKey] = value;
1022
+ }
1023
+ return acc;
1024
+ }, {});
1025
+ if (Object.keys(dynamicSamplingContext).length > 0) return dynamicSamplingContext;
1026
+ else return;
1027
+ }
1028
+ function parseBaggageHeader(baggageHeader) {
1029
+ if (!baggageHeader || !isString(baggageHeader) && !Array.isArray(baggageHeader)) return;
1030
+ if (Array.isArray(baggageHeader)) return baggageHeader.reduce((acc, curr) => {
1031
+ const currBaggageObject = baggageHeaderToObject(curr);
1032
+ Object.entries(currBaggageObject).forEach(([key, value]) => {
1033
+ acc[key] = value;
1034
+ });
1035
+ return acc;
1036
+ }, {});
1037
+ return baggageHeaderToObject(baggageHeader);
1038
+ }
1039
+ function baggageHeaderToObject(baggageHeader) {
1040
+ return baggageHeader.split(",").map((baggageEntry) => baggageEntry.split("=").map((keyOrValue) => {
1041
+ try {
1042
+ return decodeURIComponent(keyOrValue.trim());
1043
+ } catch {
1044
+ return;
1045
+ }
1046
+ })).reduce((acc, [key, value]) => {
1047
+ if (key && value) acc[key] = value;
1048
+ return acc;
1049
+ }, {});
1050
+ }
1051
+ var TRACE_FLAG_NONE = 0;
1052
+ var TRACE_FLAG_SAMPLED = 1;
1053
+ var hasShownSpanDropWarning = false;
1054
+ function spanToTransactionTraceContext(span) {
1055
+ const { spanId: span_id, traceId: trace_id } = span.spanContext();
1056
+ const { data, op, parent_span_id, status, origin, links } = spanToJSON(span);
1057
+ return {
1058
+ parent_span_id,
1059
+ span_id,
1060
+ trace_id,
1061
+ data,
1062
+ op,
1063
+ status,
1064
+ origin,
1065
+ links
1066
+ };
1067
+ }
1068
+ function spanToTraceContext(span) {
1069
+ const { spanId, traceId: trace_id, isRemote } = span.spanContext();
1070
+ const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id;
1071
+ const scope = getCapturedScopesOnSpan(span).scope;
1072
+ return {
1073
+ parent_span_id,
1074
+ span_id: isRemote ? scope?.getPropagationContext().propagationSpanId || generateSpanId() : spanId,
1075
+ trace_id
1076
+ };
1077
+ }
1078
+ function convertSpanLinksForEnvelope(links) {
1079
+ if (links && links.length > 0) return links.map(({ context: { spanId, traceId, traceFlags,...restContext }, attributes }) => ({
1080
+ span_id: spanId,
1081
+ trace_id: traceId,
1082
+ sampled: traceFlags === 1,
1083
+ attributes,
1084
+ ...restContext
1085
+ }));
1086
+ else return;
1087
+ }
1088
+ function spanTimeInputToSeconds(input) {
1089
+ if (typeof input === "number") return ensureTimestampInSeconds(input);
1090
+ if (Array.isArray(input)) return input[0] + input[1] / 1e9;
1091
+ if (input instanceof Date) return ensureTimestampInSeconds(input.getTime());
1092
+ return timestampInSeconds();
1093
+ }
1094
+ function ensureTimestampInSeconds(timestamp) {
1095
+ return timestamp > 9999999999 ? timestamp / 1e3 : timestamp;
1096
+ }
1097
+ function spanToJSON(span) {
1098
+ if (spanIsSentrySpan(span)) return span.getSpanJSON();
1099
+ const { spanId: span_id, traceId: trace_id } = span.spanContext();
1100
+ if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) {
1101
+ const { attributes, startTime, name, endTime, status, links } = span;
1102
+ return {
1103
+ span_id,
1104
+ trace_id,
1105
+ data: attributes,
1106
+ description: name,
1107
+ parent_span_id: "parentSpanId" in span ? span.parentSpanId : "parentSpanContext" in span ? span.parentSpanContext?.spanId : void 0,
1108
+ start_timestamp: spanTimeInputToSeconds(startTime),
1109
+ timestamp: spanTimeInputToSeconds(endTime) || void 0,
1110
+ status: getStatusMessage(status),
1111
+ op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],
1112
+ origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],
1113
+ links: convertSpanLinksForEnvelope(links)
1114
+ };
1115
+ }
1116
+ return {
1117
+ span_id,
1118
+ trace_id,
1119
+ start_timestamp: 0,
1120
+ data: {}
1121
+ };
1122
+ }
1123
+ function spanIsOpenTelemetrySdkTraceBaseSpan(span) {
1124
+ const castSpan = span;
1125
+ return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status;
1126
+ }
1127
+ function spanIsSentrySpan(span) {
1128
+ return typeof span.getSpanJSON === "function";
1129
+ }
1130
+ function spanIsSampled(span) {
1131
+ const { traceFlags } = span.spanContext();
1132
+ return traceFlags === 1;
1133
+ }
1134
+ function getStatusMessage(status) {
1135
+ if (!status || status.code === 0) return;
1136
+ if (status.code === 1) return "ok";
1137
+ return status.message || "unknown_error";
1138
+ }
1139
+ var CHILD_SPANS_FIELD = "_sentryChildSpans";
1140
+ var ROOT_SPAN_FIELD = "_sentryRootSpan";
1141
+ function addChildSpanToSpan(span, childSpan) {
1142
+ addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, span[ROOT_SPAN_FIELD] || span);
1143
+ if (span[CHILD_SPANS_FIELD]) span[CHILD_SPANS_FIELD].add(childSpan);
1144
+ else addNonEnumerableProperty(span, CHILD_SPANS_FIELD, new Set([childSpan]));
1145
+ }
1146
+ function getSpanDescendants(span) {
1147
+ const resultSet = /* @__PURE__ */ new Set();
1148
+ function addSpanChildren(span$1) {
1149
+ if (resultSet.has(span$1)) return;
1150
+ else if (spanIsSampled(span$1)) {
1151
+ resultSet.add(span$1);
1152
+ const childSpans = span$1[CHILD_SPANS_FIELD] ? Array.from(span$1[CHILD_SPANS_FIELD]) : [];
1153
+ for (const childSpan of childSpans) addSpanChildren(childSpan);
1154
+ }
1155
+ }
1156
+ addSpanChildren(span);
1157
+ return Array.from(resultSet);
1158
+ }
1159
+ function getRootSpan(span) {
1160
+ return span[ROOT_SPAN_FIELD] || span;
1161
+ }
1162
+ function getActiveSpan() {
1163
+ const acs = getAsyncContextStrategy(getMainCarrier());
1164
+ if (acs.getActiveSpan) return acs.getActiveSpan();
1165
+ return _getSpanForScope(getCurrentScope());
1166
+ }
1167
+ function showSpanDropWarning() {
1168
+ if (!hasShownSpanDropWarning) {
1169
+ consoleSandbox(() => {
1170
+ console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.");
1171
+ });
1172
+ hasShownSpanDropWarning = true;
1173
+ }
1174
+ }
1175
+ function hasSpansEnabled(maybeOptions) {
1176
+ if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) return false;
1177
+ const options = maybeOptions || getClient()?.getOptions();
1178
+ return !!options && (options.tracesSampleRate != null || !!options.tracesSampler);
1179
+ }
1180
+ var DEFAULT_ENVIRONMENT = "production";
1181
+ var ORG_ID_REGEX = /^o(\d+)\./;
1182
+ var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
1183
+ function isValidProtocol(protocol) {
1184
+ return protocol === "http" || protocol === "https";
1185
+ }
1186
+ function dsnToString(dsn, withPassword = false) {
1187
+ const { host, path, pass, port, projectId, protocol, publicKey } = dsn;
1188
+ return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`;
1189
+ }
1190
+ function dsnFromString(str) {
1191
+ const match = DSN_REGEX.exec(str);
1192
+ if (!match) {
1193
+ consoleSandbox(() => {
1194
+ console.error(`Invalid Sentry Dsn: ${str}`);
1195
+ });
1196
+ return;
1197
+ }
1198
+ const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1);
1199
+ let path = "";
1200
+ let projectId = lastPath;
1201
+ const split = projectId.split("/");
1202
+ if (split.length > 1) {
1203
+ path = split.slice(0, -1).join("/");
1204
+ projectId = split.pop();
1205
+ }
1206
+ if (projectId) {
1207
+ const projectMatch = projectId.match(/^\d+/);
1208
+ if (projectMatch) projectId = projectMatch[0];
1209
+ }
1210
+ return dsnFromComponents({
1211
+ host,
1212
+ pass,
1213
+ path,
1214
+ projectId,
1215
+ port,
1216
+ protocol,
1217
+ publicKey
1218
+ });
1219
+ }
1220
+ function dsnFromComponents(components) {
1221
+ return {
1222
+ protocol: components.protocol,
1223
+ publicKey: components.publicKey || "",
1224
+ pass: components.pass || "",
1225
+ host: components.host,
1226
+ port: components.port || "",
1227
+ path: components.path || "",
1228
+ projectId: components.projectId
1229
+ };
1230
+ }
1231
+ function validateDsn(dsn) {
1232
+ if (!DEBUG_BUILD) return true;
1233
+ const { port, projectId, protocol } = dsn;
1234
+ if ([
1235
+ "protocol",
1236
+ "publicKey",
1237
+ "host",
1238
+ "projectId"
1239
+ ].find((component) => {
1240
+ if (!dsn[component]) {
1241
+ debug.error(`Invalid Sentry Dsn: ${component} missing`);
1242
+ return true;
1243
+ }
1244
+ return false;
1245
+ })) return false;
1246
+ if (!projectId.match(/^\d+$/)) {
1247
+ debug.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
1248
+ return false;
1249
+ }
1250
+ if (!isValidProtocol(protocol)) {
1251
+ debug.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
1252
+ return false;
1253
+ }
1254
+ if (port && isNaN(parseInt(port, 10))) {
1255
+ debug.error(`Invalid Sentry Dsn: Invalid port ${port}`);
1256
+ return false;
1257
+ }
1258
+ return true;
1259
+ }
1260
+ function extractOrgIdFromDsnHost(host) {
1261
+ return host.match(ORG_ID_REGEX)?.[1];
1262
+ }
1263
+ function makeDsn(from) {
1264
+ const components = typeof from === "string" ? dsnFromString(from) : dsnFromComponents(from);
1265
+ if (!components || !validateDsn(components)) return;
1266
+ return components;
1267
+ }
1268
+ var FROZEN_DSC_FIELD = "_frozenDsc";
1269
+ function freezeDscOnSpan(span, dsc) {
1270
+ addNonEnumerableProperty(span, FROZEN_DSC_FIELD, dsc);
1271
+ }
1272
+ function getDynamicSamplingContextFromClient(trace_id, client) {
1273
+ const options = client.getOptions();
1274
+ const { publicKey: public_key, host } = client.getDsn() || {};
1275
+ let org_id;
1276
+ if (options.orgId) org_id = String(options.orgId);
1277
+ else if (host) org_id = extractOrgIdFromDsnHost(host);
1278
+ const dsc = {
1279
+ environment: options.environment || "production",
1280
+ release: options.release,
1281
+ public_key,
1282
+ trace_id,
1283
+ org_id
1284
+ };
1285
+ client.emit("createDsc", dsc);
1286
+ return dsc;
1287
+ }
1288
+ function getDynamicSamplingContextFromScope(client, scope) {
1289
+ const propagationContext = scope.getPropagationContext();
1290
+ return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client);
1291
+ }
1292
+ function getDynamicSamplingContextFromSpan(span) {
1293
+ const client = getClient();
1294
+ if (!client) return {};
1295
+ const rootSpan = getRootSpan(span);
1296
+ const rootSpanJson = spanToJSON(rootSpan);
1297
+ const rootSpanAttributes = rootSpanJson.data;
1298
+ const traceState = rootSpan.spanContext().traceState;
1299
+ const rootSpanSampleRate = traceState?.get("sentry.sample_rate") ?? rootSpanAttributes["sentry.sample_rate"] ?? rootSpanAttributes["sentry.previous_trace_sample_rate"];
1300
+ function applyLocalSampleRateToDsc(dsc$1) {
1301
+ if (typeof rootSpanSampleRate === "number" || typeof rootSpanSampleRate === "string") dsc$1.sample_rate = `${rootSpanSampleRate}`;
1302
+ return dsc$1;
1303
+ }
1304
+ const frozenDsc = rootSpan[FROZEN_DSC_FIELD];
1305
+ if (frozenDsc) return applyLocalSampleRateToDsc(frozenDsc);
1306
+ const traceStateDsc = traceState?.get("sentry.dsc");
1307
+ const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc);
1308
+ if (dscOnTraceState) return applyLocalSampleRateToDsc(dscOnTraceState);
1309
+ const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client);
1310
+ const source = rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
1311
+ const name = rootSpanJson.description;
1312
+ if (source !== "url" && name) dsc.transaction = name;
1313
+ if (hasSpansEnabled()) {
1314
+ dsc.sampled = String(spanIsSampled(rootSpan));
1315
+ dsc.sample_rand = traceState?.get("sentry.sample_rand") ?? getCapturedScopesOnSpan(rootSpan).scope?.getPropagationContext().sampleRand.toString();
1316
+ }
1317
+ applyLocalSampleRateToDsc(dsc);
1318
+ client.emit("createDsc", dsc, rootSpan);
1319
+ return dsc;
1320
+ }
1321
+ init_dist();
1322
+ function normalize(input, depth = 100, maxProperties = Infinity) {
1323
+ try {
1324
+ return visit("", input, depth, maxProperties);
1325
+ } catch (err) {
1326
+ return { ERROR: `**non-serializable** (${err})` };
1327
+ }
1328
+ }
1329
+ function normalizeToSize(object, depth = 3, maxSize = 100 * 1024) {
1330
+ const normalized = normalize(object, depth);
1331
+ if (jsonSize(normalized) > maxSize) return normalizeToSize(object, depth - 1, maxSize);
1332
+ return normalized;
1333
+ }
1334
+ function visit(key, value, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) {
1335
+ const [memoize, unmemoize] = memo;
1336
+ if (value == null || ["boolean", "string"].includes(typeof value) || typeof value === "number" && Number.isFinite(value)) return value;
1337
+ const stringified = stringifyValue(key, value);
1338
+ if (!stringified.startsWith("[object ")) return stringified;
1339
+ if (value["__sentry_skip_normalization__"]) return value;
1340
+ const remainingDepth = typeof value["__sentry_override_normalization_depth__"] === "number" ? value["__sentry_override_normalization_depth__"] : depth;
1341
+ if (remainingDepth === 0) return stringified.replace("object ", "");
1342
+ if (memoize(value)) return "[Circular ~]";
1343
+ const valueWithToJSON = value;
1344
+ if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") try {
1345
+ return visit("", valueWithToJSON.toJSON(), remainingDepth - 1, maxProperties, memo);
1346
+ } catch {}
1347
+ const normalized = Array.isArray(value) ? [] : {};
1348
+ let numAdded = 0;
1349
+ const visitable = convertToPlainObject(value);
1350
+ for (const visitKey in visitable) {
1351
+ if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) continue;
1352
+ if (numAdded >= maxProperties) {
1353
+ normalized[visitKey] = "[MaxProperties ~]";
1354
+ break;
1355
+ }
1356
+ const visitValue = visitable[visitKey];
1357
+ normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);
1358
+ numAdded++;
1359
+ }
1360
+ unmemoize(value);
1361
+ return normalized;
1362
+ }
1363
+ function stringifyValue(key, value) {
1364
+ try {
1365
+ if (key === "domain" && value && typeof value === "object" && value._events) return "[Domain]";
1366
+ if (key === "domainEmitter") return "[DomainEmitter]";
1367
+ if (typeof global !== "undefined" && value === global) return "[Global]";
1368
+ if (typeof window !== "undefined" && value === window) return "[Window]";
1369
+ if (typeof document !== "undefined" && value === document) return "[Document]";
1370
+ if (isVueViewModel(value)) return "[VueViewModel]";
1371
+ if (isSyntheticEvent(value)) return "[SyntheticEvent]";
1372
+ if (typeof value === "number" && !Number.isFinite(value)) return `[${value}]`;
1373
+ if (typeof value === "function") return `[Function: ${getFunctionName(value)}]`;
1374
+ if (typeof value === "symbol") return `[${String(value)}]`;
1375
+ if (typeof value === "bigint") return `[BigInt: ${String(value)}]`;
1376
+ const objName = getConstructorName(value);
1377
+ if (/^HTML(\w*)Element$/.test(objName)) return `[HTMLElement: ${objName}]`;
1378
+ return `[object ${objName}]`;
1379
+ } catch (err) {
1380
+ return `**non-serializable** (${err})`;
1381
+ }
1382
+ }
1383
+ function getConstructorName(value) {
1384
+ const prototype = Object.getPrototypeOf(value);
1385
+ return prototype?.constructor ? prototype.constructor.name : "null prototype";
1386
+ }
1387
+ function utf8Length(value) {
1388
+ return ~-encodeURI(value).split(/%..|./).length;
1389
+ }
1390
+ function jsonSize(value) {
1391
+ return utf8Length(JSON.stringify(value));
1392
+ }
1393
+ function memoBuilder() {
1394
+ const inner = /* @__PURE__ */ new WeakSet();
1395
+ function memoize(obj) {
1396
+ if (inner.has(obj)) return true;
1397
+ inner.add(obj);
1398
+ return false;
1399
+ }
1400
+ function unmemoize(obj) {
1401
+ inner.delete(obj);
1402
+ }
1403
+ return [memoize, unmemoize];
1404
+ }
1405
+ var STATE_PENDING = 0;
1406
+ var STATE_RESOLVED = 1;
1407
+ var STATE_REJECTED = 2;
1408
+ function resolvedSyncPromise(value) {
1409
+ return new SyncPromise((resolve) => {
1410
+ resolve(value);
1411
+ });
1412
+ }
1413
+ function rejectedSyncPromise(reason) {
1414
+ return new SyncPromise((_, reject) => {
1415
+ reject(reason);
1416
+ });
1417
+ }
1418
+ var SyncPromise = class SyncPromise {
1419
+ constructor(executor) {
1420
+ this._state = STATE_PENDING;
1421
+ this._handlers = [];
1422
+ this._runExecutor(executor);
1423
+ }
1424
+ then(onfulfilled, onrejected) {
1425
+ return new SyncPromise((resolve, reject) => {
1426
+ this._handlers.push([
1427
+ false,
1428
+ (result) => {
1429
+ if (!onfulfilled) resolve(result);
1430
+ else try {
1431
+ resolve(onfulfilled(result));
1432
+ } catch (e) {
1433
+ reject(e);
1434
+ }
1435
+ },
1436
+ (reason) => {
1437
+ if (!onrejected) reject(reason);
1438
+ else try {
1439
+ resolve(onrejected(reason));
1440
+ } catch (e) {
1441
+ reject(e);
1442
+ }
1443
+ }
1444
+ ]);
1445
+ this._executeHandlers();
1446
+ });
1447
+ }
1448
+ catch(onrejected) {
1449
+ return this.then((val) => val, onrejected);
1450
+ }
1451
+ finally(onfinally) {
1452
+ return new SyncPromise((resolve, reject) => {
1453
+ let val;
1454
+ let isRejected;
1455
+ return this.then((value) => {
1456
+ isRejected = false;
1457
+ val = value;
1458
+ if (onfinally) onfinally();
1459
+ }, (reason) => {
1460
+ isRejected = true;
1461
+ val = reason;
1462
+ if (onfinally) onfinally();
1463
+ }).then(() => {
1464
+ if (isRejected) {
1465
+ reject(val);
1466
+ return;
1467
+ }
1468
+ resolve(val);
1469
+ });
1470
+ });
1471
+ }
1472
+ _executeHandlers() {
1473
+ if (this._state === STATE_PENDING) return;
1474
+ const cachedHandlers = this._handlers.slice();
1475
+ this._handlers = [];
1476
+ cachedHandlers.forEach((handler) => {
1477
+ if (handler[0]) return;
1478
+ if (this._state === STATE_RESOLVED) handler[1](this._value);
1479
+ if (this._state === STATE_REJECTED) handler[2](this._value);
1480
+ handler[0] = true;
1481
+ });
1482
+ }
1483
+ _runExecutor(executor) {
1484
+ const setResult = (state, value) => {
1485
+ if (this._state !== STATE_PENDING) return;
1486
+ if (isThenable(value)) {
1487
+ value.then(resolve, reject);
1488
+ return;
1489
+ }
1490
+ this._state = state;
1491
+ this._value = value;
1492
+ this._executeHandlers();
1493
+ };
1494
+ const resolve = (value) => {
1495
+ setResult(STATE_RESOLVED, value);
1496
+ };
1497
+ const reject = (reason) => {
1498
+ setResult(STATE_REJECTED, reason);
1499
+ };
1500
+ try {
1501
+ executor(resolve, reject);
1502
+ } catch (e) {
1503
+ reject(e);
1504
+ }
1505
+ }
1506
+ };
1507
+ function notifyEventProcessors(processors, event, hint, index = 0) {
1508
+ return new SyncPromise((resolve, reject) => {
1509
+ const processor = processors[index];
1510
+ if (event === null || typeof processor !== "function") resolve(event);
1511
+ else {
1512
+ const result = processor({ ...event }, hint);
1513
+ DEBUG_BUILD && processor.id && result === null && debug.log(`Event processor "${processor.id}" dropped event`);
1514
+ if (isThenable(result)) result.then((final) => notifyEventProcessors(processors, final, hint, index + 1).then(resolve)).then(null, reject);
1515
+ else notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject);
1516
+ }
1517
+ });
1518
+ }
1519
+ function applyScopeDataToEvent(event, data) {
1520
+ const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;
1521
+ applyDataToEvent(event, data);
1522
+ if (span) applySpanToEvent(event, span);
1523
+ applyFingerprintToEvent(event, fingerprint);
1524
+ applyBreadcrumbsToEvent(event, breadcrumbs);
1525
+ applySdkMetadataToEvent(event, sdkProcessingMetadata);
1526
+ }
1527
+ function mergeScopeData(data, mergeData) {
1528
+ const { extra, tags, user, contexts, level, sdkProcessingMetadata, breadcrumbs, fingerprint, eventProcessors, attachments, propagationContext, transactionName, span } = mergeData;
1529
+ mergeAndOverwriteScopeData(data, "extra", extra);
1530
+ mergeAndOverwriteScopeData(data, "tags", tags);
1531
+ mergeAndOverwriteScopeData(data, "user", user);
1532
+ mergeAndOverwriteScopeData(data, "contexts", contexts);
1533
+ data.sdkProcessingMetadata = merge(data.sdkProcessingMetadata, sdkProcessingMetadata, 2);
1534
+ if (level) data.level = level;
1535
+ if (transactionName) data.transactionName = transactionName;
1536
+ if (span) data.span = span;
1537
+ if (breadcrumbs.length) data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];
1538
+ if (fingerprint.length) data.fingerprint = [...data.fingerprint, ...fingerprint];
1539
+ if (eventProcessors.length) data.eventProcessors = [...data.eventProcessors, ...eventProcessors];
1540
+ if (attachments.length) data.attachments = [...data.attachments, ...attachments];
1541
+ data.propagationContext = {
1542
+ ...data.propagationContext,
1543
+ ...propagationContext
1544
+ };
1545
+ }
1546
+ function mergeAndOverwriteScopeData(data, prop, mergeVal) {
1547
+ data[prop] = merge(data[prop], mergeVal, 1);
1548
+ }
1549
+ function applyDataToEvent(event, data) {
1550
+ const { extra, tags, user, contexts, level, transactionName } = data;
1551
+ if (Object.keys(extra).length) event.extra = {
1552
+ ...extra,
1553
+ ...event.extra
1554
+ };
1555
+ if (Object.keys(tags).length) event.tags = {
1556
+ ...tags,
1557
+ ...event.tags
1558
+ };
1559
+ if (Object.keys(user).length) event.user = {
1560
+ ...user,
1561
+ ...event.user
1562
+ };
1563
+ if (Object.keys(contexts).length) event.contexts = {
1564
+ ...contexts,
1565
+ ...event.contexts
1566
+ };
1567
+ if (level) event.level = level;
1568
+ if (transactionName && event.type !== "transaction") event.transaction = transactionName;
1569
+ }
1570
+ function applyBreadcrumbsToEvent(event, breadcrumbs) {
1571
+ const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs];
1572
+ event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0;
1573
+ }
1574
+ function applySdkMetadataToEvent(event, sdkProcessingMetadata) {
1575
+ event.sdkProcessingMetadata = {
1576
+ ...event.sdkProcessingMetadata,
1577
+ ...sdkProcessingMetadata
1578
+ };
1579
+ }
1580
+ function applySpanToEvent(event, span) {
1581
+ event.contexts = {
1582
+ trace: spanToTraceContext(span),
1583
+ ...event.contexts
1584
+ };
1585
+ event.sdkProcessingMetadata = {
1586
+ dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),
1587
+ ...event.sdkProcessingMetadata
1588
+ };
1589
+ const transactionName = spanToJSON(getRootSpan(span)).description;
1590
+ if (transactionName && !event.transaction && event.type === "transaction") event.transaction = transactionName;
1591
+ }
1592
+ function applyFingerprintToEvent(event, fingerprint) {
1593
+ event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : [];
1594
+ if (fingerprint) event.fingerprint = event.fingerprint.concat(fingerprint);
1595
+ if (!event.fingerprint.length) delete event.fingerprint;
1596
+ }
1597
+ var parsedStackResults;
1598
+ var lastKeysCount;
1599
+ var cachedFilenameDebugIds;
1600
+ function getFilenameToDebugIdMap(stackParser) {
1601
+ const debugIdMap = GLOBAL_OBJ._sentryDebugIds;
1602
+ if (!debugIdMap) return {};
1603
+ const debugIdKeys = Object.keys(debugIdMap);
1604
+ if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) return cachedFilenameDebugIds;
1605
+ lastKeysCount = debugIdKeys.length;
1606
+ cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => {
1607
+ if (!parsedStackResults) parsedStackResults = {};
1608
+ const result = parsedStackResults[stackKey];
1609
+ if (result) acc[result[0]] = result[1];
1610
+ else {
1611
+ const parsedStack = stackParser(stackKey);
1612
+ for (let i = parsedStack.length - 1; i >= 0; i--) {
1613
+ const filename = parsedStack[i]?.filename;
1614
+ const debugId = debugIdMap[stackKey];
1615
+ if (filename && debugId) {
1616
+ acc[filename] = debugId;
1617
+ parsedStackResults[stackKey] = [filename, debugId];
1618
+ break;
1619
+ }
1620
+ }
1621
+ }
1622
+ return acc;
1623
+ }, {});
1624
+ return cachedFilenameDebugIds;
1625
+ }
1626
+ function prepareEvent(options, event, hint, scope, client, isolationScope) {
1627
+ const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options;
1628
+ const prepared = {
1629
+ ...event,
1630
+ event_id: event.event_id || hint.event_id || uuid4(),
1631
+ timestamp: event.timestamp || dateTimestampInSeconds()
1632
+ };
1633
+ const integrations = hint.integrations || options.integrations.map((i) => i.name);
1634
+ applyClientOptions(prepared, options);
1635
+ applyIntegrationsMetadata(prepared, integrations);
1636
+ if (client) client.emit("applyFrameMetadata", event);
1637
+ if (event.type === void 0) applyDebugIds(prepared, options.stackParser);
1638
+ const finalScope = getFinalScope(scope, hint.captureContext);
1639
+ if (hint.mechanism) addExceptionMechanism(prepared, hint.mechanism);
1640
+ const clientEventProcessors = client ? client.getEventProcessors() : [];
1641
+ const data = getGlobalScope().getScopeData();
1642
+ if (isolationScope) mergeScopeData(data, isolationScope.getScopeData());
1643
+ if (finalScope) mergeScopeData(data, finalScope.getScopeData());
1644
+ const attachments = [...hint.attachments || [], ...data.attachments];
1645
+ if (attachments.length) hint.attachments = attachments;
1646
+ applyScopeDataToEvent(prepared, data);
1647
+ return notifyEventProcessors([...clientEventProcessors, ...data.eventProcessors], prepared, hint).then((evt) => {
1648
+ if (evt) applyDebugMeta(evt);
1649
+ if (typeof normalizeDepth === "number" && normalizeDepth > 0) return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
1650
+ return evt;
1651
+ });
1652
+ }
1653
+ function applyClientOptions(event, options) {
1654
+ const { environment, release, dist, maxValueLength = 250 } = options;
1655
+ event.environment = event.environment || environment || "production";
1656
+ if (!event.release && release) event.release = release;
1657
+ if (!event.dist && dist) event.dist = dist;
1658
+ const request = event.request;
1659
+ if (request?.url) request.url = truncate(request.url, maxValueLength);
1660
+ }
1661
+ function applyDebugIds(event, stackParser) {
1662
+ const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);
1663
+ event.exception?.values?.forEach((exception) => {
1664
+ exception.stacktrace?.frames?.forEach((frame) => {
1665
+ if (frame.filename) frame.debug_id = filenameDebugIdMap[frame.filename];
1666
+ });
1667
+ });
1668
+ }
1669
+ function applyDebugMeta(event) {
1670
+ const filenameDebugIdMap = {};
1671
+ event.exception?.values?.forEach((exception) => {
1672
+ exception.stacktrace?.frames?.forEach((frame) => {
1673
+ if (frame.debug_id) {
1674
+ if (frame.abs_path) filenameDebugIdMap[frame.abs_path] = frame.debug_id;
1675
+ else if (frame.filename) filenameDebugIdMap[frame.filename] = frame.debug_id;
1676
+ delete frame.debug_id;
1677
+ }
1678
+ });
1679
+ });
1680
+ if (Object.keys(filenameDebugIdMap).length === 0) return;
1681
+ event.debug_meta = event.debug_meta || {};
1682
+ event.debug_meta.images = event.debug_meta.images || [];
1683
+ const images = event.debug_meta.images;
1684
+ Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {
1685
+ images.push({
1686
+ type: "sourcemap",
1687
+ code_file: filename,
1688
+ debug_id
1689
+ });
1690
+ });
1691
+ }
1692
+ function applyIntegrationsMetadata(event, integrationNames) {
1693
+ if (integrationNames.length > 0) {
1694
+ event.sdk = event.sdk || {};
1695
+ event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames];
1696
+ }
1697
+ }
1698
+ function normalizeEvent(event, depth, maxBreadth) {
1699
+ if (!event) return null;
1700
+ const normalized = {
1701
+ ...event,
1702
+ ...event.breadcrumbs && { breadcrumbs: event.breadcrumbs.map((b) => ({
1703
+ ...b,
1704
+ ...b.data && { data: normalize(b.data, depth, maxBreadth) }
1705
+ })) },
1706
+ ...event.user && { user: normalize(event.user, depth, maxBreadth) },
1707
+ ...event.contexts && { contexts: normalize(event.contexts, depth, maxBreadth) },
1708
+ ...event.extra && { extra: normalize(event.extra, depth, maxBreadth) }
1709
+ };
1710
+ if (event.contexts?.trace && normalized.contexts) {
1711
+ normalized.contexts.trace = event.contexts.trace;
1712
+ if (event.contexts.trace.data) normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);
1713
+ }
1714
+ if (event.spans) normalized.spans = event.spans.map((span) => {
1715
+ return {
1716
+ ...span,
1717
+ ...span.data && { data: normalize(span.data, depth, maxBreadth) }
1718
+ };
1719
+ });
1720
+ if (event.contexts?.flags && normalized.contexts) normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth);
1721
+ return normalized;
1722
+ }
1723
+ function getFinalScope(scope, captureContext) {
1724
+ if (!captureContext) return scope;
1725
+ const finalScope = scope ? scope.clone() : new Scope();
1726
+ finalScope.update(captureContext);
1727
+ return finalScope;
1728
+ }
1729
+ function parseEventHintOrCaptureContext(hint) {
1730
+ if (!hint) return;
1731
+ if (hintIsScopeOrFunction(hint)) return { captureContext: hint };
1732
+ if (hintIsScopeContext(hint)) return { captureContext: hint };
1733
+ return hint;
1734
+ }
1735
+ function hintIsScopeOrFunction(hint) {
1736
+ return hint instanceof Scope || typeof hint === "function";
1737
+ }
1738
+ var captureContextKeys = [
1739
+ "user",
1740
+ "level",
1741
+ "extra",
1742
+ "contexts",
1743
+ "tags",
1744
+ "fingerprint",
1745
+ "propagationContext"
1746
+ ];
1747
+ function hintIsScopeContext(hint) {
1748
+ return Object.keys(hint).some((key) => captureContextKeys.includes(key));
1749
+ }
1750
+ function captureException(exception, hint) {
1751
+ return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));
1752
+ }
1753
+ function captureMessage(message, captureContext) {
1754
+ const level = typeof captureContext === "string" ? captureContext : void 0;
1755
+ const context = typeof captureContext !== "string" ? { captureContext } : void 0;
1756
+ return getCurrentScope().captureMessage(message, level, context);
1757
+ }
1758
+ function captureEvent(event, hint) {
1759
+ return getCurrentScope().captureEvent(event, hint);
1760
+ }
1761
+ function setTag(key, value) {
1762
+ getIsolationScope().setTag(key, value);
1763
+ }
1764
+ function startSession(context) {
1765
+ const isolationScope = getIsolationScope();
1766
+ const currentScope = getCurrentScope();
1767
+ const { userAgent } = GLOBAL_OBJ.navigator || {};
1768
+ const session = makeSession({
1769
+ user: currentScope.getUser() || isolationScope.getUser(),
1770
+ ...userAgent && { userAgent },
1771
+ ...context
1772
+ });
1773
+ const currentSession = isolationScope.getSession();
1774
+ if (currentSession?.status === "ok") updateSession(currentSession, { status: "exited" });
1775
+ endSession();
1776
+ isolationScope.setSession(session);
1777
+ return session;
1778
+ }
1779
+ function endSession() {
1780
+ const isolationScope = getIsolationScope();
1781
+ const session = getCurrentScope().getSession() || isolationScope.getSession();
1782
+ if (session) closeSession(session);
1783
+ _sendSessionUpdate();
1784
+ isolationScope.setSession();
1785
+ }
1786
+ function _sendSessionUpdate() {
1787
+ const isolationScope = getIsolationScope();
1788
+ const client = getClient();
1789
+ const session = isolationScope.getSession();
1790
+ if (session && client) client.captureSession(session);
1791
+ }
1792
+ function captureSession(end = false) {
1793
+ if (end) {
1794
+ endSession();
1795
+ return;
1796
+ }
1797
+ _sendSessionUpdate();
1798
+ }
1799
+ export { generateTraceId as $, spanTimeInputToSeconds as A, isThenable as At, SEMANTIC_ATTRIBUTE_SENTRY_OP as B, getGlobalSingleton as Bt, convertSpanLinksForEnvelope as C, isEvent as Ct, getStatusMessage as D, isPrimitive as Dt, getSpanDescendants as E, isPlainObject as Et, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME as F, stackParserFromStackParserOptions as Ft, getCurrentScope as G, DEBUG_BUILD as Gt, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE as H, getSentryCarrier as Ht, SEMANTIC_ATTRIBUTE_PROFILE_ID as I, CONSOLE_LEVELS as It, withScope as J, getIsolationScope as K, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME as L, consoleSandbox as Lt, spanToTransactionTraceContext as M, createStackParser as Mt, getCapturedScopesOnSpan as N, getFramesFromEvent as Nt, showSpanDropWarning as O, isRequest as Ot, setCapturedScopesOnSpan as P, getFunctionName as Pt, generateSpanId as Q, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT as R, debug as Rt, addChildSpanToSpan as S, isErrorEvent as St, getRootSpan as T, isParameterizedString as Tt, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE as U, SDK_VERSION as Ut, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN as V, getMainCarrier as Vt, getClient as W, GLOBAL_OBJ as Wt, _getSpanForScope as X, getAsyncContextStrategy as Y, _setSpanForScope as Z, makeDsn as _, getLocationHref as _t, setTag as a, addExceptionTypeValue as at, TRACE_FLAG_NONE as b, isDOMException as bt, SyncPromise as c, uuid4 as ct, normalize as d, fill as dt, merge as et, normalizeToSize as f, getOriginalFunction as ft, dsnToString as g, getComponentName as gt, getDynamicSamplingContextFromSpan as h, stringMatchesSomePattern as ht, captureSession as i, addExceptionMechanism as it, spanToJSON as j, UNKNOWN_FUNCTION as jt, spanIsSampled as k, isString as kt, rejectedSyncPromise as l, addNonEnumerableProperty as lt, getDynamicSamplingContextFromScope as m, safeJoin as mt, captureException as n, dateTimestampInSeconds as nt, startSession as o, checkOrSetAlreadyCaught as ot, freezeDscOnSpan as p, markFunctionWrapped as pt, getTraceContextFromScope as q, captureMessage as r, timestampInSeconds as rt, prepareEvent as s, getEventDescription as st, captureEvent as t, updateSession as tt, resolvedSyncPromise as u, extractExceptionKeysForMessage as ut, DEFAULT_ENVIRONMENT as v, htmlTreeAsString as vt, getActiveSpan as w, isInstanceOf as wt, TRACE_FLAG_SAMPLED as x, isError as xt, hasSpansEnabled as y, isDOMError as yt, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE as z, originalConsoleMethods as zt };