claude-code-best 2.5.0 → 2.6.5
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.
- package/dist/chunks/AddWorkspaceDirectory-BYyM_V0q.js +1 -0
- package/dist/chunks/App-BboadKdn.js +1 -0
- package/dist/chunks/ApproveApiKey-BLp4742y.js +1 -0
- package/dist/chunks/ApproveApiKey-DiEe4eui.js +1 -0
- package/dist/chunks/AssistantSessionChooser-B88DM0Oq.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-B6XNhFqq.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BNhlq7_K.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +1 -0
- package/dist/chunks/DesktopHandoff-S-w4bs5T.js +1 -0
- package/dist/chunks/DevChannelsDialog-BljR0X9X.js +1 -0
- package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
- package/dist/chunks/DiffDialog-BhQ2QaLW.js +3 -0
- package/dist/chunks/Doctor-BXb0qv6n.js +3 -0
- package/dist/chunks/Doctor-C5DYPEGl.js +1 -0
- package/dist/chunks/ExitFlow-CSBDxw9H.js +2 -0
- package/dist/chunks/Feedback-DwHzc4UT.js +2 -0
- package/dist/chunks/Grove-DSXRnXKv.js +11 -0
- package/dist/chunks/Grove-DnTo982-.js +1 -0
- package/dist/chunks/HybridTransport-CuT3KI5e.js +4 -0
- package/dist/chunks/ITermBackend-mokGZVH_.js +1 -0
- package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
- package/dist/chunks/InvalidConfigDialog-Bi4RKYlk.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-0zKo4-so.js +1 -0
- package/dist/chunks/ListItem-OFARanN7.js +1 -0
- package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +1 -0
- package/dist/chunks/McpParsingWarnings-EzgsOoHw.js +1 -0
- package/dist/chunks/MessageSelector-DTmUuEKJ.js +3 -0
- package/dist/chunks/Messages-DWiKTx5o.js +11 -0
- package/dist/chunks/Onboarding-odmthwzz.js +1 -0
- package/dist/chunks/OverageCreditUpsell-Cpk_5Lv0.js +1 -0
- package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
- package/dist/chunks/PluginSettings-eYcWehI8.js +17 -0
- package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-DrrkNOuS.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-DMsF4D6d.js +1 -0
- package/dist/chunks/QueryEngine-C_KZts4y.js +1 -0
- package/dist/chunks/REPL-C6YR0VKU.js +1 -0
- package/dist/chunks/REPL-DzHz-LOY.js +97 -0
- package/dist/chunks/RemoteCallout-CnpCWRPk.js +1 -0
- package/dist/chunks/RemoteSessionManager-OWg_Yccq.js +2 -0
- package/dist/chunks/ResumeConversation-BktSnsCm.js +1 -0
- package/dist/chunks/SSETransport-BpnapvlK.js +4 -0
- package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +1 -0
- package/dist/chunks/SentryErrorBoundary-C-NlfQZw.js +2 -0
- package/dist/chunks/Settings-vfFvcweR.js +2 -0
- package/dist/chunks/TeleportProgress-CYXay2ZL.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-_zbZTvcJ.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-DiHQeZIM.js +1 -0
- package/dist/chunks/ThemePicker-BRh027fA.js +1 -0
- package/dist/chunks/TmuxBackend-BaX2U7iZ.js +9 -0
- package/dist/chunks/TrustDialog-CVbzrv6g.js +1 -0
- package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
- package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
- package/dist/chunks/ValidationErrorsList-CdCUgfIl.js +2 -0
- package/dist/chunks/WelcomeV2-DCXcYd2x.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +2 -0
- package/dist/chunks/add-dir-ldGd3Ppz.js +1 -0
- package/dist/chunks/agentDisplay-CVnAeURF.js +1 -0
- package/dist/chunks/agents-C08NzRZx.js +2 -0
- package/dist/chunks/agents-DH5fmbVw.js +103 -0
- package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
- package/dist/chunks/analytics-DqMQntaB.js +1 -0
- package/dist/chunks/ant-DJren1Aa.js +1 -0
- package/dist/chunks/api-6tcwJlf_.js +1 -0
- package/dist/chunks/api-CGOR_Xfl.js +1 -0
- package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
- package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
- package/dist/chunks/assistant-BlzrMSkM.js +1 -0
- package/dist/chunks/assistant-CwbhlCM-.js +1 -0
- package/dist/chunks/assistant-aWkDcurV.js +1 -0
- package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
- package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
- package/dist/chunks/auth-CSB2RDKF.js +1 -0
- package/dist/chunks/auth-GxZhOvQ1.js +1 -0
- package/dist/chunks/autoMode-CWvZs1jO.js +45 -0
- package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
- package/dist/chunks/autonomy-BkVcSMCZ.js +19 -0
- package/dist/chunks/autonomy-DK42aJYt.js +1 -0
- package/dist/chunks/autonomyPanel-Cn4IhXgE.js +1 -0
- package/dist/chunks/axios-DLnc2dVy.js +1 -0
- package/dist/chunks/axios-DhfaybwJ.js +12 -0
- package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +17 -0
- package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +1 -0
- package/dist/chunks/banner-CVXH2xts.js +2 -0
- package/dist/chunks/base64-js-DIVSFswY.js +1 -0
- package/dist/chunks/bedrockClient-qi1-JCOK.js +15 -0
- package/dist/chunks/bg-DK0E4ZtW.js +9 -0
- package/dist/chunks/bg-Dbh5z3Y8.js +1 -0
- package/dist/chunks/branch-juox_fko.js +3 -0
- package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
- package/dist/chunks/bridge-DudsCZkh.js +2 -0
- package/dist/chunks/bridgeConfig-D4tpc568.js +1 -0
- package/dist/chunks/bridgeConfig-lRZfQqmA.js +1 -0
- package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +1 -0
- package/dist/chunks/bridgeEnabled-D2IykaHE.js +1 -0
- package/dist/chunks/bridgeMain-C5RDihlX.js +68 -0
- package/dist/chunks/bridgeMain-D7_lg2iJ.js +1 -0
- package/dist/chunks/bridgeMessaging-CqNURC4-.js +1 -0
- package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
- package/dist/chunks/browser-fLRXxIsQ.js +1 -0
- package/dist/chunks/btw-DKlE3Dea.js +1 -0
- package/dist/chunks/buddy-DQYgHR63.js +3 -0
- package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
- package/dist/chunks/bypassPermissionsKillswitch-Bof-UtM-.js +1 -0
- package/dist/chunks/caches-B5QZDncQ.js +3 -0
- package/dist/chunks/caches-dGk7xsDu.js +1 -0
- package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
- package/dist/chunks/ccrClient-BaWg4E9-.js +1 -0
- package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
- package/dist/chunks/changeDetector-DoLfg8a6.js +1 -0
- package/dist/chunks/channelNotification-B7A-9DIl.js +1 -0
- package/dist/chunks/channelNotification-DDErroWn.js +1 -0
- package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
- package/dist/chunks/chokidar-SzksMqYp.js +1 -0
- package/dist/chunks/chrome-jMAks7-w.js +1 -0
- package/dist/chunks/chromeNativeHost-4U39yLtd.js +1 -0
- package/dist/chunks/chunk-DR8-3Aex.js +1 -0
- package/dist/chunks/classPrivateFieldSet2-EAQNhHs8.js +1 -0
- package/dist/chunks/claudeDesktop-D0S1eq1F.js +1 -0
- package/dist/chunks/cleanup-Bg_gFgcj.js +1 -0
- package/dist/chunks/clear-OudnCGa7.js +1 -0
- package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
- package/dist/chunks/client-CPn1wQyc.js +7 -0
- package/dist/chunks/client-DxDmXXTh.js +1 -0
- package/dist/chunks/client-_sjL0I7A.js +35 -0
- package/dist/chunks/color-DG_R5-hl.js +1 -0
- package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
- package/dist/chunks/commands-BWIOEBPs.js +1 -0
- package/dist/chunks/commitAttribution-BA4fcbHf.js +1 -0
- package/dist/chunks/commitAttribution-C22a3OCi.js +2 -0
- package/dist/chunks/common-B379wT22.js +1 -0
- package/dist/chunks/common-B_BC3eMY.js +1 -0
- package/dist/chunks/common-CMCv4N_v.js +1 -0
- package/dist/chunks/compact-BWvnb4or.js +3 -0
- package/dist/chunks/companion-Bkn2lSLj.js +1 -0
- package/dist/chunks/completionCache-DHfUBBMH.js +1 -0
- package/dist/chunks/completionCache-DORrtxkS.js +4 -0
- package/dist/chunks/computerUseLock-BjoDJH2h.js +1 -0
- package/dist/chunks/config-BvpTbJ5p.js +1 -0
- package/dist/chunks/config-D-dzD6n-.js +1 -0
- package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
- package/dist/chunks/constants-41VpZw2G.js +1 -0
- package/dist/chunks/context-DzNahdyP.js +1 -0
- package/dist/chunks/context-noninteractive-CM1-lUSe.js +1 -0
- package/dist/chunks/context-noninteractive-yiyJriiw.js +54 -0
- package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
- package/dist/chunks/conversation-DKlz47xf.js +1 -0
- package/dist/chunks/conversation-cUxdb8MN.js +1 -0
- package/dist/chunks/copy-9k9JPRqW.js +7 -0
- package/dist/chunks/createSSHSession-BZf-Loo5.js +6 -0
- package/dist/chunks/createSession-BuJcoBAj.js +1 -0
- package/dist/chunks/createSession-kiTHYXSL.js +1 -0
- package/dist/chunks/cron-DiW7eIPP.js +1 -0
- package/dist/chunks/cronJitterConfig-CYP7yrQu.js +6 -0
- package/dist/chunks/crossProjectResume-BJisir9Z.js +40 -0
- package/dist/chunks/cwd--iizewsn.js +1 -0
- package/dist/chunks/cwd-BgpSJxd7.js +1 -0
- package/dist/chunks/daemon-VYRit6Aq.js +2 -0
- package/dist/chunks/dangerousBackend-BU_PHGR2.js +1 -0
- package/dist/chunks/datadog-Bg-zL-i7.js +1 -0
- package/dist/chunks/datadog-CVeFkaQu.js +1 -0
- package/dist/chunks/debug-DM5ezCBS.js +1 -0
- package/dist/chunks/debug-UI3T040K.js +5 -0
- package/dist/chunks/debugUtils-BBMFODKH.js +1 -0
- package/dist/chunks/defineProperty-80gRi2ZW.js +1 -0
- package/dist/chunks/desktop-DpaStjc-.js +1 -0
- package/dist/chunks/detached-D300jlhj.js +5 -0
- package/dist/chunks/detect-libc-DNuQfUvI.js +1 -0
- package/dist/chunks/detectRepository-CBk3S2zv.js +1 -0
- package/dist/chunks/detectRepository-DCTvg4p0.js +1 -0
- package/dist/chunks/detection-CQsNad64.js +1 -0
- package/dist/chunks/detection-DJ-vTbBf.js +1 -0
- package/dist/chunks/diff-N_VSBo3Z.js +1 -0
- package/dist/chunks/directoryCompletion-DP_4B1GL.js +1 -0
- package/dist/chunks/dist-CanSxOZ1.js +5 -0
- package/dist/chunks/dist-Cg1a1Exw.js +29 -0
- package/dist/chunks/dist-Q7YNoZ0H.js +20 -0
- package/dist/chunks/dist-es-4z5T3Jzm.js +1 -0
- package/dist/chunks/dist-es-B2jg52tM2.js +1 -0
- package/dist/chunks/dist-es-B6OXHQ1S.js +1 -0
- package/dist/chunks/dist-es-B8NEy5hc.js +1 -0
- package/dist/chunks/dist-es-BVGppqE4.js +1 -0
- package/dist/chunks/dist-es-Bcw5GZko.js +1 -0
- package/dist/chunks/dist-es-BoIJpncb.js +9 -0
- package/dist/chunks/dist-es-Bu_Fshi1.js +1 -0
- package/dist/chunks/dist-es-C-1vn4OP2.js +1 -0
- package/dist/chunks/dist-es-C41b_0B5.js +1 -0
- package/dist/chunks/dist-es-CCZYybbG2.js +1 -0
- package/dist/chunks/dist-es-CLK1mey-.js +1 -0
- package/dist/chunks/dist-es-CQz2aNf72.js +1 -0
- package/dist/chunks/dist-es-CSfI8B8l.js +1 -0
- package/dist/chunks/dist-es-CUZBYppo.js +1 -0
- package/dist/chunks/dist-es-CZkzHpjF.js +1 -0
- package/dist/chunks/dist-es-Cbf0_D8d.js +5 -0
- package/dist/chunks/dist-es-ChHe-SVL.js +1 -0
- package/dist/chunks/dist-es-ClYOf0My.js +1 -0
- package/dist/chunks/dist-es-D-kJbj4A2.js +1 -0
- package/dist/chunks/dist-es-D1LN6CJd.js +1 -0
- package/dist/chunks/dist-es-DC1sC3ph.js +1 -0
- package/dist/chunks/dist-es-DGn8uOwQ2.js +1 -0
- package/dist/chunks/dist-es-DK5fTeKM2.js +1 -0
- package/dist/chunks/dist-es-DN7otr6F.js +1 -0
- package/dist/chunks/dist-es-DPM0mPK5.js +1 -0
- package/dist/chunks/dist-es-DqZAh3nG.js +1 -0
- package/dist/chunks/dist-es-DuAZyxJ02.js +5 -0
- package/dist/chunks/dist-es-HVQrM0oE.js +1 -0
- package/dist/chunks/dist-es-OVleIB54.js +1 -0
- package/dist/chunks/dist-es-UAs0rdXg.js +1 -0
- package/dist/chunks/dist-es-WvMMuHmx2.js +1 -0
- package/dist/chunks/dist-es-fjXft-jH.js +1 -0
- package/dist/chunks/dist-es-hdN_ShpZ.js +3 -0
- package/dist/chunks/dist-es-neiUvMJb.js +1 -0
- package/dist/chunks/dist-es-yMYpDtui2.js +1 -0
- package/dist/chunks/dist-es-zjcbuB72.js +1 -0
- package/dist/chunks/distRoot-CcxmnzqQ.js +1 -0
- package/dist/chunks/doctor-CUWjbh1X.js +1 -0
- package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
- package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
- package/dist/chunks/effort-loH1TUvE.js +9 -0
- package/dist/chunks/entry-D58E-E6Y.js +14 -0
- package/dist/chunks/env-chR0gV31.js +1 -0
- package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +1 -0
- package/dist/chunks/envLessBridgeConfig-SPEr9oqO.js +1 -0
- package/dist/chunks/envUtils-BWeoiL4Y.js +1 -0
- package/dist/chunks/escHotkey-Cyz0yyh1.js +259 -0
- package/dist/chunks/esm--xjzB1hI.js +1 -0
- package/dist/chunks/esm-B2HIF0XY.js +1 -0
- package/dist/chunks/esm-BGQPWnJy.js +1 -0
- package/dist/chunks/esm-C-1qL9Mn.js +1 -0
- package/dist/chunks/esm-C3jcs1DH.js +1 -0
- package/dist/chunks/esm-C97WL9nC.js +1 -0
- package/dist/chunks/esm-CIL-SKM8.js +1 -0
- package/dist/chunks/esm-CJlBxjtx.js +1 -0
- package/dist/chunks/esm-CsGLyWmS.js +56 -0
- package/dist/chunks/esm-DQHmDm-H.js +1 -0
- package/dist/chunks/esm-DcdOXSzi.js +1 -0
- package/dist/chunks/esm-DhNYgGTV.js +1 -0
- package/dist/chunks/esm-DxPW7qPs.js +1 -0
- package/dist/chunks/esm-FBUWr3vI.js +1 -0
- package/dist/chunks/esm-QgL6y---.js +10 -0
- package/dist/chunks/esm-v0kPjgVS.js +1 -0
- package/dist/chunks/esm-vIn-YV_h.js +1 -0
- package/dist/chunks/event-streams-BV7ngMXu.js +1 -0
- package/dist/chunks/eventLoopStallDetector-Dnh1fc31.js +1 -0
- package/dist/chunks/execAsync-BkA6ogic.js +1 -0
- package/dist/chunks/execFileNoThrow-CuQN1sz8.js +1 -0
- package/dist/chunks/execSyncWrapper-C2XQnFVo.js +1 -0
- package/dist/chunks/execa-CGue6Z3n.js +34 -0
- package/dist/chunks/executor-4EeD8GNm.js +1561 -0
- package/dist/chunks/executor-BHEuNh5F.js +1 -0
- package/dist/chunks/exit-D-tuPpbx.js +1 -0
- package/dist/chunks/exit-_obETqBv.js +2 -0
- package/dist/chunks/export-BIZ_SPXJ.js +2 -0
- package/dist/chunks/exportRenderer-CWPSMaqM.js +1 -0
- package/dist/chunks/extra-usage-CCMwIa85.js +1 -0
- package/dist/chunks/extra-usage-core-BNW4VT7o.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-B_WjXO1E.js +1 -0
- package/dist/chunks/extra-usage-rdJ7ecEb.js +1 -0
- package/dist/chunks/extraUsage-CNMMTNJi.js +1 -0
- package/dist/chunks/extractMemories-BrvZVsmM.js +1 -0
- package/dist/chunks/fast-CG1v3fRr.js +1 -0
- package/dist/chunks/fast-CLKKsx2H.js +1 -0
- package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
- package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
- package/dist/chunks/feedback-CG4mS_-B.js +1 -0
- package/dist/chunks/figures-gfT9mM8P.js +1 -0
- package/dist/chunks/fileStateCache-C7-TxF8G.js +1 -0
- package/dist/chunks/files-DYvAZGxp.js +2 -0
- package/dist/chunks/firstPartyEventLogger-Y_jAnHoR.js +1 -0
- package/dist/chunks/flushGate-COPcye5f.js +1 -0
- package/dist/chunks/foundry-sdk-BFN5VDFQ.js +1 -0
- package/dist/chunks/fpsMetrics-DeezdcwV.js +1 -0
- package/dist/chunks/fuse-Ch_OAlm3.js +1 -0
- package/dist/chunks/gates-CSHuXnUx.js +1 -0
- package/dist/chunks/gates-CSKxLmMJ.js +1 -0
- package/dist/chunks/gemini-B3uSLiNp.js +1 -0
- package/dist/chunks/generateRecap-D7rG3jIm.js +1 -0
- package/dist/chunks/generateSessionName-zbqanivg.js +1 -0
- package/dist/chunks/genericProcessUtils-BGvcwuPt.js +23 -0
- package/dist/chunks/getMachineId-bsd-BMtYGBUL.js +1 -0
- package/dist/chunks/getMachineId-darwin-CiLdFH7z.js +2 -0
- package/dist/chunks/getMachineId-linux-Cr27rIeY.js +1 -0
- package/dist/chunks/getMachineId-unsupported-ceiBLwAN.js +1 -0
- package/dist/chunks/getMachineId-win-DFTmsQHq.js +1 -0
- package/dist/chunks/git-CN3qtTb_.js +6 -0
- package/dist/chunks/git-D23Mzu_K.js +1 -0
- package/dist/chunks/githubRepoPathMapping-B04nEUDG.js +1 -0
- package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
- package/dist/chunks/grok-CDOpos8E.js +1 -0
- package/dist/chunks/growthbook-C_EY78Sn.js +1 -0
- package/dist/chunks/hash-BRmOQc3c.js +1 -0
- package/dist/chunks/heapdump-CpmhJ55b.js +5 -0
- package/dist/chunks/help-EHn2neTv.js +1 -0
- package/dist/chunks/hooks-BFdX17Za.js +1 -0
- package/dist/chunks/hooks-BV6HqbU4.js +79 -0
- package/dist/chunks/hostAdapter-_SmFAVNf.js +1 -0
- package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
- package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
- package/dist/chunks/ide-DkN0KdTR.js +2 -0
- package/dist/chunks/inboundAttachments-BVUunfAX.js +1 -0
- package/dist/chunks/inboundAttachments-DnGQw7Pf.js +1 -0
- package/dist/chunks/index.min-BJnb9GQI.js +1 -0
- package/dist/chunks/initReplBridge-tPRGPBq7.js +1 -0
- package/dist/chunks/insights-Bs9kJDG6.js +822 -0
- package/dist/chunks/install-CFX_ph9z.js +1 -0
- package/dist/chunks/install-github-app-CvRjY1Wi.js +147 -0
- package/dist/chunks/install-slack-app-DjhnVSe0.js +1 -0
- package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
- package/dist/chunks/instrumentation-c5zlOWom.js +12 -0
- package/dist/chunks/intl-Pse97ORk.js +1 -0
- package/dist/chunks/isObject-DaxDnPKm.js +1 -0
- package/dist/chunks/isSymbol-Dp3irZaY.js +1 -0
- package/dist/chunks/job-3QwLq609.js +2 -0
- package/dist/chunks/json-bigint-OxRwRvup.js +8 -0
- package/dist/chunks/jsx-runtime-D-D469L8.js +1 -0
- package/dist/chunks/jws-2vqRyZtR.js +3 -0
- package/dist/chunks/jwtUtils-CpXwh_du.js +1 -0
- package/dist/chunks/keybindings-7mDm3UKD.js +2 -0
- package/dist/chunks/lang-DyyjY20G.js +1 -0
- package/dist/chunks/language-CPRGmY8Q.js +1 -0
- package/dist/chunks/language-Cf6bMI4N.js +1 -0
- package/dist/chunks/launchAgentsPlatform-CpsMsTqQ.js +1 -0
- package/dist/chunks/launchAutofixPr-D9h6YAZY.js +2 -0
- package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
- package/dist/chunks/launchLocalMemory-DlYQcEQJ.js +3 -0
- package/dist/chunks/launchLocalVault-CP0AyPjj.js +3 -0
- package/dist/chunks/launchMemoryStores-BHoDFkJ5.js +1 -0
- package/dist/chunks/launchOnboarding-CFTNXcnc.js +8 -0
- package/dist/chunks/launchSchedule-5KQr6x_A.js +1 -0
- package/dist/chunks/launchSkillStore-D0yGuE68.js +1 -0
- package/dist/chunks/launchTeleport-DRKnXOwY.js +3 -0
- package/dist/chunks/launchVault-XA-zAswX.js +1 -0
- package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
- package/dist/chunks/lib-B4Q0Nrpb.js +14 -0
- package/dist/chunks/lib-Ca3QWJjN.js +2 -0
- package/dist/chunks/lib-inCisXen.js +8 -0
- package/dist/chunks/loadAgentsDir-DCyiY0MN.js +1 -0
- package/dist/chunks/loadAgentsDir-DI1a76pd.js +4601 -0
- package/dist/chunks/loadPluginHooks-C0Ei-0E2.js +1 -0
- package/dist/chunks/loadSso-sDs471GC.js +1 -0
- package/dist/chunks/localSearch-CDOJNc_E.js +1 -0
- package/dist/chunks/localSearch-MBx7KzC2.js +1 -0
- package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
- package/dist/chunks/log-CzsijfHZ.js +1 -0
- package/dist/chunks/login-D8UKKaud.js +1 -0
- package/dist/chunks/login-nwTOoyxv.js +1 -0
- package/dist/chunks/logoV2Utils-DDUoPClc.js +1 -0
- package/dist/chunks/logout-B0BjqlGi.js +1 -0
- package/dist/chunks/magicDocs-CmUlOWjI.js +57 -0
- package/dist/chunks/main-C6be1KFk.js +31 -0
- package/dist/chunks/main-CeG_nUsC.js +1108 -0
- package/dist/chunks/mappers-CJ8IO1o1.js +1 -0
- package/dist/chunks/mcp-CanCqnch.js +2 -0
- package/dist/chunks/mcp-Dq0kxZFx.js +6 -0
- package/dist/chunks/mcp-zbxZM9BP.js +1 -0
- package/dist/chunks/mcpServer-DPHQVYdC.js +1 -0
- package/dist/chunks/mcpServer-lIneUZ5p.js +1 -0
- package/dist/chunks/memoize-DNnuA2aU.js +1 -0
- package/dist/chunks/memoize-DxwLawI2.js +1 -0
- package/dist/chunks/memory-BcWBkKV8.js +1 -0
- package/dist/chunks/mobile-umu5P0cM.js +2 -0
- package/dist/chunks/modalContext-CmSKRyea.js +1 -0
- package/dist/chunks/model-DJLzVvcF.js +1 -0
- package/dist/chunks/model-H3rtl6eR.js +1 -0
- package/dist/chunks/normalization-Cox8C0dP.js +1 -0
- package/dist/chunks/oauth-CdZEzMww.js +1 -0
- package/dist/chunks/oauth-CmensepG.js +1 -0
- package/dist/chunks/observationStore-tvkldXUo.js +4 -0
- package/dist/chunks/onChangeAppState-Dxbl8fvk.js +1 -0
- package/dist/chunks/open-CDditBQ-.js +1 -0
- package/dist/chunks/openai-DkYK4THc.js +10 -0
- package/dist/chunks/openaiShared-D5lOejS1.js +16 -0
- package/dist/chunks/output-style-XDb9-2Kk.js +1 -0
- package/dist/chunks/overageCreditGrant-DLKadMYU.js +1 -0
- package/dist/chunks/p-map-9Ud1LOrJ.js +1 -0
- package/dist/chunks/p-map-D7WEmnBE.js +1 -0
- package/dist/chunks/package-BhL7chzt.js +1 -0
- package/dist/chunks/panel-ByW1omJn.js +1 -0
- package/dist/chunks/panel-Bz_8td5D.js +1 -0
- package/dist/chunks/parseConnectUrl-BS6i9JPo.js +1 -0
- package/dist/chunks/parser-CmngCwjB.js +1 -0
- package/dist/chunks/parser-SWIZo39J.js +1 -0
- package/dist/chunks/passes-BIfuerjL.js +1 -0
- package/dist/chunks/path-C4kbwvSH.js +1 -0
- package/dist/chunks/paths-BBvuDQl9.js +39 -0
- package/dist/chunks/permissions-DXLfdE7b.js +1 -0
- package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
- package/dist/chunks/permissions-S2EvIRKj.js +3 -0
- package/dist/chunks/pipeTransport-DVoIA1uN.js +1 -0
- package/dist/chunks/plan--lnWxB3Q.js +1 -0
- package/dist/chunks/platform-CuyedWpe.js +2 -0
- package/dist/chunks/plist-BO4ZqMZc.js +6 -0
- package/dist/chunks/plugin-DWLyrLw4.js +1 -0
- package/dist/chunks/pluginAutoupdate-CGXIWBrb.js +1 -0
- package/dist/chunks/pluginBlocklist-DJrMdzT0.js +1 -0
- package/dist/chunks/pluginCliCommands-C08q9dHk.js +1 -0
- package/dist/chunks/pluginFlagging-Dggxke70.js +1 -0
- package/dist/chunks/pluginOperations-CNCImIe8.js +2 -0
- package/dist/chunks/pluginStartupCheck-BW2fjg2P.js +1 -0
- package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +1 -0
- package/dist/chunks/plugins-DQ3CRWWO.js +4 -0
- package/dist/chunks/policyLimits-BotYrS-v.js +1 -0
- package/dist/chunks/pollConfig-DAQ-ives.js +1 -0
- package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
- package/dist/chunks/poor-DqfrQT61.js +1 -0
- package/dist/chunks/poorMode-DEAe3hiK.js +1 -0
- package/dist/chunks/poorMode-DzYT47KW.js +1 -0
- package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
- package/dist/chunks/print-GGVp62vj.js +39 -0
- package/dist/chunks/privacy-settings-agwqjYJo.js +1 -0
- package/dist/chunks/process-CWupreF6.js +1 -0
- package/dist/chunks/process-DMKLUQIO.js +1 -0
- package/dist/chunks/processBashCommand-DHHN8Ca4.js +1 -0
- package/dist/chunks/processSlashCommand-COtIO6Jy.js +6 -0
- package/dist/chunks/projectContext-0fpRKUeH.js +1 -0
- package/dist/chunks/projectContext-eXMSfgdZ.js +1 -0
- package/dist/chunks/prompt-4tea6NJQ.js +54 -0
- package/dist/chunks/prompt-CO160cIr.js +1 -0
- package/dist/chunks/prompt-CjFAtm3w.js +222 -0
- package/dist/chunks/prompt-GY9hlRvI.js +1 -0
- package/dist/chunks/promptEditor-EgosPsy-.js +4 -0
- package/dist/chunks/protocolHandler-mtPUT9U0.js +13 -0
- package/dist/chunks/protocols-CAyQOlkr.js +7 -0
- package/dist/chunks/proxy-CfZp-wce.js +99 -0
- package/dist/chunks/rate-limit-options-C6SFOHue.js +1 -0
- package/dist/chunks/rcDebugLog-CPKZCtR8.js +11 -0
- package/dist/chunks/referral-DeDr9zAE.js +1 -0
- package/dist/chunks/refresh-D7pdoY_X.js +1 -0
- package/dist/chunks/registerProtocol-BZBH8Zgl.js +36 -0
- package/dist/chunks/registry-Dz6AbiYP.js +1 -0
- package/dist/chunks/release-notes-DiUNOrg9.js +4 -0
- package/dist/chunks/releaseNotes-CnhQit0y.js +2 -0
- package/dist/chunks/reload-plugins-Dx52GcaG.js +1 -0
- package/dist/chunks/remote-env-B67Oo3sI.js +1 -0
- package/dist/chunks/remoteBridgeCore-BzSUgPbt.js +1 -0
- package/dist/chunks/remoteControlServer-L8smP7Zu.js +3 -0
- package/dist/chunks/rename-C4PauyTZ.js +1 -0
- package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
- package/dist/chunks/resume-CrSn26xq.js +2 -0
- package/dist/chunks/rewind-CXplHgh_.js +1 -0
- package/dist/chunks/rollback-DbSpxmJE.js +11 -0
- package/dist/chunks/runtimeObserver-YNy3mIb7.js +1 -0
- package/dist/chunks/runtimeObserver-nAhH4Wca.js +10 -0
- package/dist/chunks/sandbox-adapter-CzwHes1i.js +1 -0
- package/dist/chunks/sandbox-toggle-BYqbcI5d.js +1 -0
- package/dist/chunks/sanitization-CYp-9DbE.js +1 -0
- package/dist/chunks/satisfies-BaHgd_ie.js +1 -0
- package/dist/chunks/schemas-BGAvj1T4.js +40 -0
- package/dist/chunks/sdk-DEtgRZvI.js +1 -0
- package/dist/chunks/sdkHeapDumpMonitor--fevrC5z.js +1 -0
- package/dist/chunks/searchExtraTools-CcpdCO6l.js +1 -0
- package/dist/chunks/semver-Cq33BYay.js +1 -0
- package/dist/chunks/semver-Tw0AFar5.js +1 -0
- package/dist/chunks/sentry-BNVxoVLS.js +13 -0
- package/dist/chunks/server-C5XZSlto.js +1 -0
- package/dist/chunks/server-DzOdtq8A.js +1 -0
- package/dist/chunks/serverBanner-WlSYP-f8.js +1 -0
- package/dist/chunks/serverLog-DtsUvDiY.js +1 -0
- package/dist/chunks/session-BuEmHrqM.js +2 -0
- package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
- package/dist/chunks/sessionDiscovery-Mcsfa0g-.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +1 -0
- package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
- package/dist/chunks/sessionMemory-CMahwDdW.js +1 -0
- package/dist/chunks/sessionMemory-pFSn4HSN.js +1 -0
- package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +1 -0
- package/dist/chunks/sessionObserver-DG2zQgfi.js +20 -0
- package/dist/chunks/sessionObserver-Je868MC9.js +1 -0
- package/dist/chunks/sessionStorage-D3FhAADV.js +1 -0
- package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
- package/dist/chunks/sessionTitle-zUVSAHO7.js +14 -0
- package/dist/chunks/sessionTracing-DoRJ4nSa.js +11 -0
- package/dist/chunks/settingsSync-B9bz77E1.js +1 -0
- package/dist/chunks/setup-B1JbPepL.js +9 -0
- package/dist/chunks/setup-CCOLlRtP.js +1 -0
- package/dist/chunks/setup-DWkSjA49.js +2 -0
- package/dist/chunks/shadowedRuleDetection-BBR3uEgx.js +1 -0
- package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
- package/dist/chunks/sideQuestion-DHW5rgKz.js +20 -0
- package/dist/chunks/signin-QEeYpJZw.js +1 -0
- package/dist/chunks/sink-DxDOsLa2.js +1 -0
- package/dist/chunks/sink-cQOgsnw3.js +1 -0
- package/dist/chunks/sinks-BrrTUxkC.js +2 -0
- package/dist/chunks/sinks-Djiz_5-Z.js +1 -0
- package/dist/chunks/skill-learning-C0nOKZfg.js +5 -0
- package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +1 -0
- package/dist/chunks/skillGapStore-Czi5jKjJ.js +1 -0
- package/dist/chunks/skillGapStore-_YuJP5KI.js +5 -0
- package/dist/chunks/skillGenerator-kbaRbpqJ.js +8 -0
- package/dist/chunks/skillLearning-3KWrBczS.js +1 -0
- package/dist/chunks/skillLearning-DBbdGbk-.js +1 -0
- package/dist/chunks/skillPanel-BxDvlPzd.js +28 -0
- package/dist/chunks/skillSearchPanel-D-MX6Qgt.js +21 -0
- package/dist/chunks/skills-NpEgFkFZ.js +1 -0
- package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
- package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
- package/dist/chunks/sprites-DD4eIkN7.js +1 -0
- package/dist/chunks/src-BIPP3_mo.js +26 -0
- package/dist/chunks/src-BJz1KAd_.js +6 -0
- package/dist/chunks/src-BRAdBA8A.js +1 -0
- package/dist/chunks/src-BRC_BuUP.js +1 -0
- package/dist/chunks/src-BaB-bpCj.js +5 -0
- package/dist/chunks/src-BlLavFUS.js +7 -0
- package/dist/chunks/src-C5yhFG0C.js +19 -0
- package/dist/chunks/src-CI_jaaBj.js +2 -0
- package/dist/chunks/src-CRsA-Z4y.js +1 -0
- package/dist/chunks/src-CYLfL70h.js +1 -0
- package/dist/chunks/src-DJXCzwyJ.js +1 -0
- package/dist/chunks/src-DJXKJavk.js +1 -0
- package/dist/chunks/src-Di342QoJ.js +53 -0
- package/dist/chunks/src-DsMd9Q9e.js +2 -0
- package/dist/chunks/src-DzH9IdOo.js +1 -0
- package/dist/chunks/src-hdbPEvzO.js +9 -0
- package/dist/chunks/src-poaoYkuc.js +1 -0
- package/dist/chunks/src-x7u_sB6m.js +1 -0
- package/dist/chunks/sso-oidc-BX1MlBX0.js +1 -0
- package/dist/chunks/startupProfiler-DnXZaX4A.js +3 -0
- package/dist/chunks/startupProfiler-SOE--nM9.js +1 -0
- package/dist/chunks/state-B2GIOsTB.js +1 -0
- package/dist/chunks/state-Ce1HlR-H.js +1 -0
- package/dist/chunks/state-sIHsFpDu.js +1 -0
- package/dist/chunks/staticRender-Br64h1E1.js +1 -0
- package/dist/chunks/stats-xL3NHwhp.js +1 -0
- package/dist/chunks/status-B5E70xRv.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DcssRhLw.js +1 -0
- package/dist/chunks/stdio-BEEzuxaZ.js +1 -0
- package/dist/chunks/stdio-D4cT86R0.js +3 -0
- package/dist/chunks/stickers-2K05wjSp.js +1 -0
- package/dist/chunks/store-DhI7Lcan.js +1 -0
- package/dist/chunks/sts-BDFJ-6QE.js +1 -0
- package/dist/chunks/subprocessEnv-CggQWZCx.js +1 -0
- package/dist/chunks/subprocessEnv-DV6q6o6w.js +1 -0
- package/dist/chunks/supports-color-lkzOMQ6u.js +1 -0
- package/dist/chunks/systemPromptSections-BcN_XBTx.js +1 -0
- package/dist/chunks/systemPromptSections-DB93ZNWP.js +1 -0
- package/dist/chunks/systemTheme-dDbitcxB.js +1 -0
- package/dist/chunks/tag-BELr-qIa.js +11 -0
- package/dist/chunks/tasks-CrdWcSt-.js +1 -0
- package/dist/chunks/teamHelpers--3ZyNDlv.js +1 -0
- package/dist/chunks/teamHelpers-CUAiXng3.js +1 -0
- package/dist/chunks/teammate-DMYOtLTK.js +1 -0
- package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +1 -0
- package/dist/chunks/teammateModeSnapshot-DOQMTKbQ.js +1 -0
- package/dist/chunks/teleport-LXFOan9C.js +1 -0
- package/dist/chunks/templateJobs-8IY2Cgig.js +12 -0
- package/dist/chunks/terminalSetup-C4psrmpb.js +1 -0
- package/dist/chunks/terminalSetup-Lyg4NbGA.js +33 -0
- package/dist/chunks/theme-B8GNnJ_q.js +1 -0
- package/dist/chunks/thinkback-DPXwEK3B.js +1 -0
- package/dist/chunks/thinkback-DZW3Mcx_.js +1 -0
- package/dist/chunks/thinkback-play-BMOE-ceh.js +1 -0
- package/dist/chunks/tmux-CvbhsfwG.js +1 -0
- package/dist/chunks/toolEventObserver-D0TSHm01.js +1 -0
- package/dist/chunks/toolEventObserver-DzLd0MSn.js +1 -0
- package/dist/chunks/toolPool-DVOfpjDz.js +1 -0
- package/dist/chunks/toolPool-Dq-Vtvrj.js +1 -0
- package/dist/chunks/trustedDevice-1iTu4LEm.js +1 -0
- package/dist/chunks/trustedDevice-BvYYXfd8.js +1 -0
- package/dist/chunks/tui-BVc2q4Xv.js +6 -0
- package/dist/chunks/turndown.es-Bv06VjMb.js +69 -0
- package/dist/chunks/types-CQ1wrnQ0.js +1 -0
- package/dist/chunks/types-Csi32ZXh.js +17 -0
- package/dist/chunks/types-RJTEOuIt.js +3 -0
- package/dist/chunks/udsClient-BvG_Jip0.js +1 -0
- package/dist/chunks/ultrareviewCommand-BTXAN2wP.js +3 -0
- package/dist/chunks/undercover-C_44e3oN.js +1 -0
- package/dist/chunks/undercover-DvvnEmsX.js +31 -0
- package/dist/chunks/up-D-U4wUCe.js +12 -0
- package/dist/chunks/updateCCB-C-qfLi0j.js +11 -0
- package/dist/chunks/upgrade-CGXa5Dwy.js +1 -0
- package/dist/chunks/upgrade-DTBZSxwv.js +1 -0
- package/dist/chunks/upload-BF8tf_Eo.js +1 -0
- package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
- package/dist/chunks/usage-BRYRRgNt.js +1 -0
- package/dist/chunks/usage-DvSTXEYY.js +1 -0
- package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
- package/dist/chunks/useMainLoopModel-CwvuTRXn.js +1 -0
- package/dist/chunks/useManagePlugins-GmnI9K53.js +1 -0
- package/dist/chunks/useMergedTools-Dah5KDMi.js +1 -0
- package/dist/chunks/useSearchInput-BV_azHiA.js +1 -0
- package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +1 -0
- package/dist/chunks/useVoice-DR69NLxp.js +1 -0
- package/dist/chunks/util-BpyJ4Bom.js +1 -0
- package/dist/chunks/utils-CrZcpypC.js +1 -0
- package/dist/chunks/v4-f1i_CNUT.js +1 -0
- package/dist/chunks/validatePlugin-vptAYuYu.js +1 -0
- package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
- package/dist/chunks/vim-DvOw8dfR.js +1 -0
- package/dist/chunks/voice-B3BZs53f.js +2 -0
- package/dist/chunks/voice-DXiiy8HX.js +8 -0
- package/dist/chunks/voiceModeEnabled-DA76xN1Q.js +1 -0
- package/dist/chunks/voiceModeEnabled-DIveLYGb.js +1 -0
- package/dist/chunks/voiceStreamSTT-_w1VjIOs.js +1 -0
- package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +1 -0
- package/dist/chunks/which-DqSAIvp2.js +1 -0
- package/dist/chunks/windowsPaths-C9CigqoF.js +1 -0
- package/dist/chunks/windowsPaths-swxCp7bX.js +2 -0
- package/dist/chunks/workSecret-mS2OrpxF.js +1 -0
- package/dist/chunks/workerRegistry-2_MZVih1.js +1 -0
- package/dist/chunks/worktree-CCuDwRmS.js +1 -0
- package/dist/chunks/worktreeModeEnabled-Db6b_Iy_.js +1 -0
- package/dist/chunks/worktreeModeEnabled-THQb19xR.js +1 -0
- package/dist/chunks/wrapper-BSK0MCQH.js +1 -0
- package/dist/chunks/wrapper-D5qL1aQL.js +6 -0
- package/dist/chunks/xdg-CBxMmQux.js +1 -0
- package/dist/chunks/xml-Dx--sNE1.js +1 -0
- package/dist/chunks/zod-DT6hytkp.js +1 -0
- package/dist/cli.js +1 -10978
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"./chunk-DR8-3Aex.js";import{n as a,t as o}from"./defineProperty-80gRi2ZW.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g}from"./classPrivateFieldSet2-EAQNhHs8.js";import{t as _}from"./src-BaB-bpCj.js";import{a as v,b as y,c as b,d as x,h as S,i as C,l as w,n as T,o as E,r as D,s as O,t as k,v as ee,x as te,y as ne}from"./esm-CJlBxjtx.js";import{$ as re,A,At as j,F as ie,G as ae,H as M,I as N,J as oe,K as se,L as ce,M as le,N as ue,Ot as de,P,Q as fe,R as pe,U as me,W as he,X as ge,Y as _e,Z as ve,bt as ye,c as be,dt as xe,et as Se,ft as Ce,g as we,h as Te,ht as Ee,it as De,j as F,jt as Oe,k as ke,lt as Ae,m as je,mt as Me,nt as Ne,ot as Pe,p as Fe,pt as Ie,q as Le,rt as Re,st as ze,tt as Be,vt as Ve,xt as He,yt as Ue}from"./esm-DcdOXSzi.js";import{d as We,s as Ge}from"./debug-UI3T040K.js";import{i as Ke,o as qe,t as Je}from"./esm-C-1qL9Mn.js";import*as Ye from"path";import{normalize as Xe,normalize as Ze}from"path";import{AsyncLocalStorage as Qe}from"node:async_hooks";import*as $e from"node:util";import{promisify as et}from"node:util";import{createInterface as tt}from"node:readline";import{dirname as nt,join as rt,posix as it,sep as at}from"node:path";import{readFileSync as ot}from"fs";import{execFile as st}from"node:child_process";import{createReadStream as ct,existsSync as lt,readFile as ut,readFileSync as dt,readdir as ft}from"node:fs";import*as pt from"node:os";import*as mt from"module";import{inspect as ht,types as gt}from"util";import{EventEmitter as _t,errorMonitor as vt}from"node:events";import{Readable as yt}from"node:stream";import*as bt from"node:https";import*as xt from"node:http";import{createGzip as St}from"node:zlib";import*as Ct from"node:diagnostics_channel";import{subscribe as wt,unsubscribe as Tt}from"node:diagnostics_channel";import*as Et from"node:net";import*as Dt from"node:tls";import{Worker as Ot}from"node:worker_threads";import{isMainThread as kt,threadId as At}from"worker_threads";import*as jt from"diagnostics_channel";function Mt(e){return e.setValue(Ft,!0)}function Nt(e){return e.deleteValue(Ft)}function Pt(e){return e.getValue(Ft)===!0}var Ft,It=n((()=>{T(),Ft=ne(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)})),Lt,Rt,zt=n((()=>{Lt=`baggage`,Rt=4096}));function Bt(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Vt(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Ht(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=y(e.substring(t+1))),{key:o,value:s,metadata:c}}function Ut(e){let t={};return typeof e==`string`&&e.length>0&&e.split(`,`).forEach(e=>{let n=Ht(e);n!==void 0&&n.value.length>0&&(t[n.key]=n.value)}),t}var Wt=n((()=>{T(),zt()})),Gt,Kt=n((()=>{T(),It(),zt(),Wt(),Gt=class{inject(e,t,n){let r=C.getBaggage(e);if(!r||Pt(e))return;let i=Bt(Vt(r).filter(e=>e.length<=Rt).slice(0,180));i.length>0&&n.set(t,Lt,i)}extract(e,t,n){let r=n.get(t,Lt),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Ht(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:C.setBaggage(e,C.createBaggage(a))}fields(){return[Lt]}}})),qt,Jt=n((()=>{a(),qt=class{constructor(e,t){o(this,`_monotonicClock`,void 0),o(this,`_epochMillis`,void 0),o(this,`_performanceMillis`,void 0),this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}}));function Yt(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Xt(n)){E.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Zt(r)){E.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Xt(e){return typeof e==`string`&&e!==``}function Zt(e){return e==null?!0:Array.isArray(e)?Qt(e):$t(typeof e)}function Qt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if($t(e)){t=e;continue}return!1}return!1}}return!0}function $t(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var en=n((()=>{T()}));function tn(){return e=>{E.error(nn(e))}}function nn(e){return typeof e==`string`?e:JSON.stringify(rn(e))}function rn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var an=n((()=>{T()}));function on(e){cn=e}function sn(e){try{cn(e)}catch{}}var cn,ln=n((()=>{an(),cn=tn()}));function un(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){E.warn(`Unknown value ${ht(t)} for ${e}, expected a number, using defaults`);return}return n}function dn(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}function fn(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===``?!1:t===`true`?!0:(t===`false`||E.warn(`Unknown value ${ht(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function pn(e){return dn(e)?.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}var mn=n((()=>{T()})),hn,gn=n((()=>{hn=globalThis})),_n,vn=n((()=>{_n=`2.6.1`})),yn,bn=n((()=>{yn=`process.runtime.name`})),xn,Sn=n((()=>{vn(),F(),bn(),xn={[Se]:`opentelemetry`,[yn]:`node`,[re]:De,[Be]:_n}})),Cn,wn=n((()=>{mn(),gn(),Sn(),Cn=performance})),Tn=n((()=>{wn()}));function En(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*zn)]}function Dn(){return Cn.timeOrigin}function On(e){return Ln(En(Cn.timeOrigin),En(typeof e==`number`?e:Cn.now()))}function kn(e){if(Fn(e))return e;if(typeof e==`number`)return e<Cn.timeOrigin?On(e):En(e);if(e instanceof Date)return En(e.getTime());throw TypeError(`Invalid input type`)}function An(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=Bn),[n,r]}function jn(e){let t=Rn,n=`${`0`.repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace(`000Z`,r)}function Mn(e){return e[0]*Bn+e[1]}function Nn(e){return e[0]*1e3+e[1]/1e6}function Pn(e){return e[0]*1e6+e[1]/1e3}function Fn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function In(e){return Fn(e)||typeof e==`number`||e instanceof Date}function Ln(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Bn&&(n[1]-=Bn,n[0]+=1),n}var Rn,zn,Bn,Vn=n((()=>{Tn(),Rn=9,zn=10**6,Bn=10**Rn}));function Hn(e){typeof e!=`number`&&e.unref()}var Un=n((()=>{})),Wn,Gn=n((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(Wn||(Wn={}))})),Kn,qn=n((()=>{T(),a(),Kn=class{constructor(e={}){o(this,`_propagators`,void 0),o(this,`_fields`,void 0),this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>typeof e.fields==`function`?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){E.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){E.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}}));function Jn(e){return $n.test(e)}function Yn(e){return er.test(e)&&!tr.test(e)}var Xn,Zn,Qn,$n,er,tr,nr=n((()=>{Xn=`[_0-9a-z-*/]`,Zn=`[a-z]${Xn}{0,255}`,Qn=`[a-z0-9]${Xn}{0,240}@[a-z]${Xn}{0,13}`,$n=RegExp(`^(?:${Zn}|${Qn})$`),er=/^[ -~]{0,255}[!-~]$/,tr=/,|=/})),rr,ir,ar,or,sr,cr=n((()=>{nr(),a(),rr=32,ir=512,ar=`,`,or=`=`,sr=class e{constructor(e){o(this,`_internalState`,new Map),e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+or+this.get(t)),e),[]).join(ar)}_parse(e){e.length>ir||(this._internalState=e.split(ar).reverse().reduce((e,t)=>{let n=t.trim(),r=n.indexOf(or);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);Jn(i)&&Yn(a)&&e.set(i,a)}return e},new Map),this._internalState.size>rr&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,rr))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}}));function lr(e){let t=pr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var ur,dr,fr,pr,mr,hr=n((()=>{T(),It(),cr(),ur=`traceparent`,dr=`tracestate`,fr=`00`,pr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`),mr=class{inject(e,t,n){let r=D.getSpanContext(e);if(!r||Pt(e)||!x(r))return;let i=`${fr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||S.NONE).toString(16)}`;n.set(t,ur,i),r.traceState&&n.set(t,dr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,ur);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=lr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,dr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new sr(typeof e==`string`?e:void 0)}return D.setSpanContext(e,a)}fields(){return[ur,dr]}}}));function gr(e,t){return e.setValue(yr,t)}function _r(e){return e.deleteValue(yr)}function vr(e){return e.getValue(yr)}var yr,br,xr=n((()=>{T(),yr=ne(`OpenTelemetry SDK Context Key RPC_METADATA`),(function(e){e.HTTP=`http`})(br||(br={}))}));function Sr(e){if(!Cr(e)||wr(e)!==Dr)return!1;let t=Mr(e);if(t===null)return!0;let n=Pr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Ar.call(n)===jr}function Cr(e){return typeof e==`object`&&!!e}function wr(e){return e==null?e===void 0?kr:Or:Fr&&Fr in Object(e)?Tr(e):Er(e)}function Tr(e){let t=Pr.call(e,Fr),n=e[Fr],r=!1;try{e[Fr]=void 0,r=!0}catch{}let i=Ir.call(e);return r&&(t?e[Fr]=n:delete e[Fr]),i}function Er(e){return Ir.call(e)}var Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr=n((()=>{Dr=`[object Object]`,Or=`[object Null]`,kr=`[object Undefined]`,Ar=Function.prototype.toString,jr=Ar.call(Object),Mr=Object.getPrototypeOf,Nr=Object.prototype,Pr=Nr.hasOwnProperty,Fr=Symbol?Symbol.toStringTag:void 0,Ir=Nr.toString}));function Rr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Br(t,e.shift(),0,n);return t}function zr(e){return Hr(e)?e.slice():e}function Br(e,t,n=0,r){let i;if(!(n>qr)){if(n++,Gr(e)||Gr(t)||Ur(t))i=zr(t);else if(Hr(e)){if(i=e.slice(),Hr(t))for(let e=0,n=t.length;e<n;e++)i.push(zr(t[e]));else if(Wr(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];i[r]=zr(t[r])}}}else if(Wr(e))if(Wr(t)){if(!Kr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o],c=t[s];if(Gr(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Vr(e,s,r)||Vr(t,s,r))delete i[s];else{if(Wr(a)&&Wr(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Br(i[s],c,n,r)}}}}else i=t;return i}}function Vr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function Hr(e){return Array.isArray(e)}function Ur(e){return typeof e==`function`}function Wr(e){return!Gr(e)&&!Hr(e)&&!Ur(e)&&typeof e==`object`}function Gr(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Kr(e,t){return!(!Sr(e)||!Sr(t))}var qr,Jr=n((()=>{Lr(),qr=20}));function Yr(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new Xr(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}var Xr,Zr=n((()=>{Xr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}}));function Qr(e,t){return typeof t==`string`?e===t:!!e.match(t)}function $r(e,t){if(!t)return!1;for(let n of t)if(Qr(e,n))return!0;return!1}var ei=n((()=>{})),ti,ni=n((()=>{a(),ti=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),ri,ii=n((()=>{ni(),a(),ri=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new ti),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function ai(e){return e==null?void 0:oi[e.toUpperCase()]??(E.warn(`Unknown log level "${e}", expected one of ${Object.keys(oi)}, using default`),te.INFO)}var oi,si=n((()=>{T(),oi={ALL:te.ALL,VERBOSE:te.VERBOSE,DEBUG:te.DEBUG,INFO:te.INFO,WARN:te.WARN,ERROR:te.ERROR,NONE:te.NONE}}));function ci(e,t){return new Promise(n=>{O.with(Mt(O.active()),()=>{e.export(t,n)})})}var li=n((()=>{T(),It()})),ui=r({AnchoredClock:()=>qt,BindOnceFuture:()=>ri,CompositePropagator:()=>Kn,ExportResultCode:()=>Wn,RPCType:()=>br,SDK_INFO:()=>xn,TRACE_PARENT_HEADER:()=>ur,TRACE_STATE_HEADER:()=>dr,TimeoutError:()=>Xr,TraceState:()=>sr,W3CBaggagePropagator:()=>Gt,W3CTraceContextPropagator:()=>mr,_globalThis:()=>hn,addHrTimes:()=>Ln,callWithTimeout:()=>Yr,deleteRPCMetadata:()=>_r,diagLogLevelFromString:()=>ai,getBooleanFromEnv:()=>fn,getNumberFromEnv:()=>un,getRPCMetadata:()=>vr,getStringFromEnv:()=>dn,getStringListFromEnv:()=>pn,getTimeOrigin:()=>Dn,globalErrorHandler:()=>sn,hrTime:()=>On,hrTimeDuration:()=>An,hrTimeToMicroseconds:()=>Pn,hrTimeToMilliseconds:()=>Nn,hrTimeToNanoseconds:()=>Mn,hrTimeToTimeStamp:()=>jn,internal:()=>di,isAttributeValue:()=>Zt,isTimeInput:()=>In,isTimeInputHrTime:()=>Fn,isTracingSuppressed:()=>Pt,isUrlIgnored:()=>$r,loggingErrorHandler:()=>tn,merge:()=>Rr,millisToHrTime:()=>En,otperformance:()=>Cn,parseKeyPairsIntoRecord:()=>Ut,parseTraceParent:()=>lr,sanitizeAttributes:()=>Yt,setGlobalErrorHandler:()=>on,setRPCMetadata:()=>gr,suppressTracing:()=>Mt,timeInputToHrTime:()=>kn,unrefTimer:()=>Hn,unsuppressTracing:()=>Nt,urlMatches:()=>Qr}),di,fi=n((()=>{Kt(),Jt(),en(),ln(),an(),Vn(),Un(),Gn(),Wt(),Tn(),qn(),hr(),xr(),It(),cr(),Jr(),Zr(),ei(),ii(),si(),li(),di={_export:ci}})),pi=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.VERSION=void 0,e.VERSION=`0.214.0`})),mi,hi,gi=n((()=>{mi=class{emit(e){}},hi=new mi}));function _i(e,t,n){return r=>r===e?t:n}var vi,yi,bi=n((()=>{vi=Symbol.for(`io.opentelemetry.js.api.logs`),yi=globalThis})),xi,Si,Ci=n((()=>{gi(),xi=class{getLogger(e,t,n){return new mi}},Si=new xi})),wi,Ti=n((()=>{gi(),wi=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):hi}}})),Ei,Di=n((()=>{Ci(),Ti(),Ei=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new wi(this,e,t,n)}_getDelegate(){return this._delegate??Si}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),Oi,ki=n((()=>{bi(),Ci(),Di(),Oi=class e{constructor(){this._proxyLoggerProvider=new Ei}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return yi[vi]?this.getLoggerProvider():(yi[vi]=_i(1,e,Si),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return yi[vi]?.call(yi,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete yi[vi],this._proxyLoggerProvider=new Ei}}})),Ai,ji=n((()=>{gi(),ki(),Ai=Oi.getInstance()}));function Mi(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Ni(e){e.forEach(e=>e.disable())}var Pi=n((()=>{}));function Fi(e){let t=e.tracerProvider||D.getTracerProvider(),n=e.meterProvider||v.getMeterProvider(),r=e.loggerProvider||Ai.getLoggerProvider(),i=e.instrumentations?.flat()??[];return Mi(i,t,n,r),()=>{Ni(i)}}var Ii=n((()=>{T(),ji(),Pi()}));function Li(e,t,n){if(!Ri(e))return E.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,`$1`);let r=Gi(e);if(!r)return!1;let i=[],a=zi(r,t,i,n);return a&&!n?.includePrerelease?Hi(r,i):a}function Ri(e){return typeof e==`string`&&na.test(e)}function zi(e,t,n,r){if(t.includes(`||`)){let i=t.trim().split(`||`);for(let t of i)if(Bi(e,t,n,r))return!0;return!1}else if(t.includes(` - `))t=ta(t,r);else if(t.includes(` `)){let i=t.trim().replace(/\s{2,}/g,` `).split(` `);for(let t of i)if(!Bi(e,t,n,r))return!1;return!0}return Bi(e,t,n,r)}function Bi(e,t,n,r){if(t=Ui(t,r),t.includes(` `))return zi(e,t,n,r);{let r=Ki(t);return n.push(r),Vi(e,r)}}function Vi(e,t){if(t.invalid)return!1;if(!t.version||qi(t.version))return!0;let n=Zi(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],i=t.prereleaseSegments||[];n=!r.length&&!i.length?0:!r.length&&i.length?1:r.length&&!i.length?-1:Zi(r,i)}return ia[t.op]?.includes(n)}function Hi(e,t){return e.prerelease?t.some(t=>t.prerelease&&t.version===e.version):!0}function Ui(e,t){return e=e.trim(),e=$i(e,t),e=Qi(e),e=ea(e,t),e=e.trim(),e}function Wi(e){return!e||e.toLowerCase()===`x`||e===`*`}function Gi(e){let t=e.match(na);if(!t){E.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,i=t.groups.build,a=n.split(`.`),o=r?.split(`.`);return{op:void 0,version:n,versionSegments:a,versionSegmentCount:a.length,prerelease:r,prereleaseSegments:o,prereleaseSegmentCount:o?o.length:0,build:i}}function Ki(e){if(!e)return{};let t=e.match(ra);if(!t)return E.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,i=t.groups.prerelease,a=t.groups.build,o=r.split(`.`),s=i?.split(`.`);return n===`==`&&(n=`=`),{op:n||`=`,version:r,versionSegments:o,versionSegmentCount:o.length,prerelease:i,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:a}}function qi(e){return e===`*`||e===`x`||e===`X`}function Ji(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Yi(e,t){if(typeof e==typeof t){if(typeof e==`number`||typeof e==`string`)return[e,t];throw Error(`Version segments can only be strings or numbers`)}else return[String(e),String(t)]}function Xi(e,t){if(qi(e)||qi(t))return 0;let[n,r]=Yi(Ji(e),Ji(t));return n>r?1:n<r?-1:0}function Zi(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=Xi(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0}function Qi(e){let t=ba;return e.replace(t,(e,t,n,r,i)=>{let a;return a=Wi(t)?``:Wi(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:Wi(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,a})}function $i(e,t){let n=Sa,r=t?.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>{let o;return o=Wi(t)?``:Wi(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:Wi(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i}-${a} <${+t+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i}${r} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i} <${+t+1}.0.0-0`,o})}function ea(e,t){let n=ga;return e.replace(n,(e,n,r,i,a,o)=>{let s=Wi(r),c=s||Wi(i),l=c||Wi(a),u=l;return n===`=`&&u&&(n=``),o=t?.includePrerelease?`-0`:``,s?e=n===`>`||n===`<`?`<0.0.0-0`:`*`:n&&u?(c&&(i=0),a=0,n===`>`?(n=`>=`,c?(r=+r+1,i=0,a=0):(i=+i+1,a=0)):n===`<=`&&(n=`<`,c?r=+r+1:i=+i+1),n===`<`&&(o=`-0`),e=`${n+r}.${i}.${a}${o}`):c?e=`>=${r}.0.0${o} <${+r+1}.0.0-0`:l&&(e=`>=${r}.${i}.0${o} <${r}.${+i+1}.0-0`),e})}function ta(e,t){let n=va;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>(n=Wi(r)?``:Wi(i)?`>=${r}.0.0${t?.includePrerelease?`-0`:``}`:Wi(a)?`>=${r}.${i}.0${t?.includePrerelease?`-0`:``}`:o?`>=${n}`:`>=${n}${t?.includePrerelease?`-0`:``}`,c=Wi(l)?``:Wi(u)?`<${+l+1}.0.0-0`:Wi(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t?.includePrerelease?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()))}var na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca=n((()=>{T(),na=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,ra=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,ia={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},aa=`[a-zA-Z0-9-]`,oa=`0|[1-9]\\d*`,sa=`\\d*[a-zA-Z-]${aa}*`,ca=`((?:<|>)?=?)`,la=`(?:${oa}|${sa})`,ua=`(?:-(${la}(?:\\.${la})*))`,da=`${aa}+`,fa=`(?:\\+(${da}(?:\\.${da})*))`,pa=`${oa}|x|X|\\*`,ma=`[v=\\s]*(${pa})(?:\\.(${pa})(?:\\.(${pa})(?:${ua})?${fa}?)?)?`,ha=`^${ca}\\s*${ma}$`,ga=new RegExp(ha),_a=`^\\s*(${ma})\\s+-\\s+(${ma})\\s*$`,va=new RegExp(_a),ya=`^(?:~>?)${ma}$`,ba=new RegExp(ya),xa=`^(?:\\^)${ma}$`,Sa=new RegExp(xa)}));function wa(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function Ta(e){e&&e.logger&&(typeof e.logger==`function`?Ea=e.logger:Ea(`new logger isn't a function, not replacing`))}var Ea,Da,Oa,ka,Aa,ja=n((()=>{Ea=console.error.bind(console),Da=(e,t,n)=>{if(!e||!e[t]){Ea(`no original function `+String(t)+` to wrap`);return}if(!n){Ea(`no wrapper function`),Ea(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Ea(`original object and wrapper must be functions`);return}let i=n(r,t);return wa(i,`__original`,r),wa(i,`__unwrap`,()=>{e[t]===i&&wa(e,t,r)}),wa(i,`__wrapped`,!0),wa(e,t,i),i},Oa=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Da(e,t,n)})})},ka=(e,t)=>{if(!e||!e[t]){Ea(`no function to unwrap.`),Ea(Error().stack);return}let n=e[t];if(!n.__unwrap)Ea(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Aa=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{ka(e,t)})})},Ta.wrap=Da,Ta.massWrap=Oa,Ta.unwrap=ka,Ta.massUnwrap=Aa})),Ma,Na=n((()=>{T(),ji(),ja(),a(),Ma=class{constructor(e,t,n){o(this,`_config`,{}),o(this,`_tracer`,void 0),o(this,`_meter`,void 0),o(this,`_logger`,void 0),o(this,`_diag`,void 0),o(this,`instrumentationName`,void 0),o(this,`instrumentationVersion`,void 0),o(this,`_wrap`,Da),o(this,`_unwrap`,ka),o(this,`_massWrap`,Oa),o(this,`_massUnwrap`,Aa),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=E.createComponentLogger({namespace:e}),this._tracer=D.getTracer(e,t),this._meter=v.getMeter(e,t),this._logger=Ai.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}}})),Pa=i(((e,n)=>{var r=t(`path`).sep;n.exports=function(e){var t=e.split(r),n=t.lastIndexOf(`node_modules`);if(n!==-1&&t[n+1]){for(var i=t[n+1][0]===`@`,a=i?t[n+1]+`/`+t[n+2]:t[n+1],o=i?3:2,s=``,c=n+o-1,l=0;l<=c;l++)l===c?s+=t[l]:s+=t[l]+r;for(var u=``,d=t.length-1,f=n+o;f<=d;f++)f===d?u+=t[f]:u+=t[f]+r;return{name:a,basedir:s,path:u}}}})),Fa=i(((e,n)=>{var r=t(`path`),i=t(`module`),a=_()(`require-in-the-middle`),o=Pa();n.exports=d,n.exports.Hook=d;var s,c;if(i.isBuiltin)c=i.isBuiltin;else if(i.builtinModules)c=e=>e.startsWith(`node:`)?!0:(s===void 0&&(s=new Set(i.builtinModules)),s.has(e));else throw Error(`'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0`);var l=/([/\\]index)?(\.js)?$/,u=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol(`RitmExports`)}has(e,n){if(this._localCache.has(e))return!0;if(n)return!1;{let n=t.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,n){let r=this._localCache.get(e);if(r!==void 0)return r;if(!n){let n=t.cache[e];return n&&n[this._kRitmExports]}}set(e,n,r){r?this._localCache.set(e,n):e in t.cache?t.cache[e][this._kRitmExports]=n:(a(`non-core module is unexpectedly not in require.cache: "%s"`,e),this._localCache.set(e,n))}};function d(e,n,s){if(!(this instanceof d))return new d(e,n,s);if(typeof e==`function`?(s=e,e=null,n=null):typeof n==`function`&&(s=n,n=null),typeof i._resolveFilename!=`function`){console.error(`Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!`,typeof i._resolveFilename),console.error(`Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues`,process.version);return}this._cache=new u,this._unhooked=!1,this._origRequire=i.prototype.require;let l=this,p=new Set,m=n?n.internals===!0:!1,h=Array.isArray(e);a(`registering require hook`),this._require=i.prototype.require=function(e){return l._unhooked===!0?(a(`ignoring require call - module is soft-unhooked`),l._origRequire.apply(this,arguments)):g.call(this,arguments,!1)},typeof process.getBuiltinModule==`function`&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(e){return l._unhooked===!0?(a(`ignoring process.getBuiltinModule call - module is soft-unhooked`),l._origGetBuiltinModule.apply(this,arguments)):g.call(this,arguments,!0)});function g(n,u){let d=n[0],g=c(d),_;if(g){if(_=d,d.startsWith(`node:`)){let e=d.slice(5);c(e)&&(_=e)}}else if(u)return a(`call to process.getBuiltinModule with unknown built-in id`),l._origGetBuiltinModule.apply(this,n);else try{_=i._resolveFilename(d,this)}catch(e){return a(`Module._resolveFilename("%s") threw %j, calling original Module.require`,d,e.message),l._origRequire.apply(this,n)}let v,y;if(a(`processing %s module require('%s'): %s`,g===!0?`core`:`non-core`,d,_),l._cache.has(_,g)===!0)return a(`returning already patched cached module: %s`,_),l._cache.get(_,g);let b=p.has(_);b===!1&&p.add(_);let x=u?l._origGetBuiltinModule.apply(this,n):l._origRequire.apply(this,n);if(b===!0)return a(`module is in the process of being patched already - ignoring: %s`,_),x;if(p.delete(_),g===!0){if(h===!0&&e.includes(_)===!1)return a(`ignoring core module not on whitelist: %s`,_),x;v=_}else if(h===!0&&e.includes(_)){let e=r.parse(_);v=e.name,y=e.dir}else{let n=o(_);if(n===void 0)return a(`could not parse filename: %s`,_),x;v=n.name,y=n.basedir;let i=f(n);a(`resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)`,v,d,i,y);let s=!1;if(h){if(!d.startsWith(`.`)&&e.includes(d)&&(v=d,s=!0),!e.includes(v)&&!e.includes(i))return x;e.includes(i)&&i!==v&&(v=i,s=!0)}if(!s){let e;try{e=t.resolve(v,{paths:[y]})}catch{return a(`could not resolve module: %s`,v),l._cache.set(_,x,g),x}if(e!==_)if(m===!0)v=v+r.sep+r.relative(y,_),a(`preparing to process require of internal file: %s`,v);else return a(`ignoring require of non-main module file: %s`,e),l._cache.set(_,x,g),x}}l._cache.set(_,x,g),a(`calling require hook: %s`,v);let S=s(x,v,y);return l._cache.set(_,S,g),a(`returning module: %s`,v),S}}d.prototype.unhook=function(){this._unhooked=!0,this._require===i.prototype.require?(i.prototype.require=this._origRequire,a(`require unhook successful`)):a(`require unhook unsuccessful`),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,a(`process.getBuiltinModule unhook successful`)):a(`process.getBuiltinModule unhook unsuccessful`))};function f(e){let t=r.sep===`/`?e.path:e.path.split(r.sep).join(`/`);return r.posix.join(e.name,t).replace(l,``)}})),Ia,La,Ra=n((()=>{a(),Ia=class{constructor(){o(this,`hooks`,[]),o(this,`children`,new Map)}},La=class{constructor(){o(this,`_trie`,new Ia),o(this,`_counter`,0)}insert(e){let t=this._trie;for(let n of e.moduleName.split(`/`)){let e=t.children.get(n);e||(e=new Ia,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie,i=[],a=!0;for(let t of e.split(`/`)){let e=r.children.get(t);if(!e){a=!1;break}n||i.push(...e.hooks),r=e}return n&&a&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(t&&i.sort((e,t)=>e.insertedId-t.insertedId),i.map(({hook:e})=>e))}}}));function za(e){return Ye.sep===`/`?e:e.split(Ye.sep).join(`/`)}var Ba,Va,Ha,Ua=n((()=>{Ba=Fa(),Ra(),a(),Va=[`afterEach`,`after`,`beforeEach`,`before`,`describe`,`it`].every(e=>typeof global[e]==`function`),Ha=class e{constructor(){o(this,`_moduleNameTrie`,new La),this._initialize()}_initialize(){new Ba.Hook(null,{internals:!0},(e,t,n)=>{let r=za(t),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:r}of i)e=r(e,t,n);return e})}register(e,t){let n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return Va?new e:this._instance=this._instance??new e}},o(Ha,`_instance`,void 0)})),Wa=i((e=>{var t=[],n=new WeakMap,r=new WeakMap,i=new Map,a=[],o={set(e,t,r){let i=n.get(e),a=i&&i[t];return typeof a==`function`?a(r):!0},get(e,t){if(t===Symbol.toStringTag)return`Module`;let n=r.get(e)[t];if(typeof n==`function`)return n()},defineProperty(e,t,r){if(!(`value`in r))throw Error(`Getters/setters are not supported for exports property descriptors.`);let i=n.get(e),a=i&&i[t];return typeof a==`function`?a(r.value):!0}};function s(e,s,c,l,u){i.set(e,u),n.set(s,c),r.set(s,l);let d=new Proxy(s,o);t.forEach(t=>t(e,d,u)),a.push([e,d,u])}e.register=s,e.importHooks=t,e.specifiers=i,e.toHook=a})),Ga=i(((e,n)=>{var r=t(`path`),i=Pa(),{fileURLToPath:a}=t(`url`),{MessageChannel:o}=t(`worker_threads`),{isBuiltin:s}=t(`module`);s||(s=()=>!0);var{importHooks:c,specifiers:l,toHook:u}=Wa();function d(e,t){if(!(process.env.TURBOPACK??process.argv.includes(`--turbo`)))return!1;let n=e.slice(0,e.lastIndexOf(`-`));return t.endsWith(n)}function f(e){c.push(e),u.forEach(([t,n,r])=>e(t,n,r))}function p(e){let t=c.indexOf(e);t>-1&&c.splice(t,1)}function m(e,t,n,r){let i=e(t,n,r);i&&i!==t&&`default`in t&&(t.default=i)}var h;function g(){let{port1:e,port2:t}=new o,n=0,r;h=t=>{n++,e.postMessage(t)},e.on(`message`,()=>{n--,r&&n<=0&&r()}).unref();function i(){let e=setInterval(()=>{},1e3),t=new Promise(e=>{r=e}).then(()=>{clearInterval(e)});return n===0&&r(),t}let a=t;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:i}}function _(e,t,n){if(!(this instanceof _))return new _(e,t,n);typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null);let o=t?t.internals===!0:!1;h&&Array.isArray(e)&&h(e),this._iitmHook=(t,c,u)=>{let f=t,p=f.startsWith(`node:`),h,g;if(p){let e=t.slice(5);s(e)&&(t=e)}else if(f.startsWith(`file://`)){let e=Error.stackTraceLimit;Error.stackTraceLimit=0;try{h=a(t),t=h}catch{}if(Error.stackTraceLimit=e,h){let e=i(h);e&&(t=e.name,g=e.basedir)}}if(e)for(let i of e)if(h&&i===h)m(n,c,h,void 0);else if(i===t){if(!g)m(n,c,t,g);else if(g.endsWith(l.get(f))||d(l.get(f),g))m(n,c,t,g);else if(o){let e=t+r.sep+r.relative(g,h);m(n,c,e,g)}}else i===u&&m(n,c,u,g);else m(n,c,t,g)},f(this._iitmHook)}_.prototype.unhook=function(){p(this._iitmHook)},n.exports=_,n.exports.Hook=_,n.exports.addHook=f,n.exports.removeHook=p,n.exports.createAddHookMessageChannel=g}));function Ka(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}async function qa(e,t,n){let r,i;try{i=await e()}catch(e){r=e}finally{if(await t(r,i),r&&!n)throw r;return i}}function Ja(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var Ya=n((()=>{}));function Xa(e,t,n){return t===void 0?e.includes(`*`):e.some(e=>Li(t,e,{includePrerelease:n}))}var Za,Qa,$a,eo=n((()=>{Ca(),ja(),Na(),Ua(),Za=Ga(),T(),Qa=Fa(),Ya(),a(),$a=class extends Ma{constructor(e,t,n){super(e,t,n),o(this,`_modules`,void 0),o(this,`_hooks`,[]),o(this,`_requireInTheMiddleSingleton`,Ha.getInstance()),o(this,`_enabled`,!1),o(this,`_wrap`,(e,t,n)=>{if(Ja(e[t])&&this._unwrap(e,t),gt.isProxy(e)){let r=Da(Object.assign({},e),t,n);return Object.defineProperty(e,t,{value:r}),r}else return Da(e,t,n)}),o(this,`_unwrap`,(e,t)=>gt.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):ka(e,t)),o(this,`_massWrap`,(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{E.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){E.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})})}),o(this,`_massUnwrap`,(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{E.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){E.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})})});let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){let e=globalThis.require;!e?.resolve||!e?.cache||this._modules.forEach(t=>{let{name:n}=t;try{let t=e.resolve(n);e.cache[t]?.loaded&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let t=ot(Ye.join(e,`package.json`),{encoding:`utf8`}),n=JSON.parse(t).version;return typeof n==`string`?n:void 0}catch{E.warn(`Failed extracting version`,e)}}_onRequire(e,t,n,r){if(!r)return typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for nodejs core module on require hook`,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(r);if(e.moduleVersion=i,e.name===n)return Xa(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for module on require hook`,{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;let a=e.files??[],o=Ye.normalize(n);return a.filter(t=>t.name===o&&Xa(t.supportedVersions,i,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug(`Applying instrumentation patch for nodejs module file on require hook`,{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch==`function`&&e.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module on instrumentation enabled`,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module file on instrumentation enabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(t,n,r)=>{if(!r&&Ye.isAbsolute(n)){let e=Ye.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=Ye.isAbsolute(e.name)?new Qa.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);let i=new Za.Hook([e.name],{internals:!0},t);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==`function`&&e.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module on instrumentation disabled`,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module file on instrumentation disabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}})),to=n((()=>{})),no=n((()=>{eo(),to()})),ro=n((()=>{no()})),io,ao=n((()=>{a(),io=class{constructor(e,t,n,r,i){o(this,`files`,void 0),o(this,`name`,void 0),o(this,`supportedVersions`,void 0),o(this,`patch`,void 0),o(this,`unpatch`,void 0),this.files=i||[],this.name=e,this.supportedVersions=t,this.patch=n,this.unpatch=r}}})),oo,so=n((()=>{ro(),a(),oo=class{constructor(e,t,n,r){o(this,`name`,void 0),o(this,`supportedVersions`,void 0),o(this,`patch`,void 0),o(this,`unpatch`,void 0),this.name=Ze(e),this.supportedVersions=t,this.patch=n,this.unpatch=r}}}));function co(e,t){let n=lo.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=lo.DUPLICATE;break}else t.toLowerCase()===e&&(n=lo.STABLE);return n}var lo,uo=n((()=>{(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(lo||(lo={}))})),I=r({InstrumentationBase:()=>$a,InstrumentationNodeModuleDefinition:()=>io,InstrumentationNodeModuleFile:()=>oo,SemconvStability:()=>lo,isWrapped:()=>Ja,registerInstrumentations:()=>Fi,safeExecuteInTheMiddle:()=>Ka,safeExecuteInTheMiddleAsync:()=>qa,semconvStabilityFromStr:()=>co}),L=n((()=>{Ii(),ro(),ao(),so(),Ya(),uo()})),fo=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HTTP_FLAVOR_VALUE_HTTP_1_1=e.NET_TRANSPORT_VALUE_IP_UDP=e.NET_TRANSPORT_VALUE_IP_TCP=e.ATTR_NET_TRANSPORT=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_NET_PEER_IP=e.ATTR_NET_HOST_PORT=e.ATTR_NET_HOST_NAME=e.ATTR_NET_HOST_IP=e.ATTR_HTTP_USER_AGENT=e.ATTR_HTTP_URL=e.ATTR_HTTP_TARGET=e.ATTR_HTTP_STATUS_CODE=e.ATTR_HTTP_SERVER_NAME=e.ATTR_HTTP_SCHEME=e.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=e.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=e.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=e.ATTR_HTTP_REQUEST_CONTENT_LENGTH=e.ATTR_HTTP_METHOD=e.ATTR_HTTP_HOST=e.ATTR_HTTP_FLAVOR=e.ATTR_HTTP_CLIENT_IP=e.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST=e.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT=e.ATTR_USER_AGENT_SYNTHETIC_TYPE=void 0,e.ATTR_USER_AGENT_SYNTHETIC_TYPE=`user_agent.synthetic.type`,e.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT=`bot`,e.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST=`test`,e.ATTR_HTTP_CLIENT_IP=`http.client_ip`,e.ATTR_HTTP_FLAVOR=`http.flavor`,e.ATTR_HTTP_HOST=`http.host`,e.ATTR_HTTP_METHOD=`http.method`,e.ATTR_HTTP_REQUEST_CONTENT_LENGTH=`http.request_content_length`,e.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=`http.request_content_length_uncompressed`,e.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=`http.response_content_length`,e.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=`http.response_content_length_uncompressed`,e.ATTR_HTTP_SCHEME=`http.scheme`,e.ATTR_HTTP_SERVER_NAME=`http.server_name`,e.ATTR_HTTP_STATUS_CODE=`http.status_code`,e.ATTR_HTTP_TARGET=`http.target`,e.ATTR_HTTP_URL=`http.url`,e.ATTR_HTTP_USER_AGENT=`http.user_agent`,e.ATTR_NET_HOST_IP=`net.host.ip`,e.ATTR_NET_HOST_NAME=`net.host.name`,e.ATTR_NET_HOST_PORT=`net.host.port`,e.ATTR_NET_PEER_IP=`net.peer.ip`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.ATTR_NET_TRANSPORT=`net.transport`,e.NET_TRANSPORT_VALUE_IP_TCP=`ip_tcp`,e.NET_TRANSPORT_VALUE_IP_UDP=`ip_udp`,e.HTTP_FLAVOR_VALUE_HTTP_1_1=`1.1`})),po=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=void 0,(function(e){e.HTTP_ERROR_NAME=`http.error_name`,e.HTTP_ERROR_MESSAGE=`http.error_message`,e.HTTP_STATUS_TEXT=`http.status_text`})(e.AttributeNames||(e.AttributeNames={}))})),mo=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_QUERY_STRINGS_TO_REDACT=e.STR_REDACTED=e.SYNTHETIC_BOT_NAMES=e.SYNTHETIC_TEST_NAMES=void 0,e.SYNTHETIC_TEST_NAMES=[`alwayson`],e.SYNTHETIC_BOT_NAMES=[`googlebot`,`bingbot`],e.STR_REDACTED=`REDACTED`,e.DEFAULT_QUERY_STRINGS_TO_REDACT=[`sig`,`Signature`,`AWSAccessKeyId`,`X-Goog-Signature`]})),ho=i(((e,n)=>{var r=t(`util`);function i(e,t){Error.captureStackTrace(this,i),this.name=this.constructor.name,this.message=e,this.input=t}r.inherits(i,Error),n.exports=i})),go=i(((e,t)=>{function n(e){return e===34||e===40||e===41||e===44||e===47||e>=58&&e<=64||e>=91&&e<=93||e===123||e===125}function r(e){return e===33||e>=35&&e<=39||e===42||e===43||e===45||e===46||e>=48&&e<=57||e>=65&&e<=90||e>=94&&e<=122||e===124||e===126}function i(e){return e>=32&&e<=126}function a(e){return e>=128&&e<=255}t.exports={isDelimiter:n,isTokenChar:r,isExtended:a,isPrint:i}})),_o=i(((e,n)=>{var r=t(`util`),i=ho(),a=go(),o=a.isDelimiter,s=a.isTokenChar,c=a.isExtended,l=a.isPrint;function u(e){return e.replace(/\\(.)/g,`$1`)}function d(e,t){return r.format(`Unexpected character '%s' at index %d`,e.charAt(t),t)}function f(e){for(var t=!1,n=!1,r=!1,a={},f=[],p=-1,m=-1,h,g,_=0;_<e.length;_++)if(g=e.charCodeAt(_),h===void 0){if(_!==0&&p===-1&&(g===32||g===9))continue;if(s(g))p===-1&&(p=_);else if(g===61&&p!==-1)h=e.slice(p,_).toLowerCase(),p=-1;else throw new i(d(e,_),e)}else if(n&&(g===9||l(g)||c(g)))n=!1;else if(s(g)){if(m!==-1)throw new i(d(e,_),e);p===-1&&(p=_)}else if(o(g)||c(g))if(r)g===34?(r=!1,m=_):g===92?(p===-1&&(p=_),n=t=!0):p===-1&&(p=_);else if(g===34&&e.charCodeAt(_-1)===61)r=!0;else if((g===44||g===59)&&(p!==-1||m!==-1))p===-1?a[h]=``:(m===-1&&(m=_),a[h]=t?u(e.slice(p,m)):e.slice(p,m)),g===44&&(f.push(a),a={}),h=void 0,p=m=-1;else throw new i(d(e,_),e);else if(g===32||g===9){if(m!==-1)continue;if(r)p===-1&&(p=_);else if(p!==-1)m=_;else throw new i(d(e,_),e)}else throw new i(d(e,_),e);if(h===void 0||r||p===-1&&m===-1||g===32||g===9)throw new i(`Unexpected end of input`,e);return p===-1?a[h]=``:(m===-1&&(m=_),a[h]=t?u(e.slice(p,m)):e.slice(p,m)),f.push(a),f}n.exports=f})),vo=i((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.headerCapture=n.getIncomingStableRequestMetricAttributesOnResponse=n.getIncomingRequestMetricAttributesOnResponse=n.getIncomingRequestAttributesOnResponse=n.getIncomingRequestMetricAttributes=n.getIncomingRequestAttributes=n.getRemoteClientAddress=n.getOutgoingStableRequestMetricAttributesOnResponse=n.getOutgoingRequestMetricAttributesOnResponse=n.getOutgoingRequestAttributesOnResponse=n.setAttributesFromHttpKind=n.getOutgoingRequestMetricAttributes=n.getOutgoingRequestAttributes=n.extractHostnameAndPort=n.isValidOptionsType=n.getRequestInfo=n.isCompressed=n.setResponseContentLengthAttribute=n.setRequestContentLengthAttribute=n.setSpanWithError=n.satisfiesPattern=n.parseResponseStatus=n.getAbsoluteUrl=void 0;var r=(T(),e(k)),i=(F(),e(A)),a=fo(),o=(fi(),e(ui)),s=(L(),e(I)),c=t(`url`),l=po(),u=mo(),d=mo(),f=_o();n.getAbsoluteUrl=(e,t,n=`http:`,r=Array.from(d.DEFAULT_QUERY_STRINGS_TO_REDACT))=>{let i=e||{},a=i.protocol||n,o=(i.port||``).toString(),s=i.path||`/`,c=i.host||i.hostname||t.host||`localhost`;if(c.indexOf(`:`)===-1&&o&&o!==`80`&&o!==`443`&&(c+=`:${o}`),s.includes(`?`))try{let e=new URL(s,`http://localhost`),t=r||[];for(let n of t)e.searchParams.get(n)&&e.searchParams.set(n,d.STR_REDACTED);s=`${e.pathname}${e.search}`}catch{}return`${a}//${i.auth?`${d.STR_REDACTED}:${d.STR_REDACTED}@`:``}${c}${s}`},n.parseResponseStatus=(e,t)=>{let n=e===r.SpanKind.CLIENT?400:500;return t&&t>=100&&t<n?r.SpanStatusCode.UNSET:r.SpanStatusCode.ERROR},n.satisfiesPattern=(e,t)=>{if(typeof t==`string`)return t===e;if(t instanceof RegExp)return t.test(e);if(typeof t==`function`)return t(e);throw TypeError(`Pattern is in unsupported datatype`)},n.setSpanWithError=(e,t,n)=>{let a=t.message;n&s.SemconvStability.OLD&&(e.setAttribute(l.AttributeNames.HTTP_ERROR_NAME,t.name),e.setAttribute(l.AttributeNames.HTTP_ERROR_MESSAGE,a)),n&s.SemconvStability.STABLE&&e.setAttribute(i.ATTR_ERROR_TYPE,t.name),e.setStatus({code:r.SpanStatusCode.ERROR,message:a}),e.recordException(t)},n.setRequestContentLengthAttribute=(e,t)=>{let r=p(e.headers);r!==null&&((0,n.isCompressed)(e.headers)?t[a.ATTR_HTTP_REQUEST_CONTENT_LENGTH]=r:t[a.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED]=r)},n.setResponseContentLengthAttribute=(e,t)=>{let r=p(e.headers);r!==null&&((0,n.isCompressed)(e.headers)?t[a.ATTR_HTTP_RESPONSE_CONTENT_LENGTH]=r:t[a.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED]=r)};function p(e){let t=e[`content-length`];if(t===void 0)return null;let n=parseInt(t,10);return isNaN(n)?null:n}n.isCompressed=e=>{let t=e[`content-encoding`];return!!t&&t!==`identity`};function m(e){let{hostname:t,pathname:n,port:r,username:i,password:a,search:o,protocol:s,hash:c,href:l,origin:u,host:d}=new URL(e),f={protocol:s,hostname:t&&t[0]===`[`?t.slice(1,-1):t,hash:c,search:o,pathname:n,path:`${n||``}${o||``}`,href:l,origin:u,host:d};return r!==``&&(f.port=Number(r)),(i||a)&&(f.auth=`${decodeURIComponent(i)}:${decodeURIComponent(a)}`),f}n.getRequestInfo=(e,t,n)=>{let r,i,a,o=!1;if(typeof t==`string`){try{let e=m(t);a=e,r=e.pathname||`/`}catch(n){o=!0,e.verbose(`Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:`,n),a={path:t},r=a.path||`/`}i=`${a.protocol||`http:`}//${a.host}`,n!==void 0&&Object.assign(a,n)}else if(t instanceof c.URL)a={protocol:t.protocol,hostname:typeof t.hostname==`string`&&t.hostname.startsWith(`[`)?t.hostname.slice(1,-1):t.hostname,path:`${t.pathname||``}${t.search||``}`},t.port!==``&&(a.port=Number(t.port)),(t.username||t.password)&&(a.auth=`${t.username}:${t.password}`),r=t.pathname,i=t.origin,n!==void 0&&Object.assign(a,n);else{a=Object.assign({protocol:t.host?`http:`:void 0},t);let e=a.host||(a.port==null?a.hostname:`${a.hostname}${a.port}`);if(i=`${a.protocol||`http:`}//${e}`,r=t.pathname,!r&&a.path)try{r=new URL(a.path,i).pathname||`/`}catch{r=`/`}}let s=a.method?a.method.toUpperCase():`GET`;return{origin:i,pathname:r,method:s,optionsParsed:a,invalidUrl:o}},n.isValidOptionsType=e=>{if(!e)return!1;let t=typeof e;return t===`string`||t===`object`&&!Array.isArray(e)},n.extractHostnameAndPort=e=>{if(e.hostname&&e.port)return{hostname:e.hostname,port:e.port};let t=e.host?.match(/^([^:/ ]+)(:\d{1,5})?/)||null,n=e.hostname||(t===null?`localhost`:t[1]),r=e.port;return r||(r=t&&t[2]?t[2].substring(1):e.protocol===`https:`?`443`:`80`),{hostname:n,port:r}},n.getOutgoingRequestAttributes=(e,t,r,o)=>{let c=t.hostname,l=t.port,u=e.method??`GET`,d=C(u),f=e.headers||{},p=f[`user-agent`],m=(0,n.getAbsoluteUrl)(e,f,`${t.component}:`,t.redactedQueryParams),g={[a.ATTR_HTTP_URL]:m,[a.ATTR_HTTP_METHOD]:u,[a.ATTR_HTTP_TARGET]:e.path||`/`,[a.ATTR_NET_PEER_NAME]:c,[a.ATTR_HTTP_HOST]:f.host??`${c}:${l}`},_={[i.ATTR_HTTP_REQUEST_METHOD]:d,[i.ATTR_SERVER_ADDRESS]:c,[i.ATTR_SERVER_PORT]:Number(l),[i.ATTR_URL_FULL]:m,[i.ATTR_USER_AGENT_ORIGINAL]:p};switch(u!==d&&(_[i.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=u),o&&p&&(_[a.ATTR_USER_AGENT_SYNTHETIC_TYPE]=h(p)),p!==void 0&&(g[a.ATTR_HTTP_USER_AGENT]=p),r){case s.SemconvStability.STABLE:return Object.assign(_,t.hookAttributes);case s.SemconvStability.OLD:return Object.assign(g,t.hookAttributes)}return Object.assign(g,_,t.hookAttributes)},n.getOutgoingRequestMetricAttributes=e=>{let t={};return t[a.ATTR_HTTP_METHOD]=e[a.ATTR_HTTP_METHOD],t[a.ATTR_NET_PEER_NAME]=e[a.ATTR_NET_PEER_NAME],t},n.setAttributesFromHttpKind=(e,t)=>{e&&(t[a.ATTR_HTTP_FLAVOR]=e,e.toUpperCase()===`QUIC`?t[a.ATTR_NET_TRANSPORT]=a.NET_TRANSPORT_VALUE_IP_UDP:t[a.ATTR_NET_TRANSPORT]=a.NET_TRANSPORT_VALUE_IP_TCP)};var h=e=>{let t=String(e).toLowerCase();for(let e of u.SYNTHETIC_TEST_NAMES)if(t.includes(e))return a.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST;for(let e of u.SYNTHETIC_BOT_NAMES)if(t.includes(e))return a.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT};n.getOutgoingRequestAttributesOnResponse=(e,t)=>{let{statusCode:r,statusMessage:o,httpVersion:c,socket:u}=e,d={},f={};if(r!=null&&(f[i.ATTR_HTTP_RESPONSE_STATUS_CODE]=r),u){let{remoteAddress:t,remotePort:n}=u;d[a.ATTR_NET_PEER_IP]=t,d[a.ATTR_NET_PEER_PORT]=n,f[i.ATTR_NETWORK_PEER_ADDRESS]=t,f[i.ATTR_NETWORK_PEER_PORT]=n,f[i.ATTR_NETWORK_PROTOCOL_VERSION]=e.httpVersion}switch((0,n.setResponseContentLengthAttribute)(e,d),r&&(d[a.ATTR_HTTP_STATUS_CODE]=r,d[l.AttributeNames.HTTP_STATUS_TEXT]=(o||``).toUpperCase()),(0,n.setAttributesFromHttpKind)(c,d),t){case s.SemconvStability.STABLE:return f;case s.SemconvStability.OLD:return d}return Object.assign(d,f)},n.getOutgoingRequestMetricAttributesOnResponse=e=>{let t={};return t[a.ATTR_NET_PEER_PORT]=e[a.ATTR_NET_PEER_PORT],t[a.ATTR_HTTP_STATUS_CODE]=e[a.ATTR_HTTP_STATUS_CODE],t[a.ATTR_HTTP_FLAVOR]=e[a.ATTR_HTTP_FLAVOR],t},n.getOutgoingStableRequestMetricAttributesOnResponse=e=>{let t={};return e[i.ATTR_NETWORK_PROTOCOL_VERSION]&&(t[i.ATTR_NETWORK_PROTOCOL_VERSION]=e[i.ATTR_NETWORK_PROTOCOL_VERSION]),e[i.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(t[i.ATTR_HTTP_RESPONSE_STATUS_CODE]=e[i.ATTR_HTTP_RESPONSE_STATUS_CODE]),t};function g(e,t){let n=e.split(`:`);if(n.length===1)return t===`http`?{host:n[0],port:`80`}:t===`https`?{host:n[0],port:`443`}:{host:n[0]};if(n.length===2)return{host:n[0],port:n[1]};if(n[0].startsWith(`[`)){if(n[n.length-1].endsWith(`]`)){if(t===`http`)return{host:e,port:`80`};if(t===`https`)return{host:e,port:`443`}}else if(n[n.length-2].endsWith(`]`))return{host:n.slice(0,-1).join(`:`),port:n[n.length-1]}}return{host:e}}function _(e,t){let n=e.headers.forwarded;if(n){for(let e of w(n))if(e.host)return g(e.host,e.proto)}let r=e.headers[`x-forwarded-host`];if(typeof r==`string`)return typeof e.headers[`x-forwarded-proto`]==`string`?g(r,e.headers[`x-forwarded-proto`]):Array.isArray(e.headers[`x-forwarded-proto`])?g(r,e.headers[`x-forwarded-proto`][0]):g(r);if(Array.isArray(r)&&typeof r[0]==`string`&&r[0].length>0)return typeof e.headers[`x-forwarded-proto`]==`string`?g(r[0],e.headers[`x-forwarded-proto`]):Array.isArray(e.headers[`x-forwarded-proto`])?g(r[0],e.headers[`x-forwarded-proto`][0]):g(r[0]);let i=e.headers.host;return typeof i==`string`&&i.length>0?g(i,t):null}function v(e){let t=e.headers.forwarded;if(t){for(let e of w(t))if(e.for)return y(e.for)}let n=e.headers[`x-forwarded-for`];if(n){let e;if(typeof n==`string`?e=n:Array.isArray(n)&&(e=n[0]),typeof e==`string`)return e=e.split(`,`)[0].trim(),y(e)}return e.socket.remoteAddress||null}n.getRemoteClientAddress=v;function y(e){try{let{hostname:t}=new URL(`http://${e}`);return t.startsWith(`[`)&&t.endsWith(`]`)?t.slice(1,-1):t}catch{return e}}function b(e,t,n){try{if(t.headers.host)return new URL(t.url??`/`,`${e}://${t.headers.host}`);{let n=new URL(t.url??`/`,`${e}://localhost`);return{pathname:n.pathname,search:n.search,toString:function(){return n.pathname+n.search}}}}catch(e){return n.verbose(`Unable to get URL from request`,e),{}}}n.getIncomingRequestAttributes=(e,t,r)=>{let{component:o,enableSyntheticSourceDetection:c,hookAttributes:l,semconvStability:u,serverName:d}=t,{headers:f,httpVersion:p,method:m}=e,{host:g,"user-agent":y,"x-forwarded-for":x}=f,S=b(o,e,r),w,T;if(u!==s.SemconvStability.OLD){let t=C(m),n=_(e,o),r=v(e);w={[i.ATTR_HTTP_REQUEST_METHOD]:t,[i.ATTR_URL_SCHEME]:o,[i.ATTR_SERVER_ADDRESS]:n?.host,[i.ATTR_NETWORK_PEER_ADDRESS]:e.socket.remoteAddress,[i.ATTR_NETWORK_PEER_PORT]:e.socket.remotePort,[i.ATTR_NETWORK_PROTOCOL_VERSION]:e.httpVersion,[i.ATTR_USER_AGENT_ORIGINAL]:y},S.pathname!=null&&(w[i.ATTR_URL_PATH]=S.pathname),S.search&&(w[i.ATTR_URL_QUERY]=S.search.slice(1)),r!=null&&(w[i.ATTR_CLIENT_ADDRESS]=r),n?.port!=null&&(w[i.ATTR_SERVER_PORT]=Number(n.port)),m!==t&&(w[i.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=m),c&&y&&(w[a.ATTR_USER_AGENT_SYNTHETIC_TYPE]=h(y))}if(u!==s.SemconvStability.STABLE){let t=g?.replace(/^(.*)(:[0-9]{1,5})/,`$1`)||`localhost`;T={[a.ATTR_HTTP_URL]:S.toString(),[a.ATTR_HTTP_HOST]:g,[a.ATTR_NET_HOST_NAME]:t,[a.ATTR_HTTP_METHOD]:m,[a.ATTR_HTTP_SCHEME]:o},typeof x==`string`&&(T[a.ATTR_HTTP_CLIENT_IP]=x.split(`,`)[0]),typeof d==`string`&&(T[a.ATTR_HTTP_SERVER_NAME]=d),S.pathname&&(T[a.ATTR_HTTP_TARGET]=S.pathname+S.search||`/`),y!==void 0&&(T[a.ATTR_HTTP_USER_AGENT]=y),(0,n.setRequestContentLengthAttribute)(e,T),(0,n.setAttributesFromHttpKind)(p,T)}switch(u){case s.SemconvStability.STABLE:return Object.assign(w,l);case s.SemconvStability.OLD:return Object.assign(T,l);default:return Object.assign(T,w,l)}},n.getIncomingRequestMetricAttributes=e=>{let t={};return t[a.ATTR_HTTP_SCHEME]=e[a.ATTR_HTTP_SCHEME],t[a.ATTR_HTTP_METHOD]=e[a.ATTR_HTTP_METHOD],t[a.ATTR_NET_HOST_NAME]=e[a.ATTR_NET_HOST_NAME],t[a.ATTR_HTTP_FLAVOR]=e[a.ATTR_HTTP_FLAVOR],t},n.getIncomingRequestAttributesOnResponse=(e,t,n)=>{let{socket:c}=e,{statusCode:u,statusMessage:d}=t,f={[i.ATTR_HTTP_RESPONSE_STATUS_CODE]:u},p=(0,o.getRPCMetadata)(r.context.active()),m={};if(c){let{localAddress:e,localPort:t,remoteAddress:n,remotePort:r}=c;m[a.ATTR_NET_HOST_IP]=e,m[a.ATTR_NET_HOST_PORT]=t,m[a.ATTR_NET_PEER_IP]=n,m[a.ATTR_NET_PEER_PORT]=r}switch(m[a.ATTR_HTTP_STATUS_CODE]=u,m[l.AttributeNames.HTTP_STATUS_TEXT]=(d||``).toUpperCase(),p?.type===o.RPCType.HTTP&&p.route!==void 0&&(m[i.ATTR_HTTP_ROUTE]=p.route,f[i.ATTR_HTTP_ROUTE]=p.route),n){case s.SemconvStability.STABLE:return f;case s.SemconvStability.OLD:return m}return Object.assign(m,f)},n.getIncomingRequestMetricAttributesOnResponse=e=>{let t={};return t[a.ATTR_HTTP_STATUS_CODE]=e[a.ATTR_HTTP_STATUS_CODE],t[a.ATTR_NET_HOST_PORT]=e[a.ATTR_NET_HOST_PORT],e[i.ATTR_HTTP_ROUTE]!==void 0&&(t[i.ATTR_HTTP_ROUTE]=e[i.ATTR_HTTP_ROUTE]),t},n.getIncomingStableRequestMetricAttributesOnResponse=e=>{let t={};return e[i.ATTR_HTTP_ROUTE]!==void 0&&(t[i.ATTR_HTTP_ROUTE]=e[i.ATTR_HTTP_ROUTE]),e[i.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(t[i.ATTR_HTTP_RESPONSE_STATUS_CODE]=e[i.ATTR_HTTP_RESPONSE_STATUS_CODE]),t};function x(e,t,n){let r=new Map;for(let e=0,i=t.length;e<i;e++){let i=t[e].toLowerCase();n&s.SemconvStability.STABLE?r.set(i,i):r.set(i,i.replaceAll(`-`,`_`))}return t=>{let n={};for(let i of r.keys()){let a=t(i);if(a===void 0)continue;let o=`http.${e}.header.${r.get(i)}`;typeof a==`string`?n[o]=[a]:Array.isArray(a)?n[o]=a:n[o]=[a]}return n}}n.headerCapture=x;var S=new Set([`GET`,`HEAD`,`POST`,`PUT`,`DELETE`,`CONNECT`,`OPTIONS`,`TRACE`,`PATCH`,`QUERY`]);function C(e){if(e==null)return`GET`;let t=e.toUpperCase();return S.has(t)?t:`_OTHER`}function w(e){try{return f(e)}catch{return[]}}})),yo=i((n=>{a(),Object.defineProperty(n,`__esModule`,{value:!0}),n.HttpInstrumentation=void 0;var r=(T(),e(k)),i=(fi(),e(ui)),s=t(`url`),c=pi(),l=(L(),e(I)),u=t(`events`),d=(F(),e(A)),f=vo();n.HttpInstrumentation=class extends l.InstrumentationBase{constructor(e={}){super(`@opentelemetry/instrumentation-http`,c.VERSION,e),o(this,`_spanNotEnded`,new WeakSet),o(this,`_headerCapture`,void 0),o(this,`_httpPatched`,!1),o(this,`_httpsPatched`,!1),o(this,`_semconvStability`,l.SemconvStability.OLD),this._semconvStability=(0,l.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._headerCapture=this._createHeaderCapture(this._semconvStability)}_updateMetricInstruments(){this._oldHttpServerDurationHistogram=this.meter.createHistogram(`http.server.duration`,{description:`Measures the duration of inbound HTTP requests.`,unit:`ms`,valueType:r.ValueType.DOUBLE}),this._oldHttpClientDurationHistogram=this.meter.createHistogram(`http.client.duration`,{description:`Measures the duration of outbound HTTP requests.`,unit:`ms`,valueType:r.ValueType.DOUBLE}),this._stableHttpServerDurationHistogram=this.meter.createHistogram(d.METRIC_HTTP_SERVER_REQUEST_DURATION,{description:`Duration of HTTP server requests.`,unit:`s`,valueType:r.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}}),this._stableHttpClientDurationHistogram=this.meter.createHistogram(d.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:`Duration of HTTP client requests.`,unit:`s`,valueType:r.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}_recordServerDuration(e,t,n){this._semconvStability&l.SemconvStability.OLD&&this._oldHttpServerDurationHistogram.record(e,t),this._semconvStability&l.SemconvStability.STABLE&&this._stableHttpServerDurationHistogram.record(e/1e3,n)}_recordClientDuration(e,t,n){this._semconvStability&l.SemconvStability.OLD&&this._oldHttpClientDurationHistogram.record(e,t),this._semconvStability&l.SemconvStability.STABLE&&this._stableHttpClientDurationHistogram.record(e/1e3,n)}setConfig(e={}){super.setConfig(e),this._headerCapture=this._createHeaderCapture(this._semconvStability)}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new l.InstrumentationNodeModuleDefinition(`http`,[`*`],e=>{if(this._httpPatched)return e;this._httpPatched=!0;let t=e[Symbol.toStringTag]===`Module`;if(!this.getConfig().disableOutgoingRequestInstrumentation){let n=this._wrap(e,`request`,this._getPatchOutgoingRequestFunction(`http`)),r=this._wrap(e,`get`,this._getPatchOutgoingGetFunction(n));t&&(e.default.request=n,e.default.get=r)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,`emit`,this._getPatchIncomingRequestFunction(`http`)),e},e=>{this._httpPatched=!1,e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,`request`),this._unwrap(e,`get`)),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,`emit`))})}_getHttpsInstrumentation(){return new l.InstrumentationNodeModuleDefinition(`https`,[`*`],e=>{if(this._httpsPatched)return e;this._httpsPatched=!0;let t=e[Symbol.toStringTag]===`Module`;if(!this.getConfig().disableOutgoingRequestInstrumentation){let n=this._wrap(e,`request`,this._getPatchHttpsOutgoingRequestFunction(`https`)),r=this._wrap(e,`get`,this._getPatchHttpsOutgoingGetFunction(n));t&&(e.default.request=n,e.default.get=r)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,`emit`,this._getPatchIncomingRequestFunction(`https`)),e},e=>{this._httpsPatched=!1,e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,`request`),this._unwrap(e,`get`)),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,`emit`))})}_getPatchIncomingRequestFunction(e){return t=>this._incomingRequestFunction(e,t)}_getPatchOutgoingRequestFunction(e){return t=>this._outgoingRequestFunction(e,t)}_getPatchOutgoingGetFunction(e){return t=>function(t,...n){let r=e(t,...n);return r.end(),r}}_getPatchHttpsOutgoingRequestFunction(e){return t=>{let n=this;return function(r,...i){return e===`https`&&typeof r==`object`&&r?.constructor?.name!==`URL`&&(r=Object.assign({},r),n._setDefaultOptions(r)),n._getPatchOutgoingRequestFunction(e)(t)(r,...i)}}}_setDefaultOptions(e){e.protocol=e.protocol||`https:`,e.port=e.port||443}_getPatchHttpsOutgoingGetFunction(e){return t=>{let n=this;return function(r,...i){return n._getPatchOutgoingGetFunction(e)(t)(r,...i)}}}_traceClientRequest(e,t,n,i,a){this.getConfig().requestHook&&this._callRequestHook(t,e);let o=!1;return e.prependListener(`response`,s=>{this._diag.debug(`outgoingRequest on response()`),e.listenerCount(`response`)<=1&&s.resume();let c=(0,f.getOutgoingRequestAttributesOnResponse)(s,this._semconvStability);t.setAttributes(c),i=Object.assign(i,(0,f.getOutgoingRequestMetricAttributesOnResponse)(c)),a=Object.assign(a,(0,f.getOutgoingStableRequestMetricAttributesOnResponse)(c)),this.getConfig().responseHook&&this._callResponseHook(t,s),t.setAttributes(this._headerCapture.client.captureRequestHeaders(t=>e.getHeader(t))),t.setAttributes(this._headerCapture.client.captureResponseHeaders(e=>s.headers[e])),r.context.bind(r.context.active(),s),s.on(`end`,()=>{if(this._diag.debug(`outgoingRequest on end()`),o)return;o=!0;let c;c=s.aborted&&!s.complete?{code:r.SpanStatusCode.ERROR}:{code:(0,f.parseResponseStatus)(r.SpanKind.CLIENT,s.statusCode)},t.setStatus(c),this.getConfig().applyCustomAttributesOnSpan&&(0,l.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(t,e,s),()=>{},!0),this._closeHttpSpan(t,r.SpanKind.CLIENT,n,i,a)}),s.on(u.errorMonitor,e=>{this._diag.debug(`outgoingRequest on error()`,e),!o&&(o=!0,this._onOutgoingRequestError(t,i,a,n,e))})}),e.on(`close`,()=>{this._diag.debug(`outgoingRequest on request close()`),!(e.aborted||o)&&(o=!0,this._closeHttpSpan(t,r.SpanKind.CLIENT,n,i,a))}),e.on(u.errorMonitor,e=>{this._diag.debug(`outgoingRequest on request error()`,e),!o&&(o=!0,this._onOutgoingRequestError(t,i,a,n,e))}),this._diag.debug(`http.ClientRequest return request`),e}_incomingRequestFunction(e,t){let n=this;return function(a,...o){if(a!==`request`)return t.apply(this,[a,...o]);let s=o[0],c=o[1],p=s.method||`GET`;if(n._diag.debug(`${e} instrumentation incomingRequest`),(0,l.safeExecuteInTheMiddle)(()=>n.getConfig().ignoreIncomingRequestHook?.(s),e=>{e!=null&&n._diag.error(`caught ignoreIncomingRequestHook error: `,e)},!0))return r.context.with((0,i.suppressTracing)(r.context.active()),()=>(r.context.bind(r.context.active(),s),r.context.bind(r.context.active(),c),t.apply(this,[a,...o])));let m=s.headers,h=(0,f.getIncomingRequestAttributes)(s,{component:e,serverName:n.getConfig().serverName,hookAttributes:n._callStartSpanHook(s,n.getConfig().startIncomingSpanHook),semconvStability:n._semconvStability,enableSyntheticSourceDetection:n.getConfig().enableSyntheticSourceDetection||!1},n._diag);Object.assign(h,n._headerCapture.server.captureRequestHeaders(e=>s.headers[e]));let g={kind:r.SpanKind.SERVER,attributes:h},_=(0,i.hrTime)(),v=(0,f.getIncomingRequestMetricAttributes)(h),y={[d.ATTR_HTTP_REQUEST_METHOD]:h[d.ATTR_HTTP_REQUEST_METHOD],[d.ATTR_URL_SCHEME]:h[d.ATTR_URL_SCHEME]};h[d.ATTR_NETWORK_PROTOCOL_VERSION]&&(y[d.ATTR_NETWORK_PROTOCOL_VERSION]=h[d.ATTR_NETWORK_PROTOCOL_VERSION]);let b=r.propagation.extract(r.ROOT_CONTEXT,m),x=n._startHttpSpan(p,g,b),S={type:i.RPCType.HTTP,span:x};return r.context.with((0,i.setRPCMetadata)(r.trace.setSpan(b,x),S),()=>{r.context.bind(r.context.active(),s),r.context.bind(r.context.active(),c),n.getConfig().requestHook&&n._callRequestHook(x,s),n.getConfig().responseHook&&n._callResponseHook(x,c);let e=!1;return c.on(`close`,()=>{e||n._onServerResponseFinish(s,c,x,v,y,_)}),c.on(u.errorMonitor,t=>{e=!0,n._onServerResponseError(x,v,y,_,t)}),(0,l.safeExecuteInTheMiddle)(()=>t.apply(this,[a,...o]),e=>{if(e)throw n._onServerResponseError(x,v,y,_,e),e})})}}_outgoingRequestFunction(e,t){let n=this;return function(a,...o){if(!(0,f.isValidOptionsType)(a))return t.apply(this,[a,...o]);let c=typeof o[0]==`object`&&(typeof a==`string`||a instanceof s.URL)?o.shift():void 0,{method:u,invalidUrl:p,optionsParsed:m}=(0,f.getRequestInfo)(n._diag,a,c);if((0,l.safeExecuteInTheMiddle)(()=>n.getConfig().ignoreOutgoingRequestHook?.(m),e=>{e!=null&&n._diag.error(`caught ignoreOutgoingRequestHook error: `,e)},!0))return t.apply(this,[m,...o]);let{hostname:h,port:g}=(0,f.extractHostnameAndPort)(m),_=(0,f.getOutgoingRequestAttributes)(m,{component:e,port:g,hostname:h,hookAttributes:n._callStartSpanHook(m,n.getConfig().startOutgoingSpanHook),redactedQueryParams:n.getConfig().redactedQueryParams},n._semconvStability,n.getConfig().enableSyntheticSourceDetection||!1),v=(0,i.hrTime)(),y=(0,f.getOutgoingRequestMetricAttributes)(_),b={[d.ATTR_HTTP_REQUEST_METHOD]:_[d.ATTR_HTTP_REQUEST_METHOD],[d.ATTR_SERVER_ADDRESS]:_[d.ATTR_SERVER_ADDRESS],[d.ATTR_SERVER_PORT]:_[d.ATTR_SERVER_PORT]};_[d.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(b[d.ATTR_HTTP_RESPONSE_STATUS_CODE]=_[d.ATTR_HTTP_RESPONSE_STATUS_CODE]),_[d.ATTR_NETWORK_PROTOCOL_VERSION]&&(b[d.ATTR_NETWORK_PROTOCOL_VERSION]=_[d.ATTR_NETWORK_PROTOCOL_VERSION]);let x={kind:r.SpanKind.CLIENT,attributes:_},S=n._startHttpSpan(u,x),C=r.context.active(),w=r.trace.setSpan(C,S);return m.headers?m.headers=Object.assign({},m.headers):m.headers={},r.propagation.inject(w,m.headers),r.context.with(w,()=>{let i=o[o.length-1];typeof i==`function`&&(o[o.length-1]=r.context.bind(C,i));let s=(0,l.safeExecuteInTheMiddle)(()=>p?t.apply(this,[a,...o]):t.apply(this,[m,...o]),e=>{if(e)throw n._onOutgoingRequestError(S,y,b,v,e),e});return n._diag.debug(`${e} instrumentation outgoingRequest`),r.context.bind(C,s),n._traceClientRequest(s,S,v,y,b)})}}_onServerResponseFinish(e,t,n,i,a,o){let s=(0,f.getIncomingRequestAttributesOnResponse)(e,t,this._semconvStability);i=Object.assign(i,(0,f.getIncomingRequestMetricAttributesOnResponse)(s)),a=Object.assign(a,(0,f.getIncomingStableRequestMetricAttributesOnResponse)(s)),n.setAttributes(this._headerCapture.server.captureResponseHeaders(e=>t.getHeader(e))),n.setAttributes(s).setStatus({code:(0,f.parseResponseStatus)(r.SpanKind.SERVER,t.statusCode)});let c=s[d.ATTR_HTTP_ROUTE];c&&n.updateName(`${e.method||`GET`} ${c}`),this.getConfig().applyCustomAttributesOnSpan&&(0,l.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(n,e,t),()=>{},!0),this._closeHttpSpan(n,r.SpanKind.SERVER,o,i,a)}_onOutgoingRequestError(e,t,n,i,a){(0,f.setSpanWithError)(e,a,this._semconvStability),n[d.ATTR_ERROR_TYPE]=a.name,this._closeHttpSpan(e,r.SpanKind.CLIENT,i,t,n)}_onServerResponseError(e,t,n,i,a){(0,f.setSpanWithError)(e,a,this._semconvStability),n[d.ATTR_ERROR_TYPE]=a.name,this._closeHttpSpan(e,r.SpanKind.SERVER,i,t,n)}_startHttpSpan(e,t,n=r.context.active()){let i=t.kind===r.SpanKind.CLIENT?this.getConfig().requireParentforOutgoingSpans:this.getConfig().requireParentforIncomingSpans,a,o=r.trace.getSpan(n);return a=i===!0&&(!o||!r.trace.isSpanContextValid(o.spanContext()))?r.trace.wrapSpanContext(r.INVALID_SPAN_CONTEXT):i===!0&&o?.spanContext().isRemote?o:this.tracer.startSpan(e,t,n),this._spanNotEnded.add(a),a}_closeHttpSpan(e,t,n,a,o){if(!this._spanNotEnded.has(e))return;e.end(),this._spanNotEnded.delete(e);let s=(0,i.hrTimeToMilliseconds)((0,i.hrTimeDuration)(n,(0,i.hrTime)()));t===r.SpanKind.SERVER?this._recordServerDuration(s,a,o):t===r.SpanKind.CLIENT&&this._recordClientDuration(s,a,o)}_callResponseHook(e,t){(0,l.safeExecuteInTheMiddle)(()=>this.getConfig().responseHook(e,t),()=>{},!0)}_callRequestHook(e,t){(0,l.safeExecuteInTheMiddle)(()=>this.getConfig().requestHook(e,t),()=>{},!0)}_callStartSpanHook(e,t){if(typeof t==`function`)return(0,l.safeExecuteInTheMiddle)(()=>t(e),()=>{},!0)}_createHeaderCapture(e){let t=this.getConfig();return{client:{captureRequestHeaders:(0,f.headerCapture)(`request`,t.headersToSpanAttributes?.client?.requestHeaders??[],e),captureResponseHeaders:(0,f.headerCapture)(`response`,t.headersToSpanAttributes?.client?.responseHeaders??[],e)},server:{captureRequestHeaders:(0,f.headerCapture)(`request`,t.headersToSpanAttributes?.server?.requestHeaders??[],e),captureResponseHeaders:(0,f.headerCapture)(`response`,t.headersToSpanAttributes?.server?.responseHeaders??[],e)}}}}})),bo=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HttpInstrumentation=void 0;var t=yo();Object.defineProperty(e,`HttpInstrumentation`,{enumerable:!0,get:function(){return t.HttpInstrumentation}})})),R,z=n((()=>{R=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__})),B,xo=n((()=>{B=globalThis})),So,Co=n((()=>{So=`10.49.0`}));function wo(){return To(B),B}function To(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.49.0`,t[So]=t[`10.49.0`]||{}}function Eo(e,t,n=B){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[So]=r[`10.49.0`]||{};return i[e]||(i[e]=t())}var Do=n((()=>{Co(),xo()}));function Oo(e){if(!(`console`in B))return e();let t=B.console,n={},r=Object.keys(zo);r.forEach(e=>{let r=zo[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function ko(){Io().enabled=!0}function Ao(){Io().enabled=!1}function jo(){return Io().enabled}function Mo(...e){Fo(`log`,...e)}function No(...e){Fo(`warn`,...e)}function Po(...e){Fo(`error`,...e)}function Fo(e,...t){R&&jo()&&Oo(()=>{B.console[e](`${Ro}[${e}]:`,...t)})}function Io(){return R?Eo(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var Lo,Ro,zo,V,H=n((()=>{Do(),z(),xo(),Lo=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],Ro=`Sentry Logger `,zo={},V={enable:ko,disable:Ao,isEnabled:jo,log:Mo,warn:No,error:Po}}));function Bo(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
2
|
+
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=Jo.test(n)?n.replace(Jo,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=qo+r)break}}return Ho(i.slice(r))}}function Vo(e){return Array.isArray(e)?Bo(...e):e}function Ho(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Uo(t).function||``)&&t.pop(),t.reverse(),Yo.test(Uo(t).function||``)&&(t.pop(),Yo.test(Uo(t).function||``)&&t.pop()),t.slice(0,qo).map(e=>({...e,filename:e.filename||Uo(t).filename,function:e.function||`?`}))}function Uo(e){return e[e.length-1]||{}}function Wo(e){try{return!e||typeof e!=`function`?Xo:e.name||Xo}catch{return Xo}}function Go(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}function Ko(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var qo,Jo,Yo,Xo,Zo=n((()=>{qo=50,Jo=/\(error: (.*)\)/,Yo=/captureMessage|captureException/,Xo=`<anonymous>`}));function Qo(e,t){ts[e]=ts[e]||[],ts[e].push(t)}function $o(e,t){if(!ns[e]){ns[e]=!0;try{t()}catch(t){R&&V.error(`Error while instrumenting ${e}`,t)}}}function es(e,t){let n=e&&ts[e];if(n)for(let r of n)try{r(t)}catch(t){R&&V.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Wo(r)}\nError:`,t)}}var ts,ns,rs=n((()=>{z(),H(),Zo(),ts={},ns={}}));function is(e){let t=`error`;Qo(t,e),$o(t,as)}function as(){os=B.onerror,B.onerror=function(e,t,n,r,i){return es(`error`,{column:r,error:i,line:n,msg:e,url:t}),os?os.apply(this,arguments):!1},B.onerror.__SENTRY_INSTRUMENTED__=!0}var os,ss=n((()=>{xo(),rs(),os=null}));function cs(e){let t=`unhandledrejection`;Qo(t,e),$o(t,ls)}function ls(){us=B.onunhandledrejection,B.onunhandledrejection=function(e){return es(`unhandledrejection`,e),us?us.apply(this,arguments):!0},B.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var us,ds=n((()=>{xo(),rs(),us=null}));function fs(e){switch(Es.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return ws(e,Error)}}function ps(e,t){return Es.call(e)===`[object ${t}]`}function ms(e){return ps(e,`ErrorEvent`)}function hs(e){return ps(e,`String`)}function gs(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function _s(e){return e===null||gs(e)||typeof e!=`object`&&typeof e!=`function`}function vs(e){return ps(e,`Object`)}function ys(e){return typeof Event<`u`&&ws(e,Event)}function bs(e){return typeof Element<`u`&&ws(e,Element)}function xs(e){return ps(e,`RegExp`)}function Ss(e){return!!(e?.then&&typeof e.then==`function`)}function Cs(e){return vs(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function ws(e,t){try{return e instanceof t}catch{return!1}}function Ts(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}var Es,Ds=n((()=>{Es=Object.prototype.toString}));function Os(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||js;for(;n&&i++<5&&(o=ks(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function ks(e,t){let n=e,r=[];if(!n?.tagName)return``;if(As.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&hs(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}var As,js,Ms=n((()=>{Ds(),xo(),As=B,js=80}));function Ns(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Fs(i,r);try{e[t]=i}catch{R&&V.log(`Failed to replace method "${t}" in object`,e)}}function Ps(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{R&&V.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Fs(e,t){try{e.prototype=t.prototype=t.prototype||{},Ps(e,`__sentry_original__`,t)}catch{}}function Is(e,t,n,r=!0){let i=e[t];if(typeof i!=`function`)throw Error(`Cannot wrap method: ${t} is not a function`);if(Ls(i))throw Error(`Attempting to wrap method ${t} multiple times`);Fs(n,i),Object.defineProperty(e,t,{writable:!0,configurable:!0,enumerable:r,value:n})}function Ls(e){return e.__sentry_original__}function Rs(e){if(fs(e))return{message:e.message,name:e.name,stack:e.stack,...Bs(e)};if(ys(e)){let t={type:e.type,target:zs(e.target),currentTarget:zs(e.currentTarget),...Bs(e)};return typeof CustomEvent<`u`&&ws(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function zs(e){try{return bs(e)?Os(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Bs(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function Vs(e){let t=Object.keys(Rs(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var Hs=n((()=>{z(),Ms(),H(),Ds()}));function Us(e){if(Ks!==void 0)return Ks?Ks(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=B;return t in n&&typeof n[t]==`function`?(Ks=n[t],Ks(e)):(Ks=null,e())}function Ws(){return Us(()=>Math.random())}function Gs(){return Us(()=>Date.now())}var Ks,qs=n((()=>{xo()}));function Js(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ys(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function Xs(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Ts(r)?n.push(Go(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function Zs(e,t,n=!1){return hs(e)?xs(t)?t.test(e):hs(t)?n?e===t:e.includes(t):typeof t==`function`?t(e):!1:!1}function Qs(e,t=[],n=!1){return t.some(t=>Zs(e,t,n))}var $s=n((()=>{Ds(),Zo()}));function ec(){let e=B;return e.crypto||e.msCrypto}function tc(){return Ws()*16}function nc(e=ec()){try{if(e?.randomUUID)return Us(()=>e.randomUUID()).replace(/-/g,``)}catch{}return dc||(dc=`10000000100040008000100000000000`),dc.replace(/[018]/g,e=>(e^(tc()&15)>>e/4).toString(16))}function rc(e){return e.exception?.values?.[0]}function ic(e){let{message:t,event_id:n}=e;if(t)return t;let r=rc(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function ac(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||``),a.type||(a.type=n||`Error`)}function oc(e,t){let n=rc(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function sc(e){return parseInt(e||``,10)}function cc(e){let t=e.match(fc)||[],n=sc(t[1]),r=sc(t[2]),i=sc(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:t[4]}}function lc(e){if(uc(e))return!0;try{Ps(e,`__sentry_captured__`,!0)}catch{}return!1}function uc(e){try{return e.__sentry_captured__}catch{}}var dc,fc,pc=n((()=>{Hs(),qs(),xo(),fc=/^(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-]+)*))?$/}));function mc(){return Gs()/_c}function hc(){let{performance:e}=B;if(!e?.now||!e.timeOrigin)return mc;let t=e.timeOrigin;return()=>(t+Us(()=>e.now()))/_c}function gc(){return(vc??(vc=hc()))()}var _c,vc,yc=n((()=>{qs(),xo(),_c=1e3}));function bc(e){let t=gc(),n={sid:nc(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>Cc(n)};return e&&xc(n,e),n}function xc(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||gc(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:nc()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Sc(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),xc(e,n)}function Cc(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}var wc=n((()=>{pc(),yc()}));function Tc(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Tc(r[e],t[e],n-1));return r}var Ec=n((()=>{}));function Dc(){return nc()}function Oc(){return nc().substring(16)}var kc=n((()=>{pc()}));function Ac(e,t){t?Ps(e,Mc,t):delete e[Mc]}function jc(e){return e[Mc]}var Mc,Nc=n((()=>{Hs(),Mc=`_sentrySpan`})),Pc,Fc,Ic=n((()=>{z(),wc(),H(),Ds(),Ec(),pc(),kc(),qs(),Nc(),$s(),yc(),Pc=100,Fc=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Dc(),sampleRand:Ws()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Ac(t,jc(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&xc(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():vs(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Ac(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Dc(),sampleRand:Ws()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:Pc;if(n<=0)return this;let r={timestamp:mc(),...e,message:e.message?Js(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:jc(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Tc(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||nc();if(!this._client)return R&&V.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||nc();if(!this._client)return R&&V.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||nc();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(R&&V.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}}));function Lc(){return Eo(`defaultCurrentScope`,()=>new Fc)}function Rc(){return Eo(`defaultIsolationScope`,()=>new Fc)}var zc=n((()=>{Do(),Ic()})),Bc,Vc,Hc,Uc,Wc=n((()=>{Bc=e=>e instanceof Promise&&!e[Vc],Vc=Symbol(`chained PromiseLike`),Hc=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Bc(r)&&Bc(e)?r:Uc(e,r)},Uc=(e,t)=>{let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[Vc]:!0}),t}}));function Gc(){let e=To(wo());return e.stack=e.stack||new Xc(Lc(),Rc())}function Kc(e){return Gc().withScope(e)}function qc(e,t){let n=Gc();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Jc(e){return Gc().withScope(()=>e(Gc().getIsolationScope()))}function Yc(){return{withIsolationScope:Jc,withScope:Kc,withSetScope:qc,withSetIsolationScope:(e,t)=>Jc(t),getCurrentScope:()=>Gc().getScope(),getIsolationScope:()=>Gc().getIsolationScope()}}var Xc,Zc=n((()=>{zc(),Ic(),Wc(),Ds(),Do(),Xc=class{constructor(e,t){let n;n=e||new Fc;let r;r=t||new Fc,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return Ss(n)?Hc(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}}));function Qc(e){let t=To(wo());t.acs=e}function $c(e){let t=To(e);return t.acs?t.acs:Yc()}var el=n((()=>{Do(),Zc()}));function tl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function nl(e,t){let{value:n,unit:r}=tl(e)?e:{value:e,unit:void 0},i=ol(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function rl(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=nl(i,t);e&&(n[r]=e)}return n}function il(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let e=r.value;Array.isArray(e)?t+=al(e[0])*e.length:_s(e)?t+=al(e):t+=100}return t}function al(e){return typeof e==`string`?e.length*2:typeof e==`boolean`?4:typeof e==`number`?8:0}function ol(e){let t=typeof e==`string`?`string`:typeof e==`boolean`?`boolean`:typeof e==`number`&&!Number.isNaN(e)?Number.isInteger(e)?`integer`:`double`:null;if(t)return{value:e,type:t}}var sl=n((()=>{Ds()}));function cl(){return hl?.()}function ll(){return hl!==void 0}function U(){return $c(wo()).getCurrentScope()}function ul(){return $c(wo()).getIsolationScope()}function dl(){return Eo(`globalScope`,()=>new Fc)}function fl(...e){let t=$c(wo());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function pl(...e){let t=$c(wo());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function W(){return U().getClient()}function ml(e){let t=cl();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||Oc()};return r&&(a.parent_span_id=r),a}var hl,gl=n((()=>{el(),Do(),Ic(),kc()})),_l,vl,G,K,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl=n((()=>{_l=`sentry.source`,vl=`sentry.sample_rate`,G=`sentry.op`,K=`sentry.origin`,yl=`sentry.measurement_unit`,bl=`sentry.measurement_value`,xl=`sentry.release`,Sl=`sentry.environment`,Cl=`sentry.segment.name`,wl=`sentry.segment.id`,Tl=`sentry.sdk.name`,El=`sentry.sdk.version`,Dl=`user.id`,Ol=`user.email`,kl=`user.ip_address`,Al=`user.name`,jl=`sentry.custom_span_name`,Ml=`sentry.profile_id`,Nl=`sentry.exclusive_time`,Pl=`cache.hit`,Fl=`cache.key`,Il=`cache.item_size`,Ll=`http.request.method`,Rl=`url.full`,zl=`gen_ai.conversation.id`}));function Vl(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}var Hl=n((()=>{}));function Ul(e){try{let t=B.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function Wl(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var Gl=n((()=>{xo()}));function Kl(e,t,n){e&&(Ps(e,Yl,Ul(n)),Ps(e,Jl,t))}function ql(e){let t=e;return{scope:t[Jl],isolationScope:Wl(t[Yl])}}var Jl,Yl,Xl=n((()=>{Hs(),Gl(),Jl=`_sentryScope`,Yl=`_sentryIsolationScope`}));function Zl(e){let t=$l(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function Ql(e){if(e)return tu(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${nu}${t}`]=n),e),{}))}function $l(e){if(!(!e||!hs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=eu(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):eu(e)}function eu(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function tu(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(R&&V.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var nu,ru=n((()=>{z(),H(),Ds(),nu=`sentry-`}));function iu(e){return e===`http`||e===`https`}function au(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function ou(e){let t=pu.exec(e);if(!t){Oo(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return su({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function su(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function cu(e){if(!R)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(V.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?iu(r)?t&&isNaN(parseInt(t,10))?(V.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(V.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(V.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function lu(e){return e.match(fu)?.[1]}function uu(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=lu(n)),r}function du(e){let t=typeof e==`string`?ou(e):su(e);if(!(!t||!cu(t)))return t}var fu,pu,mu=n((()=>{z(),H(),fu=/^o(\d+)\./,pu=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/}));function hu(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var gu=n((()=>{}));function _u(e){if(!e)return;let t=e.match(Cu);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function vu(e,t){let n=_u(e),r=Zl(t);if(!n?.traceId)return{traceId:Dc(),sampleRand:Ws()};let i=xu(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function yu(e=Dc(),t=Oc(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function bu(e=Dc(),t=Oc(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function xu(e,t){let n=hu(t?.sample_rand);if(n!==void 0)return n;let r=hu(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Ws()*r:r+Ws()*(1-r):Ws()}function Su(e,t){let n=uu(e);return t&&n&&t!==n?(V.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):e.getOptions().strictTraceContinuation&&(t&&!n||!t&&n)?(V.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var Cu,wu=n((()=>{H(),ru(),mu(),gu(),kc(),qs(),Cu=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`)}));function Tu(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=q(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function Eu(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:q(e).parent_span_id,a=ql(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||Oc():t,trace_id:n}}function Du(e){let{traceId:t,spanId:n}=e.spanContext();return yu(t,n,Ru(e))}function Ou(e){let{traceId:t,spanId:n}=e.spanContext();return bu(t,n,Ru(e))}function ku(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Au(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function ju(e){return typeof e==`number`?Mu(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Mu(e.getTime()):gc()}function Mu(e){return e>9999999999?e/1e3:e}function q(e){if(Lu(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Iu(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:Pu(e),start_timestamp:ju(i),timestamp:ju(o)||void 0,status:zu(s),op:r[G],origin:r[K],links:ku(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Nu(e){if(Lu(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Iu(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:Pu(e),start_timestamp:ju(i),end_timestamp:ju(o),is_segment:e===Uu(e),status:Bu(s),attributes:r,links:Au(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===Uu(e)}}function Pu(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function Fu(e){return{...e,attributes:rl(e.attributes),links:e.links?.map(e=>({...e,attributes:rl(e.attributes)}))}}function Iu(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Lu(e){return typeof e.getSpanJSON==`function`}function Ru(e){let{traceFlags:t}=e.spanContext();return t===1}function zu(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function Bu(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}function Vu(e,t){Ps(t,Ju,e[Ju]||e),e[qu]?e[qu].add(t):Ps(e,qu,new Set([t]))}function Hu(e){let t=new Set;function n(e){if(!t.has(e)&&Ru(e)){t.add(e);let r=e[qu]?Array.from(e[qu]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}function Uu(e){return e[Ju]||e}function Wu(){let e=$c(wo());return e.getActiveSpan?e.getActiveSpan():jc(U())}function Gu(){Ku||(Oo(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Ku=!0)}var Ku,qu,Ju,Yu,Xu=n((()=>{el(),sl(),Do(),gl(),Bl(),Hl(),Xl(),Hs(),kc(),yc(),wu(),H(),Nc(),Ku=!1,qu=`_sentryChildSpans`,Ju=`_sentryRootSpan`,Yu=Uu}));function Zu(){if(Qu)return;function e(){let e=Wu(),t=e&&Yu(e);if(t){let e=`internal_error`;R&&V.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}e.tag=`sentry_tracingErrorCallback`,Qu=!0,is(e),cs(e)}var Qu,$u=n((()=>{z(),ss(),ds(),H(),Xu(),Hl(),Qu=!1}));function ed(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||W()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}var td=n((()=>{gl()}));function nd(e){V.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function rd(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(ad(n)){if(Zs(e.description,n))return R&&nd(e),!0;continue}if(!n.name&&!n.op)continue;let t=n.name?Zs(e.description,n.name):!0,r=n.op?e.op&&Zs(e.op,n.op):!0;if(t&&r)return R&&nd(e),!0}return!1}function id(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function ad(e){return typeof e==`string`||e instanceof RegExp}var od=n((()=>{z(),H(),$s()})),sd,cd=n((()=>{sd=`production`}));function ld(e,t){Ps(e,pd,t)}function ud(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:uu(t)};return t.emit(`createDsc`,i),i}function dd(e,t){let n=t.getPropagationContext();return n.dsc||ud(n.traceId,e)}function fd(e){let t=W();if(!t)return{};let n=Yu(e),r=q(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[pd];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&Zl(l);if(u)return s(u);let d=ud(e.spanContext().traceId,t),f=i[`sentry.source`]??i[`sentry.span.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),ed()&&(d.sampled=String(Ru(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??ql(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var pd,md=n((()=>{cd(),gl(),Bl(),ru(),mu(),td(),Hs(),Xu(),Xl(),pd=`_frozenDsc`})),hd,gd=n((()=>{kc(),Xu(),hd=class{constructor(e={}){this._traceId=e.traceId||Dc(),this._spanId=e.spanId||Oc(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}}));function _d(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}var vd=n((()=>{}));function yd(e,t=100,n=1/0){try{return xd(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function bd(e,t=3,n=100*1024){let r=yd(e,t);return Td(r)>n?bd(e,t-1,n):r}function xd(e,t,n=1/0,r=1/0,i=Ed()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=Sd(e,t);if(!s.startsWith(`[object `))return s;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(c===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let l=t;if(l&&typeof l.toJSON==`function`)try{return xd(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=Rs(t);for(let e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(d>=r){u[e]=`[MaxProperties ~]`;break}let t=f[e];u[e]=xd(e,t,c-1,r,i),d++}return o(t),u}function Sd(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Ts(t))return Go(t);if(Cs(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${Wo(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=Cd(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function Cd(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function wd(e){return~-encodeURI(e).split(/%..|./).length}function Td(e){return wd(JSON.stringify(e))}function Ed(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}var Dd=n((()=>{Ds(),Hs(),Zo()}));function Od(e,t=[]){return[e,t]}function kd(e,t){let[n,r]=e;return[n,[...r,t]]}function Ad(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function jd(e,t){return Ad(e,(e,n)=>t.includes(n))}function Md(e){let t=To(B);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Nd(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Md(r),e]:r.push(typeof e==`string`?Md(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(yd(n))}i(e)}}return typeof r==`string`?r:Pd(r)}function Pd(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Fd(e){return[{type:`span`},e]}function Id(e){let t=typeof e.data==`string`?Md(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}function Ld(e){return e in Vd}function Rd(e){return Ld(e)?Vd[e]:e}function zd(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Bd(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:au(r)},...i&&{trace:i}}}var Vd,Hd=n((()=>{Do(),mu(),Dd(),xo(),Vd={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`}}));function Ud(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Wd(e,t,n,r){let i=zd(n);return Od({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:au(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Gd(e,t,n,r){let i=zd(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Ud(e,n?.sdk);let o=Bd(e,i,r,t);return delete e.sdkProcessingMetadata,Od(o,[[{type:a},e]])}function Kd(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=fd(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:au(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>!rd(q(e),c)):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=q(e);return(_d(s)?t:s(t))||(Gu(),t)}:q,f=[];for(let e of l){let t=d(e);t&&f.push(Fd(t))}return Od(o,f)}var qd=n((()=>{md(),vd(),mu(),Hd(),od(),Xu()}));function Jd(e){if(!R)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=q(e),{spanId:i}=e.spanContext(),a=Ru(e),o=Yu(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=q(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}V.log(`${c}
|
|
3
|
+
${l.join(`
|
|
4
|
+
`)}`)}function Yd(e){if(!R)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=q(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${Yu(e)===e?`root `:``}span "${t}" with ID ${r}`;V.log(i)}var Xd=n((()=>{z(),H(),Xu()}));function Zd(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[yl],i=n[bl];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}var Qd=n((()=>{Bl()}));function $d(e){return e.getOptions().traceLifecycle===`stream`}var ef=n((()=>{}));function tf(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function nf(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function rf(e){return e instanceof sf&&e.isStandaloneSpan()}function af(e){let t=W();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}var of,sf,cf=n((()=>{gl(),z(),qd(),Bl(),H(),kc(),Xu(),yc(),md(),Xd(),Qd(),ef(),Xl(),of=1e3,sf=class{constructor(e={}){this._traceId=e.traceId||Dc(),this._spanId=e.spanId||Oc(),this._startTime=e.startTimestamp||gc(),this._links=e.links,this._attributes={},this.setAttributes({[K]:`manual`,[G]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=ju(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(_l,`custom`),this}end(e){this._endTime||(this._endTime=ju(e),Yd(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[G],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:zu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[K],profile_id:this._attributes[Ml],exclusive_time:this._attributes[Nl],measurements:Zd(this._events),is_segment:this._isStandaloneSpan&&Yu(this)===this||void 0,segment_id:this._isStandaloneSpan?Yu(this).spanContext().spanId:void 0,links:ku(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Yu(this),status:Bu(this._status),attributes:this._attributes,links:Au(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){R&&V.log(`[Tracing] Adding an event to span:`,e);let r=tf(t)?t:n||gc(),i=tf(t)?{}:t||{},a={name:e,time:ju(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=W();if(e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this)),!(this._isStandaloneSpan||this===Yu(this)))return;if(this._isStandaloneSpan){this._sampled?af(Kd([this],e)):(R&&V.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}else if(e&&$d(e)){e.emit(`afterSegmentSpanEnd`,this);return}let t=this._convertSpanToTransaction();t&&(ql(this).scope||U()).captureEvent(t)}_convertSpanToTransaction(){if(!nf(q(this)))return;this._name||(R&&V.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name=`<unlabeled transaction>`);let{scope:e,isolationScope:t}=ql(this),n=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let r=Hu(this).filter(e=>e!==this&&!rf(e)).map(e=>q(e)).filter(nf),i=this._attributes[_l];delete this._attributes[jl],r.forEach(e=>{delete e.data[jl]});let a={contexts:{trace:Tu(this)},spans:r.length>of?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,of):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:fd(this)},request:n,...i&&{transaction_info:{source:i}}},o=Zd(this._events);return o&&Object.keys(o).length&&(R&&V.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(o,void 0,2)),a.measurements=o),a}}}));function lf(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return uf(i,t,n,r)}function uf(e,t,n,r){return Ss(e)?Hc(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}var df=n((()=>{Wc(),Ds()}));function ff(e,t,n){if(!ed(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=hu(i);if(a===void 0)return R&&V.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return R&&V.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||R&&V.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var pf=n((()=>{z(),H(),td(),gu()}));function mf(e,t){let n=xf();if(n.startSpan)return n.startSpan(e,t);let r=bf(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return fl(s,()=>Tf(a)(()=>{let n=U(),o=wf(n,a),s=e.onlyIfParent&&!o?new hd:yf({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!Df(s)||!o)&&Ac(n,s),lf(()=>t(s),()=>{let{status:e}=q(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})},()=>{s.end()})}))}function hf(e,t){let n=xf();if(n.startSpanManual)return n.startSpanManual(e,t);let r=bf(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return fl(s,()=>Tf(a)(()=>{let n=U(),o=wf(n,a),s=e.onlyIfParent&&!o?new hd:yf({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!Df(s)||!o)&&Ac(n,s),lf(()=>t(s,()=>s.end()),()=>{let{status:e}=q(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function gf(e){let t=xf();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=bf(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>fl(e.scope,t):i===void 0?e=>e():e=>_f(i,e))(()=>{let t=U(),a=wf(t,i);return e.onlyIfParent&&!a?new hd:yf({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function _f(e,t){let n=xf();return n.withActiveSpan?n.withActiveSpan(e,t):fl(n=>(Ac(n,e||void 0),t(n)))}function vf(e){let t=xf();return t.suppressTracing?t.suppressTracing(e):fl(t=>{t.setSDKProcessingMetadata({[kf]:!0});let n=e();return t.setSDKProcessingMetadata({[kf]:void 0}),n})}function yf({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!ed()){let r=new hd;return(n||!e)&&ld(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...fd(r)}),r}let i=W();if(Ef(i,t))return Of(r)||i?.recordDroppedEvent(`ignored`,`span`),new hd({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let a=ul(),o;if(e&&!n)o=Cf(e,r,t),Vu(e,o);else if(e){let n=fd(e),{traceId:i,spanId:a}=e.spanContext(),s=Ru(e);o=Sf({traceId:i,parentSpanId:a,...t},r,s),ld(o,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:s}={...a.getPropagationContext(),...r.getPropagationContext()};o=Sf({traceId:e,parentSpanId:i,...t},r,s),n&&ld(o,n)}return Jd(o),Kl(o,r,a),o}function bf(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=ju(e.startTime),delete n.startTime,n}return t}function xf(){return $c(wo())}function Sf(e,t,n){let r=W(),i=r?.getOptions()||{},{name:a=``}=e,o={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};r?.emit(`beforeSampling`,o,{decision:!1});let s=o.parentSampled??n,c=o.spanAttributes,l=t.getPropagationContext(),u=Of(t),[d,f,p]=u?[!1]:ff(i,{name:a,parentSampled:s,attributes:c,parentSampleRate:hu(l.dsc?.sample_rate)},l.sampleRand),m=new sf({...e,attributes:{[_l]:`custom`,[vl]:f!==void 0&&p?f:void 0,...c},sampled:d});return!d&&r&&!u&&(R&&V.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),r.recordDroppedEvent(`sample_rate`,$d(r)?`span`:`transaction`)),r&&r.emit(`spanStart`,m),m}function Cf(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=Of(t),o=a?!1:Ru(e),s=o?new sf({...n,parentSpanId:r,traceId:i,sampled:o}):new hd({traceId:i});Vu(e,s);let c=W();return c?($d(c)&&s instanceof hd&&(e instanceof hd&&e.dropReason?(s.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,`span`)):a||(s.dropReason=`sample_rate`,c.recordDroppedEvent(`sample_rate`,`span`))),c.emit(`spanStart`,s),n.endTimestamp&&(c.emit(`spanEnd`,s),c.emit(`afterSpanEnd`,s)),s):s}function wf(e,t){if(t)return t;if(t===null)return;let n=jc(e);if(!n)return;let r=W();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Yu(n):n}function Tf(e){return e===void 0?e=>e():t=>_f(e,t)}function Ef(e,t){let n=e?.getOptions().ignoreSpans;return!e||!$d(e)||!n?.length?!1:rd({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op},n)}function Df(e){return e instanceof hd&&e.dropReason===`ignored`}function Of(e){return e.getScopeData().sdkProcessingMetadata[kf]===!0}var kf,Af=n((()=>{el(),Do(),gl(),z(),Bl(),H(),df(),td(),od(),ef(),gu(),Nc(),Xu(),md(),Xd(),pf(),gd(),cf(),Hl(),Xl(),kf=`__SENTRY_SUPPRESS_TRACING__`}));function jf(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Ff(e,t),r&&Rf(e,r),zf(e,n),If(e,i),Lf(e,a)}function Mf(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Nf(e,`extra`,n),Nf(e,`tags`,r),Nf(e,`attributes`,i),Nf(e,`user`,a),Nf(e,`contexts`,o),e.sdkProcessingMetadata=Tc(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Nf(e,t,n){e[t]=Tc(e[t],n,1)}function Pf(e,t){let n=dl().getScopeData();return e&&Mf(n,e.getScopeData()),t&&Mf(n,t.getScopeData()),n}function Ff(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function If(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Lf(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Rf(e,t){e.contexts={trace:Eu(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:fd(t),...e.sdkProcessingMetadata};let n=q(Yu(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function zf(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var Bf=n((()=>{gl(),md(),Ec(),Xu()}));function Vf(e,t){let n=Nu(e),r=Uu(e),i=Nu(r),{isolationScope:a,scope:o}=ql(e);Hf(n,i,t,Pf(a,o)),n.is_segment&&t.emit(`processSegmentSpan`,n),t.emit(`processSpan`,n);let{beforeSendSpan:s}=t.getOptions(),c=s&&_d(s)?Uf(n,s):n,l=c.attributes?.[_l];return l&&Wf(c,{"sentry.span.source":l}),{...Fu(c),_segmentSpan:r}}function Hf(e,t,n,r){let i=n.getSdkMetadata(),{release:a,environment:o,sendDefaultPii:s}=n.getOptions();Wf(e,{[xl]:a,[Sl]:o,[Cl]:t.name,[wl]:t.span_id,[Tl]:i?.sdk?.name,[El]:i?.sdk?.version,...s?{[Dl]:r.user?.id,[Ol]:r.user?.email,[kl]:r.user?.ip_address,[Al]:r.user?.username}:{},...r.attributes})}function Uf(e,t){return t(e)||(Gu(),e)}function Wf(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}var Gf=n((()=>{Bl(),Bf(),Xu(),Xl(),vd()}));function Kf(e){return new Zf(t=>{t(e)})}function qf(e){return new Zf((t,n)=>{n(e)})}var Jf,Yf,Xf,Zf,Qf=n((()=>{Ds(),Jf=0,Yf=1,Xf=2,Zf=class e{constructor(e){this._state=Jf,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===Jf)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Yf&&e[1](this._value),this._state===Xf&&e[2](this._value),e[0]=!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===Jf){if(Ss(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(Yf,e)},r=e=>{t(Xf,e)};try{e(n,r)}catch(e){r(e)}}}}));function $f(e,t,n,r=0){try{let i=ep(t,n,e,r);return Ss(i)?i:Kf(i)}catch(e){return qf(e)}}function ep(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return R&&a===null&&V.log(`Event processor "${i.id||`?`}" dropped event`),Ss(a)?a.then(e=>ep(e,t,n,r+1)):ep(a,t,n,r+1)}var tp=n((()=>{z(),H(),Ds(),Qf()}));function np(e){let t=B._sentryDebugIds,n=B._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(op&&r.length===ip&&i.length===ap)return op;ip=r.length,ap=i.length,op={},rp||(rp={});let a=(t,n)=>{for(let r of t){let t=n[r],i=rp?.[r];if(i&&op&&t)op[i[0]]=t,rp&&(rp[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&op&&rp){op[i]=t,rp[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),op}var rp,ip,ap,op,sp=n((()=>{xo()}));function cp(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||nc(),timestamp:t.timestamp||mc()},l=n.integrations||e.integrations.map(e=>e.name);lp(c,e),fp(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&up(c,e.stackParser);let u=mp(r,n.captureContext);n.mechanism&&oc(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Pf(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),jf(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Kf(c):$f(m,c,n)).then(e=>(e&&dp(e),typeof o==`number`&&o>0?pp(e,o,s):e))}function lp(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=Js(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&(e.value=Js(e.value,a))})}function up(e,t){let n=np(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function dp(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function fp(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function pp(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:yd(e.data,t,n)}}))},...e.user&&{user:yd(e.user,t,n)},...e.contexts&&{contexts:yd(e.contexts,t,n)},...e.extra&&{extra:yd(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=yd(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:yd(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=yd(e.contexts.flags,3,n)),r}function mp(e,t){if(!t)return e;let n=e?e.clone():new Fc;return n.update(t),n}function hp(e){if(e)return gp(e)||_p(e)?{captureContext:e}:e}function gp(e){return e instanceof Fc||typeof e==`function`}function _p(e){return Object.keys(e).some(e=>vp.includes(e))}var vp,yp=n((()=>{cd(),tp(),Ic(),sp(),pc(),Dd(),Bf(),$s(),Qf(),yc(),vp=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`]}));function J(e,t){return U().captureException(e,hp(t))}function bp(e,t){return U().captureEvent(e,t)}async function xp(e){let t=W();return t?t.flush(e):(R&&V.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}async function Sp(e){let t=W();return t?t.close(e):(R&&V.warn(`Cannot flush events and disable SDK. No client defined.`),Promise.resolve(!1))}function Cp(){let e=W();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function wp(e){let t=ul(),{user:n}=Pf(t,U()),{userAgent:r}=B.navigator||{},i=bc({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&xc(a,{status:`exited`}),Tp(),t.setSession(i),i}function Tp(){let e=ul(),t=U().getSession()||e.getSession();t&&Sc(t),Ep(),e.setSession()}function Ep(){let e=ul(),t=W(),n=e.getSession();n&&t&&t.captureSession(n)}var Dp=n((()=>{gl(),z(),wc(),H(),yp(),Bf(),xo()}));function Op(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function kp(e){return`${Op(e)}${e.projectId}/envelope/`}function Ap(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function jp(e,t,n){return t||`${kp(e)}?${Ap(e,n)}`}var Mp=n((()=>{}));function Np(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function Pp(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return Np(r)}function Fp(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Lp(e,t,n)}),n}function Ip(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Lp(e,t,n){if(n[t.name]){R&&V.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Rp.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),Rp.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}R&&V.log(`Integration installed: ${t.name}`)}function Y(e){return e}var Rp,zp=n((()=>{z(),H(),Rp=[]}));function Bp(e,t){return t?fl(t,()=>{let n=Wu(),r=n?Eu(n):ml(t);return[n?fd(n):dd(e,t),r]}):[void 0,void 0]}var Vp=n((()=>{gl(),md(),Xu()}));function Hp(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function Up(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=au(r)),Od(i,[Hp(e)])}var Wp=n((()=>{mu(),Hd()}));function Gp(e,t){let n=t??Kp(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Up(n,r._metadata,r.tunnel,e.getDsn());qp().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function Kp(e){return qp().get(e)}function qp(){return Eo(`clientToLogBufferMap`,()=>new WeakMap)}var Jp=n((()=>{Do(),Wp()}));function Yp(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function Xp(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=au(r)),Od(i,[Yp(e)])}var Zp=n((()=>{mu(),Hd()}));function Qp(e,t){let n=t??$p(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Xp(n,r._metadata,r.tunnel,e.getDsn());em().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function $p(e){return em().get(e)}function em(){return Eo(`clientToMetricBufferMap`,()=>new WeakMap)}var tm=n((()=>{Do(),Zp()}));function nm(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}var rm=n((()=>{}));function im(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return qf(am);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Kf(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>nm(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var am,om=n((()=>{Qf(),rm(),am=Symbol.for(`SentryBufferFullError`)}));function sm(e,t=Gs()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?dm:r-t}function cm(e,t){return e[t]||e.all||0}function lm(e,t,n=Gs()){return cm(e,t)>n}function um(e,{statusCode:t,headers:n},r=Gs()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+sm(o,r):t===429&&(i.all=r+60*1e3);return i}var dm,fm=n((()=>{qs(),dm=60*1e3}));function pm(e,t,n=im(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(Ad(i,(t,n)=>{let i=Rd(n);lm(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=Od(i[0],a),s=t=>{if(jd(o,[`client_report`])){R&&V.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}Ad(o,(n,r)=>{e.recordDroppedEvent(t,Rd(r))})};return n.add(()=>t({body:Nd(o)}).then(e=>e.statusCode===413?(R&&V.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(R&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&V.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=um(r,e),e),e=>{throw s(`network_error`),R&&V.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===am)return R&&V.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}var mm=n((()=>{z(),H(),Hd(),om(),fm()}));function hm(e,t,n){let r=[{type:`client_report`},{timestamp:n||mc(),discarded_events:e}];return Od(t?{dsn:t}:{},[r])}var gm=n((()=>{Hd(),yc()}));function _m(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}var vm=n((()=>{}));function ym(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[Ml],exclusive_time:o?.[Nl],measurements:e.measurements,is_segment:!0}}function bm(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var xm=n((()=>{Bl()}));function Sm(e){return{message:e,[Rm]:!0}}function Cm(e){return{message:e,[zm]:!0}}function wm(e){return!!e&&typeof e==`object`&&Rm in e}function Tm(e){return!!e&&typeof e==`object`&&zm in e}function Em(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=nm(setTimeout(()=>{i(e)},Bm)))}),e.on(`flush`,()=>{i(e)})}function Dm(e){return e===`replay_event`?`replay`:e||`error`}function Om(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Ss(e))return e.then(e=>{if(!vs(e)&&e!==null)throw Sm(n);return e},e=>{throw Sm(`${t} rejected with ${e}`)});if(!vs(e)&&e!==null)throw Sm(n);return e}function km(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!_d(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Am(c)&&i)return i(c,r);if(jm(c)){if(s||o){let t=ym(c);if(o?.length&&rd(t,o))return null;if(s){let e=s(t);e?c=Tc(n,bm(e)):Gu()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&rd(e,o)){id(n,e);continue}if(s){let n=s(e);n?t.push(n):(Gu(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function Am(e){return e.type===void 0}function jm(e){return e.type===`transaction`}function Mm(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Pm(e.attributes)}function Nm(e){let t=0;return e.message&&(t+=e.message.length*2),t+Pm(e.attributes)}function Pm(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Fm(e[0]):_s(e)?t+=Fm(e):t+=100}),t}function Fm(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}var Im,Lm,Rm,zm,Bm,Vm,Hm=n((()=>{Mp(),cd(),gl(),z(),qd(),zp(),Jp(),tm(),wc(),md(),vd(),mm(),gm(),H(),mu(),Hd(),vm(),Ds(),Ec(),pc(),gu(),yp(),om(),qs(),od(),Xu(),Qf(),rm(),xm(),Im=`Not capturing exception because it's already been captured.`,Lm=`Discarded session because of missing or non-string release`,Rm=Symbol.for(`SentryInternalError`),zm=Symbol.for(`SentryDoNotSendEventError`),Bm=5e3,Vm=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=im(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=du(e.dsn):R&&V.warn(`No DSN provided, client will not send events.`),this._dsn){let t=jp(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Em(this,`afterCaptureLog`,`flushLogs`,Nm,Gp),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Em(this,`afterCaptureMetric`,`flushMetrics`,Mm,Qp)}captureException(e,t,n){let r=nc();if(lc(e))return R&&V.log(Im),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:nc(),...n},a=gs(e)?e:String(e),o=_s(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=nc();if(t?.originalException&&lc(t.originalException))return R&&V.log(Im),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=Dm(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),xc(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(!t)return!0;this.emit(`flush`);let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Gp(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Lp(this,e,this._integrations),t||Ip(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Gd(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=kd(n,Id(e));this.sendEnvelope(n).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=sd}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){R&&V.warn(Lm);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){R&&V.warn(Lm);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=Wd(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;R&&V.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return R&&V.error(`Error while sending envelope:`,e),{}}return R&&V.error(`Transport disabled`),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Fp(this,e),Ip(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(xc(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),cp(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...ml(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:dd(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=U(),r=ul()){return R&&Am(e)&&V.log(`Captured error event \`${_m(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{R&&(Tm(e)?V.log(e.message):wm(e)?V.warn(e.message):V.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=jm(e),s=Am(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:hu(a);if(s&&typeof l==`number`&&Ws()>l)return this.recordDroppedEvent(`sample_rate`,`error`),qf(Cm(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=Dm(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),Cm("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:Om(km(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw Cm(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw Tm(e)||wm(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),Sm(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===am&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){R&&V.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){R&&V.log(`No outcomes to send`);return}if(!this._dsn){R&&V.log(`No dsn provided, will not send outcomes`);return}R&&V.log(`Sending outcomes:`,e);let t=hm(e,this._options.tunnel&&au(this._dsn));this.sendEnvelope(t)}}}));function Um(e,t,n,r,i){let a={sent_at:new Date().toISOString()};return n?.sdk&&(a.sdk={name:n.sdk.name,version:n.sdk.version}),r&&i&&(a.dsn=au(i)),t&&(a.trace=t),Od(a,[Wm(e)])}function Wm(e){return[{type:`check_in`},e]}var Gm=n((()=>{mu(),Hd()}));function Km(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}var qm=n((()=>{}));function Jm(e,t){return e(t.stack||``,1)}function Ym(e){return fs(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function Xm(e){return Ym(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Zm(e,t){let n={type:t.name||t.constructor.name,value:Xm(t)},r=Jm(e,t);return r.length&&(n.stacktrace={frames:r}),n}function Qm(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function $m(e){if(`name`in e&&typeof e.name==`string`){let t=`'${e.name}' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message '${e.message}'`),t}else if(`message`in e&&typeof e.message==`string`)return e.message;let t=Vs(e);if(ms(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=eh(e);return`${n&&n!==`Object`?`'${n}'`:`Object`} captured as exception with keys: ${t}`}function eh(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function th(e,t,n,r){if(fs(n))return[n,void 0];if(t.synthetic=!0,vs(n)){let t=e?.getOptions().normalizeDepth,i={__serialized__:bd(n,t)},a=Qm(n);if(a)return[a,i];let o=$m(n),s=r?.syntheticException||Error(o);return s.message=o,[s,i]}let i=r?.syntheticException||Error(n);return i.message=`${n}`,[i,void 0]}function nh(e,t,n,r){let i=r?.data&&r.data.mechanism||{handled:!0,type:`generic`},[a,o]=th(e,i,n,r),s={exception:{values:[Zm(t,a)]}};return o&&(s.extra=o),ac(s,void 0,void 0),oc(s,i),{...s,event_id:r?.event_id}}function rh(e,t,n=`info`,r,i){let a={event_id:r?.event_id,level:n};if(i&&r?.syntheticException){let n=Jm(e,r.syntheticException);n.length&&(a.exception={values:[{value:t,stacktrace:{frames:n}}]},oc(a,{synthetic:!0}))}if(gs(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return a.logentry={message:e,params:n},a}return a.message=t,a}var ih=n((()=>{Ds(),pc(),Dd(),Hs()}));function ah(e){let t=ul().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!==`crashed`?t.status=`errored`:n||(t.status=`crashed`)}}var oh,sh=n((()=>{Gm(),Hm(),gl(),z(),$u(),H(),pc(),mm(),qm(),ih(),om(),Qf(),Vp(),oh=class extends Vm{constructor(e){Zu(),Km(e),super(e),this._setUpMetricsProcessing()}eventFromException(e,t){let n=nh(this,this._options.stackParser,e,t);return n.level=`error`,Kf(n)}eventFromMessage(e,t=`info`,n){return Kf(rh(this._options.stackParser,e,t,n,this._options.attachStacktrace))}captureException(e,t,n){return ah(t),super.captureException(e,t,n)}captureEvent(e,t,n){return!e.type&&e.exception?.values&&e.exception.values.length>0&&ah(t),super.captureEvent(e,t,n)}captureCheckIn(e,t,n){let r=`checkInId`in e&&e.checkInId?e.checkInId:nc();if(!this._isEnabled())return R&&V.warn(`SDK not enabled, will not capture check-in.`),r;let{release:i,environment:a,tunnel:o}=this.getOptions(),s={check_in_id:r,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};`duration`in e&&(s.duration=e.duration),t&&(s.monitor_config={schedule:t.schedule,checkin_margin:t.checkinMargin,max_runtime:t.maxRuntime,timezone:t.timezone,failure_issue_threshold:t.failureIssueThreshold,recovery_threshold:t.recoveryThreshold});let[c,l]=Bp(this,n);l&&(s.contexts={trace:l});let u=Um(s,c,this.getSdkMetadata(),o,this.getDsn());return R&&V.log(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(u),r}dispose(){R&&V.log(`Disposing client...`);for(let e of Object.keys(this._hooks))this._hooks[e]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=im(64)}_prepareEvent(e,t,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,t,n,r)}_setUpMetricsProcessing(){this.on(`processMetric`,e=>{this._options.serverName&&(e.attributes={"server.address":this._options.serverName,...e.attributes})})}}}));function ch(e){e.forEach(e=>{dh.add(e),R&&V.log(`AI provider "${e}" wrapping will be skipped`)})}function lh(e){return dh.has(e)}function uh(){dh.clear(),R&&V.log(`Cleared AI provider skip registrations`)}var dh,fh=n((()=>{z(),H(),dh=new Set}));function ph(e,t){let n=String(e).toLowerCase();return mh.has(n)?!1:hh.has(n)?!0:t?.strict?null:!!e}var mh,hh,gh=n((()=>{mh=new Set([`false`,`f`,`n`,`no`,`off`,`0`]),hh=new Set([`true`,`t`,`y`,`yes`,`on`,`1`])}));function _h(e){return`isRelative`in e}function vh(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?Eh:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function yh(e){if(_h(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&(t.password=`%filtered%`),t.username&&(t.username=`%filtered%`),t.toString()}function bh(e,t,n,r){return`${n?.method?.toUpperCase()??`GET`} ${r||(e?t===`client`?yh(e):e.pathname:`/`)}`}function xh(e,t,n,r,i){let a={[K]:n,[_l]:`url`};return i&&(a[t===`server`?`http.route`:`url.template`]=i,a[_l]=`route`),r?.method&&(a[Ll]=r.method.toUpperCase()),e&&(e.search&&(a[`url.query`]=e.search),e.hash&&(a[`url.fragment`]=e.hash),e.pathname&&(a[`url.path`]=e.pathname,e.pathname===`/`&&(a[_l]=`route`)),_h(e)||(a[Rl]=e.href,e.port&&(a[`url.port`]=e.port),e.protocol&&(a[`url.scheme`]=e.protocol),e.hostname&&(a[t===`server`?`server.address`:`url.domain`]=e.hostname))),[bh(e,t,r,i),a]}function Sh(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Ch(e){return e.split(/[?#]/,1)[0]}function wh(e){let{protocol:t,host:n,path:r}=e,i=n?.replace(/^.*@/,`[filtered]:[filtered]@`).replace(/(:80)$/,``).replace(/(:443)$/,``)||``;return`${t?`${t}://`:``}${i}${r}`}function Th(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}var Eh,Dh=n((()=>{Bl(),Eh=`thismessage:/`}));function Oh(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:So})),i.version=So)}var kh=n((()=>{Co()}));function Ah(e={}){let t=e.client||W();if(!Cp()||!t)return{};let n=$c(wo());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||U(),i=e.span||Wu();if(!i&&ll())return{};let a=i?Du(i):jh(r),o=Ql(i?fd(i):dd(t,r));if(!Cu.test(a))return V.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?Ou(i):Mh(r)),s}function jh(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return yu(t,r,n)}function Mh(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return bu(t,r,n)}var Nh=n((()=>{el(),Do(),gl(),Dp(),H(),Xu(),md(),ru(),wu()}));function Ph(e,t,n){if(typeof e!=`string`||!t)return!0;let r=n?.get(e);if(r!==void 0)return R&&!r&&V.log(Fh,e),r;let i=Qs(e,t);return n?.set(e,i),R&&!i&&V.log(Fh,e),i}var Fh,Ih=n((()=>{z(),H(),$s(),Fh=`[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:`}));function Lh(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var Rh=n((()=>{}));function zh(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{typeof n==`string`&&(t[e]=n)})}catch{}return t}function Bh(e){let t=e.headers||{},n=(typeof t[`x-forwarded-host`]==`string`?t[`x-forwarded-host`]:void 0)||(typeof t.host==`string`?t.host:void 0),r=(typeof t[`x-forwarded-proto`]==`string`?t[`x-forwarded-proto`]:void 0)||e.protocol||(e.socket?.encrypted?`https`:`http`),i=e.url||``,a=Vh({url:i,host:n,protocol:r}),o=e.body||void 0,s=e.cookies;return{url:a,method:e.method,query_string:Kh(i),headers:zh(t),cookies:s,data:o}}function Vh({url:e,protocol:t,host:n}){if(e?.startsWith(`http`))return e;if(e&&n)return`${t}://${n}${e}`}function Hh(e,t=!1,n=`request`){let r={};try{Object.entries(e).forEach(([e,i])=>{if(i==null)return;let a=e.toLowerCase();if((a===`cookie`||a===`set-cookie`)&&typeof i==`string`&&i!==``){let e=a===`set-cookie`,o=i.indexOf(`;`),s=e&&o!==-1?i.substring(0,o):i,c=e?[s]:s.split(`; `);for(let e of c){let i=e.indexOf(`=`),o=i===-1?e:e.substring(0,i),s=i===-1?``:e.substring(i+1);Wh(r,a,o.toLowerCase(),s,t,n)}}else Wh(r,a,``,i,t,n)})}catch{}return r}function Uh(e){return e.replace(/-/g,`_`)}function Wh(e,t,n,r,i,a){let o=Gh(n||t,r,i);if(o==null)return;let s=`http.${a}.header.${Uh(t)}${n?`.${Uh(n)}`:``}`;e[s]=o}function Gh(e,t,n){if(n?qh.some(t=>e.includes(t)):[...Jh,...qh].some(t=>e.includes(t)))return`[Filtered]`;if(Array.isArray(t))return t.map(e=>e==null?e:String(e)).join(`;`);if(typeof t==`string`)return t}function Kh(e){if(e)try{let t=new URL(e,`http://s.io`).search.slice(1);return t.length?t:void 0}catch{return}}var qh,Jh,Yh=n((()=>{qh=[`auth`,`token`,`secret`,`session`,`password`,`passwd`,`pwd`,`key`,`jwt`,`bearer`,`sso`,`saml`,`csrf`,`xsrf`,`credentials`,`set-cookie`,`cookie`],Jh=[`x-forwarded-`,`-user`]}));function Xh(e,t){let n=W(),r=ul();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Zh}=n.getOptions();if(a<=0)return;let o={timestamp:mc(),...e},s=i?Oo(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var Zh,Qh=n((()=>{gl(),H(),yc(),Zh=100})),$h,eg,tg,ng,rg,ig=n((()=>{gl(),zp(),Hs(),eg=`FunctionToString`,tg=new WeakMap,ng=(()=>({name:eg,setupOnce(){$h=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Ls(this),n=tg.has(W())&&t!==void 0?t:this;return $h.apply(n,e)}}catch{}},setup(e){tg.set(e,!0)}})),rg=Y(ng)}));function ag(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:mg],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function og(e,t){if(!e.type){if(sg(e,t.ignoreErrors))return R&&V.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ic(e)}`),!0;if(pg(e))return R&&V.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${ic(e)}`),!0;if(lg(e,t.denyUrls))return R&&V.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ic(e)}.\nUrl: ${fg(e)}`),!0;if(!ug(e,t.allowUrls))return R&&V.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ic(e)}.\nUrl: ${fg(e)}`),!0}else if(e.type===`transaction`&&cg(e,t.ignoreTransactions))return R&&V.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ic(e)}`),!0;return!1}function sg(e,t){return t?.length?_m(e).some(e=>Qs(e,t)):!1}function cg(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Qs(n,t):!1}function lg(e,t){if(!t?.length)return!1;let n=fg(e);return n?Qs(n,t):!1}function ug(e,t){if(!t?.length)return!0;let n=fg(e);return n?Qs(n,t):!0}function dg(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function fg(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?dg(t):null}catch{return R&&V.error(`Cannot extract url for event ${ic(e)}`),null}}function pg(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}var mg,hg,gg,_g,vg=n((()=>{z(),zp(),H(),vm(),pc(),$s(),mg=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],hg=`EventFilters`,gg=Y((e={})=>{let t;return{name:hg,setup(n){t=ag(e,n.getOptions())},processEvent(n,r,i){return t||(t=ag(e,i.getOptions())),og(n,t)?null:n}}}),_g=Y(((e={})=>({...gg(e),name:`InboundFilters`})))}));function yg(e,t,n,r,i,a){if(!i.exception?.values||!a||!ws(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=bg(e,t,r,a.originalException,n,i.exception.values,o,0))}function bg(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(ws(r[i],Error)){Sg(o,s,r);let a=e(t,r[i]),l=c.length;Cg(a,i,l,s),c=bg(e,t,n,r[i],i,[a,...c],a,l)}return xg(r)&&r.errors.forEach((a,l)=>{if(ws(a,Error)){Sg(o,s,r);let u=e(t,a),d=c.length;Cg(u,`errors[${l}]`,d,s),c=bg(e,t,n,a,i,[u,...c],u,d)}}),c}function xg(e){return Array.isArray(e.errors)}function Sg(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...xg(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Cg(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}var wg=n((()=>{Ds()})),Tg,Eg,Dg,Og,kg,Ag=n((()=>{zp(),wg(),ih(),Tg=`cause`,Eg=5,Dg=`LinkedErrors`,Og=((e={})=>{let t=e.limit||Eg,n=e.key||Tg;return{name:Dg,preprocessEvent(e,r,i){yg(Zm,i.getOptions().stackParser,n,t,e,r)}}}),kg=Y(Og)}));function jg(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}var Mg=n((()=>{}));function Ng(e){let t={};for(let n of Object.keys(e))t[n.toLowerCase()]=e[n];return Ig.map(e=>{let n=t[e.toLowerCase()],r=Array.isArray(n)?n.join(`;`):n;return e===`Forwarded`?Pg(r):r?.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&Fg(e))||null}function Pg(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function Fg(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var Ig,Lg=n((()=>{Ig=[`X-Client-IP`,`X-Forwarded-For`,`Fly-Client-IP`,`CF-Connecting-IP`,`Fastly-Client-Ip`,`True-Client-Ip`,`X-Real-IP`,`X-Cluster-Client-IP`,`X-Forwarded`,`Forwarded-For`,`Forwarded`,`X-Vercel-Forwarded-For`]}));function Rg(e,t,n,r){if(e.request={...e.request,...zg(t,r)},r.ip){let r=t.headers&&Ng(t.headers)||n.ipAddress;r&&(e.user={...e.user,ip_address:r})}}function zg(e,t){let n={},r={...e.headers};return t.headers&&(n.headers=r,t.cookies||delete r.cookie,t.ip||Ig.forEach(e=>{delete r[e]})),n.method=e.method,t.url&&(n.url=e.url),t.cookies&&(n.cookies=e.cookies||(r?.cookie?jg(r.cookie):void 0)||{}),t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}var Bg,Vg,Hg,Ug,Wg=n((()=>{zp(),Mg(),Lg(),Bg={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Vg=`RequestData`,Hg=((e={})=>{let t={...Bg,...e.include};return{name:Vg,processEvent(e,n,r){let{sdkProcessingMetadata:i={}}=e,{normalizedRequest:a,ipAddress:o}=i,s={...t,ip:t.ip??r.getOptions().sendDefaultPii};return a&&Rg(e,a,{ipAddress:o},s),e}}}),Ug=Y(Hg)}));function Gg(e){let t=`console`;Qo(t,e),$o(t,Kg)}function Kg(){`console`in B&&Lo.forEach(function(e){e in B.console&&Ns(B.console,e,function(t){return zo[e]=t,function(...t){es(`console`,{args:t,level:e}),zo[e]?.apply(B.console,t)}})})}var qg=n((()=>{H(),Hs(),xo(),rs()}));function Jg(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var Yg=n((()=>{})),Xg,Zg,Qg,$g=n((()=>{Xg=new WeakMap,Zg=(e,t)=>{let n=Xg.get(e);n?n.push(t):Xg.set(e,[t])},Qg=e=>{let t=Xg.get(e);return t||(t=[],Xg.set(e,t)),t}})),e_,t_,n_,r_,i_,a_,o_=n((()=>{e_=`express.name`,t_=`http.route`,n_=`express.type`,r_=`router`,i_=`middleware`,a_=`request_handler`}));function s_(e){return e.includes(`:`)||e.includes(`*`)}function c_(e,t){let n=Qg(e);if(n.length===0)return;if(n.every(e=>e===`/`))return e.originalUrl===`/`?`/`:void 0;if(t===`*`||t.includes(`/`)&&(t.includes(`,`)||t.includes(`\\`)||t.includes(`*`)||t.includes(`[`)))return t;let r=t.startsWith(`/`)?t:`/${t}`;return r.length>0&&(e.originalUrl===r||e.originalUrl.startsWith(r)||s_(r))?r:void 0}function l_(e){let t=Qg(e),n=``;for(let e of t)e===`/`||e===`/*`||(n+=!n||n.endsWith(`/`)?e:`/${e}`);return n.replace(/\/{2,}/g,`/`)}var u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_=n((()=>{$g(),o_(),$s(),u_=e=>e instanceof Error?[e,e.message]:[String(e),String(e)],d_=(e,t,n)=>{if(t.name===`router`){let r=f_(``,t)||n||e||`/`;return{attributes:{[e_]:r,[n_]:r_},name:`router - ${r}`}}else if(t.name===`bound dispatch`||t.name===`handle`)return{attributes:{[e_]:(e||n)??`request handler`,[n_]:a_},name:`request handler${t.path?` - ${e||n}`:``}`};else return{attributes:{[e_]:t.name,[n_]:i_},name:`middleware - ${t.name}`}},f_=(e,t)=>{let n=Array.isArray(t.handle?.stack)?t.handle?.stack?.[0]:void 0;return n?.route?.path?`${e}${n.route.path}`:n&&Array.isArray(n?.handle?.stack)?f_(e,n):e},p_=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(!Array.isArray(n?.ignoreLayers))return!1;try{return Qs(e,n.ignoreLayers,!0)}catch{}return!1},m_=e=>{let t=e[0];return Array.isArray(t)?t.map(e=>h_(e)||``).join(`,`):h_(t)},h_=e=>typeof e==`string`?e:e instanceof RegExp||typeof e==`number`?String(e):void 0,g_=e=>__(e?.Router?.prototype),__=e=>(typeof e==`object`||typeof e==`function`)&&!!e&&`route`in e&&typeof e.route==`function`,v_=e=>__(e.Router)&&!g_(e),y_=e=>!!e&&typeof e==`object`&&`default`in e&&typeof e.default==`function`}));function x_(e){if(!ul()?.getScopeData()?.sdkProcessingMetadata?.normalizedRequest){let t=Bh(e);ul().setSDKProcessingMetadata({normalizedRequest:t})}}var S_=n((()=>{gl(),Yh()}));function C_(e,t,n){if(!t?.handle)return;let r=t,i=r.handle;if(Ls(i)||i.length===4)return;function a(t,a,...o){let s=e();x_(t);let c=Wu();if(!c)return i.apply(this,[t,a,...o]);n&&Zg(t,n);let l=Qg(t),u=!!n,d=l_(t),f=c_(t,d);s.onRouteResolved?.(f);let p=d_(d,r,n),m=p.attributes[e_],h=p.attributes[n_],g=Object.assign(p.attributes,{[K]:`auto.http.express`,[G]:`${h}.express`});if(f&&(g[t_]=f),p_(p.attributes[`express.name`],h,s))return u&&l.pop(),i.apply(this,[t,a,...o]);let _=ul();if(_!==Rc()){if(h===`request_handler`){let e=t.method?t.method.toUpperCase():`GET`;_.setTransactionName(`${e} ${d}`)}}else R&&V.warn(`Isolation scope is still default isolation scope - skipping setting transactionName`);return hf({name:m,attributes:g},e=>{let n=!1;p.attributes[`express.type`]===`router`&&(e.end(),n=!0);let r=()=>{n||(n=!0,e.end())};for(let i=0;i<o.length;i++){let s=o[i];if(typeof s==`function`){o[i]=function(...i){let o=i[0],d=!!o&&o!==`route`&&o!==`router`;if(!n&&d){let[t,n]=u_(o);e.setStatus({code:2,message:n})}return n||(n=!0,a.removeListener(`finish`,r),e.end()),!(t.route&&d)&&u&&l.pop(),_f(c,()=>s.apply(this,i))};break}}try{return i.apply(this,[t,a,...o])}catch(t){let[n,r]=u_(t);throw e.setStatus({code:2,message:r}),t}finally{n||a.once(`finish`,r)}})}for(let e in i)e in a||Object.defineProperty(a,e,{get(){return i[e]},set(t){i[e]=t}});Fs(a,i),Object.defineProperty(r,`handle`,{enumerable:!0,configurable:!0,writable:!0,value:a})}var w_=n((()=>{z(),Bl(),H(),Xu(),Hl(),Hs(),gl(),Af(),$g(),o_(),b_(),zc(),S_()}));function T_(e){return!!e.express}function E_(){k_||(k_=!0,R&&V.warn("[Express] `patchExpressModule(options)` is deprecated. Use `patchExpressModule(moduleExports, getOptions)` instead."))}function D_(e,t){let n,r;if(!t&&T_(e)){let{express:t,...i}=e;r=t,n=()=>i,E_()}else if(typeof t!=`function`)throw TypeError("`patchExpressModule(moduleExports, getOptions)` requires a `getOptions` callback");else n=t,r=e;let i=O_(r),a=g_(i)?i.Router.prototype:v_(i)?i.Router:void 0;if(!a)throw TypeError(`no valid Express route function to instrument`);let o=a.route;try{Is(a,`route`,function(...e){let t=o.apply(this,e),r=this.stack[this.stack.length-1];return C_(n,r,m_(e)),t})}catch(e){R&&V.error(`Failed to patch express route method:`,e)}let s=a.use;try{Is(a,`use`,function(...e){let t=s.apply(this,e),r=this.stack[this.stack.length-1];return r&&C_(n,r,m_(e)),t})}catch(e){R&&V.error(`Failed to patch express use method:`,e)}let{application:c}=i,l=c.use;try{Is(c,`use`,function(...e){let t=l.apply(this,e),r=g_(i)?this.router:this._router;if(r){let t=r.stack[r.stack.length-1];t&&C_(n,t,m_(e))}return t})}catch(e){R&&V.error(`Failed to patch express application.use method:`,e)}return i}var O_,k_,A_=n((()=>{H(),z(),b_(),Hs(),w_(),O_=e=>y_(e)?e.default:e,k_=!1}));function j_(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=N_.exec(t);return n?n.slice(1):[]}function M_(e){let t=j_(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&(r=r.slice(0,r.length-1)),n+r)}var N_,P_=n((()=>{N_=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/}));function F_(e,t){return!e||typeof e!=`function`?(R&&V.warn(`instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance`),e):I_(e,{requireParentSpan:!0,...t})}function I_(e,t,n){if(e[J_])return e;let r=new Proxy(e,{apply(e,n,i){let a=Reflect.apply(e,n,i);return a&&typeof a==`object`&&`handle`in a&&z_(a,r,t),a},get(e,n){let i=e[n];return typeof n!=`string`||typeof i!=`function`?i:n===`unsafe`||n===`file`?L_(i,e,r,t):n===`begin`||n===`reserve`?R_(i,e,r,t):i}});return n?r[q_]=n:G_(e,r),e[J_]=!0,r[J_]=!0,r}function L_(e,t,n,r){return function(...i){let a=Reflect.apply(e,t,i);return a&&typeof a==`object`&&`handle`in a&&z_(a,n,r),a}}function R_(e,t,n,r){return function(...i){let a=n[q_];if(typeof i[i.length-1]!=`function`){let n=Reflect.apply(e,t,i);return n&&typeof n.then==`function`?n.then(e=>I_(e,r,a)):n}let o=i.length===1?i[0]:i[1],s=function(e){return o(I_(e,r,a))},c=i.length===1?[s]:[i[0],s];return Reflect.apply(e,t,c)}}function z_(e,t,n){if(e.handle?.__sentryWrapped)return;e[Y_]=!0;let r=e.handle,i=async function(...i){if(!B_(n))return r.apply(this,i);let a=H_(V_(e.strings));return hf({name:a||`postgresjs.query`,op:`db`},e=>{e.setAttribute(K,`auto.db.postgresjs`),e.setAttributes({"db.system.name":`postgres`,"db.query.text":a});let o=t?t[q_]:void 0;if(U_(e,o),n.requestHook)try{n.requestHook(e,a,o)}catch(t){e.setAttribute(`sentry.hook.error`,`requestHook failed`),R&&V.error(`Error in requestHook for PostgresJs instrumentation:`,t)}let s=this;s.resolve=new Proxy(s.resolve,{apply:(t,n,r)=>{try{W_(e,a,r?.[0]?.command),e.end()}catch(e){R&&V.error(`Error ending span in resolve callback:`,e)}return Reflect.apply(t,n,r)}}),s.reject=new Proxy(s.reject,{apply:(t,n,r)=>{try{e.setStatus({code:2,message:r?.[0]?.message||`unknown_error`}),e.setAttribute(`db.response.status_code`,r?.[0]?.code||`unknown`),e.setAttribute(`error.type`,r?.[0]?.name||`unknown`),W_(e,a),e.end()}catch(e){R&&V.error(`Error ending span in reject callback:`,e)}return Reflect.apply(t,n,r)}});try{return r.apply(this,i)}catch(t){throw e.setStatus({code:2,message:t instanceof Error?t.message:`unknown_error`}),e.end(),t}})};i.__sentryWrapped=!0,e.handle=i}function B_(e){return Wu()!==void 0||!e.requireParentSpan}function V_(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((e,t,n)=>n===0?t:`${e}$${n}${t}`,``)}function H_(e){return e?e.replace(/--.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``).replace(/;\s*$/,``).replace(/\s+/g,` `).trim().replace(/\bX'[0-9A-Fa-f]*'/gi,`?`).replace(/\bB'[01]*'/gi,`?`).replace(/'(?:[^']|'')*'/g,`?`).replace(/\b0x[0-9A-Fa-f]+/gi,`?`).replace(/\b(?:TRUE|FALSE)\b/gi,`?`).replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,`?`).replace(/-?\b\d+\.\d+\b/g,`?`).replace(/-?\.\d+\b/g,`?`).replace(/(?<!\$)-?\b\d+\b/g,`?`).replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,`IN (?)`).replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,`IN ($?)`):`Unknown SQL Query`}function U_(e,t){if(t&&(t.ATTR_DB_NAMESPACE&&e.setAttribute(`db.namespace`,t.ATTR_DB_NAMESPACE),t.ATTR_SERVER_ADDRESS&&e.setAttribute(`server.address`,t.ATTR_SERVER_ADDRESS),t.ATTR_SERVER_PORT!==void 0)){let n=parseInt(t.ATTR_SERVER_PORT,10);isNaN(n)||e.setAttribute(`server.port`,n)}}function W_(e,t,n){if(n){e.setAttribute(`db.operation.name`,n);return}let r=t?.match(K_);r?.[1]&&e.setAttribute(`db.operation.name`,r[1].toUpperCase())}function G_(e,t){let n=e;if(!n.options||typeof n.options!=`object`)return;let r=n.options,i=r.host?.[0]||`localhost`,a=r.port?.[0]||5432;t[q_]={ATTR_DB_NAMESPACE:typeof r.database==`string`&&r.database!==``?r.database:void 0,ATTR_SERVER_ADDRESS:i,ATTR_SERVER_PORT:String(a)}}var K_,q_,J_,Y_,X_=n((()=>{z(),Bl(),H(),Xu(),Hl(),Af(),K_=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,q_=Symbol(`sentryPostgresConnectionContext`),J_=Symbol.for(`sentry.instrumented.postgresjs`),Y_=Symbol.for(`sentry.query.from.instrumented.sql`)}));function Z_(e,t){let n={category:`console`,data:{arguments:t,logger:`console`},level:Jg(e),message:Q_(t)};if(e===`assert`)if(t[0]===!1){let e=t.slice(1);n.message=e.length>0?`Assertion failed: ${Q_(e)}`:`Assertion failed`,n.data.arguments=e}else return;Xh(n,{input:t,level:e})}function Q_(e){return`util`in B&&typeof B.util.format==`function`?B.util.format(...e):Xs(e,` `)}var $_,ev,tv=n((()=>{Qh(),gl(),qg(),zp(),H(),Yg(),$s(),xo(),$_=`Console`,ev=Y((e={})=>{let t=new Set(e.levels||Lo);return{name:$_,setup(e){Gg(({args:n,level:r})=>{W()!==e||!t.has(r)||Z_(r,n)})}}})})),nv,rv,iv,av=n((()=>{gl(),zp(),Bl(),Xu(),nv=`ConversationId`,rv=(()=>({name:nv,setup(e){e.on(`spanStart`,e=>{let t=U().getScopeData(),n=ul().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=q(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(zl,r)}})}})),iv=Y(rv)})),ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv=n((()=>{ov=`gen_ai.prompt`,sv=`gen_ai.system`,cv=`gen_ai.request.model`,lv=`gen_ai.request.stream`,uv=`gen_ai.request.temperature`,dv=`gen_ai.request.max_tokens`,fv=`gen_ai.request.frequency_penalty`,pv=`gen_ai.request.presence_penalty`,mv=`gen_ai.request.top_p`,hv=`gen_ai.request.top_k`,gv=`gen_ai.request.encoding_format`,_v=`gen_ai.request.dimensions`,vv=`gen_ai.response.finish_reasons`,yv=`gen_ai.response.model`,bv=`gen_ai.response.id`,xv=`gen_ai.response.stop_reason`,Sv=`gen_ai.usage.input_tokens`,Cv=`gen_ai.usage.output_tokens`,wv=`gen_ai.usage.total_tokens`,Tv=`gen_ai.operation.name`,Ev=`sentry.sdk_meta.gen_ai.input.messages.original_length`,Dv=`gen_ai.input.messages`,Ov=`gen_ai.output.messages`,kv=`gen_ai.system_instructions`,Av=`gen_ai.response.text`,jv=`gen_ai.request.available_tools`,Mv=`gen_ai.response.streaming`,Nv=`gen_ai.response.tool_calls`,Pv=`gen_ai.agent.name`,Fv=`gen_ai.pipeline.name`,Iv=`gen_ai.conversation.id`,Lv=`gen_ai.usage.cache_creation_input_tokens`,Rv=`gen_ai.usage.cache_read_input_tokens`,zv=`gen_ai.usage.input_tokens.cache_write`,Bv=`gen_ai.usage.input_tokens.cached`,Vv=`gen_ai.invoke_agent`,Hv=`gen_ai.embeddings.input`,Uv=`gen_ai.embeddings`,Wv=`gen_ai.tool.name`,Gv=`gen_ai.tool.call.id`,Kv=`gen_ai.tool.type`,qv=`gen_ai.tool.input`,Jv=`gen_ai.tool.output`,Yv=`gen_ai.tool.description`}));function Zv(e){return!e||typeof e!=`object`?!1:ey(e)||ty(e)||Qv(e)||ny(e)||ry(e)||iy(e)||ay(e)||oy(e)||sy(e)||cy(e)||ly(e)||uy(e)}function Qv(e){return`image_url`in e?typeof e.image_url==`string`?e.image_url.startsWith(`data:`):$v(e):!1}function $v(e){return`image_url`in e&&!!e.image_url&&typeof e.image_url==`object`&&`url`in e.image_url&&typeof e.image_url.url==`string`&&e.image_url.url.startsWith(`data:`)}function ey(e){return`type`in e&&typeof e.type==`string`&&`source`in e&&Zv(e.source)}function ty(e){return`inlineData`in e&&!!e.inlineData&&typeof e.inlineData==`object`&&`data`in e.inlineData&&typeof e.inlineData.data==`string`}function ny(e){return`type`in e&&e.type===`input_audio`&&`input_audio`in e&&!!e.input_audio&&typeof e.input_audio==`object`&&`data`in e.input_audio&&typeof e.input_audio.data==`string`}function ry(e){return`type`in e&&e.type===`file`&&`file`in e&&!!e.file&&typeof e.file==`object`&&`file_data`in e.file&&typeof e.file.file_data==`string`}function iy(e){return`media_type`in e&&typeof e.media_type==`string`&&`data`in e}function ay(e){return`type`in e&&e.type===`file`&&`mediaType`in e&&typeof e.mediaType==`string`&&`data`in e&&typeof e.data==`string`&&!e.data.startsWith(`http://`)&&!e.data.startsWith(`https://`)}function oy(e){return`type`in e&&e.type===`image`&&`image`in e&&typeof e.image==`string`&&!e.image.startsWith(`http://`)&&!e.image.startsWith(`https://`)}function sy(e){return`type`in e&&(e.type===`blob`||e.type===`base64`)}function cy(e){return`b64_json`in e}function ly(e){return`type`in e&&`result`in e&&e.type===`image_generation`}function uy(e){return`uri`in e&&typeof e.uri==`string`&&e.uri.startsWith(`data:`)}function dy(e){let t={...e};Zv(t.source)&&(t.source=dy(t.source)),ty(e)&&(t.inlineData={...e.inlineData,data:fy}),$v(e)&&(t.image_url={...e.image_url,url:fy}),ny(e)&&(t.input_audio={...e.input_audio,data:fy}),ry(e)&&(t.file={...e.file,file_data:fy});for(let e of py)typeof t[e]==`string`&&(t[e]=fy);return t}var fy,py,my=n((()=>{fy=`[Blob substitute]`,py=[`image_url`,`data`,`content`,`b64_json`,`result`,`uri`,`image`]}));function hy(e,t){if(Ay(e)<=t)return e;let n=0,r=e.length,i=``;for(;n<=r;){let a=Math.floor((n+r)/2),o=e.slice(0,a);Ay(o)<=t?(i=o,n=a+1):r=a-1}return i}function gy(e){return typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``}function _y(e,t){return typeof e==`string`?t:{...e,text:t}}function vy(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`}function yy(e){return typeof e==`object`&&!!e&&`content`in e&&Array.isArray(e.content)}function by(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)&&e.parts.length>0}function xy(e,t){let n=t-jy({...e,content:``});if(n<=0)return[];let r=hy(e.content,n);return[{...e,content:r}]}function Sy(e){return`parts`in e&&Array.isArray(e.parts)?{key:`parts`,items:e.parts}:`content`in e&&Array.isArray(e.content)?{key:`content`,items:e.content}:{key:null,items:[]}}function Cy(e,t){let{key:n,items:r}=Sy(e);if(n===null||r.length===0)return[];let i=r.map(e=>_y(e,``)),a=t-jy({...e,[n]:i});if(a<=0)return[];let o=[];for(let e of r){let t=gy(e),n=Ay(t);if(n<=a)o.push(e),a-=n;else if(o.length===0){let n=hy(t,a);n&&o.push(_y(e,n));break}else break}return o.length<=0?[]:[{...e,[n]:o}]}function wy(e,t){if(!e)return[];if(typeof e==`string`){let n=hy(e,t);return n?[n]:[]}return typeof e==`object`?vy(e)?xy(e,t):yy(e)||by(e)?Cy(e,t):[]:[]}function Ty(e){return e.map(e=>{let t;return e&&typeof e==`object`&&(yy(e)?t={...e,content:Ty(e.content)}:`content`in e&&Zv(e.content)&&(t={...e,content:dy(e.content)}),by(e)&&(t={...t??e,parts:Ty(e.parts)}),Zv(t)?t=dy(t):Zv(e)&&(t=dy(e))),t??e})}function Ey(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=Ty([r]),a=i[0];return jy(a)<=n?i:wy(a,n)}function Dy(e){return Ey(e,ky)}function Oy(e){return hy(e,ky)}var ky,Ay,jy,My=n((()=>{my(),ky=2e4,Ay=e=>new TextEncoder().encode(e).length,jy=e=>Ay(JSON.stringify(e))}));function Ny(e){let t=!!W()?.getOptions().sendDefaultPii;return{...e,recordInputs:e?.recordInputs??t,recordOutputs:e?.recordOutputs??t}}function Py(e){let t=W();return e??!(t&&$d(t))}function Fy(e,t){return e?`${e}.${t}`:t}function Iy(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[Sv]:t}),n!==void 0&&e.setAttributes({[Cv]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let a=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[wv]:a})}}function Ly(e,t,n){if(!e.isRecording())return;let r={[Mv]:!0};t.responseId&&(r[bv]=t.responseId),t.responseModel&&(r[yv]=t.responseModel),t.promptTokens!==void 0&&(r[Sv]=t.promptTokens),t.completionTokens!==void 0&&(r[Cv]=t.completionTokens),t.totalTokens===void 0?(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[wv]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)):r[wv]=t.totalTokens,t.finishReasons.length&&(r[vv]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[Av]=t.responseTexts.join(``)),n&&t.toolCalls.length&&(r[Nv]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Ry(e){return typeof e==`string`?e:JSON.stringify(e)}function zy(e){if(typeof e==`string`)return Oy(e);if(Array.isArray(e)){let t=Dy(e);return JSON.stringify(t)}return JSON.stringify(e)}function By(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(e=>e&&typeof e==`object`&&`role`in e&&e.role===`system`);if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content==`string`?n.content:n.content===void 0?void 0:JSON.stringify(n.content);return r?{systemInstructions:JSON.stringify([{type:`text`,content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}async function Vy(e,t,n){let r=e.catch(e=>{throw J(e,{mechanism:{handled:!1,type:n}}),e}),i=await t,a=await r;return a&&typeof a==`object`&&`data`in a?{...a,data:i}:i}function Hy(e,t,n){return Ss(e)?new Proxy(e,{get(e,r){let i=r in Promise.prototype||r===Symbol.toStringTag?t:e,a=Reflect.get(i,r);return r===`withResponse`&&typeof a==`function`?function(){return Vy(a.call(e),t,n)}:typeof a==`function`?a.bind(i):a}}):t}var Uy=n((()=>{Dp(),gl(),ef(),Ds(),Xv(),My()})),Wy,Gy,Ky=n((()=>{Wy=new Map,Gy=new Map([[`ai.generateText`,`invoke_agent`],[`ai.streamText`,`invoke_agent`],[`ai.generateObject`,`invoke_agent`],[`ai.streamObject`,`invoke_agent`],[`ai.generateText.doGenerate`,`generate_content`],[`ai.streamText.doStream`,`generate_content`],[`ai.generateObject.doGenerate`,`generate_content`],[`ai.streamObject.doStream`,`generate_content`],[`ai.embed.doEmbed`,`embeddings`],[`ai.embedMany.doEmbed`,`embeddings`],[`ai.rerank.doRerank`,`rerank`],[`ai.toolCall`,`execute_tool`]])})),qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb,lb,ub,db,fb,pb,mb,hb=n((()=>{qy=`operation.name`,Jy=`ai.operationId`,Yy=`ai.prompt`,Xy=`ai.schema`,Zy=`ai.response.object`,Qy=`ai.values`,$y=`ai.response.text`,eb=`ai.response.toolCalls`,tb=`ai.response.finishReason`,nb=`ai.prompt.messages`,rb=`ai.prompt.tools`,ib=`ai.model.id`,ab=`ai.response.providerMetadata`,ob=`ai.usage.cachedInputTokens`,sb=`ai.telemetry.functionId`,cb=`ai.usage.completionTokens`,lb=`ai.usage.promptTokens`,ub=`ai.usage.tokens`,db=`ai.toolCall.name`,fb=`ai.toolCall.id`,pb=`ai.toolCall.args`,mb=`ai.toolCall.result`}));function gb(e,t){let n=e.parent_span_id;if(!n)return;let r=e.data[Sv],i=e.data[Cv];if(typeof r==`number`||typeof i==`number`){let e=t.get(n)||{inputTokens:0,outputTokens:0};typeof r==`number`&&(e.inputTokens+=r),typeof i==`number`&&(e.outputTokens+=i),t.set(n,e)}}function _b(e,t){let n=t.get(e.span_id);!n||!e.data||(n.inputTokens>0&&(e.data[Sv]=n.inputTokens),n.outputTokens>0&&(e.data[Cv]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(e.data[`gen_ai.usage.total_tokens`]=n.inputTokens+n.outputTokens))}function vb(e){let t=new Map;for(let n of e){let e=n.data[jv];if(typeof e==`string`)try{let n=JSON.parse(e);for(let e of n)e.name&&e.description&&!t.has(e.name)&&t.set(e.name,e.description)}catch{}}return t}function yb(e,t){let n=vb(e);for(let r of e){if(r.op===`gen_ai.execute_tool`){let e=r.data[Wv];if(typeof e==`string`){let t=n.get(e);t&&(r.data[Yv]=t)}}r.op===`gen_ai.invoke_agent`&&_b(r,t)}}function bb(e){return Wy.get(e)}function xb(e){Wy.delete(e)}function Sb(e){let t=e.map(e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e});return JSON.stringify(t)}function Cb(e){return e.filter(e=>!!e&&typeof e==`object`&&`role`in e&&`content`in e)}function wb(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`){let{messages:e}=t,{prompt:n,system:r}=t,i=[];if(typeof r==`string`&&i.push({role:`system`,content:r}),typeof e==`string`)try{e=JSON.parse(e)}catch{}if(Array.isArray(e))return i.push(...Cb(e)),i;if(Array.isArray(n))return i.push(...Cb(n)),i;if(typeof n==`string`&&i.push({role:`user`,content:n}),i.length>0)return i}}catch{}return[]}function Tb(e,t,n){if(typeof t[`ai.prompt`]==`string`&&!t[`gen_ai.input.messages`]&&!t[`ai.prompt.messages`]){let r=t[Yy],i=wb(r);if(i.length){let{systemInstructions:t,filteredMessages:r}=By(i);t&&e.setAttribute(kv,t);let a=Array.isArray(r)?r.length:0,o=n?zy(r):Ry(r);e.setAttributes({[Yy]:o,[Dv]:o,[Ev]:a})}}else if(typeof t[`ai.prompt.messages`]==`string`)try{let r=JSON.parse(t[nb]);if(Array.isArray(r)){let{systemInstructions:t,filteredMessages:i}=By(r);t&&e.setAttribute(kv,t);let a=Array.isArray(i)?i.length:0,o=n?zy(i):Ry(i);e.setAttributes({[nb]:o,[Dv]:o,[Ev]:a})}}catch{}}var Eb=n((()=>{Xv(),Uy(),Ky(),hb()}));function Db(e){let{data:t,description:n}=q(e);if(!n)return;if(t[`ai.toolCall.name`]&&t[`ai.toolCall.id`]&&n===`ai.toolCall`){Nb(e,t);return}if(!t[`ai.operationId`]&&!n.startsWith(`ai.`))return;let r=W()?.getIntegrationByName(`VercelAI`);Pb(e,n,t,Py(r?.options?.enableTruncation))}function Ob(e){if(e.type===`transaction`&&e.spans){let t=new Map;for(let n of e.spans)jb(n),gb(n,t);yb(e.spans,t);let n=e.contexts?.trace;n?.op===`gen_ai.invoke_agent`&&_b(n,t)}return e}function kb(e){if(typeof e!=`string`)return`stop`;switch(e){case`tool-calls`:return`tool_call`;case`stop`:case`length`:case`content_filter`:case`error`:return e;default:return e}}function Ab(e){let t=e[$y],n=e[eb],r=e[tb];if(t==null&&n==null)return;let i=[];if(typeof t==`string`&&t.length>0&&i.push({type:`text`,content:t}),n!=null)try{let t=typeof n==`string`?JSON.parse(n):n;if(Array.isArray(t)){for(let e of t){let t=e.input??e.args;i.push({type:`tool_call`,id:e.toolCallId,name:e.toolName,arguments:typeof t==`string`?t:JSON.stringify(t??{})})}delete e[eb]}}catch{}if(i.length>0){let t={role:`assistant`,parts:i,finish_reason:kb(r)};e[Ov]=JSON.stringify([t]),delete e[$y]}}function jb(e){let{data:t,origin:n}=e;if(n===`auto.vercelai.otel`){if(e.status&&e.status!==`ok`&&(e.status=`internal_error`),Mb(t,cb,Cv),Mb(t,lb,Sv),Mb(t,ob,Bv),Mb(t,`ai.usage.inputTokens`,Sv),Mb(t,`ai.usage.outputTokens`,Cv),Mb(t,ub,Sv),Mb(t,`ai.response.avgOutputTokensPerSecond`,`ai.response.avgCompletionTokensPerSecond`),typeof t[`gen_ai.usage.input_tokens`]==`number`&&typeof t[`gen_ai.usage.input_tokens.cached`]==`number`&&(t[Sv]=t[Sv]+t[Bv]),typeof t[`gen_ai.usage.input_tokens`]==`number`&&(t[wv]=(typeof t[`gen_ai.usage.output_tokens`]==`number`?t[Cv]:0)+t[Sv]),t[`ai.prompt.tools`]&&Array.isArray(t[`ai.prompt.tools`])&&(t[rb]=Sb(t[rb])),t[`operation.name`]){let e=t[`ai.operationId`]?t[Jy]:t[qy];t[Tv]=Gy.get(e)??e,delete t[qy]}if(Mb(t,nb,Dv),Ab(t),Mb(t,Zy,`gen_ai.response.object`),Mb(t,rb,`gen_ai.request.available_tools`),Mb(t,pb,qv),Mb(t,mb,Jv),Mb(t,Xy,`gen_ai.request.schema`),Mb(t,ib,cv),Array.isArray(t[`ai.values`])){let e=t[Qy].map(e=>{try{return JSON.parse(e)}catch{return e}});t[Hv]=e.length===1?e[0]:JSON.stringify(e)}Ib(t);for(let e of Object.keys(t))e.startsWith(`ai.`)&&Mb(t,e,`vercel.${e}`)}}function Mb(e,t,n){e[t]!=null&&(e[n]=e[t],delete e[t])}function Nb(e,t){e.setAttribute(K,`auto.vercelai.otel`),e.setAttribute(G,`gen_ai.execute_tool`),e.setAttribute(Tv,`execute_tool`),Mb(t,db,Wv),Mb(t,fb,Gv);let n=t[Gv];typeof n==`string`&&Wy.set(n,e.spanContext()),t[`gen_ai.tool.type`]||e.setAttribute(Kv,`function`);let r=t[Wv];r&&e.updateName(`execute_tool ${r}`)}function Pb(e,t,n,r){e.setAttribute(K,`auto.vercelai.otel`);let i=t.replace(`ai.`,``);e.setAttribute(`ai.pipeline.name`,i),e.updateName(i);let a=n[sb];a&&typeof a==`string`&&e.setAttribute(`gen_ai.function_id`,a),Tb(e,n,r),n[`ai.model.id`]&&!n[`gen_ai.response.model`]&&e.setAttribute(yv,n[ib]),e.setAttribute(`ai.streaming`,t.includes(`stream`));let o=Gy.get(t);if(o?e.setAttribute(G,`gen_ai.${o}`):t.startsWith(`ai.stream`)&&e.setAttribute(G,`ai.run`),o===`invoke_agent`){a&&typeof a==`string`?e.updateName(`invoke_agent ${a}`):e.updateName(`invoke_agent`);return}let s=n[ib];s&&o&&e.updateName(`${o} ${s}`)}function Fb(e){e.on(`spanStart`,Db),e.addEventProcessor(Object.assign(Ob,{id:`VercelAiEventProcessor`}))}function Ib(e){let t=e[ab];if(t)try{let n=JSON.parse(t),r=n.openai??n.azure;r&&(Lb(e,Bv,r.cachedPromptTokens),Lb(e,`gen_ai.usage.output_tokens.reasoning`,r.reasoningTokens),Lb(e,`gen_ai.usage.output_tokens.prediction_accepted`,r.acceptedPredictionTokens),Lb(e,`gen_ai.usage.output_tokens.prediction_rejected`,r.rejectedPredictionTokens),e[`gen_ai.conversation.id`]||Lb(e,`gen_ai.conversation.id`,r.responseId)),n.anthropic&&(Lb(e,Bv,n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens),Lb(e,zv,n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens)),n.bedrock?.usage&&(Lb(e,Bv,n.bedrock.usage.cacheReadInputTokens),Lb(e,zv,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(Lb(e,Bv,n.deepseek.promptCacheHitTokens),Lb(e,`gen_ai.usage.input_tokens.cache_miss`,n.deepseek.promptCacheMissTokens))}catch{}}function Lb(e,t,n){n!=null&&(e[t]=n)}var Rb=n((()=>{gl(),Bl(),Uy(),Xu(),Xv(),Ky(),Eb(),hb()})),zb,Bb,Vb,Hb,Ub=n((()=>{zb=`OpenAI`,Bb={"responses.create":{operation:`chat`},"chat.completions.create":{operation:`chat`},"embeddings.create":{operation:`embeddings`},"conversations.create":{operation:`chat`}},Vb=[`response.output_item.added`,`response.function_call_arguments.delta`,`response.function_call_arguments.done`,`response.output_item.done`],Hb=[`response.created`,`response.in_progress`,`response.failed`,`response.completed`,`response.incomplete`,`response.queued`,`response.output_text.delta`,...Vb]}));function Wb(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`response.`)}function Gb(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`chat.completion.chunk`}function Kb(e,t,n){if(!t||typeof t!=`object`)return;let r=t,i={};if(typeof r.id==`string`&&(i[bv]=r.id),typeof r.model==`string`&&(i[yv]=r.model),r.object===`conversation`&&typeof r.id==`string`&&(i[Iv]=r.id),r.usage&&typeof r.usage==`object`){let e=r.usage,t=e.prompt_tokens??e.input_tokens;typeof t==`number`&&(i[Sv]=t);let n=e.completion_tokens??e.output_tokens;typeof n==`number`&&(i[Cv]=n),typeof e.total_tokens==`number`&&(i[wv]=e.total_tokens)}if(Array.isArray(r.choices)){let e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>typeof e==`string`);if(t.length>0&&(i[vv]=JSON.stringify(t)),n){let t=e.map(e=>e.message?.content||``);i[Av]=JSON.stringify(t);let n=e.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(i[Nv]=JSON.stringify(n))}}if(typeof r.status==`string`&&(i[`gen_ai.response.finish_reasons`]||(i[vv]=JSON.stringify([r.status]))),n&&(typeof r.output_text==`string`&&!i[`gen_ai.response.text`]&&(i[Av]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[`gen_ai.response.tool_calls`])){let e=r.output.filter(e=>e?.type===`function_call`);e.length>0&&(i[Nv]=JSON.stringify(e))}e.setAttributes(i)}function qb(e){if(`conversation`in e&&typeof e.conversation==`string`)return e.conversation;if(`previous_response_id`in e&&typeof e.previous_response_id==`string`)return e.previous_response_id}function Jb(e){let t={[cv]:e.model??`unknown`};`temperature`in e&&(t[uv]=e.temperature),`top_p`in e&&(t[mv]=e.top_p),`frequency_penalty`in e&&(t[fv]=e.frequency_penalty),`presence_penalty`in e&&(t[pv]=e.presence_penalty),`stream`in e&&(t[lv]=e.stream),`encoding_format`in e&&(t[gv]=e.encoding_format),`dimensions`in e&&(t[_v]=e.dimensions);let n=qb(e);return n&&(t[Iv]=n),t}var Yb=n((()=>{Xv()}));function Xb(e,t){for(let n of e){let e=n.index;if(!(e===void 0||!n.function))if(!(e in t.chatCompletionToolCalls))t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||``}};else{let r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}function Zb(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&Xb(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function Qb(e,t,n,r){if(!(e&&typeof e==`object`)){t.eventTypes.push(`unknown:non-object`);return}if(e instanceof Error){r.setStatus({code:2,message:`internal_error`}),J(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream-response`}});return}if(!(`type`in e))return;let i=e;if(!Hb.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type===`response.output_item.done`&&`item`in i&&t.responsesApiToolCalls.push(i.item),i.type===`response.output_text.delta`&&`delta`in i&&i.delta)){t.responseTexts.push(i.delta);return}if(`response`in i){let{response:e}=i;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}async function*$b(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)Gb(i)?Zb(i,r,n):Wb(i)&&Qb(i,r,n,t),yield i}finally{let e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];Ly(t,{...r,toolCalls:e},n)}}var ex=n((()=>{Dp(),Hl(),Uy(),Ub(),Yb()}));function tx(e){let t=Array.isArray(e.tools)?e.tools:[],n=e.web_search_options&&typeof e.web_search_options==`object`?[{type:`web_search_options`,...e.web_search_options}]:[],r=[...t,...n];if(r.length!==0)try{return JSON.stringify(r)}catch(e){R&&V.error(`Failed to serialize OpenAI tools:`,e);return}}function nx(e,t){let n={[sv]:`openai`,[Tv]:t,[K]:`auto.ai.openai`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0],r=tx(t);r&&(n[jv]=r),Object.assign(n,Jb(t))}else n[cv]=`unknown`;return n}function rx(e,t,n,r){if(n===`embeddings`&&`input`in t){let n=t.input;if(n==null||typeof n==`string`&&n.length===0||Array.isArray(n)&&n.length===0)return;e.setAttribute(Hv,typeof n==`string`?n:JSON.stringify(n));return}let i=`input`in t?t.input:`messages`in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:a,filteredMessages:o}=By(i);a&&e.setAttribute(kv,a),e.setAttribute(Dv,r?zy(o):Ry(o)),Array.isArray(o)?e.setAttribute(Ev,o.length):e.setAttribute(Ev,1)}function ix(e,t,n,r,i){return function(...a){let o=n.operation||`unknown`,s=nx(a,o),c=s[`gen_ai.request.model`]||`unknown`,l=a[0],u=l&&typeof l==`object`&&l.stream===!0,d={name:`${o} ${c}`,op:`gen_ai.${o}`,attributes:s};if(u){let n,s=hf(d,s=>(n=e.apply(r,a),i.recordInputs&&l&&rx(s,l,o,Py(i.enableTruncation)),(async()=>{try{return $b(await n,s,i.recordOutputs??!1)}catch(e){throw s.setStatus({code:2,message:`internal_error`}),J(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream`,data:{function:t}}}),s.end(),e}})()));return Hy(n,s,`auto.ai.openai`)}let f,p=mf(d,n=>(f=e.apply(r,a),i.recordInputs&&l&&rx(n,l,o,Py(i.enableTruncation)),f.then(e=>(Kb(n,e,i.recordOutputs),e),e=>{throw J(e,{mechanism:{handled:!1,type:`auto.ai.openai`,data:{function:t}}}),e})));return Hy(f,p,`auto.ai.openai`)}}function ax(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=Fy(t,String(r)),o=Bb[a];return typeof i==`function`&&o?ix(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?ax(i,a,n):i}})}function ox(e,t){return ax(e,``,Ny(t))}var sx=n((()=>{z(),Dp(),Bl(),H(),Hl(),Af(),Xv(),Uy(),Ub(),ex(),Yb()})),cx,lx,ux=n((()=>{cx=`Anthropic_AI`,lx={"messages.create":{operation:`chat`},"messages.stream":{operation:`chat`,streaming:!0},"messages.countTokens":{operation:`chat`},"models.get":{operation:`models`},"completions.create":{operation:`chat`},"models.retrieve":{operation:`models`},"beta.messages.create":{operation:`chat`}}}));function dx(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=By(t);r&&e.setAttributes({[kv]:r});let a=Array.isArray(i)?i.length:1;e.setAttributes({[Dv]:n?zy(i):Ry(i),[Ev]:a})}function fx(e){return e&&hx[e]||`internal_error`}function px(e,t){t.error&&(e.setStatus({code:2,message:fx(t.error.type)}),J(t.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}))}function mx(e){let{system:t,messages:n,input:r}=e,i=typeof t==`string`?[{role:`system`,content:e.system}]:[],a=(Array.isArray(r)?r:r==null?void 0:[r])??(Array.isArray(n)?n:n==null?[]:[n]);return[...i,...a]}var hx,gx=n((()=>{Dp(),Hl(),Xv(),Uy(),hx={invalid_request_error:`invalid_argument`,authentication_error:`unauthenticated`,permission_error:`permission_denied`,not_found_error:`not_found`,request_too_large:`failed_precondition`,rate_limit_error:`resource_exhausted`,api_error:`internal_error`,overloaded_error:`unavailable`}}));function _x(e,t){return`type`in e&&typeof e.type==`string`&&e.type===`error`?(t.setStatus({code:2,message:fx(e.error?.type)}),J(e.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}),!0):!1}function vx(e,t){if(e.type===`message_delta`&&e.usage&&`output_tokens`in e.usage&&typeof e.usage.output_tokens==`number`&&(t.completionTokens=e.usage.output_tokens),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens==`number`&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens==`number`&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens==`number`&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function yx(e,t){e.type!==`content_block_start`||typeof e.index!=`number`||!e.content_block||(e.content_block.type===`tool_use`||e.content_block.type===`server_tool_use`)&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function bx(e,t,n){if(!(e.type!==`content_block_delta`||!e.delta)){if(typeof e.index==`number`&&`partial_json`in e.delta&&typeof e.delta.partial_json==`string`){let n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text==`string`&&t.responseTexts.push(e.delta.text)}}function xx(e,t){if(e.type!==`content_block_stop`||typeof e.index!=`number`)return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(``),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:`tool_use`,id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function Sx(e,t,n,r){e&&typeof e==`object`&&(_x(e,r)||(vx(e,t),yx(e,t),bx(e,t,n),xx(e,t)))}async function*Cx(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)Sx(i,r,n,t),yield i}finally{Ly(t,r,n)}}function wx(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on(`streamEvent`,e=>{Sx(e,r,n,t)}),e.on(`message`,()=>{Ly(t,r,n)}),e.on(`error`,e=>{J(e,{mechanism:{handled:!1,type:`auto.ai.anthropic.stream_error`}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end())}),e}var Tx=n((()=>{Dp(),Hl(),Uy(),gx()}));function Ex(e,t,n){let r={[sv]:`anthropic`,[Tv]:n,[K]:`auto.ai.anthropic`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0];t.tools&&Array.isArray(t.tools)&&(r[jv]=JSON.stringify(t.tools)),r[cv]=t.model??`unknown`,`temperature`in t&&(r[uv]=t.temperature),`top_p`in t&&(r[mv]=t.top_p),`stream`in t&&(r[lv]=t.stream),`top_k`in t&&(r[hv]=t.top_k),`frequency_penalty`in t&&(r[fv]=t.frequency_penalty),`max_tokens`in t&&(r[dv]=t.max_tokens)}else t===`models.retrieve`||t===`models.get`?r[cv]=e[0]:r[cv]=`unknown`;return r}function Dx(e,t,n){dx(e,mx(t),n),`prompt`in t&&e.setAttributes({[ov]:JSON.stringify(t.prompt)})}function Ox(e,t){if(`content`in t&&Array.isArray(t.content)){e.setAttributes({[Av]:t.content.map(e=>e.text).filter(e=>!!e).join(``)});let n=[];for(let e of t.content)(e.type===`tool_use`||e.type===`server_tool_use`)&&n.push(e);n.length>0&&e.setAttributes({[Nv]:JSON.stringify(n)})}`completion`in t&&e.setAttributes({[Av]:t.completion}),`input_tokens`in t&&e.setAttributes({[Av]:JSON.stringify(t.input_tokens)})}function kx(e,t){`id`in t&&`model`in t&&(e.setAttributes({[bv]:t.id,[yv]:t.model}),`usage`in t&&t.usage&&Iy(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function Ax(e,t,n){if(!(!t||typeof t!=`object`)){if(`type`in t&&t.type===`error`){px(e,t);return}n&&Ox(e,t),kx(e,t)}}function jx(e,t,n){throw J(e,{mechanism:{handled:!1,type:`auto.ai.anthropic`,data:{function:n}}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end()),e}function Mx(e,t,n,r,i,a,o,s,c,l,u){let d={name:`${a} ${i[`gen_ai.request.model`]??`unknown`}`,op:`gen_ai.${a}`,attributes:i};if(l&&!u){let t,i=hf(d,i=>(t=e.apply(n,r),c.recordInputs&&s&&Dx(i,s,Py(c.enableTruncation)),(async()=>{try{return Cx(await t,i,c.recordOutputs??!1)}catch(e){return jx(e,i,o)}})()));return Hy(t,i,`auto.ai.anthropic`)}else return hf(d,e=>{try{return c.recordInputs&&s&&Dx(e,s,Py(c.enableTruncation)),wx(t.apply(n,r),e,c.recordOutputs??!1)}catch(t){return jx(t,e,o)}})}function Nx(e,t,n,r,i){return new Proxy(e,{apply(a,o,s){let c=n.operation||`unknown`,l=Ex(s,t,c),u=l[`gen_ai.request.model`]??`unknown`,d=typeof s[0]==`object`?s[0]:void 0,f=!!d?.stream,p=n.streaming===!0;if(f||p)return Mx(e,a,r,s,l,c,t,d,i,f,p);let m,h=mf({name:`${c} ${u}`,op:`gen_ai.${c}`,attributes:l},e=>(m=a.apply(r,s),i.recordInputs&&d&&Dx(e,d,Py(i.enableTruncation)),m.then(t=>(Ax(e,t,i.recordOutputs),t),e=>{throw J(e,{mechanism:{handled:!1,type:`auto.ai.anthropic`,data:{function:t}}}),e})));return Hy(m,h,`auto.ai.anthropic`)}})}function Px(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=Fy(t,String(r)),o=lx[a];return typeof i==`function`&&o?Nx(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?Px(i,a,n):i}})}function Fx(e,t){return Px(e,``,Ny(t))}var Ix=n((()=>{Dp(),Bl(),Hl(),Af(),Xv(),Uy(),ux(),Tx(),gx()})),Lx,Rx,zx,Bx=n((()=>{Lx=`Google_GenAI`,Rx={"models.generateContent":{operation:`generate_content`},"models.generateContentStream":{operation:`generate_content`,streaming:!0},"models.embedContent":{operation:`embeddings`},"chats.create":{proxyResultPath:`chat`},"chat.sendMessage":{operation:`chat`},"chat.sendMessageStream":{operation:`chat`,streaming:!0}},zx=`google_genai`}));function Vx(e,t){let n=e?.promptFeedback;if(n?.blockReason){let e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:`internal_error`}),J(`Content blocked: ${e}`,{mechanism:{handled:!1,type:`auto.ai.google_genai`}}),!0}return!1}function Hx(e,t){typeof e.responseId==`string`&&(t.responseId=e.responseId),typeof e.modelVersion==`string`&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount==`number`&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount==`number`&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount==`number`&&(t.totalTokens=n.totalTokenCount))}function Ux(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:`function`,id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}function Wx(e,t,n,r){!e||Vx(e,r)||(Hx(e,t),Ux(e,t,n))}async function*Gx(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)Wx(i,r,n,t),yield i}finally{Ly(t,r,n)}}var Kx=n((()=>{Dp(),Hl(),Uy()}));function qx(e,t=`user`){return typeof e==`string`?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>qx(e,t)):typeof e!=`object`||!e?[]:`role`in e&&typeof e.role==`string`?[e]:`parts`in e?[{...e,role:t}]:[{role:t,content:e}]}var Jx=n((()=>{}));function Yx(e,t){if(`model`in e&&typeof e.model==`string`)return e.model;if(t&&typeof t==`object`){let e=t;if(`model`in e&&typeof e.model==`string`)return e.model;if(`modelVersion`in e&&typeof e.modelVersion==`string`)return e.modelVersion}return`unknown`}function Xx(e){let t={};return`temperature`in e&&typeof e.temperature==`number`&&(t[uv]=e.temperature),`topP`in e&&typeof e.topP==`number`&&(t[mv]=e.topP),`topK`in e&&typeof e.topK==`number`&&(t[hv]=e.topK),`maxOutputTokens`in e&&typeof e.maxOutputTokens==`number`&&(t[dv]=e.maxOutputTokens),`frequencyPenalty`in e&&typeof e.frequencyPenalty==`number`&&(t[fv]=e.frequencyPenalty),`presencePenalty`in e&&typeof e.presencePenalty==`number`&&(t[pv]=e.presencePenalty),t}function Zx(e,t,n){let r={[sv]:zx,[Tv]:e,[K]:`auto.ai.google_genai`};if(t){if(r[cv]=Yx(t,n),`config`in t&&typeof t.config==`object`&&t.config){let e=t.config;if(Object.assign(r,Xx(e)),`tools`in e&&Array.isArray(e.tools)){let t=e.tools.flatMap(e=>e.functionDeclarations);r[jv]=JSON.stringify(t)}}}else r[cv]=Yx({},n);return r}function Qx(e,t,n,r){if(n){let n=t.contents;n!=null&&e.setAttribute(Hv,typeof n==`string`?n:JSON.stringify(n));return}let i=[];if(`config`in t&&t.config&&typeof t.config==`object`&&`systemInstruction`in t.config&&t.config.systemInstruction&&i.push(...qx(t.config.systemInstruction,`system`)),`history`in t&&i.push(...qx(t.history,`user`)),`contents`in t&&i.push(...qx(t.contents,`user`)),`message`in t&&i.push(...qx(t.message,`user`)),Array.isArray(i)&&i.length){let{systemInstructions:t,filteredMessages:n}=By(i);t&&e.setAttribute(kv,t);let a=Array.isArray(n)?n.length:0;e.setAttributes({[Ev]:a,[Dv]:r?zy(n):Ry(n)})}}function $x(e,t,n){if(!(!t||typeof t!=`object`)){if(t.modelVersion&&e.setAttribute(yv,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata==`object`){let n=t.usageMetadata;typeof n.promptTokenCount==`number`&&e.setAttributes({[Sv]:n.promptTokenCount}),typeof n.candidatesTokenCount==`number`&&e.setAttributes({[Cv]:n.candidatesTokenCount}),typeof n.totalTokenCount==`number`&&e.setAttributes({[wv]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>typeof e.text==`string`?e.text:``).filter(e=>e.length>0).join(``):``).filter(e=>e.length>0);n.length>0&&e.setAttributes({[Av]:n.join(``)})}if(n&&t.functionCalls){let n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[Nv]:JSON.stringify(n)})}}}function eS(e,t,n,r,i){let a=n.operation===`embeddings`;return new Proxy(e,{apply(e,o,s){let c=n.operation||`unknown`,l=s[0],u=Zx(c,l,r),d=u[`gen_ai.request.model`]??`unknown`;return n.streaming?hf({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},async n=>{try{return i.recordInputs&&l&&Qx(n,l,a,Py(i.enableTruncation)),Gx(await e.apply(r,s),n,!!i.recordOutputs)}catch(e){throw n.setStatus({code:2,message:`internal_error`}),J(e,{mechanism:{handled:!1,type:`auto.ai.google_genai`,data:{function:t}}}),n.end(),e}}):mf({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},n=>(i.recordInputs&&l&&Qx(n,l,a,Py(i.enableTruncation)),lf(()=>e.apply(r,s),e=>{J(e,{mechanism:{handled:!1,type:`auto.ai.google_genai`,data:{function:t}}})},()=>{},e=>{a||$x(n,e,i.recordOutputs)})))}})}function tS(e,t=``,n){return new Proxy(e,{get:(e,r,i)=>{let a=Reflect.get(e,r,i),o=Fy(t,String(r)),s=Rx[o];if(typeof a==`function`&&s){let t=s.operation?eS(a,o,s,e,n):a.bind(e);return s.proxyResultPath?function(...e){let r=t(...e);return r&&typeof r==`object`?tS(r,s.proxyResultPath,n):r}:t}return typeof a==`function`?a.bind(e):a&&typeof a==`object`?tS(a,o,n):a}})}function nS(e,t){return tS(e,``,Ny(t))}var rS=n((()=>{Dp(),Bl(),Hl(),Af(),df(),Xv(),Uy(),Bx(),Kx(),Jx()})),iS,aS,oS,sS=n((()=>{iS=`LangChain`,aS=`auto.ai.langchain`,oS={human:`user`,ai:`assistant`,assistant:`assistant`,system:`system`,function:`function`,tool:`tool`}}));function cS(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function lS(e){if(Array.isArray(e))try{let t=e.map(e=>e&&typeof e==`object`&&Zv(e)?dy(e):e);return JSON.stringify(t)}catch{return String(e)}return cS(e)}function uS(e){let t=e.toLowerCase();return oS[t]??t}function dS(e){return e.includes(`System`)?`system`:e.includes(`Human`)?`user`:e.includes(`AI`)||e.includes(`Assistant`)?`assistant`:e.includes(`Function`)?`function`:e.includes(`Tool`)?`tool`:`user`}function fS(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function pS(e){return e.map(e=>{let t=e._getType;if(typeof t==`function`)return{role:uS(t.call(e)),content:lS(e.content)};if(e.lc===1&&e.kwargs){let t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:``;return{role:uS(typeof n==`string`?dS(n):`user`),content:lS(e.kwargs?.content)}}if(e.type)return{role:uS(String(e.type).toLowerCase()),content:lS(e.content)};if(e.role)return{role:uS(String(e.role)),content:lS(e.content)};let n=e.constructor?.name;return n&&n!==`Object`?{role:uS(dS(n)),content:lS(e.content)}:{role:`user`,content:lS(e.content)}})}function mS(e,t,n){let r={},i=`kwargs`in e?e.kwargs:void 0;SS(r,uv,t?.temperature??n?.ls_temperature??i?.temperature),SS(r,dv,t?.max_tokens??n?.ls_max_tokens??i?.max_tokens),SS(r,mv,t?.top_p??i?.top_p);let a=t?.frequency_penalty;SS(r,fv,a);let o=t?.presence_penalty;return SS(r,pv,o),t&&`stream`in t&&xS(r,lv,!!t.stream),r}function hS(e,t,n,r,i){return{[sv]:cS(e??`langchain`),[Tv]:`chat`,[cv]:cS(t),[K]:aS,...mS(n,r,i)}}function gS(e,t,n,r,i,a){let o=a?.ls_provider,s=hS(o,i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){xS(s,Ev,t.length);let e=t.map(e=>({role:`user`,content:e}));xS(s,Dv,r?zy(e):Ry(e))}return s}function _S(e,t,n,r,i,a){let o=hS(a?.ls_provider??e.id?.[2],i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){let{systemInstructions:e,filteredMessages:n}=By(pS(t.flat()));e&&xS(o,kv,e),xS(o,Ev,Array.isArray(n)?n.length:0),xS(o,Dv,r?zy(n):Ry(n))}return o}function vS(e,t){let n=[],r=e.flat();for(let e of r){let t=e.message?.content;if(Array.isArray(t))for(let e of t){let t=e;t.type===`tool_use`&&n.push(t)}}n.length>0&&xS(t,Nv,cS(n))}function yS(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)SS(t,Sv,n.promptTokens),SS(t,Cv,n.completionTokens),SS(t,wv,n.totalTokens);else if(r){SS(t,Sv,r.input_tokens),SS(t,Cv,r.output_tokens);let e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&SS(t,wv,i),r.cache_creation_input_tokens!==void 0&&SS(t,Lv,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&SS(t,Rv,r.cache_read_input_tokens)}}function bS(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let r=e.generations.flat().map(e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null).filter(e=>typeof e==`string`);if(r.length>0&&xS(n,vv,cS(r)),vS(e.generations,n),t){let t=e.generations.flat().map(e=>e.text??e.message?.content).filter(e=>typeof e==`string`);t.length>0&&xS(n,Av,cS(t))}}yS(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&xS(n,yv,a);let o=r?.id??i?.id;o&&xS(n,bv,o);let s=r?.stop_reason??i?.response_metadata?.finish_reason;return s&&xS(n,xv,cS(s)),n}var xS,SS,CS=n((()=>{Bl(),Xv(),my(),Uy(),sS(),xS=(e,t,n)=>{n!=null&&(e[t]=n)},SS=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)}}));function wS(e={}){let{recordInputs:t,recordOutputs:n}=Ny(e),r=Py(e.enableTruncation),i=new Map,a=e=>{let t=i.get(e);t?.isRecording()&&(t.end(),i.delete(e))},o={lc_serializable:!1,lc_namespace:[`langchain_core`,`callbacks`,`sentry`],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:[`langchain_core`,`callbacks`,`sentry`],lc_kwargs:{},name:`SentryCallbackHandler`,ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(e,n,a,o,s,c,l,u){let d=gS(e,n,t,r,fS(c),l),f=d[cv],p=d[Tv];hf({name:`${p} ${f}`,op:`gen_ai.chat`,attributes:{...d,[G]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleChatModelStart(e,n,a,o,s,c,l,u){let d=_S(e,n,t,r,fS(c),l),f=d[cv],p=d[Tv];hf({name:`${p} ${f}`,op:`gen_ai.chat`,attributes:{...d,[G]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleLLMEnd(e,t,r,o,s){let c=i.get(t);if(c?.isRecording()){let r=bS(e,n);r&&c.setAttributes(r),a(t)}},handleLLMError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),J(e,{mechanism:{handled:!1,type:`${aS}.llm_error_handler`}})},handleChainStart(e,n,r,a,o,s,c,l){let u=l||e.name||`unknown_chain`,d={[K]:`auto.ai.langchain`,"langchain.chain.name":u};t&&(d[`langchain.chain.inputs`]=JSON.stringify(n)),hf({name:`chain ${u}`,op:`gen_ai.invoke_agent`,attributes:{...d,[G]:`gen_ai.invoke_agent`}},e=>(i.set(r,e),e))},handleChainEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),a(t))},handleChainError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),J(e,{mechanism:{handled:!1,type:`${aS}.chain_error_handler`}})},handleToolStart(e,n,r,a){let o=e.name||`unknown_tool`,s={[K]:aS,[Wv]:o};t&&(s[qv]=n),hf({name:`execute_tool ${o}`,op:`gen_ai.execute_tool`,attributes:{...s,[G]:`gen_ai.execute_tool`}},e=>(i.set(r,e),e))},handleToolEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({[Jv]:JSON.stringify(e)}),a(t))},handleToolError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),J(e,{mechanism:{handled:!1,type:`${aS}.tool_error_handler`}})},copy(){return o},toJSON(){return{lc:1,type:`not_implemented`,id:o.lc_id}},toJSONNotImplemented(){return{lc:1,type:`not_implemented`,id:o.lc_id}}};return o}var TS=n((()=>{Dp(),Bl(),Hl(),Af(),Xv(),Uy(),sS(),CS()})),ES,DS,OS=n((()=>{ES=`LangGraph`,DS=`auto.ai.langgraph`}));function kS(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n==`object`){let e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function AS(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata==`object`){let e=t.usage_metadata;return typeof e.input_tokens==`number`&&(n=e.input_tokens),typeof e.output_tokens==`number`&&(r=e.output_tokens),typeof e.total_tokens==`number`&&(i=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata==`object`){let e=t.response_metadata;if(e.tokenUsage&&typeof e.tokenUsage==`object`){let t=e.tokenUsage;typeof t.promptTokens==`number`&&(n=t.promptTokens),typeof t.completionTokens==`number`&&(r=t.completionTokens),typeof t.totalTokens==`number`&&(i=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function jS(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata==`object`){let t=n.response_metadata;t.model_name&&typeof t.model_name==`string`&&e.setAttribute(yv,t.model_name),t.finish_reason&&typeof t.finish_reason==`string`&&e.setAttribute(vv,[t.finish_reason])}}function MS(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))}function NS(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,a=r.length>i?r.slice(i):[];if(a.length===0)return;let o=kS(a);o&&e.setAttribute(Nv,JSON.stringify(o));let s=pS(a);e.setAttribute(Av,JSON.stringify(s));let c=0,l=0,u=0;for(let t of a){let n=AS(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,jS(e,t)}c>0&&e.setAttribute(Sv,c),l>0&&e.setAttribute(Cv,l),u>0&&e.setAttribute(wv,u)}var PS=n((()=>{Xv(),CS()}));function FS(e,t){return new Proxy(e,{apply(e,n,r){return mf({op:`gen_ai.create_agent`,name:`create_agent`,attributes:{[K]:DS,[G]:`gen_ai.create_agent`,[Tv]:`create_agent`}},i=>{try{let a=Reflect.apply(e,n,r),o=r.length>0?r[0]:{};o?.name&&typeof o.name==`string`&&(i.setAttribute(Pv,o.name),i.updateName(`create_agent ${o.name}`));let s=a.invoke;return s&&typeof s==`function`&&(a.invoke=IS(s.bind(a),a,o,t)),a}catch(e){throw i.setStatus({code:2,message:`internal_error`}),J(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}})}function IS(e,t,n,r){return new Proxy(e,{apply(e,i,a){return mf({op:`gen_ai.invoke_agent`,name:`invoke_agent`,attributes:{[K]:DS,[G]:Vv,[Tv]:`invoke_agent`}},async o=>{try{let s=n?.name;s&&typeof s==`string`&&(o.setAttribute(Fv,s),o.setAttribute(Pv,s),o.updateName(`invoke_agent ${s}`));let c=(a.length>1?a[1]:void 0)?.configurable?.thread_id;c&&typeof c==`string`&&o.setAttribute(Iv,c);let l=MS(t);l&&o.setAttribute(jv,JSON.stringify(l));let u=r.recordInputs,d=r.recordOutputs,f=a.length>0?a[0]?.messages??[]:[];if(f&&u){let{systemInstructions:e,filteredMessages:t}=By(pS(f));e&&o.setAttribute(kv,e);let n=Py(r.enableTruncation),i=Array.isArray(t)?t.length:0;o.setAttributes({[Dv]:n?zy(t):Ry(t),[Ev]:i})}let p=await Reflect.apply(e,i,a);return d&&NS(o,f??null,p),p}catch(e){throw o.setStatus({code:2,message:`internal_error`}),J(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}})}function LS(e,t){return e.compile=FS(e.compile,Ny(t)),e}var RS=n((()=>{Dp(),Bl(),Hl(),Af(),Xv(),Uy(),CS(),OS(),PS()}));function zS(e,t,n){let r=n.getDsn(),i=n.getOptions().tunnel,a=zd(n.getOptions()._metadata);return Od({sent_at:new Date().toISOString(),...BS(t)&&{trace:t},...a&&{sdk:a},...!!i&&r&&{dsn:au(r)}},[[{type:`span`,item_count:e.length,content_type:`application/vnd.sentry.items.span.v2+json`},{items:e}]])}function BS(e){return!!e.trace_id&&!!e.public_key}var VS=n((()=>{mu(),Hd()}));function HS(e){let t=156;if(t+=e.name.length*2,t+=il(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,r=100+(n?il(n):0);t+=r*e.links.length}return t}var US=n((()=>{sl()})),WS,GS,KS,qS=n((()=>{z(),H(),rm(),md(),VS(),US(),WS=1e3,GS=5e6,KS=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:i}=t??{};this._maxSpanLimit=n&&n>0&&n<=WS?n:WS,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:GS,this._client.on(`flush`,()=>{this.drain()}),this._client.on(`close`,()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){let t=e.trace_id,n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:nm(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=HS(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(R&&V.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){let t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size){this._removeTrace(e);return}let n=Array.from(t.spans),r=n[0]?._segmentSpan;if(!r){R&&V.warn(`No segment span reference found on span JSON, cannot compute DSC`),this._removeTrace(e);return}let i=fd(r),a=n.map(e=>{let{_segmentSpan:t,...n}=e;return n}),o=zS(a,i,this._client);R&&V.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(o).then(null,e=>{R&&V.error(`Error while sending streamed span envelope:`,e)}),this._removeTrace(e)}_removeTrace(e){let t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}}})),JS,YS=n((()=>{z(),zp(),vd(),Gf(),ef(),qS(),H(),Xu(),JS=Y(()=>({name:`SpanStreaming`,setup(e){let t=`SpanStreaming integration requires`,n=`Falling back to static trace lifecycle.`,r=e.getOptions();if(!$d(e)){r.traceLifecycle=`static`,R&&V.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!_d(i)){r.traceLifecycle=`static`,R&&V.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let a=new KS(e);e.on(`afterSpanEnd`,t=>{Ru(t)&&a.add(Vf(t,e))})}}))}));function XS(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var ZS=n((()=>{}));function QS(e,t,n){let r=e[t];if(typeof r==`function`){try{e[t]=n}catch{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=n}catch{Object.defineProperty(e,`default`,{value:n,writable:!0,configurable:!0,enumerable:!0})}}}var $S=n((()=>{}));function eC(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function tC(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return i=>{let a=i.match(r);if(a)return{filename:`<data:${a[2]}>`,function:a[1]};let o=i.match(n);if(o){let t,n,r,i,a;if(o[1]){r=o[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}i=void 0}n&&(i=t,a=n),n===`<anonymous>`&&(a=void 0,r=void 0),r===void 0&&(a=a||`?`,r=i?`${i}.${a}`:a);let s=Ko(o[2]),c=o[5]===`native`;!s&&o[5]&&!c&&(s=o[5]);let l=s?iC(s):void 0;return{filename:l??s,module:l&&e?.(l),function:r,lineno:rC(o[3]),colno:rC(o[4]),in_app:eC(s||``,c)}}if(i.match(t))return{filename:i}}}function nC(e){return[90,tC(e)]}function rC(e){return parseInt(e||``,10)||void 0}function iC(e){try{return decodeURI(e)}catch{return}}var aC=n((()=>{Zo()})),oC,sC=n((()=>{oC=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let t=this._cache.get(e);if(t!==void 0)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){if(this._cache.size>=this._maxSize){let e=this._cache.keys().next().value;this._cache.delete(e)}this._cache.set(e,t)}remove(e){let t=this._cache.get(e);return t&&this._cache.delete(e),t}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(t=>e.push(t)),e}}}));function cC(e){let t=e.constructor?.name??``;return t.includes(`OpenAI`)?`openai`:t.includes(`Google`)?`google_genai`:t.includes(`Mistral`)?`mistralai`:t.includes(`Vertex`)?`google_vertexai`:t.includes(`Bedrock`)?`aws_bedrock`:t.includes(`Ollama`)?`ollama`:t.includes(`Cloudflare`)?`cloudflare`:t.includes(`Cohere`)?`cohere`:`langchain`}function lC(e){let t=e??{},n={[K]:aS,[G]:Uv,[Tv]:`embeddings`,[cv]:t.model??`unknown`};return n[sv]=cC(t),`dimensions`in t&&(n[_v]=t.dimensions),`encodingFormat`in t&&(n[gv]=t.encodingFormat),n}function uC(e,t={}){let{recordInputs:n}=Ny(t);return new Proxy(e,{apply(e,t,r){let i=lC(t),a=i[`gen_ai.request.model`]||`unknown`;if(n){let e=r[0];e!=null&&(i[Hv]=typeof e==`string`?e:JSON.stringify(e))}return mf({name:`embeddings ${a}`,op:Uv,attributes:i},()=>Reflect.apply(e,t,r).then(void 0,e=>{throw J(e,{mechanism:{handled:!1,type:`auto.ai.langchain`}}),e}))}})}function dC(e,t){let n=e;return typeof n.embedQuery==`function`&&(n.embedQuery=uC(n.embedQuery,t)),typeof n.embedDocuments==`function`&&(n.embedDocuments=uC(n.embedDocuments,t)),e}var fC=n((()=>{Dp(),Bl(),Af(),Xv(),Uy(),sS()})),X=n((()=>{$u(),Xl(),gl(),z(),Bl(),H(),td(),od(),Nc(),Xu(),yc(),md(),gd(),cf(),Hl(),Af(),Qd(),pf(),Xd(),Gf(),qd(),Dp(),zc(),el(),Do(),wc(),Ic(),tp(),Mp(),Hm(),sh(),mm(),Hd(),fm(),rm(),mu(),zp(),fh(),gh(),Bf(),yp(),Gm(),vd(),Dh(),df(),gu(),kh(),Nh(),Ih(),Rh(),Gl(),Yh(),cd(),Qh(),ig(),vg(),Ag(),xo(),Wg(),qg(),pc(),Yg(),$s(),A_(),Zo(),Ds(),Dd(),Hs(),P_(),X_(),tv(),av(),ru(),Jp(),tm(),Rb(),Eb(),Ky(),sx(),Ub(),Ix(),ux(),rS(),Bx(),TS(),sS(),RS(),OS(),qS(),ef(),YS(),wg(),ZS(),Ms(),rs(),ss(),ds(),om(),$S(),aC(),Qf(),wu(),gm(),ih(),sC(),kc(),Co(),sp(),qs(),fC()}));function Z(e,t,n){return n?mC(e,t,n):pC(e,t)}function pC(e,t){return Object.assign(n=>{let r=_C[e];if(r)return n&&r.setConfig(n),r;let i=t(n);return _C[e]=i,Fi({instrumentations:[i]}),i},{id:e})}function mC(e,t,n){return Object.assign(r=>{let i=n(r),a=_C[e];if(a)return a.setConfig(i),a;let o=new t(i);return _C[e]=o,Fi({instrumentations:[o]}),o},{id:e})}function hC(e){let t=!1,n=[];if(!gC(e))t=!0;else{let r=e._wrap;e._wrap=(...e)=>(t=!0,n.forEach(e=>e()),n=[],r(...e))}return e=>{t?e():n.push(e)}}function gC(e){return typeof e._wrap==`function`}var _C,vC=n((()=>{L(),_C={}})),Q,yC=n((()=>{Q=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__})),bC,xC,SC=n((()=>{bC=`@sentry/instrumentation-http`,xC=1024*1024}));function CC(e,t,n,r){let i=0,a=[];Q&&V.log(r,`Patching request.on`);let o=new WeakMap,s=n===`small`?1e3:n===`medium`?1e4:xC;try{e.on=new Proxy(e.on,{apply:(e,t,n)=>{let[c,l,...u]=n;if(c===`data`){Q&&V.log(r,`Handling request.on("data") with maximum body size of ${s}b`);let n=new Proxy(l,{apply:(e,t,n)=>{try{let e=n[0],t=Buffer.from(e);i<s?(a.push(t),i+=t.byteLength):Q&&V.log(r,`Dropping request body chunk because maximum body length of ${s}b is exceeded.`)}catch{Q&&V.error(r,`Encountered error while storing body chunk.`)}return Reflect.apply(e,t,n)}});return o.set(l,n),Reflect.apply(e,t,[c,n,...u])}return Reflect.apply(e,t,n)}}),e.off=new Proxy(e.off,{apply:(e,t,n)=>{let[,r]=n,i=o.get(r);if(i){o.delete(r);let a=n.slice();return a[1]=i,Reflect.apply(e,t,a)}return Reflect.apply(e,t,n)}}),e.on(`end`,()=>{try{let e=Buffer.concat(a).toString(`utf-8`);if(e){let n=Buffer.byteLength(e,`utf-8`)>s?`${Buffer.from(e).subarray(0,s-3).toString(`utf-8`)}...`:e;t.setSDKProcessingMetadata({normalizedRequest:{data:n}})}}catch(e){Q&&V.error(r,`Error building captured request body`,e)}})}catch(e){Q&&V.error(r,`Error patching request to capture body`,e)}}var wC=n((()=>{X(),yC(),SC()}));function TC(e,t){Ps(e,`_startSpanCallback`,new WeakRef(t))}function EC(e,{ignoreRequestBody:t,maxRequestBodySize:n,sessions:r,sessionFlushingDelayMS:i}){let a=e.emit;if(jC.has(a))return;let o=new Proxy(a,{apply(e,a,o){if(o[0]!==`request`)return e.apply(a,o);let s=W();if(O.active().getValue(OC)||!s)return e.apply(a,o);Q&&V.log(kC,`Handling incoming request`);let c=ul().clone(),l=o[1],u=o[2],d=Bh(l),f=l.ip||l.socket?.remoteAddress,p=l.url||`/`;n!==`none`&&!t?.(p,l)&&CC(l,c,n,kC),c.setSDKProcessingMetadata({normalizedRequest:d,ipAddress:f});let m=`${(l.method||`GET`).toUpperCase()} ${Ch(p)}`;return c.setTransactionName(m),r&&s&&DC(s,{requestIsolationScope:c,response:u,sessionFlushingDelayMS:i??6e4}),pl(c,()=>{let t={traceId:Dc(),sampleRand:Ws(),propagationSpanId:Oc()};U().setPropagationContext({...t}),c.setPropagationContext({...t});let n=C.extract(O.active(),d.headers).setValue(OC,!0);return O.with(n,()=>{s.emit(`httpServerRequest`,l,u,d);let t=l._startSpanCallback?.deref();return t?t(()=>e.apply(a,o)):e.apply(a,o)})})}});jC.add(o),e.emit=o}function DC(e,{requestIsolationScope:t,response:n,sessionFlushingDelayMS:r}){t.setSDKProcessingMetadata({requestSession:{status:`ok`}}),n.once(`close`,()=>{let n=t.getScopeData().sdkProcessingMetadata.requestSession;if(e&&n){Q&&V.log(`Recorded request session with status: ${n.status}`);let t=new Date;t.setSeconds(0,0);let i=t.toISOString(),a=AC.get(e),o=a?.[i]||{exited:0,crashed:0,errored:0};if(o[{ok:`exited`,crashed:`crashed`,errored:`errored`}[n.status]]++,a)a[i]=o;else{Q&&V.log(`Opened new request session aggregate.`);let t={[i]:o};AC.set(e,t);let n=()=>{clearTimeout(s),a(),AC.delete(e);let n=Object.entries(t).map(([e,t])=>({started:e,exited:t.exited,errored:t.errored,crashed:t.crashed}));e.sendSession({aggregates:n})},a=e.on(`flush`,()=>{Q&&V.log(`Sending request session aggregate due to client flush`),n()}),s=setTimeout(()=>{Q&&V.log(`Sending request session aggregate due to flushing schedule`),n()},r).unref()}}})}var OC,kC,AC,jC,MC,NC,PC=n((()=>{T(),X(),yC(),wC(),OC=ne(`sentry_http_server_instrumented`),kC=`Http.Server`,AC=new Map,jC=new WeakSet,MC=((e={})=>{let t={sessions:e.sessions??!0,sessionFlushingDelayMS:e.sessionFlushingDelayMS??6e4,maxRequestBodySize:e.maxRequestBodySize??`medium`,ignoreRequestBody:e.ignoreRequestBody};return{name:kC,setupOnce(){wt(`http.server.request.start`,(e=>{EC(e.server,t)}))},afterAllSetup(e){Q&&e.getIntegrationByName(`Http`)&&V.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.")}}}),NC=MC}));function FC(e){return e.headers[`next-router-prefetch`]===`1`}function IC(e){let t=Ch(e);return!!(t.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||t.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function LC(e,{ignoreStaticAssets:t,ignoreIncomingRequests:n}){if(j(O.active()))return!0;let r=e.url,i=e.method?.toUpperCase();return!!(i===`OPTIONS`||i===`HEAD`||!r||t&&i===`GET`&&IC(r)||n?.(r,e))}function RC(e){let t=zC(e.headers);return t==null?{}:BC(e.headers)?{"http.request_content_length":t}:{"http.request_content_length_uncompressed":t}}function zC(e){let t=e[`content-length`];if(t===void 0)return null;let n=parseInt(t,10);return isNaN(n)?null:n}function BC(e){let t=e[`content-encoding`];return!!t&&t!==`identity`}function VC(e,t){let{socket:n}=e,{statusCode:r,statusMessage:i}=t,a={[me]:r,[Me]:r,"http.status_text":i?.toUpperCase()},o=je(O.active());if(n){let{localAddress:e,localPort:t,remoteAddress:r,remotePort:i}=n;a[Ve]=e,a[Ue]=t,a[ye]=r,a[`net.peer.port`]=i}return a[Me]=r,a[`http.status_text`]=(i||``).toUpperCase(),o?.type===Fe.HTTP&&o.route!==void 0&&(a[he]=o.route),a}function HC(e,t){return t.some(t=>{if(typeof t==`number`)return t===e;let[n,r]=t;return e>=n&&e<=r})}var UC,WC,GC,KC=n((()=>{T(),be(),F(),X(),yC(),PC(),UC=`Http.ServerSpans`,WC=((e={})=>{let t=e.ignoreStaticAssets??!0,n=e.ignoreIncomingRequests,r=e.ignoreStatusCodes??[[401,404],[301,303],[305,399]],{onSpanCreated:i}=e,{requestHook:a,responseHook:o,applyCustomAttributesOnSpan:s}=e.instrumentation??{};return{name:UC,setup(e){typeof __SENTRY_TRACING__<`u`&&!__SENTRY_TRACING__||e.on(`httpServerRequest`,(r,c,l)=>{let u=r,d=c;TC(u,r=>{if(LC(u,{ignoreStaticAssets:t,ignoreIncomingRequests:n}))return Q&&V.log(UC,`Skipping span creation for incoming request`,u.url),r();let c=l.url||u.url||`/`,f=vh(c),p=u.headers,m=p[`user-agent`],h=p[`x-forwarded-for`],g=u.httpVersion,_=p.host,v=_?.replace(/^(.*)(:[0-9]{1,5})/,`$1`)||`localhost`,y=e.tracer,b=c.startsWith(`https`)?`https`:`http`,x=l.method||u.method?.toUpperCase()||`GET`,S=f?f.pathname:Ch(c),C=`${x} ${S}`,T=y.startSpan(C,{kind:w.SERVER,attributes:{[G]:`http.server`,[K]:`auto.http.otel.http`,"sentry.http.prefetch":FC(u)||void 0,"http.url":c,"http.method":l.method,"http.target":f?`${f.pathname}${f.search}`:S,"http.host":_,"net.host.name":v,"http.client_ip":typeof h==`string`?h.split(`,`)[0]:void 0,"http.user_agent":m,"http.scheme":b,"http.flavor":g,"net.transport":g?.toUpperCase()===`QUIC`?`ip_udp`:`ip_tcp`,...RC(u),...Hh(l.headers||{},e.getOptions().sendDefaultPii??!1)}});a?.(T,u),o?.(T,d),s?.(T,u,d),i?.(T,u,d);let E={type:Fe.HTTP,span:T};return O.with(Te(D.setSpan(O.active(),T),E),()=>{O.bind(O.active(),u),O.bind(O.active(),d);let e=!1;function t(t){if(e)return;e=!0;let n=VC(u,d);T.setAttributes(n),T.setStatus(t),T.end();let r=n[`http.route`];r&&ul().setTransactionName(`${u.method?.toUpperCase()||`GET`} ${r}`)}return d.on(`close`,()=>{t(Vl(d.statusCode))}),d.on(vt,()=>{let e=Vl(d.statusCode);t(e.code===2?e:{code:2})}),r()})})})},processEvent(e){if(e.type===`transaction`){let t=e.contexts?.trace?.data?.[`http.response.status_code`];if(typeof t==`number`&&HC(t,r))return Q&&V.log(`Dropping transaction due to status code`,t),null}return e},afterAllSetup(e){Q&&(e.getIntegrationByName(`Http`)&&V.warn("It seems that you have manually added `httpServerSpansIntergation` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`."),e.getIntegrationByName(`Http.Server`)||V.error("It seems that you have manually added `httpServerSpansIntergation` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration."))}}}),GC=WC}));function qC(e,t){if(!e)return t;let n=$l(e),r=$l(t);if(!r)return e;let i={},a={};for(let[e,t]of Object.entries(r))e.startsWith(`sentry-`)?i[e]=t:a[e]=t;let o=Object.keys(i).length>0,s={};if(n)for(let[e,t]of Object.entries(n))o&&e.startsWith(`sentry-`)||(s[e]=t);Object.assign(s,i);for(let[e,t]of Object.entries(a))s[e]||(s[e]=t);return tu(s)}var JC=n((()=>{X()}));function YC(e,t){let n=ZC(e),r=t?.statusCode,i=XS(r);Xh({category:`http`,data:{status_code:r,...n},type:`http`,level:i},{event:`response`,request:e,response:t})}function XC(e,t){let n=$C(e),{tracePropagationTargets:r,propagateTraceparent:i}=W()?.getOptions()||{},a=Ph(n,r,t)?Ah({propagateTraceparent:i}):void 0;if(!a)return;let{"sentry-trace":o,baggage:s,traceparent:c}=a;if(!e.getHeader(`sentry-trace`)){if(o)try{e.setHeader(`sentry-trace`,o),Q&&V.log(ew,`Added sentry-trace header to outgoing request`)}catch(e){Q&&V.error(ew,`Failed to add sentry-trace header to outgoing request:`,fs(e)?e.message:`Unknown error`)}if(c&&!e.getHeader(`traceparent`))try{e.setHeader(`traceparent`,c),Q&&V.log(ew,`Added traceparent header to outgoing request`)}catch(e){Q&&V.error(ew,`Failed to add traceparent header to outgoing request:`,fs(e)?e.message:`Unknown error`)}if(s){let t=qC(e.getHeader(`baggage`),s);if(t)try{e.setHeader(`baggage`,t),Q&&V.log(ew,`Added baggage header to outgoing request`)}catch(e){Q&&V.error(ew,`Failed to add baggage header to outgoing request:`,fs(e)?e.message:`Unknown error`)}}}}function ZC(e){try{let t=e.getHeader(`host`)||e.host,n=Sh(new URL(e.path,`${e.protocol}//${t}`).toString()),r={url:wh(n),"http.method":e.method||`GET`};return n.search&&(r[`http.query`]=n.search),n.hash&&(r[`http.fragment`]=n.hash),r}catch{return{}}}function QC(e){return{method:e.method,protocol:e.protocol,host:e.host,hostname:e.host,path:e.path,headers:e.getHeaders()}}function $C(e){let t=e.getHeader(`host`)||e.host;return`${e.protocol}//${t}${e.path}`}var ew,tw=n((()=>{X(),yC(),JC(),ew=`@sentry/instrumentation-http`}));function nw(e){let t=$C(e),[n,r]=xh(vh(t),`client`,`auto.http.otel.http`,e),i=e.getHeader(`user-agent`);return[n,{[G]:`http.client`,"otel.kind":`CLIENT`,[Re]:i,[Ne]:t,"http.url":t,"http.method":e.method,"http.target":e.path||`/`,"net.peer.name":e.host,"http.host":e.getHeader(`host`),...r}]}function rw(e){let{statusCode:t,statusMessage:n,httpVersion:r,socket:i}=e,a=r.toUpperCase()===`QUIC`?`ip_udp`:`ip_tcp`,o={[me]:t,[Le]:r,"http.flavor":r,[oe]:a,"net.transport":a,"http.status_text":n?.toUpperCase(),"http.status_code":t,...iw(e)};if(i){let{remoteAddress:e,remotePort:t}=i;o[ae]=e,o[se]=t,o[`net.peer.ip`]=e,o[`net.peer.port`]=t}return o}function iw(e){let t=aw(e.headers);return t==null?{}:ow(e.headers)?{[xe]:t}:{[Ce]:t}}function aw(e){let t=e[`content-length`];if(typeof t==`number`)return t;if(typeof t!=`string`)return;let n=parseInt(t,10);if(!isNaN(n))return n}function ow(e){let t=e[`content-encoding`];return!!t&&t!==`identity`}var sw,cw=n((()=>{T(),be(),L(),F(),X(),yC(),SC(),tw(),sw=class extends $a{constructor(e={}){super(bC,So,e),this._propagationDecisionMap=new oC(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){let e=!1,t=(e=>{let t=e;this._onOutgoingRequestFinish(t.request,t.response)}),n=(e=>{let t=e;this._onOutgoingRequestFinish(t.request,void 0)}),r=(e=>{let t=e;this._onOutgoingRequestCreated(t.request)}),i=i=>e?i:(e=!0,wt(`http.client.response.finish`,t),wt(`http.client.request.error`,n),(this.getConfig().propagateTraceInOutgoingRequests||this.getConfig().createSpansForOutgoingRequests)&&wt(`http.client.request.created`,r),i),a=()=>{Tt(`http.client.response.finish`,t),Tt(`http.client.request.error`,n),Tt(`http.client.request.created`,r)};return[new io(`http`,[`*`],i,a),new io(`https`,[`*`],i,a)]}_startSpanForOutgoingRequest(e){let t=e.once,[n,r]=nw(e),i=gf({name:n,attributes:r,onlyIfParent:!0});this.getConfig().outgoingRequestHook?.(i,e),e.once=new Proxy(t,{apply(e,t,n){let[r]=n;if(r!==`response`)return e.apply(t,n);let a=O.active(),o=D.setSpan(a,i);return O.with(o,()=>e.apply(t,n))}});let a=!1,o=e=>{a||(a=!0,i.setStatus(e),i.end())};return e.prependListener(`response`,t=>{e.listenerCount(`response`)<=1&&t.resume(),O.bind(O.active(),t);let n=rw(t);i.setAttributes(n),this.getConfig().outgoingResponseHook?.(i,t),this.getConfig().outgoingRequestApplyCustomAttributes?.(i,e,t);let r=(e=!1)=>{this._diag.debug(`outgoingRequest on end()`),o(e||typeof t.statusCode!=`number`||t.aborted&&!t.complete?{code:b.ERROR}:Vl(t.statusCode))};t.on(`end`,()=>{r()}),t.on(vt,e=>{this._diag.debug(`outgoingRequest on response error()`,e),r(!0)})}),e.on(`close`,()=>{o({code:b.UNSET})}),e.on(vt,e=>{this._diag.debug(`outgoingRequest on request error()`,e),o({code:b.ERROR})}),i}_onOutgoingRequestFinish(e,t){Q&&V.log(`@sentry/instrumentation-http`,`Handling finished outgoing request`);let n=this.getConfig().breadcrumbs,r=n===void 0?!0:n,i=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,i),r&&!i&&YC(e,t)}_onOutgoingRequestCreated(e){Q&&V.log(`@sentry/instrumentation-http`,`Handling outgoing request created`);let t=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,t),t)return;let n=this.getConfig().createSpansForOutgoingRequests&&(this.getConfig().spans??!0),r=this.getConfig().propagateTraceInOutgoingRequests;if(n){let t=this._startSpanForOutgoingRequest(e);if(r&&t.isRecording()){let n=D.setSpan(O.active(),t);O.with(n,()=>{XC(e,this._propagationDecisionMap)})}else r&&XC(e,this._propagationDecisionMap)}else r&&XC(e,this._propagationDecisionMap)}_shouldIgnoreOutgoingRequest(e){if(j(O.active()))return!0;let t=this.getConfig().ignoreOutgoingRequests;if(!t)return!1;let n=QC(e);return t($C(e),n)}}})),lw,uw,dw,fw=n((()=>{X(),vC(),PC(),KC(),cw(),lw=`Http`,uw=Z(`${lw}.sentry`,e=>new sw(e)),dw=Y((e={})=>{let t={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},n={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes},r={breadcrumbs:e.breadcrumbs,propagateTraceInOutgoingRequests:e.tracePropagation??!0,ignoreOutgoingRequests:e.ignoreOutgoingRequests},i=NC(t),a=GC(n),o=e.spans??!1,s=e.disableIncomingRequestSpans??!1,c=o&&!s;return{name:lw,setup(e){c&&a.setup(e)},setupOnce(){i.setupOnce(),uw(r)},processEvent(e){return a.processEvent(e)}}})})),pw,mw,hw,gw=n((()=>{X(),pw=cc(process.versions.node),mw=pw.major,hw=pw.minor}));function _w(e,t){let n=ww(e.origin,e.path),{tracePropagationTargets:r,propagateTraceparent:i}=W()?.getOptions()||{},a=Ph(n,r,t)?Ah({propagateTraceparent:i}):void 0;if(!a)return;let{"sentry-trace":o,baggage:s,traceparent:c}=a,l=Array.isArray(e.headers)?e.headers:vw(e.headers);if(bw(l,Tw),bw(l,Ew),i&&bw(l,Dw),xw(l,Tw)===-1){o&&l.push(Tw,o),c&&xw(l,`traceparent`)===-1&&l.push(`traceparent`,c);let e=xw(l,Ew);if(s&&e===-1)l.push(Ew,s);else if(s){let t=l[e+1],n=qC(t,s);n&&(l[e+1]=n)}}Array.isArray(e.headers)||(e.headers=yw(l))}function vw(e){let t=e.split(`\r
|
|
5
|
+
`),n=[];for(let e of t)try{let t=e.indexOf(`:`);if(t===-1)continue;let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();r&&n.push(r,i)}catch{V.warn(`Failed to convert string request header to array header: ${e}`)}return n}function yw(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];!r||i==null||t.push(`${r}: ${i}`)}return t.length?t.join(`\r
|
|
6
|
+
`).concat(`\r
|
|
7
|
+
`):``}function bw(e,t){let n=-1;for(let r=0;r<e.length;r+=2){if(e[r]!==t)continue;if(n===-1){n=r;continue}let i=e[n+1];if(t===Ew&&i){let t=qC(e[r+1],i);t&&(e[n+1]=t)}e.splice(r,2),r-=2}}function xw(e,t){return e.findIndex((e,n)=>n%2==0&&e===t)}function Sw(e,t){let n=Cw(e),r=t.statusCode,i=XS(r);Xh({category:`http`,data:{status_code:r,...n},type:`http`,level:i},{event:`response`,request:e,response:t})}function Cw(e){try{let t=Sh(ww(e.origin,e.path)),n={url:wh(t),"http.method":e.method||`GET`};return t.search&&(n[`http.query`]=t.search),t.hash&&(n[`http.fragment`]=t.hash),n}catch{return{}}}function ww(e,t=`/`){try{return new URL(t,e).toString()}catch{let n=`${e}`;return n.endsWith(`/`)&&t.startsWith(`/`)?`${n}${t.slice(1)}`:!n.endsWith(`/`)&&!t.startsWith(`/`)?`${n}/${t}`:`${n}${t}`}}var Tw,Ew,Dw,Ow=n((()=>{X(),JC(),Tw=`sentry-trace`,Ew=`baggage`,Dw=`traceparent`})),kw,Aw=n((()=>{T(),be(),L(),X(),gw(),Ow(),kw=class extends $a{constructor(e={}){super(`@sentry/instrumentation-node-fetch`,So,e),this._channelSubs=[],this._propagationDecisionMap=new oC(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs=[]}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this._subscribeToChannel(`undici:request:create`,this._onRequestCreated.bind(this)),this._subscribeToChannel(`undici:request:headers`,this._onResponseHeaders.bind(this)))}_onRequestCreated({request:e}){let t=this.getConfig();if(t.enabled===!1)return;let n=this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,n),!n&&t.tracePropagation!==!1&&_w(e,this._propagationDecisionMap)}_onResponseHeaders({request:e,response:t}){let n=this.getConfig();if(n.enabled===!1)return;let r=n.breadcrumbs,i=r===void 0?!0:r,a=this._ignoreOutgoingRequestsMap.get(e);i&&!a&&Sw(e,t)}_subscribeToChannel(e,t){let n=mw>18||mw===18&&hw>=19,r;if(n)jt.subscribe?.(e,t),r=()=>jt.unsubscribe?.(e,t);else{let n=jt.channel(e);n.subscribe(t),r=()=>n.unsubscribe(t)}this._channelSubs.push({name:e,unsubscribe:r})}_shouldIgnoreOutgoingRequest(e){if(j(O.active()))return!0;let t=ww(e.origin,e.path),n=this.getConfig().ignoreOutgoingRequests;return typeof n!=`function`||!t?!1:n(t)}}})),jw,Mw,Nw,Pw=n((()=>{X(),vC(),Aw(),jw=Z(`NodeFetch.sentry`,kw,e=>e),Mw=((e={})=>({name:`NodeFetch`,setupOnce(){jw(e)}})),Nw=Y(Mw)}));function Fw(e){if(`parentSpanId`in e)return e.parentSpanId;if(`parentSpanContext`in e)return e.parentSpanContext?.spanId}function Iw(e){let t=e;return!!t.attributes&&typeof t.attributes==`object`}function Lw(e){return typeof e.kind==`number`}function Rw(e){return!!e.status}function zw(e){return!!e.name}function Bw(e){if(!Iw(e))return{};let t=e.attributes[`url.full`]||e.attributes[`http.url`],n={url:t,"http.method":e.attributes[`http.request.method`]||e.attributes[`http.method`]};!n[`http.method`]&&n.url&&(n[`http.method`]=`GET`);try{if(typeof t==`string`){let e=Sh(t);n.url=wh(e),e.search&&(n[`http.query`]=e.search),e.hash&&(n[`http.fragment`]=e.hash)}}catch{}return n}function Vw(e){return Lw(e)?e.kind:w.INTERNAL}function Hw(e){return e.getValue(cE)}function Uw(e,t){return e.setValue(cE,t)}function Ww(e,t){Ps(e,fE,Ul(t))}function Gw(e){return Wl(e[fE])}function Kw(e){let{traceFlags:t,traceState:n}=e,r=n?n.get(nE)===`1`:!1;if(t===S.SAMPLED)return!0;if(r)return!1;let i=n?n.get(tE):void 0,a=i?Zl(i):void 0;if(a?.sampled===`true`)return!0;if(a?.sampled===`false`)return!1}function qw(e,t,n){let r=t[`http.request.method`]||t[`http.method`];if(r)return Xw({attributes:t,name:e,kind:n},r);let i=t[`db.system.name`]||t[`db.system`],a=typeof t[`sentry.op`]==`string`&&t[`sentry.op`].startsWith(`cache.`);if(i&&!a)return Yw({attributes:t,name:e});let o=t[`sentry.source`]===`custom`?`custom`:`route`;if(t[`rpc.service`])return{...$w(e,t,`route`),op:`rpc`};if(t[`messaging.system`])return{...$w(e,t,o),op:`message`};let s=t[Ae];return s?{...$w(e,t,o),op:s.toString()}:{op:void 0,description:e,source:`custom`}}function Jw(e){let t=Iw(e)?e.attributes:{};return qw(zw(e)?e.name:`<unknown>`,t,Vw(e))}function Yw({attributes:e,name:t}){let n=e[jl];if(typeof n==`string`)return{op:`db`,description:n,source:e[`sentry.source`]||`custom`};if(e[`sentry.source`]===`custom`)return{op:`db`,description:t,source:`custom`};let r=e[ze];return{op:`db`,description:r?r.toString():t,source:`task`}}function Xw({name:e,kind:t,attributes:n},r){let i=[`http`];switch(t){case w.CLIENT:i.push(`client`);break;case w.SERVER:i.push(`server`);break}n[`sentry.http.prefetch`]&&i.push(`prefetch`);let{urlPath:a,url:o,query:s,fragment:c,hasRoute:l}=Qw(n,t);if(!a)return{...$w(e,n),op:i.join(`.`)};let u=n[QT],d=`${r} ${a}`,f=u?`${d} (${Zw(u)})`:d,p=l||a===`/`?`route`:`url`,m={};o&&(m.url=o),s&&(m[`http.query`]=s),c&&(m[`http.fragment`]=c);let h=t===w.CLIENT||t===w.SERVER,g=!`${n[`sentry.origin`]||`manual`}`.startsWith(`auto`),_=n[_l]===`custom`,v=n[jl],{description:y,source:b}=!_&&v==null&&(h||!g)?{description:f,source:p}:$w(e,n);return{op:i.join(`.`),description:y,source:b,data:m}}function Zw(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(`, `):`${t.slice(0,5).join(`, `)}, +${t.length-5}`}return`${e}`}function Qw(e,t){let n=e[Ee],r=e[`http.url`]||e[`url.full`],i=e[he],a=typeof r==`string`?Sh(r):void 0,o=a?wh(a):void 0,s=a?.search||void 0,c=a?.hash||void 0;return typeof i==`string`?{urlPath:i,url:o,query:s,fragment:c,hasRoute:!0}:t===w.SERVER&&typeof n==`string`?{urlPath:Ch(n),url:o,query:s,fragment:c,hasRoute:!1}:a?{urlPath:o,url:o,query:s,fragment:c,hasRoute:!1}:typeof n==`string`?{urlPath:Ch(n),url:o,query:s,fragment:c,hasRoute:!1}:{urlPath:void 0,url:o,query:s,fragment:c,hasRoute:!1}}function $w(e,t,n=`custom`){let r=t[`sentry.source`]||n,i=t[jl];return i&&typeof i==`string`?{description:i,source:r}:{description:e,source:r}}function eT(e){e.on(`createDsc`,(e,t)=>{if(!t)return;let n=q(t).data[_l],{description:r}=zw(t)?Jw(t):{description:void 0};if(n!==`url`&&r&&(e.transaction=r),ed()){let n=Kw(t.spanContext());e.sampled=n==null?void 0:String(n)}})}function tT(){return D.getActiveSpan()}function nT({dsc:e,sampled:t}){let n=e?Ql(e):void 0,r=new we,i=n?r.set(tE,n):r;return t===!1?i.set(nE,`1`):i}function rT(){return Array.from(mE)}function iT(e){mE.add(e)}function aT(e,t={}){let n=D.getSpan(e);if(n?.spanContext().isRemote){let e=n.spanContext();return{dynamicSamplingContext:fd(n),traceId:e.traceId,spanId:void 0,sampled:Kw(e)}}if(n){let e=n.spanContext();return{dynamicSamplingContext:fd(n),traceId:e.traceId,spanId:e.spanId,sampled:Kw(e)}}let r=t.scope||Hw(e)?.scope||U(),i=t.client||W(),a=r.getPropagationContext();return{dynamicSamplingContext:i?dd(i,r):void 0,traceId:a.traceId,spanId:a.propagationSpanId,sampled:a.sampled}}function oT(e,{sentryTrace:t,baggage:n}){let{traceId:r,parentSpanId:i,sampled:a,dsc:o}=vu(t,n),s=W(),c=Zl(n);if(!i||s&&!Su(s,c?.org_id))return e;let l=fT({traceId:r,spanId:i,sampled:a,dsc:o});return D.setSpanContext(e,l)}function sT(e,t,n){let r=cT(oT(e,t));return O.with(r,n)}function cT(e){let t=Hw(e);return Uw(e,{scope:t?t.scope:U().clone(),isolationScope:t?t.isolationScope:ul()})}function lT(e){try{let t=e[eE];return Array.isArray(t)?t.join(`,`):t}catch{return}}function uT(e){try{return e[$T]}catch{return}}function dT(e){let t=q(e).data,n=t[`http.url`]||t[`url.full`];if(typeof n==`string`)return n;let r=e.spanContext().traceState?.get(rE);if(r)return r}function fT({spanId:e,traceId:t,sampled:n,dsc:r}){let i=nT({dsc:r,sampled:n});return{traceId:t,spanId:e,isRemote:!0,traceFlags:n?S.SAMPLED:S.NONE,traceState:i}}function pT(e,t,n){let r=vT(),{name:i,parentSpan:a}=e;return DT(a)(()=>{let a=ST(e.scope,e.forceTransaction),o=e.onlyIfParent&&!D.getSpan(a)?Oe(a):a,s=yT(e);if(!ed()){let e=j(o)?o:Oe(o);return O.with(e,()=>r.startActiveSpan(i,s,e,e=>(xT(e),O.with(a,()=>lf(()=>t(e),()=>{q(e).status===void 0&&e.setStatus({code:b.ERROR})},n?()=>e.end():void 0)))))}return r.startActiveSpan(i,s,o,e=>(xT(e),lf(()=>t(e),()=>{q(e).status===void 0&&e.setStatus({code:b.ERROR})},n?()=>e.end():void 0)))})}function mT(e,t){return pT(e,t,!0)}function hT(e,t){return pT(e,e=>t(e,()=>e.end()),!1)}function gT(e){let t=vT(),{name:n,parentSpan:r}=e;return DT(r)(()=>{let r=ST(e.scope,e.forceTransaction),i=e.onlyIfParent&&!D.getSpan(r)?Oe(r):r,a=yT(e);ed()||(i=j(i)?i:Oe(i));let o=t.startSpan(n,a,i);return xT(o),o})}function _T(e,t){let n=e?D.setSpan(O.active(),e):D.deleteSpan(O.active());return O.with(n,()=>t(U()))}function vT(){return W()?.tracer||D.getTracer(`@sentry/opentelemetry`,`10.49.0`)}function yT(e){let{startTime:t,attributes:n,kind:r,op:i,links:a}=e,o=typeof t==`number`?bT(t):t;return{attributes:i?{[G]:i,...n}:n,kind:r,links:a,startTime:o}}function bT(e){return e<9999999999?e*1e3:e}function xT(e){let t=e.end.bind(e);e.end=e=>t(typeof e==`number`?bT(e):e)}function ST(e,t){let n=CT(e),r=D.getSpan(n);if(!r||!t)return n;let i=D.deleteSpan(n),{spanId:a,traceId:o}=r.spanContext(),s=Kw(r.spanContext()),c=nT({dsc:fd(Yu(r)),sampled:s}),l={traceId:o,spanId:a,isRemote:!0,traceFlags:s?S.SAMPLED:S.NONE,traceState:c};return D.setSpanContext(i,l)}function CT(e){if(e){let t=Gw(e);if(t)return t}return O.active()}function wT(e,t){return sT(O.active(),e,t)}function TT(e){let t=Dc(),n={traceId:t,spanId:Oc(),isRemote:!0,traceFlags:S.NONE},r=D.setSpanContext(O.active(),n);return O.with(r,()=>(U().setPropagationContext({traceId:t,sampleRand:Ws()}),e()))}function ET(e,t){let n=Gw(t),r=n&&D.getSpan(n),i=r?Eu(r):ml(t);return[r?fd(r):dd(e,t),i]}function DT(e){return e===void 0?e=>e():t=>_T(e,t)}function OT(e){let t=Oe(O.active());return O.with(t,e)}function kT(e){e.on(`preprocessEvent`,e=>{let t=tT();if(!(!t||e.type===`transaction`))return e.contexts={trace:Eu(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:fd(Yu(t)),...e.sdkProcessingMetadata},e})}function AT({span:e,scope:t,client:n,propagateTraceparent:r}={}){let i=(t&&Gw(t))??O.active();if(e){let{scope:t}=ql(e);i=t&&Gw(t)||D.setSpan(O.active(),e)}let{traceId:a,spanId:o,sampled:s,dynamicSamplingContext:c}=aT(i,{scope:t,client:n}),l={"sentry-trace":yu(a,o,s),baggage:Ql(c)};return r&&(l.traceparent=bu(a,o,s)),l}function jT(){function e(){return Hw(O.active())||{scope:Lc(),isolationScope:Rc()}}function t(e){let t=O.active();return O.with(t,()=>e(a()))}function n(e,t){let n=Gw(e)||O.active();return O.with(n.setValue(uE,e),()=>t(e))}function r(e){let t=O.active();return O.with(t.setValue(lE,!0),()=>e(o()))}function i(e,t){let n=O.active();return O.with(n.setValue(dE,e),()=>t(o()))}function a(){return e().scope}function o(){return e().isolationScope}Qc({withScope:t,withSetScope:n,withSetIsolationScope:i,withIsolationScope:r,getCurrentScope:a,getIsolationScope:o,startSpan:mT,startSpanManual:hT,startInactiveSpan:gT,getActiveSpan:tT,suppressTracing:OT,getTraceData:AT,continueTrace:wT,startNewTrace:TT,withActiveSpan:_T})}function MT(e,t){let n=D.getSpan(e),r;if(n?.spanContext().traceState?.get(oE)===`1`){let n=D.deleteSpan(e),i=D.getSpan(t);r=i?D.setSpan(n,i):n}else r=e;let i=Hw(r),a=i?.scope||U(),o=i?.isolationScope||ul(),s=r.getValue(lE)===!0,c=r.getValue(uE),l=r.getValue(dE),u=c||a.clone(),d={scope:u,isolationScope:l||(s?o.clone():o)},f=Uw(r,d).deleteValue(lE).deleteValue(uE).deleteValue(dE);return Ww(u,f),f}function NT(e){let t=new Map;for(let n of e)FT(t,n);return Array.from(t,function([e,t]){return t})}function PT(e){return e.attributes[ZT]===!0?void 0:Fw(e)}function FT(e,t){let n=t.spanContext().spanId,r=PT(t);if(!r){LT(e,{id:n,span:t,children:[]});return}let i=IT(e,r),a=LT(e,{id:n,span:t,parentNode:i,children:[]});i.children.push(a)}function IT(e,t){return e.get(t)||LT(e,{id:t,children:[]})}function LT(e,t){let n=e.get(t.id);return n?.span?n:n&&!n.span?(n.span=t.span,n.parentNode=t.parentNode,n):(e.set(t.id,t),t)}function RT(e){let t=Iw(e)?e.attributes:{},n=Rw(e)?e.status:void 0;if(n){if(n.code===b.OK)return{code:1};if(n.code===b.ERROR){if(n.message===void 0){let e=zT(t);if(e)return e}return n.message&&yE(n.message)?{code:2,message:n.message}:{code:2,message:`internal_error`}}}return zT(t)||(n?.code===b.UNSET?{code:1}:{code:2,message:`unknown_error`})}function zT(e){let t=e[`http.response.status_code`]||e[`http.status_code`],n=e[He],r=typeof t==`number`?t:typeof t==`string`?parseInt(t):void 0;if(typeof r==`number`)return Vl(r);if(typeof n==`string`)return{code:2,message:vE[n]||`unknown_error`}}function BT(e){let t=e.attributes;return{origin:t[K],op:t[G],source:t[_l]}}function VT(e){let{op:t,description:n,data:r,origin:i=`manual`,source:a}=UT(e),o=ql(e),s=e.attributes[vl],c={[_l]:a,[vl]:s,[G]:t,[K]:i,...r,...WT(e.attributes)},{links:l}=e,{traceId:u,spanId:d}=e.spanContext(),f={parent_span_id:Fw(e),span_id:d,trace_id:u,data:c,origin:i,op:t,status:zu(RT(e)),links:ku(l)},p=c[me],m=typeof p==`number`?{response:{status_code:p}}:void 0;return{contexts:{trace:f,otel:{resource:e.resource.attributes},...m},spans:[],start_timestamp:ju(e.startTime),timestamp:ju(e.endTime),transaction:n,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:o.scope,capturedSpanIsolationScope:o.isolationScope,sampleRate:s,dynamicSamplingContext:fd(e)},...a&&{transaction_info:{source:a}}}}function HT(e,t,n){let r=e.span;if(r&&n.add(r),!r){e.children.forEach(e=>{HT(e,t,n)});return}let i=r.spanContext().spanId,a=r.spanContext().traceId,o=Fw(r),{attributes:s,startTime:c,endTime:l,links:u}=r,{op:d,description:f,data:p,origin:m=`manual`}=UT(r),h={[K]:m,[G]:d,...WT(s),...p},g=RT(r),_={span_id:i,trace_id:a,data:h,description:f,parent_span_id:o,start_timestamp:ju(c),timestamp:ju(l)||void 0,status:zu(g),op:d,origin:m,measurements:Zd(r.events),links:ku(u)};t.push(_),e.children.forEach(e=>{HT(e,t,n)})}function UT(e){let{op:t,source:n,origin:r}=BT(e),{op:i,description:a,source:o,data:s}=Jw(e);return{op:t||i,description:a,source:n||o,origin:r,data:{...s,...GT(e)}}}function WT(e){let t={...e};return delete t[vl],delete t[ZT],delete t[jl],t}function GT(e){let t=e.attributes,n={};e.kind!==w.INTERNAL&&(n[`otel.kind`]=w[e.kind]);let r=t[Me];r&&(n[me]=r);let i=Bw(e);return i.url&&(n.url=i.url),i[`http.query`]&&(n[`http.query`]=i[`http.query`].slice(1)),i[`http.fragment`]&&(n[`http.fragment`]=i[`http.fragment`].slice(1)),n}function KT(e,t,n){let r=e.spanContext();if(x(r)&&r.traceId===t){if(r.isRemote){let t=Kw(e.spanContext());return pE&&V.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${t}`),t}let t=Kw(r);return pE&&V.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${t}`),t}}function qT({decision:e,context:t,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:i,ignoredChildSpan:a,ignoredSegmentSpan:o}){let s=JT(t,n);return i!==void 0&&(s=s.set(aE,`${i}`)),r!==void 0&&(s=s.set(iE,`${r}`)),a&&(s=s.set(oE,`1`)),o&&(s=s.set(sE,`1`)),e==null?{decision:qe.NOT_RECORD,traceState:s}:e===qe.NOT_RECORD?{decision:e,traceState:s.set(nE,`1`)}:{decision:e,traceState:s}}function JT(e,t){let n=D.getSpan(e)?.spanContext()?.traceState||new we,r=t[`http.url`]||t[`url.full`];return r&&typeof r==`string`&&(n=n.set(rE,r)),n}function YT(e){let t=D.getSpan(e);return t&&x(t.spanContext())?t:void 0}function XT(e){return new TE({[ve]:e,[Pe]:`sentry`,[fe]:So,[re]:ke[re],[Se]:ke[Se],[Be]:ke[Be]})}var ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE=n((()=>{F(),X(),T(),be(),Je(),ZT=`sentry.parentIsRemote`,QT=`sentry.graphql.operation`,$T=`sentry-trace`,eE=`baggage`,tE=`sentry.dsc`,nE=`sentry.sampled_not_recording`,rE=`sentry.url`,iE=`sentry.sample_rand`,aE=`sentry.sample_rate`,oE=`sentry.ignored`,sE=`sentry.segment_ignored`,cE=ne(`sentry_scopes`),lE=ne(`sentry_fork_isolation_scope`),uE=ne(`sentry_fork_set_scope`),dE=ne(`sentry_fork_set_isolation_scope`),fE=`_scopeContext`,pE=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,mE=new Set,hE=class extends de{constructor(){super(),iT(`SentryPropagator`),this._urlMatchesTargetsMap=new oC(100)}inject(e,t,n){if(j(e)){pE&&V.log(`[Tracing] Not injecting trace data for url because tracing is suppressed.`);return}let r=D.getSpan(e),i=r&&dT(r),{tracePropagationTargets:a,propagateTraceparent:o}=W()?.getOptions()||{};if(!Ph(i,a,this._urlMatchesTargetsMap)){pE&&V.log(`[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:`,i);return}let s=lT(t),c=uT(t),l=C.getBaggage(e)||C.createBaggage({}),{dynamicSamplingContext:u,traceId:d,spanId:f,sampled:p}=aT(e);if(s){let e=$l(s);e&&Object.entries(e).forEach(([e,t])=>{!c&&e.startsWith(`sentry-`)||(l=l.setEntry(e,{value:t}))})}!c&&u&&(l=Object.entries(u).reduce((e,[t,n])=>n?e.setEntry(`${nu}${t}`,{value:n}):e,l)),!c&&d&&d!==`00000000000000000000000000000000`&&(n.set(t,$T,yu(d,f,p)),o&&n.set(t,`traceparent`,bu(d,f,p))),super.inject(C.setBaggage(e,l),t,n)}extract(e,t,n){let r=n.get(t,$T),i=n.get(t,eE);return cT(oT(e,{sentryTrace:r?Array.isArray(r)?r[0]:r:void 0,baggage:i}))}fields(){return[$T,eE,`traceparent`]}},gE=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`],_E=class e{__init(){this._asyncLocalStorage=new Qe}__init2(){this._kOtListeners=Symbol(`OtListeners`)}__init3(){this._wrapped=!1}constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),iT(`SentryContextManager`)}active(){return this._asyncLocalStorage.getStore()??ee}with(e,t,n,...r){let i=MT(e,this.active()),a=n==null?t:t.bind(n);return this._asyncLocalStorage.run(i,a,...r)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}bind(e,t){return t instanceof _t?this._bindEventEmitter(e,t):typeof t==`function`?this._bindFunction(e,t):t}getAsyncLocalStorageLookup(){return{asyncLocalStorage:this._asyncLocalStorage,contextSymbol:cE}}_bindFunction(e,t){let n=this.with.bind(this),r=function(...r){return n(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindEventEmitter(e,t){if(this._getPatchMap(t)!==void 0)return t;this._createPatchMap(t);for(let n of gE)t[n]!==void 0&&(t[n]=this._patchAddListener(t,t[n],e));return typeof t.removeListener==`function`&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off==`function`&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners==`function`&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners)),t}_patchRemoveListener(e,t){let n=this;return function(r,i){let a=n._getPatchMap(e)?.[r];if(a===void 0)return t.call(this,r,i);let o=a.get(i);return t.call(this,r,o||i)}}_patchRemoveAllListeners(e,t){let n=this;return function(r){let i=n._getPatchMap(e);return i!==void 0&&(arguments.length===0?n._createPatchMap(e):r!==void 0&&i[r]!==void 0&&delete i[r]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let r=this;return function(i,a){if(r._wrapped)return t.call(this,i,a);let o=r._getPatchMap(e);o===void 0&&(o=r._createPatchMap(e));let s=o[i];s===void 0&&(s=new WeakMap,o[i]=s);let c=r.bind(n,a);s.set(a,c),r._wrapped=!0;try{return t.call(this,i,c)}finally{r._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}},vE={1:`cancelled`,2:`unknown_error`,3:`invalid_argument`,4:`deadline_exceeded`,5:`not_found`,6:`already_exists`,7:`permission_denied`,8:`resource_exhausted`,9:`failed_precondition`,10:`aborted`,11:`out_of_range`,12:`unimplemented`,13:`internal_error`,14:`unavailable`,15:`data_loss`,16:`unauthenticated`},yE=e=>Object.values(vE).includes(e),bE=1e3,xE=300,SE=class{constructor(e){this._finishedSpanBucketSize=e?.timeout||xE,this._finishedSpanBuckets=Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Gs()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Map,this._debouncedFlush=Lh(this.flush.bind(this),1,{maxWait:100})}export(e){let t=Math.floor(Gs()/1e3);if(this._lastCleanupTimestampInS!==t){let e=0;this._finishedSpanBuckets.forEach((n,r)=>{n&&n.timestampInS<=t-this._finishedSpanBucketSize&&(e+=n.spans.size,this._finishedSpanBuckets[r]=void 0)}),e>0&&pE&&V.log(`SpanExporter dropped ${e} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=t}let n=t%this._finishedSpanBucketSize,r=this._finishedSpanBuckets[n]||{timestampInS:t,spans:new Set};this._finishedSpanBuckets[n]=r,r.spans.add(e),this._spansToBucketEntry.set(e,r);let i=PT(e);(!i||this._sentSpans.has(i))&&this._debouncedFlush()}flush(){let e=this._finishedSpanBuckets.flatMap(e=>e?Array.from(e.spans):[]);this._flushSentSpanCache();let t=this._maybeSend(e),n=t.size,r=e.length-n;pE&&V.log(`SpanExporter exported ${n} spans, ${r} spans are waiting for their parent spans to finish`);let i=Gs()+xE*1e3;for(let e of t){this._sentSpans.set(e.spanContext().spanId,i);let t=this._spansToBucketEntry.get(e);t&&t.spans.delete(e)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(e){let t=NT(e),n=new Set,r=this._getCompletedRootNodes(t);for(let e of r){let t=e.span;n.add(t);let r=VT(t);if(e.parentNode&&this._sentSpans.has(e.parentNode.id)){let e=r.contexts?.trace?.data;e&&(e[`sentry.parent_span_already_sent`]=!0)}let i=r.spans||[];for(let t of e.children)HT(t,i,n);r.spans=i.length>bE?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,bE):i;let a=Zd(t.events);a&&(r.measurements=a),bp(r)}return n}_flushSentSpanCache(){let e=Gs();for(let[t,n]of this._sentSpans.entries())n<=e&&this._sentSpans.delete(t)}_nodeIsCompletedRootNodeOrHasSentParent(e){return!!e.span&&(!e.parentNode||this._sentSpans.has(e.parentNode.id))}_getCompletedRootNodes(e){return e.filter(e=>this._nodeIsCompletedRootNodeOrHasSentParent(e))}},CE=class{constructor(e){iT(`SentrySpanProcessor`),this._exporter=new SE(e)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(e,t){let n=D.getSpan(t),r=Hw(t);n&&!n.spanContext().isRemote&&Vu(n,e),n?.spanContext().isRemote&&e.setAttribute(ZT,!0),t===ee&&(r={scope:Lc(),isolationScope:Rc()}),r&&Kl(e,r.scope,r.isolationScope),Jd(e),W()?.emit(`spanStart`,e)}onEnd(e){Yd(e);let t=W();t?.emit(`spanEnd`,e),t&&$d(t)?t.emit(`afterSpanEnd`,e):this._exporter.export(e)}},wE=class{constructor(e){this._client=e,this._isSpanStreaming=$d(e),iT(`SentrySampler`)}shouldSample(e,t,n,r,i,a){let o=this._client.getOptions(),{ignoreSpans:s}=o,c=YT(e),l=c?.spanContext();if(!ed(o))return qT({decision:void 0,context:e,spanAttributes:i});let u=i[`http.method`]||i[`http.request.method`];if(r===w.CLIENT&&u&&(!c||l?.isRemote))return qT({decision:void 0,context:e,spanAttributes:i});let d=c?KT(c,t,n):void 0;if(!(!c||l?.isRemote)){if(this._isSpanStreaming){if(d&&s?.length){let{description:t,op:a}=qw(n,i,r);if(rd({description:t,op:i[`sentry.op`]??a},s))return this._client.recordDroppedEvent(`ignored`,`span`),qT({decision:qe.NOT_RECORD,context:e,spanAttributes:i,ignoredChildSpan:!0})}if(!d){let e=l?.traceState?.get(sE)===`1`;this._client.recordDroppedEvent(e?`ignored`:`sample_rate`,`span`)}}return qT({decision:d?qe.RECORD_AND_SAMPLED:qe.NOT_RECORD,context:e,spanAttributes:i})}let{description:f,data:p,op:m}=qw(n,i,r),h={...p,...i};if(m&&(h[G]=m),this._isSpanStreaming&&s?.length&&rd({description:f,op:h[`sentry.op`]??m},s))return this._client.recordDroppedEvent(`ignored`,`span`),qT({decision:qe.NOT_RECORD,context:e,spanAttributes:i,ignoredSegmentSpan:!0});let g={decision:!0};if(this._client.emit(`beforeSampling`,{spanAttributes:h,spanName:f,parentSampled:d,parentContext:l},g),!g.decision)return qT({decision:void 0,context:e,spanAttributes:i});let{isolationScope:_}=Hw(e)??{},v=l?.traceState?l.traceState.get(tE):void 0,y=v?Zl(v):void 0,b=hu(y?.sample_rand)??Ws(),[x,S,C]=ff(o,{name:f,attributes:h,normalizedRequest:_?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:d,parentSampleRate:hu(y?.sample_rate)},b),T=`${u}`.toUpperCase();return T===`OPTIONS`||T===`HEAD`?(pE&&V.log(`[Tracing] Not sampling span because HTTP method is '${T}' for ${n}`),qT({decision:qe.NOT_RECORD,context:e,spanAttributes:i,sampleRand:b,downstreamTraceSampleRate:0})):(!x&&d===void 0&&(pE&&V.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),this._client.recordDroppedEvent(`sample_rate`,this._isSpanStreaming?`span`:`transaction`)),{...qT({decision:x?qe.RECORD_AND_SAMPLED:qe.NOT_RECORD,context:e,spanAttributes:i,sampleRand:b,downstreamTraceSampleRate:C?S:void 0}),attributes:{[vl]:C?S:void 0}})}toString(){return`SentrySampler`}},TE=class e{constructor(e){this._attributes=e}get attributes(){return this._attributes}merge(t){return t?new e({...this._attributes,...t.attributes}):this}getRawAttributes(){return Object.entries(this._attributes)}}})),DE,OE=n((()=>{EE(),DE=_E}));function kE(){E.disable(),E.setLogger({error:V.error,warn:V.warn,info:V.log,debug:V.log,verbose:V.log},te.DEBUG)}var AE=n((()=>{T(),X()}));function jE(e,t){let n=!1,r;e.on(`spawn`,()=>{if(e.spawnfile===`/usr/bin/sw_vers`){n=!0;return}r={spawnfile:e.spawnfile},t.includeChildProcessArgs&&(r.spawnargs=e.spawnargs)}).on(`exit`,e=>{n||(n=!0,e!==null&&e!==0&&Xh({category:`child_process`,message:`Child process exited with code '${e}'`,level:e===0?`info`:`warning`,data:r}))}).on(`error`,e=>{n||(n=!0,Xh({category:`child_process`,message:`Child process errored with '${e.message}'`,level:`error`,data:r}))})}function ME(e,t){let n;e.on(`online`,()=>{n=e.threadId}).on(`error`,e=>{t.captureWorkerErrors===!1?Xh({category:`worker_thread`,message:`Worker thread errored with '${e.message}'`,level:`error`,data:{threadId:n}}):J(e,{mechanism:{type:`auto.child_process.worker_thread`,handled:!1,data:{threadId:String(n)}}})})}var NE,PE,FE=n((()=>{X(),NE=`ChildProcess`,PE=Y((e={})=>({name:NE,setup(){Ct.channel(`child_process`).subscribe(t=>{t&&typeof t==`object`&&`process`in t&&jE(t.process,e)}),Ct.channel(`worker_threads`).subscribe(t=>{t&&typeof t==`object`&&`worker`in t&&ME(t.worker,e)})}}))}));function IE(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory==`function`){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=pt.freemem()),e}async function LE(){let e=pt.platform();switch(e){case`darwin`:return HE();case`linux`:return WE();default:return{name:ZE[e]||e,version:pt.release()}}}function RE(){try{if(typeof process.versions.icu!=`string`)return;let e=new Date(9e8);if(new Intl.DateTimeFormat(`es`,{month:`long`}).format(e)===`enero`){let e=Intl.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone}}}catch{}}function zE(){let e=process.memoryUsage().rss,t={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory==`function`){let e=process.availableMemory?.();e!=null&&(t.free_memory=e)}return t}function BE(e){let t={},n;try{n=pt.uptime()}catch{}if(typeof n==`number`&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=pt.arch(),(e===!0||e.memory)&&(t.memory_size=pt.totalmem(),t.free_memory=pt.freemem()),e===!0||e.cpu){let e=pt.cpus(),n=e?.[0];n&&(t.processor_count=e.length,t.cpu_description=n.model,t.processor_frequency=n.speed)}return t}function VE(e,t){let n=e.exec(t);return n?n[1]:void 0}async function HE(){let e={kernel_version:pt.release(),name:`Mac OS X`,version:`10.${Number(pt.release().split(`.`)[0])-4}`};try{let t=await new Promise((e,t)=>{st(`/usr/bin/sw_vers`,(n,r)=>{if(n){t(n);return}e(r)})});e.name=VE(/^ProductName:\s+(.*)$/m,t),e.version=VE(/^ProductVersion:\s+(.*)$/m,t),e.build=VE(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function UE(e){return e.split(` `)[0].toLowerCase()}async function WE(){let e={kernel_version:pt.release(),name:`Linux`};try{let t=await qE(`/etc`),n=QE.find(e=>t.includes(e.name));if(!n)return e;let r=(await KE(rt(`/etc`,n.name),{encoding:`utf-8`})).toLowerCase(),{distros:i}=n;e.name=i.find(e=>r.indexOf(UE(e))>=0)||i[0],e.version=$E[UE(e.name)]?.(r)}catch{}return e}function GE(){if(process.env.VERCEL)return{"cloud.provider":`vercel`,"cloud.region":process.env.VERCEL_REGION};if(process.env.AWS_REGION)return{"cloud.provider":`aws`,"cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV};if(process.env.GCP_PROJECT)return{"cloud.provider":`gcp`};if(process.env.ALIYUN_REGION_ID)return{"cloud.provider":`alibaba_cloud`,"cloud.region":process.env.ALIYUN_REGION_ID};if(process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME)return{"cloud.provider":`azure`,"cloud.region":process.env.REGION_NAME};if(process.env.IBM_CLOUD_REGION)return{"cloud.provider":`ibm_cloud`,"cloud.region":process.env.IBM_CLOUD_REGION};if(process.env.TENCENTCLOUD_REGION)return{"cloud.provider":`tencent_cloud`,"cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE};if(process.env.NETLIFY)return{"cloud.provider":`netlify`};if(process.env.FLY_REGION)return{"cloud.provider":`fly.io`,"cloud.region":process.env.FLY_REGION};if(process.env.DYNO)return{"cloud.provider":`heroku`}}var KE,qE,JE,YE,XE,ZE,QE,$E,eD=n((()=>{X(),KE=et(ut),qE=et(ft),JE=`Context`,YE=((e={})=>{let t,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e};async function r(e){t===void 0&&(t=i());let n=IE(await t);return e.contexts={...e.contexts,app:{...n.app,...e.contexts?.app},os:{...n.os,...e.contexts?.os},device:{...n.device,...e.contexts?.device},culture:{...n.culture,...e.contexts?.culture},cloud_resource:{...n.cloud_resource,...e.contexts?.cloud_resource}},e}async function i(){let e={};if(n.os&&(e.os=await LE()),n.app&&(e.app=zE()),n.device&&(e.device=BE(n.device)),n.culture){let t=RE();t&&(e.culture=t)}return n.cloudResource&&(e.cloud_resource=GE()),e}return{name:JE,processEvent(e){return r(e)}}}),XE=Y(YE),ZE={aix:`IBM AIX`,freebsd:`FreeBSD`,openbsd:`OpenBSD`,sunos:`SunOS`,win32:`Windows`,ohos:`OpenHarmony`,android:`Android`},QE=[{name:`fedora-release`,distros:[`Fedora`]},{name:`redhat-release`,distros:[`Red Hat Linux`,`Centos`]},{name:`redhat_version`,distros:[`Red Hat Linux`]},{name:`SuSE-release`,distros:[`SUSE Linux`]},{name:`lsb-release`,distros:[`Ubuntu Linux`,`Arch Linux`]},{name:`debian_version`,distros:[`Debian`]},{name:`debian_release`,distros:[`Debian`]},{name:`arch-release`,distros:[`Arch Linux`]},{name:`gentoo-release`,distros:[`Gentoo Linux`]},{name:`novell-release`,distros:[`SUSE Linux`]},{name:`alpine-release`,distros:[`Alpine Linux`]}],$E={alpine:e=>e,arch:e=>VE(/distrib_release=(.*)/,e),centos:e=>VE(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>VE(/release (..)/,e),mint:e=>VE(/distrib_release=(.*)/,e),red:e=>VE(/release ([^ ]+)/,e),suse:e=>VE(/VERSION = (.*)\n/,e),ubuntu:e=>VE(/distrib_release=(.*)/,e)}}));function tD(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function nD(e){return!!(e.startsWith(`node:`)||e.endsWith(`.min.js`)||e.endsWith(`.min.cjs`)||e.endsWith(`.min.mjs`)||e.startsWith(`data:`))}function rD(e){return e.lineno!==void 0&&e.lineno>1e4||e.colno!==void 0&&e.colno>1e3}function iD(e,t){let n=mD.get(e);if(n===void 0)return!1;for(let e=t[0];e<=t[1];e++)if(n[e]===void 0)return!1;return!0}function aD(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!=`number`)return[];let i=pD(r,t),a=[];for(;;){if(n===e.length-1){a.push(i);break}let r=e[n+1];if(typeof r!=`number`)break;r<=i[1]?i[1]=r+t:(a.push(i),i=pD(r,t)),n++}return a}function oD(e,t,n){return new Promise((r,i)=>{let a=ct(e),o=tt({input:a});function s(){a.destroy(),r()}let c=0,l=0,u=t[l];if(u===void 0){s();return}let d=u[0],f=u[1];function p(t){hD.set(e,1),Q&&V.error(`Failed to read file: ${e}. Error: ${t}`),o.close(),o.removeAllListeners(),s()}a.on(`error`,p),o.on(`error`,p),o.on(`close`,s),o.on(`line`,e=>{if(c++,!(c<d)&&(n[c]=Ys(e,0),c>=f)){if(l===t.length-1){o.close(),o.removeAllListeners();return}l++;let e=t[l];if(e===void 0){o.close(),o.removeAllListeners();return}d=e[0],f=e[1]}})})}async function sD(e,t){let n={};if(t>0&&e.exception?.values){for(let t of e.exception.values)if(t.stacktrace?.frames?.length)for(let e=t.stacktrace.frames.length-1;e>=0;e--){let r=t.stacktrace.frames[e],i=r?.filename;!r||typeof i!=`string`||typeof r.lineno!=`number`||nD(i)||rD(r)||(n[i]||(n[i]=[]),n[i].push(r.lineno))}}let r=Object.keys(n);if(r.length==0)return e;let i=[];for(let e of r){if(hD.get(e))continue;let r=n[e];if(!r)continue;r.sort((e,t)=>e-t);let a=aD(r,t);if(a.every(t=>iD(e,t)))continue;let o=tD(mD,e,{});i.push(oD(e,a,o))}if(await Promise.all(i).catch(()=>{Q&&V.log(`Failed to read one or more source files and resolve context lines`)}),t>0&&e.exception?.values)for(let n of e.exception.values)n.stacktrace?.frames&&n.stacktrace.frames.length>0&&cD(n.stacktrace.frames,t,mD);return e}function cD(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno==`number`){let e=n.get(r.filename);if(e===void 0)continue;uD(r.lineno,r,t,e)}}function lD(e){delete e.pre_context,delete e.context_line,delete e.post_context}function uD(e,t,n,r){if(t.lineno===void 0||r===void 0){Q&&V.error(`Cannot resolve context for frame with no lineno or file contents`);return}t.pre_context=[];for(let i=dD(e,n);i<e;i++){let e=r[i];if(e===void 0){lD(t),Q&&V.error(`Could not find line ${i} in file ${t.filename}`);return}t.pre_context.push(e)}if(r[e]===void 0){lD(t),Q&&V.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let i=fD(e,n);t.post_context=[];for(let n=e+1;n<=i;n++){let e=r[n];if(e===void 0)break;t.post_context.push(e)}}function dD(e,t){return Math.max(1,e-t)}function fD(e,t){return e+t}function pD(e,t){return[dD(e,t),fD(e,t)]}var mD,hD,gD,_D,vD,yD,bD=n((()=>{X(),yC(),mD=new oC(10),hD=new oC(20),gD=7,_D=`ContextLines`,vD=((e={})=>{let t=e.frameContextLines===void 0?gD:e.frameContextLines;return{name:_D,processEvent(e){return sD(e,t)}}}),yD=Y(vD)}));async function xD(){if(SD===void 0)try{SD=!!(await import(`node:inspector`)).url()}catch{SD=!1}return SD}var SD,CD=n((()=>{}));function wD(e,t,n){let r=0,i=5,a=0;return setInterval(()=>{a===0?r>e&&(i*=2,n(i),i>86400&&(i=86400),a=i):(--a,a===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function TD(e){return e!==void 0&&(e.length===0||e===`?`||e===`<anonymous>`)}function ED(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||TD(e)&&TD(t)}var DD,OD=n((()=>{DD=`__SENTRY_ERROR_LOCAL_VARIABLES__`}));function kD(...e){V.log(`[LocalVariables]`,...e)}var AD,jD,MD=n((()=>{X(),CD(),OD(),AD=`LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjQ5LjAgKDc0NWFmNzkpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=`,jD=Y(((e={})=>{function t(t,n){let r=(t.stacktrace?.frames||[]).filter(e=>e.function!==`new Promise`);for(let t=0;t<r.length;t++){let i=r.length-t-1,a=n[t],o=r[i];if(!o||!a)break;a.vars===void 0||o.in_app===!1&&e.includeOutOfAppFrames!==!0||!ED(o.function,a.function)||(o.vars=a.vars)}}function n(e,n){if(n.originalException&&typeof n.originalException==`object`&&`__SENTRY_ERROR_LOCAL_VARIABLES__`in n.originalException&&Array.isArray(n.originalException.__SENTRY_ERROR_LOCAL_VARIABLES__)){for(let r of e.exception?.values||[])t(r,n.originalException[DD]);n.originalException[DD]=void 0}return e}async function r(){let e=await import(`node:inspector`);e.url()||e.open(0)}function i(e){let t=new Ot(new URL(`data:application/javascript;base64,${AD}`),{workerData:e,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on(`exit`,()=>{t.terminate()}),t.once(`error`,e=>{kD(`Worker error`,e)}),t.once(`exit`,e=>{kD(`Worker exit`,e)}),t.unref()}return{name:`LocalVariablesAsync`,async setup(t){if(!t.getOptions().includeLocalVariables)return;if(await xD()){V.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}let n={...e,debug:V.isEnabled()};r().then(()=>{try{i(n)}catch(e){V.error(`Failed to start worker`,e)}},e=>{V.error(`Failed to start inspector`,e)})},processEvent(e,t){return n(e,t)}}}))}));function ND(e){if(e!==void 0)return e.slice(-10).reduce((e,t)=>`${e},${t.function},${t.lineno},${t.colno}`,``)}function PD(e,t){if(t!==void 0)return ND(e(t,1))}function FD(e){let t=[],n=!1;function r(r){t=[],!n&&(n=!0,e(r))}t.push(r);function i(e){t.push(e)}function a(e){let n=t.pop()||r;try{n(e)}catch{r(e)}}return{add:i,next:a}}var ID,LD,RD,zD,BD=n((()=>{X(),gw(),CD(),OD(),ID=class e{constructor(e){this._session=e}static async create(t){return t||new e(new(await(import(`node:inspector`))).Session)}configureAndConnect(e,t){this._session.connect(),this._session.on(`Debugger.paused`,t=>{e(t,()=>{this._session.post(`Debugger.resume`)})}),this._session.post(`Debugger.enable`),this._session.post(`Debugger.setPauseOnExceptions`,{state:t?`all`:`uncaught`})}setPauseOnExceptions(e){this._session.post(`Debugger.setPauseOnExceptions`,{state:e?`all`:`uncaught`})}getLocalVariables(e,t){this._getProperties(e,e=>{let{add:n,next:r}=FD(t);for(let t of e)if(t.value?.objectId&&t.value.className===`Array`){let e=t.value.objectId;n(n=>this._unrollArray(e,t.name,n,r))}else if(t.value?.objectId&&t.value.className===`Object`){let e=t.value.objectId;n(n=>this._unrollObject(e,t.name,n,r))}else t.value&&n(e=>this._unrollOther(t,e,r));r({})})}_getProperties(e,t){this._session.post(`Runtime.getProperties`,{objectId:e,ownProperties:!0},(e,n)=>{t(e?[]:n.result)})}_unrollArray(e,t,n,r){this._getProperties(e,e=>{n[t]=e.filter(e=>e.name!==`length`&&!isNaN(parseInt(e.name,10))).sort((e,t)=>parseInt(e.name,10)-parseInt(t.name,10)).map(e=>e.value?.value),r(n)})}_unrollObject(e,t,n,r){this._getProperties(e,e=>{n[t]=e.map(e=>[e.name,e.value?.value]).reduce((e,[t,n])=>(e[t]=n,e),{}),r(n)})}_unrollOther(e,t,n){e.value&&(`value`in e.value?e.value.value===void 0||e.value.value===null?t[e.name]=`<${e.value.value}>`:t[e.name]=e.value.value:`description`in e.value&&e.value.type!==`function`?t[e.name]=`<${e.value.description}>`:e.value.type===`undefined`&&(t[e.name]=`<undefined>`)),n(t)}},LD=`LocalVariables`,RD=((e={},t)=>{let n=new oC(20),r,i=!1;function a(t){let r=ND(t.stacktrace?.frames);if(r===void 0)return;let i=n.remove(r);if(i===void 0)return;let a=(t.stacktrace?.frames||[]).filter(e=>e.function!==`new Promise`);for(let t=0;t<a.length;t++){let n=a.length-t-1,r=i[t],o=a[n];if(!o||!r)break;r.vars===void 0||o.in_app===!1&&e.includeOutOfAppFrames!==!0||!ED(o.function,r.function)||(o.vars=r.vars)}}function o(e){for(let t of e.exception?.values||[])a(t);return e}let s;async function c(){let a=W()?.getOptions();if(a?.includeLocalVariables){if(mw<18){V.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await xD()){V.warn(`Local variables capture has been disabled because the debugger was already enabled`);return}try{let o=await ID.create(t),s=(e,{params:{reason:t,data:i,callFrames:a}},s)=>{if(t!==`exception`&&t!==`promiseRejection`){s();return}r?.();let c=PD(e,i.description);if(c==null){s();return}let{add:l,next:u}=FD(e=>{n.set(c,e),s()});for(let e=0;e<Math.min(a.length,5);e++){let{scopeChain:t,functionName:n,this:r}=a[e],i=t.find(e=>e.type===`local`),s=r.className===`global`||!r.className?n:`${r.className}.${n}`;if(i?.object.objectId===void 0)l(t=>{t[e]={function:s},u(t)});else{let t=i.object.objectId;l(n=>o.getLocalVariables(t,t=>{n[e]={function:s,vars:t},u(n)}))}}u([])},c=e.captureAllExceptions!==!1;o.configureAndConnect((e,t)=>s(a.stackParser,e,t),c),c&&(r=wD(e.maxExceptionsPerSecond||50,()=>{V.log(`Local variables rate-limit lifted.`),o.setPauseOnExceptions(!0)},e=>{V.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${e} seconds.`),o.setPauseOnExceptions(!1)})),i=!0}catch(e){V.log("The `LocalVariables` integration failed to start.",e)}}}return{name:LD,setupOnce(){s=c()},async processEvent(e){return await s,i?o(e):e},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),zD=Y(RD)})),VD,HD=n((()=>{gw(),MD(),BD(),VD=(e={})=>pw.major<19?zD(e):jD(e)}));function UD(){try{return typeof module<`u`&&module.exports!==void 0}catch{return!1}}function WD(){return UD()?!1:mw>=21||mw===20&&hw>=6||mw===18&&hw>=19?!0:(GD||(GD=!0,Oo(()=>{console.warn(`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`)})),!1)}var GD,KD=n((()=>{X(),gw()}));function qD(){try{return t.cache?Object.keys(t.cache):[]}catch{return[]}}function JD(){return{...tO,...QD(),...UD()?YD():{}}}function YD(){let e=t.main?.paths||[],n=qD(),r={},i=new Set;return n.forEach(t=>{let n=t,a=()=>{let t=n;if(n=nt(t),!n||t===n||i.has(t))return;if(e.indexOf(n)<0)return a();let o=rt(t,`package.json`);if(i.add(t),!lt(o))return a();try{let e=JSON.parse(dt(o,`utf8`));r[e.name]=e.version}catch{}};a()}),r}function XD(){return $D||($D=JD()),$D}function ZD(){try{let e=rt(process.cwd(),`package.json`);return JSON.parse(dt(e,`utf8`))}catch{return{}}}function QD(){let e=ZD();return{...e.dependencies,...e.devDependencies}}var $D,eO,tO,nO,rO,iO=n((()=>{KD(),eO=`Modules`,tO=typeof __SENTRY_SERVER_MODULES__>`u`?{}:__SENTRY_SERVER_MODULES__,nO=(()=>({name:eO,processEvent(e){return e.modules={...e.modules,...XD()},e},getModules:XD})),rO=nO}));function aO(e){Oo(()=>{console.error(e)});let t=W();if(t===void 0){Q&&V.warn(`No NodeClient was defined, we are exiting the process now.`),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:oO;t.close(r).then(e=>{e||Q&&V.warn(`We reached the timeout for emptying the request buffer, still exiting now!`),global.process.exit(1)},e=>{Q&&V.error(e)})}var oO,sO=n((()=>{X(),yC(),oO=2e3}));function cO(e,t){let n=!1,r=!1,i=!1,a,o=e.getOptions();return Object.assign(s=>{let c=aO;t.onFatalError?c=t.onFatalError:o.onFatalError&&(c=o.onFatalError);let l=global.process.listeners(`uncaughtException`).filter(e=>e.name!==`domainUncaughtExceptionClear`&&e.tag!==`sentry_tracingErrorCallback`&&e._errorHandler!==!0).length===0,u=t.exitEvenIfOtherHandlersAreRegistered||l;n?u&&(i?(Q&&V.warn(`uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown`),aO(s)):r||(r=!0,setTimeout(()=>{i||(i=!0,c(a,s))},2e3))):(a=s,n=!0,W()===e&&J(s,{originalException:s,captureContext:{level:`fatal`},mechanism:{handled:!1,type:`auto.node.onuncaughtexception`}}),!i&&u&&(i=!0,c(s)))},{_errorHandler:!0})}var lO,uO,dO=n((()=>{X(),yC(),sO(),lO=`OnUncaughtException`,uO=Y((e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:lO,setup(e){kt&&global.process.on(`uncaughtException`,cO(e,t))}}})}));function fO(e){if(typeof e!=`object`||!e)return{name:``,message:String(e??``)};let t=e;return{name:typeof t.name==`string`?t.name:``,message:typeof t.message==`string`?t.message:String(e)}}function pO(e,t){let n=e.name===void 0||Zs(t.name,e.name,!0),r=e.message===void 0||Zs(t.message,e.message);return n&&r}function mO(e,t){let n=fO(t);return e.some(e=>pO(e,n))}function hO(e,t){return function(n,r){if(W()!==e||mO(t.ignore??[],n))return;let i=t.mode===`strict`?`fatal`:`error`,a=n&&typeof n==`object`?n._sentry_active_span:void 0;(a?e=>_f(a,e):e=>e())(()=>{J(n,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:i},mechanism:{handled:!1,type:`auto.node.onunhandledrejection`}})}),gO(n,t.mode)}}function gO(e,t){let n=`This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:`;t===`warn`?Oo(()=>{console.warn(n),console.error(e&&typeof e==`object`&&`stack`in e?e.stack:e)}):t===`strict`&&(Oo(()=>{console.warn(n)}),aO(e))}var _O,vO,yO,bO,xO=n((()=>{X(),sO(),_O=`OnUnhandledRejection`,vO=[{name:`AI_NoOutputGeneratedError`},{name:`AbortError`}],yO=((e={})=>{let t={mode:e.mode??`warn`,ignore:[...vO,...e.ignore??[]]};return{name:_O,setup(e){global.process.on(`unhandledRejection`,hO(e,t))}}}),bO=Y(yO)})),SO,CO,wO=n((()=>{X(),SO=`ProcessSession`,CO=Y(()=>({name:SO,setupOnce(){wp(),process.on(`beforeExit`,()=>{ul().getSession()?.status!==`ok`&&Tp()})}}))}));function TO(e,t){let n=EO(t.sidecarUrl);if(!n)return;let r=0;e.on(`beforeEnvelope`,e=>{if(r>3){V.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests`);return}let t=Nd(e);vf(()=>{let e=xt.request({method:`POST`,path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":`application/x-sentry-envelope`}},e=>{e.statusCode&&e.statusCode>=200&&e.statusCode<400&&(r=0),e.on(`data`,()=>{}),e.on(`end`,()=>{}),e.setEncoding(`utf8`)});e.on(`error`,()=>{r++,V.warn(`[Spotlight] Failed to send envelope to Spotlight Sidecar`)}),e.write(t),e.end()})})}function EO(e){try{return new URL(`${e}`)}catch{V.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var DO,OO,kO,AO=n((()=>{X(),DO=`Spotlight`,OO=((e={})=>{let t={sidecarUrl:e.sidecarUrl||`http://localhost:8969/stream`};return{name:DO,setup(e){try{V.warn(`[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?`)}catch{}TO(e,t)}}}),kO=Y(OO)}));function jO(e){return!(e instanceof Error)||!(`errno`in e)||typeof e.errno!=`number`?!1:$e.getSystemErrorMap().has(e.errno)}var MO,NO,PO=n((()=>{X(),MO=`NodeSystemError`,NO=Y((e={})=>({name:MO,processEvent:(t,n,r)=>{if(!jO(n.originalException))return t;let i=n.originalException,a={...i};!r.getOptions().sendDefaultPii&&e.includePaths!==!0&&(delete a.path,delete a.dest),t.contexts={...t.contexts,node_system_error:a};for(let e of t.exception?.values||[])e.value&&(i.path&&e.value.includes(i.path)&&(e.value=e.value.replace(`'${i.path}'`,``).trim()),i.dest&&e.value.includes(i.dest)&&(e.value=e.value.replace(`'${i.dest}'`,``).trim()));return t}}))})),FO,IO,LO=n((()=>{FO=Symbol(`AgentBaseInternalState`),IO=class extends xt.Agent{constructor(e){super(e),this[FO]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==`boolean`)return e.secureEndpoint;if(typeof e.protocol==`string`)return e.protocol===`https:`}let{stack:t}=Error();return typeof t==`string`?t.split(`
|
|
8
|
+
`).some(e=>e.indexOf(`(https.js:`)!==-1||e.indexOf(`node:https:`)!==-1):!1}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)};Promise.resolve().then(()=>this.connect(e,r)).then(i=>{if(i instanceof xt.Agent)return i.addRequest(e,r);this[FO].currentSocket=i,super.createSocket(e,t,n)},n)}createConnection(){let e=this[FO].currentSocket;if(this[FO].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[FO].defaultPort??(this.protocol===`https:`?443:80)}set defaultPort(e){this[FO]&&(this[FO].defaultPort=e)}get protocol(){return this[FO].protocol??(this.isSecureEndpoint()?`https:`:`http:`)}set protocol(e){this[FO]&&(this[FO].protocol=e)}}}));function RO(...e){V.log(`[https-proxy-agent:parse-proxy-response]`,...e)}function zO(e){return new Promise((t,n)=>{let r=0,i=[];function a(){let t=e.read();t?l(t):e.once(`readable`,a)}function o(){e.removeListener(`end`,s),e.removeListener(`error`,c),e.removeListener(`readable`,a)}function s(){o(),RO(`onend`),n(Error(`Proxy connection ended before receiving CONNECT response`))}function c(e){o(),RO(`onerror %o`,e),n(e)}function l(s){i.push(s),r+=s.length;let c=Buffer.concat(i,r),l=c.indexOf(`\r
|
|
9
|
+
\r
|
|
10
|
+
`);if(l===-1){RO(`have not received end of HTTP headers yet...`),a();return}let u=c.subarray(0,l).toString(`ascii`).split(`\r
|
|
11
|
+
`),d=u.shift();if(!d)return e.destroy(),n(Error(`No header received from proxy CONNECT response`));let f=d.split(` `),p=+(f[1]||0),m=f.slice(2).join(` `),h={};for(let t of u){if(!t)continue;let r=t.indexOf(`:`);if(r===-1)return e.destroy(),n(Error(`Invalid header from proxy CONNECT response: "${t}"`));let i=t.slice(0,r).toLowerCase(),a=t.slice(r+1).trimStart(),o=h[i];typeof o==`string`?h[i]=[o,a]:Array.isArray(o)?o.push(a):h[i]=a}RO(`got proxy server response: %o %o`,d,h),o(),t({connect:{statusCode:p,statusText:m,headers:h},buffered:c})}e.on(`error`,c),e.on(`end`,s),a()})}var BO=n((()=>{X()}));function VO(...e){V.log(`[https-proxy-agent]`,...e)}function HO(e){e.resume()}function UO(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var WO,GO=n((()=>{X(),LO(),BO(),WO=class extends IO{static __initStatic(){this.protocols=[`http`,`https`]}constructor(e,t){super(t),this.options={},this.proxy=typeof e==`string`?new URL(e):e,this.proxyHeaders=t?.headers??{},VO(`Creating new HttpsProxyAgent instance: %o`,this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,``),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol===`https:`?443:80;this.connectOpts={ALPNProtocols:[`http/1.1`],...t?UO(t,`headers`):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw TypeError(`No "host" provided`);let r;if(n.protocol===`https:`){VO("Creating `tls.Socket`: %o",this.connectOpts);let e=this.connectOpts.servername||this.connectOpts.host;r=Dt.connect({...this.connectOpts,servername:e&&Et.isIP(e)?void 0:e})}else VO("Creating `net.Socket`: %o",this.connectOpts),r=Et.connect(this.connectOpts);let i=typeof this.proxyHeaders==`function`?this.proxyHeaders():{...this.proxyHeaders},a=Et.isIPv6(t.host)?`[${t.host}]`:t.host,o=`CONNECT ${a}:${t.port} HTTP/1.1\r\n`;if(n.username||n.password){let e=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;i[`Proxy-Authorization`]=`Basic ${Buffer.from(e).toString(`base64`)}`}i.Host=`${a}:${t.port}`,i[`Proxy-Connection`]||(i[`Proxy-Connection`]=this.keepAlive?`Keep-Alive`:`close`);for(let e of Object.keys(i))o+=`${e}: ${i[e]}\r\n`;let s=zO(r);r.write(`${o}\r\n`);let{connect:c,buffered:l}=await s;if(e.emit(`proxyConnect`,c),this.emit(`proxyConnect`,c,e),c.statusCode===200){if(e.once(`socket`,HO),t.secureEndpoint){VO(`Upgrading socket connection to TLS`);let e=t.servername||t.host;return Dt.connect({...UO(t,`host`,`path`,`port`),socket:r,servername:Et.isIP(e)?void 0:e})}return r}r.destroy();let u=new Et.Socket({writable:!1});return u.readable=!0,e.once(`socket`,e=>{VO(`Replaying proxy buffer for failed request`),e.push(l),e.push(null)}),u}},WO.__initStatic()}));function KO(e){return new yt({read(){this.push(e),this.push(null)}})}function qO(e){let t;try{t=new URL(e.url)}catch{return Oo(()=>{console.warn(`[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.`)}),pm(e,()=>Promise.resolve({}))}let n=t.protocol===`https:`,r=JO(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),i=n?bt:xt,a=e.keepAlive===void 0?!1:e.keepAlive,o=r?new WO(r):new i.Agent({keepAlive:a,maxSockets:30,timeout:2e3});return pm(e,YO(e,e.httpModule??i,o))}function JO(e,t){let{no_proxy:n}=process.env;if(!n?.split(`,`).some(t=>e.host.endsWith(t)||e.hostname.endsWith(t)))return t}function YO(e,t,n){let{hostname:r,pathname:i,port:a,protocol:o,search:s}=new URL(e.url);return function(c){return new Promise((l,u)=>{vf(()=>{let d=KO(c.body),f={...e.headers};c.body.length>XO&&(f[`content-encoding`]=`gzip`,d=d.pipe(St()));let p=r.startsWith(`[`),m=t.request({method:`POST`,agent:n,headers:f,hostname:p?r.slice(1,-1):r,path:`${i}${s}`,port:a,protocol:o,ca:e.caCerts},e=>{e.on(`data`,()=>{}),e.on(`end`,()=>{}),e.setEncoding(`utf8`);let t=e.headers[`retry-after`]??null,n=e.headers[`x-sentry-rate-limits`]??null;l({statusCode:e.statusCode,headers:{"retry-after":t,"x-sentry-rate-limits":Array.isArray(n)?n[0]||null:n}})});m.on(`error`,u),d.pipe(m)})})}}var XO,ZO=n((()=>{X(),GO(),XO=1024*32}));function QO(e){if(e===!1)return!1;if(typeof e==`string`)return e;let t=ph(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}var $O=n((()=>{X()}));function ek(e){return e.replace(/^[A-Z]:/,``).replace(/\\/g,`/`)}function tk(e=process.argv[1]?M_(process.argv[1]):process.cwd(),t=at===`\\`){let n=t?ek(e):e;return e=>{if(!e)return;let r=t?ek(e):e,{dir:i,base:a,ext:o}=it.parse(r);(o===`.js`||o===`.mjs`||o===`.cjs`)&&(a=a.slice(0,o.length*-1));let s=decodeURIComponent(a);i||(i=`.`);let c=i.lastIndexOf(`/node_modules`);if(c>-1)return`${i.slice(c+14).replace(/\//g,`.`)}:${s}`;if(i.startsWith(n)){let e=i.slice(n.length+1).replace(/\//g,`.`);return e?`${e}:${s}`:s}return s}}var nk=n((()=>{X()}));function rk(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(B.SENTRY_RELEASE?.id)return B.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||n||r||e}var ik,ak=n((()=>{X(),nk(),ik=Bo(nC(tk()))})),ok,sk,ck=n((()=>{T(),L(),X(),EE(),yC(),ok=6e4,sk=class extends oh{constructor(e){let t=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||pt.hostname(),n={...e,platform:`node`,runtime:e.runtime||{name:`node`,version:global.process.version},serverName:t};e.openTelemetryInstrumentations&&Fi({instrumentations:e.openTelemetryInstrumentations}),Oh(n,`node`),V.log(`Initializing Sentry: process: ${process.pid}, thread: ${kt?`main`:`worker-${At}`}.`),super(n),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Gp(this)},t&&this.on(`beforeCaptureLog`,e=>{e.attributes={...e.attributes,"server.address":t}}),process.on(`beforeExit`,this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e=So,t=D.getTracer(`@sentry/node`,e);return this._tracer=t,t}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}async close(e){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off(`beforeExit`,this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off(`beforeExit`,this._logOnExitFlushListener);let t=await super.close(e);return this.traceProvider&&await this.traceProvider.shutdown(),t}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{Q&&V.log(`Flushing client reports based on interval.`),this._flushOutcomes()},e.clientReportFlushInterval??ok).unref(),process.on(`beforeExit`,this._clientReportOnExitFlushListener))}_setupIntegrations(){uh(),super._setupIntegrations()}_getTraceInfoFromScope(e){return e?ET(this,e):[void 0,void 0]}}}));function lk(){if(WD()&&!B._sentryEsmLoaderHookRegistered){B._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:e}=(0,uk.createAddHookMessageChannel)();mt.register(`import-in-the-middle/hook.mjs`,import.meta.url,{data:{addHookMessagePort:e,include:[]},transferList:[e]})}catch(e){V.warn(`Failed to register 'import-in-the-middle' hook`,e)}}}var uk,dk=n((()=>{X(),uk=Ga(),KD()}));function fk(){return[_g(),rg(),kg(),Ug(),NO(),iv(),ev(),dw(),Nw(),uO(),bO(),yD(),VD(),XE(),PE(),CO(),rO()]}function pk(e={}){return mk(e,fk)}function mk(e={},t){let n=gk(e,t);n.debug===!0&&(Q?V.enable():Oo(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&lk(),jT(),U().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:e})=>e===`Spotlight`)&&n.integrations.push(kO({sidecarUrl:typeof n.spotlight==`string`?n.spotlight:void 0})),Oh(n,`node-core`);let r=new sk(n);return U().setClient(r),r.init(),V.log(`SDK initialized from ${UD()?`CommonJS`:`ESM`}`),r.startClientReportTracking(),yk(),eT(r),kT(r),process.env.VERCEL&&process.on(`SIGTERM`,async()=>{await r.flush(200)}),r}function hk(){if(!Q)return;let e=rT(),t=[`SentryContextManager`,`SentryPropagator`];ed()&&t.push(`SentrySpanProcessor`);for(let n of t)e.includes(n)||V.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);e.includes(`SentrySampler`)||V.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function gk(e,t){let n=_k(e.release),r=QO(e.spotlight),i=vk(e.tracesSampleRate),a={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??qO,stackParser:Vo(e.stackParser||ik),release:n,tracesSampleRate:i,spotlight:r,debug:ph(e.debug??process.env.SENTRY_DEBUG)},o=e.integrations,s=Pp({defaultIntegrations:e.defaultIntegrations??t(a),integrations:o});return a.traceLifecycle===`stream`&&!s.some(e=>e.name===`SpanStreaming`)&&s.push(JS()),{...a,integrations:s}}function _k(e){if(e!==void 0)return e;let t=rk();if(t!==void 0)return t}function vk(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let n=parseFloat(t);return isFinite(n)?n:void 0}function yk(){if(ph(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=vu(e,t);U().setPropagationContext(n)}}var bk=n((()=>{X(),EE(),yC(),FE(),eD(),bD(),fw(),HD(),iO(),Pw(),dO(),xO(),wO(),AO(),PO(),ZO(),KD(),$O(),ak(),ck(),dk()}));function xk(e,t){e.setAttribute(K,t)}var Sk=n((()=>{X()}));function Ck(e){let t=e.protocol||``,n=e.hostname||e.host||``;return`${t}//${n}${!e.port||e.port===80||e.port===443||/^(.*):(\d+)$/.test(n)?``:`:${e.port}`}${e.path?e.path:`/`}`}var wk=n((()=>{})),$=n((()=>{fw(),KC(),PC(),cw(),Pw(),Aw(),OE(),AE(),vC(),bk(),EE(),ck(),L(),X(),KD(),wO(),gw(),CD(),eD(),bD(),HD(),iO(),dO(),xO(),AO(),PO(),FE(),yC(),ak(),nk(),Sk(),wk(),dk(),ZO()}));function Tk(e,t={}){return typeof e.spans==`boolean`?e.spans:!(t.skipOpenTelemetrySetup||!ed(t)&&Ak)}function Ek(e={}){return{disableOutgoingRequestInstrumentation:Ak,ignoreOutgoingRequestHook:t=>{let n=Ck(t);if(!n)return!1;let r=e.ignoreOutgoingRequests;return!!r?.(n,t)},requireParentforOutgoingSpans:!1,requestHook:(t,n)=>{xk(t,`auto.http.otel.http`);let r=Ck(n);if(r.startsWith(`data:`)){let e=Th(r);t.setAttribute(`http.url`,e),t.setAttribute(Rl,e),t.updateName(`${n.method||`GET`} ${e}`)}e.instrumentation?.requestHook?.(t,n)},responseHook:(t,n)=>{e.instrumentation?.responseHook?.(t,n)},applyCustomAttributesOnSpan:(t,n,r)=>{e.instrumentation?.applyCustomAttributesOnSpan?.(t,n,r)}}}var Dk,Ok,kk,Ak,jk,Mk,Nk,Pk=n((()=>{T(),Dk=bo(),X(),$(),Ok=`Http`,kk=`@opentelemetry_sentry-patched/instrumentation-http`,Ak=pw.major===22&&pw.minor>=12||pw.major===23&&pw.minor>=2||pw.major>=24,jk=Z(`${Ok}.sentry`,e=>new sw(e)),Mk=Z(Ok,e=>{let t=new Dk.HttpInstrumentation({...e,disableIncomingRequestInstrumentation:!0});try{t._diag=E.createComponentLogger({namespace:kk}),t.instrumentationName=kk}catch{}try{let e={get:()=>!1,set:()=>{}};Object.defineProperty(t,`_httpPatched`,e),Object.defineProperty(t,`_httpsPatched`,e)}catch{}return t}),Nk=Y((e={})=>{let t=e.spans??!0,n=e.disableIncomingRequestSpans,r={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},i={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes,instrumentation:e.instrumentation,onSpanCreated:e.incomingRequestSpanHook},a=NC(r),o=GC(i),s=t&&!n;return{name:Ok,setup(e){let t=e.getOptions();s&&ed(t)&&o.setup(e)},setupOnce(){let t=Tk(e,W()?.getOptions()||{});a.setupOnce(),jk({breadcrumbs:e.breadcrumbs,propagateTraceInOutgoingRequests:typeof e.tracePropagation==`boolean`?e.tracePropagation:Ak||!t,createSpansForOutgoingRequests:Ak,spans:e.spans,ignoreOutgoingRequests:e.ignoreOutgoingRequests,outgoingRequestHook:(t,n)=>{let r=Ck(n);if(r.startsWith(`data:`)){let e=Th(r);t.setAttribute(`http.url`,e),t.setAttribute(Rl,e),t.updateName(`${n.method||`GET`} ${e}`)}e.instrumentation?.requestHook?.(t,n)},outgoingResponseHook:e.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:e.instrumentation?.applyCustomAttributesOnSpan}),t&&Mk(Ek(e))},processEvent(e){return o.processEvent(e)}}})})),Fk=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.24.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-undici`})),Ik=i((n=>{a(),Object.defineProperty(n,`__esModule`,{value:!0}),n.UndiciInstrumentation=void 0;var r=t(`diagnostics_channel`),i=t(`url`),s=(L(),e(I)),c=(T(),e(k)),l=(fi(),e(ui)),u=(F(),e(A)),d=Fk();n.UndiciInstrumentation=class extends s.InstrumentationBase{constructor(e={}){super(d.PACKAGE_NAME,d.PACKAGE_VERSION,e),o(this,`_recordFromReq`,new WeakMap)}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs.length=0}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this.subscribeToChannel(`undici:request:create`,this.onRequestCreated.bind(this)),this.subscribeToChannel(`undici:client:sendHeaders`,this.onRequestHeaders.bind(this)),this.subscribeToChannel(`undici:request:headers`,this.onResponseHeaders.bind(this)),this.subscribeToChannel(`undici:request:trailers`,this.onDone.bind(this)),this.subscribeToChannel(`undici:request:error`,this.onError.bind(this)))}_updateMetricInstruments(){this._httpClientDurationHistogram=this.meter.createHistogram(u.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:`Measures the duration of outbound HTTP requests.`,unit:`s`,valueType:c.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}subscribeToChannel(e,t){let[n,i]=process.version.replace(`v`,``).split(`.`).map(e=>Number(e)),a=n>18||n===18&&i>=19,o;if(a)r.subscribe?.(e,t),o=()=>r.unsubscribe?.(e,t);else{let n=r.channel(e);n.subscribe(t),o=()=>n.unsubscribe(t)}this._channelSubs.push({name:e,unsubscribe:o})}parseRequestHeaders(e){let t=new Map;if(Array.isArray(e.headers))for(let n=0;n<e.headers.length;n+=2){let r=e.headers[n],i=e.headers[n+1];typeof r==`string`&&t.set(r.toLowerCase(),i)}else if(typeof e.headers==`string`){let n=e.headers.split(`\r
|
|
12
|
+
`);for(let e of n){if(!e)continue;let n=e.indexOf(`:`);if(n===-1)continue;let r=e.substring(0,n).toLowerCase(),i=e.substring(n+1).trim(),a=t.get(r);a&&Array.isArray(a)?a.push(i):a?t.set(r,[a,i]):t.set(r,i)}}return t}onRequestCreated({request:e}){let t=this.getConfig(),n=t.enabled!==!1;if((0,s.safeExecuteInTheMiddle)(()=>!n||e.method===`CONNECT`||t.ignoreRequestHook?.(e),e=>e&&this._diag.error(`caught ignoreRequestHook error: `,e),!0))return;let r=(0,l.hrTime)(),a;try{a=new i.URL(e.path,e.origin)}catch(e){this._diag.warn(`could not determine url.full:`,e);return}let o=a.protocol.replace(`:`,``),d=this.getRequestMethod(e.method),f={[u.ATTR_HTTP_REQUEST_METHOD]:d,[u.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:e.method,[u.ATTR_URL_FULL]:a.toString(),[u.ATTR_URL_PATH]:a.pathname,[u.ATTR_URL_QUERY]:a.search,[u.ATTR_URL_SCHEME]:o},p={https:`443`,http:`80`},m=a.hostname,h=a.port||p[o];f[u.ATTR_SERVER_ADDRESS]=m,h&&!isNaN(Number(h))&&(f[u.ATTR_SERVER_PORT]=Number(h));let g=this.parseRequestHeaders(e).get(`user-agent`);if(g){let e=Array.isArray(g)?g[g.length-1]:g;f[u.ATTR_USER_AGENT_ORIGINAL]=e}let _=(0,s.safeExecuteInTheMiddle)(()=>t.startSpanHook?.(e),e=>e&&this._diag.error(`caught startSpanHook error: `,e),!0);_&&Object.entries(_).forEach(([e,t])=>{f[e]=t});let v=c.context.active(),y=c.trace.getSpan(v),b;b=t.requireParentforSpans&&(!y||!c.trace.isSpanContextValid(y.spanContext()))?c.trace.wrapSpanContext(c.INVALID_SPAN_CONTEXT):this.tracer.startSpan(d===`_OTHER`?`HTTP`:d,{kind:c.SpanKind.CLIENT,attributes:f},v),(0,s.safeExecuteInTheMiddle)(()=>t.requestHook?.(b,e),e=>e&&this._diag.error(`caught requestHook error: `,e),!0);let x=c.trace.setSpan(c.context.active(),b),S={};c.propagation.inject(x,S);let C=Object.entries(S);for(let t=0;t<C.length;t++){let[n,r]=C[t];typeof e.addHeader==`function`?e.addHeader(n,r):typeof e.headers==`string`?e.headers+=`${n}: ${r}\r\n`:Array.isArray(e.headers)&&e.headers.push(n,r)}this._recordFromReq.set(e,{span:b,attributes:f,startTime:r})}onRequestHeaders({request:e,socket:t}){let n=this._recordFromReq.get(e);if(!n)return;let r=this.getConfig(),{span:i}=n,{remoteAddress:a,remotePort:o}=t,s={[u.ATTR_NETWORK_PEER_ADDRESS]:a,[u.ATTR_NETWORK_PEER_PORT]:o};if(r.headersToSpanAttributes?.requestHeaders){let t=new Set(r.headersToSpanAttributes.requestHeaders.map(e=>e.toLowerCase())),n=this.parseRequestHeaders(e);for(let[e,r]of n.entries())if(t.has(e)){let t=Array.isArray(r)?r:[r];s[`http.request.header.${e}`]=t}}i.setAttributes(s)}onResponseHeaders({request:e,response:t}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:i}=n,a={[u.ATTR_HTTP_RESPONSE_STATUS_CODE]:t.statusCode},o=this.getConfig();if((0,s.safeExecuteInTheMiddle)(()=>o.responseHook?.(r,{request:e,response:t}),e=>e&&this._diag.error(`caught responseHook error: `,e),!0),o.headersToSpanAttributes?.responseHeaders){let e=new Set;o.headersToSpanAttributes?.responseHeaders.forEach(t=>e.add(t.toLowerCase()));for(let n=0;n<t.headers.length;n+=2){let r=t.headers[n].toString().toLowerCase(),i=t.headers[n+1];if(e.has(r)){let e=`http.response.header.${r}`;Object.hasOwn(a,e)?a[e].push(i.toString()):a[e]=[i.toString()]}}}r.setAttributes(a),r.setStatus({code:t.statusCode>=400?c.SpanStatusCode.ERROR:c.SpanStatusCode.UNSET}),n.attributes=Object.assign(i,a)}onDone({request:e}){let t=this._recordFromReq.get(e);if(!t)return;let{span:n,attributes:r,startTime:i}=t;n.end(),this._recordFromReq.delete(e),this.recordRequestDuration(r,i)}onError({request:e,error:t}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:i,startTime:a}=n;r.recordException(t),r.setStatus({code:c.SpanStatusCode.ERROR,message:t.message}),r.end(),this._recordFromReq.delete(e),i[u.ATTR_ERROR_TYPE]=t.message,this.recordRequestDuration(i,a)}recordRequestDuration(e,t){let n={};[u.ATTR_HTTP_RESPONSE_STATUS_CODE,u.ATTR_HTTP_REQUEST_METHOD,u.ATTR_SERVER_ADDRESS,u.ATTR_SERVER_PORT,u.ATTR_URL_SCHEME,u.ATTR_ERROR_TYPE].forEach(t=>{t in e&&(n[t]=e[t])});let r=(0,l.hrTimeToMilliseconds)((0,l.hrTimeDuration)(t,(0,l.hrTime)()))/1e3;this._httpClientDurationHistogram.record(r,n)}getRequestMethod(e){return e.toUpperCase()in{CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0}?e.toUpperCase():`_OTHER`}}})),Lk=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.UndiciInstrumentation=void 0;var t=Ik();Object.defineProperty(e,`UndiciInstrumentation`,{enumerable:!0,get:function(){return t.UndiciInstrumentation}})}));function Rk(e,t=`/`){let n=`${e}`;return n.endsWith(`/`)&&t.startsWith(`/`)?`${n}${t.slice(1)}`:!n.endsWith(`/`)&&!t.startsWith(`/`)?`${n}/${t}`:`${n}${t}`}function zk(e,t={}){return typeof e.spans==`boolean`?e.spans:!t.skipOpenTelemetrySetup&&ed(t)}function Bk(e={}){return{requireParentforSpans:!1,ignoreRequestHook:t=>{let n=Rk(t.origin,t.path),r=e.ignoreOutgoingRequests;return!!(r&&n&&r(n))},startSpanHook:e=>{let t=Rk(e.origin,e.path);if(t.startsWith(`data:`)){let n=Th(t);return{[K]:`auto.http.otel.node_fetch`,"http.url":n,[Rl]:n,[jl]:`${e.method||`GET`} ${n}`}}return{[K]:`auto.http.otel.node_fetch`}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var Vk,Hk,Uk,Wk,Gk,Kk,qk=n((()=>{Vk=Lk(),X(),$(),Hk=`NodeFetch`,Uk=Z(Hk,Vk.UndiciInstrumentation,e=>Bk(e)),Wk=Z(`${Hk}.sentry`,kw,e=>e),Gk=((e={})=>({name:`NodeFetch`,setupOnce(){zk(e,W()?.getOptions())&&Uk(e),Wk(e)}})),Kk=Y(Gk)})),Jk,Yk=n((()=>{Jk=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__})),Xk,Zk,Qk,$k,eA,tA,nA=n((()=>{L(),T(),be(),$(),X(),Yk(),Xk=`Express`,Zk=[`>=4.0.0 <6`],Qk=Z(Xk,e=>new $k(e)),$k=class extends $a{constructor(e={}){super(`sentry-express`,So,e)}init(){return new io(`express`,Zk,e=>{try{D_(e,()=>({...this.getConfig(),onRouteResolved(e){let t=je(O.active());e&&t?.type===Fe.HTTP&&(t.route=e)}}))}catch(e){Jk&&V.error(`Failed to patch express module:`,e)}return e},e=>e)}},eA=(e=>({name:Xk,setupOnce(){Qk(e)}})),tA=Y(eA)})),rA,iA,aA=n((()=>{rA=class{emit(e){}},iA=new rA}));function oA(e,t,n){return r=>r===e?t:n}var sA,cA,lA=n((()=>{sA=Symbol.for(`io.opentelemetry.js.api.logs`),cA=globalThis})),uA,dA,fA=n((()=>{aA(),uA=class{getLogger(e,t,n){return new rA}},dA=new uA})),pA,mA=n((()=>{aA(),pA=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):iA}}})),hA,gA=n((()=>{fA(),mA(),hA=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new pA(this,e,t,n)}_getDelegate(){return this._delegate??dA}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),_A,vA=n((()=>{lA(),fA(),gA(),_A=class e{constructor(){this._proxyLoggerProvider=new hA}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return cA[sA]?this.getLoggerProvider():(cA[sA]=oA(1,e,dA),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return cA[sA]?.call(cA,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete cA[sA],this._proxyLoggerProvider=new hA}}})),yA,bA=n((()=>{aA(),vA(),yA=_A.getInstance()}));function xA(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function SA(e){e.forEach(e=>e.disable())}var CA=n((()=>{}));function wA(e){let t=e.tracerProvider||D.getTracerProvider(),n=e.meterProvider||v.getMeterProvider(),r=e.loggerProvider||yA.getLoggerProvider(),i=e.instrumentations?.flat()??[];return xA(i,t,n,r),()=>{SA(i)}}var TA=n((()=>{T(),bA(),CA()}));function EA(e,t,n){if(!DA(e))return E.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,`$1`);let r=PA(e);if(!r)return!1;let i=[],a=OA(r,t,i,n);return a&&!n?.includePrerelease?jA(r,i):a}function DA(e){return typeof e==`string`&&GA.test(e)}function OA(e,t,n,r){if(t.includes(`||`)){let i=t.trim().split(`||`);for(let t of i)if(kA(e,t,n,r))return!0;return!1}else if(t.includes(` - `))t=WA(t,r);else if(t.includes(` `)){let i=t.trim().replace(/\s{2,}/g,` `).split(` `);for(let t of i)if(!kA(e,t,n,r))return!1;return!0}return kA(e,t,n,r)}function kA(e,t,n,r){if(t=MA(t,r),t.includes(` `))return OA(e,t,n,r);{let r=FA(t);return n.push(r),AA(e,r)}}function AA(e,t){if(t.invalid)return!1;if(!t.version||IA(t.version))return!0;let n=BA(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],i=t.prereleaseSegments||[];n=!r.length&&!i.length?0:!r.length&&i.length?1:r.length&&!i.length?-1:BA(r,i)}return qA[t.op]?.includes(n)}function jA(e,t){return e.prerelease?t.some(t=>t.prerelease&&t.version===e.version):!0}function MA(e,t){return e=e.trim(),e=HA(e,t),e=VA(e),e=UA(e,t),e=e.trim(),e}function NA(e){return!e||e.toLowerCase()===`x`||e===`*`}function PA(e){let t=e.match(GA);if(!t){E.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,i=t.groups.build,a=n.split(`.`),o=r?.split(`.`);return{op:void 0,version:n,versionSegments:a,versionSegmentCount:a.length,prerelease:r,prereleaseSegments:o,prereleaseSegmentCount:o?o.length:0,build:i}}function FA(e){if(!e)return{};let t=e.match(KA);if(!t)return E.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,i=t.groups.prerelease,a=t.groups.build,o=r.split(`.`),s=i?.split(`.`);return n===`==`&&(n=`=`),{op:n||`=`,version:r,versionSegments:o,versionSegmentCount:o.length,prerelease:i,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:a}}function IA(e){return e===`*`||e===`x`||e===`X`}function LA(e){let t=parseInt(e,10);return isNaN(t)?e:t}function RA(e,t){if(typeof e==typeof t){if(typeof e==`number`||typeof e==`string`)return[e,t];throw Error(`Version segments can only be strings or numbers`)}else return[String(e),String(t)]}function zA(e,t){if(IA(e)||IA(t))return 0;let[n,r]=RA(LA(e),LA(t));return n>r?1:n<r?-1:0}function BA(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=zA(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0}function VA(e){let t=lj;return e.replace(t,(e,t,n,r,i)=>{let a;return a=NA(t)?``:NA(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:NA(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,a})}function HA(e,t){let n=dj,r=t?.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>{let o;return o=NA(t)?``:NA(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:NA(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i}-${a} <${+t+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i}${r} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i} <${+t+1}.0.0-0`,o})}function UA(e,t){let n=aj;return e.replace(n,(e,n,r,i,a,o)=>{let s=NA(r),c=s||NA(i),l=c||NA(a),u=l;return n===`=`&&u&&(n=``),o=t?.includePrerelease?`-0`:``,s?e=n===`>`||n===`<`?`<0.0.0-0`:`*`:n&&u?(c&&(i=0),a=0,n===`>`?(n=`>=`,c?(r=+r+1,i=0,a=0):(i=+i+1,a=0)):n===`<=`&&(n=`<`,c?r=+r+1:i=+i+1),n===`<`&&(o=`-0`),e=`${n+r}.${i}.${a}${o}`):c?e=`>=${r}.0.0${o} <${+r+1}.0.0-0`:l&&(e=`>=${r}.${i}.0${o} <${r}.${+i+1}.0-0`),e})}function WA(e,t){let n=sj;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>(n=NA(r)?``:NA(i)?`>=${r}.0.0${t?.includePrerelease?`-0`:``}`:NA(a)?`>=${r}.${i}.0${t?.includePrerelease?`-0`:``}`:o?`>=${n}`:`>=${n}${t?.includePrerelease?`-0`:``}`,c=NA(l)?``:NA(u)?`<${+l+1}.0.0-0`:NA(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t?.includePrerelease?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()))}var GA,KA,qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj,ij,aj,oj,sj,cj,lj,uj,dj,fj=n((()=>{T(),GA=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,KA=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,qA={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},JA=`[a-zA-Z0-9-]`,YA=`0|[1-9]\\d*`,XA=`\\d*[a-zA-Z-]${JA}*`,ZA=`((?:<|>)?=?)`,QA=`(?:${YA}|${XA})`,$A=`(?:-(${QA}(?:\\.${QA})*))`,ej=`${JA}+`,tj=`(?:\\+(${ej}(?:\\.${ej})*))`,nj=`${YA}|x|X|\\*`,rj=`[v=\\s]*(${nj})(?:\\.(${nj})(?:\\.(${nj})(?:${$A})?${tj}?)?)?`,ij=`^${ZA}\\s*${rj}$`,aj=new RegExp(ij),oj=`^\\s*(${rj})\\s+-\\s+(${rj})\\s*$`,sj=new RegExp(oj),cj=`^(?:~>?)${rj}$`,lj=new RegExp(cj),uj=`^(?:\\^)${rj}$`,dj=new RegExp(uj)}));function pj(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function mj(e){e&&e.logger&&(typeof e.logger==`function`?hj=e.logger:hj(`new logger isn't a function, not replacing`))}var hj,gj,_j,vj,yj,bj=n((()=>{hj=console.error.bind(console),gj=(e,t,n)=>{if(!e||!e[t]){hj(`no original function `+String(t)+` to wrap`);return}if(!n){hj(`no wrapper function`),hj(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){hj(`original object and wrapper must be functions`);return}let i=n(r,t);return pj(i,`__original`,r),pj(i,`__unwrap`,()=>{e[t]===i&&pj(e,t,r)}),pj(i,`__wrapped`,!0),pj(e,t,i),i},_j=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{hj(`must provide one or more modules to patch`),hj(Error().stack);return}if(!(t&&Array.isArray(t))){hj(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{gj(e,t,n)})})},vj=(e,t)=>{if(!e||!e[t]){hj(`no function to unwrap.`),hj(Error().stack);return}let n=e[t];if(!n.__unwrap)hj(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},yj=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{hj(`must provide one or more modules to patch`),hj(Error().stack);return}if(!(t&&Array.isArray(t))){hj(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{vj(e,t)})})},mj.wrap=gj,mj.massWrap=_j,mj.unwrap=vj,mj.massUnwrap=yj})),xj,Sj=n((()=>{T(),bA(),bj(),a(),xj=class{constructor(e,t,n){o(this,`_config`,{}),o(this,`_tracer`,void 0),o(this,`_meter`,void 0),o(this,`_logger`,void 0),o(this,`_diag`,void 0),o(this,`instrumentationName`,void 0),o(this,`instrumentationVersion`,void 0),o(this,`_wrap`,gj),o(this,`_unwrap`,vj),o(this,`_massWrap`,_j),o(this,`_massUnwrap`,yj),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=E.createComponentLogger({namespace:e}),this._tracer=D.getTracer(e,t),this._meter=v.getMeter(e,t),this._logger=yA.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}}})),Cj,wj,Tj=n((()=>{a(),Cj=class{constructor(){o(this,`hooks`,[]),o(this,`children`,new Map)}},wj=class{constructor(){o(this,`_trie`,new Cj),o(this,`_counter`,0)}insert(e){let t=this._trie;for(let n of e.moduleName.split(`/`)){let e=t.children.get(n);e||(e=new Cj,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie,i=[],a=!0;for(let t of e.split(`/`)){let e=r.children.get(t);if(!e){a=!1;break}n||i.push(...e.hooks),r=e}return n&&a&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(t&&i.sort((e,t)=>e.insertedId-t.insertedId),i.map(({hook:e})=>e))}}}));function Ej(e){return Ye.sep===`/`?e:e.split(Ye.sep).join(`/`)}var Dj,Oj,kj,Aj=n((()=>{Dj=Fa(),Tj(),a(),Oj=[`afterEach`,`after`,`beforeEach`,`before`,`describe`,`it`].every(e=>typeof global[e]==`function`),kj=class e{constructor(){o(this,`_moduleNameTrie`,new wj),this._initialize()}_initialize(){new Dj.Hook(null,{internals:!0},(e,t,n)=>{let r=Ej(t),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:r}of i)e=r(e,t,n);return e})}register(e,t){let n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return Oj?new e:this._instance=this._instance??new e}},o(kj,`_instance`,void 0)})),jj=i((e=>{var t=[],n=new WeakMap,r=new WeakMap,i=new Map,a=[],o={set(e,t,r){let i=n.get(e),a=i&&i[t];return typeof a==`function`?a(r):!0},get(e,t){if(t===Symbol.toStringTag)return`Module`;let n=r.get(e)[t];if(typeof n==`function`)return n()},defineProperty(e,t,r){if(!(`value`in r))throw Error(`Getters/setters are not supported for exports property descriptors.`);let i=n.get(e),a=i&&i[t];return typeof a==`function`?a(r.value):!0}};function s(e,s,c,l,u){i.set(e,u),n.set(s,c),r.set(s,l);let d=new Proxy(s,o);t.forEach(t=>t(e,d,u)),a.push([e,d,u])}e.register=s,e.importHooks=t,e.specifiers=i,e.toHook=a})),Mj=i(((e,n)=>{var r=t(`path`),i=Pa(),{fileURLToPath:a}=t(`url`),{MessageChannel:o}=t(`worker_threads`),{isBuiltin:s}=t(`module`);s||(s=()=>!0);var{importHooks:c,specifiers:l,toHook:u}=jj();function d(e){c.push(e),u.forEach(([t,n,r])=>e(t,n,r))}function f(e){let t=c.indexOf(e);t>-1&&c.splice(t,1)}function p(e,t,n,r){let i=e(t,n,r);i&&i!==t&&`default`in t&&(t.default=i)}var m;function h(){let{port1:e,port2:t}=new o,n=0,r;m=t=>{n++,e.postMessage(t)},e.on(`message`,()=>{n--,r&&n<=0&&r()}).unref();function i(){let e=setInterval(()=>{},1e3),t=new Promise(e=>{r=e}).then(()=>{clearInterval(e)});return n===0&&r(),t}let a=t;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:i}}function g(e,t,n){if(!(this instanceof g))return new g(e,t,n);typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null);let o=t?t.internals===!0:!1;m&&Array.isArray(e)&&m(e),this._iitmHook=(t,c,u)=>{let d=t,f=d.startsWith(`node:`),m,h;if(f){let e=t.slice(5);s(e)&&(t=e)}else if(d.startsWith(`file://`)){let e=Error.stackTraceLimit;Error.stackTraceLimit=0;try{m=a(t),t=m}catch{}if(Error.stackTraceLimit=e,m){let e=i(m);e&&(t=e.name,h=e.basedir)}}if(e)for(let i of e)if(m&&i===m)p(n,c,m,void 0);else if(i===t){if(!h)p(n,c,t,h);else if(h.endsWith(l.get(d)))p(n,c,t,h);else if(o){let e=t+r.sep+r.relative(h,m);p(n,c,e,h)}}else i===u&&p(n,c,u,h);else p(n,c,t,h)},d(this._iitmHook)}g.prototype.unhook=function(){f(this._iitmHook)},n.exports=g,n.exports.Hook=g,n.exports.addHook=d,n.exports.removeHook=f,n.exports.createAddHookMessageChannel=h}));function Nj(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}async function Pj(e,t,n){let r,i;try{i=await e()}catch(e){r=e}finally{if(await t(r,i),r&&!n)throw r;return i}}function Fj(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var Ij=n((()=>{}));function Lj(e,t,n){return t===void 0?e.includes(`*`):e.some(e=>EA(t,e,{includePrerelease:n}))}var Rj,zj,Bj,Vj=n((()=>{fj(),bj(),Sj(),Aj(),Rj=Mj(),T(),zj=Fa(),Ij(),a(),Bj=class extends xj{constructor(e,t,n){super(e,t,n),o(this,`_modules`,void 0),o(this,`_hooks`,[]),o(this,`_requireInTheMiddleSingleton`,kj.getInstance()),o(this,`_enabled`,!1),o(this,`_wrap`,(e,t,n)=>{if(Fj(e[t])&&this._unwrap(e,t),gt.isProxy(e)){let r=gj(Object.assign({},e),t,n);return Object.defineProperty(e,t,{value:r}),r}else return gj(e,t,n)}),o(this,`_unwrap`,(e,t)=>gt.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):vj(e,t)),o(this,`_massWrap`,(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{E.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){E.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})})}),o(this,`_massUnwrap`,(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{E.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){E.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})})});let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let e=t.resolve(n);t.cache[e]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let t=ot(Ye.join(e,`package.json`),{encoding:`utf8`}),n=JSON.parse(t).version;return typeof n==`string`?n:void 0}catch{E.warn(`Failed extracting version`,e)}}_onRequire(e,t,n,r){if(!r)return typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for nodejs core module on require hook`,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(r);if(e.moduleVersion=i,e.name===n)return Lj(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for module on require hook`,{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;let a=e.files??[],o=Ye.normalize(n);return a.filter(t=>t.name===o&&Lj(t.supportedVersions,i,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug(`Applying instrumentation patch for nodejs module file on require hook`,{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch==`function`&&e.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module on instrumentation enabled`,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module file on instrumentation enabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(t,n,r)=>{if(!r&&Ye.isAbsolute(n)){let e=Ye.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=Ye.isAbsolute(e.name)?new zj.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);let i=new Rj.Hook([e.name],{internals:!0},t);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==`function`&&e.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module on instrumentation disabled`,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module file on instrumentation disabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}})),Hj=n((()=>{})),Uj=n((()=>{Vj(),Hj()})),Wj=n((()=>{Uj()})),Gj,Kj=n((()=>{a(),Gj=class{constructor(e,t,n,r,i){o(this,`files`,void 0),o(this,`name`,void 0),o(this,`supportedVersions`,void 0),o(this,`patch`,void 0),o(this,`unpatch`,void 0),this.files=i||[],this.name=e,this.supportedVersions=t,this.patch=n,this.unpatch=r}}})),qj,Jj=n((()=>{Wj(),a(),qj=class{constructor(e,t,n,r){o(this,`name`,void 0),o(this,`supportedVersions`,void 0),o(this,`patch`,void 0),o(this,`unpatch`,void 0),this.name=Xe(e),this.supportedVersions=t,this.patch=n,this.unpatch=r}}}));function Yj(e,t){let n=Xj.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=Xj.DUPLICATE;break}else t.toLowerCase()===e&&(n=Xj.STABLE);return n}var Xj,Zj=n((()=>{(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(Xj||(Xj={}))})),Qj=r({InstrumentationBase:()=>Bj,InstrumentationNodeModuleDefinition:()=>Gj,InstrumentationNodeModuleFile:()=>qj,SemconvStability:()=>Xj,isWrapped:()=>Fj,registerInstrumentations:()=>wA,safeExecuteInTheMiddle:()=>Nj,safeExecuteInTheMiddleAsync:()=>Pj,semconvStabilityFromStr:()=>Yj}),$j=n((()=>{TA(),Wj(),Kj(),Jj(),Ij(),Zj()})),eM=r({author:()=>uM,bugs:()=>dM,default:()=>vM,dependencies:()=>hM,description:()=>rM,devDependencies:()=>mM,funding:()=>pM,homepage:()=>fM,keywords:()=>lM,license:()=>`MIT`,main:()=>iM,name:()=>tM,peerDependencies:()=>gM,repository:()=>cM,scripts:()=>sM,tsd:()=>_M,type:()=>aM,types:()=>oM,version:()=>nM}),tM,nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM=n((()=>{tM=`@fastify/otel`,nM=`0.18.0`,rM=`Official Fastify OpenTelemetry Instrumentation`,iM=`index.js`,aM=`commonjs`,oM=`types/index.d.ts`,sM={lint:`eslint`,"lint:fix":`eslint --fix`,test:`npm run test:all && npm run test:typescript`,"test:unit":`c8 --100 node --test`,"test:all":`npm run test:v4 && npm run test:v5`,"test:v4":`cross-env FASTIFY_VERSION=fastifyv4 npm run test:unit`,"test:v5":`cross-env FASTIFY_VERSION=fastify npm run test:unit`,"test:coverage":`c8 node --test && c8 report --reporter=html`,"test:typescript":`tsd`},cM={type:`git`,url:`git+https://github.com/fastify/otel.git`},lM=[`plugin`,`helper`,`fastify`,`instrumentation`,`otel`,`opentelemetry`],uM=`Carlos Fuentes - @metcoder95 (https://metcoder.dev)`,dM={url:`https://github.com/fastify/otel/issues`},fM=`https://github.com/fastify/otel#readme`,pM=[{type:`github`,url:`https://github.com/sponsors/fastify`},{type:`opencollective`,url:`https://opencollective.com/fastify`}],mM={"@fastify/type-provider-typebox":`^6.1.0`,"@opentelemetry/context-async-hooks":`^2.0.0`,"@opentelemetry/contrib-test-utils":`^0.59.0`,"@opentelemetry/instrumentation-http":`^0.212.0`,"@opentelemetry/propagator-jaeger":`^2.0.0`,"@opentelemetry/sdk-trace-base":`^2.0.0`,"@opentelemetry/sdk-trace-node":`^2.2.0`,"@types/node":`^25.0.3`,c8:`^11.0.0`,"cross-env":`^10.0.0`,eslint:`^9.16.0`,fastify:`^5.1.0`,"fastify-plugin":`^5.1.0`,fastifyv4:`npm:fastify@^4.0.0`,neostandard:`^0.12.0`,tsd:`^0.33.0`},hM={"@opentelemetry/core":`^2.0.0`,"@opentelemetry/instrumentation":`^0.212.0`,"@opentelemetry/semantic-conventions":`^1.28.0`,minimatch:`^10.2.4`},gM={"@opentelemetry/api":`^1.9.0`},_M={directory:`types`},vM={name:tM,version:nM,description:rM,main:iM,type:aM,types:oM,scripts:sM,repository:cM,keywords:lM,author:uM,license:`MIT`,bugs:dM,homepage:fM,funding:pM,devDependencies:mM,dependencies:hM,peerDependencies:gM,tsd:_M}})),bM=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.range=e.balanced=void 0,e.balanced=(n,r,i)=>{let a=n instanceof RegExp?t(n,i):n,o=r instanceof RegExp?t(r,i):r,s=a!==null&&o!=null&&(0,e.range)(a,o,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+a.length,s[1]),post:i.slice(s[1]+o.length)}};var t=(e,t)=>{let n=t.match(e);return n?n[0]:null};e.range=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s}})),xM=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EXPANSION_MAX=void 0,e.expand=x;var t=bM(),n=`\0SLASH`+Math.random()+`\0`,r=`\0OPEN`+Math.random()+`\0`,i=`\0CLOSE`+Math.random()+`\0`,a=`\0COMMA`+Math.random()+`\0`,o=`\0PERIOD`+Math.random()+`\0`,s=new RegExp(n,`g`),c=new RegExp(r,`g`),l=new RegExp(i,`g`),u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=/\\\\/g,p=/\\{/g,m=/\\}/g,h=/\\,/g,g=/\\\./g;e.EXPANSION_MAX=1e5;function _(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function v(e){return e.replace(f,n).replace(p,r).replace(m,i).replace(h,a).replace(g,o)}function y(e){return e.replace(s,`\\`).replace(c,`{`).replace(l,`}`).replace(u,`,`).replace(d,`.`)}function b(e){if(!e)return[``];let n=[],r=(0,t.balanced)(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=b(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),n.push.apply(n,s),n}function x(t,n={}){if(!t)return[];let{max:r=e.EXPANSION_MAX}=n;return t.slice(0,2)===`{}`&&(t=`\\{\\}`+t.slice(2)),E(v(t),r,!0).map(y)}function S(e){return`{`+e+`}`}function C(e){return/^-?0\d/.test(e)}function w(e,t){return e<=t}function T(e,t){return e>=t}function E(e,n,r){let a=[],o=(0,t.balanced)(`{`,`}`,e);if(!o)return[e];let s=o.pre,c=o.post.length?E(o.post,n,!1):[``];if(/\$$/.test(o.pre))for(let e=0;e<c.length&&e<n;e++){let t=s+`{`+o.body+`}`+c[e];a.push(t)}else{let t=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),u=t||l,d=o.body.indexOf(`,`)>=0;if(!u&&!d)return o.post.match(/,(?!,).*\}/)?(e=o.pre+`{`+o.body+i+o.post,E(e,n,!0)):[e];let f;if(u)f=o.body.split(/\.\./);else if(f=b(o.body),f.length===1&&f[0]!==void 0&&(f=E(f[0],n,!1).map(S),f.length===1))return c.map(e=>o.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=_(f[0]),t=_(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.max(Math.abs(_(f[2])),1):1,i=w;t<e&&(r*=-1,i=T);let a=f.some(C);p=[];for(let o=e;i(o,t);o+=r){let e;if(l)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e<f.length;e++)p.push.apply(p,E(f[e],n,!1))}for(let e=0;e<p.length;e++)for(let t=0;t<c.length&&a.length<n;t++){let n=s+p[e]+c[t];(!r||u||n)&&a.push(n)}}return a}})),SM=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertValidPattern=void 0;var t=1024*64;e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>t)throw TypeError(`pattern is too long`)}})),CM=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseClass=void 0;var t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;WHILE:for(;l<e.length;){let r=e.charAt(l);if((r===`!`||r===`^`)&&l===o+1){p=!0,l++;continue}if(r===`]`&&u&&!f){m=l+1;break}if(u=!0,r===`\\`&&!f){f=!0,l++;continue}if(r===`[`&&!f){for(let[n,[r,i,a]]of Object.entries(t))if(e.startsWith(n,l)){if(h)return[`$.`,!1,e.length-o,!0];l+=n.length,a?c.push(r):s.push(r),d=d||i;continue WHILE}}if(f=!1,h){r>h?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m<l)return[``,!1,0,!1];if(!s.length&&!c.length)return[`$.`,!1,e.length-o,!0];if(c.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!p)return[r(s[0].length===2?s[0].slice(-1):s[0]),!1,m-o,!1];let g=`[`+(p?`^`:``)+i(s)+`]`,_=`[`+(p?``:`^`)+i(c)+`]`;return[s.length&&c.length?`(`+g+`|`+_+`)`:s.length?g:_,d,m-o,!0]}})),wM=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`)})),TM=i((e=>{g(),a(),c(),l(),d(),f();var t,n,r;Object.defineProperty(e,`__esModule`,{value:!0}),e.AST=void 0;var i=CM(),_=wM(),v=new Set([`!`,`?`,`+`,`*`,`@`]),y=e=>v.has(e),b=e=>y(e.type),x=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),S=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),C=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),w=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),T=`(?!(?:^|/)\\.\\.?(?:$|/))`,E=`(?!\\.)`,D=new Set([`[`,`.`]),O=new Set([`..`,`.`]),k=new Set(`().*{}+?[]^$\\!`),ee=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),te=`[^/]`,ne=te+`*?`,re=te+`+?`,A=0,j=new WeakMap,ie=new WeakMap,ae=new WeakMap,M=new WeakMap,N=new WeakMap,oe=new WeakMap,se=new WeakMap,ce=new WeakMap,le=new WeakMap,ue=new WeakMap,de=new WeakMap,P=new WeakSet;n=Symbol.for(`nodejs.util.inspect.custom`);var fe=class e{get depth(){return(p(N,this)?.depth??-1)+1}[n](){return{"@@type":`AST`,id:this.id,type:this.type,root:p(j,this).id,parent:p(N,this)?.id,depth:this.depth,partsLength:p(M,this).length,parts:p(M,this)}}constructor(e,t,n={}){u(this,P),o(this,`type`,void 0),m(this,j,void 0),m(this,ie,void 0),m(this,ae,!1),m(this,M,[]),m(this,N,void 0),m(this,oe,void 0),m(this,se,void 0),m(this,ce,!1),m(this,le,void 0),m(this,ue,void 0),m(this,de,!1),o(this,`id`,++A),this.type=e,e&&h(ie,this,!0),h(N,this,t),h(j,this,p(N,this)?p(j,p(N,this)):this),h(le,this,p(j,this)===this?n:p(le,p(j,this))),h(se,this,p(j,this)===this?[]:p(se,p(j,this))),e===`!`&&!p(ce,p(j,this))&&p(se,this).push(this),h(oe,this,p(N,this)?p(M,p(N,this)).length:0)}get hasMagic(){if(p(ie,this)!==void 0)return p(ie,this);for(let e of p(M,this))if(typeof e!=`string`&&(e.type||e.hasMagic))return h(ie,this,!0);return p(ie,this)}toString(){return p(ue,this)===void 0?this.type?h(ue,this,this.type+`(`+p(M,this).map(e=>String(e)).join(`|`)+`)`):h(ue,this,p(M,this).map(e=>String(e)).join(``)):p(ue,this)}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof r&&p(N,t)===this))throw Error(`invalid part: `+t);p(M,this).push(t)}}toJSON(){let e=this.type===null?p(M,this).slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...p(M,this).map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===p(j,this)||p(ce,p(j,this))&&p(N,this)?.type===`!`)&&e.push({}),e}isStart(){if(p(j,this)===this)return!0;if(!p(N,this)?.isStart())return!1;if(p(oe,this)===0)return!0;let e=p(N,this);for(let t=0;t<p(oe,this);t++){let n=p(M,e)[t];if(!(n instanceof r&&n.type===`!`))return!1}return!0}isEnd(){if(p(j,this)===this||p(N,this)?.type===`!`)return!0;if(!p(N,this)?.isEnd())return!1;if(!this.type)return p(N,this)?.isEnd();let e=p(N,this)?p(M,p(N,this)).length:0;return p(oe,this)===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new r(this.type,e);for(let e of p(M,this))t.copyIn(e);return t}static fromGlob(t,n={}){let i=new r(null,void 0,n);return s(e,r,me).call(r,t,i,0,n,0),i}toMMPattern(){if(this!==p(j,this))return p(j,this).toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||p(ie,this)||p(le,this).nocase&&!p(le,this).nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(p(le,this).nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return p(le,this)}toRegExpSource(t){let n=t??!!p(le,this).dot;if(p(j,this)===this&&(s(P,this,Ce).call(this),s(P,this,pe).call(this)),!b(this)){let i=this.isStart()&&this.isEnd()&&!p(M,this).some(e=>typeof e!=`string`),a=p(M,this).map(n=>{let[a,o,c,l]=typeof n==`string`?s(e,r,Te).call(r,n,p(ie,this),i):n.toRegExpSource(t);return h(ie,this,p(ie,this)||c),h(ae,this,p(ae,this)||l),a}).join(``),o=``;if(this.isStart()&&typeof p(M,this)[0]==`string`&&!(p(M,this).length===1&&O.has(p(M,this)[0]))){let e=D,r=n&&e.has(a.charAt(0))||a.startsWith(`\\.`)&&e.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&e.has(a.charAt(4)),i=!n&&!t&&e.has(a.charAt(0));o=r?T:i?E:``}let c=``;return this.isEnd()&&p(ce,p(j,this))&&p(N,this)?.type===`!`&&(c=`(?:$|\\/)`),[o+a+c,(0,_.unescape)(a),h(ie,this,!!p(ie,this)),p(ae,this)]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,o=s(P,this,we).call(this,n);if(this.isStart()&&this.isEnd()&&!o&&this.type!==`!`){let e=this.toString(),t=this;return h(M,t,[e]),t.type=null,h(ie,t,void 0),[e,(0,_.unescape)(this.toString()),!1,!1]}let c=!i||t||n?``:s(P,this,we).call(this,!0);c===o&&(c=``),c&&(o=`(?:${o})(?:${c})*?`);let l=``;if(this.type===`!`&&p(de,this))l=(this.isStart()&&!n?E:``)+re;else{let e=this.type===`!`?`))`+(this.isStart()&&!n&&!t?E:``)+ne+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&c?`)`:this.type===`*`&&c?`)?`:`)${this.type}`;l=a+o+e}return[l,(0,_.unescape)(o),h(ie,this,!!p(ie,this)),p(ae,this)]}};t=fe;function pe(){if(this!==p(j,this))throw Error(`should only call on root`);if(p(ce,this))return this;this.toString(),h(ce,this,!0);let e;for(;e=p(se,this).pop();){if(e.type!==`!`)continue;let t=e,n=p(N,t);for(;n;){for(let r=p(oe,t)+1;!n.type&&r<p(M,n).length;r++)for(let t of p(M,e)){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(p(M,n)[r])}t=n,n=p(N,t)}}return this}function me(e,n,i,a,o){let c=a.maxExtglobRecursion??2,l=!1,u=!1,d=-1,f=!1;if(n.type===null){let p=i,m=``;for(;p<e.length;){let i=e.charAt(p++);if(l||i===`\\`){l=!l,m+=i;continue}if(u){p===d+1?(i===`^`||i===`!`)&&(f=!0):i===`]`&&!(p===d+2&&f)&&(u=!1),m+=i;continue}else if(i===`[`){u=!0,d=p,f=!1,m+=i;continue}if(!a.noext&&y(i)&&e.charAt(p)===`(`&&o<=c){n.push(m),m=``;let c=new r(i,n);p=s(t,r,me).call(r,e,c,p,a,o+1),n.push(c);continue}m+=i}return n.push(m),p}let m=i+1,g=new r(null,n),_=[],v=``;for(;m<e.length;){let i=e.charAt(m++);if(l||i===`\\`){l=!l,v+=i;continue}if(u){m===d+1?(i===`^`||i===`!`)&&(f=!0):i===`]`&&!(m===d+2&&f)&&(u=!1),v+=i;continue}else if(i===`[`){u=!0,d=m,f=!1,v+=i;continue}if(!a.noext&&y(i)&&e.charAt(m)===`(`&&(o<=c||n&&s(P,n,_e).call(n,i))){let c=n&&s(P,n,_e).call(n,i)?0:1;g.push(v),v=``;let l=new r(i,g);g.push(l),m=s(t,r,me).call(r,e,l,m,a,o+c);continue}if(i===`|`){g.push(v),v=``,_.push(g),g=new r(null,n);continue}if(i===`)`)return v===``&&p(M,n).length===0&&h(de,n,!0),g.push(v),v=``,n.push(..._,g),m;v+=i}return n.type=null,h(ie,n,void 0),h(M,n,[e.substring(i-1)]),m}function he(e){return s(P,this,ge).call(this,e,S)}function ge(e,t=x){if(!e||typeof e!=`object`||e.type!==null||p(M,e).length!==1||this.type===null)return!1;let n=p(M,e)[0];return!n||typeof n!=`object`||n.type===null?!1:s(P,this,_e).call(this,n.type,t)}function _e(e,t=C){return!!t.get(this.type)?.includes(e)}function ve(e,t){let n=p(M,e)[0],i=new r(null,n,this.options);p(M,i).push(``),n.push(i),s(P,this,ye).call(this,e,t)}function ye(e,t){let n=p(M,e)[0];p(M,this).splice(t,1,...p(M,n));for(let e of p(M,n))typeof e==`object`&&h(N,e,this);h(ue,this,void 0)}function be(e){return!!w.get(this.type)?.has(e)}function xe(e){if(!e||typeof e!=`object`||e.type!==null||p(M,e).length!==1||this.type===null||p(M,this).length!==1)return!1;let t=p(M,e)[0];return!t||typeof t!=`object`||t.type===null?!1:s(P,this,be).call(this,t.type)}function Se(e){let t=w.get(this.type),n=p(M,e)[0],r=t?.get(n.type);if(!r)return!1;h(M,this,p(M,n));for(let e of p(M,this))typeof e==`object`&&h(N,e,this);this.type=r,h(ue,this,void 0),h(de,this,!1)}function Ce(){if(b(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<p(M,this).length;e++){let n=p(M,this)[e];typeof n==`object`&&(s(P,n,Ce).call(n),s(P,this,ge).call(this,n)?(t=!1,s(P,this,ye).call(this,n,e)):s(P,this,he).call(this,n)?(t=!1,s(P,this,ve).call(this,n,e)):s(P,this,xe).call(this,n)&&(t=!1,s(P,this,Se).call(this,n)))}}while(!t&&++e<10)}else for(let e of p(M,this))typeof e==`object`&&s(P,e,Ce).call(e);h(ue,this,void 0)}function we(e){return p(M,this).map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return h(ae,this,p(ae,this)||a),n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}function Te(e,t,n=!1){let r=!1,a=``,o=!1,s=!1;for(let c=0;c<e.length;c++){let l=e.charAt(c);if(r){r=!1,a+=(k.has(l)?`\\`:``)+l;continue}if(l===`*`){if(s)continue;s=!0,a+=n&&/^[*]+$/.test(e)?re:ne,t=!0;continue}else s=!1;if(l===`\\`){c===e.length-1?a+=`\\\\`:r=!0;continue}if(l===`[`){let[n,r,s,l]=(0,i.parseClass)(e,c);if(s){a+=n,o=o||r,c+=s-1,t=t||l;continue}}if(l===`?`){a+=te,t=!0;continue}a+=ee(l)}return[a,(0,_.unescape)(e),!!t,o]}e.AST=fe,r=fe})),EM=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)})),DM=i((e=>{g(),a(),f(),Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;var t=xM(),n=SM(),r=TM(),i=EM(),c=wM();e.minimatch=(e,t,r={})=>((0,n.assertValidPattern)(t),!r.nocomment&&t.charAt(0)===`#`?!1:new se(t,r).match(e));var l=/^\*+([^+@!?*[(]*)$/,d=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),p=e=>t=>t.endsWith(e),m=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),h=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),_=/^\*+\.\*+$/,v=e=>!e.startsWith(`.`)&&e.includes(`.`),y=e=>e!==`.`&&e!==`..`&&e.includes(`.`),b=/^\.\*+$/,x=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),S=/^\*+$/,C=e=>e.length!==0&&!e.startsWith(`.`),w=e=>e.length!==0&&e!==`.`&&e!==`..`,T=/^\?+([^+@!?*[(]*)?$/,E=([e,t=``])=>{let n=ee([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},D=([e,t=``])=>{let n=te([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},O=([e,t=``])=>{let n=te([e]);return t?e=>n(e)&&e.endsWith(t):n},k=([e,t=``])=>{let n=ee([e]);return t?e=>n(e)&&e.endsWith(t):n},ee=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},te=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},ne=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,re={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=ne===`win32`?re.win32.sep:re.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR;var A=`[^/]*?`,j=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,ie=`(?:(?!(?:\\/|^)\\.).)*?`;e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;var ae=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,ae(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,ae(t,n))}static defaults(e){return n.defaults(ae(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,ae(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,ae(t,r))}},unescape:(e,r={})=>n.unescape(e,ae(t,r)),escape:(e,r={})=>n.escape(e,ae(t,r)),filter:(e,r={})=>n.filter(e,ae(t,r)),defaults:e=>n.defaults(ae(t,e)),makeRe:(e,r={})=>n.makeRe(e,ae(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,ae(t,r)),match:(e,r,i={})=>n.match(e,r,ae(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,r={})=>((0,n.assertValidPattern)(e),r.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,t.expand)(e,{max:r.braceExpandMax})),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new se(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new se(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;var M=/[?*]|[+@!]\(.*?\)|\[|\]/,N=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),oe=new WeakSet,se=class{constructor(e,t={}){u(this,oe),o(this,`options`,void 0),o(this,`set`,void 0),o(this,`pattern`,void 0),o(this,`windowsPathsNoEscape`,void 0),o(this,`nonegate`,void 0),o(this,`negate`,void 0),o(this,`comment`,void 0),o(this,`empty`,void 0),o(this,`preserveMultipleSlashes`,void 0),o(this,`partial`,void 0),o(this,`globSet`,void 0),o(this,`globParts`,void 0),o(this,`nocase`,void 0),o(this,`isWindows`,void 0),o(this,`platform`,void 0),o(this,`windowsNoMagicRoot`,void 0),o(this,`maxGlobstarRecursion`,void 0),o(this,`regexp`,void 0),(0,n.assertValidPattern)(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||ne,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!M.test(e[2]))&&!M.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(t,n,r=!1){let i=0,a=0;if(this.isWindows){let e=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),r=!e&&t[0]===``&&t[1]===``&&t[2]===`?`&&/^[a-z]:$/i.test(t[3]),o=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),s=!o&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),c=r?3:e?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[e,r]=[t[c],n[l]];e.toLowerCase()===r.toLowerCase()&&(n[l]=e,a=l,i=c)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(e.GLOBSTAR)?s(oe,this,ce).call(this,t,n,r,i,a):s(oe,this,ue).call(this,t,n,r,i,a)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,n.assertValidPattern)(t);let i=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let a,o=null;(a=t.match(S))?o=i.dot?w:C:(a=t.match(l))?o=(i.nocase?i.dot?h:m:i.dot?p:d)(a[1]):(a=t.match(T))?o=(i.nocase?i.dot?D:E:i.dot?O:k)(a):(a=t.match(_))?o=i.dot?y:v:(a=t.match(b))&&(o=x);let s=r.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof s==`object`&&Reflect.defineProperty(s,`test`,{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?A:n.dot?j:ie,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?N(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|\\/`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))});let a=n.filter(t=>t!==e.GLOBSTAR);if(this.partial&&a.length>=1){let e=[];for(let t=1;t<=a.length;t++)e.push(a.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return a.join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.partial&&(a=`^(?:\\/|`+o+a.slice(1,-1)+s+`)$`),this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};function ce(t,n,r,i,a){let o=n.indexOf(e.GLOBSTAR,a),c=n.lastIndexOf(e.GLOBSTAR),[l,u,d]=r?[n.slice(a,o),n.slice(o+1),[]]:[n.slice(a,o),n.slice(o+1,c),n.slice(c+1)];if(l.length){let e=t.slice(i,i+l.length);if(!s(oe,this,ue).call(this,e,l,r,0,0))return!1;i+=l.length,a+=l.length}let f=0;if(d.length){if(d.length+i>t.length)return!1;let e=t.length-d.length;if(s(oe,this,ue).call(this,t,d,r,e,0))f=d.length;else{if(t[t.length-1]!==``||i+d.length===t.length||(e--,!s(oe,this,ue).call(this,t,d,r,e,0)))return!1;f=d.length+1}}if(!u.length){let e=!!f;for(let n=i;n<t.length-f;n++){let r=String(t[n]);if(e=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return r||e}let p=[[[],0]],m=p[0],h=0,g=[0];for(let t of u)t===e.GLOBSTAR?(g.push(h),m=[[],0],p.push(m)):(m[0].push(t),h++);let _=p.length-1,v=t.length-f;for(let e of p)e[1]=v-(g[_--]+e[0].length);return!!s(oe,this,le).call(this,t,p,i,0,r,0,!!f)}function le(e,t,n,r,i,a,o){let c=t[r];if(!c){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[l,u]=c;for(;n<=u;){if(s(oe,this,ue).call(this,e.slice(0,n+l.length),l,i,n,0)&&a<this.maxGlobstarRecursion){let c=s(oe,this,le).call(this,e,t,n+l.length,r+1,i,a+1,o);if(c!==!1)return c}let c=e[n];if(c===`.`||c===`..`||!this.options.dot&&c.startsWith(`.`))return!1;n++}return i||null}function ue(t,n,r,i,a){let o,s,c,l;for(o=i,s=a,l=t.length,c=n.length;o<l&&s<c;o++,s++){this.debug(`matchOne loop`);let r=n[s],i=t[o];if(this.debug(n,r,i),r===!1||r===e.GLOBSTAR)return!1;let a;if(typeof r==`string`?(a=i===r,this.debug(`string match`,r,i,a)):(a=r.test(i),this.debug(`pattern match`,r,i,a)),!a)return!1}if(o===l&&s===c)return!0;if(o===l)return r;if(s===c)return o===l-1&&t[o]===``;throw Error(`wtf?`)}e.Minimatch=se;var de=TM();Object.defineProperty(e,`AST`,{enumerable:!0,get:function(){return de.AST}});var P=EM();Object.defineProperty(e,`escape`,{enumerable:!0,get:function(){return P.escape}});var fe=wM();Object.defineProperty(e,`unescape`,{enumerable:!0,get:function(){return fe.unescape}}),e.minimatch.AST=r.AST,e.minimatch.Minimatch=se,e.minimatch.escape=i.escape,e.minimatch.unescape=c.unescape})),OM=i(((n,r)=>{a();var i=t(`node:diagnostics_channel`),{context:s,trace:c,SpanStatusCode:l,propagation:u,diag:d}=(T(),e(k)),{getRPCMetadata:f,RPCType:p}=(fi(),e(ui)),{ATTR_HTTP_ROUTE:m,ATTR_HTTP_RESPONSE_STATUS_CODE:h,ATTR_HTTP_REQUEST_METHOD:g,ATTR_URL_PATH:_}=(F(),e(A)),{InstrumentationBase:v}=($j(),e(Qj)),{version:y,name:b}=(yM(),e(eM).default),x=`>=4.0.0 <6`,S=[`onRequest`,`preParsing`,`preValidation`,`preHandler`,`preSerialization`,`onSend`,`onResponse`,`onError`],C={HOOK_NAME:`hook.name`,FASTIFY_TYPE:`fastify.type`,HOOK_CALLBACK_NAME:`hook.callback.name`,ROOT:`fastify.root`},w={ROUTE:`route-hook`,INSTANCE:`hook`,HANDLER:`request-handler`},E=`anonymous`,D=Symbol(`fastify otel instance`),O=Symbol(`fastify otel request spans`),ee=Symbol(`fastify otel request context`),te=Symbol(`fastify otel addhook original`),ne=Symbol(`fastify otel setnotfound original`),re=Symbol(`fastify otel ignore path`),j=Symbol(`fastify otel record exceptions`),ie=class extends v{constructor(e){if(super(b,y,e),o(this,`logger`,null),o(this,`_requestHook`,null),o(this,`_lifecycleHook`,null),this.logger=d.createComponentLogger({namespace:b}),this[re]=null,this[j]=!0,e?.recordExceptions!=null){if(typeof e.recordExceptions!=`boolean`)throw TypeError(`recordExceptions must be a boolean`);this[j]=e.recordExceptions}if(typeof e?.requestHook==`function`&&(this._requestHook=e.requestHook),typeof e?.lifecycleHook==`function`&&(this._lifecycleHook=e.lifecycleHook),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let t=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof t!=`string`||t.length===0)&&typeof t!=`function`)throw TypeError(`ignorePaths must be a string or a function`);let n=null;this[re]=e=>typeof t==`function`?t(e):(n??(n=DM().minimatch),n(e.url,t))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=e=>{this.plugin()(e.fastify,void 0,()=>{});let t=(e,t,n)=>{n()};t[Symbol.for(`skip-override`)]=!0,t[Symbol.for(`fastify.display-name`)]=`@fastify/otel`,e.fastify.register(t)},i.subscribe(`fastify.initialization`,this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(i.unsubscribe(`fastify.initialization`,this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return t[Symbol.for(`skip-override`)]=!0,t[Symbol.for(`fastify.display-name`)]=`@fastify/otel`,t[Symbol.for(`plugin-meta`)]={fastify:x,name:`@fastify/otel`},t;function t(t,n,r){t.decorate(D,e),t.decorate(te,t.addHook),t.decorate(ne,t.setNotFoundHandler),t.decorateRequest(`opentelemetry`,function(){let t=this[ee],n=this[O];return{enabled:this.routeOptions.config?.otel!==!1,span:n,tracer:e.tracer,context:t,inject:(e,n)=>u.inject(t,e,n),extract:(e,n)=>u.extract(t,e,n)}}),t.decorateRequest(O,null),t.decorateRequest(ee,null),t.addHook(`onRoute`,function(t){if(e[re]?.(t)===!0){e.logger.debug(`Ignoring route instrumentation ${t.method} ${t.url} because it matches the ignore path`);return}if(t.config?.otel===!1){e.logger.debug(`Ignoring route instrumentation ${t.method} ${t.url} because it is disabled`);return}for(let e of S)if(t[e]!=null){let n=t[e];if(typeof n==`function`)t[e]=y(n,e,{[C.HOOK_NAME]:`${this.pluginName} - route -> ${e}`,[C.FASTIFY_TYPE]:w.ROUTE,[m]:t.url,[C.HOOK_CALLBACK_NAME]:n.name?.length>0?n.name:E});else if(Array.isArray(n)){let r=[];for(let i of n)r.push(y(i,e,{[C.HOOK_NAME]:`${this.pluginName} - route -> ${e}`,[C.FASTIFY_TYPE]:w.ROUTE,[m]:t.url,[C.HOOK_CALLBACK_NAME]:i.name?.length>0?i.name:E}));t[e]=r}}t.onSend==null?t.onSend=i:t.onSend=Array.isArray(t.onSend)?[...t.onSend,i]:[t.onSend,i],t.onError==null?t.onError=a:t.onError=Array.isArray(t.onError)?[...t.onError,a]:[t.onError,a],t.handler=y(t.handler,`handler`,{[C.HOOK_NAME]:`${this.pluginName} - route-handler`,[C.FASTIFY_TYPE]:w.HANDLER,[m]:t.url,[C.HOOK_CALLBACK_NAME]:t.handler.name.length>0?t.handler.name:E})}),t.addHook(`onRequest`,function(e,t,n){if(this[D].isEnabled()===!1||e.routeOptions.config?.otel===!1)return n();if(this[D][re]?.({url:e.url,method:e.method})===!0)return this[D].logger.debug(`Ignoring request ${e.method} ${e.url} because it matches the ignore path`),n();let r=s.active();c.getSpan(r)??(r=u.extract(r,e.headers));let i=f(r);e.routeOptions.url!=null&&i?.type===p.HTTP&&(i.route=e.routeOptions.url);let a={[C.ROOT]:`@fastify/otel`,[g]:e.method,[_]:e.url};e.routeOptions.url!=null&&(a[m]=e.routeOptions.url);let o=this[D].tracer.startSpan(`request`,{attributes:a},r);try{this[D]._requestHook?.(o,e)}catch(e){this[D].logger.error({err:e},`requestHook threw`)}e[ee]=c.setSpan(r,o),e[O]=o,s.with(e[ee],()=>{n()})}),t.addHook(`onResponse`,function(e,t,n){let r=e[O];r!=null&&(r.setAttributes({[h]:t.statusCode}),r.end()),e[O]=null,n()}),t.addHook=o,t.setNotFoundHandler=d,r();function i(e,t,n,r){let i=e[O];i!=null&&(t.statusCode>=500&&i.setStatus({code:l.ERROR}),i.setAttributes({[h]:t.statusCode}),i.end()),e[O]=null,r(null,n)}function a(t,n,r,i){let a=t[O];a!=null&&(a.setStatus({code:l.ERROR,message:r.message}),e[j]!==!1&&a.recordException(r)),i()}function o(e,t){let n=this[te];return S.includes(e)?n.call(this,e,y(t,e,{[C.HOOK_NAME]:`${this.pluginName} - ${e}`,[C.FASTIFY_TYPE]:w.INSTANCE,[C.HOOK_CALLBACK_NAME]:t.name?.length>0?t.name:E})):n.call(this,e,t)}function d(e,t){let n=this[ne];typeof e==`function`?(t=y(e,`notFoundHandler`,{[C.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[C.FASTIFY_TYPE]:w.INSTANCE,[C.HOOK_CALLBACK_NAME]:e.name?.length>0?e.name:E}),n.call(this,t)):(e.preValidation!=null&&(e.preValidation=y(e.preValidation,`notFoundHandler - preValidation`,{[C.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[C.FASTIFY_TYPE]:w.INSTANCE,[C.HOOK_CALLBACK_NAME]:e.preValidation.name?.length>0?e.preValidation.name:E})),e.preHandler!=null&&(e.preHandler=y(e.preHandler,`notFoundHandler - preHandler`,{[C.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[C.FASTIFY_TYPE]:w.INSTANCE,[C.HOOK_CALLBACK_NAME]:e.preHandler.name?.length>0?e.preHandler.name:E})),t=y(t,`notFoundHandler`,{[C.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[C.FASTIFY_TYPE]:w.INSTANCE,[C.HOOK_CALLBACK_NAME]:t.name?.length>0?t.name:E}),n.call(this,e,t))}function v(e){for(let t of e)if(t?.routeOptions&&t.url&&t.method)return t;return null}function y(e,t,n={}){return function(...r){let i=this[D],a=v(r);if(a===null)return i.logger.debug(`Ignoring route instrumentation because ${t} was called without a Fastify request argument`),e.call(this,...r);if(i.isEnabled()===!1||a.routeOptions.config?.otel===!1)return i.logger.debug(`Ignoring route instrumentation ${a.routeOptions.method} ${a.routeOptions.url} because it is disabled`),e.call(this,...r);if(i[re]?.({url:a.url,method:a.method})===!0)return i.logger.debug(`Ignoring route instrumentation ${a.routeOptions.method} ${a.routeOptions.url} because it matches the ignore path`),e.call(this,...r);let o=a[ee]??s.active(),u=e.name?.length>0?e.name:this.pluginName??E,d=i.tracer.startSpan(`${t} - ${u}`,{attributes:n},o);if(i._lifecycleHook!=null)try{i._lifecycleHook(d,{hookName:t,request:a,handler:u})}catch(e){i.logger.error({err:e},`Execution of lifecycleHook failed`)}return s.with(c.setSpan(o,d),function(){try{let t=e.call(this,...r);return typeof t?.then==`function`?t.then(e=>(d.end(),e),e=>(d.setStatus({code:l.ERROR,message:e.message}),i[j]!==!1&&d.recordException(e),d.end(),Promise.reject(e))):(d.end(),t)}catch(e){throw d.setStatus({code:l.ERROR,message:e.message}),i[j]!==!1&&d.recordException(e),d.end(),e}},this)}}}}};r.exports=ie,r.exports.FastifyOtelInstrumentation=ie})),kM,AM,jM,MM=n((()=>{(function(e){e.FASTIFY_NAME=`fastify.name`,e.FASTIFY_TYPE=`fastify.type`,e.HOOK_NAME=`hook.name`,e.PLUGIN_NAME=`plugin.name`})(kM||(kM={})),(function(e){e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request_handler`})(AM||(AM={})),(function(e){e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request handler`})(jM||(jM={}))})),NM,PM=n((()=>{NM=Symbol(`opentelemetry.instrumentation.fastify.request_active_span`)}));function FM(e,t,n,r={}){let i=t.startSpan(n,{attributes:r}),a=e[NM]||[];return a.push(i),Object.defineProperty(e,NM,{enumerable:!1,configurable:!0,value:a}),i}function IM(e,t){let n=e[NM]||[];n.length&&(n.forEach(e=>{t&&(e.setStatus({code:b.ERROR,message:t.message}),e.recordException(t)),e.end()}),delete e[NM])}function LM(e,t,n){let r,i;try{i=e(),RM(i)&&i.then(e=>t(void 0,e),e=>t(e))}catch(e){r=e}finally{if(!RM(i)&&(t(r,i),r))throw r;return i}}function RM(e){return typeof e==`object`&&e&&typeof Object.getOwnPropertyDescriptor(e,`then`)?.value==`function`||!1}var zM=n((()=>{T(),PM()}));function BM(){let e=W();e&&e.on(`spanStart`,e=>{VM(e)})}function VM(e){let t=q(e).data,n=t[`fastify.type`];if(t[`sentry.op`]||!n)return;e.setAttributes({[K]:`auto.http.otel.fastify`,[G]:`${n}.fastify`});let r=t[`fastify.name`]||t[`plugin.name`]||t[`hook.name`];if(typeof r==`string`){let t=r.replace(/^fastify -> /,``).replace(/^@fastify\/otel -> /,``);e.updateName(t)}}var HM,UM,WM,GM,KM,qM=n((()=>{T(),be(),L(),F(),X(),MM(),zM(),HM=`0.1.0`,UM=`@sentry/instrumentation-fastify-v3`,WM=`anonymous`,GM=new Set([`onTimeout`,`onRequest`,`preParsing`,`preValidation`,`preSerialization`,`preHandler`,`onSend`,`onResponse`,`onError`]),KM=class extends $a{constructor(e={}){super(UM,HM,e)}init(){return[new io(`fastify`,[`>=3.0.0 <4`],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(t,n,r){if(!e.isEnabled())return r();e._wrap(n,`send`,e._patchSend());let i=t,a=je(O.active()),o=i.routeOptions?i.routeOptions.url:t.routerPath;o&&a?.type===Fe.HTTP&&(a.route=o);let s=t.method||`GET`;ul().setTransactionName(`${s} ${o}`),r()}}_wrapHandler(e,t,n,r){let i=this;return this._diag.debug(`Patching fastify route.handler function`),function(...a){if(!i.isEnabled())return n.apply(this,a);let o=n.name||e||WM,s=`${jM.MIDDLEWARE} - ${o}`,c=a[1],l=FM(c,i.tracer,s,{[kM.FASTIFY_TYPE]:AM.MIDDLEWARE,[kM.PLUGIN_NAME]:e,[kM.HOOK_NAME]:t}),u=r&&a[a.length-1];return u&&(a[a.length-1]=function(...e){IM(c),u.apply(this,e)}),O.with(D.setSpan(O.active(),l),()=>LM(()=>n.apply(this,a),e=>{e instanceof Error&&(l.setStatus({code:b.ERROR,message:e.message}),l.recordException(e)),r||IM(c)}))}}_wrapAddHook(){let e=this;return this._diag.debug(`Patching fastify server.addHook function`),function(t){return function(...n){let r=n[0],i=n[1],a=this.pluginName;if(!GM.has(r))return t.apply(this,n);let o=typeof n[n.length-1]==`function`&&i.constructor.name!==`AsyncFunction`;return t.apply(this,[r,e._wrapHandler(a,r,i,o)])}}}_patchConstructor(e){let t=this;function n(...n){let r=e.fastify.apply(this,n);return r.addHook(`onRequest`,t._hookOnRequest()),r.addHook(`preHandler`,t._hookPreHandler()),BM(),t._wrap(r,`addHook`,t._wrapAddHook()),r}return e.errorCodes!==void 0&&(n.errorCodes=e.errorCodes),n.fastify=n,n.default=n,n}_patchSend(){let e=this;return this._diag.debug(`Patching fastify reply.send function`),function(t){return function(...n){let r=n[0];return e.isEnabled()?Ka(()=>t.apply(this,n),e=>{!e&&r instanceof Error&&(e=r),IM(this,e)}):t.apply(this,n)}}}_hookPreHandler(){let e=this;return this._diag.debug(`Patching fastify preHandler function`),function(t,n,r){if(!e.isEnabled())return r();let i=t,a=i.routeOptions?.handler||i.context?.handler,o=a?.name.startsWith(`bound `)?a.name.substring(6):a?.name,s=`${jM.REQUEST_HANDLER} - ${o||this.pluginName||WM}`,c={[kM.PLUGIN_NAME]:this.pluginName,[kM.FASTIFY_TYPE]:AM.REQUEST_HANDLER,[Ie]:i.routeOptions?i.routeOptions.url:t.routerPath};o&&(c[kM.FASTIFY_NAME]=o);let l=FM(n,e.tracer,s,c);VM(l);let{requestHook:u}=e.getConfig();return u&&Ka(()=>u(l,{request:t}),t=>{t&&e._diag.error(`request hook failed`,t)},!0),O.with(D.setSpan(O.active(),l),()=>{r()})}}}}));function JM(){let e=W();if(e)return e.getIntegrationByName(tN)}function YM(e,t,n,r){let i=JM()?.getShouldHandleError()||XM;if(r===`diagnostics-channel`&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r===`onError-hook`){Jk&&V.warn(`Fastify error handler was already registered via diagnostics channel.`,"You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}i(e,t,n)&&J(e,{mechanism:{handled:!1,type:`auto.function.fastify`}})}function XM(e,t,n){let r=n.statusCode;return r>=500||r<=299}function ZM(e){let t=q(e),n=t.description,r=t.data,i=r[`fastify.type`],a=i===`hook`,o=i===n?.startsWith(`handler -`),s=n===`request`||i===`request-handler`;if(r[`sentry.op`]||!o&&!s&&!a)return;let c=a?`hook`:o?`middleware`:s?`request_handler`:`<unknown>`;e.setAttributes({[K]:`auto.http.otel.fastify`,[G]:`${c}.fastify`});let l=r[`fastify.name`]||r[`plugin.name`]||r[`hook.name`];if(typeof l==`string`){let t=l.replace(/^fastify -> /,``).replace(/^@fastify\/otel -> /,``);e.updateName(t)}}function QM(){let e=W();e&&e.on(`spanStart`,e=>{ZM(e)})}function $M(e){e.addHook(`onRequest`,async(e,t)=>{if(e.opentelemetry){let{span:t}=e.opentelemetry();t&&ZM(t)}let n=e.routeOptions?.url,r=e.method||`GET`;ul().setTransactionName(`${r} ${n}`)})}var eN,tN,nN,rN,iN,aN,oN=n((()=>{eN=OM(),X(),$(),Yk(),qM(),tN=`Fastify`,nN=Z(`${tN}.v3`,()=>new KM),rN=Z(`${tN}.v5`,()=>{let e=new eN.FastifyOtelInstrumentation,t=e.plugin();return Ct.subscribe(`fastify.initialization`,e=>{let n=e.fastify;n?.register(t).after(e=>{e?Jk&&V.error(`Failed to setup Fastify instrumentation`,e):(QM(),n&&$M(n))})}),Ct.subscribe(`tracing:fastify.request.handler:error`,e=>{let{error:t,request:n,reply:r}=e;YM.call(YM,t,n,r,`diagnostics-channel`)}),e}),iN=(({shouldHandleError:e})=>{let t;return{name:tN,setupOnce(){t=e||XM,nN(),rN()},getShouldHandleError(){return t},setShouldHandleError(e){t=e}}}),aN=Y((e={})=>iN(e))})),sN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SpanNames=e.TokenKind=e.AllowedOperationTypes=void 0,(function(e){e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`})(e.AllowedOperationTypes||(e.AllowedOperationTypes={})),(function(e){e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`})(e.TokenKind||(e.TokenKind={})),(function(e){e.EXECUTE=`graphql.execute`,e.PARSE=`graphql.parse`,e.RESOLVE=`graphql.resolve`,e.VALIDATE=`graphql.validate`,e.SCHEMA_VALIDATE=`graphql.validateSchema`,e.SCHEMA_PARSE=`graphql.parseSchema`})(e.SpanNames||(e.SpanNames={}))})),cN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=void 0,(function(e){e.SOURCE=`graphql.source`,e.FIELD_NAME=`graphql.field.name`,e.FIELD_PATH=`graphql.field.path`,e.FIELD_TYPE=`graphql.field.type`,e.PARENT_NAME=`graphql.parent.name`,e.OPERATION_TYPE=`graphql.operation.type`,e.OPERATION_NAME=`graphql.operation.name`,e.VARIABLES=`graphql.variables.`,e.ERROR_VALIDATION_NAME=`graphql.validation.error`})(e.AttributeNames||(e.AttributeNames={}))})),lN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.OTEL_GRAPHQL_DATA_SYMBOL=e.OTEL_PATCHED_SYMBOL=void 0,e.OTEL_PATCHED_SYMBOL=Symbol.for(`opentelemetry.patched`),e.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for(`opentelemetry.graphql_data`)})),uN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.OPERATION_NOT_SUPPORTED=void 0,lN(),e.OPERATION_NOT_SUPPORTED=`Operation$operationName$not supported`})),dN=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.wrapFieldResolver=t.wrapFields=t.getSourceFromLocation=t.getOperation=t.endSpan=t.addSpanSource=t.addInputVariableAttributes=t.isPromise=void 0;var n=(T(),e(k)),r=sN(),i=cN(),a=lN(),o=Object.values(r.AllowedOperationTypes);t.isPromise=e=>typeof e?.then==`function`;var s=e=>typeof e==`object`&&!!e;function c(e,t,n){Array.isArray(n)?n.forEach((n,r)=>{c(e,`${t}.${r}`,n)}):n instanceof Object?Object.entries(n).forEach(([n,r])=>{c(e,`${t}.${n}`,r)}):e.setAttribute(`${i.AttributeNames.VARIABLES}${String(t)}`,n)}function l(e,t){Object.entries(t).forEach(([t,n])=>{c(e,t,n)})}t.addInputVariableAttributes=l;function u(e,t,n,r,a){let o=w(t,n,r,a);e.setAttribute(i.AttributeNames.SOURCE,o)}t.addSpanSource=u;function d(e,t,n,r,i){let a=g(n,i);return a?{field:a,spanAdded:!1}:(a={span:f(e,t,n,r,i,t().flatResolveSpans?v(n):_(n,i))},h(n,i,a),{field:a,spanAdded:!0})}function f(e,t,o,s,c,l){let d={[i.AttributeNames.FIELD_NAME]:s.fieldName,[i.AttributeNames.FIELD_PATH]:c.join(`.`),[i.AttributeNames.FIELD_TYPE]:s.returnType.toString(),[i.AttributeNames.PARENT_NAME]:s.parentType.name},f=e.startSpan(`${r.SpanNames.RESOLVE} ${d[i.AttributeNames.FIELD_PATH]}`,{attributes:d},l?n.trace.setSpan(n.context.active(),l):void 0),p=o[a.OTEL_GRAPHQL_DATA_SYMBOL].source,m=s.fieldNodes.find(e=>e.kind===`Field`);return m&&u(f,p.loc,t().allowValues,m.loc?.start,m.loc?.end),f}function p(e,t){t&&e.recordException(t),e.end()}t.endSpan=p;function m(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(e=>o.indexOf(e?.operation)!==-1).find(e=>t===e?.name?.value):e.definitions.find(e=>o.indexOf(e?.operation)!==-1)}t.getOperation=m;function h(e,t,n){return e[a.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(`.`)]=n}function g(e,t){return e[a.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(`.`)]}function _(e,t){for(let n=t.length-1;n>0;n--){let r=g(e,t.slice(0,n));if(r)return r.span}return v(e)}function v(e){return e[a.OTEL_GRAPHQL_DATA_SYMBOL].span}function y(e,t){let n=[],r=t;for(;r;){let t=r.key;e&&typeof t==`number`&&(t=`*`),n.push(String(t)),r=r.prev}return n.reverse()}function b(e){return S(`
|
|
13
|
+
`,e)}function x(e){return S(` `,e)}function S(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}var C=[r.TokenKind.FLOAT,r.TokenKind.STRING,r.TokenKind.INT,r.TokenKind.BLOCK_STRING];function w(e,t=!1,n,i){let a=``;if(e?.startToken){let o=typeof n==`number`?n:e.start,s=typeof i==`number`?i:e.end,c=e.startToken.next,l=1;for(;c;){if(c.start<o){c=c.next,l=c?.line;continue}if(c.end>s){c=c.next,l=c?.line;continue}let e=c.value||c.kind,n=``;!t&&C.indexOf(c.kind)>=0&&(e=`*`),c.kind===r.TokenKind.STRING&&(e=`"${e}"`),c.kind===r.TokenKind.EOF&&(e=``),c.line>l?(a+=b(c.line-l),l=c.line,n=x(c.column-1)):c.line===c.prev?.line&&(n=x(c.start-(c.prev?.end||0))),a+=n+e,c&&(c=c.next)}}return a}t.getSourceFromLocation=w;function E(e,t,n){if(!e||e[a.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[a.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(e=>{let i=r[e];if(i&&(i.resolve&&(i.resolve=re(t,n,i.resolve)),i.type)){let e=D(i.type);for(let r of e)E(r,t,n)}})}t.wrapFields=E;function D(e){return`ofType`in e?D(e.ofType):O(e)?e.getTypes():ee(e)?[e]:[]}function O(e){return`getTypes`in e&&typeof e.getTypes==`function`}function ee(e){return`getFields`in e&&typeof e.getFields==`function`}var te=(e,t,r)=>{r&&(e.recordException(t),e.setStatus({code:n.SpanStatusCode.ERROR,message:t.message}),e.end())},ne=(e,t)=>{t&&e.end()};function re(e,r,i,o=!1){if(c[a.OTEL_PATCHED_SYMBOL]||typeof i!=`function`)return i;function c(c,l,u,f){if(!i)return;let p=r();if(p.ignoreTrivialResolveSpans&&o&&(s(c)||typeof c==`function`)&&typeof c[f.fieldName]!=`function`||!u[a.OTEL_GRAPHQL_DATA_SYMBOL])return i.call(this,c,l,u,f);let m=y(p.mergeItems,f&&f.path),h=m.filter(e=>typeof e==`string`).length,g,v=!1;if(p.depth>=0&&p.depth<h)g=_(u,m);else{let{field:t,spanAdded:n}=d(e,r,u,f,m);g=t.span,v=n}return n.context.with(n.trace.setSpan(n.context.active(),g),()=>{try{let e=i.call(this,c,l,u,f);return(0,t.isPromise)(e)?e.then(e=>(ne(g,v),e),e=>{throw te(g,e,v),e}):(ne(g,v),e)}catch(e){throw te(g,e,v),e}})}return c[a.OTEL_PATCHED_SYMBOL]=!0,c}t.wrapFieldResolver=re})),fN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.62.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-graphql`})),pN=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.GraphQLInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=sN(),a=cN(),o=lN(),s=uN(),c=dN(),l=fN(),u={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},d=[`>=14.0.0 <17`];t.GraphQLInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(l.PACKAGE_NAME,l.PACKAGE_VERSION,{...u,...e})}setConfig(e={}){super.setConfig({...u,...e})}init(){let e=new r.InstrumentationNodeModuleDefinition(`graphql`,d);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new r.InstrumentationNodeModuleFile(`graphql/execution/execute.js`,d,e=>((0,r.isWrapped)(e.execute)&&this._unwrap(e,`execute`),this._wrap(e,`execute`,this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,`execute`)})}_addPatchingParser(){return new r.InstrumentationNodeModuleFile(`graphql/language/parser.js`,d,e=>((0,r.isWrapped)(e.parse)&&this._unwrap(e,`parse`),this._wrap(e,`parse`,this._patchParse()),e),e=>{e&&this._unwrap(e,`parse`)})}_addPatchingValidate(){return new r.InstrumentationNodeModuleFile(`graphql/validation/validate.js`,d,e=>((0,r.isWrapped)(e.validate)&&this._unwrap(e,`validate`),this._wrap(e,`validate`,this._patchValidate()),e),e=>{e&&this._unwrap(e,`validate`)})}_patchExecute(e){let t=this;return function(i){return function(){let a;if(arguments.length>=2){let n=arguments;a=t._wrapExecuteArgs(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],e)}else{let n=arguments[0];a=t._wrapExecuteArgs(n.schema,n.document,n.rootValue,n.contextValue,n.variableValues,n.operationName,n.fieldResolver,n.typeResolver,e)}let s=(0,c.getOperation)(a.document,a.operationName),l=t._createExecuteSpan(s,a);return a.contextValue[o.OTEL_GRAPHQL_DATA_SYMBOL]={source:a.document?a.document||a.document[o.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:l,fields:{}},n.context.with(n.trace.setSpan(n.context.active(),l),()=>(0,r.safeExecuteInTheMiddle)(()=>i.apply(this,[a]),(e,n)=>{t._handleExecutionResult(l,e,n)}))}}}_handleExecutionResult(e,t,n){let r=this.getConfig();if(n===void 0||t){(0,c.endSpan)(e,t);return}if((0,c.isPromise)(n))n.then(t=>{if(typeof r.responseHook!=`function`){(0,c.endSpan)(e);return}this._executeResponseHook(e,t)},t=>{(0,c.endSpan)(e,t)});else{if(typeof r.responseHook!=`function`){(0,c.endSpan)(e);return}this._executeResponseHook(e,n)}}_executeResponseHook(e,t){let{responseHook:n}=this.getConfig();n&&(0,r.safeExecuteInTheMiddle)(()=>{n(e,t)},t=>{t&&this._diag.error(`Error running response hook`,t),(0,c.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(t){return function(n,r){return e._parse(this,t,n,r)}}}_patchValidate(){let e=this;return function(t){return function(n,r,i,a,o){return e._validate(this,t,n,r,i,o,a)}}}_parse(e,t,a,o){let s=this.getConfig(),l=this.tracer.startSpan(i.SpanNames.PARSE);return n.context.with(n.trace.setSpan(n.context.active(),l),()=>(0,r.safeExecuteInTheMiddle)(()=>t.call(e,a,o),(e,t)=>{t&&((0,c.getOperation)(t)?t.loc&&(0,c.addSpanSource)(l,t.loc,s.allowValues):l.updateName(i.SpanNames.SCHEMA_PARSE)),(0,c.endSpan)(l,e)}))}_validate(e,t,o,s,l,u,d){let f=this.tracer.startSpan(i.SpanNames.VALIDATE,{});return n.context.with(n.trace.setSpan(n.context.active(),f),()=>(0,r.safeExecuteInTheMiddle)(()=>t.call(e,o,s,l,d,u),(e,t)=>{s.loc||f.updateName(i.SpanNames.SCHEMA_VALIDATE),t&&t.length&&f.recordException({name:a.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(t)}),(0,c.endSpan)(f,e)}))}_createExecuteSpan(e,t){let n=this.getConfig(),r=this.tracer.startSpan(i.SpanNames.EXECUTE,{});if(e){let{operation:t,name:n}=e;r.setAttribute(a.AttributeNames.OPERATION_TYPE,t);let i=n?.value;i?(r.setAttribute(a.AttributeNames.OPERATION_NAME,i),r.updateName(`${t} ${i}`)):r.updateName(t)}else{let e=` `;t.operationName&&(e=` "${t.operationName}" `),e=s.OPERATION_NOT_SUPPORTED.replace(`$operationName$`,e),r.setAttribute(a.AttributeNames.OPERATION_NAME,e)}return t.document?.loc&&(0,c.addSpanSource)(r,t.document.loc,n.allowValues),t.variableValues&&n.allowValues&&(0,c.addInputVariableAttributes)(r,t.variableValues),r}_wrapExecuteArgs(e,t,n,r,i,a,s,l,u){if(r||(r={}),r[o.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:t,rootValue:n,contextValue:r,variableValues:i,operationName:a,fieldResolver:s,typeResolver:l};let d=s==null,f=s??u;return s=(0,c.wrapFieldResolver)(this.tracer,()=>this.getConfig(),f,d),e&&((0,c.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,c.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:t,rootValue:n,contextValue:r,variableValues:i,operationName:a,fieldResolver:s,typeResolver:l}}}})),mN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GraphQLInstrumentation=void 0;var t=pN();Object.defineProperty(e,`GraphQLInstrumentation`,{enumerable:!0,get:function(){return t.GraphQLInstrumentation}})}));function hN(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function gN(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(`, `):`${t.slice(0,5).join(`, `)}, +${t.length-5}`}return`${e}`}var _N,vN,yN,bN,xN,SN=n((()=>{T(),_N=mN(),X(),$(),EE(),vN=`Graphql`,yN=Z(vN,_N.GraphQLInstrumentation,e=>{let t=hN(e);return{...t,responseHook(e,n){xk(e,`auto.graphql.otel.graphql`),n.errors?.length&&!q(e).status&&e.setStatus({code:b.ERROR});let r=q(e).data,i=r[`graphql.operation.type`],a=r[`graphql.operation.name`];if(t.useOperationNameForRootSpan&&i){let t=Yu(e),n=q(t).data[`sentry.graphql.operation`]||[],r=a?`${i} ${a}`:`${i}`;Array.isArray(n)?(n.push(r),t.setAttribute(QT,n)):typeof n==`string`?t.setAttribute(QT,[n,r]):t.setAttribute(QT,r),q(t).data[`original-description`]||t.setAttribute(`original-description`,q(t).description),t.updateName(`${q(t).data[`original-description`]} (${gN(n)})`)}}}}),bN=((e={})=>({name:vN,setupOnce(){yN(hN(e))}})),xN=Y(bN)})),CN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EVENT_LISTENERS_SET=void 0,e.EVENT_LISTENERS_SET=Symbol(`opentelemetry.instrumentation.kafkajs.eventListenersSet`)})),wN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.bufferTextMapGetter=void 0,e.bufferTextMapGetter={get(e,t){if(!e)return;let n=Object.keys(e);for(let r of n)if(r===t||r.toLowerCase()===t)return e[r]?.toString()},keys(e){return e?Object.keys(e):[]}}})),TN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.METRIC_MESSAGING_PROCESS_DURATION=e.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=e.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=e.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=e.MESSAGING_SYSTEM_VALUE_KAFKA=e.MESSAGING_OPERATION_TYPE_VALUE_SEND=e.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=e.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=e.ATTR_MESSAGING_SYSTEM=e.ATTR_MESSAGING_OPERATION_TYPE=e.ATTR_MESSAGING_OPERATION_NAME=e.ATTR_MESSAGING_KAFKA_OFFSET=e.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=e.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=e.ATTR_MESSAGING_DESTINATION_PARTITION_ID=e.ATTR_MESSAGING_DESTINATION_NAME=e.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0,e.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=`messaging.batch.message_count`,e.ATTR_MESSAGING_DESTINATION_NAME=`messaging.destination.name`,e.ATTR_MESSAGING_DESTINATION_PARTITION_ID=`messaging.destination.partition.id`,e.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=`messaging.kafka.message.key`,e.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=`messaging.kafka.message.tombstone`,e.ATTR_MESSAGING_KAFKA_OFFSET=`messaging.kafka.offset`,e.ATTR_MESSAGING_OPERATION_NAME=`messaging.operation.name`,e.ATTR_MESSAGING_OPERATION_TYPE=`messaging.operation.type`,e.ATTR_MESSAGING_SYSTEM=`messaging.system`,e.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=`process`,e.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=`receive`,e.MESSAGING_OPERATION_TYPE_VALUE_SEND=`send`,e.MESSAGING_SYSTEM_VALUE_KAFKA=`kafka`,e.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=`messaging.client.consumed.messages`,e.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=`messaging.client.operation.duration`,e.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=`messaging.client.sent.messages`,e.METRIC_MESSAGING_PROCESS_DURATION=`messaging.process.duration`})),EN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.23.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-kafkajs`})),DN=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.KafkaJsInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=(F(),e(A)),a=CN(),o=wN(),s=TN(),c=EN();function l(e,t,n){return r=>{e.add(t,{...n,...r?{[i.ATTR_ERROR_TYPE]:r}:{}})}}function u(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[i.ATTR_ERROR_TYPE]:r}:{}})}}var d=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10];t.KafkaJsInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(c.PACKAGE_NAME,c.PACKAGE_VERSION,e)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(s.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:d}}),this._sentMessages=this.meter.createCounter(s.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(s.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(s.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:d}})}init(){let e=e=>{(0,r.isWrapped)(e?.Kafka?.prototype.producer)&&this._unwrap(e.Kafka.prototype,`producer`),(0,r.isWrapped)(e?.Kafka?.prototype.consumer)&&this._unwrap(e.Kafka.prototype,`consumer`)};return new r.InstrumentationNodeModuleDefinition(`kafkajs`,[`>=0.3.0 <3`],t=>(e(t),this._wrap(t?.Kafka?.prototype,`producer`,this._getProducerPatch()),this._wrap(t?.Kafka?.prototype,`consumer`,this._getConsumerPatch()),t),e)}_getConsumerPatch(){let e=this;return t=>function(...n){let i=t.apply(this,n);return(0,r.isWrapped)(i.run)&&e._unwrap(i,`run`),e._wrap(i,`run`,e._getConsumerRunPatch()),e._setKafkaEventListeners(i),i}}_setKafkaEventListeners(e){e[a.EVENT_LISTENERS_SET]||(e.events?.REQUEST&&e.on(e.events.REQUEST,this._recordClientDurationMetric.bind(this)),e[a.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(e){let[t,n]=e.payload.broker.split(`:`);this._clientDuration.record(e.payload.duration/1e3,{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`${e.payload.apiName}`,[i.ATTR_SERVER_ADDRESS]:t,[i.ATTR_SERVER_PORT]:Number.parseInt(n,10)})}_getProducerPatch(){let e=this;return t=>function(...n){let i=t.apply(this,n);return(0,r.isWrapped)(i.sendBatch)&&e._unwrap(i,`sendBatch`),e._wrap(i,`sendBatch`,e._getSendBatchPatch()),(0,r.isWrapped)(i.send)&&e._unwrap(i,`send`),e._wrap(i,`send`,e._getSendPatch()),(0,r.isWrapped)(i.transaction)&&e._unwrap(i,`transaction`),e._wrap(i,`transaction`,e._getProducerTransactionPatch()),e._setKafkaEventListeners(i),i}}_getConsumerRunPatch(){let e=this;return t=>function(...n){let i=n[0];return i?.eachMessage&&((0,r.isWrapped)(i.eachMessage)&&e._unwrap(i,`eachMessage`),e._wrap(i,`eachMessage`,e._getConsumerEachMessagePatch())),i?.eachBatch&&((0,r.isWrapped)(i.eachBatch)&&e._unwrap(i,`eachBatch`),e._wrap(i,`eachBatch`,e._getConsumerEachBatchPatch())),t.call(this,i)}}_getConsumerEachMessagePatch(){let e=this;return t=>function(...r){let i=r[0],a=n.propagation.extract(n.ROOT_CONTEXT,i.message.headers,o.bufferTextMapGetter),c=e._startConsumerSpan({topic:i.topic,message:i.message,operationType:s.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:a,attributes:{[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),d=[u(e._processDuration,Date.now(),{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`process`,[s.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),l(e._consumedMessages,1,{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`process`,[s.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],f=n.context.with(n.trace.setSpan(a,c),()=>t.apply(this,r));return e._endSpansOnPromise([c],d,f)}}_getConsumerEachBatchPatch(){return e=>{let t=this;return function(...r){let i=r[0],a=t._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:s.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:n.ROOT_CONTEXT,attributes:{[s.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return n.context.with(n.trace.setSpan(n.context.active(),a),()=>{let c=Date.now(),d=[],f=[l(t._consumedMessages,i.batch.messages.length,{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`process`,[s.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(e=>{let r=n.propagation.extract(n.ROOT_CONTEXT,e.headers,o.bufferTextMapGetter),a=n.trace.getSpan(r)?.spanContext(),l;a&&(l={context:a}),d.push(t._startConsumerSpan({topic:i.batch.topic,message:e,operationType:s.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:l,attributes:{[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),f.push(u(t._processDuration,c,{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`process`,[s.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let p=e.apply(this,r);return d.unshift(a),t._endSpansOnPromise(d,f,p)})}}}_getProducerTransactionPatch(){let e=this;return t=>function(...r){let i=e.tracer.startSpan(`transaction`),a=t.apply(this,r);return a.then(t=>{let r=t.send;t.send=function(...t){return n.context.with(n.trace.setSpan(n.context.active(),i),()=>e._getSendPatch()(r).apply(this,t).catch(e=>{throw i.setStatus({code:n.SpanStatusCode.ERROR,message:e?.message}),i.recordException(e),e}))};let a=t.sendBatch;t.sendBatch=function(...t){return n.context.with(n.trace.setSpan(n.context.active(),i),()=>e._getSendBatchPatch()(a).apply(this,t).catch(e=>{throw i.setStatus({code:n.SpanStatusCode.ERROR,message:e?.message}),i.recordException(e),e}))};let o=t.commit;t.commit=function(...t){let r=o.apply(this,t).then(()=>{i.setStatus({code:n.SpanStatusCode.OK})});return e._endSpansOnPromise([i],[],r)};let s=t.abort;t.abort=function(...t){let n=s.apply(this,t);return e._endSpansOnPromise([i],[],n)}}).catch(e=>{i.setStatus({code:n.SpanStatusCode.ERROR,message:e?.message}),i.recordException(e),i.end()}),a}}_getSendBatchPatch(){let e=this;return t=>function(...n){let r=n[0].topicMessages||[],i=[],a=[];r.forEach(t=>{t.messages.forEach(n=>{i.push(e._startProducerSpan(t.topic,n)),a.push(l(e._sentMessages,1,{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`send`,[s.ATTR_MESSAGING_DESTINATION_NAME]:t.topic,...n.partition===void 0?{}:{[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(n.partition)}}))})});let o=t.apply(this,n);return e._endSpansOnPromise(i,a,o)}}_getSendPatch(){let e=this;return t=>function(...n){let r=n[0],i=r.messages.map(t=>e._startProducerSpan(r.topic,t)),a=r.messages.map(t=>l(e._sentMessages,1,{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_OPERATION_NAME]:`send`,[s.ATTR_MESSAGING_DESTINATION_NAME]:r.topic,...t.partition===void 0?{}:{[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(t.partition)}})),o=t.apply(this,n);return e._endSpansOnPromise(i,a,o)}}_endSpansOnPromise(e,t,r){return Promise.resolve(r).then(e=>(t.forEach(e=>e()),e)).catch(r=>{let a,o=i.ERROR_TYPE_VALUE_OTHER;throw typeof r==`string`||r===void 0?a=r:typeof r==`object`&&Object.prototype.hasOwnProperty.call(r,`message`)&&(a=r.message,o=r.constructor.name),t.forEach(e=>e(o)),e.forEach(e=>{e.setAttribute(i.ATTR_ERROR_TYPE,o),e.setStatus({code:n.SpanStatusCode.ERROR,message:a})}),r}).finally(()=>{e.forEach(e=>e.end())})}_startConsumerSpan({topic:e,message:t,operationType:i,ctx:a,link:o,attributes:c}){let l=i===s.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?`poll`:i,u=this.tracer.startSpan(`${l} ${e}`,{kind:i===s.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?n.SpanKind.CLIENT:n.SpanKind.CONSUMER,attributes:{...c,[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_DESTINATION_NAME]:e,[s.ATTR_MESSAGING_OPERATION_TYPE]:i,[s.ATTR_MESSAGING_OPERATION_NAME]:l,[s.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:t?.key?String(t.key):void 0,[s.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:t?.key&&t.value===null?!0:void 0,[s.ATTR_MESSAGING_KAFKA_OFFSET]:t?.offset},links:o?[o]:[]},a),{consumerHook:d}=this.getConfig();return d&&t&&(0,r.safeExecuteInTheMiddle)(()=>d(u,{topic:e,message:t}),e=>{e&&this._diag.error(`consumerHook error`,e)},!0),u}_startProducerSpan(e,t){let i=this.tracer.startSpan(`send ${e}`,{kind:n.SpanKind.PRODUCER,attributes:{[s.ATTR_MESSAGING_SYSTEM]:s.MESSAGING_SYSTEM_VALUE_KAFKA,[s.ATTR_MESSAGING_DESTINATION_NAME]:e,[s.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:t.key?String(t.key):void 0,[s.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:t.key&&t.value===null?!0:void 0,[s.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:t.partition===void 0?void 0:String(t.partition),[s.ATTR_MESSAGING_OPERATION_NAME]:`send`,[s.ATTR_MESSAGING_OPERATION_TYPE]:s.MESSAGING_OPERATION_TYPE_VALUE_SEND}});t.headers=t.headers??{},n.propagation.inject(n.trace.setSpan(n.context.active(),i),t.headers);let{producerHook:a}=this.getConfig();return a&&(0,r.safeExecuteInTheMiddle)(()=>a(i,{topic:e,message:t}),e=>{e&&this._diag.error(`producerHook error`,e)},!0),i}}})),ON=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.KafkaJsInstrumentation=void 0;var t=DN();Object.defineProperty(e,`KafkaJsInstrumentation`,{enumerable:!0,get:function(){return t.KafkaJsInstrumentation}})})),kN,AN,jN,MN,NN,PN=n((()=>{kN=ON(),X(),$(),AN=`Kafka`,jN=Z(AN,()=>new kN.KafkaJsInstrumentation({consumerHook(e){xk(e,`auto.kafkajs.otel.consumer`)},producerHook(e){xk(e,`auto.kafkajs.otel.producer`)}})),MN=(()=>({name:AN,setupOnce(){jN()}})),NN=Y(MN)})),FN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.58.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-lru-memoizer`})),IN=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.LruMemoizerInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=FN();t.LruMemoizerInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(i.PACKAGE_NAME,i.PACKAGE_VERSION,e)}init(){return[new r.InstrumentationNodeModuleDefinition(`lru-memoizer`,[`>=1.3 <4`],e=>{let t=function(){let t=e.apply(this,arguments);return function(){let e=[...arguments],r=e.pop(),i=typeof r==`function`?n.context.bind(n.context.active(),r):r;return e.push(i),t.apply(this,e)}};return t.sync=e.sync,t},void 0)]}}})),LN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LruMemoizerInstrumentation=void 0;var t=IN();Object.defineProperty(e,`LruMemoizerInstrumentation`,{enumerable:!0,get:function(){return t.LruMemoizerInstrumentation}})})),RN,zN,BN,VN,HN,UN=n((()=>{RN=LN(),X(),$(),zN=`LruMemoizer`,BN=Z(zN,()=>new RN.LruMemoizerInstrumentation),VN=(()=>({name:zN,setupOnce(){BN()}})),HN=Y(VN)})),WN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.METRIC_DB_CLIENT_CONNECTIONS_USAGE=e.DB_SYSTEM_VALUE_MONGODB=e.DB_SYSTEM_NAME_VALUE_MONGODB=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_OPERATION=e.ATTR_DB_NAME=e.ATTR_DB_MONGODB_COLLECTION=e.ATTR_DB_CONNECTION_STRING=void 0,e.ATTR_DB_CONNECTION_STRING=`db.connection_string`,e.ATTR_DB_MONGODB_COLLECTION=`db.mongodb.collection`,e.ATTR_DB_NAME=`db.name`,e.ATTR_DB_OPERATION=`db.operation`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_NAME_VALUE_MONGODB=`mongodb`,e.DB_SYSTEM_VALUE_MONGODB=`mongodb`,e.METRIC_DB_CLIENT_CONNECTIONS_USAGE=`db.client.connections.usage`})),GN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MongodbCommandType=void 0,(function(e){e.CREATE_INDEXES=`createIndexes`,e.FIND_AND_MODIFY=`findAndModify`,e.IS_MASTER=`isMaster`,e.COUNT=`count`,e.AGGREGATE=`aggregate`,e.UNKNOWN=`unknown`})(e.MongodbCommandType||(e.MongodbCommandType={}))})),KN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.67.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-mongodb`})),qN=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.MongoDBInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=(F(),e(A)),s=WN(),c=GN(),l=KN(),u={requireParentSpan:!0};t.MongoDBInstrumentation=class e extends r.InstrumentationBase{constructor(e={}){super(l.PACKAGE_NAME,l.PACKAGE_VERSION,{...u,...e}),o(this,`_netSemconvStability`,void 0),o(this,`_dbSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,r.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,r.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...u,...e})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(s.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:`The number of connections that are currently in state described by the state attribute.`,unit:`{connection}`})}_connCountAdd(e,t,n){this._connectionsUsage?.add(e,{"pool.name":t,state:n})}init(){let{v3PatchConnection:e,v3UnpatchConnection:t}=this._getV3ConnectionPatches(),{v4PatchConnect:n,v4UnpatchConnect:i}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:a,v4PatchConnectionPromise:o,v4UnpatchConnection:s}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:l}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:u,v4UnpatchSessions:d}=this._getV4SessionsPatches();return[new r.InstrumentationNodeModuleDefinition(`mongodb`,[`>=3.3.0 <4`],void 0,void 0,[new r.InstrumentationNodeModuleFile(`mongodb/lib/core/wireprotocol/index.js`,[`>=3.3.0 <4`],e,t)]),new r.InstrumentationNodeModuleDefinition(`mongodb`,[`>=4.0.0 <8`],void 0,void 0,[new r.InstrumentationNodeModuleFile(`mongodb/lib/cmap/connection.js`,[`>=4.0.0 <6.4`],a,s),new r.InstrumentationNodeModuleFile(`mongodb/lib/cmap/connection.js`,[`>=6.4.0 <8`],o,s),new r.InstrumentationNodeModuleFile(`mongodb/lib/cmap/connection_pool.js`,[`>=4.0.0 <6.4`],c,l),new r.InstrumentationNodeModuleFile(`mongodb/lib/cmap/connect.js`,[`>=4.0.0 <8`],n,i),new r.InstrumentationNodeModuleFile(`mongodb/lib/sessions.js`,[`>=4.0.0 <8`],u,d)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,r.isWrapped)(e.insert)&&this._unwrap(e,`insert`),this._wrap(e,`insert`,this._getV3PatchOperation(`insert`)),(0,r.isWrapped)(e.remove)&&this._unwrap(e,`remove`),this._wrap(e,`remove`,this._getV3PatchOperation(`remove`)),(0,r.isWrapped)(e.update)&&this._unwrap(e,`update`),this._wrap(e,`update`,this._getV3PatchOperation(`update`)),(0,r.isWrapped)(e.command)&&this._unwrap(e,`command`),this._wrap(e,`command`,this._getV3PatchCommand()),(0,r.isWrapped)(e.query)&&this._unwrap(e,`query`),this._wrap(e,`query`,this._getV3PatchFind()),(0,r.isWrapped)(e.getMore)&&this._unwrap(e,`getMore`),this._wrap(e,`getMore`,this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,`insert`),this._unwrap(e,`remove`),this._unwrap(e,`update`),this._unwrap(e,`command`),this._unwrap(e,`query`),this._unwrap(e,`getMore`))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,r.isWrapped)(e.acquire)&&this._unwrap(e,`acquire`),this._wrap(e.ServerSessionPool.prototype,`acquire`,this._getV4AcquireCommand()),(0,r.isWrapped)(e.release)&&this._unwrap(e,`release`),this._wrap(e.ServerSessionPool.prototype,`release`,this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,r.isWrapped)(e.acquire)&&this._unwrap(e,`acquire`),(0,r.isWrapped)(e.release)&&this._unwrap(e,`release`))}}}_getV4AcquireCommand(){let e=this;return t=>function(){let n=this.sessions.length,r=t.call(this),i=this.sessions.length;return n===i?e._connCountAdd(1,e._poolName,`used`):n-1===i&&(e._connCountAdd(-1,e._poolName,`idle`),e._connCountAdd(1,e._poolName,`used`)),r}}_getV4ReleaseCommand(){let e=this;return t=>function(n){let r=t.call(this,n);return e._connCountAdd(-1,e._poolName,`used`),e._connCountAdd(1,e._poolName,`idle`),r}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let t=e.ConnectionPool.prototype;return(0,r.isWrapped)(t.checkOut)&&this._unwrap(t,`checkOut`),this._wrap(t,`checkOut`,this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,`checkOut`)}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,r.isWrapped)(e.connect)&&this._unwrap(e,`connect`),this._wrap(e,`connect`,this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,`connect`)}}}_getV4ConnectionPoolCheckOut(){return e=>function(t){let r=n.context.bind(n.context.active(),t);return e.call(this,r)}}_getV4ConnectCommand(){let e=this;return t=>function(n,r){if(t.length===1){let r=t.call(this,n);return r&&typeof r.then==`function`&&r.then(()=>e.setPoolName(n),()=>void 0),r}return t.call(this,n,function(t,i){if(t||!i){r(t,i);return}e.setPoolName(n),r(t,i)})}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,r.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,`command`),this._wrap(e.Connection.prototype,`command`,this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,r.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,`command`),this._wrap(e.Connection.prototype,`command`,this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,`command`)}}}_getV3PatchOperation(e){let t=this;return r=>function(i,a,o,s,c){let l=n.trace.getSpan(n.context.active()),u=t._checkSkipInstrumentation(l),d=typeof s==`function`?s:c;if(u||typeof d!=`function`||typeof o!=`object`)return typeof s==`function`?r.call(this,i,a,o,s):r.call(this,i,a,o,s,c);let f=t._getV3SpanAttributes(a,i,o[0],e),p=t._spanNameFromAttrs(f),m=t.tracer.startSpan(p,{kind:n.SpanKind.CLIENT,attributes:f}),h=t._patchEnd(m,d);return typeof s==`function`?r.call(this,i,a,o,h):r.call(this,i,a,o,s,h)}}_getV3PatchCommand(){let t=this;return r=>function(i,a,o,s,l){let u=n.trace.getSpan(n.context.active()),d=t._checkSkipInstrumentation(u),f=typeof s==`function`?s:l;if(d||typeof f!=`function`||typeof o!=`object`)return typeof s==`function`?r.call(this,i,a,o,s):r.call(this,i,a,o,s,l);let p=e._getCommandType(o),m=p===c.MongodbCommandType.UNKNOWN?void 0:p,h=t._getV3SpanAttributes(a,i,o,m),g=t._spanNameFromAttrs(h),_=t.tracer.startSpan(g,{kind:n.SpanKind.CLIENT,attributes:h}),v=t._patchEnd(_,f);return typeof s==`function`?r.call(this,i,a,o,v):r.call(this,i,a,o,s,v)}}_getV4PatchCommandCallback(){let e=this;return t=>function(r,i,a,o){let s=n.trace.getSpan(n.context.active()),c=e._checkSkipInstrumentation(s),l=o,u=Object.keys(i)[0];if(typeof i!=`object`||i.ismaster||i.hello)return t.call(this,r,i,a,o);let d;if(!c){let t=e._getV4SpanAttributes(this,r,i,u),a=e._spanNameFromAttrs(t);d=e.tracer.startSpan(a,{kind:n.SpanKind.CLIENT,attributes:t})}let f=e._patchEnd(d,l,this.id,u);return t.call(this,r,i,a,f)}}_getV4PatchCommandPromise(){let e=this;return t=>function(...r){let[i,a]=r,o=n.trace.getSpan(n.context.active()),s=e._checkSkipInstrumentation(o),c=Object.keys(a)[0],l=()=>void 0;if(typeof a!=`object`||a.ismaster||a.hello)return t.apply(this,r);let u;if(!s){let t=e._getV4SpanAttributes(this,i,a,c),r=e._spanNameFromAttrs(t);u=e.tracer.startSpan(r,{kind:n.SpanKind.CLIENT,attributes:t})}let d=e._patchEnd(u,l,this.id,c),f=t.apply(this,r);return f.then(e=>d(null,e),e=>d(e)),f}}_getV3PatchFind(){let e=this;return t=>function(r,i,a,o,s,c){let l=n.trace.getSpan(n.context.active()),u=e._checkSkipInstrumentation(l),d=typeof s==`function`?s:c;if(u||typeof d!=`function`||typeof a!=`object`)return typeof s==`function`?t.call(this,r,i,a,o,s):t.call(this,r,i,a,o,s,c);let f=e._getV3SpanAttributes(i,r,a,`find`),p=e._spanNameFromAttrs(f),m=e.tracer.startSpan(p,{kind:n.SpanKind.CLIENT,attributes:f}),h=e._patchEnd(m,d);return typeof s==`function`?t.call(this,r,i,a,o,h):t.call(this,r,i,a,o,s,h)}}_getV3PatchCursor(){let e=this;return t=>function(r,i,a,o,s,c){let l=n.trace.getSpan(n.context.active()),u=e._checkSkipInstrumentation(l),d=typeof s==`function`?s:c;if(u||typeof d!=`function`)return typeof s==`function`?t.call(this,r,i,a,o,s):t.call(this,r,i,a,o,s,c);let f=e._getV3SpanAttributes(i,r,a.cmd,`getMore`),p=e._spanNameFromAttrs(f),m=e.tracer.startSpan(p,{kind:n.SpanKind.CLIENT,attributes:f}),h=e._patchEnd(m,d);return typeof s==`function`?t.call(this,r,i,a,o,h):t.call(this,r,i,a,o,s,h)}}static _getCommandType(e){return e.createIndexes===void 0?e.findandmodify===void 0?e.ismaster===void 0?e.count===void 0?e.aggregate===void 0?c.MongodbCommandType.UNKNOWN:c.MongodbCommandType.AGGREGATE:c.MongodbCommandType.COUNT:c.MongodbCommandType.IS_MASTER:c.MongodbCommandType.FIND_AND_MODIFY:c.MongodbCommandType.CREATE_INDEXES}_getV4SpanAttributes(e,t,n,r){let i,a;if(e){let t=typeof e.address==`string`?e.address.split(`:`):``;t.length===2&&(i=t[0],a=t[1])}let o;return o=n?.documents&&n.documents[0]?n.documents[0]:n?.cursors?n.cursors:n,this._getSpanAttributes(t.db,t.collection,i,a,o,r)}_getV3SpanAttributes(e,t,n,r){let i,a;if(t&&t.s&&(i=t.s.options?.host??t.s.host,a=(t.s.options?.port??t.s.port)?.toString(),i==null||a==null)){let e=t.description?.address;if(e){let t=e.split(`:`);i=t[0],a=t[1]}}let[o,s]=e.toString().split(`.`),c=n?.query??n?.q??n;return this._getSpanAttributes(o,s,i,a,c,r)}_getSpanAttributes(e,t,n,a,o,c){let l={};if(this._dbSemconvStability&r.SemconvStability.OLD&&(l[s.ATTR_DB_SYSTEM]=s.DB_SYSTEM_VALUE_MONGODB,l[s.ATTR_DB_NAME]=e,l[s.ATTR_DB_MONGODB_COLLECTION]=t,l[s.ATTR_DB_OPERATION]=c,l[s.ATTR_DB_CONNECTION_STRING]=`mongodb://${n}:${a}/${e}`),this._dbSemconvStability&r.SemconvStability.STABLE&&(l[i.ATTR_DB_SYSTEM_NAME]=s.DB_SYSTEM_NAME_VALUE_MONGODB,l[i.ATTR_DB_NAMESPACE]=e,l[i.ATTR_DB_OPERATION_NAME]=c,l[i.ATTR_DB_COLLECTION_NAME]=t),n&&a){this._netSemconvStability&r.SemconvStability.OLD&&(l[s.ATTR_NET_PEER_NAME]=n),this._netSemconvStability&r.SemconvStability.STABLE&&(l[i.ATTR_SERVER_ADDRESS]=n);let e=parseInt(a,10);isNaN(e)||(this._netSemconvStability&r.SemconvStability.OLD&&(l[s.ATTR_NET_PEER_PORT]=e),this._netSemconvStability&r.SemconvStability.STABLE&&(l[i.ATTR_SERVER_PORT]=e))}if(o){let{dbStatementSerializer:e}=this.getConfig(),t=typeof e==`function`?e:this._defaultDbStatementSerializer.bind(this);(0,r.safeExecuteInTheMiddle)(()=>{let e=t(o);this._dbSemconvStability&r.SemconvStability.OLD&&(l[s.ATTR_DB_STATEMENT]=e),this._dbSemconvStability&r.SemconvStability.STABLE&&(l[i.ATTR_DB_QUERY_TEXT]=e)},e=>{e&&this._diag.error(`Error running dbStatementSerializer hook`,e)},!0)}return l}_spanNameFromAttrs(e){let t;return t=this._dbSemconvStability&r.SemconvStability.STABLE?[e[i.ATTR_DB_OPERATION_NAME],e[i.ATTR_DB_COLLECTION_NAME]].filter(e=>e).join(` `)||s.DB_SYSTEM_NAME_VALUE_MONGODB:`mongodb.${e[s.ATTR_DB_OPERATION]||`command`}`,t}_getDefaultDbStatementReplacer(){let e=new WeakSet;return(t,n)=>typeof n!=`object`||!n?`?`:e.has(n)?`[Circular]`:(e.add(n),n)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:t}=this.getConfig();return t?JSON.stringify(e):JSON.stringify(e,this._getDefaultDbStatementReplacer())}_handleExecutionResult(e,t){let{responseHook:n}=this.getConfig();typeof n==`function`&&(0,r.safeExecuteInTheMiddle)(()=>{n(e,{data:t})},e=>{e&&this._diag.error(`Error running response hook`,e)},!0)}_patchEnd(e,t,r,i){let a=n.context.active(),o=this,s=!1;return function(...r){if(!s){s=!0;let t=r[0];if(e){if(t instanceof Error)e.setStatus({code:n.SpanStatusCode.ERROR,message:t.message});else{let t=r[1];o._handleExecutionResult(e,t)}e.end()}i===`endSessions`&&o._connCountAdd(-1,o._poolName,`idle`)}return n.context.with(a,()=>t.apply(this,r))}}setPoolName(e){this._poolName=`mongodb://${e.hostAddress?.host}:${e.hostAddress?.port}/${e.dbName}`}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}}})),JN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MongodbCommandType=void 0,(function(e){e.CREATE_INDEXES=`createIndexes`,e.FIND_AND_MODIFY=`findAndModify`,e.IS_MASTER=`isMaster`,e.COUNT=`count`,e.UNKNOWN=`unknown`})(e.MongodbCommandType||(e.MongodbCommandType={}))})),YN=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MongodbCommandType=e.MongoDBInstrumentation=void 0;var t=qN();Object.defineProperty(e,`MongoDBInstrumentation`,{enumerable:!0,get:function(){return t.MongoDBInstrumentation}});var n=JN();Object.defineProperty(e,`MongodbCommandType`,{enumerable:!0,get:function(){return n.MongodbCommandType}})}));function XN(e){let t=ZN(e);return JSON.stringify(t)}function ZN(e){return Array.isArray(e)?e.map(e=>ZN(e)):QN(e)?Object.entries(e).map(([e,t])=>[e,ZN(t)]).reduce((e,t)=>(eP(t)&&(e[t[0]]=t[1]),e),{}):`?`}function QN(e){return typeof e==`object`&&!!e&&!$N(e)}function $N(e){let t=!1;return typeof Buffer<`u`&&(t=Buffer.isBuffer(e)),t}function eP(e){return Array.isArray(e)}var tP,nP,rP,iP,aP,oP=n((()=>{tP=YN(),X(),$(),nP=`Mongo`,rP=Z(nP,()=>new tP.MongoDBInstrumentation({dbStatementSerializer:XN,responseHook(e){xk(e,`auto.db.otel.mongo`)}})),iP=(()=>({name:nP,setupOnce(){rP()}})),aP=Y(iP)})),sP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DB_SYSTEM_NAME_VALUE_MONGODB=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_USER=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_OPERATION=e.ATTR_DB_NAME=e.ATTR_DB_MONGODB_COLLECTION=void 0,e.ATTR_DB_MONGODB_COLLECTION=`db.mongodb.collection`,e.ATTR_DB_NAME=`db.name`,e.ATTR_DB_OPERATION=`db.operation`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_DB_USER=`db.user`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_NAME_VALUE_MONGODB=`mongodb`})),cP=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.handleCallbackResponse=t.handlePromiseResponse=t.getAttributesFromCollection=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=sP(),a=(F(),e(A));function o(e,t,n){let o={};return t&r.SemconvStability.OLD&&(o[i.ATTR_DB_MONGODB_COLLECTION]=e.name,o[i.ATTR_DB_NAME]=e.conn.name,o[i.ATTR_DB_USER]=e.conn.user),t&r.SemconvStability.STABLE&&(o[a.ATTR_DB_COLLECTION_NAME]=e.name,o[a.ATTR_DB_NAMESPACE]=e.conn.name),n&r.SemconvStability.OLD&&(o[i.ATTR_NET_PEER_NAME]=e.conn.host,o[i.ATTR_NET_PEER_PORT]=e.conn.port),n&r.SemconvStability.STABLE&&(o[a.ATTR_SERVER_ADDRESS]=e.conn.host,o[a.ATTR_SERVER_PORT]=e.conn.port),o}t.getAttributesFromCollection=o;function s(e,t={}){e.recordException(t),e.setStatus({code:n.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`\nMongoose Error Code: ${t.code}`:``}`})}function c(e,t,i,a=void 0){i&&(0,r.safeExecuteInTheMiddle)(()=>i(e,{moduleVersion:a,response:t}),e=>{e&&n.diag.error(`mongoose instrumentation: responseHook error`,e)},!0)}function l(e,t,n,r=void 0){return e instanceof Promise?e.then(e=>(c(t,e,n,r),e)).catch(e=>{throw s(t,e),e}).finally(()=>t.end()):(c(t,e,n,r),t.end(),e)}t.handlePromiseResponse=l;function u(e,t,n,r,i,a,o=void 0){let l=0;return i.length===2?l=1:i.length===3&&(l=2),i[l]=(t,n)=>(t?s(r,t):c(r,n,a,o),r.end(),e(t,n)),t.apply(n,i)}t.handleCallbackResponse=u})),lP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.60.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-mongoose`})),uP=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.MongooseInstrumentation=t._ALREADY_INSTRUMENTED=t._STORED_PARENT_SPAN=void 0;var n=(T(),e(k)),r=(fi(),e(ui)),i=cP(),s=(L(),e(I)),c=lP(),l=sP(),u=(F(),e(A)),d=[`deleteOne`,`deleteMany`,`find`,`findOne`,`estimatedDocumentCount`,`countDocuments`,`distinct`,`where`,`$where`,`findOneAndUpdate`,`findOneAndDelete`,`findOneAndReplace`],f=[`remove`,`count`,`findOneAndRemove`,...d],p=[`count`,`findOneAndRemove`,...d],m=[...d];function h(e){return e?e.startsWith(`6.`)||e.startsWith(`5.`)?f:e.startsWith(`7.`)?p:m:d}function g(e){return e&&(e.startsWith(`5.`)||e.startsWith(`6.`))||!1}function _(e){return!e||!e.startsWith(`8.`)?!1:parseInt(e.split(`.`)[1],10)>=21}t._STORED_PARENT_SPAN=Symbol(`stored-parent-span`),t._ALREADY_INSTRUMENTED=Symbol(`already-instrumented`),t.MongooseInstrumentation=class extends s.InstrumentationBase{constructor(e={}){super(c.PACKAGE_NAME,c.PACKAGE_VERSION,e),o(this,`_netSemconvStability`,void 0),o(this,`_dbSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,s.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,s.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new s.InstrumentationNodeModuleDefinition(`mongoose`,[`>=5.9.7 <10`],this.patch.bind(this),this.unpatch.bind(this))}patch(e,t){let n=e[Symbol.toStringTag]===`Module`?e.default:e;return this._wrap(n.Model.prototype,`save`,this.patchOnModelMethods(`save`,t)),n.Model.prototype.$save=n.Model.prototype.save,g(t)&&this._wrap(n.Model.prototype,`remove`,this.patchOnModelMethods(`remove`,t)),_(t)&&(this._wrap(n.Model.prototype,`updateOne`,this._patchDocumentUpdateMethods(`updateOne`,t)),this._wrap(n.Model.prototype,`deleteOne`,this._patchDocumentUpdateMethods(`deleteOne`,t))),this._wrap(n.Query.prototype,`exec`,this.patchQueryExec(t)),this._wrap(n.Aggregate.prototype,`exec`,this.patchAggregateExec(t)),h(t).forEach(e=>{this._wrap(n.Query.prototype,e,this.patchAndCaptureSpanContext(e))}),this._wrap(n.Model,`aggregate`,this.patchModelAggregate()),this._wrap(n.Model,`insertMany`,this.patchModelStatic(`insertMany`,t)),this._wrap(n.Model,`bulkWrite`,this.patchModelStatic(`bulkWrite`,t)),n}unpatch(e,t){let n=e[Symbol.toStringTag]===`Module`?e.default:e,r=h(t);this._unwrap(n.Model.prototype,`save`),n.Model.prototype.$save=n.Model.prototype.save,g(t)&&this._unwrap(n.Model.prototype,`remove`),_(t)&&(this._unwrap(n.Model.prototype,`updateOne`),this._unwrap(n.Model.prototype,`deleteOne`)),this._unwrap(n.Query.prototype,`exec`),this._unwrap(n.Aggregate.prototype,`exec`),r.forEach(e=>{this._unwrap(n.Query.prototype,e)}),this._unwrap(n.Model,`aggregate`),this._unwrap(n.Model,`insertMany`),this._unwrap(n.Model,`bulkWrite`)}patchAggregateExec(e){let r=this;return i=>function(a){if(r.getConfig().requireParentSpan&&n.trace.getSpan(n.context.active())===void 0)return i.apply(this,arguments);let o=this[t._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=r.getConfig();if(d){let e=d(`aggregate`,{options:this.options,aggregatePipeline:this._pipeline});r._dbSemconvStability&s.SemconvStability.OLD&&(c[l.ATTR_DB_STATEMENT]=e),r._dbSemconvStability&s.SemconvStability.STABLE&&(c[u.ATTR_DB_QUERY_TEXT]=e)}let f=r._startSpan(this._model.collection,this._model?.modelName,`aggregate`,c,o);return r._handleResponse(f,i,this,arguments,a,e)}}patchQueryExec(e){let r=this;return i=>function(a){if(this[t._ALREADY_INSTRUMENTED]||r.getConfig().requireParentSpan&&n.trace.getSpan(n.context.active())===void 0)return i.apply(this,arguments);let o=this[t._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=r.getConfig();if(d){let e=d(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});r._dbSemconvStability&s.SemconvStability.OLD&&(c[l.ATTR_DB_STATEMENT]=e),r._dbSemconvStability&s.SemconvStability.STABLE&&(c[u.ATTR_DB_QUERY_TEXT]=e)}let f=r._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,o);return r._handleResponse(f,i,this,arguments,a,e)}}patchOnModelMethods(e,t){let r=this;return i=>function(a,o){if(r.getConfig().requireParentSpan&&n.trace.getSpan(n.context.active())===void 0)return i.apply(this,arguments);let c={document:this};a&&!(a instanceof Function)&&(c.options=a);let d={},{dbStatementSerializer:f}=r.getConfig();if(f){let t=f(e,c);r._dbSemconvStability&s.SemconvStability.OLD&&(d[l.ATTR_DB_STATEMENT]=t),r._dbSemconvStability&s.SemconvStability.STABLE&&(d[u.ATTR_DB_QUERY_TEXT]=t)}let p=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return a instanceof Function&&(o=a,a=void 0),r._handleResponse(p,i,this,arguments,o,t)}}_patchDocumentUpdateMethods(e,r){let i=this;return a=>function(o,c,d){if(i.getConfig().requireParentSpan&&n.trace.getSpan(n.context.active())===void 0)return a.apply(this,arguments);let f=d,p=o,m=c;typeof o==`function`?(f=o,p=void 0,m=void 0):typeof c==`function`&&(f=c,m=void 0);let h={},g=i.getConfig().dbStatementSerializer;if(g){let t=g(e,{condition:{_id:this._id},updates:p,options:m});i._dbSemconvStability&s.SemconvStability.OLD&&(h[l.ATTR_DB_STATEMENT]=t),i._dbSemconvStability&s.SemconvStability.STABLE&&(h[u.ATTR_DB_QUERY_TEXT]=t)}let _=i._startSpan(this.constructor.collection,this.constructor.modelName,e,h),v=i._handleResponse(_,a,this,arguments,f,r);return v&&typeof v==`object`&&(v[t._ALREADY_INSTRUMENTED]=!0),v}}patchModelStatic(e,t){let r=this;return i=>function(a,o,c){if(r.getConfig().requireParentSpan&&n.trace.getSpan(n.context.active())===void 0)return i.apply(this,arguments);typeof o==`function`&&(c=o,o=void 0);let d={};switch(e){case`insertMany`:d.documents=a;break;case`bulkWrite`:d.operations=a;break;default:d.document=a;break}o!==void 0&&(d.options=o);let f={},{dbStatementSerializer:p}=r.getConfig();if(p){let t=p(e,d);r._dbSemconvStability&s.SemconvStability.OLD&&(f[l.ATTR_DB_STATEMENT]=t),r._dbSemconvStability&s.SemconvStability.STABLE&&(f[u.ATTR_DB_QUERY_TEXT]=t)}let m=r._startSpan(this.collection,this.modelName,e,f);return r._handleResponse(m,i,this,arguments,c,t)}}patchModelAggregate(){let e=this;return r=>function(){let i=n.trace.getSpan(n.context.active()),a=e._callOriginalFunction(()=>r.apply(this,arguments));return a&&(a[t._STORED_PARENT_SPAN]=i),a}}patchAndCaptureSpanContext(e){let r=this;return e=>function(){return this[t._STORED_PARENT_SPAN]=n.trace.getSpan(n.context.active()),r._callOriginalFunction(()=>e.apply(this,arguments))}}_startSpan(e,t,r,a,o){let c={...a,...(0,i.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&s.SemconvStability.OLD&&(c[l.ATTR_DB_OPERATION]=r,c[l.ATTR_DB_SYSTEM]=`mongoose`),this._dbSemconvStability&s.SemconvStability.STABLE&&(c[u.ATTR_DB_OPERATION_NAME]=r,c[u.ATTR_DB_SYSTEM_NAME]=l.DB_SYSTEM_NAME_VALUE_MONGODB);let d=this._dbSemconvStability&s.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${t}.${r}`;return this.tracer.startSpan(d,{kind:n.SpanKind.CLIENT,attributes:c},o?n.trace.setSpan(n.context.active(),o):void 0)}_handleResponse(e,t,n,r,a,o=void 0){let s=this;if(a instanceof Function)return s._callOriginalFunction(()=>(0,i.handleCallbackResponse)(a,t,n,e,r,s.getConfig().responseHook,o));{let a=s._callOriginalFunction(()=>t.apply(n,r));return(0,i.handlePromiseResponse)(a,e,s.getConfig().responseHook,o)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?n.context.with((0,r.suppressTracing)(n.context.active()),e):e()}}})),dP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MongooseInstrumentation=void 0;var t=uP();Object.defineProperty(e,`MongooseInstrumentation`,{enumerable:!0,get:function(){return t.MongooseInstrumentation}})})),fP,pP,mP,hP,gP,_P=n((()=>{fP=dP(),X(),$(),pP=`Mongoose`,mP=Z(pP,()=>new fP.MongooseInstrumentation({responseHook(e){xk(e,`auto.db.otel.mongoose`)}})),hP=(()=>({name:pP,setupOnce(){mP()}})),gP=Y(hP)})),vP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.METRIC_DB_CLIENT_CONNECTIONS_USAGE=e.DB_SYSTEM_VALUE_MYSQL=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_USER=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_NAME=e.ATTR_DB_CONNECTION_STRING=void 0,e.ATTR_DB_CONNECTION_STRING=`db.connection_string`,e.ATTR_DB_NAME=`db.name`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_DB_USER=`db.user`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_VALUE_MYSQL=`mysql`,e.METRIC_DB_CLIENT_CONNECTIONS_USAGE=`db.client.connections.usage`})),yP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=void 0,(function(e){e.MYSQL_VALUES=`db.mysql.values`})(e.AttributeNames||(e.AttributeNames={}))})),bP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getPoolNameOld=e.arrayStringifyHelper=e.getSpanName=e.getDbValues=e.getDbQueryText=e.getJDBCString=e.getConfig=void 0;function t(e){let{host:t,port:n,database:r,user:i}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:i}}e.getConfig=t;function n(e,t,n){let r=`jdbc:mysql://${e||`localhost`}`;return typeof t==`number`&&(r+=`:${t}`),typeof n==`string`&&(r+=`/${n}`),r}e.getJDBCString=n;function r(e){return typeof e==`string`?e:e.sql}e.getDbQueryText=r;function i(e,t){return o(typeof e==`string`?t:t||e.values)}e.getDbValues=i;function a(e){let t=typeof e==`object`?e.sql:e,n=t?.indexOf(` `);return typeof n==`number`&&n!==-1?t?.substring(0,n):t}e.getSpanName=a;function o(e){return e?`[${e.toString()}]`:``}e.arrayStringifyHelper=o;function s(e){let t=e.config.connectionConfig,n=``;return n+=t.host?`host: '${t.host}', `:``,n+=t.port?`port: ${t.port}, `:``,n+=t.database?`database: '${t.database}', `:``,n+=t.user?`user: '${t.user}'`:``,t.user||(n=n.substring(0,n.length-2)),n.trim()}e.getPoolNameOld=s})),xP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.60.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-mysql`})),SP=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.MySQLInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=(F(),e(A)),s=vP(),c=yP(),l=bP(),u=xP();t.MySQLInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(u.PACKAGE_NAME,u.PACKAGE_VERSION,e),o(this,`_netSemconvStability`,void 0),o(this,`_dbSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,r.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,r.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(s.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:`The number of connections that are currently in state described by the state attribute.`,unit:`{connection}`})}_connCountAdd(e,t,n){this._connectionsUsageOld?.add(e,{state:n,name:t})}init(){return[new r.InstrumentationNodeModuleDefinition(`mysql`,[`>=2.0.0 <3`],e=>((0,r.isWrapped)(e.createConnection)&&this._unwrap(e,`createConnection`),this._wrap(e,`createConnection`,this._patchCreateConnection()),(0,r.isWrapped)(e.createPool)&&this._unwrap(e,`createPool`),this._wrap(e,`createPool`,this._patchCreatePool()),(0,r.isWrapped)(e.createPoolCluster)&&this._unwrap(e,`createPoolCluster`),this._wrap(e,`createPoolCluster`,this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,`createConnection`),this._unwrap(e,`createPool`),this._unwrap(e,`createPoolCluster`))})]}_patchCreateConnection(){return e=>{let t=this;return function(n){let r=e(...arguments);return t._wrap(r,`query`,t._patchQuery(r)),r}}}_patchCreatePool(){return e=>{let t=this;return function(n){let r=e(...arguments);return t._wrap(r,`query`,t._patchQuery(r)),t._wrap(r,`getConnection`,t._patchGetConnection(r)),t._wrap(r,`end`,t._patchPoolEnd(r)),t._setPoolCallbacks(r,``),r}}}_patchPoolEnd(e){return t=>{let n=this;return function(r){let i=e._allConnections.length,a=e._freeConnections.length,o=i-a,s=(0,l.getPoolNameOld)(e);n._connCountAdd(-o,s,`used`),n._connCountAdd(-a,s,`idle`),t.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let t=this;return function(n){let r=e(...arguments);return t._wrap(r,`getConnection`,t._patchGetConnection(r)),t._wrap(r,`add`,t._patchAdd(r)),r}}}_patchAdd(e){return t=>{let n=this;return function(r,i){if(!n._enabled)return n._unwrap(e,`add`),t.apply(e,arguments);t.apply(e,arguments);let a=e._nodes;if(a){let t=a[typeof r==`object`?`CLUSTER::`+e._lastId:String(r)].pool;n._setPoolCallbacks(t,r)}}}}_patchGetConnection(e){return t=>{let n=this;return function(r,i,a){if(!n._enabled)return n._unwrap(e,`getConnection`),t.apply(e,arguments);if(arguments.length===1&&typeof r==`function`){let i=n._getConnectionCallbackPatchFn(r);return t.call(e,i)}if(arguments.length===2&&typeof i==`function`){let a=n._getConnectionCallbackPatchFn(i);return t.call(e,r,a)}if(arguments.length===3&&typeof a==`function`){let o=n._getConnectionCallbackPatchFn(a);return t.call(e,r,i,o)}return t.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let t=this,i=n.context.active();return function(a,o){o&&((0,r.isWrapped)(o.query)||t._wrap(o,`query`,t._patchQuery(o))),typeof e==`function`&&n.context.with(i,e,this,a,o)}}_patchQuery(e){return t=>{let a=this;return function(o,u,d){if(!a._enabled)return a._unwrap(e,`query`),t.apply(e,arguments);let f={},{host:p,port:m,database:h,user:g}=(0,l.getConfig)(e.config),_=parseInt(m,10),v=(0,l.getDbQueryText)(o);a._dbSemconvStability&r.SemconvStability.OLD&&(f[s.ATTR_DB_SYSTEM]=s.DB_SYSTEM_VALUE_MYSQL,f[s.ATTR_DB_CONNECTION_STRING]=(0,l.getJDBCString)(p,m,h),f[s.ATTR_DB_NAME]=h,f[s.ATTR_DB_USER]=g,f[s.ATTR_DB_STATEMENT]=v),a._dbSemconvStability&r.SemconvStability.STABLE&&(f[i.ATTR_DB_SYSTEM_NAME]=i.DB_SYSTEM_NAME_VALUE_MYSQL,f[i.ATTR_DB_NAMESPACE]=h,f[i.ATTR_DB_QUERY_TEXT]=v),a._netSemconvStability&r.SemconvStability.OLD&&(f[s.ATTR_NET_PEER_NAME]=p,isNaN(_)||(f[s.ATTR_NET_PEER_PORT]=_)),a._netSemconvStability&r.SemconvStability.STABLE&&(f[i.ATTR_SERVER_ADDRESS]=p,isNaN(_)||(f[i.ATTR_SERVER_PORT]=_));let y=a.tracer.startSpan((0,l.getSpanName)(o),{kind:n.SpanKind.CLIENT,attributes:f});if(a.getConfig().enhancedDatabaseReporting){let e;Array.isArray(u)?e=u:arguments[2]&&(e=[u]),y.setAttribute(c.AttributeNames.MYSQL_VALUES,(0,l.getDbValues)(o,e))}let b=Array.from(arguments).findIndex(e=>typeof e==`function`),x=n.context.active();if(b===-1){let r=n.context.with(n.trace.setSpan(n.context.active(),y),()=>t.apply(e,arguments));return n.context.bind(x,r),r.on(`error`,e=>y.setStatus({code:n.SpanStatusCode.ERROR,message:e.message})).on(`end`,()=>{y.end()})}else return a._wrap(arguments,b,a._patchCallbackQuery(y,x)),n.context.with(n.trace.setSpan(n.context.active(),y),()=>t.apply(e,arguments))}}}_patchCallbackQuery(e,t){return r=>function(i,a,o){return i&&e.setStatus({code:n.SpanStatusCode.ERROR,message:i.message}),e.end(),n.context.with(t,()=>r(...arguments))}}_setPoolCallbacks(e,t){let n=t||(0,l.getPoolNameOld)(e);e.on(`connection`,e=>{this._connCountAdd(1,n,`idle`)}),e.on(`acquire`,e=>{this._connCountAdd(-1,n,`idle`),this._connCountAdd(1,n,`used`)}),e.on(`release`,e=>{this._connCountAdd(1,n,`idle`),this._connCountAdd(-1,n,`used`)})}}})),CP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MySQLInstrumentation=void 0;var t=SP();Object.defineProperty(e,`MySQLInstrumentation`,{enumerable:!0,get:function(){return t.MySQLInstrumentation}})})),wP,TP,EP,DP,OP,kP=n((()=>{wP=CP(),X(),$(),TP=`Mysql`,EP=Z(TP,()=>new wP.MySQLInstrumentation({})),DP=(()=>({name:TP,setupOnce(){EP()}})),OP=Y(DP)})),AP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DB_SYSTEM_VALUE_MYSQL=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_USER=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_NAME=e.ATTR_DB_CONNECTION_STRING=void 0,e.ATTR_DB_CONNECTION_STRING=`db.connection_string`,e.ATTR_DB_NAME=`db.name`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_DB_USER=`db.user`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_VALUE_MYSQL=`mysql`})),jP=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.addSqlCommenterComment=void 0;var n=(T(),e(k)),r=(fi(),e(ui));function i(e){let t=e.indexOf(`--`);return t>=0?!0:e.indexOf(`/*`)<0?!1:t<e.indexOf(`*/`)}function a(e){return encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function o(e,t){if(typeof t!=`string`||t.length===0||i(t))return t;let o=new r.W3CTraceContextPropagator,s={};o.inject(n.trace.setSpan(n.ROOT_CONTEXT,e),s,n.defaultTextMapSetter);let c=Object.keys(s).sort();return c.length===0?t:`${t} /*${c.map(e=>`${e}='${a(s[e])}'`).join(`,`)}*/`}t.addSqlCommenterComment=o})),MP=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getConnectionPrototypeToInstrument=t.once=t.getSpanName=t.getQueryText=t.getConnectionAttributes=void 0;var n=AP(),r=(L(),e(I)),i=(F(),e(A));function a(e,t,a){let{host:c,port:l,database:u,user:d}=o(e),f={};t&r.SemconvStability.OLD&&(f[n.ATTR_DB_CONNECTION_STRING]=s(c,l,u),f[n.ATTR_DB_NAME]=u,f[n.ATTR_DB_USER]=d),t&r.SemconvStability.STABLE&&(f[i.ATTR_DB_NAMESPACE]=u);let p=parseInt(l,10);return a&r.SemconvStability.OLD&&(f[n.ATTR_NET_PEER_NAME]=c,isNaN(p)||(f[n.ATTR_NET_PEER_PORT]=p)),a&r.SemconvStability.STABLE&&(f[i.ATTR_SERVER_ADDRESS]=c,isNaN(p)||(f[i.ATTR_SERVER_PORT]=p)),f}t.getConnectionAttributes=a;function o(e){let{host:t,port:n,database:r,user:i}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:i}}function s(e,t,n){let r=`jdbc:mysql://${e||`localhost`}`;return typeof t==`number`&&(r+=`:${t}`),typeof n==`string`&&(r+=`/${n}`),r}function c(e,t,n,r=!1,i=l){let[a,o]=typeof e==`string`?[e,n]:[e.sql,u(e)?n||e.values:n];try{return r?i(a):t&&o?t(a,o):a}catch{return`Could not determine the query due to an error in masking or formatting`}}t.getQueryText=c;function l(e){return e.replace(/\b\d+\b/g,`?`).replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,`?`)}function u(e){return`values`in e}function d(e){let t=typeof e==`object`?e.sql:e,n=t?.indexOf(` `);return typeof n==`number`&&n!==-1?t?.substring(0,n):t}t.getSpanName=d,t.once=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};function f(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query==`function`&&typeof n?.execute==`function`?n:t}t.getConnectionPrototypeToInstrument=f})),NP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.60.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-mysql2`})),PP=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.MySQL2Instrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=AP(),s=jP(),c=MP(),l=NP(),u=(F(),e(A)),d=[`>=1.4.2 <4`];t.MySQL2Instrumentation=class extends r.InstrumentationBase{constructor(e={}){super(l.PACKAGE_NAME,l.PACKAGE_VERSION,e),o(this,`_netSemconvStability`,void 0),o(this,`_dbSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,r.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,r.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function t(t){!e&&t.format&&(e=t.format)}let n=t=>{(0,r.isWrapped)(t.query)&&this._unwrap(t,`query`),this._wrap(t,`query`,this._patchQuery(e,!1)),(0,r.isWrapped)(t.execute)&&this._unwrap(t,`execute`),this._wrap(t,`execute`,this._patchQuery(e,!0))},i=e=>{this._unwrap(e,`query`),this._unwrap(e,`execute`)};return[new r.InstrumentationNodeModuleDefinition(`mysql2`,d,e=>(t(e),e),()=>{},[new r.InstrumentationNodeModuleFile(`mysql2/promise.js`,d,e=>(t(e),e),()=>{}),new r.InstrumentationNodeModuleFile(`mysql2/lib/connection.js`,d,e=>(n((0,c.getConnectionPrototypeToInstrument)(e)),e),e=>{e!==void 0&&i((0,c.getConnectionPrototypeToInstrument)(e))})])]}_patchQuery(e,t){return a=>{let o=this;return function(l,d,f){let p;Array.isArray(d)?p=d:arguments[2]&&(p=[d]);let{maskStatement:m,maskStatementHook:h,responseHook:g}=o.getConfig(),_=(0,c.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),v=(0,c.getQueryText)(l,e,p,m,h);o._dbSemconvStability&r.SemconvStability.OLD&&(_[i.ATTR_DB_SYSTEM]=i.DB_SYSTEM_VALUE_MYSQL,_[i.ATTR_DB_STATEMENT]=v),o._dbSemconvStability&r.SemconvStability.STABLE&&(_[u.ATTR_DB_SYSTEM_NAME]=u.DB_SYSTEM_NAME_VALUE_MYSQL,_[u.ATTR_DB_QUERY_TEXT]=v);let y=o.tracer.startSpan((0,c.getSpanName)(l),{kind:n.SpanKind.CLIENT,attributes:_});!t&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=l=typeof l==`string`?(0,s.addSqlCommenterComment)(y,l):Object.assign(l,{sql:(0,s.addSqlCommenterComment)(y,l.sql)}));let b=(0,c.once)((e,t)=>{e?y.setStatus({code:n.SpanStatusCode.ERROR,message:e.message}):typeof g==`function`&&(0,r.safeExecuteInTheMiddle)(()=>{g(y,{queryResults:t})},e=>{e&&o._diag.warn(`Failed executing responseHook`,e)},!0),y.end()});if(arguments.length===1){typeof l.onResult==`function`&&o._wrap(l,`onResult`,o._patchCallbackQuery(b));let e=a.apply(this,arguments);return e.once(`error`,e=>{b(e)}).once(`result`,e=>{b(void 0,e)}),e}return typeof arguments[1]==`function`?o._wrap(arguments,1,o._patchCallbackQuery(b)):typeof arguments[2]==`function`&&o._wrap(arguments,2,o._patchCallbackQuery(b)),a.apply(this,arguments)}}}_patchCallbackQuery(e){return t=>function(n,r,i){return e(n,r),t(...arguments)}}}})),FP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MySQL2Instrumentation=void 0;var t=PP();Object.defineProperty(e,`MySQL2Instrumentation`,{enumerable:!0,get:function(){return t.MySQL2Instrumentation}})})),IP,LP,RP,zP,BP,VP=n((()=>{IP=FP(),X(),$(),LP=`Mysql2`,RP=Z(LP,()=>new IP.MySQL2Instrumentation({responseHook(e){xk(e,`auto.db.otel.mysql2`)}})),zP=(()=>({name:LP,setupOnce(){RP()}})),BP=Y(zP)})),HP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DB_SYSTEM_VALUE_REDIS=e.DB_SYSTEM_NAME_VALUE_REDIS=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_CONNECTION_STRING=void 0,e.ATTR_DB_CONNECTION_STRING=`db.connection_string`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_NAME_VALUE_REDIS=`redis`,e.DB_SYSTEM_VALUE_REDIS=`redis`})),UP=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.endSpan=void 0;var n=(T(),e(k));t.endSpan=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:n.SpanStatusCode.ERROR,message:t.message})),e.end()}})),WP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultDbStatementSerializer=void 0;var t=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}];e.defaultDbStatementSerializer=(e,n)=>{if(Array.isArray(n)&&n.length){let r=t.find(({regex:t})=>t.test(e))?.args??0,i=r>=0?n.slice(0,r):n;return n.length>i.length&&i.push(`[${n.length-r} other arguments]`),`${e} ${i.join(` `)}`}return e}})),GP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.62.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-ioredis`})),KP=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.IORedisInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=(F(),e(A)),s=HP(),c=(L(),e(I)),l=UP(),u=WP(),d=GP(),f={requireParentSpan:!0};t.IORedisInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(d.PACKAGE_NAME,d.PACKAGE_VERSION,{...f,...e}),o(this,`_netSemconvStability`,void 0),o(this,`_dbSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,r.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,r.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...f,...e})}init(){return[new r.InstrumentationNodeModuleDefinition(`ioredis`,[`>=2.0.0 <6`],(e,t)=>{let n=e[Symbol.toStringTag]===`Module`?e.default:e;return(0,r.isWrapped)(n.prototype.sendCommand)&&this._unwrap(n.prototype,`sendCommand`),this._wrap(n.prototype,`sendCommand`,this._patchSendCommand(t)),(0,r.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,`connect`),this._wrap(n.prototype,`connect`,this._patchConnection()),e},e=>{if(e===void 0)return;let t=e[Symbol.toStringTag]===`Module`?e.default:e;this._unwrap(t.prototype,`sendCommand`),this._unwrap(t.prototype,`connect`)})]}_patchSendCommand(e){return t=>this._traceSendCommand(t,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,t){let a=this;return function(o){if(arguments.length<1||typeof o!=`object`)return e.apply(this,arguments);let d=a.getConfig(),f=d.dbStatementSerializer||u.defaultDbStatementSerializer,p=n.trace.getSpan(n.context.active())===void 0;if(d.requireParentSpan===!0&&p)return e.apply(this,arguments);let m={},{host:h,port:g}=this.options,_=f(o.name,o.args);a._dbSemconvStability&r.SemconvStability.OLD&&(m[s.ATTR_DB_SYSTEM]=s.DB_SYSTEM_VALUE_REDIS,m[s.ATTR_DB_STATEMENT]=_,m[s.ATTR_DB_CONNECTION_STRING]=`redis://${h}:${g}`),a._dbSemconvStability&r.SemconvStability.STABLE&&(m[i.ATTR_DB_SYSTEM_NAME]=s.DB_SYSTEM_NAME_VALUE_REDIS,m[i.ATTR_DB_QUERY_TEXT]=_),a._netSemconvStability&r.SemconvStability.OLD&&(m[s.ATTR_NET_PEER_NAME]=h,m[s.ATTR_NET_PEER_PORT]=g),a._netSemconvStability&r.SemconvStability.STABLE&&(m[i.ATTR_SERVER_ADDRESS]=h,m[i.ATTR_SERVER_PORT]=g);let v=a.tracer.startSpan(o.name,{kind:n.SpanKind.CLIENT,attributes:m}),{requestHook:y}=d;y&&(0,c.safeExecuteInTheMiddle)(()=>y(v,{moduleVersion:t,cmdName:o.name,cmdArgs:o.args}),e=>{e&&n.diag.error(`ioredis instrumentation: request hook failed`,e)},!0);try{let t=e.apply(this,arguments),r=o.resolve;o.resolve=function(e){(0,c.safeExecuteInTheMiddle)(()=>d.responseHook?.(v,o.name,o.args,e),e=>{e&&n.diag.error(`ioredis instrumentation: response hook failed`,e)},!0),(0,l.endSpan)(v,null),r(e)};let i=o.reject;return o.reject=function(e){(0,l.endSpan)(v,e),i(e)},t}catch(e){throw(0,l.endSpan)(v,e),e}}}_traceConnection(e){let t=this;return function(){let a=n.trace.getSpan(n.context.active())===void 0;if(t.getConfig().requireParentSpan===!0&&a)return e.apply(this,arguments);let o={},{host:c,port:u}=this.options;t._dbSemconvStability&r.SemconvStability.OLD&&(o[s.ATTR_DB_SYSTEM]=s.DB_SYSTEM_VALUE_REDIS,o[s.ATTR_DB_STATEMENT]=`connect`,o[s.ATTR_DB_CONNECTION_STRING]=`redis://${c}:${u}`),t._dbSemconvStability&r.SemconvStability.STABLE&&(o[i.ATTR_DB_SYSTEM_NAME]=s.DB_SYSTEM_NAME_VALUE_REDIS,o[i.ATTR_DB_QUERY_TEXT]=`connect`),t._netSemconvStability&r.SemconvStability.OLD&&(o[s.ATTR_NET_PEER_NAME]=c,o[s.ATTR_NET_PEER_PORT]=u),t._netSemconvStability&r.SemconvStability.STABLE&&(o[i.ATTR_SERVER_ADDRESS]=c,o[i.ATTR_SERVER_PORT]=u);let d=t.tracer.startSpan(`connect`,{kind:n.SpanKind.CLIENT,attributes:o});try{let t=e.apply(this,arguments);return(0,l.endSpan)(d,null),t}catch(e){throw(0,l.endSpan)(d,e),e}}}}})),qP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IORedisInstrumentation=void 0;var t=KP();Object.defineProperty(e,`IORedisInstrumentation`,{enumerable:!0,get:function(){return t.IORedisInstrumentation}})})),JP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.62.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-redis`})),YP=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getTracedCreateStreamTrace=t.getTracedCreateClient=t.endSpan=void 0;var n=(T(),e(k));t.endSpan=(e,t)=>{t&&e.setStatus({code:n.SpanStatusCode.ERROR,message:t.message}),e.end()},t.getTracedCreateClient=e=>function(){let t=e.apply(this,arguments);return n.context.bind(n.context.active(),t)},t.getTracedCreateStreamTrace=e=>function(){return Object.prototype.hasOwnProperty.call(this,`stream`)||Object.defineProperty(this,`stream`,{get(){return this._patched_redis_stream},set(e){n.context.bind(n.context.active(),e),this._patched_redis_stream=e}}),e.apply(this,arguments)}})),XP=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DB_SYSTEM_VALUE_REDIS=e.DB_SYSTEM_NAME_VALUE_REDIS=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_CONNECTION_STRING=void 0,e.ATTR_DB_CONNECTION_STRING=`db.connection_string`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_NAME_VALUE_REDIS=`redis`,e.DB_SYSTEM_VALUE_REDIS=`redis`})),ZP=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.RedisInstrumentationV2_V3=void 0;var n=(L(),e(I)),r=YP(),i=JP(),s=(T(),e(k)),c=(F(),e(A)),l=XP(),u=WP(),d=class e extends n.InstrumentationBase{constructor(e={}){super(i.PACKAGE_NAME,i.PACKAGE_VERSION,e),o(this,`_semconvStability`,void 0),this._semconvStability=e.semconvStability?e.semconvStability:(0,n.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,n.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new n.InstrumentationNodeModuleDefinition(`redis`,[`>=2.6.0 <4`],e=>((0,n.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,`internal_send_command`),this._wrap(e.RedisClient.prototype,`internal_send_command`,this._getPatchInternalSendCommand()),(0,n.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,`create_stream`),this._wrap(e.RedisClient.prototype,`create_stream`,this._getPatchCreateStream()),(0,n.isWrapped)(e.createClient)&&this._unwrap(e,`createClient`),this._wrap(e,`createClient`,this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,`internal_send_command`),this._unwrap(e.RedisClient.prototype,`create_stream`),this._unwrap(e,`createClient`))})]}_getPatchInternalSendCommand(){let t=this;return function(i){return function(a){if(arguments.length!==1||typeof a!=`object`)return i.apply(this,arguments);let o=t.getConfig(),d=s.trace.getSpan(s.context.active())===void 0;if(o.requireParentSpan===!0&&d)return i.apply(this,arguments);let f=o?.dbStatementSerializer||u.defaultDbStatementSerializer,p={};t._semconvStability&n.SemconvStability.OLD&&Object.assign(p,{[l.ATTR_DB_SYSTEM]:l.DB_SYSTEM_VALUE_REDIS,[l.ATTR_DB_STATEMENT]:f(a.command,a.args)}),t._semconvStability&n.SemconvStability.STABLE&&Object.assign(p,{[c.ATTR_DB_SYSTEM_NAME]:l.DB_SYSTEM_NAME_VALUE_REDIS,[c.ATTR_DB_OPERATION_NAME]:a.command,[c.ATTR_DB_QUERY_TEXT]:f(a.command,a.args)});let m=t.tracer.startSpan(`${e.COMPONENT}-${a.command}`,{kind:s.SpanKind.CLIENT,attributes:p});if(this.connection_options){let e={};t._semconvStability&n.SemconvStability.OLD&&Object.assign(e,{[l.ATTR_NET_PEER_NAME]:this.connection_options.host,[l.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&n.SemconvStability.STABLE&&Object.assign(e,{[c.ATTR_SERVER_ADDRESS]:this.connection_options.host,[c.ATTR_SERVER_PORT]:this.connection_options.port}),m.setAttributes(e)}this.address&&t._semconvStability&n.SemconvStability.OLD&&m.setAttribute(l.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let h=arguments[0].callback;if(h){let e=s.context.active();arguments[0].callback=function(i,c){if(o?.responseHook){let e=o.responseHook;(0,n.safeExecuteInTheMiddle)(()=>{e(m,a.command,a.args,c)},e=>{e&&t._diag.error(`Error executing responseHook`,e)},!0)}return(0,r.endSpan)(m,i),s.context.with(e,h,this,...arguments)}}try{return i.apply(this,arguments)}catch(e){throw(0,r.endSpan)(m,e),e}}}}_getPatchCreateClient(){return function(e){return(0,r.getTracedCreateClient)(e)}}_getPatchCreateStream(){return function(e){return(0,r.getTracedCreateStreamTrace)(e)}}};o(d,`COMPONENT`,`redis`),t.RedisInstrumentationV2_V3=d})),QP=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getClientAttributes=void 0;var n=(F(),e(A)),r=XP(),i=(L(),e(I));function a(e,t,a){let s={};return a&i.SemconvStability.OLD&&Object.assign(s,{[r.ATTR_DB_SYSTEM]:r.DB_SYSTEM_VALUE_REDIS,[r.ATTR_NET_PEER_NAME]:t?.socket?.host,[r.ATTR_NET_PEER_PORT]:t?.socket?.port,[r.ATTR_DB_CONNECTION_STRING]:o(e,t?.url)}),a&i.SemconvStability.STABLE&&Object.assign(s,{[n.ATTR_DB_SYSTEM_NAME]:r.DB_SYSTEM_NAME_VALUE_REDIS,[n.ATTR_SERVER_ADDRESS]:t?.socket?.host,[n.ATTR_SERVER_PORT]:t?.socket?.port}),s}t.getClientAttributes=a;function o(e,t){if(!(typeof t!=`string`||!t))try{let e=new URL(t);return e.searchParams.delete(`user_pwd`),e.username=``,e.password=``,e.href}catch(t){e.error(`failed to sanitize redis connection url`,t)}}})),$P=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.RedisInstrumentationV4_V5=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=QP(),s=WP(),c=JP(),l=(F(),e(A)),u=XP(),d=Symbol(`opentelemetry.instrumentation.redis.open_spans`),f=Symbol(`opentelemetry.instrumentation.redis.multi_command_options`),p=class e extends r.InstrumentationBase{constructor(e={}){super(c.PACKAGE_NAME,c.PACKAGE_VERSION,e),o(this,`_semconvStability`,void 0),this._semconvStability=e.semconvStability?e.semconvStability:(0,r.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,r.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition(`@redis/client`),this._getInstrumentationNodeModuleDefinition(`@node-redis/client`)]}_getInstrumentationNodeModuleDefinition(e){let t=new r.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,[`^1.0.0`],(e,t)=>{let n=e.transformCommandArguments;if(!n)return this._diag.error(`internal instrumentation error, missing transformCommandArguments function`),e;let i=t?.startsWith(`1.0.`)?`extendWithCommands`:`attachCommands`;return(0,r.isWrapped)(e?.[i])&&this._unwrap(e,i),this._wrap(e,i,this._getPatchExtendWithCommands(n)),e},e=>{(0,r.isWrapped)(e?.extendWithCommands)&&this._unwrap(e,`extendWithCommands`),(0,r.isWrapped)(e?.attachCommands)&&this._unwrap(e,`attachCommands`)}),n=new r.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,[`^1.0.0`,`^5.0.0`],e=>{let t=e?.default?.prototype;return(0,r.isWrapped)(t?.exec)&&this._unwrap(t,`exec`),this._wrap(t,`exec`,this._getPatchMultiCommandsExec(!1)),(0,r.isWrapped)(t?.execAsPipeline)&&this._unwrap(t,`execAsPipeline`),this._wrap(t,`execAsPipeline`,this._getPatchMultiCommandsExec(!0)),(0,r.isWrapped)(t?.addCommand)&&this._unwrap(t,`addCommand`),this._wrap(t,`addCommand`,this._getPatchMultiCommandsAddCommand()),e},e=>{let t=e?.default?.prototype;(0,r.isWrapped)(t?.exec)&&this._unwrap(t,`exec`),(0,r.isWrapped)(t?.addCommand)&&this._unwrap(t,`addCommand`)}),i=new r.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,[`^1.0.0`,`^5.0.0`],e=>{let t=e?.default?.prototype;return t?.multi&&((0,r.isWrapped)(t?.multi)&&this._unwrap(t,`multi`),this._wrap(t,`multi`,this._getPatchRedisClientMulti())),t?.MULTI&&((0,r.isWrapped)(t?.MULTI)&&this._unwrap(t,`MULTI`),this._wrap(t,`MULTI`,this._getPatchRedisClientMulti())),(0,r.isWrapped)(t?.sendCommand)&&this._unwrap(t,`sendCommand`),this._wrap(t,`sendCommand`,this._getPatchRedisClientSendCommand()),this._wrap(t,`connect`,this._getPatchedClientConnect()),e},e=>{let t=e?.default?.prototype;(0,r.isWrapped)(t?.multi)&&this._unwrap(t,`multi`),(0,r.isWrapped)(t?.MULTI)&&this._unwrap(t,`MULTI`),(0,r.isWrapped)(t?.sendCommand)&&this._unwrap(t,`sendCommand`)});return new r.InstrumentationNodeModuleDefinition(e,[`^1.0.0`,`^5.0.0`],e=>e,()=>{},[t,n,i])}_getPatchExtendWithCommands(e){let t=this;return function(n){return function(r){if(r?.BaseClass?.name!==`RedisClient`)return n.apply(this,arguments);let i=r.executor;return r.executor=function(n,r){let a=e(n,r).args;return t._traceClientCommand(i,this,arguments,a)},n.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let t=this;return function(n){return function(){let r=n.apply(this,arguments);return typeof r?.then==`function`?r.then(n=>{let r=this[d];return t._endSpansWithRedisReplies(r,n,e),n}).catch(n=>{let r=this[d];if(!r)t._diag.error(`cannot find open spans to end for multi/pipeline`);else{let i=n.constructor.name===`MultiErrorReply`?n.replies:Array(r.length).fill(n);t._endSpansWithRedisReplies(r,i,e)}return Promise.reject(n)}):(t._diag.error(`non-promise result when patching exec/execAsPipeline`),r)}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(t){return function(n){return e._traceClientCommand(t,this,arguments,n)}}}_getPatchRedisClientMulti(){return function(e){return function(){let t=e.apply(this,arguments);return t[f]=this.options,t}}}_getPatchRedisClientSendCommand(){let e=this;return function(t){return function(n){return e._traceClientCommand(t,this,arguments,n)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let a=this.options,o=(0,i.getClientAttributes)(t._diag,a,t._semconvStability),s=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:n.SpanKind.CLIENT,attributes:o});return n.context.with(n.trace.setSpan(n.context.active(),s),()=>r.apply(this)).then(e=>(s.end(),e)).catch(e=>(s.recordException(e),s.setStatus({code:n.SpanStatusCode.ERROR,message:e.message}),s.end(),Promise.reject(e)))}}}_traceClientCommand(t,a,o,c){if(n.trace.getSpan(n.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(a,o);let p=a.options||a[f],m=c[0],h=c.slice(1),g=this.getConfig().dbStatementSerializer||s.defaultDbStatementSerializer,_=(0,i.getClientAttributes)(this._diag,p,this._semconvStability);this._semconvStability&r.SemconvStability.STABLE&&(_[l.ATTR_DB_OPERATION_NAME]=m);try{let e=g(m,h);e!=null&&(this._semconvStability&r.SemconvStability.OLD&&(_[u.ATTR_DB_STATEMENT]=e),this._semconvStability&r.SemconvStability.STABLE&&(_[l.ATTR_DB_QUERY_TEXT]=e))}catch(e){this._diag.error(`dbStatementSerializer throw an exception`,e,{commandName:m})}let v=this.tracer.startSpan(`${e.COMPONENT}-${m}`,{kind:n.SpanKind.CLIENT,attributes:_}),y=n.context.with(n.trace.setSpan(n.context.active(),v),()=>t.apply(a,o));if(typeof y?.then==`function`)y.then(e=>{this._endSpanWithResponse(v,m,h,e,void 0)},e=>{this._endSpanWithResponse(v,m,h,null,e)});else{let e=y;e[d]=e[d]||[],e[d].push({span:v,commandName:m,commandArgs:h})}return y}_endSpansWithRedisReplies(e,t,n=!1){if(!e)return this._diag.error(`cannot find open spans to end for redis multi/pipeline`);if(t.length!==e.length)return this._diag.error(`number of multi command spans does not match response from redis`);let i=e.map(e=>e.commandName),a=i.every(e=>e===i[0])?(n?`PIPELINE `:`MULTI `)+i[0]:n?`PIPELINE`:`MULTI`;for(let n=0;n<e.length;n++){let{span:o,commandArgs:s}=e[n],c=t[n],[u,d]=c instanceof Error?[null,c]:[c,void 0];this._semconvStability&r.SemconvStability.STABLE&&o.setAttribute(l.ATTR_DB_OPERATION_NAME,a),this._endSpanWithResponse(o,i[n],s,u,d)}}_endSpanWithResponse(e,t,r,i,a){let{responseHook:o}=this.getConfig();if(!a&&o)try{o(e,t,r,i)}catch(e){this._diag.error(`responseHook throw an exception`,e)}a&&(e.recordException(a),e.setStatus({code:n.SpanStatusCode.ERROR,message:a?.message})),e.end()}};o(p,`COMPONENT`,`redis`),t.RedisInstrumentationV4_V5=p})),eF=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.RedisInstrumentation=void 0;var n=(L(),e(I)),r=JP(),i=ZP(),s=$P(),c={requireParentSpan:!1};t.RedisInstrumentation=class extends n.InstrumentationBase{constructor(e={}){let t={...c,...e};super(r.PACKAGE_NAME,r.PACKAGE_VERSION,t),o(this,`instrumentationV2_V3`,void 0),o(this,`instrumentationV4_V5`,void 0),o(this,`initialized`,!1),this.instrumentationV2_V3=new i.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new s.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let t={...c,...e};super.setConfig(t),this.initialized&&(this.instrumentationV2_V3.setConfig(t),this.instrumentationV4_V5.setConfig(t))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}}})),tF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RedisInstrumentation=void 0;var t=eF();Object.defineProperty(e,`RedisInstrumentation`,{enumerable:!0,get:function(){return t.RedisInstrumentation}})}));function nF(e,t){return e.includes(t.toLowerCase())}function rF(e){if(nF(uF,e))return`cache.get`;if(nF(dF,e))return`cache.put`}function iF(e,t){return t.some(t=>e.startsWith(t))}function aF(e,t){try{if(t.length===0)return;let n=e=>typeof e==`string`||typeof e==`number`||Buffer.isBuffer(e)?[e.toString()]:Array.isArray(e)?cF(e.map(e=>n(e))):[`<unknown>`],r=t[0];return nF(lF,e)&&r!=null?n(r):cF(t.map(e=>n(e)))}catch{return}}function oF(e,t,n){if(!rF(e))return!1;for(let e of t)if(iF(e,n))return!0;return!1}function sF(e){let t=e=>{try{return Buffer.isBuffer(e)?e.byteLength:typeof e==`string`?e.length:typeof e==`number`?e.toString().length:e==null?0:JSON.stringify(e).length}catch{return}};return Array.isArray(e)?e.reduce((e,n)=>{let r=t(n);return typeof r==`number`?e===void 0?r:e+r:e},0):t(e)}function cF(e){let t=[],n=e=>{e.forEach(e=>{Array.isArray(e)?n(e):t.push(e)})};return n(e),t}var lF,uF,dF,fF=n((()=>{lF=[`get`,`set`,`setex`],uF=[`get`,`mget`],dF=[`set`,`setex`]})),pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF=n((()=>{pF=qP(),mF=tF(),X(),$(),fF(),hF=`Redis`,gF={},_F=(e,t,n,r)=>{e.setAttribute(K,`auto.db.otel.redis`);let i=aF(t,n),a=rF(t);if(!i||!a||!gF.cachePrefixes||!oF(t,i,gF.cachePrefixes))return;let o=q(e).data[`net.peer.name`],s=q(e).data[`net.peer.port`];s&&o&&e.setAttributes({"network.peer.address":o,"network.peer.port":s});let c=sF(r);c&&e.setAttribute(Il,c),nF(uF,t)&&c!==void 0&&e.setAttribute(Pl,c>0),e.setAttributes({[G]:a,[Fl]:i});let l=i.join(`, `);e.updateName(gF.maxCacheKeyLength?Js(l,gF.maxCacheKeyLength):l)},vF=Z(`${hF}.IORedis`,()=>new pF.IORedisInstrumentation({responseHook:_F})),yF=Z(`${hF}.Redis`,()=>new mF.RedisInstrumentation({responseHook:_F})),bF=Object.assign(()=>{vF(),yF()},{id:hF}),xF=((e={})=>({name:hF,setupOnce(){gF=e,bF()}})),SF=Y(xF)})),wF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EVENT_LISTENERS_SET=void 0,e.EVENT_LISTENERS_SET=Symbol(`opentelemetry.instrumentation.pg.eventListenersSet`)})),TF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=void 0,(function(e){e.PG_VALUES=`db.postgresql.values`,e.PG_PLAN=`db.postgresql.plan`,e.IDLE_TIMEOUT_MILLIS=`db.postgresql.idle.timeout.millis`,e.MAX_CLIENT=`db.postgresql.max.client`})(e.AttributeNames||(e.AttributeNames={}))})),EF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=e.METRIC_DB_CLIENT_CONNECTION_COUNT=e.DB_SYSTEM_VALUE_POSTGRESQL=e.DB_CLIENT_CONNECTION_STATE_VALUE_USED=e.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_USER=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_NAME=e.ATTR_DB_CONNECTION_STRING=e.ATTR_DB_CLIENT_CONNECTION_STATE=e.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0,e.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=`db.client.connection.pool.name`,e.ATTR_DB_CLIENT_CONNECTION_STATE=`db.client.connection.state`,e.ATTR_DB_CONNECTION_STRING=`db.connection_string`,e.ATTR_DB_NAME=`db.name`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_DB_USER=`db.user`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=`idle`,e.DB_CLIENT_CONNECTION_STATE_VALUE_USED=`used`,e.DB_SYSTEM_VALUE_POSTGRESQL=`postgresql`,e.METRIC_DB_CLIENT_CONNECTION_COUNT=`db.client.connection.count`,e.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=`db.client.connection.pending_requests`})),DF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SpanNames=void 0,(function(e){e.QUERY_PREFIX=`pg.query`,e.CONNECT=`pg.connect`,e.POOL_CONNECT=`pg-pool.connect`})(e.SpanNames||(e.SpanNames={}))})),OF=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.sanitizedErrorMessage=t.isObjectWithTextString=t.getErrorMessage=t.patchClientConnectCallback=t.patchCallbackPGPool=t.updateCounter=t.getPoolName=t.patchCallback=t.handleExecutionResult=t.handleConfigQuery=t.shouldSkipInstrumentation=t.getSemanticAttributesFromPoolConnection=t.getSemanticAttributesFromConnection=t.getConnectionString=t.parseAndMaskConnectionString=t.parseNormalizedOperationName=t.getQuerySpanName=void 0;var n=(T(),e(k)),r=TF(),i=(F(),e(A)),a=EF(),o=(L(),e(I)),s=DF();function c(e,t){if(!t)return s.SpanNames.QUERY_PREFIX;let n=typeof t.name==`string`&&t.name?t.name:l(t.text);return`${s.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:``}`}t.getQuerySpanName=c;function l(e){let t=e.trim(),n=t.indexOf(` `),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(`;`)?r.slice(0,-1):r}t.parseNormalizedOperationName=l;function u(e){try{let t=new URL(e);return t.username=``,t.password=``,t.toString()}catch{return`postgresql://localhost:5432/`}}t.parseAndMaskConnectionString=u;function d(e){return`connectionString`in e&&e.connectionString?u(e.connectionString):`postgresql://${e.host||`localhost`}:${e.port||5432}/${e.database||``}`}t.getConnectionString=d;function f(e){if(Number.isInteger(e))return e}function p(e,t){let n={};return t&o.SemconvStability.OLD&&(n={...n,[a.ATTR_DB_SYSTEM]:a.DB_SYSTEM_VALUE_POSTGRESQL,[a.ATTR_DB_NAME]:e.database,[a.ATTR_DB_CONNECTION_STRING]:d(e),[a.ATTR_DB_USER]:e.user,[a.ATTR_NET_PEER_NAME]:e.host,[a.ATTR_NET_PEER_PORT]:f(e.port)}),t&o.SemconvStability.STABLE&&(n={...n,[i.ATTR_DB_SYSTEM_NAME]:i.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[i.ATTR_DB_NAMESPACE]:e.namespace,[i.ATTR_SERVER_ADDRESS]:e.host,[i.ATTR_SERVER_PORT]:f(e.port)}),n}t.getSemanticAttributesFromConnection=p;function m(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let s={[r.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[r.AttributeNames.MAX_CLIENT]:e.maxClient};return t&o.SemconvStability.OLD&&(s={...s,[a.ATTR_DB_SYSTEM]:a.DB_SYSTEM_VALUE_POSTGRESQL,[a.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[a.ATTR_DB_CONNECTION_STRING]:d(e),[a.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[a.ATTR_NET_PEER_PORT]:Number(n?.port)||f(e.port),[a.ATTR_DB_USER]:n?.username??e.user}),t&o.SemconvStability.STABLE&&(s={...s,[i.ATTR_DB_SYSTEM_NAME]:i.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[i.ATTR_DB_NAMESPACE]:e.namespace,[i.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[i.ATTR_SERVER_PORT]:Number(n?.port)||f(e.port)}),s}t.getSemanticAttributesFromPoolConnection=m;function h(e){return e.requireParentSpan===!0&&n.trace.getSpan(n.context.active())===void 0}t.shouldSkipInstrumentation=h;function g(e,t,s,l){let{connectionParameters:u}=this,d=u.database,f=c(d,l),m=e.startSpan(f,{kind:n.SpanKind.CLIENT,attributes:p(u,s)});if(!l)return m;if(l.text&&(s&o.SemconvStability.OLD&&m.setAttribute(a.ATTR_DB_STATEMENT,l.text),s&o.SemconvStability.STABLE&&m.setAttribute(i.ATTR_DB_QUERY_TEXT,l.text)),t.enhancedDatabaseReporting&&Array.isArray(l.values))try{let e=l.values.map(e=>e==null?`null`:e instanceof Buffer?e.toString():typeof e==`object`?typeof e.toPostgres==`function`?e.toPostgres():JSON.stringify(e):e.toString());m.setAttribute(r.AttributeNames.PG_VALUES,e)}catch(e){n.diag.error(`failed to stringify `,l.values,e)}return typeof l.name==`string`&&m.setAttribute(r.AttributeNames.PG_PLAN,l.name),m}t.handleConfigQuery=g;function _(e,t,r){typeof e.responseHook==`function`&&(0,o.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:r})},e=>{e&&n.diag.error(`Error running response hook`,e)},!0)}t.handleExecutionResult=_;function v(e,t,r,a,o){return function(s,c){s?(Object.prototype.hasOwnProperty.call(s,`code`)&&(a[i.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(E(s)),t.setStatus({code:n.SpanStatusCode.ERROR,message:s.message})):_(e,t,c),o(),t.end(),r.call(this,s,c)}}t.patchCallback=v;function y(e){let t=``;return t+=(e?.host?`${e.host}`:`unknown_host`)+`:`,t+=(e?.port?`${e.port}`:`unknown_port`)+`/`,t+=e?.database?`${e.database}`:`unknown_database`,t.trim()}t.getPoolName=y;function b(e,t,n,r,i){let o=t.totalCount,s=t.waitingCount,c=t.idleCount,l=o-c;return n.add(l-i.used,{[a.ATTR_DB_CLIENT_CONNECTION_STATE]:a.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[a.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-i.idle,{[a.ATTR_DB_CLIENT_CONNECTION_STATE]:a.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[a.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(s-i.pending,{[a.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:l,idle:c,pending:s}}t.updateCounter=b;function x(e,t){return function(r,i,a){r&&(r instanceof Error&&e.recordException(E(r)),e.setStatus({code:n.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,i,a)}}t.patchCallbackPGPool=x;function S(e,t){return function(r){r&&(r instanceof Error&&e.recordException(E(r)),e.setStatus({code:n.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}t.patchClientConnectCallback=S;function C(e){return typeof e==`object`&&e&&`message`in e?String(e.message):void 0}t.getErrorMessage=C;function w(e){return typeof e==`object`&&typeof e?.text==`string`}t.isObjectWithTextString=w;function E(e){return`PostgreSQL error of type '${e?.name??`PostgreSQLError`}' occurred (code: ${e?.code??`UNKNOWN`})`}t.sanitizedErrorMessage=E})),kF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.66.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-pg`})),AF=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.PgInstrumentation=void 0;var n=(L(),e(I)),r=(T(),e(k)),i=wF(),s=OF(),c=jP(),l=kF(),u=DF(),d=(fi(),e(ui)),f=(F(),e(A)),p=EF();function m(e){return e[Symbol.toStringTag]===`Module`?e.default:e}t.PgInstrumentation=class extends n.InstrumentationBase{constructor(e={}){super(l.PACKAGE_NAME,l.PACKAGE_VERSION,e),o(this,`_connectionsCounter`,{used:0,idle:0,pending:0}),o(this,`_semconvStability`,void 0),this._semconvStability=(0,n.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(f.METRIC_DB_CLIENT_OPERATION_DURATION,{description:`Duration of database client operations.`,unit:`s`,valueType:r.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(p.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:`The number of connections that are currently in state described by the state attribute.`,unit:`{connection}`}),this._connectionPendingRequests=this.meter.createUpDownCounter(p.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:`The number of current pending requests for an open connection.`,unit:`{connection}`})}init(){let e=[`>=8.0.3 <9`],t=[`>=2.0.0 <4`],r=new n.InstrumentationNodeModuleFile(`pg/lib/native/client.js`,e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new n.InstrumentationNodeModuleFile(`pg/lib/client.js`,e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this));return[new n.InstrumentationNodeModuleDefinition(`pg`,e,e=>{let t=m(e);return this._patchPgClient(t.Client),e},e=>{let t=m(e);return this._unpatchPgClient(t.Client),e},[i,r]),new n.InstrumentationNodeModuleDefinition(`pg-pool`,t,e=>{let t=m(e);return(0,n.isWrapped)(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),this._wrap(t.prototype,`connect`,this._getPoolConnectPatch()),t},e=>{let t=m(e);(0,n.isWrapped)(t.prototype.connect)&&this._unwrap(t.prototype,`connect`)})]}_patchPgClient(e){if(!e)return;let t=m(e);return(0,n.isWrapped)(t.prototype.query)&&this._unwrap(t.prototype,`query`),(0,n.isWrapped)(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),this._wrap(t.prototype,`query`,this._getClientQueryPatch()),this._wrap(t.prototype,`connect`,this._getClientConnectPatch()),e}_unpatchPgClient(e){let t=m(e);return(0,n.isWrapped)(t.prototype.query)&&this._unwrap(t.prototype,`query`),(0,n.isWrapped)(t.prototype.connect)&&this._unwrap(t.prototype,`connect`),e}_getClientConnectPatch(){let e=this;return t=>function(n){let i=e.getConfig();if(s.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return t.call(this,n);let a=e.tracer.startSpan(u.SpanNames.CONNECT,{kind:r.SpanKind.CLIENT,attributes:s.getSemanticAttributesFromConnection(this,e._semconvStability)});if(n){let e=r.trace.getSpan(r.context.active());n=s.patchClientConnectCallback(a,n),e&&(n=r.context.bind(r.context.active(),n))}return h(a,r.context.with(r.trace.setSpan(r.context.active(),a),()=>t.call(this,n)))}}recordOperationDuration(e,t){let r={},i=[f.ATTR_DB_NAMESPACE,f.ATTR_ERROR_TYPE,f.ATTR_SERVER_PORT,f.ATTR_SERVER_ADDRESS,f.ATTR_DB_OPERATION_NAME];this._semconvStability&n.SemconvStability.OLD&&i.push(p.ATTR_DB_SYSTEM),this._semconvStability&n.SemconvStability.STABLE&&i.push(f.ATTR_DB_SYSTEM_NAME),i.forEach(t=>{t in e&&(r[t]=e[t])});let a=(0,d.hrTimeToMilliseconds)((0,d.hrTimeDuration)(t,(0,d.hrTime)()))/1e3;this._operationDuration.record(a,r)}_getClientQueryPatch(){let e=this;return t=>(this._diag.debug(`Patching pg.Client.prototype.query`),function(...i){if(s.shouldSkipInstrumentation(e.getConfig()))return t.apply(this,i);let a=(0,d.hrTime)(),o=i[0],l=typeof o==`string`,u=s.isObjectWithTextString(o),m=l?{text:o,values:Array.isArray(i[1])?i[1]:void 0}:u?{...o,name:o.name,text:o.text,values:o.values??(Array.isArray(i[1])?i[1]:void 0)}:void 0,h={[p.ATTR_DB_SYSTEM]:p.DB_SYSTEM_VALUE_POSTGRESQL,[f.ATTR_DB_NAMESPACE]:this.database,[f.ATTR_SERVER_PORT]:this.connectionParameters.port,[f.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};m?.text&&(h[f.ATTR_DB_OPERATION_NAME]=s.parseNormalizedOperationName(m?.text));let g=()=>{e.recordOperationDuration(h,a)},_=e.getConfig(),v=s.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,m);if(_.addSqlCommenterCommentToQueries&&(l?i[0]=(0,c.addSqlCommenterComment)(v,o):u&&!(`name`in o)&&(i[0]={...o,text:(0,c.addSqlCommenterComment)(v,o.text)})),i.length>0){let t=r.trace.getSpan(r.context.active());if(typeof i[i.length-1]==`function`)i[i.length-1]=s.patchCallback(_,v,i[i.length-1],h,g),t&&(i[i.length-1]=r.context.bind(r.context.active(),i[i.length-1]));else if(typeof m?.callback==`function`){let n=s.patchCallback(e.getConfig(),v,m.callback,h,g);t&&(n=r.context.bind(r.context.active(),n)),i[0].callback=n}}let{requestHook:y}=_;typeof y==`function`&&m&&(0,n.safeExecuteInTheMiddle)(()=>{let{database:e,host:t,port:n,user:r}=this.connectionParameters;y(v,{connection:{database:e,host:t,port:n,user:r},query:{text:m.text,values:m.values,name:m.name}})},t=>{t&&e._diag.error(`Error running query hook`,t)},!0);let b;try{b=t.apply(this,i)}catch(e){throw e instanceof Error&&v.recordException(s.sanitizedErrorMessage(e)),v.setStatus({code:r.SpanStatusCode.ERROR,message:s.getErrorMessage(e)}),v.end(),e}return b instanceof Promise?b.then(t=>new Promise(n=>{s.handleExecutionResult(e.getConfig(),v,t),g(),v.end(),n(t)})).catch(e=>new Promise((t,n)=>{e instanceof Error&&v.recordException(s.sanitizedErrorMessage(e)),v.setStatus({code:r.SpanStatusCode.ERROR,message:e.message}),g(),v.end(),n(e)})):b})}_setPoolConnectEventListeners(e){if(e[i.EVENT_LISTENERS_SET])return;let t=s.getPoolName(e.options);e.on(`connect`,()=>{this._connectionsCounter=s.updateCounter(t,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on(`acquire`,()=>{this._connectionsCounter=s.updateCounter(t,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on(`remove`,()=>{this._connectionsCounter=s.updateCounter(t,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on(`release`,()=>{this._connectionsCounter=s.updateCounter(t,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[i.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return t=>function(n){let i=e.getConfig();if(s.shouldSkipInstrumentation(i)||(e._setPoolConnectEventListeners(this),i.ignoreConnectSpans))return t.call(this,n);let a=e.tracer.startSpan(u.SpanNames.POOL_CONNECT,{kind:r.SpanKind.CLIENT,attributes:s.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(n){let e=r.trace.getSpan(r.context.active());n=s.patchCallbackPGPool(a,n),e&&(n=r.context.bind(r.context.active(),n))}return h(a,r.context.with(r.trace.setSpan(r.context.active(),a),()=>t.call(this,n)))}}};function h(e,t){if(!(t instanceof Promise))return t;let n=t;return r.context.bind(r.context.active(),n.then(t=>(e.end(),t)).catch(t=>(t instanceof Error&&e.recordException(s.sanitizedErrorMessage(t)),e.setStatus({code:r.SpanStatusCode.ERROR,message:s.getErrorMessage(t)}),e.end(),Promise.reject(t))))}})),jF=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=e.PgInstrumentation=void 0;var t=AF();Object.defineProperty(e,`PgInstrumentation`,{enumerable:!0,get:function(){return t.PgInstrumentation}});var n=TF();Object.defineProperty(e,`AttributeNames`,{enumerable:!0,get:function(){return n.AttributeNames}})})),MF,NF,PF,FF,IF,LF=n((()=>{MF=jF(),X(),$(),NF=`Postgres`,PF=Z(NF,MF.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(e){xk(e,`auto.db.otel.postgres`)},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),FF=(e=>({name:NF,setupOnce(){PF(e)}})),IF=Y(FF)})),RF,zF,BF,VF,HF,UF,WF,GF,KF=n((()=>{T(),L(),F(),X(),$(),Yk(),RF=`PostgresJs`,zF=[`>=3.0.0 <4`],BF=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,VF=Symbol.for(`sentry.query.from.instrumented.sql`),HF=Z(RF,e=>new UF({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),UF=class extends $a{constructor(e){super(`sentry-postgres-js`,So,e)}init(){let e=new io(`postgres`,zF,e=>{try{return this._patchPostgres(e)}catch(t){return Jk&&V.error(`Failed to patch postgres module:`,t),e}},e=>e);return[`src`,`cf/src`,`cjs/src`].forEach(t=>{e.files.push(new oo(`postgres/${t}/query.js`,zF,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let t=typeof e==`function`,n=t?e:e.default;if(typeof n!=`function`)return Jk&&V.warn(`postgres module does not export a function. Skipping instrumentation.`),e;let r=this,i=function(...e){let t=Reflect.construct(n,e);if(!t||typeof t!=`function`)return Jk&&V.warn(`postgres() did not return a valid instance`),t;let i=r.getConfig();return F_(t,{requireParentSpan:i.requireParentSpan,requestHook:i.requestHook})};Object.setPrototypeOf(i,n),Object.setPrototypeOf(i.prototype,n.prototype);for(let e of Object.getOwnPropertyNames(n))if(![`length`,`name`,`prototype`].includes(e)){let t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(i,e,t)}return t?i:(QS(e,`default`,i),e)}_shouldCreateSpans(){let e=this.getConfig();return D.getSpan(O.active())!==void 0||!e.requireParentSpan}_setOperationName(e,t,n){if(n){e.setAttribute(P,n);return}let r=t?.match(BF);r?.[1]&&e.setAttribute(P,r[1].toUpperCase())}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((e,t,n)=>n===0?t:`${e}$${n}${t}`,``)}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,``).replace(/\/\*[\s\S]*?\*\//g,``).replace(/;\s*$/,``).replace(/\s+/g,` `).trim().replace(/\bX'[0-9A-Fa-f]*'/gi,`?`).replace(/\bB'[01]*'/gi,`?`).replace(/'(?:[^']|'')*'/g,`?`).replace(/\b0x[0-9A-Fa-f]+/gi,`?`).replace(/\b(?:TRUE|FALSE)\b/gi,`?`).replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,`?`).replace(/-?\b\d+\.\d+\b/g,`?`).replace(/-?\.\d+\b/g,`?`).replace(/(?<!\$)-?\b\d+\b/g,`?`).replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,`IN (?)`).replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,`IN ($?)`):`Unknown SQL Query`}_patchQueryPrototype(e){let t=this,n=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...e){if(this[VF]||!t._shouldCreateSpans())return n.apply(this,e);let r=t._reconstructQuery(this.strings),i=t._sanitizeSqlQuery(r);return hf({name:i||`postgresjs.query`,op:`db`},r=>{xk(r,`auto.db.postgresjs`),r.setAttributes({[ce]:`postgres`,[ie]:i});let{requestHook:a}=t.getConfig();a&&Ka(()=>a(r,i,void 0),e=>{e&&(r.setAttribute(`sentry.hook.error`,`requestHook failed`),Jk&&V.error(`Error in requestHook for ${RF} integration:`,e))},!0);let o=this.resolve;this.resolve=new Proxy(o,{apply:(e,n,a)=>{try{t._setOperationName(r,i,a?.[0]?.command),r.end()}catch(e){Jk&&V.error(`Error ending span in resolve callback:`,e)}return Reflect.apply(e,n,a)}});let s=this.reject;this.reject=new Proxy(s,{apply:(e,n,a)=>{try{r.setStatus({code:2,message:a?.[0]?.message||`unknown_error`}),r.setAttribute(N,a?.[0]?.code||`unknown`),r.setAttribute(pe,a?.[0]?.name||`unknown`),t._setOperationName(r,i),r.end()}catch(e){Jk&&V.error(`Error ending span in reject callback:`,e)}return Reflect.apply(e,n,a)}});try{return n.apply(this,e)}catch(e){throw r.setStatus({code:2,message:e instanceof Error?e.message:`unknown_error`}),r.end(),e}})},e.Query.prototype.handle.__sentry_original__=n,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},WF=(e=>({name:RF,setupOnce(){HF(e)}})),GF=Y(WF)})),qF,JF,YF=n((()=>{qF=class{emit(e){}},JF=new qF})),XF,ZF,QF=n((()=>{YF(),XF=class{getLogger(e,t,n){return new qF}},ZF=new XF})),$F,eI=n((()=>{YF(),$F=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):JF}}})),tI,nI=n((()=>{QF(),eI(),tI=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new $F(this,e,t,n)}_getDelegate(){return this._delegate??ZF}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),rI,iI=n((()=>{rI=typeof globalThis==`object`?globalThis:global})),aI=n((()=>{iI()})),oI=n((()=>{aI()}));function sI(e,t,n){return r=>r===e?t:n}var cI,lI,uI=n((()=>{oI(),cI=Symbol.for(`io.opentelemetry.js.api.logs`),lI=rI})),dI,fI=n((()=>{uI(),QF(),nI(),dI=class e{constructor(){this._proxyLoggerProvider=new tI}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return lI[cI]?this.getLoggerProvider():(lI[cI]=sI(1,e,ZF),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return lI[cI]?.call(lI,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete lI[cI],this._proxyLoggerProvider=new tI}}})),pI,mI=n((()=>{YF(),QF(),eI(),nI(),fI(),pI=dI.getInstance()}));function hI(e,t,n){if(!gI(e))return E.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,`$1`);let r=CI(e);if(!r)return!1;let i=[],a=_I(r,t,i,n);return a&&!n?.includePrerelease?bI(r,i):a}function gI(e){return typeof e==`string`&&PI.test(e)}function _I(e,t,n,r){if(t.includes(`||`)){let i=t.trim().split(`||`);for(let t of i)if(vI(e,t,n,r))return!0;return!1}else if(t.includes(` - `))t=NI(t,r);else if(t.includes(` `)){let i=t.trim().replace(/\s{2,}/g,` `).split(` `);for(let t of i)if(!vI(e,t,n,r))return!1;return!0}return vI(e,t,n,r)}function vI(e,t,n,r){if(t=xI(t,r),t.includes(` `))return _I(e,t,n,r);{let r=wI(t);return n.push(r),yI(e,r)}}function yI(e,t){if(t.invalid)return!1;if(!t.version||TI(t.version))return!0;let n=kI(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],i=t.prereleaseSegments||[];n=!r.length&&!i.length?0:!r.length&&i.length?1:r.length&&!i.length?-1:kI(r,i)}return II[t.op]?.includes(n)}function bI(e,t){return e.prerelease?t.some(t=>t.prerelease&&t.version===e.version):!0}function xI(e,t){return e=e.trim(),e=jI(e,t),e=AI(e),e=MI(e,t),e=e.trim(),e}function SI(e){return!e||e.toLowerCase()===`x`||e===`*`}function CI(e){let t=e.match(PI);if(!t){E.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,i=t.groups.build,a=n.split(`.`),o=r?.split(`.`);return{op:void 0,version:n,versionSegments:a,versionSegmentCount:a.length,prerelease:r,prereleaseSegments:o,prereleaseSegmentCount:o?o.length:0,build:i}}function wI(e){if(!e)return{};let t=e.match(FI);if(!t)return E.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,i=t.groups.prerelease,a=t.groups.build,o=r.split(`.`),s=i?.split(`.`);return n===`==`&&(n=`=`),{op:n||`=`,version:r,versionSegments:o,versionSegmentCount:o.length,prerelease:i,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:a}}function TI(e){return e===`*`||e===`x`||e===`X`}function EI(e){let t=parseInt(e,10);return isNaN(t)?e:t}function DI(e,t){if(typeof e==typeof t){if(typeof e==`number`||typeof e==`string`)return[e,t];throw Error(`Version segments can only be strings or numbers`)}else return[String(e),String(t)]}function OI(e,t){if(TI(e)||TI(t))return 0;let[n,r]=DI(EI(e),EI(t));return n>r?1:n<r?-1:0}function kI(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=OI(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0}function AI(e){let t=QI;return e.replace(t,(e,t,n,r,i)=>{let a;return a=SI(t)?``:SI(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:SI(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:i?`>=${t}.${n}.${r}-${i} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,a})}function jI(e,t){let n=eL,r=t?.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>{let o;return o=SI(t)?``:SI(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:SI(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i}-${a} <${+t+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i}${r} <${t}.${n}.${+i+1}-0`:`>=${t}.${n}.${i}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${i} <${+t+1}.0.0-0`,o})}function MI(e,t){let n=JI;return e.replace(n,(e,n,r,i,a,o)=>{let s=SI(r),c=s||SI(i),l=c||SI(a),u=l;return n===`=`&&u&&(n=``),o=t?.includePrerelease?`-0`:``,s?e=n===`>`||n===`<`?`<0.0.0-0`:`*`:n&&u?(c&&(i=0),a=0,n===`>`?(n=`>=`,c?(r=+r+1,i=0,a=0):(i=+i+1,a=0)):n===`<=`&&(n=`<`,c?r=+r+1:i=+i+1),n===`<`&&(o=`-0`),e=`${n+r}.${i}.${a}${o}`):c?e=`>=${r}.0.0${o} <${+r+1}.0.0-0`:l&&(e=`>=${r}.${i}.0${o} <${r}.${+i+1}.0-0`),e})}function NI(e,t){let n=XI;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>(n=SI(r)?``:SI(i)?`>=${r}.0.0${t?.includePrerelease?`-0`:``}`:SI(a)?`>=${r}.${i}.0${t?.includePrerelease?`-0`:``}`:o?`>=${n}`:`>=${n}${t?.includePrerelease?`-0`:``}`,c=SI(l)?``:SI(u)?`<${+l+1}.0.0-0`:SI(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t?.includePrerelease?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()))}var PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL=n((()=>{T(),PI=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,FI=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,II={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},LI=`[a-zA-Z0-9-]`,RI=`0|[1-9]\\d*`,zI=`\\d*[a-zA-Z-]${LI}*`,BI=`((?:<|>)?=?)`,VI=`(?:${RI}|${zI})`,HI=`(?:-(${VI}(?:\\.${VI})*))`,UI=`${LI}+`,WI=`(?:\\+(${UI}(?:\\.${UI})*))`,GI=`${RI}|x|X|\\*`,KI=`[v=\\s]*(${GI})(?:\\.(${GI})(?:\\.(${GI})(?:${HI})?${WI}?)?)?`,qI=`^${BI}\\s*${KI}$`,JI=new RegExp(qI),YI=`^\\s*(${KI})\\s+-\\s+(${KI})\\s*$`,XI=new RegExp(YI),ZI=`^(?:~>?)${KI}$`,QI=new RegExp(ZI),$I=`^(?:\\^)${KI}$`,eL=new RegExp($I)}));function nL(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function rL(e){e&&e.logger&&(typeof e.logger==`function`?iL=e.logger:iL(`new logger isn't a function, not replacing`))}var iL,aL,oL,sL,cL,lL=n((()=>{iL=console.error.bind(console),aL=(e,t,n)=>{if(!e||!e[t]){iL(`no original function `+String(t)+` to wrap`);return}if(!n){iL(`no wrapper function`),iL(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){iL(`original object and wrapper must be functions`);return}let i=n(r,t);return nL(i,`__original`,r),nL(i,`__unwrap`,()=>{e[t]===i&&nL(e,t,r)}),nL(i,`__wrapped`,!0),nL(e,t,i),i},oL=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{iL(`must provide one or more modules to patch`),iL(Error().stack);return}if(!(t&&Array.isArray(t))){iL(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{aL(e,t,n)})})},sL=(e,t)=>{if(!e||!e[t]){iL(`no function to unwrap.`),iL(Error().stack);return}let n=e[t];if(!n.__unwrap)iL(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},cL=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{iL(`must provide one or more modules to patch`),iL(Error().stack);return}if(!(t&&Array.isArray(t))){iL(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{sL(e,t)})})},rL.wrap=aL,rL.massWrap=oL,rL.unwrap=sL,rL.massUnwrap=cL})),uL,dL=n((()=>{T(),mI(),lL(),a(),uL=class{constructor(e,t,n){o(this,`instrumentationName`,void 0),o(this,`instrumentationVersion`,void 0),o(this,`_config`,{}),o(this,`_tracer`,void 0),o(this,`_meter`,void 0),o(this,`_logger`,void 0),o(this,`_diag`,void 0),o(this,`_wrap`,aL),o(this,`_unwrap`,sL),o(this,`_massWrap`,oL),o(this,`_massUnwrap`,cL),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=E.createComponentLogger({namespace:e}),this._tracer=D.getTracer(e,t),this._meter=v.getMeter(e,t),this._logger=pI.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}}})),fL,pL,mL=n((()=>{a(),fL=class{constructor(){o(this,`hooks`,[]),o(this,`children`,new Map)}},pL=class{constructor(){o(this,`_trie`,new fL),o(this,`_counter`,0)}insert(e){let t=this._trie;for(let n of e.moduleName.split(`/`)){let e=t.children.get(n);e||(e=new fL,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie,i=[],a=!0;for(let t of e.split(`/`)){let e=r.children.get(t);if(!e){a=!1;break}n||i.push(...e.hooks),r=e}return n&&a&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(t&&i.sort((e,t)=>e.insertedId-t.insertedId),i.map(({hook:e})=>e))}}}));function hL(e){return Ye.sep===`/`?e:e.split(Ye.sep).join(`/`)}var gL,_L,vL,yL=n((()=>{gL=Fa(),mL(),a(),_L=[`afterEach`,`after`,`beforeEach`,`before`,`describe`,`it`].every(e=>typeof global[e]==`function`),vL=class e{constructor(){o(this,`_moduleNameTrie`,new pL),this._initialize()}_initialize(){new gL.Hook(null,{internals:!0},(e,t,n)=>{let r=hL(t),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:r}of i)e=r(e,t,n);return e})}register(e,t){let n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return _L?new e:this._instance=this._instance??new e}},o(vL,`_instance`,void 0)}));function bL(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var xL=n((()=>{}));function SL(e,t,n){return t===void 0?e.includes(`*`):e.some(e=>hI(t,e,{includePrerelease:n}))}var CL,wL,TL,EL=n((()=>{tL(),lL(),dL(),yL(),CL=Mj(),T(),wL=Fa(),xL(),a(),TL=class extends uL{constructor(e,t,n){super(e,t,n),o(this,`_modules`,void 0),o(this,`_hooks`,[]),o(this,`_requireInTheMiddleSingleton`,vL.getInstance()),o(this,`_enabled`,!1),o(this,`_wrap`,(e,t,n)=>{if(bL(e[t])&&this._unwrap(e,t),gt.isProxy(e)){let r=aL(Object.assign({},e),t,n);return Object.defineProperty(e,t,{value:r}),r}else return aL(e,t,n)}),o(this,`_unwrap`,(e,t)=>gt.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):sL(e,t)),o(this,`_massWrap`,(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{E.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){E.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})})}),o(this,`_massUnwrap`,(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{E.error(`must provide one or more modules to patch`);return}if(!(t&&Array.isArray(t))){E.error(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})})});let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let e=t.resolve(n);t.cache[e]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let t=ot(Ye.join(e,`package.json`),{encoding:`utf8`}),n=JSON.parse(t).version;return typeof n==`string`?n:void 0}catch{E.warn(`Failed extracting version`,e)}}_onRequire(e,t,n,r){if(!r)return typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for nodejs core module on require hook`,{module:e.name}),e.patch(t)):t;let i=this._extractPackageVersion(r);if(e.moduleVersion=i,e.name===n)return SL(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch==`function`&&(e.moduleExports=t,this._enabled)?(this._diag.debug(`Applying instrumentation patch for module on require hook`,{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;let a=e.files??[],o=Ye.normalize(n);return a.filter(e=>e.name===o).filter(t=>SL(t.supportedVersions,i,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug(`Applying instrumentation patch for nodejs module file on require hook`,{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch==`function`&&e.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module on instrumentation enabled`,{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Applying instrumentation patch for nodejs module file on instrumentation enabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let t=(t,n,r)=>{if(!r&&Ye.isAbsolute(n)){let e=Ye.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=Ye.isAbsolute(e.name)?new wL.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);let i=new CL.Hook([e.name],{internals:!1},t);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch==`function`&&e.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module on instrumentation disabled`,{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let t of e.files)t.moduleExports&&(this._diag.debug(`Removing instrumentation patch for nodejs module file on instrumentation disabled`,{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}})),DL=n((()=>{EL()})),OL=n((()=>{DL()})),kL,AL=n((()=>{a(),kL=class{constructor(e,t,n,r,i){o(this,`name`,void 0),o(this,`supportedVersions`,void 0),o(this,`patch`,void 0),o(this,`unpatch`,void 0),o(this,`files`,void 0),this.name=e,this.supportedVersions=t,this.patch=n,this.unpatch=r,this.files=i||[]}}})),jL=n((()=>{mI(),OL(),AL(),xL()}));function ML(){let e=UL[HL];return e?.helper?e.helper:UL[VL]?.helper}function NL(e){let t={helper:e};UL[HL]=t,UL[VL]=t}function PL(){delete UL[HL],delete UL[VL]}function FL(e){switch(e){case`client`:return w.CLIENT;default:return w.INTERNAL}}function IL(e,t,n,r,i){if(zL(t.name,i))return;let a={attributes:t.attributes,kind:FL(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,a,a=>{r.set(t.id,a.spanContext().spanId),t.links&&a.addLinks(t.links.flatMap(e=>{let t=r.get(e);return t?{context:{spanId:t,traceId:a.spanContext().traceId,traceFlags:a.spanContext().traceFlags}}:[]}));let o=n.filter(e=>e.parentId===t.id);for(let t of o)IL(e,t,n,r,i);a.end(t.endTime)})}function LL(e,t){return RL(t)?t.then(t=>(e.end(),t),t=>{throw e.end(),t}):(e.end(),t)}function RL(e){return e!=null&&typeof e.then==`function`}function zL(e,t){return t.some(t=>typeof t==`string`?t===e:t.test(e))}var BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL,ZL,QL=n((()=>{T(),jL(),a(),BL={name:`@prisma/instrumentation-contract`,version:`7.6.0`,description:`Shared types and utilities for Prisma instrumentation`,main:`dist/index.js`,module:`dist/index.mjs`,types:`dist/index.d.ts`,exports:{".":{require:{types:`./dist/index.d.ts`,default:`./dist/index.js`},import:{types:`./dist/index.d.mts`,default:`./dist/index.mjs`}}},license:`Apache-2.0`,homepage:`https://www.prisma.io`,repository:{type:`git`,url:`https://github.com/prisma/prisma.git`,directory:`packages/instrumentation-contract`},bugs:`https://github.com/prisma/prisma/issues`,scripts:{dev:`DEV=true tsx helpers/build.ts`,build:`tsx helpers/build.ts`,prepublishOnly:`pnpm run build`,test:`vitest run`},files:[`dist`],sideEffects:!1,devDependencies:{"@opentelemetry/api":`1.9.0`},peerDependencies:{"@opentelemetry/api":`^1.8`}}.version.split(`.`)[0],VL=`PRISMA_INSTRUMENTATION`,HL=`V${BL}_PRISMA_INSTRUMENTATION`,UL=globalThis,WL=process.env.PRISMA_SHOW_ALL_TRACES===`true`,GL=`00-10-10-00`,KL=class{constructor({tracerProvider:e,ignoreSpanTypes:t}){o(this,`tracerProvider`,void 0),o(this,`ignoreSpanTypes`,void 0),this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=D.getSpanContext(e??O.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:GL}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer(`prisma`),n=new Map,r=e.filter(e=>e.parentId===null);for(let i of r)IL(t,i,e,n,this.ignoreSpanTypes)}getActiveContext(){return O.active()}runInChildSpan(e,t){if(typeof e==`string`&&(e={name:e}),e.internal&&!WL)return t();let n=this.tracerProvider.getTracer(`prisma`),r=e.context??this.getActiveContext(),i=`prisma:client:${e.name}`;if(zL(i,this.ignoreSpanTypes))return t();if(e.active===!1){let a=n.startSpan(i,e,r);return LL(a,t(a,r))}return n.startActiveSpan(i,e,e=>LL(e,t(e,r)))}},qL={name:`@prisma/instrumentation`,version:`7.6.0`,description:`OpenTelemetry compliant instrumentation for Prisma Client`,main:`dist/index.js`,module:`dist/index.mjs`,types:`dist/index.d.ts`,exports:{".":{require:{types:`./dist/index.d.ts`,default:`./dist/index.js`},import:{types:`./dist/index.d.ts`,default:`./dist/index.mjs`}}},license:`Apache-2.0`,homepage:`https://www.prisma.io`,repository:{type:`git`,url:`https://github.com/prisma/prisma.git`,directory:`packages/instrumentation`},bugs:`https://github.com/prisma/prisma/issues`,devDependencies:{"@opentelemetry/api":`1.9.0`,"@prisma/instrumentation-contract":`workspace:*`,"@types/node":`~20.19.24`,typescript:`5.4.5`},dependencies:{"@opentelemetry/instrumentation":`^0.207.0`},peerDependencies:{"@opentelemetry/api":`^1.8`},files:[`dist`],keywords:[`prisma`,`instrumentation`,`opentelemetry`,`otel`],scripts:{dev:`DEV=true tsx helpers/build.ts`,build:`tsx helpers/build.ts`,prepublishOnly:`pnpm run build`,test:`vitest run`},sideEffects:!1},JL=qL.version,YL=qL.name,XL=`@prisma/client`,ZL=class extends TL{constructor(e={}){super(YL,JL,e),o(this,`tracerProvider`,void 0)}setTracerProvider(e){this.tracerProvider=e}init(){return[new kL(XL,[JL])]}enable(){let e=this._config;NL(new KL({tracerProvider:this.tracerProvider??D.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){PL()}isEnabled(){return ML()!==void 0}}}));function $L(e){return!!e&&typeof e==`object`&&`dispatchEngineSpans`in e}function eR(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e==`object`&&`helper`in e?e.helper:void 0}function tR(e){switch(e){case`client`:return w.CLIENT;default:return w.INTERNAL}}var nR,rR,iR,aR,oR=n((()=>{T(),QL(),X(),$(),nR=`Prisma`,rR=class extends ZL{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=eR();$L(e)&&(e.createEngineSpan=e=>{let t=D.getTracer(`prismaV5Compatibility`),n=t._idGenerator;if(!n){Oo(()=>{console.warn(`[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!`)});return}try{e.spans.forEach(e=>{let r=tR(e.kind),i=e.parent_span_id,a=e.span_id,o=e.trace_id,s=e.links?.map(e=>({context:{traceId:e.trace_id,spanId:e.span_id,traceFlags:S.SAMPLED}})),c=D.setSpanContext(O.active(),{traceId:o,spanId:i,traceFlags:S.SAMPLED});O.with(c,()=>{t._idGenerator={generateTraceId:()=>o,generateSpanId:()=>a},t.startSpan(e.name,{kind:r,links:s,startTime:e.start_time,attributes:e.attributes}).end(e.end_time),t._idGenerator=n})})}finally{t._idGenerator=n}})}},iR=Z(nR,e=>new rR(e)),aR=Y(e=>({name:nR,setupOnce(){iR(e)},setup(e){eR()&&e.on(`spanStart`,e=>{let t=q(e);t.description?.startsWith(`prisma:`)&&e.setAttribute(K,`auto.db.otel.prisma`),t.description===`prisma:engine:db_query`&&t.data[`db.query.text`]&&e.updateName(t.data[`db.query.text`]),t.description===`prisma:engine:db_query`&&!t.data[`db.system`]&&e.setAttribute(`db.system`,`prisma`)})}}))})),sR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.60.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-hapi`})),cR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HapiLifecycleMethodNames=e.HapiLayerType=e.handlerPatched=e.HapiComponentName=void 0,e.HapiComponentName=`@hapi/hapi`,e.handlerPatched=Symbol(`hapi-handler-patched`),e.HapiLayerType={ROUTER:`router`,PLUGIN:`plugin`,EXT:`server.ext`},e.HapiLifecycleMethodNames=new Set([`onPreAuth`,`onCredentials`,`onPostAuth`,`onPreHandler`,`onPostHandler`,`onPreResponse`,`onRequest`])})),lR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ATTR_HTTP_METHOD=void 0,e.ATTR_HTTP_METHOD=`http.method`})),uR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=void 0,(function(e){e.HAPI_TYPE=`hapi.type`,e.PLUGIN_NAME=`hapi.plugin.name`,e.EXT_TYPE=`server.ext.type`})(e.AttributeNames||(e.AttributeNames={}))})),dR=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getPluginFromInput=t.getExtMetadata=t.getRouteMetadata=t.isPatchableExtMethod=t.isDirectExtInput=t.isLifecycleExtEventObj=t.isLifecycleExtType=t.getPluginName=void 0;var n=(F(),e(A)),r=lR(),i=cR(),a=uR(),o=(L(),e(I));function s(e){return e.name?e.name:e.pkg.name}t.getPluginName=s,t.isLifecycleExtType=e=>typeof e==`string`&&i.HapiLifecycleMethodNames.has(e),t.isLifecycleExtEventObj=e=>{let n=e?.type;return n!==void 0&&(0,t.isLifecycleExtType)(n)},t.isDirectExtInput=e=>Array.isArray(e)&&e.length<=3&&(0,t.isLifecycleExtType)(e[0])&&typeof e[1]==`function`,t.isPatchableExtMethod=e=>!Array.isArray(e),t.getRouteMetadata=(e,t,s)=>{let c={[n.ATTR_HTTP_ROUTE]:e.path};t&o.SemconvStability.OLD&&(c[r.ATTR_HTTP_METHOD]=e.method),t&o.SemconvStability.STABLE&&(c[n.ATTR_HTTP_REQUEST_METHOD]=e.method);let l;return s?(c[a.AttributeNames.HAPI_TYPE]=i.HapiLayerType.PLUGIN,c[a.AttributeNames.PLUGIN_NAME]=s,l=`${s}: route - ${e.path}`):(c[a.AttributeNames.HAPI_TYPE]=i.HapiLayerType.ROUTER,l=`route - ${e.path}`),{attributes:c,name:l}},t.getExtMetadata=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!==`method`&&(r=`ext - ${e} - ${n}`),t?{attributes:{[a.AttributeNames.EXT_TYPE]:e,[a.AttributeNames.HAPI_TYPE]:i.HapiLayerType.EXT,[a.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[a.AttributeNames.EXT_TYPE]:e,[a.AttributeNames.HAPI_TYPE]:i.HapiLayerType.EXT},name:r}},t.getPluginFromInput=e=>`plugin`in e?`plugin`in e.plugin?e.plugin.plugin:e.plugin:e})),fR=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.HapiInstrumentation=void 0;var n=(T(),e(k)),r=(fi(),e(ui)),i=(L(),e(I)),s=sR(),c=cR(),l=dR();t.HapiInstrumentation=class extends i.InstrumentationBase{constructor(e={}){super(s.PACKAGE_NAME,s.PACKAGE_VERSION,e),o(this,`_semconvStability`,void 0),this._semconvStability=(0,i.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new i.InstrumentationNodeModuleDefinition(c.HapiComponentName,[`>=17.0.0 <22`],e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;return(0,i.isWrapped)(t.server)||this._wrap(t,`server`,this._getServerPatch.bind(this)),(0,i.isWrapped)(t.Server)||this._wrap(t,`Server`,this._getServerPatch.bind(this)),t},e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;this._massUnwrap([t],[`server`,`Server`])})}_getServerPatch(e){let t=this,n=this;return function(r){let i=e.apply(this,[r]);return n._wrap(i,`route`,e=>t._getServerRoutePatch.bind(t)(e)),n._wrap(i,`ext`,e=>t._getServerExtPatch.bind(t)(e)),n._wrap(i,`register`,t._getServerRegisterPatch.bind(t)),i}}_getServerRegisterPatch(e){let t=this;return function(n,r){if(Array.isArray(n))for(let e of n){let n=(0,l.getPluginFromInput)(e);t._wrapRegisterHandler(n)}else{let e=(0,l.getPluginFromInput)(n);t._wrapRegisterHandler(e)}return e.apply(this,[n,r])}}_getServerExtPatch(e,t){let n=this;return function(...r){if(Array.isArray(r[0])){let i=r[0];for(let e=0;e<i.length;e++){let r=i[e];if((0,l.isLifecycleExtType)(r.type)){let a=r;a.method=n._wrapExtMethods(a.method,r.type,t),i[e]=a}}return e.apply(this,r)}else if((0,l.isDirectExtInput)(r)){let i=r,a=i[1],o=n._wrapExtMethods(a,i[0],t);return e.apply(this,[i[0],o,i[2]])}else if((0,l.isLifecycleExtEventObj)(r[0])){let i=r[0];return i.method=n._wrapExtMethods(i.method,i.type,t),e.call(this,i)}return e.apply(this,r)}}_getServerRoutePatch(e,t){let n=this;return function(r){if(Array.isArray(r))for(let e=0;e<r.length;e++){let i=n._wrapRouteHandler.call(n,r[e],t);r[e]=i}else r=n._wrapRouteHandler.call(n,r,t);return e.apply(this,[r])}}_wrapRegisterHandler(e){let t=this,n=(0,l.getPluginName)(e),r=e.register,i=this;e.register=function(e,a){return i._wrap(e,`route`,e=>t._getServerRoutePatch.bind(t)(e,n)),i._wrap(e,`ext`,e=>t._getServerExtPatch.bind(t)(e,n)),r.call(this,e,a)}}_wrapExtMethods(e,t,r){let i=this;if(e instanceof Array){for(let n=0;n<e.length;n++)e[n]=i._wrapExtMethods(e[n],t);return e}else if((0,l.isPatchableExtMethod)(e))return e[c.handlerPatched]===!0?e:(e[c.handlerPatched]=!0,async function(...a){if(n.trace.getSpan(n.context.active())===void 0)return await e.apply(this,a);let o=(0,l.getExtMetadata)(t,r,e.name),s=i.tracer.startSpan(o.name,{attributes:o.attributes});try{return await n.context.with(n.trace.setSpan(n.context.active(),s),e,void 0,...a)}catch(e){throw s.recordException(e),s.setStatus({code:n.SpanStatusCode.ERROR,message:e.message}),e}finally{s.end()}});return e}_wrapRouteHandler(e,t){let i=this;if(e[c.handlerPatched]===!0)return e;e[c.handlerPatched]=!0;let a=a=>async function(...o){if(n.trace.getSpan(n.context.active())===void 0)return await a.call(this,...o);let s=(0,r.getRPCMetadata)(n.context.active());s?.type===r.RPCType.HTTP&&(s.route=e.path);let c=(0,l.getRouteMetadata)(e,i._semconvStability,t),u=i.tracer.startSpan(c.name,{attributes:c.attributes});try{return await n.context.with(n.trace.setSpan(n.context.active(),u),()=>a.call(this,...o))}catch(e){throw u.recordException(e),u.setStatus({code:n.SpanStatusCode.ERROR,message:e.message}),e}finally{u.end()}};if(typeof e.handler==`function`)e.handler=a(e.handler);else if(typeof e.options==`function`){let t=e.options;e.options=function(e){let n=t(e);return typeof n.handler==`function`&&(n.handler=a(n.handler)),n}}else typeof e.options?.handler==`function`&&(e.options.handler=a(e.options.handler));return e}}})),pR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=e.HapiInstrumentation=void 0;var t=fR();Object.defineProperty(e,`HapiInstrumentation`,{enumerable:!0,get:function(){return t.HapiInstrumentation}});var n=uR();Object.defineProperty(e,`AttributeNames`,{enumerable:!0,get:function(){return n.AttributeNames}})})),mR,hR,gR,_R,vR,yR=n((()=>{mR=pR(),X(),$(),hR=`Hapi`,gR=Z(hR,()=>new mR.HapiInstrumentation),_R=(()=>({name:hR,setupOnce(){gR()}})),vR=Y(_R)})),bR,xR,SR=n((()=>{bR={HONO_TYPE:`hono.type`,HONO_NAME:`hono.name`},xR={MIDDLEWARE:`middleware`,REQUEST_HANDLER:`request_handler`}})),CR,wR,TR,ER=n((()=>{T(),L(),X(),SR(),CR=`@sentry/instrumentation-hono`,wR=`0.0.1`,TR=class extends $a{constructor(e={}){super(CR,wR,e)}init(){return[new io(`hono`,[`>=4.0.0 <5`],e=>this._patch(e))]}_patch(e){let t=this;class n extends e.Hono{constructor(...e){super(...e),t._wrap(this,`get`,t._patchHandler()),t._wrap(this,`post`,t._patchHandler()),t._wrap(this,`put`,t._patchHandler()),t._wrap(this,`delete`,t._patchHandler()),t._wrap(this,`options`,t._patchHandler()),t._wrap(this,`patch`,t._patchHandler()),t._wrap(this,`all`,t._patchHandler()),t._wrap(this,`on`,t._patchOnHandler()),t._wrap(this,`use`,t._patchMiddlewareHandler())}}try{e.Hono=n}catch{return{...e,Hono:n}}return e}_patchHandler(){let e=this;return function(t){return function(...n){if(typeof n[0]==`string`){let r=n[0];if(n.length===1)return t.apply(this,[r]);let i=n.slice(1);return t.apply(this,[r,...i.map(t=>e._wrapHandler(t))])}return t.apply(this,n.map(t=>e._wrapHandler(t)))}}}_patchOnHandler(){let e=this;return function(t){return function(...n){let r=n.slice(2);return t.apply(this,[...n.slice(0,2),...r.map(t=>e._wrapHandler(t))])}}}_patchMiddlewareHandler(){let e=this;return function(t){return function(...n){if(typeof n[0]==`string`){let r=n[0];if(n.length===1)return t.apply(this,[r]);let i=n.slice(1);return t.apply(this,[r,...i.map(t=>e._wrapHandler(t))])}return t.apply(this,n.map(t=>e._wrapHandler(t)))}}}_wrapHandler(e){let t=this;return function(n,r){if(!t.isEnabled())return e.apply(this,[n,r]);let i=n.req.path,a=t.tracer.startSpan(i);return O.with(D.setSpan(O.active(),a),()=>t._safeExecute(()=>{let o=e.apply(this,[n,r]);if(Ss(o))return o.then(n=>{let r=t._determineHandlerType(n);return a.setAttributes({[bR.HONO_TYPE]:r,[bR.HONO_NAME]:r===xR.REQUEST_HANDLER?i:e.name||`anonymous`}),t.getConfig().responseHook?.(a),n});{let n=t._determineHandlerType(o);return a.setAttributes({[bR.HONO_TYPE]:n,[bR.HONO_NAME]:n===xR.REQUEST_HANDLER?i:e.name||`anonymous`}),t.getConfig().responseHook?.(a),o}},()=>a.end(),e=>{t._handleError(a,e),a.end()}))}}_safeExecute(e,t,n){try{let r=e();return Ss(r)?r.then(()=>t(),e=>n(e)):t(),r}catch(e){throw n(e),e}}_determineHandlerType(e){return e===void 0?xR.MIDDLEWARE:xR.REQUEST_HANDLER}_handleError(e,t){t instanceof Error&&(e.setStatus({code:b.ERROR,message:t.message}),e.recordException(t))}}}));function DR(e){let t=q(e).data,n=t[bR.HONO_TYPE];if(t[`sentry.op`]||!n)return;e.setAttributes({[K]:`auto.http.otel.hono`,[G]:`${n}.hono`});let r=t[bR.HONO_NAME];if(typeof r==`string`&&e.updateName(r),ul()===Rc()){Jk&&V.warn(`Isolation scope is default isolation scope - skipping setting transactionName`);return}let i=t[he],a=t[M];typeof i==`string`&&typeof a==`string`&&ul().setTransactionName(`${a} ${i}`)}var OR,kR,AR,jR,MR=n((()=>{F(),X(),$(),Yk(),SR(),ER(),OR=`Hono`,kR=Z(OR,()=>new TR({responseHook:e=>{DR(e)}})),AR=(()=>({name:OR,setupOnce(){kR()}})),jR=Y(AR)})),NR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.KoaLayerType=void 0,(function(e){e.ROUTER=`router`,e.MIDDLEWARE=`middleware`})(e.KoaLayerType||(e.KoaLayerType={}))})),PR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.62.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-koa`})),FR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AttributeNames=void 0,(function(e){e.KOA_TYPE=`koa.type`,e.KOA_NAME=`koa.name`})(e.AttributeNames||(e.AttributeNames={}))})),IR=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.isLayerIgnored=t.getMiddlewareMetadata=void 0;var n=NR(),r=FR(),i=(F(),e(A));t.getMiddlewareMetadata=(e,t,a,o)=>a?{attributes:{[r.AttributeNames.KOA_NAME]:o?.toString(),[r.AttributeNames.KOA_TYPE]:n.KoaLayerType.ROUTER,[i.ATTR_HTTP_ROUTE]:o?.toString()},name:e._matchedRouteName||`router - ${o}`}:{attributes:{[r.AttributeNames.KOA_NAME]:t.name??`middleware`,[r.AttributeNames.KOA_TYPE]:n.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`},t.isLayerIgnored=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e))})),LR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.kLayerPatched=void 0,e.kLayerPatched=Symbol(`koa-layer-patched`)})),RR=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.KoaInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=NR(),a=PR(),o=IR(),s=(fi(),e(ui)),c=LR();t.KoaInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(a.PACKAGE_NAME,a.PACKAGE_VERSION,e)}init(){return new r.InstrumentationNodeModuleDefinition(`koa`,[`>=2.0.0 <4`],e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;return t==null?t:((0,r.isWrapped)(t.prototype.use)&&this._unwrap(t.prototype,`use`),this._wrap(t.prototype,`use`,this._getKoaUsePatch.bind(this)),e)},e=>{let t=e[Symbol.toStringTag]===`Module`?e.default:e;(0,r.isWrapped)(t.prototype.use)&&this._unwrap(t.prototype,`use`)})}_getKoaUsePatch(e){let t=this;return function(n){let r;return r=n.router?t._patchRouterDispatch(n):t._patchLayer(n,!1),e.apply(this,[r])}}_patchRouterDispatch(e){n.diag.debug(`Patching @koa/router dispatch`);let t=e.router?.stack??[];for(let e of t){let t=e.path,n=e.stack;for(let e=0;e<n.length;e++){let r=n[e];n[e]=this._patchLayer(r,!0,t)}}return e}_patchLayer(e,t,a){let l=t?i.KoaLayerType.ROUTER:i.KoaLayerType.MIDDLEWARE;return e[c.kLayerPatched]===!0||(0,o.isLayerIgnored)(l,this.getConfig())?e:e.constructor.name===`GeneratorFunction`||e.constructor.name===`AsyncGeneratorFunction`?(n.diag.debug(`ignoring generator-based Koa middleware layer`),e):(e[c.kLayerPatched]=!0,n.diag.debug(`patching Koa middleware layer`),async(i,c)=>{if(n.trace.getSpan(n.context.active())===void 0)return e(i,c);let u=(0,o.getMiddlewareMetadata)(i,e,t,a),d=this.tracer.startSpan(u.name,{attributes:u.attributes}),f=(0,s.getRPCMetadata)(n.context.active());f?.type===s.RPCType.HTTP&&i._matchedRoute&&(f.route=i._matchedRoute.toString());let{requestHook:p}=this.getConfig();p&&(0,r.safeExecuteInTheMiddle)(()=>p(d,{context:i,middlewareLayer:e,layerType:l}),e=>{e&&n.diag.error(`koa instrumentation: request hook failed`,e)},!0);let m=n.trace.setSpan(n.context.active(),d);return n.context.with(m,async()=>{try{return await e(i,c)}catch(e){throw d.recordException(e),e}finally{d.end()}})})}}})),zR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.KoaLayerType=e.AttributeNames=e.KoaInstrumentation=void 0;var t=RR();Object.defineProperty(e,`KoaInstrumentation`,{enumerable:!0,get:function(){return t.KoaInstrumentation}});var n=FR();Object.defineProperty(e,`AttributeNames`,{enumerable:!0,get:function(){return n.AttributeNames}});var r=NR();Object.defineProperty(e,`KoaLayerType`,{enumerable:!0,get:function(){return r.KoaLayerType}})})),BR,VR,HR,UR,WR,GR=n((()=>{BR=zR(),F(),X(),$(),Yk(),VR=`Koa`,HR=Z(VR,BR.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(e,t){xk(e,`auto.http.otel.koa`);let n=q(e).data,r=n[`koa.type`];r&&e.setAttribute(G,`${r}.koa`);let i=n[`koa.name`];if(typeof i==`string`&&e.updateName(i||`< unknown >`),ul()===Rc()){Jk&&V.warn(`Isolation scope is default isolation scope - skipping setting transactionName`);return}let a=n[he],o=t.context?.request?.method?.toUpperCase()||`GET`;a&&ul().setTransactionName(`${o} ${a}`)}})),UR=((e={})=>({name:VR,setupOnce(){HR(e)}})),WR=Y(UR)})),KR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConnectNames=e.ConnectTypes=e.AttributeNames=void 0,(function(e){e.CONNECT_TYPE=`connect.type`,e.CONNECT_NAME=`connect.name`})(e.AttributeNames||(e.AttributeNames={})),(function(e){e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request_handler`})(e.ConnectTypes||(e.ConnectTypes={})),(function(e){e.MIDDLEWARE=`middleware`,e.REQUEST_HANDLER=`request handler`})(e.ConnectNames||(e.ConnectNames={}))})),qR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.57.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-connect`})),JR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e._LAYERS_STORE_PROPERTY=void 0,e._LAYERS_STORE_PROPERTY=Symbol(`opentelemetry.instrumentation-connect.request-route-stack`)})),YR=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.generateRoute=t.replaceCurrentStackRoute=t.addNewStackLayer=void 0;var n=(T(),e(k)),r=JR();t.addNewStackLayer=e=>{Array.isArray(e[r._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,r._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[r._LAYERS_STORE_PROPERTY].push(`/`);let t=e[r._LAYERS_STORE_PROPERTY].length;return()=>{t===e[r._LAYERS_STORE_PROPERTY].length?e[r._LAYERS_STORE_PROPERTY].pop():n.diag.warn(`Connect: Trying to pop the stack multiple time`)}},t.replaceCurrentStackRoute=(e,t)=>{t&&e[r._LAYERS_STORE_PROPERTY].splice(-1,1,t)},t.generateRoute=e=>e[r._LAYERS_STORE_PROPERTY].reduce((e,t)=>e.replace(/\/+$/,``)+t)})),XR=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ConnectInstrumentation=t.ANONYMOUS_NAME=void 0;var n=(T(),e(k)),r=(fi(),e(ui)),i=KR(),a=qR(),o=(L(),e(I)),s=(F(),e(A)),c=YR();t.ANONYMOUS_NAME=`anonymous`,t.ConnectInstrumentation=class extends o.InstrumentationBase{constructor(e={}){super(a.PACKAGE_NAME,a.PACKAGE_VERSION,e)}init(){return[new o.InstrumentationNodeModuleDefinition(`connect`,[`>=3.0.0 <4`],e=>this._patchConstructor(e))]}_patchApp(e){(0,o.isWrapped)(e.use)||this._wrap(e,`use`,this._patchUse.bind(this)),(0,o.isWrapped)(e.handle)||this._wrap(e,`handle`,this._patchHandle.bind(this))}_patchConstructor(e){let t=this;return function(...n){let r=e.apply(this,n);return t._patchApp(r),r}}_patchNext(e,t){return function(n){let r=e.apply(this,[n]);return t(),r}}_startSpan(e,n){let r,a,o;e?(r=i.ConnectTypes.REQUEST_HANDLER,o=i.ConnectNames.REQUEST_HANDLER,a=e):(r=i.ConnectTypes.MIDDLEWARE,o=i.ConnectNames.MIDDLEWARE,a=n.name||t.ANONYMOUS_NAME);let c=`${o} - ${a}`,l={attributes:{[s.ATTR_HTTP_ROUTE]:e.length>0?e:`/`,[i.AttributeNames.CONNECT_TYPE]:r,[i.AttributeNames.CONNECT_NAME]:a}};return this.tracer.startSpan(c,l)}_patchMiddleware(e,i){let a=this,o=i.length===4;function s(){if(!a.isEnabled())return i.apply(this,arguments);let[s,l,u]=o?[1,2,3]:[0,1,2],d=arguments[s],f=arguments[l],p=arguments[u];(0,c.replaceCurrentStackRoute)(d,e);let m=(0,r.getRPCMetadata)(n.context.active());e&&m?.type===r.RPCType.HTTP&&(m.route=(0,c.generateRoute)(d));let h=``;h=e?`request handler - ${e}`:`middleware - ${i.name||t.ANONYMOUS_NAME}`;let g=a._startSpan(e,i);a._diag.debug(`start span`,h);let _=!1;function v(){_?a._diag.debug(`span ${g.name} - already finished`):(_=!0,a._diag.debug(`finishing span ${g.name}`),g.end()),f.removeListener(`close`,v)}return f.addListener(`close`,v),arguments[u]=a._patchNext(p,v),i.apply(this,arguments)}return Object.defineProperty(s,`length`,{value:i.length,writable:!1,configurable:!0}),s}_patchUse(e){let t=this;return function(...n){let r=n[n.length-1],i=n[n.length-2]||``;return n[n.length-1]=t._patchMiddleware(i,r),e.apply(this,n)}}_patchHandle(e){let t=this;return function(){let[n,r]=[0,2],i=arguments[n],a=arguments[r],o=(0,c.addNewStackLayer)(i);return typeof a==`function`&&(arguments[r]=t._patchOut(a,o)),e.apply(this,arguments)}}_patchOut(e,t){return function(...n){return t(),Reflect.apply(e,this,n)}}}})),ZR=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConnectTypes=e.ConnectNames=e.AttributeNames=e.ANONYMOUS_NAME=e.ConnectInstrumentation=void 0;var t=XR();Object.defineProperty(e,`ConnectInstrumentation`,{enumerable:!0,get:function(){return t.ConnectInstrumentation}}),Object.defineProperty(e,`ANONYMOUS_NAME`,{enumerable:!0,get:function(){return t.ANONYMOUS_NAME}});var n=KR();Object.defineProperty(e,`AttributeNames`,{enumerable:!0,get:function(){return n.AttributeNames}}),Object.defineProperty(e,`ConnectNames`,{enumerable:!0,get:function(){return n.ConnectNames}}),Object.defineProperty(e,`ConnectTypes`,{enumerable:!0,get:function(){return n.ConnectTypes}})})),QR,$R,ez,tz,nz,rz=n((()=>{QR=ZR(),X(),$(),$R=`Connect`,ez=Z($R,()=>new QR.ConnectInstrumentation),tz=(()=>({name:$R,setupOnce(){ez()}})),nz=Y(tz)})),iz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DB_SYSTEM_VALUE_MSSQL=e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_DB_USER=e.ATTR_DB_SYSTEM=e.ATTR_DB_STATEMENT=e.ATTR_DB_SQL_TABLE=e.ATTR_DB_NAME=void 0,e.ATTR_DB_NAME=`db.name`,e.ATTR_DB_SQL_TABLE=`db.sql.table`,e.ATTR_DB_STATEMENT=`db.statement`,e.ATTR_DB_SYSTEM=`db.system`,e.ATTR_DB_USER=`db.user`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`,e.DB_SYSTEM_VALUE_MSSQL=`mssql`})),az=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.once=e.getSpanName=void 0;function t(e,t,n,r){return e===`execBulkLoad`&&r&&t?`${e} ${r} ${t}`:e===`callProcedure`?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}e.getSpanName=t,e.once=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}}})),oz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.33.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-tedious`})),sz=i((n=>{a(),Object.defineProperty(n,`__esModule`,{value:!0}),n.TediousInstrumentation=n.INJECTED_CTX=void 0;var r=(T(),e(k)),i=t(`events`),s=(L(),e(I)),c=(F(),e(A)),l=iz(),u=az(),d=oz(),f=Symbol(`opentelemetry.instrumentation-tedious.current-database`);n.INJECTED_CTX=Symbol(`opentelemetry.instrumentation-tedious.context-info-injected`);var p=[`callProcedure`,`execSql`,`execSqlBatch`,`execBulkLoad`,`prepare`,`execute`];function m(e){Object.defineProperty(this,f,{value:e,writable:!0})}var h=class e extends s.InstrumentationBase{constructor(e={}){super(d.PACKAGE_NAME,d.PACKAGE_VERSION,e),o(this,`_netSemconvStability`,void 0),o(this,`_dbSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,s.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,s.semconvStabilityFromStr)(`database`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new s.InstrumentationNodeModuleDefinition(e.COMPONENT,[`>=1.11.0 <20`],e=>{let t=e.Connection.prototype;for(let n of p)(0,s.isWrapped)(t[n])&&this._unwrap(t,n),this._wrap(t,n,this._patchQuery(n,e));return(0,s.isWrapped)(t.connect)&&this._unwrap(t,`connect`),this._wrap(t,`connect`,this._patchConnect),e},e=>{if(e===void 0)return;let t=e.Connection.prototype;for(let e of p)this._unwrap(t,e);this._unwrap(t,`connect`)})]}_patchConnect(e){return function(){return m.call(this,this.config?.options?.database),this.removeListener(`databaseChange`,m),this.on(`databaseChange`,m),this.once(`end`,()=>{this.removeListener(`databaseChange`,m)}),e.apply(this,arguments)}}_buildTraceparent(e){let t=e.spanContext();return`00-${t.traceId}-${t.spanId}-0${Number(t.traceFlags||r.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,t,r){return new Promise(i=>{try{let a=new t.Request(`set context_info @opentelemetry_traceparent`,e=>{i()});Object.defineProperty(a,n.INJECTED_CTX,{value:!0});let o=Buffer.from(r,`utf8`);a.addParameter(`opentelemetry_traceparent`,t.TYPES.VarBinary,o,{length:o.length}),e.execSql(a)}catch{i()}})}_shouldInjectFor(e){return e===`execSql`||e===`execSqlBatch`||e===`callProcedure`||e===`execute`}_patchQuery(e,t){return a=>{let o=this;function d(d){if(d?.[n.INJECTED_CTX])return a.apply(this,arguments);if(!(d instanceof i.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),a.apply(this,arguments);let p=0,m=0,h=()=>m++,g=()=>p++,_=this[f],v=(e=>e.sqlTextOrProcedure===`sp_prepare`&&e.parametersByName?.stmt?.value?e.parametersByName.stmt.value:e.sqlTextOrProcedure)(d),y={};o._dbSemconvStability&s.SemconvStability.OLD&&(y[l.ATTR_DB_SYSTEM]=l.DB_SYSTEM_VALUE_MSSQL,y[l.ATTR_DB_NAME]=_,y[l.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,y[l.ATTR_DB_STATEMENT]=v,y[l.ATTR_DB_SQL_TABLE]=d.table),o._dbSemconvStability&s.SemconvStability.STABLE&&(y[c.ATTR_DB_NAMESPACE]=_,y[c.ATTR_DB_SYSTEM_NAME]=c.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,y[c.ATTR_DB_QUERY_TEXT]=v,y[c.ATTR_DB_COLLECTION_NAME]=d.table),o._netSemconvStability&s.SemconvStability.OLD&&(y[l.ATTR_NET_PEER_NAME]=this.config?.server,y[l.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&s.SemconvStability.STABLE&&(y[c.ATTR_SERVER_ADDRESS]=this.config?.server,y[c.ATTR_SERVER_PORT]=this.config?.options?.port);let b=o.tracer.startSpan((0,u.getSpanName)(e,_,v,d.table),{kind:r.SpanKind.CLIENT,attributes:y}),x=(0,u.once)(e=>{d.removeListener(`done`,h),d.removeListener(`doneInProc`,h),d.removeListener(`doneProc`,g),d.removeListener(`error`,x),this.removeListener(`end`,x),b.setAttribute(`tedious.procedure_count`,p),b.setAttribute(`tedious.statement_count`,m),e&&b.setStatus({code:r.SpanStatusCode.ERROR,message:e.message}),b.end()});d.on(`done`,h),d.on(`doneInProc`,h),d.on(`doneProc`,g),d.once(`error`,x),this.on(`end`,x),typeof d.callback==`function`?o._wrap(d,`callback`,o._patchCallbackQuery(x)):o._diag.error(`Expected request.callback to be a function`);let S=()=>r.context.with(r.trace.setSpan(r.context.active(),b),a,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return S();let C=o._buildTraceparent(b);o._injectContextInfo(this,t,C).finally(S)}return Object.defineProperty(d,`length`,{value:a.length,writable:!1}),d}}_patchCallbackQuery(e){return t=>function(n,r,i){return e(n),t.apply(this,arguments)}}};o(h,`COMPONENT`,`tedious`),n.TediousInstrumentation=h})),cz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TediousInstrumentation=void 0;var t=sz();Object.defineProperty(e,`TediousInstrumentation`,{enumerable:!0,get:function(){return t.TediousInstrumentation}})})),lz,uz,dz,fz,pz,mz,hz=n((()=>{lz=cz(),X(),$(),uz=new Set([`callProcedure`,`execSql`,`execSqlBatch`,`execBulkLoad`,`prepare`,`execute`]),dz=`Tedious`,fz=Z(dz,()=>new lz.TediousInstrumentation({})),pz=(()=>{let e;return{name:dz,setupOnce(){e=hC(fz())},setup(t){e?.(()=>t.on(`spanStart`,e=>{let{description:t,data:n}=q(e);if(!t||n[`db.system`]!==`mssql`)return;let r=t.split(` `)[0]||``;uz.has(r)&&e.setAttribute(K,`auto.db.otel.tedious`)}))}}}),mz=Y(pz)})),gz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.57.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-generic-pool`})),_z=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.GenericPoolInstrumentation=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=gz(),s=`generic-pool`;t.GenericPoolInstrumentation=class extends r.InstrumentationBase{constructor(e={}){super(i.PACKAGE_NAME,i.PACKAGE_VERSION,e),o(this,`_isDisabled`,!1)}init(){return[new r.InstrumentationNodeModuleDefinition(s,[`>=3.0.0 <4`],e=>{let t=e.Pool;return(0,r.isWrapped)(t.prototype.acquire)&&this._unwrap(t.prototype,`acquire`),this._wrap(t.prototype,`acquire`,this._acquirePatcher.bind(this)),e},e=>{let t=e.Pool;return this._unwrap(t.prototype,`acquire`),e}),new r.InstrumentationNodeModuleDefinition(s,[`>=2.4.0 <3`],e=>{let t=e.Pool;return(0,r.isWrapped)(t.prototype.acquire)&&this._unwrap(t.prototype,`acquire`),this._wrap(t.prototype,`acquire`,this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let t=e.Pool;return this._unwrap(t.prototype,`acquire`),e}),new r.InstrumentationNodeModuleDefinition(s,[`>=2.0.0 <2.4`],e=>(this._isDisabled=!1,(0,r.isWrapped)(e.Pool)&&this._unwrap(e,`Pool`),this._wrap(e,`Pool`,this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let t=this;return function(...r){let i=n.context.active(),a=t.tracer.startSpan(`generic-pool.acquire`,{},i);return n.context.with(n.trace.setSpan(i,a),()=>e.call(this,...r).then(e=>(a.end(),e),e=>{throw a.recordException(e),a.end(),e}))}}_poolWrapper(e){let t=this;return function(){let n=e.apply(this,arguments);return t._wrap(n,`acquire`,t._acquireWithCallbacksPatcher.bind(t)),n}}_acquireWithCallbacksPatcher(e){let t=this;return function(r,i){if(t._isDisabled)return e.call(this,r,i);let a=n.context.active(),o=t.tracer.startSpan(`generic-pool.acquire`,{},a);return n.context.with(n.trace.setSpan(a,o),()=>{e.call(this,(e,t)=>{if(o.end(),r)return r(e,t)},i)})}}}})),vz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GenericPoolInstrumentation=void 0;var t=_z();Object.defineProperty(e,`GenericPoolInstrumentation`,{enumerable:!0,get:function(){return t.GenericPoolInstrumentation}})})),yz,bz,xz,Sz,Cz,wz=n((()=>{yz=vz(),X(),$(),bz=`GenericPool`,xz=Z(bz,()=>new yz.GenericPoolInstrumentation({})),Sz=(()=>{let e;return{name:bz,setupOnce(){e=hC(xz())},setup(t){e?.(()=>t.on(`spanStart`,e=>{let t=q(e).description;(t===`generic-pool.aquire`||t===`generic-pool.acquire`)&&e.setAttribute(K,`auto.db.otel.generic_pool`)}))}}}),Cz=Y(Sz)})),Tz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ATTR_NET_PEER_PORT=e.ATTR_NET_PEER_NAME=e.ATTR_MESSAGING_SYSTEM=e.ATTR_MESSAGING_OPERATION=void 0,e.ATTR_MESSAGING_OPERATION=`messaging.operation`,e.ATTR_MESSAGING_SYSTEM=`messaging.system`,e.ATTR_NET_PEER_NAME=`net.peer.name`,e.ATTR_NET_PEER_PORT=`net.peer.port`})),Ez=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ATTR_MESSAGING_CONVERSATION_ID=e.OLD_ATTR_MESSAGING_MESSAGE_ID=e.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=e.ATTR_MESSAGING_URL=e.ATTR_MESSAGING_PROTOCOL_VERSION=e.ATTR_MESSAGING_PROTOCOL=e.MESSAGING_OPERATION_VALUE_PROCESS=e.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=e.ATTR_MESSAGING_DESTINATION_KIND=e.ATTR_MESSAGING_DESTINATION=void 0,e.ATTR_MESSAGING_DESTINATION=`messaging.destination`,e.ATTR_MESSAGING_DESTINATION_KIND=`messaging.destination_kind`,e.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=`messaging.rabbitmq.routing_key`,e.MESSAGING_OPERATION_VALUE_PROCESS=`process`,e.ATTR_MESSAGING_PROTOCOL=`messaging.protocol`,e.ATTR_MESSAGING_PROTOCOL_VERSION=`messaging.protocol_version`,e.ATTR_MESSAGING_URL=`messaging.url`,e.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=`topic`,e.OLD_ATTR_MESSAGING_MESSAGE_ID=`messaging.message_id`,e.ATTR_MESSAGING_CONVERSATION_ID=`messaging.conversation_id`})),Dz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_CONFIG=e.EndOperation=void 0,(function(e){e.AutoAck=`auto ack`,e.Ack=`ack`,e.AckAll=`ackAll`,e.Reject=`reject`,e.Nack=`nack`,e.NackAll=`nackAll`,e.ChannelClosed=`channel closed`,e.ChannelError=`channel error`,e.InstrumentationTimeout=`instrumentation timeout`})(e.EndOperation||(e.EndOperation={})),e.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}})),Oz=i((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.isConfirmChannelTracing=t.unmarkConfirmChannelTracing=t.markConfirmChannelTracing=t.getConnectionAttributesFromUrl=t.getConnectionAttributesFromServer=t.normalizeExchange=t.CONNECTION_ATTRIBUTES=t.CHANNEL_CONSUME_TIMEOUT_TIMER=t.CHANNEL_SPANS_NOT_ENDED=t.MESSAGE_STORED_SPAN=void 0;var n=(T(),e(k)),r=(L(),e(I)),i=(F(),e(A)),a=Tz(),o=Ez();t.MESSAGE_STORED_SPAN=Symbol(`opentelemetry.amqplib.message.stored-span`),t.CHANNEL_SPANS_NOT_ENDED=Symbol(`opentelemetry.amqplib.channel.spans-not-ended`),t.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol(`opentelemetry.amqplib.channel.consumer-timeout-timer`),t.CONNECTION_ATTRIBUTES=Symbol(`opentelemetry.amqplib.connection.attributes`);var s=(0,n.createContextKey)(`opentelemetry.amqplib.channel.is-confirm-channel`);t.normalizeExchange=e=>e===``?`<default>`:e;var c=e=>e.replace(/:[^:@/]*@/,`:***@`),l=(e,t)=>e||(t===`AMQP`?5672:5671),u=e=>{let t=e||`amqp`;return(t.endsWith(`:`)?t.substring(0,t.length-1):t).toUpperCase()},d=e=>e||`localhost`,f=(e,t,r,i)=>r?{[t]:r}:(n.diag.error(`amqplib instrumentation: could not extract connection attribute ${i} from user supplied url`,{url:e}),{});t.getConnectionAttributesFromServer=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[a.ATTR_MESSAGING_SYSTEM]:t}:{}},t.getConnectionAttributesFromUrl=(e,t)=>{let s={[o.ATTR_MESSAGING_PROTOCOL_VERSION]:`0.9.1`};if(e=e||`amqp://localhost`,typeof e==`object`){let n=e,c=u(n?.protocol);Object.assign(s,{...f(e,o.ATTR_MESSAGING_PROTOCOL,c,`protocol`)});let p=d(n?.hostname);t&r.SemconvStability.OLD&&Object.assign(s,{...f(e,a.ATTR_NET_PEER_NAME,p,`hostname`)}),t&r.SemconvStability.STABLE&&Object.assign(s,{...f(e,i.ATTR_SERVER_ADDRESS,p,`hostname`)});let m=l(n.port,c);t&r.SemconvStability.OLD&&Object.assign(s,f(e,a.ATTR_NET_PEER_PORT,m,`port`)),t&r.SemconvStability.STABLE&&Object.assign(s,f(e,i.ATTR_SERVER_PORT,m,`port`))}else{let p=c(e);s[o.ATTR_MESSAGING_URL]=p;try{let e=new URL(p),n=u(e.protocol);Object.assign(s,{...f(p,o.ATTR_MESSAGING_PROTOCOL,n,`protocol`)});let c=d(e.hostname);t&r.SemconvStability.OLD&&Object.assign(s,{...f(p,a.ATTR_NET_PEER_NAME,c,`hostname`)}),t&r.SemconvStability.STABLE&&Object.assign(s,{...f(p,i.ATTR_SERVER_ADDRESS,c,`hostname`)});let m=l(e.port?parseInt(e.port):void 0,n);t&r.SemconvStability.OLD&&Object.assign(s,f(p,a.ATTR_NET_PEER_PORT,m,`port`)),t&r.SemconvStability.STABLE&&Object.assign(s,f(p,i.ATTR_SERVER_PORT,m,`port`))}catch(e){n.diag.error(`amqplib instrumentation: error while extracting connection details from connection url`,{censoredUrl:p,err:e})}}return s},t.markConfirmChannelTracing=e=>e.setValue(s,!0),t.unmarkConfirmChannelTracing=e=>e.deleteValue(s),t.isConfirmChannelTracing=e=>e.getValue(s)===!0})),kz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PACKAGE_NAME=e.PACKAGE_VERSION=void 0,e.PACKAGE_VERSION=`0.61.0`,e.PACKAGE_NAME=`@opentelemetry/instrumentation-amqplib`})),Az=i((t=>{a(),Object.defineProperty(t,`__esModule`,{value:!0}),t.AmqplibInstrumentation=void 0;var n=(T(),e(k)),r=(fi(),e(ui)),i=(L(),e(I)),s=Tz(),c=Ez(),l=Dz(),u=Oz(),d=kz(),f=[`>=0.5.5 <1`];t.AmqplibInstrumentation=class extends i.InstrumentationBase{constructor(e={}){super(d.PACKAGE_NAME,d.PACKAGE_VERSION,{...l.DEFAULT_CONFIG,...e}),o(this,`_netSemconvStability`,void 0),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,i.semconvStabilityFromStr)(`http`,process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...l.DEFAULT_CONFIG,...e})}init(){let e=new i.InstrumentationNodeModuleFile(`amqplib/lib/channel_model.js`,f,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),t=new i.InstrumentationNodeModuleFile(`amqplib/lib/callback_model.js`,f,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new i.InstrumentationNodeModuleFile(`amqplib/lib/connect.js`,f,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new i.InstrumentationNodeModuleDefinition(`amqplib`,f,void 0,void 0,[e,n,t])}patchConnect(e){return e=this.unpatchConnect(e),(0,i.isWrapped)(e.connect)||this._wrap(e,`connect`,this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,i.isWrapped)(e.connect)&&this._unwrap(e,`connect`),e}patchChannelModel(e,t){return(0,i.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,`publish`,this.getPublishPatch.bind(this,t)),(0,i.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,`consume`,this.getConsumePatch.bind(this,t)),(0,i.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,`ack`,this.getAckPatch.bind(this,!1,l.EndOperation.Ack)),(0,i.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,`nack`,this.getAckPatch.bind(this,!0,l.EndOperation.Nack)),(0,i.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,`reject`,this.getAckPatch.bind(this,!0,l.EndOperation.Reject)),(0,i.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,`ackAll`,this.getAckAllPatch.bind(this,!1,l.EndOperation.AckAll)),(0,i.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,`nackAll`,this.getAckAllPatch.bind(this,!0,l.EndOperation.NackAll)),(0,i.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,`emit`,this.getChannelEmitPatch.bind(this)),(0,i.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,`publish`,this.getConfirmedPublishPatch.bind(this,t)),e}unpatchChannelModel(e){return(0,i.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,`publish`),(0,i.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,`consume`),(0,i.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,`ack`),(0,i.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,`nack`),(0,i.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,`reject`),(0,i.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,`ackAll`),(0,i.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,`nackAll`),(0,i.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,`emit`),(0,i.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,`publish`),e}getConnectPatch(e){let t=this;return function(n,r,i){return e.call(this,n,r,function(e,r){if(e==null){let e=(0,u.getConnectionAttributesFromUrl)(n,t._netSemconvStability),i=(0,u.getConnectionAttributesFromServer)(r);r[u.CONNECTION_ATTRIBUTES]={...e,...i}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let t=this;return function(n){if(n===`close`){t.endAllSpansOnChannel(this,!0,l.EndOperation.ChannelClosed,void 0);let e=this[u.CHANNEL_CONSUME_TIMEOUT_TIMER];e&&clearInterval(e),this[u.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else n===`error`&&t.endAllSpansOnChannel(this,!0,l.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,t,n){let r=this;return function(i){return r.endAllSpansOnChannel(this,e,t,i),n.apply(this,arguments)}}getAckPatch(e,t,n){let r=this;return function(i,a,o){let s=this,c=t===l.EndOperation.Reject?a:o,d=s[u.CHANNEL_SPANS_NOT_ENDED]??[],f=d.findIndex(e=>e.msg===i);if(f<0)r.endConsumerSpan(i,e,t,c);else if(t!==l.EndOperation.Reject&&a){for(let n=0;n<=f;n++)r.endConsumerSpan(d[n].msg,e,t,c);d.splice(0,f+1)}else r.endConsumerSpan(i,e,t,c),d.splice(f,1);return n.apply(this,arguments)}}getConsumePatch(e,t){let a=this;return function(o,d,f){let p=this;if(!Object.prototype.hasOwnProperty.call(p,u.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:e}=a.getConfig();if(e){let t=setInterval(()=>{a.checkConsumeTimeoutOnChannel(p)},e);t.unref(),p[u.CHANNEL_CONSUME_TIMEOUT_TIMER]=t}p[u.CHANNEL_SPANS_NOT_ENDED]=[]}let m=function(t){if(!t)return d.call(this,t);let m=t.properties.headers??{},h=n.propagation.extract(n.ROOT_CONTEXT,m),g=t.fields?.exchange,_;if(a._config.useLinksForConsume){let e=h?n.trace.getSpan(h)?.spanContext():void 0;h=void 0,e&&(_=[{context:e}])}let v=a.tracer.startSpan(`${o} process`,{kind:n.SpanKind.CONSUMER,attributes:{...p?.connection?.[u.CONNECTION_ATTRIBUTES],[c.ATTR_MESSAGING_DESTINATION]:g,[c.ATTR_MESSAGING_DESTINATION_KIND]:c.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[c.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:t.fields?.routingKey,[s.ATTR_MESSAGING_OPERATION]:c.MESSAGING_OPERATION_VALUE_PROCESS,[c.OLD_ATTR_MESSAGING_MESSAGE_ID]:t?.properties.messageId,[c.ATTR_MESSAGING_CONVERSATION_ID]:t?.properties.correlationId},links:_},h),{consumeHook:y}=a.getConfig();y&&(0,i.safeExecuteInTheMiddle)(()=>y(v,{moduleVersion:e,msg:t}),e=>{e&&n.diag.error(`amqplib instrumentation: consumerHook error`,e)},!0),f?.noAck||(p[u.CHANNEL_SPANS_NOT_ENDED].push({msg:t,timeOfConsume:(0,r.hrTime)()}),t[u.MESSAGE_STORED_SPAN]=v);let b=h||n.ROOT_CONTEXT;n.context.with(n.trace.setSpan(b,v),()=>{d.call(this,t)}),f?.noAck&&(a.callConsumeEndHook(v,t,!1,l.EndOperation.AutoAck),v.end())};return arguments[1]=m,t.apply(this,arguments)}}getConfirmedPublishPatch(e,t){let r=this;return function(a,o,s,c,l){let d=this,{span:f,modifiedOptions:p}=r.createPublishSpan(r,a,o,d,c),{publishHook:m}=r.getConfig();m&&(0,i.safeExecuteInTheMiddle)(()=>m(f,{moduleVersion:e,exchange:a,routingKey:o,content:s,options:p,isConfirmChannel:!0}),e=>{e&&n.diag.error(`amqplib instrumentation: publishHook error`,e)},!0);let h=function(t,u){try{l?.call(this,t,u)}finally{let{publishConfirmHook:l}=r.getConfig();l&&(0,i.safeExecuteInTheMiddle)(()=>l(f,{moduleVersion:e,exchange:a,routingKey:o,content:s,options:c,isConfirmChannel:!0,confirmError:t}),e=>{e&&n.diag.error(`amqplib instrumentation: publishConfirmHook error`,e)},!0),t&&f.setStatus({code:n.SpanStatusCode.ERROR,message:`message confirmation has been nack'ed`}),f.end()}},g=(0,u.markConfirmChannelTracing)(n.context.active()),_=[...arguments];return _[3]=p,_[4]=n.context.bind((0,u.unmarkConfirmChannelTracing)(n.trace.setSpan(g,f)),h),n.context.with(g,t.bind(this,..._))}}getPublishPatch(e,t){let r=this;return function(a,o,s,c){if((0,u.isConfirmChannelTracing)(n.context.active()))return t.apply(this,arguments);{let l=this,{span:u,modifiedOptions:d}=r.createPublishSpan(r,a,o,l,c),{publishHook:f}=r.getConfig();f&&(0,i.safeExecuteInTheMiddle)(()=>f(u,{moduleVersion:e,exchange:a,routingKey:o,content:s,options:d,isConfirmChannel:!1}),e=>{e&&n.diag.error(`amqplib instrumentation: publishHook error`,e)},!0);let p=[...arguments];p[3]=d;let m=t.apply(this,p);return u.end(),m}}}createPublishSpan(e,t,r,i,a){let o=(0,u.normalizeExchange)(t),s=e.tracer.startSpan(`publish ${o}`,{kind:n.SpanKind.PRODUCER,attributes:{...i.connection[u.CONNECTION_ATTRIBUTES],[c.ATTR_MESSAGING_DESTINATION]:t,[c.ATTR_MESSAGING_DESTINATION_KIND]:c.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[c.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[c.OLD_ATTR_MESSAGING_MESSAGE_ID]:a?.messageId,[c.ATTR_MESSAGING_CONVERSATION_ID]:a?.correlationId}}),l=a??{};return l.headers=l.headers??{},n.propagation.inject(n.trace.setSpan(n.context.active(),s),l.headers),{span:s,modifiedOptions:l}}endConsumerSpan(e,t,r,i){let a=e[u.MESSAGE_STORED_SPAN];a&&(t!==!1&&a.setStatus({code:n.SpanStatusCode.ERROR,message:r!==l.EndOperation.ChannelClosed&&r!==l.EndOperation.ChannelError?`${r} called on message${i===!0?` with requeue`:i===!1?` without requeue`:``}`:r}),this.callConsumeEndHook(a,e,t,r),a.end(),e[u.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,t,n,r){(e[u.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(e=>{this.endConsumerSpan(e.msg,t,n,r)}),e[u.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,t,r,a){let{consumeEndHook:o}=this.getConfig();o&&(0,i.safeExecuteInTheMiddle)(()=>o(e,{msg:t,rejected:r,endOperation:a}),e=>{e&&n.diag.error(`amqplib instrumentation: consumerEndHook error`,e)},!0)}checkConsumeTimeoutOnChannel(e){let t=(0,r.hrTime)(),n=e[u.CHANNEL_SPANS_NOT_ENDED]??[],i,{consumeTimeoutMs:a}=this.getConfig();for(i=0;i<n.length;i++){let e=n[i],o=(0,r.hrTimeDuration)(e.timeOfConsume,t);if((0,r.hrTimeToMilliseconds)(o)<a)break;this.endConsumerSpan(e.msg,null,l.EndOperation.InstrumentationTimeout,!0)}n.splice(0,i)}}})),jz=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EndOperation=e.DEFAULT_CONFIG=e.AmqplibInstrumentation=void 0;var t=Az();Object.defineProperty(e,`AmqplibInstrumentation`,{enumerable:!0,get:function(){return t.AmqplibInstrumentation}});var n=Dz();Object.defineProperty(e,`DEFAULT_CONFIG`,{enumerable:!0,get:function(){return n.DEFAULT_CONFIG}}),Object.defineProperty(e,`EndOperation`,{enumerable:!0,get:function(){return n.EndOperation}})})),Mz,Nz,Pz,Fz,Iz,Lz,Rz=n((()=>{Mz=jz(),X(),$(),Nz=`Amqplib`,Pz={consumeEndHook:e=>{xk(e,`auto.amqplib.otel.consumer`)},publishHook:e=>{xk(e,`auto.amqplib.otel.publisher`)}},Fz=Z(Nz,()=>new Mz.AmqplibInstrumentation(Pz)),Iz=(()=>({name:Nz,setupOnce(){Fz()}})),Lz=Y(Iz)})),zz,Bz=n((()=>{zz=`VercelAI`}));function Vz(e){if(typeof e!=`object`||!e)return!1;let t=e;return`type`in t&&`error`in t&&`toolName`in t&&`toolCallId`in t&&t.type===`tool-error`&&t.error instanceof Error}function Hz(e){if(typeof e!=`object`||!e||!(`content`in e))return;let t=e;Array.isArray(t.content)&&(Uz(t.content),Wz(t.content))}function Uz(e){for(let t of e){if(!Vz(t))continue;let e=bb(t.toolCallId);fl(e?n=>{n.setContext(`trace`,{trace_id:e.traceId,span_id:e.spanId}),n.setTag(`vercel.ai.tool.name`,t.toolName),n.setTag(`vercel.ai.tool.callId`,t.toolCallId),n.setLevel(`error`),J(t.error,{mechanism:{type:`auto.vercelai.otel`,handled:!1}})}:e=>{e.setTag(`vercel.ai.tool.name`,t.toolName),e.setTag(`vercel.ai.tool.callId`,t.toolCallId),e.setLevel(`error`),J(t.error,{mechanism:{type:`auto.vercelai.otel`,handled:!1}})})}}function Wz(e){for(let t of e)typeof t==`object`&&t&&`toolCallId`in t&&typeof t.toolCallId==`string`&&xb(t.toolCallId)}function Gz(e,t,n,r){return{recordInputs:e?.recordInputs===void 0?t.recordInputs===void 0?n===!0?!0:r:t.recordInputs:e.recordInputs,recordOutputs:e?.recordOutputs===void 0?t.recordOutputs===void 0?n===!0?!0:r:t.recordOutputs:e.recordOutputs}}var Kz,qz,Jz,Yz=n((()=>{L(),X(),Bz(),Kz=[`>=3.0.0 <7`],qz=[`generateText`,`streamText`,`generateObject`,`streamObject`,`embed`,`embedMany`,`rerank`],Jz=class e extends $a{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super(`@sentry/instrumentation-vercel-ai`,So,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new io(`ai`,Kz,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(e=>e()),this._callbacks=[];let t=e=>new Proxy(e,{apply:(e,t,n)=>{let r=n[0].experimental_telemetry||{},i=r.isEnabled,a=W(),o=a?.getIntegrationByName(zz),s=o?.options,{recordInputs:c,recordOutputs:l}=Gz(s,r,i,o?!!a?.getOptions().sendDefaultPii:!1);return n[0].experimental_telemetry={...r,isEnabled:i===void 0?!0:i,recordInputs:c,recordOutputs:l},lf(()=>Reflect.apply(e,t,n),e=>{e&&typeof e==`object`&&Ps(e,`_sentry_active_span`,Wu())},()=>{},e=>{Hz(e)})}});if(Object.prototype.toString.call(e)===`[object Module]`){for(let n of qz)e[n]!=null&&(e[n]=t(e[n]));return e}else{let n=qz.reduce((n,r)=>(e[r]!=null&&(n[r]=t(e[r])),n),{});return{...e,...n}}}}}));function Xz(e){return!!e.getIntegrationByName(`Modules`)?.getModules?.()?.ai}var Zz,Qz,$z,eB=n((()=>{X(),$(),Bz(),Yz(),Zz=Z(zz,()=>new Jz({})),Qz=((e={})=>{let t;return{name:zz,options:e,setupOnce(){t=Zz()},afterAllSetup(n){e.force??Xz(n)?Fb(n):t?.callWhenPatched(()=>Fb(n))}}}),$z=Y(Qz)})),tB,nB,rB=n((()=>{L(),X(),tB=[`>=4.0.0 <7`],nB=class extends $a{constructor(e={}){super(`@sentry/instrumentation-openai`,So,e)}init(){return new io(`openai`,tB,this._patch.bind(this))}_patch(e){let t=e;return t=this._patchClient(t,`OpenAI`),t=this._patchClient(t,`AzureOpenAI`),t}_patchClient(e,t){let n=e[t];if(!n)return e;let r=this.getConfig(),i=function(...e){return lh(`OpenAI`)?Reflect.construct(n,e):ox(Reflect.construct(n,e),r)};Object.setPrototypeOf(i,n),Object.setPrototypeOf(i.prototype,n.prototype);for(let e of Object.getOwnPropertyNames(n))if(![`length`,`name`,`prototype`].includes(e)){let t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(i,e,t)}try{e[t]=i}catch{Object.defineProperty(e,t,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=i}catch{Object.defineProperty(e,`default`,{value:i,writable:!0,configurable:!0,enumerable:!0})}return e}}})),iB,aB,oB,sB=n((()=>{X(),$(),rB(),iB=Z(zb,e=>new nB(e)),aB=((e={})=>({name:zb,setupOnce(){iB(e)}})),oB=Y(aB)})),cB,lB,uB=n((()=>{L(),X(),cB=[`>=0.19.2 <1.0.0`],lB=class extends $a{constructor(e={}){super(`@sentry/instrumentation-anthropic-ai`,So,e)}init(){return new io(`@anthropic-ai/sdk`,cB,this._patch.bind(this))}_patch(e){let t=e.Anthropic,n=this.getConfig(),r=function(...e){return lh(`Anthropic_AI`)?Reflect.construct(t,e):Fx(Reflect.construct(t,e),n)};Object.setPrototypeOf(r,t),Object.setPrototypeOf(r.prototype,t.prototype);for(let e of Object.getOwnPropertyNames(t))if(![`length`,`name`,`prototype`].includes(e)){let n=Object.getOwnPropertyDescriptor(t,e);n&&Object.defineProperty(r,e,n)}try{e.Anthropic=r}catch{Object.defineProperty(e,`Anthropic`,{value:r,writable:!0,configurable:!0,enumerable:!0})}if(e.default===t)try{e.default=r}catch{Object.defineProperty(e,`default`,{value:r,writable:!0,configurable:!0,enumerable:!0})}return e}}})),dB,fB,pB,mB=n((()=>{X(),$(),uB(),dB=Z(cx,e=>new lB(e)),fB=((e={})=>({name:cx,options:e,setupOnce(){dB(e)}})),pB=Y(fB)})),hB,gB,_B=n((()=>{L(),X(),hB=[`>=0.10.0 <2`],gB=class extends $a{constructor(e={}){super(`@sentry/instrumentation-google-genai`,So,e)}init(){return new io(`@google/genai`,hB,e=>this._patch(e),e=>e,[new oo(`@google/genai/dist/node/index.cjs`,hB,e=>this._patch(e),e=>e)])}_patch(e){let t=e.GoogleGenAI,n=this.getConfig();if(typeof t!=`function`)return e;let r=function(...e){return lh(`Google_GenAI`)?Reflect.construct(t,e):nS(Reflect.construct(t,e),n)};Object.setPrototypeOf(r,t),Object.setPrototypeOf(r.prototype,t.prototype);for(let e of Object.getOwnPropertyNames(t))if(![`length`,`name`,`prototype`].includes(e)){let n=Object.getOwnPropertyDescriptor(t,e);n&&Object.defineProperty(r,e,n)}return QS(e,`GoogleGenAI`,r),e}}})),vB,yB,bB,xB=n((()=>{X(),$(),_B(),vB=Z(Lx,e=>new gB(e)),yB=((e={})=>({name:Lx,setupOnce(){vB(e)}})),bB=Y(yB)}));function SB(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e==`object`?[e,t]:e:[t]}function CB(e,t,n){return new Proxy(e,{apply(e,n,r){let i=r[1];(!i||typeof i!=`object`||Array.isArray(i))&&(i={},r[1]=i);let a=i.callbacks,o=SB(a,t);return i.callbacks=o,Reflect.apply(e,n,r)}})}var wB,TB,EB=n((()=>{L(),X(),wB=[`>=0.1.0 <2.0.0`],TB=class extends $a{constructor(e={}){super(`@sentry/instrumentation-langchain`,So,e)}init(){let e=[];for(let t of[`@langchain/anthropic`,`@langchain/openai`,`@langchain/google-genai`,`@langchain/mistralai`,`@langchain/google-vertexai`,`@langchain/groq`])e.push(new io(t,wB,this._patch.bind(this),e=>e,[new oo(`${t}/dist/index.cjs`,wB,this._patch.bind(this),e=>e)]));return e.push(new io(`langchain`,wB,this._patch.bind(this),e=>e,[new oo(`langchain/dist/chat_models/universal.cjs`,wB,this._patch.bind(this),e=>e)])),e}_patch(e){ch([zb,cx,Lx]);let t=this.getConfig(),n=wS(t);return this._patchRunnableMethods(e,n),this._patchEmbeddingsMethods(e,t),e}_patchRunnableMethods(e,t){let n=[`ChatAnthropic`,`ChatOpenAI`,`ChatGoogleGenerativeAI`,`ChatMistralAI`,`ChatVertexAI`,`ChatGroq`,`ConfigurableModel`],r=e.universal_exports??e,i=Object.values(r).find(e=>typeof e==`function`&&n.includes(e.name));if(!i)return;let a=i.prototype;if(!a.__sentry_patched__){a.__sentry_patched__=!0;for(let e of[`invoke`,`stream`,`batch`]){let n=a[e];typeof n==`function`&&(a[e]=CB(n,t))}}}_patchEmbeddingsMethods(e,t){let n=e.universal_exports??e;for(let e of Object.values(n)){if(typeof e!=`function`||!e.prototype)continue;let n=e.prototype;typeof n.embedQuery!=`function`||typeof n.embedDocuments!=`function`||n.__sentry_patched__||(n.__sentry_patched__=!0,dC(n,t))}}}})),DB,OB,kB,AB=n((()=>{X(),$(),EB(),DB=Z(iS,e=>new TB(e)),OB=((e={})=>({name:iS,setupOnce(){DB(e)}})),kB=Y(OB)})),jB,MB,NB=n((()=>{L(),X(),jB=[`>=0.0.0 <2.0.0`],MB=class extends $a{constructor(e={}){super(`@sentry/instrumentation-langgraph`,So,e)}init(){return new io(`@langchain/langgraph`,jB,this._patch.bind(this),e=>e,[new oo(`@langchain/langgraph/dist/index.cjs`,jB,this._patch.bind(this),e=>e)])}_patch(e){return e.StateGraph&&typeof e.StateGraph==`function`&&LS(e.StateGraph.prototype,this.getConfig()),e}}})),PB,FB,IB,LB=n((()=>{X(),$(),NB(),PB=Z(ES,e=>new MB(e)),FB=((e={})=>({name:ES,setupOnce(){PB(e)}})),IB=Y(FB)}));function RB(e,t,n,r,i){let a=()=>{},o=i.firestoreSpanCreationHook;typeof o==`function`&&(a=e=>{Ka(()=>o(e),e=>{e&&E.error(e?.message)},!0)});let s=new io(`@firebase/firestore`,t,t=>zB(t,n,r,e,a));for(let i of[`@firebase/firestore/dist/lite/index.node.cjs.js`,`@firebase/firestore/dist/lite/index.node.mjs.js`,`@firebase/firestore/dist/lite/index.rn.esm2017.js`,`@firebase/firestore/dist/lite/index.cjs.js`])s.files.push(new oo(i,t,t=>zB(t,n,r,e,a),e=>BB(e,r)));return s}function zB(e,t,n,r,i){return BB(e,n),t(e,`addDoc`,VB(r,i)),t(e,`getDocs`,UB(r,i)),t(e,`setDoc`,WB(r,i)),t(e,`deleteDoc`,HB(r,i)),e}function BB(e,t){for(let n of[`addDoc`,`getDocs`,`setDoc`,`deleteDoc`])Ja(e[n])&&t(e,n);return e}function VB(e,t){return function(n){return function(r,i){let a=KB(e,`addDoc`,r);return t(a),GB(a,()=>n(r,i))}}}function HB(e,t){return function(n){return function(r){let i=KB(e,`deleteDoc`,r.parent||r);return t(i),GB(i,()=>n(r))}}}function UB(e,t){return function(n){return function(r){let i=KB(e,`getDocs`,r);return t(i),GB(i,()=>n(r))}}}function WB(e,t){return function(n){return function(r,i,a){let o=KB(e,`setDoc`,r.parent||r);return t(o),GB(o,()=>a===void 0?n(r,i):n(r,i,a))}}}function GB(e,t){return O.with(D.setSpan(O.active(),e),()=>Ka(()=>t(),t=>{t&&e.recordException(t),e.end()},!0))}function KB(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:w.CLIENT});return JB(r,n),r.setAttribute(P,t),r}function qB(e){let t,n;if(typeof e.host==`string`)if(e.host.startsWith(`[`)){if(e.host.endsWith(`]`))t=e.host.replace(/^\[|\]$/g,``);else if(e.host.includes(`]:`)){let r=e.host.lastIndexOf(`:`);r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,``),n=e.host.slice(r+1))}}else if(Et.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(`:`);r===-1?t=e.host:(t=e.host.slice(0,r),n=e.host.slice(r+1))}return{address:t,port:n?parseInt(n,10):void 0}}function JB(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},a={[le]:t.path,[ue]:n.name,[ce]:`firebase.firestore`,"firebase.firestore.type":t.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:o,port:s}=qB(i);o&&(a[_e]=o),s&&(a[ge]=s),e.setAttributes(a)}var YB=n((()=>{T(),L(),F()}));function XB(e,t,n,r,i){let a=()=>{},o=()=>{},s=i.functions?.errorHook,c=i.functions?.requestHook,l=i.functions?.responseHook;typeof l==`function`&&(o=(e,t)=>{Ka(()=>l(e,t),e=>{e&&E.error(e?.message)},!0)}),typeof c==`function`&&(a=e=>{Ka(()=>c(e),e=>{e&&E.error(e?.message)},!0)});let u=new io(`firebase-functions`,t);return[{name:`firebase-functions/lib/v2/providers/https.js`,triggerType:`function`},{name:`firebase-functions/lib/v2/providers/firestore.js`,triggerType:`firestore`},{name:`firebase-functions/lib/v2/providers/scheduler.js`,triggerType:`scheduler`},{name:`firebase-functions/lib/v2/storage.js`,triggerType:`storage`}].forEach(({name:i,triggerType:c})=>{u.files.push(new oo(i,t,t=>QB(t,n,r,e,{requestHook:a,responseHook:o,errorHook:s},c),e=>$B(e,r)))}),u}function ZB(e,t,n){return function(r){return function(...i){let a=typeof i[0]==`function`?i[0]:i[1],o=typeof i[0]==`function`?void 0:i[0];if(!a)return r.call(this,...i);let s=async function(...r){let i=process.env.FUNCTION_TARGET||process.env.K_SERVICE||`unknown`,o=e.startSpan(`firebase.function.${n}`,{kind:w.SERVER}),s={"faas.name":i,"faas.trigger":n,"faas.provider":`firebase`};return process.env.GCLOUD_PROJECT&&(s[`cloud.project_id`]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(s[`cloud.event_source`]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),o.setAttributes(s),t?.requestHook?.(o),O.with(D.setSpan(O.active(),o),async()=>{let e,n;try{n=await a.apply(this,r)}catch(t){e=t}if(t?.responseHook?.(o,e),e&&o.recordException(e),o.end(),e)throw await t?.errorHook?.(o,e),e;return n})};return o?r.call(this,o,s):r.call(this,s)}}}function QB(e,t,n,r,i,a){switch($B(e,n),a){case`function`:t(e,`onRequest`,ZB(r,i,`http.request`)),t(e,`onCall`,ZB(r,i,`http.call`));break;case`firestore`:t(e,`onDocumentCreated`,ZB(r,i,`firestore.document.created`)),t(e,`onDocumentUpdated`,ZB(r,i,`firestore.document.updated`)),t(e,`onDocumentDeleted`,ZB(r,i,`firestore.document.deleted`)),t(e,`onDocumentWritten`,ZB(r,i,`firestore.document.written`)),t(e,`onDocumentCreatedWithAuthContext`,ZB(r,i,`firestore.document.created`)),t(e,`onDocumentUpdatedWithAuthContext`,ZB(r,i,`firestore.document.updated`)),t(e,`onDocumentDeletedWithAuthContext`,ZB(r,i,`firestore.document.deleted`)),t(e,`onDocumentWrittenWithAuthContext`,ZB(r,i,`firestore.document.written`));break;case`scheduler`:t(e,`onSchedule`,ZB(r,i,`scheduler.scheduled`));break;case`storage`:t(e,`onObjectFinalized`,ZB(r,i,`storage.object.finalized`)),t(e,`onObjectArchived`,ZB(r,i,`storage.object.archived`)),t(e,`onObjectDeleted`,ZB(r,i,`storage.object.deleted`)),t(e,`onObjectMetadataUpdated`,ZB(r,i,`storage.object.metadataUpdated`));break}return e}function $B(e,t){for(let n of[`onSchedule`,`onRequest`,`onCall`,`onObjectFinalized`,`onObjectArchived`,`onObjectDeleted`,`onObjectMetadataUpdated`,`onDocumentCreated`,`onDocumentUpdated`,`onDocumentDeleted`,`onDocumentWritten`,`onDocumentCreatedWithAuthContext`,`onDocumentUpdatedWithAuthContext`,`onDocumentDeletedWithAuthContext`,`onDocumentWrittenWithAuthContext`])Ja(e[n])&&t(e,n);return e}var eV=n((()=>{T(),L()})),tV,nV,rV,iV,aV=n((()=>{L(),X(),YB(),eV(),tV={},nV=[`>=3.0.0 <5`],rV=[`>=6.0.0 <7`],iV=class extends $a{constructor(e=tV){super(`@sentry/instrumentation-firebase`,So,e)}setConfig(e={}){super.setConfig({...tV,...e})}init(){let e=[];return e.push(RB(this.tracer,nV,this._wrap,this._unwrap,this.getConfig())),e.push(XB(this.tracer,rV,this._wrap,this._unwrap,this.getConfig())),e}}})),oV,sV,cV,lV,uV,dV=n((()=>{X(),$(),aV(),oV=`Firebase`,sV={firestoreSpanCreationHook:e=>{xk(e,`auto.firebase.otel.firestore`),e.setAttribute(G,`db.query`)},functions:{requestHook:e=>{xk(e,`auto.firebase.otel.functions`),e.setAttribute(G,`http.request`)},errorHook:async(e,t)=>{t&&(J(t,{mechanism:{type:`auto.firebase.otel.functions`,handled:!1}}),await xp(2e3))}}},cV=Z(oV,()=>new iV(sV)),lV=(()=>({name:oV,setupOnce(){cV()}})),uV=Y(lV)}));function fV(){return[tA(),aN(),xN(),jR(),aP(),gP(),OP(),BP(),SF(),IF(),aR(),vR(),WR(),nz(),mz(),Cz(),NN(),Lz(),HN(),kB(),IB(),$z(),oB(),pB(),bB(),GF(),uV()]}var pV=n((()=>{Rz(),mB(),rz(),nA(),oN(),dV(),wz(),xB(),SN(),yR(),MR(),PN(),GR(),AB(),LB(),UN(),oP(),_P(),kP(),VP(),sB(),LF(),KF(),oR(),CF(),hz(),eB()}));function mV(e,t={}){e.getOptions().debug&&kE();let[n,r]=hV(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function hV(e,t={}){let n=new Ke({sampler:new wE(e),resource:XT(`node`),forceFlushTimeoutMillis:500,spanProcessors:[new CE({timeout:gV(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});D.setGlobalTracerProvider(n),C.setGlobalPropagator(new hE);let r=new DE;return O.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function gV(e){if(e!=null){if(e>_V)return Jk&&V.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${_V}`),_V;if(e<=0||Number.isNaN(e)){Jk&&V.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var _V,vV=n((()=>{T(),Je(),X(),$(),EE(),Yk(),_V=1e6}));function yV(){return fk().filter(e=>e.name!==`Http`&&e.name!==`NodeFetch`).concat(Nk(),Kk())}function bV(e){return[...yV(),...ed(e)?fV():[]]}function xV(e={}){return SV(e,bV)}function SV(e={},t){Oh(e,`node`);let n=pk({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(mV(n,{spanProcessors:e.openTelemetrySpanProcessors}),hk()),n}var CV=n((()=>{X(),$(),Pk(),qk(),pV(),vV()})),wV=n((()=>{Pk(),qk(),X(),$(),nA(),oN(),SN(),PN(),UN(),oP(),_P(),kP(),VP(),CF(),LF(),KF(),oR(),yR(),MR(),GR(),rz(),hz(),wz(),Rz(),eB(),sB(),mB(),xB(),AB(),LB(),dV(),CV(),vV(),pV(),EE()}));function TV(){if(OV)return;let e=process.env.SENTRY_DSN;if(!e){We(`[sentry] SENTRY_DSN not set, skipping initialization`);return}xV({dsn:e,release:typeof MACRO<`u`?`2.6.5`:void 0,environment:typeof BUILD_ENV<`u`?BUILD_ENV:`production`,maxBreadcrumbs:20,sampleRate:1,beforeSend(e){let t=e.request;if(t?.headers){let e=[`authorization`,`x-api-key`,`cookie`,`set-cookie`];for(let n of Object.keys(t.headers))e.includes(n.toLowerCase())&&delete t.headers[n]}return e},ignoreErrors:[`ECONNREFUSED`,`ECONNRESET`,`ENOTFOUND`,`ETIMEDOUT`,`AbortError`,`The user aborted a request`,`CancelError`],beforeSendTransaction(e){return null}}),OV=!0,We(`[sentry] Initialized successfully`)}function EV(e,t){if(OV)try{fl(n=>{t&&n.setExtras(t),J(e)})}catch{}}async function DV(e=2e3){if(OV)try{await Sp(e),We(`[sentry] Closed successfully`)}catch{}}var OV,kV=n((()=>{wV(),Ge(),OV=!1}));export{kV as i,DV as n,TV as r,EV as t};
|