@inventreedb/ui 0.10.1 → 0.11.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 (184) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/.vite/manifest.json +444 -1
  3. package/dist/components/Boundary.d.ts +10 -0
  4. package/dist/components/Boundary.js +37 -0
  5. package/dist/components/Boundary.js.map +1 -0
  6. package/dist/components/CopyButton.d.ts +13 -0
  7. package/dist/components/CopyButton.js +51 -0
  8. package/dist/components/CopyButton.js.map +1 -0
  9. package/dist/components/CopyableCell.d.ts +11 -0
  10. package/dist/components/CopyableCell.js +24 -0
  11. package/dist/components/CopyableCell.js.map +1 -0
  12. package/dist/components/InvenTreeTable.d.ts +17 -0
  13. package/dist/components/InvenTreeTable.js +41 -0
  14. package/dist/components/InvenTreeTable.js.map +1 -0
  15. package/dist/components/TableColumnSelect.d.ts +4 -0
  16. package/dist/components/TableColumnSelect.js +38 -0
  17. package/dist/components/TableColumnSelect.js.map +1 -0
  18. package/dist/enums/ApiEndpoints.d.ts +1 -1
  19. package/dist/enums/ApiEndpoints.js +1 -1
  20. package/dist/enums/ApiEndpoints.js.map +1 -1
  21. package/dist/enums/ModelInformation.js +17 -0
  22. package/dist/enums/ModelInformation.js.map +1 -1
  23. package/dist/enums/ModelType.d.ts +1 -0
  24. package/dist/enums/ModelType.js +1 -0
  25. package/dist/enums/ModelType.js.map +1 -1
  26. package/dist/functions/Forms.d.ts +11 -0
  27. package/dist/functions/Forms.js +27 -0
  28. package/dist/functions/Forms.js.map +1 -0
  29. package/dist/functions/Notification.d.ts +16 -0
  30. package/dist/functions/Notification.js +82 -0
  31. package/dist/functions/Notification.js.map +1 -0
  32. package/dist/functions/String.d.ts +13 -0
  33. package/dist/functions/String.js +25 -0
  34. package/dist/functions/String.js.map +1 -0
  35. package/dist/hooks/UseFilterSet.d.ts +2 -0
  36. package/dist/hooks/UseFilterSet.js +35 -0
  37. package/dist/hooks/UseFilterSet.js.map +1 -0
  38. package/dist/hooks/UseTable.d.ts +12 -0
  39. package/dist/hooks/UseTable.js +92 -0
  40. package/dist/hooks/UseTable.js.map +1 -0
  41. package/dist/index.d.ts +13 -2
  42. package/dist/index.js +32 -4
  43. package/dist/index.js.map +1 -1
  44. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/create-storage.js +129 -0
  45. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/create-storage.js.map +1 -0
  46. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.js +8 -0
  47. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.js.map +1 -0
  48. package/dist/node_modules/@mantine/hooks/esm/use-window-event/use-window-event.js +11 -0
  49. package/dist/node_modules/@mantine/hooks/esm/use-window-event/use-window-event.js.map +1 -0
  50. package/dist/node_modules/@mantine/hooks/esm/utils/random-id/random-id.js +7 -0
  51. package/dist/node_modules/@mantine/hooks/esm/utils/random-id/random-id.js.map +1 -0
  52. package/dist/node_modules/@remix-run/router/dist/router.js +272 -0
  53. package/dist/node_modules/@remix-run/router/dist/router.js.map +1 -0
  54. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/debug-build.js +5 -0
  55. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/debug-build.js.map +1 -0
  56. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/helpers.js +6 -0
  57. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/helpers.js.map +1 -0
  58. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/report-dialog.js +54 -0
  59. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/report-dialog.js.map +1 -0
  60. package/dist/node_modules/@sentry/core/build/esm/api.js +41 -0
  61. package/dist/node_modules/@sentry/core/build/esm/api.js.map +1 -0
  62. package/dist/node_modules/@sentry/core/build/esm/asyncContext/index.js +13 -0
  63. package/dist/node_modules/@sentry/core/build/esm/asyncContext/index.js.map +1 -0
  64. package/dist/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js +124 -0
  65. package/dist/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js.map +1 -0
  66. package/dist/node_modules/@sentry/core/build/esm/carrier.js +22 -0
  67. package/dist/node_modules/@sentry/core/build/esm/carrier.js.map +1 -0
  68. package/dist/node_modules/@sentry/core/build/esm/currentScopes.js +34 -0
  69. package/dist/node_modules/@sentry/core/build/esm/currentScopes.js.map +1 -0
  70. package/dist/node_modules/@sentry/core/build/esm/debug-build.js +5 -0
  71. package/dist/node_modules/@sentry/core/build/esm/debug-build.js.map +1 -0
  72. package/dist/node_modules/@sentry/core/build/esm/defaultScopes.js +13 -0
  73. package/dist/node_modules/@sentry/core/build/esm/defaultScopes.js.map +1 -0
  74. package/dist/node_modules/@sentry/core/build/esm/exports.js +13 -0
  75. package/dist/node_modules/@sentry/core/build/esm/exports.js.map +1 -0
  76. package/dist/node_modules/@sentry/core/build/esm/scope.js +577 -0
  77. package/dist/node_modules/@sentry/core/build/esm/scope.js.map +1 -0
  78. package/dist/node_modules/@sentry/core/build/esm/session.js +61 -0
  79. package/dist/node_modules/@sentry/core/build/esm/session.js.map +1 -0
  80. package/dist/node_modules/@sentry/core/build/esm/utils/chain-and-copy-promiselike.js +39 -0
  81. package/dist/node_modules/@sentry/core/build/esm/utils/chain-and-copy-promiselike.js.map +1 -0
  82. package/dist/node_modules/@sentry/core/build/esm/utils/debug-logger.js +79 -0
  83. package/dist/node_modules/@sentry/core/build/esm/utils/debug-logger.js.map +1 -0
  84. package/dist/node_modules/@sentry/core/build/esm/utils/dsn.js +88 -0
  85. package/dist/node_modules/@sentry/core/build/esm/utils/dsn.js.map +1 -0
  86. package/dist/node_modules/@sentry/core/build/esm/utils/is.js +35 -0
  87. package/dist/node_modules/@sentry/core/build/esm/utils/is.js.map +1 -0
  88. package/dist/node_modules/@sentry/core/build/esm/utils/merge.js +19 -0
  89. package/dist/node_modules/@sentry/core/build/esm/utils/merge.js.map +1 -0
  90. package/dist/node_modules/@sentry/core/build/esm/utils/misc.js +32 -0
  91. package/dist/node_modules/@sentry/core/build/esm/utils/misc.js.map +1 -0
  92. package/dist/node_modules/@sentry/core/build/esm/utils/object.js +18 -0
  93. package/dist/node_modules/@sentry/core/build/esm/utils/object.js.map +1 -0
  94. package/dist/node_modules/@sentry/core/build/esm/utils/prepareEvent.js +34 -0
  95. package/dist/node_modules/@sentry/core/build/esm/utils/prepareEvent.js.map +1 -0
  96. package/dist/node_modules/@sentry/core/build/esm/utils/propagationContext.js +8 -0
  97. package/dist/node_modules/@sentry/core/build/esm/utils/propagationContext.js.map +1 -0
  98. package/dist/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js +27 -0
  99. package/dist/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js.map +1 -0
  100. package/dist/node_modules/@sentry/core/build/esm/utils/spanOnScope.js +17 -0
  101. package/dist/node_modules/@sentry/core/build/esm/utils/spanOnScope.js.map +1 -0
  102. package/dist/node_modules/@sentry/core/build/esm/utils/string.js +10 -0
  103. package/dist/node_modules/@sentry/core/build/esm/utils/string.js.map +1 -0
  104. package/dist/node_modules/@sentry/core/build/esm/utils/time.js +26 -0
  105. package/dist/node_modules/@sentry/core/build/esm/utils/time.js.map +1 -0
  106. package/dist/node_modules/@sentry/core/build/esm/utils/version.js +5 -0
  107. package/dist/node_modules/@sentry/core/build/esm/utils/version.js.map +1 -0
  108. package/dist/node_modules/@sentry/core/build/esm/utils/worldwide.js +5 -0
  109. package/dist/node_modules/@sentry/core/build/esm/utils/worldwide.js.map +1 -0
  110. package/dist/node_modules/@sentry/react/build/esm/debug-build.js +5 -0
  111. package/dist/node_modules/@sentry/react/build/esm/debug-build.js.map +1 -0
  112. package/dist/node_modules/@sentry/react/build/esm/error.js +40 -0
  113. package/dist/node_modules/@sentry/react/build/esm/error.js.map +1 -0
  114. package/dist/node_modules/@sentry/react/build/esm/errorboundary.js +103 -0
  115. package/dist/node_modules/@sentry/react/build/esm/errorboundary.js.map +1 -0
  116. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -6
  117. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js.map +1 -1
  118. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -6
  119. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js.map +1 -1
  120. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustments.js +8 -0
  121. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustments.js.map +1 -0
  122. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -6
  123. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js.map +1 -1
  124. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +8 -0
  125. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js.map +1 -0
  126. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js +0 -6
  127. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js.map +1 -1
  128. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js +0 -6
  129. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js.map +1 -1
  130. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -6
  131. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js.map +1 -1
  132. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js +0 -6
  133. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js.map +1 -1
  134. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js +0 -6
  135. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js.map +1 -1
  136. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js +0 -6
  137. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js.map +1 -1
  138. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js +0 -6
  139. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js.map +1 -1
  140. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -6
  141. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js.map +1 -1
  142. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +0 -6
  143. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js.map +1 -1
  144. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +1 -10
  145. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
  146. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +1 -10
  147. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -1
  148. package/dist/node_modules/react-router/dist/index.js +377 -0
  149. package/dist/node_modules/react-router/dist/index.js.map +1 -0
  150. package/dist/node_modules/react-router-dom/dist/index.js +560 -0
  151. package/dist/node_modules/react-router-dom/dist/index.js.map +1 -0
  152. package/dist/node_modules/zustand/esm/middleware.js +202 -0
  153. package/dist/node_modules/zustand/esm/middleware.js.map +1 -0
  154. package/dist/node_modules/zustand/esm/react.js +24 -0
  155. package/dist/node_modules/zustand/esm/react.js.map +1 -0
  156. package/dist/node_modules/zustand/esm/vanilla.js +26 -0
  157. package/dist/node_modules/zustand/esm/vanilla.js.map +1 -0
  158. package/dist/states/StoredTableState.d.ts +37 -0
  159. package/dist/states/StoredTableState.js +58 -0
  160. package/dist/states/StoredTableState.js.map +1 -0
  161. package/dist/types/Forms.d.ts +2 -0
  162. package/dist/types/Plugins.d.ts +14 -7
  163. package/dist/types/Plugins.js +1 -1
  164. package/dist/types/Plugins.js.map +1 -1
  165. package/dist/types/Tables.d.ts +10 -0
  166. package/lib/components/Boundary.tsx +46 -0
  167. package/lib/components/CopyButton.tsx +76 -0
  168. package/lib/components/CopyableCell.tsx +51 -0
  169. package/lib/components/InvenTreeTable.tsx +63 -0
  170. package/lib/components/TableColumnSelect.tsx +40 -0
  171. package/lib/enums/ApiEndpoints.tsx +1 -1
  172. package/lib/enums/ModelInformation.tsx +7 -0
  173. package/lib/enums/ModelType.tsx +1 -0
  174. package/lib/functions/Forms.tsx +47 -0
  175. package/lib/functions/Notification.tsx +50 -0
  176. package/lib/functions/String.tsx +38 -0
  177. package/lib/hooks/UseFilterSet.tsx +47 -0
  178. package/lib/hooks/UseTable.tsx +160 -0
  179. package/lib/index.ts +49 -1
  180. package/lib/states/StoredTableState.tsx +91 -0
  181. package/lib/types/Forms.tsx +2 -0
  182. package/lib/types/Plugins.tsx +15 -7
  183. package/lib/types/Tables.tsx +11 -0
  184. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sources":["../../../../../../node_modules/@sentry/core/build/esm/session.js"],"sourcesContent":["import { uuid4 } from './utils/misc.js';\nimport { timestampInSeconds } from './utils/time.js';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see Client.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return {\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n };\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n"],"names":[],"mappings":";;AA8CA,SAAS,cAAc,SAAS,UAAU,IAAI;AAC5C,MAAI,QAAQ,MAAM;AAChB,QAAI,CAAC,QAAQ,aAAa,QAAQ,KAAK,YAAY;AACjD,cAAQ,YAAY,QAAQ,KAAK;AAAA,IACnC;AAEA,QAAI,CAAC,QAAQ,OAAO,CAAC,QAAQ,KAAK;AAChC,cAAQ,MAAM,QAAQ,KAAK,MAAM,QAAQ,KAAK,SAAS,QAAQ,KAAK;AAAA,IACtE;AAAA,EACF;AAEA,UAAQ,YAAY,QAAQ,aAAa,mBAAkB;AAE3D,MAAI,QAAQ,oBAAoB;AAC9B,YAAQ,qBAAqB,QAAQ;AAAA,EACvC;AAEA,MAAI,QAAQ,gBAAgB;AAC1B,YAAQ,iBAAiB,QAAQ;AAAA,EACnC;AACA,MAAI,QAAQ,KAAK;AAEf,YAAQ,MAAM,QAAQ,IAAI,WAAW,KAAK,QAAQ,MAAM,MAAK;AAAA,EAC/D;AACA,MAAI,QAAQ,SAAS,QAAW;AAC9B,YAAQ,OAAO,QAAQ;AAAA,EACzB;AACA,MAAI,CAAC,QAAQ,OAAO,QAAQ,KAAK;AAC/B,YAAQ,MAAM,GAAG,QAAQ,GAAG;AAAA,EAC9B;AACA,MAAI,OAAO,QAAQ,YAAY,UAAU;AACvC,YAAQ,UAAU,QAAQ;AAAA,EAC5B;AACA,MAAI,QAAQ,gBAAgB;AAC1B,YAAQ,WAAW;AAAA,EACrB,WAAW,OAAO,QAAQ,aAAa,UAAU;AAC/C,YAAQ,WAAW,QAAQ;AAAA,EAC7B,OAAO;AACL,UAAM,WAAW,QAAQ,YAAY,QAAQ;AAC7C,YAAQ,WAAW,YAAY,IAAI,WAAW;AAAA,EAChD;AACA,MAAI,QAAQ,SAAS;AACnB,YAAQ,UAAU,QAAQ;AAAA,EAC5B;AACA,MAAI,QAAQ,aAAa;AACvB,YAAQ,cAAc,QAAQ;AAAA,EAChC;AACA,MAAI,CAAC,QAAQ,aAAa,QAAQ,WAAW;AAC3C,YAAQ,YAAY,QAAQ;AAAA,EAC9B;AACA,MAAI,CAAC,QAAQ,aAAa,QAAQ,WAAW;AAC3C,YAAQ,YAAY,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,QAAQ,WAAW,UAAU;AACtC,YAAQ,SAAS,QAAQ;AAAA,EAC3B;AACA,MAAI,QAAQ,QAAQ;AAClB,YAAQ,SAAS,QAAQ;AAAA,EAC3B;AACF;","x_google_ignoreList":[0]}
@@ -0,0 +1,39 @@
1
+ const isActualPromise = (p) => p instanceof Promise && !p[kChainedCopy];
2
+ const kChainedCopy = /* @__PURE__ */ Symbol("chained PromiseLike");
3
+ const chainAndCopyPromiseLike = (original, onSuccess, onError) => {
4
+ const chained = original.then(
5
+ (value) => {
6
+ onSuccess(value);
7
+ return value;
8
+ },
9
+ (err) => {
10
+ onError(err);
11
+ throw err;
12
+ }
13
+ );
14
+ return isActualPromise(chained) && isActualPromise(original) ? chained : copyProps(original, chained);
15
+ };
16
+ const copyProps = (original, chained) => {
17
+ let mutated = false;
18
+ for (const key in original) {
19
+ if (key in chained) continue;
20
+ mutated = true;
21
+ const value = original[key];
22
+ if (typeof value === "function") {
23
+ Object.defineProperty(chained, key, {
24
+ value: (...args) => value.apply(original, args),
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true
28
+ });
29
+ } else {
30
+ chained[key] = value;
31
+ }
32
+ }
33
+ if (mutated) Object.assign(chained, { [kChainedCopy]: true });
34
+ return chained;
35
+ };
36
+ export {
37
+ chainAndCopyPromiseLike
38
+ };
39
+ //# sourceMappingURL=chain-and-copy-promiselike.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain-and-copy-promiselike.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/chain-and-copy-promiselike.js"],"sourcesContent":["const isActualPromise = (p) =>\n p instanceof Promise && !(p )[kChainedCopy];\n\nconst kChainedCopy = Symbol('chained PromiseLike');\n\n/**\n * Copy the properties from a decorated promiselike object onto its chained\n * actual promise.\n */\nconst chainAndCopyPromiseLike = (\n original,\n onSuccess,\n onError,\n) => {\n const chained = original.then(\n value => {\n onSuccess(value);\n return value;\n },\n err => {\n onError(err);\n throw err;\n },\n ) ;\n\n // if we're just dealing with \"normal\" Promise objects, return the chain\n return isActualPromise(chained) && isActualPromise(original) ? chained : copyProps(original, chained);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst copyProps = (original, chained) => {\n let mutated = false;\n //oxlint-disable-next-line guard-for-in\n for (const key in original) {\n if (key in chained) continue;\n mutated = true;\n const value = original[key];\n if (typeof value === 'function') {\n Object.defineProperty(chained, key, {\n value: (...args) => value.apply(original, args),\n enumerable: true,\n configurable: true,\n writable: true,\n });\n } else {\n (chained )[key] = value;\n }\n }\n\n if (mutated) Object.assign(chained, { [kChainedCopy]: true });\n return chained;\n};\n\nexport { chainAndCopyPromiseLike };\n//# sourceMappingURL=chain-and-copy-promiselike.js.map\n"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,CAAC,MACvB,aAAa,WAAW,CAAE,EAAI,YAAY;AAE5C,MAAM,eAAe,uBAAO,qBAAqB;AAM5C,MAAC,0BAA0B,CAC9B,UACA,WACA,YACG;AACH,QAAM,UAAU,SAAS;AAAA,IACvB,WAAS;AACP,gBAAU,KAAK;AACf,aAAO;AAAA,IACT;AAAA,IACA,SAAO;AACL,cAAQ,GAAG;AACX,YAAM;AAAA,IACR;AAAA,EACJ;AAGE,SAAO,gBAAgB,OAAO,KAAK,gBAAgB,QAAQ,IAAI,UAAU,UAAU,UAAU,OAAO;AACtG;AAGA,MAAM,YAAY,CAAC,UAAU,YAAY;AACvC,MAAI,UAAU;AAEd,aAAW,OAAO,UAAU;AAC1B,QAAI,OAAO,QAAS;AACpB,cAAU;AACV,UAAM,QAAQ,SAAS,GAAG;AAC1B,QAAI,OAAO,UAAU,YAAY;AAC/B,aAAO,eAAe,SAAS,KAAK;AAAA,QAClC,OAAO,IAAI,SAAS,MAAM,MAAM,UAAU,IAAI;AAAA,QAC9C,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,UAAU;AAAA,MAClB,CAAO;AAAA,IACH,OAAO;AACL,MAAC,QAAU,GAAG,IAAI;AAAA,IACpB;AAAA,EACF;AAEA,MAAI,QAAS,QAAO,OAAO,SAAS,EAAE,CAAC,YAAY,GAAG,MAAM;AAC5D,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,79 @@
1
+ import { getGlobalSingleton } from "../carrier.js";
2
+ import { DEBUG_BUILD } from "../debug-build.js";
3
+ import { GLOBAL_OBJ } from "./worldwide.js";
4
+ const PREFIX = "Sentry Logger ";
5
+ const originalConsoleMethods = {};
6
+ function consoleSandbox(callback) {
7
+ if (!("console" in GLOBAL_OBJ)) {
8
+ return callback();
9
+ }
10
+ const console = GLOBAL_OBJ.console;
11
+ const wrappedFuncs = {};
12
+ const wrappedLevels = Object.keys(originalConsoleMethods);
13
+ wrappedLevels.forEach((level) => {
14
+ const originalConsoleMethod = originalConsoleMethods[level];
15
+ wrappedFuncs[level] = console[level];
16
+ console[level] = originalConsoleMethod;
17
+ });
18
+ try {
19
+ return callback();
20
+ } finally {
21
+ wrappedLevels.forEach((level) => {
22
+ console[level] = wrappedFuncs[level];
23
+ });
24
+ }
25
+ }
26
+ function enable() {
27
+ _getLoggerSettings().enabled = true;
28
+ }
29
+ function disable() {
30
+ _getLoggerSettings().enabled = false;
31
+ }
32
+ function isEnabled() {
33
+ return _getLoggerSettings().enabled;
34
+ }
35
+ function log(...args) {
36
+ _maybeLog("log", ...args);
37
+ }
38
+ function warn(...args) {
39
+ _maybeLog("warn", ...args);
40
+ }
41
+ function error(...args) {
42
+ _maybeLog("error", ...args);
43
+ }
44
+ function _maybeLog(level, ...args) {
45
+ if (!DEBUG_BUILD) {
46
+ return;
47
+ }
48
+ if (isEnabled()) {
49
+ consoleSandbox(() => {
50
+ GLOBAL_OBJ.console[level](`${PREFIX}[${level}]:`, ...args);
51
+ });
52
+ }
53
+ }
54
+ function _getLoggerSettings() {
55
+ if (!DEBUG_BUILD) {
56
+ return { enabled: false };
57
+ }
58
+ return getGlobalSingleton("loggerSettings", () => ({ enabled: false }));
59
+ }
60
+ const debug = {
61
+ /** Enable logging. */
62
+ enable,
63
+ /** Disable logging. */
64
+ disable,
65
+ /** Check if logging is enabled. */
66
+ isEnabled,
67
+ /** Log a message. */
68
+ log,
69
+ /** Log a warning. */
70
+ warn,
71
+ /** Log an error. */
72
+ error
73
+ };
74
+ export {
75
+ consoleSandbox,
76
+ debug,
77
+ originalConsoleMethods
78
+ };
79
+ //# sourceMappingURL=debug-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-logger.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/debug-logger.js"],"sourcesContent":["import { getGlobalSingleton } from '../carrier.js';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level];\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod ;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction enable() {\n _getLoggerSettings().enabled = true;\n}\n\nfunction disable() {\n _getLoggerSettings().enabled = false;\n}\n\nfunction isEnabled() {\n return _getLoggerSettings().enabled;\n}\n\nfunction log(...args) {\n _maybeLog('log', ...args);\n}\n\nfunction warn(...args) {\n _maybeLog('warn', ...args);\n}\n\nfunction error(...args) {\n _maybeLog('error', ...args);\n}\n\nfunction _maybeLog(level, ...args) {\n if (!DEBUG_BUILD) {\n return;\n }\n\n if (isEnabled()) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[level](`${PREFIX}[${level}]:`, ...args);\n });\n }\n}\n\nfunction _getLoggerSettings() {\n if (!DEBUG_BUILD) {\n return { enabled: false };\n }\n\n return getGlobalSingleton('loggerSettings', () => ({ enabled: false }));\n}\n\n/**\n * This is a logger singleton which either logs things or no-ops if logging is not enabled.\n */\nconst debug = {\n /** Enable logging. */\n enable,\n /** Disable logging. */\n disable,\n /** Check if logging is enabled. */\n isEnabled,\n /** Log a message. */\n log,\n /** Log a warning. */\n warn,\n /** Log an error. */\n error,\n} ;\n\nexport { CONSOLE_LEVELS, consoleSandbox, debug, originalConsoleMethods };\n//# sourceMappingURL=debug-logger.js.map\n"],"names":[],"mappings":";;;AAeA,MAAM,SAAS;AAGV,MAAC,yBAEH,CAAA;AAQH,SAAS,eAAe,UAAU;AAChC,MAAI,EAAE,aAAa,aAAa;AAC9B,WAAO,SAAQ;AAAA,EACjB;AAEA,QAAM,UAAU,WAAW;AAC3B,QAAM,eAAe,CAAA;AAErB,QAAM,gBAAgB,OAAO,KAAK,sBAAsB;AAGxD,gBAAc,QAAQ,WAAS;AAC7B,UAAM,wBAAwB,uBAAuB,KAAK;AAC1D,iBAAa,KAAK,IAAI,QAAQ,KAAK;AACnC,YAAQ,KAAK,IAAI;AAAA,EACnB,CAAC;AAED,MAAI;AACF,WAAO,SAAQ;AAAA,EACjB,UAAC;AAEC,kBAAc,QAAQ,WAAS;AAC7B,cAAQ,KAAK,IAAI,aAAa,KAAK;AAAA,IACrC,CAAC;AAAA,EACH;AACF;AAEA,SAAS,SAAS;AAChB,qBAAkB,EAAG,UAAU;AACjC;AAEA,SAAS,UAAU;AACjB,qBAAkB,EAAG,UAAU;AACjC;AAEA,SAAS,YAAY;AACnB,SAAO,mBAAkB,EAAG;AAC9B;AAEA,SAAS,OAAO,MAAM;AACpB,YAAU,OAAO,GAAG,IAAI;AAC1B;AAEA,SAAS,QAAQ,MAAM;AACrB,YAAU,QAAQ,GAAG,IAAI;AAC3B;AAEA,SAAS,SAAS,MAAM;AACtB,YAAU,SAAS,GAAG,IAAI;AAC5B;AAEA,SAAS,UAAU,UAAU,MAAM;AACjC,MAAI,CAAC,aAAa;AAChB;AAAA,EACF;AAEA,MAAI,UAAS,GAAI;AACf,mBAAe,MAAM;AACnB,iBAAW,QAAQ,KAAK,EAAE,GAAG,MAAM,IAAI,KAAK,MAAM,GAAG,IAAI;AAAA,IAC3D,CAAC;AAAA,EACH;AACF;AAEA,SAAS,qBAAqB;AAC5B,MAAI,CAAC,aAAa;AAChB,WAAO,EAAE,SAAS,MAAK;AAAA,EACzB;AAEA,SAAO,mBAAmB,kBAAkB,OAAO,EAAE,SAAS,MAAK,EAAG;AACxE;AAKK,MAAC,QAAQ;AAAA;AAAA,EAEZ;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AACF;","x_google_ignoreList":[0]}
@@ -0,0 +1,88 @@
1
+ import { DEBUG_BUILD } from "../debug-build.js";
2
+ import { consoleSandbox, debug } from "./debug-logger.js";
3
+ const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;
4
+ function isValidProtocol(protocol) {
5
+ return protocol === "http" || protocol === "https";
6
+ }
7
+ function dsnToString(dsn, withPassword = false) {
8
+ const { host, path, pass, port, projectId, protocol, publicKey } = dsn;
9
+ return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`;
10
+ }
11
+ function dsnFromString(str) {
12
+ const match = DSN_REGEX.exec(str);
13
+ if (!match) {
14
+ consoleSandbox(() => {
15
+ console.error(`Invalid Sentry Dsn: ${str}`);
16
+ });
17
+ return void 0;
18
+ }
19
+ const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1);
20
+ let path = "";
21
+ let projectId = lastPath;
22
+ const split = projectId.split("/");
23
+ if (split.length > 1) {
24
+ path = split.slice(0, -1).join("/");
25
+ projectId = split.pop();
26
+ }
27
+ if (projectId) {
28
+ const projectMatch = projectId.match(/^\d+/);
29
+ if (projectMatch) {
30
+ projectId = projectMatch[0];
31
+ }
32
+ }
33
+ return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey });
34
+ }
35
+ function dsnFromComponents(components) {
36
+ return {
37
+ protocol: components.protocol,
38
+ publicKey: components.publicKey || "",
39
+ pass: components.pass || "",
40
+ host: components.host,
41
+ port: components.port || "",
42
+ path: components.path || "",
43
+ projectId: components.projectId
44
+ };
45
+ }
46
+ function validateDsn(dsn) {
47
+ if (!DEBUG_BUILD) {
48
+ return true;
49
+ }
50
+ const { port, projectId, protocol } = dsn;
51
+ const requiredComponents = ["protocol", "publicKey", "host", "projectId"];
52
+ const hasMissingRequiredComponent = requiredComponents.find((component) => {
53
+ if (!dsn[component]) {
54
+ debug.error(`Invalid Sentry Dsn: ${component} missing`);
55
+ return true;
56
+ }
57
+ return false;
58
+ });
59
+ if (hasMissingRequiredComponent) {
60
+ return false;
61
+ }
62
+ if (!projectId.match(/^\d+$/)) {
63
+ debug.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
64
+ return false;
65
+ }
66
+ if (!isValidProtocol(protocol)) {
67
+ debug.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
68
+ return false;
69
+ }
70
+ if (port && isNaN(parseInt(port, 10))) {
71
+ debug.error(`Invalid Sentry Dsn: Invalid port ${port}`);
72
+ return false;
73
+ }
74
+ return true;
75
+ }
76
+ function makeDsn(from) {
77
+ const components = typeof from === "string" ? dsnFromString(from) : dsnFromComponents(from);
78
+ if (!components || !validateDsn(components)) {
79
+ return void 0;
80
+ }
81
+ return components;
82
+ }
83
+ export {
84
+ dsnFromString,
85
+ dsnToString,
86
+ makeDsn
87
+ };
88
+ //# sourceMappingURL=dsn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dsn.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/dsn.js"],"sourcesContent":["import { DEBUG_BUILD } from '../debug-build.js';\nimport { consoleSandbox, debug } from './debug-logger.js';\n\n/** Regular expression used to extract org ID from a DSN host. */\nconst ORG_ID_REGEX = /^o(\\d+)\\./;\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)((?:\\[[:.%\\w]+\\]|[\\w.-]+))(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nfunction dsnToString(dsn, withPassword = false) {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nfunction dsnFromString(str) {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host = '', port = '', lastPath = ''] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() ;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });\n}\n\nfunction dsnFromComponents(components) {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn) {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n debug.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n debug.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n debug.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n debug.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Extract the org ID from a DSN host.\n *\n * @param host The host from a DSN\n * @returns The org ID if found, undefined otherwise\n */\nfunction extractOrgIdFromDsnHost(host) {\n const match = host.match(ORG_ID_REGEX);\n\n return match?.[1];\n}\n\n/**\n * Returns the organization ID of the client.\n *\n * The organization ID is extracted from the DSN. If the client options include a `orgId`, this will always take precedence.\n */\nfunction extractOrgIdFromClient(client) {\n const options = client.getOptions();\n\n const { host } = client.getDsn() || {};\n\n let org_id;\n\n if (options.orgId) {\n org_id = String(options.orgId);\n } else if (host) {\n org_id = extractOrgIdFromDsnHost(host);\n }\n\n return org_id;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nfunction makeDsn(from) {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n\nexport { dsnFromString, dsnToString, extractOrgIdFromClient, extractOrgIdFromDsnHost, makeDsn };\n//# sourceMappingURL=dsn.js.map\n"],"names":[],"mappings":";;AAOA,MAAM,YAAY;AAElB,SAAS,gBAAgB,UAAU;AACjC,SAAO,aAAa,UAAU,aAAa;AAC7C;AAWA,SAAS,YAAY,KAAK,eAAe,OAAO;AAC9C,QAAM,EAAE,MAAM,MAAM,MAAM,MAAM,WAAW,UAAU,UAAS,IAAK;AACnE,SACE,GAAG,QAAQ,MAAM,SAAS,GAAG,gBAAgB,OAAO,IAAI,IAAI,KAAK,EAAE,IAC/D,IAAI,GAAG,OAAO,IAAI,IAAI,KAAK,EAAE,IAAI,OAAO,GAAG,IAAI,MAAM,IAAI,GAAG,SAAS;AAE7E;AAQA,SAAS,cAAc,KAAK;AAC1B,QAAM,QAAQ,UAAU,KAAK,GAAG;AAEhC,MAAI,CAAC,OAAO;AAEV,mBAAe,MAAM;AAEnB,cAAQ,MAAM,uBAAuB,GAAG,EAAE;AAAA,IAC5C,CAAC;AACD,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,UAAU,WAAW,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,WAAW,EAAE,IAAI,MAAM,MAAM,CAAC;AAC3F,MAAI,OAAO;AACX,MAAI,YAAY;AAEhB,QAAM,QAAQ,UAAU,MAAM,GAAG;AACjC,MAAI,MAAM,SAAS,GAAG;AACpB,WAAO,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAClC,gBAAY,MAAM,IAAG;AAAA,EACvB;AAEA,MAAI,WAAW;AACb,UAAM,eAAe,UAAU,MAAM,MAAM;AAC3C,QAAI,cAAc;AAChB,kBAAY,aAAa,CAAC;AAAA,IAC5B;AAAA,EACF;AAEA,SAAO,kBAAkB,EAAE,MAAM,MAAM,MAAM,WAAW,MAAM,UAAqB,WAAW;AAChG;AAEA,SAAS,kBAAkB,YAAY;AACrC,SAAO;AAAA,IACL,UAAU,WAAW;AAAA,IACrB,WAAW,WAAW,aAAa;AAAA,IACnC,MAAM,WAAW,QAAQ;AAAA,IACzB,MAAM,WAAW;AAAA,IACjB,MAAM,WAAW,QAAQ;AAAA,IACzB,MAAM,WAAW,QAAQ;AAAA,IACzB,WAAW,WAAW;AAAA,EAC1B;AACA;AAEA,SAAS,YAAY,KAAK;AACxB,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,MAAM,WAAW,SAAQ,IAAK;AAEtC,QAAM,qBAAqB,CAAC,YAAY,aAAa,QAAQ,WAAW;AACxE,QAAM,8BAA8B,mBAAmB,KAAK,eAAa;AACvE,QAAI,CAAC,IAAI,SAAS,GAAG;AACnB,YAAM,MAAM,uBAAuB,SAAS,UAAU;AACtD,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,CAAC;AAED,MAAI,6BAA6B;AAC/B,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,UAAU,MAAM,OAAO,GAAG;AAC7B,UAAM,MAAM,yCAAyC,SAAS,EAAE;AAChE,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,gBAAgB,QAAQ,GAAG;AAC9B,UAAM,MAAM,wCAAwC,QAAQ,EAAE;AAC9D,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,MAAM,SAAS,MAAM,EAAE,CAAC,GAAG;AACrC,UAAM,MAAM,oCAAoC,IAAI,EAAE;AACtD,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAuCA,SAAS,QAAQ,MAAM;AACrB,QAAM,aAAa,OAAO,SAAS,WAAW,cAAc,IAAI,IAAI,kBAAkB,IAAI;AAC1F,MAAI,CAAC,cAAc,CAAC,YAAY,UAAU,GAAG;AAC3C,WAAO;AAAA,EACT;AACA,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,35 @@
1
+ const objectToString = Object.prototype.toString;
2
+ function isError(wat) {
3
+ switch (objectToString.call(wat)) {
4
+ case "[object Error]":
5
+ case "[object Exception]":
6
+ case "[object DOMException]":
7
+ case "[object WebAssembly.Exception]":
8
+ return true;
9
+ default:
10
+ return isInstanceOf(wat, Error);
11
+ }
12
+ }
13
+ function isBuiltin(wat, className) {
14
+ return objectToString.call(wat) === `[object ${className}]`;
15
+ }
16
+ function isPlainObject(wat) {
17
+ return isBuiltin(wat, "Object");
18
+ }
19
+ function isThenable(wat) {
20
+ return Boolean(wat?.then && typeof wat.then === "function");
21
+ }
22
+ function isInstanceOf(wat, base) {
23
+ try {
24
+ return wat instanceof base;
25
+ } catch {
26
+ return false;
27
+ }
28
+ }
29
+ export {
30
+ isError,
31
+ isInstanceOf,
32
+ isPlainObject,
33
+ isThenable
34
+ };
35
+ //# sourceMappingURL=is.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/is.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isError(wat) {\n switch (objectToString.call(wat)) {\n case '[object Error]':\n case '[object Exception]':\n case '[object DOMException]':\n case '[object WebAssembly.Exception]':\n return true;\n default:\n return isInstanceOf(wat, Error);\n }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat, className) {\n return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isErrorEvent(wat) {\n return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMError(wat) {\n return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isDOMException(wat) {\n return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isString(wat) {\n return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given string is parameterized\n * {@link isParameterizedString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isParameterizedString(wat) {\n return (\n typeof wat === 'object' &&\n wat !== null &&\n '__sentry_template_string__' in wat &&\n '__sentry_template_values__' in wat\n );\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPrimitive(wat) {\n return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal, or a class instance.\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isPlainObject(wat) {\n return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isEvent(wat) {\n return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isElement(wat) {\n return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isRegExp(wat) {\n return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nfunction isThenable(wat) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return Boolean(wat?.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isSyntheticEvent(wat) {\n return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\n// TODO: fix in v11, convert any to unknown\n// export function isInstanceOf<T>(wat: unknown, base: { new (...args: any[]): T }): wat is T {\nfunction isInstanceOf(wat, base) {\n try {\n return wat instanceof base;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks whether given value's type is a Vue ViewModel or a VNode.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nfunction isVueViewModel(wat) {\n // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property.\n // We also need to check for __v_isVNode because Vue 3 component render instances have an internal __v_isVNode property.\n return !!(\n typeof wat === 'object' &&\n wat !== null &&\n ((wat ).__isVue || (wat )._isVue || (wat ).__v_isVNode)\n );\n}\n\n/**\n * Checks whether the given parameter is a Standard Web API Request instance.\n *\n * Returns false if Request is not available in the current runtime.\n */\nfunction isRequest(request) {\n return typeof Request !== 'undefined' && isInstanceOf(request, Request);\n}\n\nexport { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isParameterizedString, isPlainObject, isPrimitive, isRegExp, isRequest, isString, isSyntheticEvent, isThenable, isVueViewModel };\n//# sourceMappingURL=is.js.map\n"],"names":[],"mappings":"AACA,MAAM,iBAAiB,OAAO,UAAU;AASxC,SAAS,QAAQ,KAAK;AACpB,UAAQ,eAAe,KAAK,GAAG,GAAC;AAAA,IAC9B,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO,aAAa,KAAK,KAAK;AAAA,EACpC;AACA;AAQA,SAAS,UAAU,KAAK,WAAW;AACjC,SAAO,eAAe,KAAK,GAAG,MAAM,WAAW,SAAS;AAC1D;AAgFA,SAAS,cAAc,KAAK;AAC1B,SAAO,UAAU,KAAK,QAAQ;AAChC;AAuCA,SAAS,WAAW,KAAK;AAEvB,SAAO,QAAQ,KAAK,QAAQ,OAAO,IAAI,SAAS,UAAU;AAC5D;AAuBA,SAAS,aAAa,KAAK,MAAM;AAC/B,MAAI;AACF,WAAO,eAAe;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","x_google_ignoreList":[0]}
@@ -0,0 +1,19 @@
1
+ function merge(initialObj, mergeObj, levels = 2) {
2
+ if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) {
3
+ return mergeObj;
4
+ }
5
+ if (initialObj && Object.keys(mergeObj).length === 0) {
6
+ return initialObj;
7
+ }
8
+ const output = { ...initialObj };
9
+ for (const key in mergeObj) {
10
+ if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {
11
+ output[key] = merge(output[key], mergeObj[key], levels - 1);
12
+ }
13
+ }
14
+ return output;
15
+ }
16
+ export {
17
+ merge
18
+ };
19
+ //# sourceMappingURL=merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/merge.js"],"sourcesContent":["/**\n * Shallow merge two objects.\n * Does not mutate the passed in objects.\n * Undefined/empty values in the merge object will overwrite existing values.\n *\n * By default, this merges 2 levels deep.\n */\nfunction merge(initialObj, mergeObj, levels = 2) {\n // If the merge value is not an object, or we have no merge levels left,\n // we just set the value to the merge value\n if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) {\n return mergeObj;\n }\n\n // If the merge object is an empty object, and the initial object is not undefined, we return the initial object\n if (initialObj && Object.keys(mergeObj).length === 0) {\n return initialObj;\n }\n\n // Clone object\n const output = { ...initialObj };\n\n // Merge values into output, resursively\n for (const key in mergeObj) {\n if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {\n output[key] = merge(output[key], mergeObj[key], levels - 1);\n }\n }\n\n return output;\n}\n\nexport { merge };\n//# sourceMappingURL=merge.js.map\n"],"names":[],"mappings":"AAOA,SAAS,MAAM,YAAY,UAAU,SAAS,GAAG;AAG/C,MAAI,CAAC,YAAY,OAAO,aAAa,YAAY,UAAU,GAAG;AAC5D,WAAO;AAAA,EACT;AAGA,MAAI,cAAc,OAAO,KAAK,QAAQ,EAAE,WAAW,GAAG;AACpD,WAAO;AAAA,EACT;AAGA,QAAM,SAAS,EAAE,GAAG,WAAU;AAG9B,aAAW,OAAO,UAAU;AAC1B,QAAI,OAAO,UAAU,eAAe,KAAK,UAAU,GAAG,GAAG;AACvD,aAAO,GAAG,IAAI,MAAM,OAAO,GAAG,GAAG,SAAS,GAAG,GAAG,SAAS,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,32 @@
1
+ import { withRandomSafeContext, safeMathRandom } from "./randomSafeContext.js";
2
+ import { GLOBAL_OBJ } from "./worldwide.js";
3
+ function getCrypto() {
4
+ const gbl = GLOBAL_OBJ;
5
+ return gbl.crypto || gbl.msCrypto;
6
+ }
7
+ let emptyUuid;
8
+ function getRandomByte() {
9
+ return safeMathRandom() * 16;
10
+ }
11
+ function uuid4(crypto = getCrypto()) {
12
+ try {
13
+ if (crypto?.randomUUID) {
14
+ return withRandomSafeContext(() => crypto.randomUUID()).replace(/-/g, "");
15
+ }
16
+ } catch {
17
+ }
18
+ if (!emptyUuid) {
19
+ emptyUuid = "10000000100040008000" + 1e11;
20
+ }
21
+ return emptyUuid.replace(
22
+ /[018]/g,
23
+ (c) => (
24
+ // eslint-disable-next-line no-bitwise
25
+ (c ^ (getRandomByte() & 15) >> c / 4).toString(16)
26
+ )
27
+ );
28
+ }
29
+ export {
30
+ uuid4
31
+ };
32
+ //# sourceMappingURL=misc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/misc.js"],"sourcesContent":["import { addNonEnumerableProperty } from './object.js';\nimport { withRandomSafeContext, safeMathRandom } from './randomSafeContext.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\nfunction getCrypto() {\n const gbl = GLOBAL_OBJ ;\n return gbl.crypto || gbl.msCrypto;\n}\n\nlet emptyUuid;\n\nfunction getRandomByte() {\n return safeMathRandom() * 16;\n}\n\n/**\n * UUID4 generator\n * @param crypto Object that provides the crypto API.\n * @returns string Generated UUID4.\n */\nfunction uuid4(crypto = getCrypto()) {\n try {\n if (crypto?.randomUUID) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return withRandomSafeContext(() => crypto.randomUUID()).replace(/-/g, '');\n }\n } catch {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n if (!emptyUuid) {\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n emptyUuid = ([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11;\n }\n\n return emptyUuid.replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event) {\n return event.exception?.values?.[0];\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '<unknown>';\n }\n return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nfunction addExceptionTypeValue(event, value, type) {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...currentMechanism?.data, ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\nfunction _parseInt(input) {\n return parseInt(input || '', 10);\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = _parseInt(match[1]);\n const minor = _parseInt(match[2]);\n const patch = _parseInt(match[3]);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n // We guard here to ensure this is not larger than the existing number of lines\n const lineIndex = Math.min(maxLines - 1, sourceLine);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n frame.context_line = snipLine(lines[lineIndex], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n if (isAlreadyCaptured(exception)) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether we've already captured the given exception (note: not an identical exception - the very object).\n * It is considered already captured if it has the `__sentry_captured__` property set to `true`.\n *\n * @internal Only considered for internal usage\n */\nfunction isAlreadyCaptured(exception) {\n try {\n return (exception ).__sentry_captured__;\n } catch {} // eslint-disable-line no-empty\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, checkOrSetAlreadyCaught, getEventDescription, isAlreadyCaptured, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n"],"names":[],"mappings":";;AAKA,SAAS,YAAY;AACnB,QAAM,MAAM;AACZ,SAAO,IAAI,UAAU,IAAI;AAC3B;AAEA,IAAI;AAEJ,SAAS,gBAAgB;AACvB,SAAO,eAAc,IAAK;AAC5B;AAOA,SAAS,MAAM,SAAS,aAAa;AACnC,MAAI;AACF,QAAI,QAAQ,YAAY;AAEtB,aAAO,sBAAsB,MAAM,OAAO,WAAU,CAAE,EAAE,QAAQ,MAAM,EAAE;AAAA,IAC1E;AAAA,EACF,QAAQ;AAAA,EAGR;AAEA,MAAI,CAAC,WAAW;AAGd,gBAAa,yBAA4B;AAAA,EAC3C;AAEA,SAAO,UAAU;AAAA,IAAQ;AAAA,IAAU;AAAA;AAAA,OAE/B,KAAQ,cAAa,IAAK,OAAS,IAAM,GAAK,SAAS,EAAE;AAAA;AAAA,EAC/D;AACA;","x_google_ignoreList":[0]}
@@ -0,0 +1,18 @@
1
+ import { DEBUG_BUILD } from "../debug-build.js";
2
+ import { debug } from "./debug-logger.js";
3
+ function addNonEnumerableProperty(obj, name, value) {
4
+ try {
5
+ Object.defineProperty(obj, name, {
6
+ // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
7
+ value,
8
+ writable: true,
9
+ configurable: true
10
+ });
11
+ } catch {
12
+ DEBUG_BUILD && debug.log(`Failed to add non-enumerable property "${name}" to object`, obj);
13
+ }
14
+ }
15
+ export {
16
+ addNonEnumerableProperty
17
+ };
18
+ //# sourceMappingURL=object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/object.js"],"sourcesContent":["import { DEBUG_BUILD } from '../debug-build.js';\nimport { htmlTreeAsString } from './browser.js';\nimport { debug } from './debug-logger.js';\nimport { isError, isEvent, isInstanceOf, isPrimitive, isElement } from './is.js';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * If the method on the passed object is not a function, the wrapper will not be applied.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nfunction fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n // explicitly casting to unknown because we don't know the type of the method initially at all\n const original = source[name] ;\n\n if (typeof original !== 'function') {\n return;\n }\n\n const wrapped = replacementFactory(original) ;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n try {\n source[name] = wrapped;\n } catch {\n DEBUG_BUILD && debug.log(`Failed to replace method \"${name}\" in object`, source);\n }\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nfunction addNonEnumerableProperty(obj, name, value) {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value,\n writable: true,\n configurable: true,\n });\n } catch {\n DEBUG_BUILD && debug.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nfunction markFunctionWrapped(wrapped, original) {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor\n * an Error.\n */\nfunction convertToPlainObject(value)\n\n {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj\n\n = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target) {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch {\n return '<unknown>';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj) {\n if (typeof obj === 'object' && obj !== null) {\n return Object.fromEntries(Object.entries(obj));\n }\n return {};\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nfunction extractExceptionKeysForMessage(exception) {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n return !keys[0] ? '[object has no keys]' : keys.join(', ');\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n *\n * @deprecated This function is no longer used by the SDK and will be removed in a future major version.\n */\nfunction dropUndefinedKeys(inputValue) {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue, memoizationMap) {\n // Early return for primitive values\n if (inputValue === null || typeof inputValue !== 'object') {\n return inputValue;\n }\n\n // Check memo map first for all object types\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n // handle arrays\n if (Array.isArray(inputValue)) {\n const returnValue = [];\n // Store mapping to handle circular references\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach(value => {\n returnValue.push(_dropUndefinedKeys(value, memoizationMap));\n });\n\n return returnValue ;\n }\n\n if (isPojo(inputValue)) {\n const returnValue = {};\n // Store mapping to handle circular references\n memoizationMap.set(inputValue, returnValue);\n\n const keys = Object.keys(inputValue);\n\n keys.forEach(key => {\n const val = inputValue[key];\n if (val !== undefined) {\n returnValue[key] = _dropUndefinedKeys(val, memoizationMap);\n }\n });\n\n return returnValue ;\n }\n\n // For other object types, return as is\n return inputValue;\n}\n\nfunction isPojo(input) {\n // Plain objects have Object as constructor or no constructor\n const constructor = (input ).constructor;\n return constructor === Object || constructor === undefined;\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nfunction objectify(wat) {\n let objectified;\n switch (true) {\n // this will catch both undefined and null\n case wat == undefined:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat ).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n\nexport { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify };\n//# sourceMappingURL=object.js.map\n"],"names":[],"mappings":";;AAsDA,SAAS,yBAAyB,KAAK,MAAM,OAAO;AAClD,MAAI;AACF,WAAO,eAAe,KAAK,MAAM;AAAA;AAAA,MAE/B;AAAA,MACA,UAAU;AAAA,MACV,cAAc;AAAA,IACpB,CAAK;AAAA,EACH,QAAQ;AACN,mBAAe,MAAM,IAAI,0CAA0C,IAAI,eAAe,GAAG;AAAA,EAC3F;AACF;","x_google_ignoreList":[0]}
@@ -0,0 +1,34 @@
1
+ import { Scope } from "../scope.js";
2
+ function parseEventHintOrCaptureContext(hint) {
3
+ if (!hint) {
4
+ return void 0;
5
+ }
6
+ if (hintIsScopeOrFunction(hint)) {
7
+ return { captureContext: hint };
8
+ }
9
+ if (hintIsScopeContext(hint)) {
10
+ return {
11
+ captureContext: hint
12
+ };
13
+ }
14
+ return hint;
15
+ }
16
+ function hintIsScopeOrFunction(hint) {
17
+ return hint instanceof Scope || typeof hint === "function";
18
+ }
19
+ const captureContextKeys = [
20
+ "user",
21
+ "level",
22
+ "extra",
23
+ "contexts",
24
+ "tags",
25
+ "fingerprint",
26
+ "propagationContext"
27
+ ];
28
+ function hintIsScopeContext(hint) {
29
+ return Object.keys(hint).some((key) => captureContextKeys.includes(key));
30
+ }
31
+ export {
32
+ parseEventHintOrCaptureContext
33
+ };
34
+ //# sourceMappingURL=prepareEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareEvent.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/prepareEvent.js"],"sourcesContent":["import { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { notifyEventProcessors } from '../eventProcessors.js';\nimport { Scope } from '../scope.js';\nimport { getFilenameToDebugIdMap } from './debug-ids.js';\nimport { uuid4, addExceptionMechanism } from './misc.js';\nimport { normalize } from './normalize.js';\nimport { getCombinedScopeData, applyScopeDataToEvent } from './scopeData.js';\nimport { truncate } from './string.js';\nimport { resolvedSyncPromise } from './syncpromise.js';\nimport { dateTimestampInSeconds } from './time.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n if (client) {\n client.emit('applyFrameMetadata', event);\n }\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Scope.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getCombinedScopeData(isolationScope, finalScope);\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n const eventProcessors = [\n ...clientEventProcessors,\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n // Skip event processors for internal exceptions to prevent recursion\n // oxlint-disable-next-line typescript/prefer-optional-chain\n const isInternalException = hint.data && (hint.data ).__sentry__ === true;\n const result = isInternalException\n ? resolvedSyncPromise(prepared)\n : notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n *\n * Only exported for tests.\n *\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength } = options;\n\n // empty strings do not make sense for environment, release, and dist\n // so we handle them the same as if they were not provided\n event.environment = event.environment || environment || DEFAULT_ENVIRONMENT;\n\n if (!event.release && release) {\n event.release = release;\n }\n\n if (!event.dist && dist) {\n event.dist = dist;\n }\n\n const request = event.request;\n if (request?.url && maxValueLength) {\n request.url = truncate(request.url, maxValueLength);\n }\n\n if (maxValueLength) {\n event.exception?.values?.forEach(exception => {\n if (exception.value) {\n // Truncates error messages\n exception.value = truncate(exception.value, maxValueLength);\n }\n });\n }\n}\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);\n\n event.exception?.values?.forEach(exception => {\n exception.stacktrace?.frames?.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n event.exception?.values?.forEach(exception => {\n exception.stacktrace?.frames?.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id,\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts?.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n return {\n ...span,\n ...(span.data && {\n data: normalize(span.data, depth, maxBreadth),\n }),\n };\n });\n }\n\n // event.contexts.flags (FeatureFlagContext) stores context for our feature\n // flag integrations. It has a greater nesting depth than our other typed\n // Contexts, so we re-normalize with a fixed depth of 3 here. We do not want\n // to skip this in case of conflicting, user-provided context.\n if (event.contexts?.flags && normalized.contexts) {\n normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth);\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope, captureContext) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(hint) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyClientOptions, applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n"],"names":[],"mappings":";AA8SA,SAAS,+BACP,MACA;AACA,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAGA,MAAI,sBAAsB,IAAI,GAAG;AAC/B,WAAO,EAAE,gBAAgB,KAAI;AAAA,EAC/B;AAEA,MAAI,mBAAmB,IAAI,GAAG;AAC5B,WAAO;AAAA,MACL,gBAAgB;AAAA,IACtB;AAAA,EACE;AAEA,SAAO;AACT;AAEA,SAAS,sBAAsB,MAAM;AACnC,SAAO,gBAAgB,SAAS,OAAO,SAAS;AAClD;AAEA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,mBAAmB,MAAM;AAChC,SAAO,OAAO,KAAK,IAAI,EAAE,KAAK,SAAO,mBAAmB,SAAS,IAAK;AACxE;","x_google_ignoreList":[0]}
@@ -0,0 +1,8 @@
1
+ import { uuid4 } from "./misc.js";
2
+ function generateTraceId() {
3
+ return uuid4();
4
+ }
5
+ export {
6
+ generateTraceId
7
+ };
8
+ //# sourceMappingURL=propagationContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propagationContext.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/propagationContext.js"],"sourcesContent":["import { uuid4 } from './misc.js';\n\n/**\n * Generate a random, valid trace ID.\n */\nfunction generateTraceId() {\n return uuid4();\n}\n\n/**\n * Generate a random, valid span ID.\n */\nfunction generateSpanId() {\n return uuid4().substring(16);\n}\n\nexport { generateSpanId, generateTraceId };\n//# sourceMappingURL=propagationContext.js.map\n"],"names":[],"mappings":";AAKA,SAAS,kBAAkB;AACzB,SAAO,MAAK;AACd;","x_google_ignoreList":[0]}
@@ -0,0 +1,27 @@
1
+ import { GLOBAL_OBJ } from "./worldwide.js";
2
+ let RESOLVED_RUNNER;
3
+ function withRandomSafeContext(cb) {
4
+ if (RESOLVED_RUNNER !== void 0) {
5
+ return RESOLVED_RUNNER ? RESOLVED_RUNNER(cb) : cb();
6
+ }
7
+ const sym = /* @__PURE__ */ Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__");
8
+ const globalWithSymbol = GLOBAL_OBJ;
9
+ if (sym in globalWithSymbol && typeof globalWithSymbol[sym] === "function") {
10
+ RESOLVED_RUNNER = globalWithSymbol[sym];
11
+ return RESOLVED_RUNNER(cb);
12
+ }
13
+ RESOLVED_RUNNER = null;
14
+ return cb();
15
+ }
16
+ function safeMathRandom() {
17
+ return withRandomSafeContext(() => Math.random());
18
+ }
19
+ function safeDateNow() {
20
+ return withRandomSafeContext(() => Date.now());
21
+ }
22
+ export {
23
+ safeDateNow,
24
+ safeMathRandom,
25
+ withRandomSafeContext
26
+ };
27
+ //# sourceMappingURL=randomSafeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"randomSafeContext.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/randomSafeContext.js"],"sourcesContent":["import { GLOBAL_OBJ } from './worldwide.js';\n\n// undefined = not yet resolved, null = no runner found, function = runner found\nlet RESOLVED_RUNNER;\n\n/**\n * Simple wrapper that allows SDKs to *secretly* set context wrapper to generate safe random IDs in cache components contexts\n */\nfunction withRandomSafeContext(cb) {\n // Skips future symbol lookups if we've already resolved (or attempted to resolve) the runner once\n if (RESOLVED_RUNNER !== undefined) {\n return RESOLVED_RUNNER ? RESOLVED_RUNNER(cb) : cb();\n }\n\n const sym = Symbol.for('__SENTRY_SAFE_RANDOM_ID_WRAPPER__');\n const globalWithSymbol = GLOBAL_OBJ;\n\n if (sym in globalWithSymbol && typeof globalWithSymbol[sym] === 'function') {\n RESOLVED_RUNNER = globalWithSymbol[sym];\n return RESOLVED_RUNNER(cb);\n }\n\n RESOLVED_RUNNER = null;\n return cb();\n}\n\n/**\n * Identical to Math.random() but wrapped in withRandomSafeContext\n * to ensure safe random number generation in certain contexts (e.g., Next.js Cache Components).\n */\nfunction safeMathRandom() {\n return withRandomSafeContext(() => Math.random());\n}\n\n/**\n * Identical to Date.now() but wrapped in withRandomSafeContext\n * to ensure safe time value generation in certain contexts (e.g., Next.js Cache Components).\n */\nfunction safeDateNow() {\n return withRandomSafeContext(() => Date.now());\n}\n\nexport { safeDateNow, safeMathRandom, withRandomSafeContext };\n//# sourceMappingURL=randomSafeContext.js.map\n"],"names":[],"mappings":";AAGA,IAAI;AAKJ,SAAS,sBAAsB,IAAI;AAEjC,MAAI,oBAAoB,QAAW;AACjC,WAAO,kBAAkB,gBAAgB,EAAE,IAAI,GAAE;AAAA,EACnD;AAEA,QAAM,MAAM,uBAAO,IAAI,mCAAmC;AAC1D,QAAM,mBAAmB;AAEzB,MAAI,OAAO,oBAAoB,OAAO,iBAAiB,GAAG,MAAM,YAAY;AAC1E,sBAAkB,iBAAiB,GAAG;AACtC,WAAO,gBAAgB,EAAE;AAAA,EAC3B;AAEA,oBAAkB;AAClB,SAAO,GAAE;AACX;AAMA,SAAS,iBAAiB;AACxB,SAAO,sBAAsB,MAAM,KAAK,QAAQ;AAClD;AAMA,SAAS,cAAc;AACrB,SAAO,sBAAsB,MAAM,KAAK,KAAK;AAC/C;","x_google_ignoreList":[0]}
@@ -0,0 +1,17 @@
1
+ import { addNonEnumerableProperty } from "./object.js";
2
+ const SCOPE_SPAN_FIELD = "_sentrySpan";
3
+ function _setSpanForScope(scope, span) {
4
+ if (span) {
5
+ addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, span);
6
+ } else {
7
+ delete scope[SCOPE_SPAN_FIELD];
8
+ }
9
+ }
10
+ function _getSpanForScope(scope) {
11
+ return scope[SCOPE_SPAN_FIELD];
12
+ }
13
+ export {
14
+ _getSpanForScope,
15
+ _setSpanForScope
16
+ };
17
+ //# sourceMappingURL=spanOnScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spanOnScope.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/spanOnScope.js"],"sourcesContent":["import { addNonEnumerableProperty } from './object.js';\n\nconst SCOPE_SPAN_FIELD = '_sentrySpan';\n\n/**\n * Set the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nfunction _setSpanForScope(scope, span) {\n if (span) {\n addNonEnumerableProperty(scope , SCOPE_SPAN_FIELD, span);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete (scope )[SCOPE_SPAN_FIELD];\n }\n}\n\n/**\n * Get the active span for a given scope.\n * NOTE: This should NOT be used directly, but is only used internally by the trace methods.\n */\nfunction _getSpanForScope(scope) {\n return scope[SCOPE_SPAN_FIELD];\n}\n\nexport { _getSpanForScope, _setSpanForScope };\n//# sourceMappingURL=spanOnScope.js.map\n"],"names":[],"mappings":";AAEA,MAAM,mBAAmB;AAMzB,SAAS,iBAAiB,OAAO,MAAM;AACrC,MAAI,MAAM;AACR,6BAAyB,OAAQ,kBAAkB,IAAI;AAAA,EACzD,OAAO;AAEL,WAAQ,MAAQ,gBAAgB;AAAA,EAClC;AACF;AAMA,SAAS,iBAAiB,OAAO;AAC/B,SAAO,MAAM,gBAAgB;AAC/B;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ function truncate(str, max = 0) {
2
+ if (typeof str !== "string" || max === 0) {
3
+ return str;
4
+ }
5
+ return str.length <= max ? str : `${str.slice(0, max)}...`;
6
+ }
7
+ export {
8
+ truncate
9
+ };
10
+ //# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.js","sources":["../../../../../../../node_modules/@sentry/core/build/esm/utils/string.js"],"sourcesContent":["import { isString, isRegExp, isVueViewModel } from './is.js';\nimport { getVueInternalName } from './stacktrace.js';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nfunction truncate(str, max = 0) {\n if (typeof str !== 'string' || max === 0) {\n return str;\n }\n return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nfunction snipLine(line, colno) {\n let newLine = line;\n const lineLength = newLine.length;\n if (lineLength <= 150) {\n return newLine;\n }\n if (colno > lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\nfunction safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line typescript/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push(getVueInternalName(value));\n } else {\n output.push(String(value));\n }\n } catch {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nfunction isMatchingPattern(\n value,\n pattern,\n requireExactStringMatch = false,\n) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nfunction stringMatchesSomePattern(\n testString,\n patterns = [],\n requireExactStringMatch = false,\n) {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n\nexport { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate };\n//# sourceMappingURL=string.js.map\n"],"names":[],"mappings":"AAUA,SAAS,SAAS,KAAK,MAAM,GAAG;AAC9B,MAAI,OAAO,QAAQ,YAAY,QAAQ,GAAG;AACxC,WAAO;AAAA,EACT;AACA,SAAO,IAAI,UAAU,MAAM,MAAM,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;AACvD;","x_google_ignoreList":[0]}