{"version":3,"file":"distDirRewriteFramesIntegration.js","sources":["../../../src/edge/distDirRewriteFramesIntegration.ts"],"sourcesContent":["import { defineIntegration, escapeStringForRegex, rewriteFramesIntegration } from '@sentry/core';\n\nexport const distDirRewriteFramesIntegration = defineIntegration(({ distDirName }: { distDirName: string }) => {\n const distDirAbsPath = distDirName.replace(/(\\/|\\\\)$/, ''); // We strip trailing slashes because \"app:///_next\" also doesn't have one\n\n // Normally we would use `path.resolve` to obtain the absolute path we will strip from the stack frame to align with\n // the uploaded artifacts, however we don't have access to that API in edge so we need to be a bit more lax.\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- user input is escaped\n const SOURCEMAP_FILENAME_REGEX = new RegExp(`.*${escapeStringForRegex(distDirAbsPath)}`);\n\n const rewriteFramesIntegrationInstance = rewriteFramesIntegration({\n iteratee: frame => {\n frame.filename = frame.filename?.replace(SOURCEMAP_FILENAME_REGEX, 'app:///_next');\n return frame;\n },\n });\n\n return {\n ...rewriteFramesIntegrationInstance,\n name: 'DistDirRewriteFrames',\n };\n});\n"],"names":[],"mappings":";;AAEO,MAAM,+BAAA,GAAkC,iBAAiB,CAAC,CAAC,EAAE,WAAA,EAAa,KAA8B;AAC/G,EAAE,MAAM,cAAA,GAAiB,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;;AAE5D;AACA;AACA;AACA,EAAE,MAAM,wBAAA,GAA2B,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAAA,CAAA;;AAEA,EAAA,MAAA,gCAAA,GAAA,wBAAA,CAAA;AACA,IAAA,QAAA,EAAA,KAAA,IAAA;AACA,MAAA,KAAA,CAAA,QAAA,GAAA,KAAA,CAAA,QAAA,EAAA,OAAA,CAAA,wBAAA,EAAA,cAAA,CAAA;AACA,MAAA,OAAA,KAAA;AACA,IAAA,CAAA;AACA,GAAA,CAAA;;AAEA,EAAA,OAAA;AACA,IAAA,GAAA,gCAAA;AACA,IAAA,IAAA,EAAA,sBAAA;AACA,GAAA;AACA,CAAA;;;;"}