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rDzB,EAAAA,GAAsBlC,EAAS2D","sources":["webpack://StravaModern/./app/javascript/utils/devUtils.js","webpack://StravaModern/./app/javascript/utils/sentry.helper.js","webpack://StravaModern/./app/javascript/utils/sentry.js"],"sourcesContent":["/**\n * dev utils to make local development easier (dynamically-imported mock data,\n * dev-only console logs, etc.)\n */\n\nexport const isDev = () => {\n return process.env.NODE_ENV === 'development';\n};\n\nexport const isTest = () => process.env.NODE_ENV === 'test';\n\nexport const devLog = (string) => {\n if (isDev() || window?.StravaDevTools?.enabled) {\n // eslint-disable-next-line no-console\n console.log(string);\n }\n};\n\nexport const timeout = (ms) => {\n return new Promise((resolve) => setTimeout(resolve, ms));\n};\n\nexport default { isDev, devLog, timeout };\n","const BROWSER_EXTENSION = '-extension://';\nconst ANONYMOUS = '';\nconst DOWNLOADED_FILES = ['/Users/', '/users/']; // eg. https://sentry.io/share/issue/391b31fba7714147a99a3697db116840/\n\n// see https://github.com/thomaschampagne/elevate/blob/fc5772a12327c0d5015fb0fec64aba1cec6756c7/webextension/scripts/processors/activities-synchronize.ts\nconst ELEVATE_APP_CONSOLE_LOGS = [\n 'Fast sync mode enabled',\n 'A previous sync exists on',\n 'local and remote activities count matches',\n 'Mismatch found between local and remote activities. Syncing first page only.',\n 'Activities fetched in group',\n ', raw activities length: ',\n 'PagesRidden] Resolving with ',\n 'clearSyncCache requested',\n 'Group handled count: ',\n 'Updating synced activities to extension local storage.',\n 'Activities fetched in group'\n];\n\nexport const includes = (substringList, string) =>\n !!substringList.find((substring) => {\n return string?.includes(substring);\n });\n\nexport const hasExtensionReferenceInHintErrorStack = (hint) =>\n hint?.originalException?.stack?.includes(BROWSER_EXTENSION);\n\nexport const hasExtensionReferenceInBreadCrumbs = (event) =>\n !!event?.breadcrumbs?.find((entry) => {\n return (\n entry.data?.url?.includes(BROWSER_EXTENSION) ||\n includes(ELEVATE_APP_CONSOLE_LOGS, entry.message)\n );\n });\n\nexport const hasExtensionReferenceInEventErrorStack = (event) => {\n return !!event?.exception?.values?.find((entry) => {\n return !!entry.stacktrace?.frames?.find(\n (frame) =>\n frame?.filename?.includes(BROWSER_EXTENSION) ||\n frame?.abs_path?.includes(BROWSER_EXTENSION) ||\n frame?.filename?.includes(ANONYMOUS) ||\n frame?.abs_path?.includes(ANONYMOUS) ||\n includes(DOWNLOADED_FILES, frame?.filename) ||\n includes(DOWNLOADED_FILES, frame?.abs_path)\n );\n });\n};\n\nexport default {\n hasExtensionReferenceInHintErrorStack,\n hasExtensionReferenceInBreadCrumbs,\n hasExtensionReferenceInEventErrorStack,\n includes\n};\n","import * as Sentry from '@sentry/react';\nimport { BrowserTracing } from '@sentry/tracing';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport { createBrowserHistory } from 'history';\nimport { matchPath } from 'react-router-dom';\nimport { isDev } from './devUtils';\nimport {\n hasExtensionReferenceInBreadCrumbs,\n hasExtensionReferenceInHintErrorStack,\n hasExtensionReferenceInEventErrorStack\n} from './sentry.helper';\n\n// List of pages that have the same pathname but different variants controlled with\n// search params. Pages added to this list will have the search param added to the name\n// during tracing (performance tracking)\nconst PAGES_WITH_VARIANTS = ['/onboarding/continue', '/'];\n\n// List of react-router routes to be singled out for performance tracking\n// Make sure the order of the routes is correct. The longest url under the same parent should be placed first and in decreasing order.\n// eg. athlete/id/post should be added before athlete/id\nconst REACT_ROUTER_ROUTES = [\n { path: '/onboarding/continue' },\n { path: '/onboarding/google_registered' },\n { path: '/onboarding/suggested-friends' },\n { path: '/onboarding/facebook-friends' },\n { path: '/onboarding/welcome-to-strava' },\n { path: '/onboarding/subscription-trial' },\n { path: '/onboarding/direct-promotion' }\n];\n\nconst history = createBrowserHistory();\n\nif (!window.StravaSentryDsn) {\n window.StravaSentryDsn = {};\n}\nif (!window.StravaSentryDsn.deferred) {\n window.StravaSentryDsn.deferred = {};\n const promise = new Promise(\n function _(resolve, reject) {\n this.doResolve = resolve;\n this.doReject = reject;\n }.bind(window.StravaSentryDsn.deferred)\n );\n window.StravaSentryDsn.deferred.then = promise.then.bind(promise);\n}\n\nconst { enabled, environment, release, userId, dsn, sampleRate, debug } =\n window.StravaSentry || {};\n\nwindow.StravaSentryDsn.deferred.doResolve(dsn);\n\nwindow.StravaSentryDsn.deferred.then((_dsn) => {\n // configure sentry_frontend.yml to enable sentry on local\n if (enabled) {\n Sentry.init({\n dsn: _dsn,\n maxBreadcrumbs: 50,\n integrations: [\n new BrowserTracing({\n tracingOrigins: [\n 'https://www.staging.strava.com',\n 'https://www.strava.com',\n 'localhost',\n /^\\//\n ],\n beforeNavigate: (context) => {\n const { pathname, search } = window.location;\n const includeSearchParam = PAGES_WITH_VARIANTS.includes(pathname);\n return {\n ...context,\n name: includeSearchParam ? pathname.concat(search) : pathname\n };\n }\n })\n ],\n denyUrls: [\n // Chrome extensions\n /extensions\\//i,\n /^chrome:\\/\\//i\n ],\n tracesSampleRate: sampleRate,\n debug,\n attachStacktrace: true,\n release,\n initialScope: {\n user: { id: userId }\n },\n environment,\n beforeSend: (event, hint) => {\n if (\n hasExtensionReferenceInHintErrorStack(hint) ||\n hasExtensionReferenceInBreadCrumbs(event) ||\n hasExtensionReferenceInEventErrorStack(event) ||\n hint?.originalException === 'Timeout' // google-recaptcha flakiness\n ) {\n return null;\n }\n return event;\n },\n routingInstrumentation: Sentry.reactRouterV5Instrumentation(\n history,\n REACT_ROUTER_ROUTES,\n matchPath\n )\n });\n }\n});\n\n/** @type {import(\"@sentry/browser\").withScope} */\nexport const withScope = (...args) => Sentry.withScope(...args);\n\n/** @type {import(\"@sentry/browser\").captureException} */\nexport const logError = (error, captureContext) => {\n if (isDev()) {\n // eslint-disable-next-line no-console\n console.error('logError :::', error, captureContext);\n return;\n }\n\n Sentry.captureException(error, captureContext);\n};\n\n/** @type {import(\"@sentry/browser\").captureMessage} */\nexport const logMessage = (message, captureContext) => {\n if (isDev()) {\n // eslint-disable-next-line no-console\n console.error('logMessage :::', message, captureContext);\n return;\n }\n\n Sentry.captureMessage(message, captureContext);\n};\n\nexport default { logError, logMessage, withScope };\n"],"names":["isDev","process","devLog","string","window","StravaDevTools","enabled","console","log","BROWSER_EXTENSION","ANONYMOUS","DOWNLOADED_FILES","ELEVATE_APP_CONSOLE_LOGS","includes","substringList","find","substring","hasExtensionReferenceInHintErrorStack","hint","originalException","stack","hasExtensionReferenceInBreadCrumbs","event","breadcrumbs","entry","data","url","message","hasExtensionReferenceInEventErrorStack","exception","values","stacktrace","frames","frame","f","filename","abs_path","PAGES_WITH_VARIANTS","REACT_ROUTER_ROUTES","path","history","createBrowserHistory","StravaSentryDsn","deferred","promise","Promise","resolve","reject","this","doResolve","doReject","bind","then","StravaSentry","environment","release","userId","dsn","sampleRate","debug","_dsn","Sentry","maxBreadcrumbs","integrations","BrowserTracing","tracingOrigins","beforeNavigate","context","location","pathname","search","includeSearchParam","name","concat","denyUrls","tracesSampleRate","attachStacktrace","initialScope","user","id","beforeSend","routingInstrumentation","matchPath","withScope","logError","error","captureContext","logMessage"],"sourceRoot":""}