claude-code-best 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AddWorkspaceDirectory-Cj5bvJgD.js +1 -0
- package/dist/chunks/App-2tgSv9lb.js +1 -0
- package/dist/chunks/ApproveApiKey-DWa-XTLb.js +1 -0
- package/dist/chunks/ApproveApiKey-SIUwkD8j.js +1 -0
- package/dist/chunks/AssistantSessionChooser-DF9eeJZS.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-BW4XHmkw.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Bz0JyaOG.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +1 -0
- package/dist/chunks/DesktopHandoff-CcsM_OAS.js +1 -0
- package/dist/chunks/DevChannelsDialog-DXRgY00D.js +1 -0
- package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
- package/dist/chunks/DiffDialog-PvNZfZby.js +3 -0
- package/dist/chunks/Doctor--B1HUENo.js +1 -0
- package/dist/chunks/Doctor-CE_jL9jC.js +3 -0
- package/dist/chunks/ExitFlow-C4ybxKPn.js +2 -0
- package/dist/chunks/Feedback-B5rPGl_C.js +2 -0
- package/dist/chunks/Grove-C2YjB3zL.js +1 -0
- package/dist/chunks/Grove-CKVpREDU.js +11 -0
- package/dist/chunks/HybridTransport-Byjvz-DL.js +4 -0
- package/dist/chunks/ITermBackend-Co9XpeS4.js +1 -0
- package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
- package/dist/chunks/InvalidConfigDialog-CNsqbNU3.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-ClnZaN6b.js +1 -0
- package/dist/chunks/ListItem-OFARanN7.js +1 -0
- package/dist/chunks/MCPConnectionManager-CDsa79pu.js +1 -0
- package/dist/chunks/McpParsingWarnings-DZkzoeZf.js +1 -0
- package/dist/chunks/MessageSelector-CkeGQPNM.js +3 -0
- package/dist/chunks/Messages-PfbzLYOU.js +11 -0
- package/dist/chunks/Onboarding-BwoGQB4g.js +1 -0
- package/dist/chunks/OverageCreditUpsell-Q5g2YjQw.js +1 -0
- package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
- package/dist/chunks/PluginSettings-B2ASJ0Rx.js +17 -0
- package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-D4lMVCqj.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-BvLtS6an.js +1 -0
- package/dist/chunks/QueryEngine-Av0G5fze.js +1 -0
- package/dist/chunks/REPL-DCwqua0C.js +1 -0
- package/dist/chunks/REPL-Dh8vzGmF.js +97 -0
- package/dist/chunks/RemoteCallout-BV_hoz98.js +1 -0
- package/dist/chunks/RemoteSessionManager-Cxoy1ud2.js +2 -0
- package/dist/chunks/ResumeConversation-B3WuB8rs.js +1 -0
- package/dist/chunks/SSETransport-pIm26VJq.js +4 -0
- package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +1 -0
- package/dist/chunks/SentryErrorBoundary-B6EWoJml.js +2 -0
- package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +1 -0
- package/dist/chunks/Settings-CreAhCsb.js +2 -0
- package/dist/chunks/TeleportProgress-DPzGpyyM.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-DPSO0S49.js +1 -0
- package/dist/chunks/ThemePicker-DueihHcy.js +1 -0
- package/dist/chunks/TmuxBackend-BNaZNAeP.js +9 -0
- package/dist/chunks/TrustDialog-CIzAlGn9.js +1 -0
- package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
- package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
- package/dist/chunks/ValidationErrorsList-1k1qbsRo.js +2 -0
- package/dist/chunks/WelcomeV2-CR6TtXXM.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +2 -0
- package/dist/chunks/add-dir-DAMizKzF.js +1 -0
- package/dist/chunks/agentDisplay-B9z7i8b_.js +1 -0
- package/dist/chunks/agents-D5u0p1UC.js +103 -0
- package/dist/chunks/agents-DCh_gEvJ.js +2 -0
- package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
- package/dist/chunks/analytics-DqMQntaB.js +1 -0
- package/dist/chunks/ant-DRJq-cEg.js +1 -0
- package/dist/chunks/api-B6URs6nc.js +1 -0
- package/dist/chunks/api-Dz_3z1kl.js +1 -0
- package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
- package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
- package/dist/chunks/assistant-BRGDWkKB.js +1 -0
- package/dist/chunks/assistant-tPxOUa-Z.js +1 -0
- package/dist/chunks/assistant-zVegFdAO.js +1 -0
- package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
- package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
- package/dist/chunks/auth-CqURlg4d.js +1 -0
- package/dist/chunks/auth-D4isgfuK.js +1 -0
- package/dist/chunks/autoMode-DVt4K4I2.js +45 -0
- package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
- package/dist/chunks/autonomy-BZzW8QJZ.js +1 -0
- package/dist/chunks/autonomy-Ffv0QIyl.js +19 -0
- package/dist/chunks/autonomyPanel-MwuzDvv_.js +1 -0
- package/dist/chunks/axios-DLnc2dVy.js +1 -0
- package/dist/chunks/axios-DhfaybwJ.js +12 -0
- package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +17 -0
- package/dist/chunks/backgroundHousekeeping-DUmxC6h0.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-DXefFdDE.js +3 -0
- package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
- package/dist/chunks/bridge-qr4GQW_c.js +2 -0
- package/dist/chunks/bridgeConfig-CJ-KznTS.js +1 -0
- package/dist/chunks/bridgeConfig-CNbOKpAg.js +1 -0
- package/dist/chunks/bridgeEnabled-5vsPrjuq.js +1 -0
- package/dist/chunks/bridgeEnabled-BUJTCUHY.js +1 -0
- package/dist/chunks/bridgeMain-BimZwc2P.js +68 -0
- package/dist/chunks/bridgeMain-DYL4fl6A.js +1 -0
- package/dist/chunks/bridgeMessaging-BiE0CTqq.js +1 -0
- package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
- package/dist/chunks/browser-fLRXxIsQ.js +1 -0
- package/dist/chunks/btw-FpimqEqk.js +1 -0
- package/dist/chunks/buddy-BA3Cr067.js +3 -0
- package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
- package/dist/chunks/bypassPermissionsKillswitch-CSC9p8mO.js +1 -0
- package/dist/chunks/caches-BUBkfP2Q.js +3 -0
- package/dist/chunks/caches-CTfNpKhW.js +1 -0
- package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
- package/dist/chunks/ccrClient-BOxUn9EJ.js +1 -0
- package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
- package/dist/chunks/changeDetector-Y9KV5LgG.js +1 -0
- package/dist/chunks/channelNotification-CC7Xb06W.js +1 -0
- package/dist/chunks/channelNotification-l3EXKDNB.js +1 -0
- package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
- package/dist/chunks/chokidar-SzksMqYp.js +1 -0
- package/dist/chunks/chrome-BnKyWWQL.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-OUVFUt8Z.js +1 -0
- package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
- package/dist/chunks/client-B47ZvTMo.js +1 -0
- package/dist/chunks/client-CPn1wQyc.js +7 -0
- package/dist/chunks/client-_sjL0I7A.js +35 -0
- package/dist/chunks/color-D5MCzz9h.js +1 -0
- package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
- package/dist/chunks/commands-FJGWgQsa.js +1 -0
- package/dist/chunks/commitAttribution-BFshsh2H.js +2 -0
- package/dist/chunks/commitAttribution-DSv9FggK.js +1 -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-DWNaf1wR.js +3 -0
- package/dist/chunks/companion-CyK_Dr1U.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-BdCuh6eA.js +1 -0
- package/dist/chunks/config-DNz6Eitr.js +1 -0
- package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
- package/dist/chunks/constants-41VpZw2G.js +1 -0
- package/dist/chunks/context-BOjdTj0i.js +1 -0
- package/dist/chunks/context-noninteractive-Bd2HO-vU.js +1 -0
- package/dist/chunks/context-noninteractive-k2ibficU.js +54 -0
- package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
- package/dist/chunks/conversation-BP0phkOY.js +1 -0
- package/dist/chunks/conversation-Ci8O_eZ-.js +1 -0
- package/dist/chunks/copy-B0VUJ2rH.js +7 -0
- package/dist/chunks/createSSHSession-DqmkCS_k.js +6 -0
- package/dist/chunks/createSession-B9MhWusY.js +1 -0
- package/dist/chunks/createSession-CJEsHz58.js +1 -0
- package/dist/chunks/cron-DiW7eIPP.js +1 -0
- package/dist/chunks/cronJitterConfig-BzPaa52I.js +6 -0
- package/dist/chunks/crossProjectResume-tWsqBUHc.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-Bd1s_VFj.js +1 -0
- package/dist/chunks/datadog-DJowkWhh.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-BDowrzvG.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-auU5sUOw.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-bKPp6AeL.js +1 -0
- package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
- package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
- package/dist/chunks/effort-BQj2QnnA.js +9 -0
- package/dist/chunks/entry-CUu6-QhT.js +14 -0
- package/dist/chunks/env-chR0gV31.js +1 -0
- package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +1 -0
- package/dist/chunks/envLessBridgeConfig-Ju4W58xf.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-DijkO8eo.js +1 -0
- package/dist/chunks/exit-_obETqBv.js +2 -0
- package/dist/chunks/export-DA-bBZkX.js +2 -0
- package/dist/chunks/exportRenderer-3y4tGdSB.js +1 -0
- package/dist/chunks/extra-usage-CS6VwKJt.js +1 -0
- package/dist/chunks/extra-usage-DGHEQOrY.js +1 -0
- package/dist/chunks/extra-usage-core-DOgT4u4i.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-DYnfiRlV.js +1 -0
- package/dist/chunks/extraUsage-CfxgfpX_.js +1 -0
- package/dist/chunks/extractMemories-jvjCvtpC.js +1 -0
- package/dist/chunks/fast-Bbtx_Bs1.js +1 -0
- package/dist/chunks/fast-CzRUJBTK.js +1 -0
- package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
- package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
- package/dist/chunks/feedback-FoXtdHAV.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-KIwaBY-E.js +1 -0
- package/dist/chunks/flushGate-C2Icy43G.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-CbQLZHtm.js +1 -0
- package/dist/chunks/gates-DSI3vpwO.js +1 -0
- package/dist/chunks/gemini-BrNJGX4k.js +1 -0
- package/dist/chunks/generateRecap-B0fvSCjo.js +1 -0
- package/dist/chunks/generateSessionName-DvRYa39O.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-Dut3d6nn.js +1 -0
- package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
- package/dist/chunks/grok-Ftoheab3.js +1 -0
- package/dist/chunks/growthbook-BynnuVTn.js +1 -0
- package/dist/chunks/hash-BRmOQc3c.js +1 -0
- package/dist/chunks/heapdump-hQ_w0LPC.js +5 -0
- package/dist/chunks/help-DQsHHv6r.js +1 -0
- package/dist/chunks/hooks-BLLL4iPv.js +1 -0
- package/dist/chunks/hooks-BhVDc8yb.js +79 -0
- package/dist/chunks/hostAdapter-D1eWmmhu.js +1 -0
- package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
- package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
- package/dist/chunks/ide-CPmMXLL-.js +2 -0
- package/dist/chunks/inboundAttachments-Bmf6vYsE.js +1 -0
- package/dist/chunks/inboundAttachments-D-p91z3w.js +1 -0
- package/dist/chunks/index.min-BJnb9GQI.js +1 -0
- package/dist/chunks/initReplBridge-BiHXpDEY.js +1 -0
- package/dist/chunks/insights-CTlTyvjj.js +822 -0
- package/dist/chunks/install-IPuD3Lq8.js +1 -0
- package/dist/chunks/install-github-app-Bmu_sA9e.js +147 -0
- package/dist/chunks/install-slack-app-Rfl81Jqo.js +1 -0
- package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
- package/dist/chunks/instrumentation-DWwmOmr0.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-BXEt0izn.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-DRDgVvqz.js +2 -0
- package/dist/chunks/lang-D3ZHlfT6.js +1 -0
- package/dist/chunks/language-B_-BfBT4.js +1 -0
- package/dist/chunks/language-DcSjogBx.js +1 -0
- package/dist/chunks/launchAgentsPlatform-BPm_VMln.js +1 -0
- package/dist/chunks/launchAutofixPr-D2qac07g.js +2 -0
- package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
- package/dist/chunks/launchLocalMemory-D_hBbXKE.js +3 -0
- package/dist/chunks/launchLocalVault-CPzNWvQ9.js +3 -0
- package/dist/chunks/launchMemoryStores-Djq2KhKb.js +1 -0
- package/dist/chunks/launchOnboarding-Bh6E7vdc.js +8 -0
- package/dist/chunks/launchSchedule-C988bQ-5.js +1 -0
- package/dist/chunks/launchSkillStore-DqrP6Gme.js +1 -0
- package/dist/chunks/launchTeleport-DFhybaq_.js +3 -0
- package/dist/chunks/launchVault-p_CSK4ZQ.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-Ci5mr0vm.js +4601 -0
- package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +1 -0
- package/dist/chunks/loadPluginHooks-xYCEZ6t5.js +1 -0
- package/dist/chunks/loadSso-sDs471GC.js +1 -0
- package/dist/chunks/localSearch-DtVqtfvk.js +1 -0
- package/dist/chunks/localSearch-Vpn6W5aY.js +1 -0
- package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
- package/dist/chunks/log-CzsijfHZ.js +1 -0
- package/dist/chunks/login-D-N78G6r.js +1 -0
- package/dist/chunks/login-D9IWjvza.js +1 -0
- package/dist/chunks/logoV2Utils-SAulcC5x.js +1 -0
- package/dist/chunks/logout-CFggVS-9.js +1 -0
- package/dist/chunks/magicDocs-BfoeYhin.js +57 -0
- package/dist/chunks/main-C6be1KFk.js +31 -0
- package/dist/chunks/main-DhMlhVj3.js +1108 -0
- package/dist/chunks/mappers-uIrAj-Wd.js +1 -0
- package/dist/chunks/mcp-CAYGNxCb.js +1 -0
- package/dist/chunks/mcp-COQap0SM.js +6 -0
- package/dist/chunks/mcp-DlM0OC6R.js +2 -0
- package/dist/chunks/mcpServer-1SnOWb8_.js +1 -0
- package/dist/chunks/mcpServer-DXvS3v4x.js +1 -0
- package/dist/chunks/memoize-DNnuA2aU.js +1 -0
- package/dist/chunks/memoize-DxwLawI2.js +1 -0
- package/dist/chunks/memory-XccPLQLt.js +1 -0
- package/dist/chunks/mobile-umu5P0cM.js +2 -0
- package/dist/chunks/modalContext-CmSKRyea.js +1 -0
- package/dist/chunks/model-CbiDGGJU.js +1 -0
- package/dist/chunks/model-DdbcxKub.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-Dp0JIXd8.js +1 -0
- package/dist/chunks/open-CDditBQ-.js +1 -0
- package/dist/chunks/openai-6KcHd4Hw.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-DYiB4sr-.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-Cbc6T_Tj.js +1 -0
- package/dist/chunks/path-C4kbwvSH.js +1 -0
- package/dist/chunks/paths-Q2255dD7.js +39 -0
- package/dist/chunks/permissions-BLzPHh_3.js +3 -0
- package/dist/chunks/permissions-DXLfdE7b.js +1 -0
- package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
- package/dist/chunks/pipeTransport-D7NIp3aA.js +1 -0
- package/dist/chunks/plan-DloFVJK7.js +1 -0
- package/dist/chunks/platform-CuyedWpe.js +2 -0
- package/dist/chunks/plist-BO4ZqMZc.js +6 -0
- package/dist/chunks/plugin-XR9IBPMM.js +1 -0
- package/dist/chunks/pluginAutoupdate-Cr9hP0zG.js +1 -0
- package/dist/chunks/pluginBlocklist-CM9uP8CY.js +1 -0
- package/dist/chunks/pluginCliCommands-BQkrvES5.js +1 -0
- package/dist/chunks/pluginFlagging-CJ1--2Kw.js +1 -0
- package/dist/chunks/pluginOperations-B0rLuSvo.js +2 -0
- package/dist/chunks/pluginStartupCheck-Bjdc8zhz.js +1 -0
- package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +1 -0
- package/dist/chunks/plugins-BgOP_8TX.js +4 -0
- package/dist/chunks/policyLimits-CKy_gTEt.js +1 -0
- package/dist/chunks/pollConfig-DhptuhFw.js +1 -0
- package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
- package/dist/chunks/poor-DF0aqXDx.js +1 -0
- package/dist/chunks/poorMode-C5Frra4j.js +1 -0
- package/dist/chunks/poorMode-DJvjO2nW.js +1 -0
- package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
- package/dist/chunks/print-CPtR0KTa.js +39 -0
- package/dist/chunks/privacy-settings-e-7lc7Un.js +1 -0
- package/dist/chunks/process-CWupreF6.js +1 -0
- package/dist/chunks/process-DMKLUQIO.js +1 -0
- package/dist/chunks/processBashCommand-D5dC6Mya.js +1 -0
- package/dist/chunks/processSlashCommand-DHRUtZ-C.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-CQC-mh6u.js +1 -0
- package/dist/chunks/prompt-DEPUnJdB.js +222 -0
- package/dist/chunks/prompt-DawxLANl.js +1 -0
- package/dist/chunks/promptEditor-Ci-h04-5.js +4 -0
- package/dist/chunks/protocolHandler-DhqM32qE.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-B0l29Zx8.js +1 -0
- package/dist/chunks/rcDebugLog-BbPkkigY.js +11 -0
- package/dist/chunks/referral-ByevBJrE.js +1 -0
- package/dist/chunks/refresh-B_CwwIRX.js +1 -0
- package/dist/chunks/registerProtocol-DzhaQH02.js +36 -0
- package/dist/chunks/registry-DkHA4cRu.js +1 -0
- package/dist/chunks/release-notes-CZthYkei.js +4 -0
- package/dist/chunks/releaseNotes-CwKpIsyd.js +2 -0
- package/dist/chunks/reload-plugins-DxWfXvrN.js +1 -0
- package/dist/chunks/remote-env-BiRLWIrh.js +1 -0
- package/dist/chunks/remoteBridgeCore-nz1fPY1U.js +1 -0
- package/dist/chunks/remoteControlServer-FzLUxh2B.js +3 -0
- package/dist/chunks/rename-DmGuyncE.js +1 -0
- package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
- package/dist/chunks/resume-7GeU7RMS.js +2 -0
- package/dist/chunks/rewind-CXplHgh_.js +1 -0
- package/dist/chunks/rollback-DbSpxmJE.js +11 -0
- package/dist/chunks/runtimeObserver-Duod-ign.js +10 -0
- package/dist/chunks/runtimeObserver-OgM9ZYxZ.js +1 -0
- package/dist/chunks/sandbox-adapter-CxkhKgaa.js +1 -0
- package/dist/chunks/sandbox-toggle-Cc96R6Ox.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-DQ6e601b.js +1 -0
- package/dist/chunks/semver-Cq33BYay.js +1 -0
- package/dist/chunks/semver-Tw0AFar5.js +1 -0
- package/dist/chunks/sentry-BUHYuYGj.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-DgLqm7ZI.js +2 -0
- package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
- package/dist/chunks/sessionDiscovery-DgNea6qa.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +1 -0
- package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
- package/dist/chunks/sessionMemory-DIrR3zvb.js +1 -0
- package/dist/chunks/sessionMemory-_dmj8lcH.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +1 -0
- package/dist/chunks/sessionObserver-CuWMVPlT.js +20 -0
- package/dist/chunks/sessionObserver-_adufOGQ.js +1 -0
- package/dist/chunks/sessionStorage-W7okgAlQ.js +1 -0
- package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
- package/dist/chunks/sessionTitle-DzkMzHer.js +14 -0
- package/dist/chunks/sessionTracing-DTjmc0EF.js +11 -0
- package/dist/chunks/settingsSync-CfYDkakY.js +1 -0
- package/dist/chunks/setup-BKUG46jQ.js +9 -0
- package/dist/chunks/setup-CmLngvpJ.js +1 -0
- package/dist/chunks/setup-TqJ7-Nxh.js +2 -0
- package/dist/chunks/shadowedRuleDetection-DesT0yKM.js +1 -0
- package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
- package/dist/chunks/sideQuestion-BAq0YyKY.js +20 -0
- package/dist/chunks/signin-QEeYpJZw.js +1 -0
- package/dist/chunks/sink-B3uP8Cf8.js +1 -0
- package/dist/chunks/sink-CaWMZBw_.js +1 -0
- package/dist/chunks/sinks-COcy5GnB.js +2 -0
- package/dist/chunks/sinks-oFfsKySL.js +1 -0
- package/dist/chunks/skill-learning-DOIMPtWE.js +5 -0
- package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +1 -0
- package/dist/chunks/skillGapStore-CWuw1dYh.js +1 -0
- package/dist/chunks/skillGapStore-DpEoKhn-.js +5 -0
- package/dist/chunks/skillGenerator-9y3Q4YoO.js +8 -0
- package/dist/chunks/skillLearning-BhM09bQD.js +1 -0
- package/dist/chunks/skillLearning-_o2D06yM.js +1 -0
- package/dist/chunks/skillPanel-Dt24mZTZ.js +28 -0
- package/dist/chunks/skillSearchPanel-gaXN64Fu.js +21 -0
- package/dist/chunks/skills-Dx3dMHYk.js +1 -0
- package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
- package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
- package/dist/chunks/sprites-5OAB-Ui2.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-TUExo9iU.js +1 -0
- package/dist/chunks/status-Dghaz1my.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DVZSSXeK.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-ZcVkzFjz.js +11 -0
- package/dist/chunks/tasks-DbB33ekt.js +1 -0
- package/dist/chunks/teamHelpers-BmN9nKz-.js +1 -0
- package/dist/chunks/teamHelpers-yeTNtZbb.js +1 -0
- package/dist/chunks/teammate-DMYOtLTK.js +1 -0
- package/dist/chunks/teammateModeSnapshot-CPjJJDL1.js +1 -0
- package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +1 -0
- package/dist/chunks/teleport-JHgpwZIh.js +1 -0
- package/dist/chunks/templateJobs-Db630FZD.js +12 -0
- package/dist/chunks/terminalSetup-DJqWE8fc.js +33 -0
- package/dist/chunks/terminalSetup-ygKHrVKR.js +1 -0
- package/dist/chunks/theme-MmfFhdTD.js +1 -0
- package/dist/chunks/thinkback-CrNirB0V.js +1 -0
- package/dist/chunks/thinkback-Quc7KPmi.js +1 -0
- package/dist/chunks/thinkback-play-CQ1s7oqg.js +1 -0
- package/dist/chunks/tmux-CvbhsfwG.js +1 -0
- package/dist/chunks/toolEventObserver-BqMplcIk.js +1 -0
- package/dist/chunks/toolEventObserver-DBq2XBYY.js +1 -0
- package/dist/chunks/toolPool-BkCtTKXz.js +1 -0
- package/dist/chunks/toolPool-C7bOwJfR.js +1 -0
- package/dist/chunks/trustedDevice-C9Zevohz.js +1 -0
- package/dist/chunks/trustedDevice-DEuQUTbz.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-DrlfRrXq.js +3 -0
- package/dist/chunks/undercover-CBeHiWUd.js +1 -0
- package/dist/chunks/undercover-DKn95mh9.js +31 -0
- package/dist/chunks/up-D-U4wUCe.js +12 -0
- package/dist/chunks/updateCCB-CJ7dCUan.js +11 -0
- package/dist/chunks/upgrade-Degqbu8S.js +1 -0
- package/dist/chunks/upgrade-ucJ-lnlY.js +1 -0
- package/dist/chunks/upload-pTZQCPLt.js +1 -0
- package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
- package/dist/chunks/usage-D96a7Cke.js +1 -0
- package/dist/chunks/usage-DVQMUMcC.js +1 -0
- package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
- package/dist/chunks/useMainLoopModel-B7ch2o9K.js +1 -0
- package/dist/chunks/useManagePlugins-BfGzHMvO.js +1 -0
- package/dist/chunks/useMergedTools-TemEvCrX.js +1 -0
- package/dist/chunks/useSearchInput-B-V4kIa-.js +1 -0
- package/dist/chunks/useSettingsErrors-B2JGz1s8.js +1 -0
- package/dist/chunks/useVoice-BuwYDm2U.js +1 -0
- package/dist/chunks/util-CeIKZmj9.js +1 -0
- package/dist/chunks/utils-CwhszpkT.js +1 -0
- package/dist/chunks/v4-f1i_CNUT.js +1 -0
- package/dist/chunks/validatePlugin-BlVho93x.js +1 -0
- package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
- package/dist/chunks/vim-DUZQCWUP.js +1 -0
- package/dist/chunks/voice-BkRIHZiM.js +2 -0
- package/dist/chunks/voice-DXiiy8HX.js +8 -0
- package/dist/chunks/voiceModeEnabled-CPQUE3PU.js +1 -0
- package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +1 -0
- package/dist/chunks/voiceStreamSTT-DgoDscHn.js +1 -0
- package/dist/chunks/voiceStreamSTT-Dr_wH1Kh.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-CT7_kjvY.js +1 -0
- package/dist/chunks/worktree-DU3xtwKW.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-DD_ldd3X.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,29 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./chunk-DR8-3Aex.js";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./zod-DT6hytkp.js";import{t as _}from"./graceful-fs-Cgc0rjGF.js";import{t as v}from"./src-BaB-bpCj.js";import"os";import"path";import"fs";import"crypto";import"fs/promises";import{promisify as y}from"util";import{execFile as b}from"child_process";var x=t((()=>{f()})),S=r((e=>{e.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]==`function`)e.apply(this,t);else return new Promise((n,r)=>{t.push((e,t)=>e==null?n(t):r(e)),e.apply(this,t)})},`name`,{value:e.name})},e.fromPromise=function(e){return Object.defineProperty(function(...t){let n=t[t.length-1];if(typeof n!=`function`)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>n(null,e),n)},`name`,{value:e.name})}})),C=r((e=>{var t=S().fromCallback,n=_(),r=`access.appendFile.chmod.chown.close.copyFile.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.lchmod.lchown.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.symlink.truncate.unlink.utimes.writeFile`.split(`.`).filter(e=>typeof n[e]==`function`);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},typeof n.writev==`function`&&(e.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})}),typeof n.realpath.native==`function`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),w=r(((t,n)=>{var r=e(`path`);n.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(r.parse(e).root,``))){let t=Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),T=r(((e,t)=>{var n=C(),{checkPath:r}=w(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),E=r(((e,t)=>{var n=S().fromPromise,{makeDir:r,makeDirSync:i}=T(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),D=r(((e,t)=>{var n=S().fromPromise,r=C();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),O=r(((e,t)=>{var n=_();function r(e,t,r,i){n.open(e,`r+`,(e,a)=>{if(e)return i(e);n.futimes(a,t,r,e=>{n.close(a,t=>{i&&i(e||t)})})})}function i(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r,utimesMillisSync:i}})),k=r(((t,n)=>{var r=C(),i=e(`path`),a=e(`util`);function o(e,t,n){let i=n.dereference?e=>r.stat(e,{bigint:!0}):e=>r.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function s(e,t,n){let i,a=n.dereference?e=>r.statSync(e,{bigint:!0}):e=>r.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}function c(e,t,n,r,s){a.callbackify(o)(e,t,r,(r,a)=>{if(r)return s(r);let{srcStat:o,destStat:c}=a;if(c){if(f(o,c)){let r=i.basename(e),a=i.basename(t);return n===`move`&&r!==a&&r.toLowerCase()===a.toLowerCase()?s(null,{srcStat:o,destStat:c,isChangingCase:!0}):s(Error(`Source and destination must not be the same.`))}if(o.isDirectory()&&!c.isDirectory())return s(Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!o.isDirectory()&&c.isDirectory())return s(Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return o.isDirectory()&&p(e,t)?s(Error(m(e,t,n))):s(null,{srcStat:o,destStat:c})})}function l(e,t,n,r){let{srcStat:a,destStat:o}=s(e,t,r);if(o){if(f(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:o}}function u(e,t,n,a,o){let s=i.resolve(i.dirname(e)),c=i.resolve(i.dirname(n));if(c===s||c===i.parse(c).root)return o();r.stat(c,{bigint:!0},(r,i)=>r?r.code===`ENOENT`?o():o(r):f(t,i)?o(Error(m(e,n,a))):u(e,t,c,a,o))}function d(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=r.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return d(e,t,s,a)}function f(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function p(e,t){let n=i.resolve(e).split(i.sep).filter(e=>e),r=i.resolve(t).split(i.sep).filter(e=>e);return n.reduce((e,t,n)=>e&&r[n]===t,!0)}function m(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}n.exports={checkPaths:c,checkPathsSync:l,checkParentPaths:u,checkParentPathsSync:d,isSrcSubdir:p,areIdentical:f}})),A=r(((t,n)=>{var r=_(),i=e(`path`),a=E().mkdirs,o=D().pathExists,s=O().utimesMillis,c=k();function l(e,t,n,r){typeof n==`function`&&!r?(r=n,n={}):typeof n==`function`&&(n={filter:n}),r=r||function(){},n=n||{},n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
2
|
+
|
|
3
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0001`),c.checkPaths(e,t,`copy`,n,(i,a)=>{if(i)return r(i);let{srcStat:o,destStat:s}=a;c.checkParentPaths(e,o,t,`copy`,i=>i?r(i):n.filter?d(u,s,e,t,n,r):u(s,e,t,n,r))})}function u(e,t,n,r,s){let c=i.dirname(n);o(c,(i,o)=>{if(i)return s(i);if(o)return p(e,t,n,r,s);a(c,i=>i?s(i):p(e,t,n,r,s))})}function d(e,t,n,r,i,a){Promise.resolve(i.filter(n,r)).then(o=>o?e(t,n,r,i,a):a(),e=>a(e))}function f(e,t,n,r,i){return r.filter?d(p,e,t,n,r,i):p(e,t,n,r,i)}function p(e,t,n,i,a){(i.dereference?r.stat:r.lstat)(t,(r,o)=>r?a(r):o.isDirectory()?w(o,e,t,n,i,a):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?m(o,e,t,n,i,a):o.isSymbolicLink()?N(e,t,n,i,a):o.isSocket()?a(Error(`Cannot copy a socket file: ${t}`)):o.isFIFO()?a(Error(`Cannot copy a FIFO pipe: ${t}`)):a(Error(`Unknown file: ${t}`)))}function m(e,t,n,r,i,a){return t?h(e,n,r,i,a):g(e,n,r,i,a)}function h(e,t,n,i,a){if(i.overwrite)r.unlink(n,r=>r?a(r):g(e,t,n,i,a));else if(i.errorOnExist)return a(Error(`'${n}' already exists`));else return a()}function g(e,t,n,i,a){r.copyFile(t,n,r=>r?a(r):i.preserveTimestamps?v(e.mode,t,n,a):S(n,e.mode,a))}function v(e,t,n,r){return y(e)?b(n,e,i=>i?r(i):x(e,t,n,r)):x(e,t,n,r)}function y(e){return(e&128)==0}function b(e,t,n){return S(e,t|128,n)}function x(e,t,n,r){C(t,n,t=>t?r(t):S(n,e,r))}function S(e,t,n){return r.chmod(e,t,n)}function C(e,t,n){r.stat(e,(e,r)=>e?n(e):s(t,r.atime,r.mtime,n))}function w(e,t,n,r,i,a){return t?A(n,r,i,a):T(e.mode,n,r,i,a)}function T(e,t,n,i,a){r.mkdir(n,r=>{if(r)return a(r);A(t,n,i,t=>t?a(t):S(n,e,a))})}function A(e,t,n,i){r.readdir(e,(r,a)=>r?i(r):j(a,e,t,n,i))}function j(e,t,n,r,i){let a=e.pop();return a?M(e,a,t,n,r,i):i()}function M(e,t,n,r,a,o){let s=i.join(n,t),l=i.join(r,t);c.checkPaths(s,l,`copy`,a,(t,i)=>{if(t)return o(t);let{destStat:c}=i;f(c,s,l,a,t=>t?o(t):j(e,n,r,a,o))})}function N(e,t,n,a,o){r.readlink(t,(t,s)=>{if(t)return o(t);if(a.dereference&&(s=i.resolve(process.cwd(),s)),e)r.readlink(n,(t,l)=>t?t.code===`EINVAL`||t.code===`UNKNOWN`?r.symlink(s,n,o):o(t):(a.dereference&&(l=i.resolve(process.cwd(),l)),c.isSrcSubdir(s,l)?o(Error(`Cannot copy '${s}' to a subdirectory of itself, '${l}'.`)):e.isDirectory()&&c.isSrcSubdir(l,s)?o(Error(`Cannot overwrite '${l}' with '${s}'.`)):P(s,n,o)));else return r.symlink(s,n,o)})}function P(e,t,n){r.unlink(t,i=>i?n(i):r.symlink(e,t,n))}n.exports=l})),j=r(((t,n)=>{var r=_(),i=e(`path`),a=E().mkdirsSync,o=O().utimesMillisSync,s=k();function c(e,t,n){typeof n==`function`&&(n={filter:n}),n=n||{},n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
4
|
+
|
|
5
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0002`);let{srcStat:r,destStat:i}=s.checkPathsSync(e,t,`copy`,n);return s.checkParentPathsSync(e,r,t,`copy`),l(i,e,t,n)}function l(e,t,n,o){if(o.filter&&!o.filter(t,n))return;let s=i.dirname(n);return r.existsSync(s)||a(s),d(e,t,n,o)}function u(e,t,n,r){if(!(r.filter&&!r.filter(t,n)))return d(e,t,n,r)}function d(e,t,n,i){let a=(i.dereference?r.statSync:r.lstatSync)(t);if(a.isDirectory())return x(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return f(a,e,t,n,i);if(a.isSymbolicLink())return T(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}function f(e,t,n,r,i){return t?p(e,n,r,i):m(e,n,r,i)}function p(e,t,n,i){if(i.overwrite)return r.unlinkSync(n),m(e,t,n,i);if(i.errorOnExist)throw Error(`'${n}' already exists`)}function m(e,t,n,i){return r.copyFileSync(t,n),i.preserveTimestamps&&h(e.mode,t,n),y(n,e.mode)}function h(e,t,n){return g(e)&&v(n,e),b(t,n)}function g(e){return(e&128)==0}function v(e,t){return y(e,t|128)}function y(e,t){return r.chmodSync(e,t)}function b(e,t){let n=r.statSync(e);return o(t,n.atime,n.mtime)}function x(e,t,n,r,i){return t?C(n,r,i):S(e.mode,n,r,i)}function S(e,t,n,i){return r.mkdirSync(n),C(t,n,i),y(n,e)}function C(e,t,n){r.readdirSync(e).forEach(r=>w(r,e,t,n))}function w(e,t,n,r){let a=i.join(t,e),o=i.join(n,e),{destStat:c}=s.checkPathsSync(a,o,`copy`,r);return u(c,a,o,r)}function T(e,t,n,a){let o=r.readlinkSync(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),e){let e;try{e=r.readlinkSync(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlinkSync(o,n);throw e}if(a.dereference&&(e=i.resolve(process.cwd(),e)),s.isSrcSubdir(o,e))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`);if(r.statSync(n).isDirectory()&&s.isSrcSubdir(e,o))throw Error(`Cannot overwrite '${e}' with '${o}'.`);return D(o,n)}else return r.symlinkSync(o,n)}function D(e,t){return r.unlinkSync(t),r.symlinkSync(e,t)}n.exports=c})),M=r(((e,t)=>{var n=S().fromCallback;t.exports={copy:n(A()),copySync:j()}})),N=r(((t,n)=>{var r=_(),i=e(`path`),a=e(`assert`),o=process.platform===`win32`;function s(e){[`unlink`,`chmod`,`stat`,`lstat`,`rmdir`,`readdir`].forEach(t=>{e[t]=e[t]||r[t],t+=`Sync`,e[t]=e[t]||r[t]}),e.maxBusyTries=e.maxBusyTries||3}function c(e,t,n){let r=0;typeof t==`function`&&(n=t,t={}),a(e,`rimraf: missing path`),a.strictEqual(typeof e,`string`,`rimraf: path should be a string`),a.strictEqual(typeof n,`function`,`rimraf: callback function required`),a(t,`rimraf: invalid options argument provided`),a.strictEqual(typeof t,`object`,`rimraf: options should be object`),s(t),l(e,t,function i(a){if(a){if((a.code===`EBUSY`||a.code===`ENOTEMPTY`||a.code===`EPERM`)&&r<t.maxBusyTries){r++;let n=r*100;return setTimeout(()=>l(e,t,i),n)}a.code===`ENOENT`&&(a=null)}n(a)})}function l(e,t,n){a(e),a(t),a(typeof n==`function`),t.lstat(e,(r,i)=>{if(r&&r.code===`ENOENT`)return n(null);if(r&&r.code===`EPERM`&&o)return u(e,t,r,n);if(i&&i.isDirectory())return f(e,t,r,n);t.unlink(e,r=>{if(r){if(r.code===`ENOENT`)return n(null);if(r.code===`EPERM`)return o?u(e,t,r,n):f(e,t,r,n);if(r.code===`EISDIR`)return f(e,t,r,n)}return n(r)})})}function u(e,t,n,r){a(e),a(t),a(typeof r==`function`),t.chmod(e,438,i=>{i?r(i.code===`ENOENT`?null:n):t.stat(e,(i,a)=>{i?r(i.code===`ENOENT`?null:n):a.isDirectory()?f(e,t,n,r):t.unlink(e,r)})})}function d(e,t,n){let r;a(e),a(t);try{t.chmodSync(e,438)}catch(e){if(e.code===`ENOENT`)return;throw n}try{r=t.statSync(e)}catch(e){if(e.code===`ENOENT`)return;throw n}r.isDirectory()?h(e,t,n):t.unlinkSync(e)}function f(e,t,n,r){a(e),a(t),a(typeof r==`function`),t.rmdir(e,i=>{i&&(i.code===`ENOTEMPTY`||i.code===`EEXIST`||i.code===`EPERM`)?p(e,t,r):i&&i.code===`ENOTDIR`?r(n):r(i)})}function p(e,t,n){a(e),a(t),a(typeof n==`function`),t.readdir(e,(r,a)=>{if(r)return n(r);let o=a.length,s;if(o===0)return t.rmdir(e,n);a.forEach(r=>{c(i.join(e,r),t,r=>{if(!s){if(r)return n(s=r);--o===0&&t.rmdir(e,n)}})})})}function m(e,t){let n;t=t||{},s(t),a(e,`rimraf: missing path`),a.strictEqual(typeof e,`string`,`rimraf: path should be a string`),a(t,`rimraf: missing options`),a.strictEqual(typeof t,`object`,`rimraf: options should be object`);try{n=t.lstatSync(e)}catch(n){if(n.code===`ENOENT`)return;n.code===`EPERM`&&o&&d(e,t,n)}try{n&&n.isDirectory()?h(e,t,null):t.unlinkSync(e)}catch(n){if(n.code===`ENOENT`)return;if(n.code===`EPERM`)return o?d(e,t,n):h(e,t,n);if(n.code!==`EISDIR`)throw n;h(e,t,n)}}function h(e,t,n){a(e),a(t);try{t.rmdirSync(e)}catch(r){if(r.code===`ENOTDIR`)throw n;if(r.code===`ENOTEMPTY`||r.code===`EEXIST`||r.code===`EPERM`)g(e,t);else if(r.code!==`ENOENT`)throw r}}function g(e,t){if(a(e),a(t),t.readdirSync(e).forEach(n=>m(i.join(e,n),t)),o){let n=Date.now();do try{return t.rmdirSync(e,t)}catch{}while(Date.now()-n<500)}else return t.rmdirSync(e,t)}n.exports=c,c.sync=m})),P=r(((e,t)=>{var n=_(),r=S().fromCallback,i=N();function a(e,t){if(n.rm)return n.rm(e,{recursive:!0,force:!0},t);i(e,t)}function o(e){if(n.rmSync)return n.rmSync(e,{recursive:!0,force:!0});i.sync(e)}t.exports={remove:r(a),removeSync:o}})),ee=r(((t,n)=>{var r=S().fromPromise,i=C(),a=e(`path`),o=E(),s=P(),c=r(async function(e){let t;try{t=await i.readdir(e)}catch{return o.mkdirs(e)}return Promise.all(t.map(t=>s.remove(a.join(e,t))))});function l(e){let t;try{t=i.readdirSync(e)}catch{return o.mkdirsSync(e)}t.forEach(t=>{t=a.join(e,t),s.removeSync(t)})}n.exports={emptyDirSync:l,emptydirSync:l,emptyDir:c,emptydir:c}})),F=r(((t,n)=>{var r=S().fromCallback,i=e(`path`),a=_(),o=E();function s(e,t){function n(){a.writeFile(e,``,e=>{if(e)return t(e);t()})}a.stat(e,(r,s)=>{if(!r&&s.isFile())return t();let c=i.dirname(e);a.stat(c,(e,r)=>{if(e)return e.code===`ENOENT`?o.mkdirs(c,e=>{if(e)return t(e);n()}):t(e);r.isDirectory()?n():a.readdir(c,e=>{if(e)return t(e)})})})}function c(e){let t;try{t=a.statSync(e)}catch{}if(t&&t.isFile())return;let n=i.dirname(e);try{a.statSync(n).isDirectory()||a.readdirSync(n)}catch(e){if(e&&e.code===`ENOENT`)o.mkdirsSync(n);else throw e}a.writeFileSync(e,``)}n.exports={createFile:r(s),createFileSync:c}})),I=r(((t,n)=>{var r=S().fromCallback,i=e(`path`),a=_(),o=E(),s=D().pathExists,{areIdentical:c}=k();function l(e,t,n){function r(e,t){a.link(e,t,e=>{if(e)return n(e);n(null)})}a.lstat(t,(l,u)=>{a.lstat(e,(a,l)=>{if(a)return a.message=a.message.replace(`lstat`,`ensureLink`),n(a);if(u&&c(l,u))return n(null);let d=i.dirname(t);s(d,(i,a)=>{if(i)return n(i);if(a)return r(e,t);o.mkdirs(d,i=>{if(i)return n(i);r(e,t)})})})})}function u(e,t){let n;try{n=a.lstatSync(t)}catch{}try{let t=a.lstatSync(e);if(n&&c(t,n))return}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}let r=i.dirname(t);return a.existsSync(r)||o.mkdirsSync(r),a.linkSync(e,t)}n.exports={createLink:r(l),createLinkSync:u}})),L=r(((t,n)=>{var r=e(`path`),i=_(),a=D().pathExists;function o(e,t,n){if(r.isAbsolute(e))return i.lstat(e,t=>t?(t.message=t.message.replace(`lstat`,`ensureSymlink`),n(t)):n(null,{toCwd:e,toDst:e}));{let o=r.dirname(t),s=r.join(o,e);return a(s,(t,a)=>t?n(t):a?n(null,{toCwd:s,toDst:e}):i.lstat(e,t=>t?(t.message=t.message.replace(`lstat`,`ensureSymlink`),n(t)):n(null,{toCwd:e,toDst:r.relative(o,e)})))}}function s(e,t){let n;if(r.isAbsolute(e)){if(n=i.existsSync(e),!n)throw Error(`absolute srcpath does not exist`);return{toCwd:e,toDst:e}}else{let a=r.dirname(t),o=r.join(a,e);if(n=i.existsSync(o),n)return{toCwd:o,toDst:e};if(n=i.existsSync(e),!n)throw Error(`relative srcpath does not exist`);return{toCwd:e,toDst:r.relative(a,e)}}}n.exports={symlinkPaths:o,symlinkPathsSync:s}})),R=r(((e,t)=>{var n=_();function r(e,t,r){if(r=typeof t==`function`?t:r,t=typeof t==`function`?!1:t,t)return r(null,t);n.lstat(e,(e,n)=>{if(e)return r(null,`file`);t=n&&n.isDirectory()?`dir`:`file`,r(null,t)})}function i(e,t){let r;if(t)return t;try{r=n.lstatSync(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}t.exports={symlinkType:r,symlinkTypeSync:i}})),z=r(((t,n)=>{var r=S().fromCallback,i=e(`path`),a=C(),o=E(),s=o.mkdirs,c=o.mkdirsSync,l=L(),u=l.symlinkPaths,d=l.symlinkPathsSync,f=R(),p=f.symlinkType,m=f.symlinkTypeSync,h=D().pathExists,{areIdentical:g}=k();function _(e,t,n,r){r=typeof n==`function`?n:r,n=typeof n==`function`?!1:n,a.lstat(t,(i,o)=>{!i&&o.isSymbolicLink()?Promise.all([a.stat(e),a.stat(t)]).then(([i,a])=>{if(g(i,a))return r(null);v(e,t,n,r)}):v(e,t,n,r)})}function v(e,t,n,r){u(e,t,(o,c)=>{if(o)return r(o);e=c.toDst,p(c.toCwd,n,(n,o)=>{if(n)return r(n);let c=i.dirname(t);h(c,(n,i)=>{if(n)return r(n);if(i)return a.symlink(e,t,o,r);s(c,n=>{if(n)return r(n);a.symlink(e,t,o,r)})})})})}function y(e,t,n){let r;try{r=a.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()&&g(a.statSync(e),a.statSync(t)))return;let o=d(e,t);e=o.toDst,n=m(o.toCwd,n);let s=i.dirname(t);return a.existsSync(s)||c(s),a.symlinkSync(e,t,n)}n.exports={createSymlink:r(_),createSymlinkSync:y}})),B=r(((e,t)=>{var{createFile:n,createFileSync:r}=F(),{createLink:i,createLinkSync:a}=I(),{createSymlink:o,createSymlinkSync:s}=z();t.exports={createFile:n,createFileSync:r,ensureFile:n,ensureFileSync:r,createLink:i,createLinkSync:a,ensureLink:i,ensureLinkSync:a,createSymlink:o,createSymlinkSync:s,ensureSymlink:o,ensureSymlinkSync:s}})),V=r(((e,t)=>{function n(e,{EOL:t=`
|
|
6
|
+
`,finalEOL:n=!0,replacer:r=null,spaces:i}={}){let a=n?t:``;return JSON.stringify(e,r,i).replace(/\n/g,t)+a}function r(e){return Buffer.isBuffer(e)&&(e=e.toString(`utf8`)),e.replace(/^\uFEFF/,``)}t.exports={stringify:n,stripBom:r}})),H=r(((t,n)=>{var r;try{r=_()}catch{r=e(`fs`)}var i=S(),{stringify:a,stripBom:o}=V();async function s(e,t={}){typeof t==`string`&&(t={encoding:t});let n=t.fs||r,a=`throws`in t?t.throws:!0,s=await i.fromCallback(n.readFile)(e,t);s=o(s);let c;try{c=JSON.parse(s,t?t.reviver:null)}catch(t){if(a)throw t.message=`${e}: ${t.message}`,t;return null}return c}var c=i.fromPromise(s);function l(e,t={}){typeof t==`string`&&(t={encoding:t});let n=t.fs||r,i=`throws`in t?t.throws:!0;try{let r=n.readFileSync(e,t);return r=o(r),JSON.parse(r,t.reviver)}catch(t){if(i)throw t.message=`${e}: ${t.message}`,t;return null}}async function u(e,t,n={}){let o=n.fs||r,s=a(t,n);await i.fromCallback(o.writeFile)(e,s,n)}var d=i.fromPromise(u);function f(e,t,n={}){let i=n.fs||r,o=a(t,n);return i.writeFileSync(e,o,n)}n.exports={readFile:c,readFileSync:l,writeFile:d,writeFileSync:f}})),U=r(((e,t)=>{var n=H();t.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}})),W=r(((t,n)=>{var r=S().fromCallback,i=_(),a=e(`path`),o=E(),s=D().pathExists;function c(e,t,n,r){typeof n==`function`&&(r=n,n=`utf8`);let c=a.dirname(e);s(c,(a,s)=>{if(a)return r(a);if(s)return i.writeFile(e,t,n,r);o.mkdirs(c,a=>{if(a)return r(a);i.writeFile(e,t,n,r)})})}function l(e,...t){let n=a.dirname(e);if(i.existsSync(n))return i.writeFileSync(e,...t);o.mkdirsSync(n),i.writeFileSync(e,...t)}n.exports={outputFile:r(c),outputFileSync:l}})),G=r(((e,t)=>{var{stringify:n}=V(),{outputFile:r}=W();async function i(e,t,i={}){await r(e,n(t,i),i)}t.exports=i})),K=r(((e,t)=>{var{stringify:n}=V(),{outputFileSync:r}=W();function i(e,t,i){r(e,n(t,i),i)}t.exports=i})),q=r(((e,t)=>{var n=S().fromPromise,r=U();r.outputJson=n(G()),r.outputJsonSync=K(),r.outputJSON=r.outputJson,r.outputJSONSync=r.outputJsonSync,r.writeJSON=r.writeJson,r.writeJSONSync=r.writeJsonSync,r.readJSON=r.readJson,r.readJSONSync=r.readJsonSync,t.exports=r})),J=r(((t,n)=>{var r=_(),i=e(`path`),a=M().copy,o=P().remove,s=E().mkdirp,c=D().pathExists,l=k();function u(e,t,n,r){typeof n==`function`&&(r=n,n={}),n=n||{};let a=n.overwrite||n.clobber||!1;l.checkPaths(e,t,`move`,n,(n,o)=>{if(n)return r(n);let{srcStat:c,isChangingCase:u=!1}=o;l.checkParentPaths(e,c,t,`move`,n=>{if(n)return r(n);if(d(t))return f(e,t,a,u,r);s(i.dirname(t),n=>n?r(n):f(e,t,a,u,r))})})}function d(e){let t=i.dirname(e);return i.parse(t).root===t}function f(e,t,n,r,i){if(r)return p(e,t,n,i);if(n)return o(t,r=>r?i(r):p(e,t,n,i));c(t,(r,a)=>r?i(r):a?i(Error(`dest already exists.`)):p(e,t,n,i))}function p(e,t,n,i){r.rename(e,t,r=>r?r.code===`EXDEV`?m(e,t,n,i):i(r):i())}function m(e,t,n,r){a(e,t,{overwrite:n,errorOnExist:!0},t=>t?r(t):o(e,r))}n.exports=u})),Y=r(((t,n)=>{var r=_(),i=e(`path`),a=M().copySync,o=P().removeSync,s=E().mkdirpSync,c=k();function l(e,t,n){n=n||{};let r=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=c.checkPathsSync(e,t,`move`,n);return c.checkParentPathsSync(e,a,t,`move`),u(t)||s(i.dirname(t)),d(e,t,r,o)}function u(e){let t=i.dirname(e);return i.parse(t).root===t}function d(e,t,n,i){if(i)return f(e,t,n);if(n)return o(t),f(e,t,n);if(r.existsSync(t))throw Error(`dest already exists.`);return f(e,t,n)}function f(e,t,n){try{r.renameSync(e,t)}catch(r){if(r.code!==`EXDEV`)throw r;return p(e,t,n)}}function p(e,t,n){return a(e,t,{overwrite:n,errorOnExist:!0}),o(e)}n.exports=l})),X=r(((e,t)=>{var n=S().fromCallback;t.exports={move:n(J()),moveSync:Y()}})),te=r(((e,t)=>{t.exports={...C(),...M(),...ee(),...B(),...q(),...E(),...X(),...W(),...D(),...P()}})),ne=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.childDepType=e.depTypeGreater=e.DepType=void 0;var t;(function(e){e[e.PROD=0]=`PROD`,e[e.DEV=1]=`DEV`,e[e.OPTIONAL=2]=`OPTIONAL`,e[e.DEV_OPTIONAL=3]=`DEV_OPTIONAL`,e[e.ROOT=4]=`ROOT`})(t=e.DepType||(e.DepType={})),e.depTypeGreater=(e,n)=>{switch(n){case t.DEV:switch(e){case t.OPTIONAL:case t.PROD:case t.ROOT:return!0;case t.DEV:case t.DEV_OPTIONAL:default:return!1}case t.DEV_OPTIONAL:switch(e){case t.OPTIONAL:case t.PROD:case t.ROOT:case t.DEV:return!0;case t.DEV_OPTIONAL:default:return!1}case t.OPTIONAL:switch(e){case t.PROD:case t.ROOT:return!0;case t.OPTIONAL:case t.DEV:case t.DEV_OPTIONAL:default:return!1}case t.PROD:switch(e){case t.ROOT:return!0;case t.PROD:case t.OPTIONAL:case t.DEV:case t.DEV_OPTIONAL:default:return!1}case t.ROOT:switch(e){case t.ROOT:case t.PROD:case t.OPTIONAL:case t.DEV:case t.DEV_OPTIONAL:default:return!1}default:return!1}},e.childDepType=(e,n)=>{if(n===t.ROOT)throw Error(`Something went wrong, a child dependency can't be marked as the ROOT`);switch(e){case t.ROOT:return n;case t.PROD:return n===t.OPTIONAL?t.OPTIONAL:t.PROD;case t.OPTIONAL:return t.OPTIONAL;case t.DEV_OPTIONAL:return t.DEV_OPTIONAL;case t.DEV:return n===t.OPTIONAL?t.DEV_OPTIONAL:t.DEV}}})),re=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NativeModuleType=void 0,(function(e){e[e.NONE=0]=`NONE`,e[e.NODE_GYP=1]=`NODE_GYP`,e[e.PREBUILD=2]=`PREBUILD`})(e.NativeModuleType||(e.NativeModuleType={}))})),ie=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Walker=void 0;var n=v(),r=te(),i=e(`path`),a=ne(),o=re(),s=n(`flora-colossus`);t.Walker=class{constructor(e){if(this.modules=[],this.walkHistory=new Set,this.cache=null,!e||typeof e!=`string`)throw Error(`modulePath must be provided as a string`);s(`creating walker with rootModule=${e}`),this.rootModule=e}relativeModule(e,t){return i.resolve(e,`node_modules`,t)}async loadPackageJSON(e){let t=i.resolve(e,`package.json`);if(await r.pathExists(t)){let e=await r.readJson(t);return e.dependencies||(e.dependencies={}),e.devDependencies||(e.devDependencies={}),e.optionalDependencies||(e.optionalDependencies={}),e}return null}async walkDependenciesForModuleInModule(e,t,n){let o=t,s=null,c=null;for(;!s&&this.relativeModule(o,e)!==c;)c=this.relativeModule(o,e),await r.pathExists(c)?s=c:(i.basename(i.dirname(o))!==`node_modules`&&(o=i.dirname(o)),o=i.dirname(i.dirname(o)));if(!s&&n!==a.DepType.OPTIONAL&&n!==a.DepType.DEV_OPTIONAL)throw Error(`Failed to locate module "${e}" from "${t}"
|
|
7
|
+
|
|
8
|
+
This normally means that either you have deleted this package already somehow (check your ignore settings if using electron-packager). Or your module installation failed.`);s&&await this.walkDependenciesForModule(s,n)}async detectNativeModuleType(e,t){return t.dependencies[`prebuild-install`]?o.NativeModuleType.PREBUILD:await r.pathExists(i.join(e,`binding.gyp`))?o.NativeModuleType.NODE_GYP:o.NativeModuleType.NONE}async walkDependenciesForModule(e,t){if(s(`walk reached:`,e,` Type is:`,a.DepType[t]),this.walkHistory.has(e)){s(`already walked this route`);let n=this.modules.find(t=>t.path===e);(0,a.depTypeGreater)(t,n.depType)&&(s(`existing module has a type of "${n.depType}", new module type would be "${t}" therefore updating`),n.depType=t);return}let n=await this.loadPackageJSON(e);if(!n){s(`walk hit a dead end, this module is incomplete`);return}this.walkHistory.add(e),this.modules.push({depType:t,nativeModuleType:await this.detectNativeModuleType(e,n),path:e,name:n.name});for(let r in n.dependencies){if(r in n.optionalDependencies){s(`found ${r} in prod deps of ${e} but it is also marked optional`);continue}await this.walkDependenciesForModuleInModule(r,e,(0,a.childDepType)(t,a.DepType.PROD))}for(let r in n.optionalDependencies)await this.walkDependenciesForModuleInModule(r,e,(0,a.childDepType)(t,a.DepType.OPTIONAL));if(t===a.DepType.ROOT){s(`we're still at the beginning, walking down the dev route`);for(let r in n.devDependencies)await this.walkDependenciesForModuleInModule(r,e,(0,a.childDepType)(t,a.DepType.DEV))}}async walkTree(){return s(`starting tree walk`),this.cache?s(`tree walk in progress / completed already, waiting for existing walk to complete`):this.cache=new Promise(async(e,t)=>{this.modules=[];try{await this.walkDependenciesForModule(this.rootModule,a.DepType.ROOT)}catch(e){t(e);return}e(this.modules)}),await this.cache}getRootModule(){return this.rootModule}}})),ae=r((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(ie(),e),n(ne(),e)})),oe=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DestroyerOfModules=void 0;var n=te(),r=e(`path`),i=ae();t.DestroyerOfModules=class{constructor({rootDirectory:e,walker:t,shouldKeepModuleTest:n}){if(e)this.walker=new i.Walker(e);else if(t)this.walker=t;else throw Error(`Must either provide rootDirectory or walker argument`);n&&(this.shouldKeepFn=n)}async destroyModule(e,t){if(t.get(e)){let i=r.resolve(e,`node_modules`);if(!await n.pathExists(i))return;for(let e of await n.readdir(i))if(e.startsWith(`@`))for(let a of await n.readdir(r.resolve(i,e)))await this.destroyModule(r.resolve(i,e,a),t);else await this.destroyModule(r.resolve(i,e),t)}else await n.remove(e)}async collectKeptModules({relativePaths:e=!1}){let t=await this.walker.walkTree(),n=new Map,i=r.resolve(this.walker.getRootModule());for(let a of t)if(this.shouldKeepModule(a)){let t=a.path;e&&(t=t.replace(`${i}${r.sep}`,``)),n.set(t,a)}return n}async destroy(){await this.destroyModule(this.walker.getRootModule(),await this.collectKeptModules({relativePaths:!1}))}shouldKeepModule(e){let t=e.depType===i.DepType.DEV||e.depType===i.DepType.DEV_OPTIONAL;return this.shouldKeepFn?this.shouldKeepFn(e,t):!t}}})),se=r((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(oe(),e),n(ae(),e)})),ce=r(((e,t)=>{var n=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],r=[`B`,`kiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`],i=[`b`,`kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],a=[`b`,`kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],o=(e,t,n)=>{let r=e;return typeof t==`string`||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};t.exports=(e,t)=>{if(!Number.isFinite(e))throw TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t=Object.assign({bits:!1,binary:!1},t);let s=t.bits?t.binary?a:i:t.binary?r:n;if(t.signed&&e===0)return` 0 ${s[0]}`;let c=e<0,l=c?`-`:t.signed?`+`:``;c&&(e=-e);let u;if(t.minimumFractionDigits!==void 0&&(u={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(u=Object.assign({maximumFractionDigits:t.maximumFractionDigits},u)),e<1)return l+o(e,t.locale,u)+` `+s[0];let d=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),s.length-1);e/=(t.binary?1024:1e3)**d,u||(e=e.toPrecision(3));let f=o(Number(e),t.locale,u),p=s[d];return l+f+` `+p}})),Z=r(((e,t)=>{t.exports={options:{usePureJavaScript:!1}}})),le=r(((e,t)=>{var n={};t.exports=n;var r={};n.encode=function(e,t,n){if(typeof t!=`string`)throw TypeError(`"alphabet" must be a string.`);if(n!==void 0&&typeof n!=`number`)throw TypeError(`"maxline" must be a number.`);var r=``;if(!(e instanceof Uint8Array))r=i(e,t);else{var a=0,o=t.length,s=t.charAt(0),c=[0];for(a=0;a<e.length;++a){for(var l=0,u=e[a];l<c.length;++l)u+=c[l]<<8,c[l]=u%o,u=u/o|0;for(;u>0;)c.push(u%o),u=u/o|0}for(a=0;e[a]===0&&a<e.length-1;++a)r+=s;for(a=c.length-1;a>=0;--a)r+=t[c[a]]}if(n){var d=RegExp(`.{1,`+n+`}`,`g`);r=r.match(d).join(`\r
|
|
9
|
+
`)}return r},n.decode=function(e,t){if(typeof e!=`string`)throw TypeError(`"input" must be a string.`);if(typeof t!=`string`)throw TypeError(`"alphabet" must be a string.`);var n=r[t];if(!n){n=r[t]=[];for(var i=0;i<t.length;++i)n[t.charCodeAt(i)]=i}e=e.replace(/\s/g,``);for(var a=t.length,o=t.charAt(0),s=[0],i=0;i<e.length;i++){var c=n[e.charCodeAt(i)];if(c===void 0)return;for(var l=0,u=c;l<s.length;++l)u+=s[l]*a,s[l]=u&255,u>>=8;for(;u>0;)s.push(u&255),u>>=8}for(var d=0;e[d]===o&&d<e.length-1;++d)s.push(0);return typeof Buffer<`u`?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function i(e,t){var n=0,r=t.length,i=t.charAt(0),a=[0];for(n=0;n<e.length();++n){for(var o=0,s=e.at(n);o<a.length;++o)s+=a[o]<<8,a[o]=s%r,s=s/r|0;for(;s>0;)a.push(s%r),s=s/r|0}var c=``;for(n=0;e.at(n)===0&&n<e.length()-1;++n)c+=i;for(n=a.length-1;n>=0;--n)c+=t[a[n]];return c}})),Q=r(((e,t)=>{var n=Z(),r=le(),i=t.exports=n.util=n.util||{};(function(){if(typeof process<`u`&&process.nextTick&&!process.browser){i.nextTick=process.nextTick,typeof setImmediate==`function`?i.setImmediate=setImmediate:i.setImmediate=i.nextTick;return}if(typeof setImmediate==`function`){i.setImmediate=function(){return setImmediate.apply(void 0,arguments)},i.nextTick=function(e){return setImmediate(e)};return}if(i.setImmediate=function(e){setTimeout(e,0)},typeof window<`u`&&typeof window.postMessage==`function`){var e=`forge.setImmediate`,t=[];i.setImmediate=function(n){t.push(n),t.length===1&&window.postMessage(e,`*`)};function n(n){if(n.source===window&&n.data===e){n.stopPropagation();var r=t.slice();t.length=0,r.forEach(function(e){e()})}}window.addEventListener(`message`,n,!0)}if(typeof MutationObserver<`u`){var n=Date.now(),r=!0,a=document.createElement(`div`),t=[];new MutationObserver(function(){var e=t.slice();t.length=0,e.forEach(function(e){e()})}).observe(a,{attributes:!0});var o=i.setImmediate;i.setImmediate=function(e){Date.now()-n>15?(n=Date.now(),o(e)):(t.push(e),t.length===1&&a.setAttribute(`a`,r=!r))}}i.nextTick=i.setImmediate})(),i.isNodejs=typeof process<`u`&&process.versions&&process.versions.node,i.globalScope=(function(){return i.isNodejs?global:typeof self>`u`?window:self})(),i.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},i.isArrayBuffer=function(e){return typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function a(e){if(!(e===8||e===16||e===24||e===32))throw Error(`Only 8, 16, 24, or 32 bits supported: `+e)}i.ByteBuffer=o;function o(e){if(this.data=``,this.read=0,typeof e==`string`)this.data=e;else if(i.isArrayBuffer(e)||i.isArrayBufferView(e))if(typeof Buffer<`u`&&e instanceof Buffer)this.data=e.toString(`binary`);else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var n=0;n<t.length;++n)this.putByte(t[n])}}else (e instanceof o||typeof e==`object`&&typeof e.data==`string`&&typeof e.read==`number`)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}i.ByteStringBuffer=o;var s=4096;i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>s&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var n=this.data;t>0;)t&1&&(n+=e),t>>>=1,t>0&&(e+=e);return this.data=n,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){a(t);var n=``;do t-=8,n+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(n)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},i.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},i.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},i.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},i.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},i.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},i.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},i.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},i.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},i.ByteStringBuffer.prototype.getInt=function(e){a(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<<e-2;return t>=n&&(t-=n<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t=``:(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return e===void 0?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data=``,this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e=``,t=this.read;t<this.data.length;++t){var n=this.data.charCodeAt(t);n<16&&(e+=`0`),e+=n.toString(16)}return e},i.ByteStringBuffer.prototype.toString=function(){return i.decodeUtf8(this.bytes())};function c(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var n=i.isArrayBuffer(e),r=i.isArrayBufferView(e);if(n||r){n?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write=`writeOffset`in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),`writeOffset`in t&&(this.write=t.writeOffset)}i.DataBuffer=c,i.DataBuffer.prototype.length=function(){return this.write-this.read},i.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},i.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var n=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(n),this.data=new DataView(r.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var n=0;n<t;++n)this.data.setUint8(e);return this},i.DataBuffer.prototype.putBytes=function(e,t){if(i.isArrayBufferView(e)){var n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=n.byteLength-n.byteOffset;this.accommodate(r);var a=new Uint8Array(this.data.buffer,this.write);return a.set(n),this.write+=r,this}if(i.isArrayBuffer(e)){var n=new Uint8Array(e);this.accommodate(n.byteLength);var a=new Uint8Array(this.data.buffer);return a.set(n,this.write),this.write+=n.byteLength,this}if(e instanceof i.DataBuffer||typeof e==`object`&&typeof e.read==`number`&&typeof e.write==`number`&&i.isArrayBufferView(e.data)){var n=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(n.byteLength);var a=new Uint8Array(e.data.byteLength,this.write);return a.set(n),this.write+=n.byteLength,this}if(e instanceof i.ByteStringBuffer&&(e=e.data,t=`binary`),t=t||`binary`,typeof e==`string`){var o;if(t===`hex`)return this.accommodate(Math.ceil(e.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.hex.decode(e,o,this.write),this;if(t===`base64`)return this.accommodate(Math.ceil(e.length/4)*3),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.base64.decode(e,o,this.write),this;if(t===`utf8`&&(e=i.encodeUtf8(e),t=`binary`),t===`binary`||t===`raw`)return this.accommodate(e.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.raw.decode(o),this;if(t===`utf16`)return this.accommodate(e.length*2),o=new Uint16Array(this.data.buffer,this.write),this.write+=i.text.utf16.encode(o),this;throw Error(`Invalid encoding: `+t)}throw Error(`Invalid parameter: `+e)},i.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},i.DataBuffer.prototype.putString=function(e){return this.putBytes(e,`utf16`)},i.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},i.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){a(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return a(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},i.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},i.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},i.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},i.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},i.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},i.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},i.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},i.DataBuffer.prototype.getInt=function(e){a(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),n=2<<e-2;return t>=n&&(t-=n<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t=``:(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return e===void 0?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e=``,t=this.read;t<this.data.byteLength;++t){var n=this.data.getUint8(t);n<16&&(e+=`0`),e+=n.toString(16)}return e},i.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||`utf8`,e===`binary`||e===`raw`)return i.binary.raw.encode(t);if(e===`hex`)return i.binary.hex.encode(t);if(e===`base64`)return i.binary.base64.encode(t);if(e===`utf8`)return i.text.utf8.decode(t);if(e===`utf16`)return i.text.utf16.decode(t);throw Error(`Invalid encoding: `+e)},i.createBuffer=function(e,t){return t=t||`raw`,e!==void 0&&t===`utf8`&&(e=i.encodeUtf8(e)),new i.ByteBuffer(e)},i.fillString=function(e,t){for(var n=``;t>0;)t&1&&(n+=e),t>>>=1,t>0&&(e+=e);return n},i.xorBytes=function(e,t,n){for(var r=``,i=``,a=``,o=0,s=0;n>0;--n,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(r+=a,a=``,s=0),a+=String.fromCharCode(i),++s;return r+=a,r},i.hexToBytes=function(e){var t=``,n=0;for(e.length&!0&&(n=1,t+=String.fromCharCode(parseInt(e[0],16)));n<e.length;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t},i.bytesToHex=function(e){return i.createBuffer(e).toHex()},i.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var l=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],d=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`;i.encode64=function(e,t){for(var n=``,r=``,i,a,o,s=0;s<e.length;)i=e.charCodeAt(s++),a=e.charCodeAt(s++),o=e.charCodeAt(s++),n+=l.charAt(i>>2),n+=l.charAt((i&3)<<4|a>>4),isNaN(a)?n+=`==`:(n+=l.charAt((a&15)<<2|o>>6),n+=isNaN(o)?`=`:l.charAt(o&63)),t&&n.length>t&&(r+=n.substr(0,t)+`\r
|
|
10
|
+
`,n=n.substr(t));return r+=n,r},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,``);for(var t=``,n,r,i,a,o=0;o<e.length;)n=u[e.charCodeAt(o++)-43],r=u[e.charCodeAt(o++)-43],i=u[e.charCodeAt(o++)-43],a=u[e.charCodeAt(o++)-43],t+=String.fromCharCode(n<<2|r>>4),i!==64&&(t+=String.fromCharCode((r&15)<<4|i>>2),a!==64&&(t+=String.fromCharCode((i&3)<<6|a)));return t},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:r.encode,decode:r.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(e.length)),n=n||0;for(var i=n,a=0;a<e.length;++a)r[i++]=e.charCodeAt(a);return t?i-n:r},i.binary.hex.encode=i.bytesToHex,i.binary.hex.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),n=n||0;var i=0,a=n;for(e.length&1&&(i=1,r[a++]=parseInt(e[0],16));i<e.length;i+=2)r[a++]=parseInt(e.substr(i,2),16);return t?a-n:r},i.binary.base64.encode=function(e,t){for(var n=``,r=``,i,a,o,s=0;s<e.byteLength;)i=e[s++],a=e[s++],o=e[s++],n+=l.charAt(i>>2),n+=l.charAt((i&3)<<4|a>>4),isNaN(a)?n+=`==`:(n+=l.charAt((a&15)<<2|o>>6),n+=isNaN(o)?`=`:l.charAt(o&63)),t&&n.length>t&&(r+=n.substr(0,t)+`\r
|
|
11
|
+
`,n=n.substr(t));return r+=n,r},i.binary.base64.decode=function(e,t,n){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,``),n=n||0;for(var i,a,o,s,c=0,l=n;c<e.length;)i=u[e.charCodeAt(c++)-43],a=u[e.charCodeAt(c++)-43],o=u[e.charCodeAt(c++)-43],s=u[e.charCodeAt(c++)-43],r[l++]=i<<2|a>>4,o!==64&&(r[l++]=(a&15)<<4|o>>2,s!==64&&(r[l++]=(o&3)<<6|s));return t?l-n:r.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,d,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,d,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,n){e=i.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),n=n||0;for(var a=n,o=0;o<e.length;++o)r[a++]=e.charCodeAt(o);return t?a-n:r},i.text.utf8.decode=function(e){return i.decodeUtf8(String.fromCharCode.apply(null,e))},i.text.utf16.encode=function(e,t,n){var r=t;r||(r=new Uint8Array(e.length*2));var i=new Uint16Array(r.buffer);n=n||0;for(var a=n,o=n,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-n:r},i.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},i.deflate=function(e,t,n){if(t=i.decode64(e.deflate(i.encode64(t)).rval),n){var r=2;t.charCodeAt(1)&32&&(r=6),t=t.substring(r,t.length-4)}return t},i.inflate=function(e,t,n){var r=e.inflate(i.encode64(t)).rval;return r===null?null:i.decode64(r)};var f=function(e,t,n){if(!e)throw Error(`WebStorage not available.`);var r;if(n===null?r=e.removeItem(t):(n=i.encode64(JSON.stringify(n)),r=e.setItem(t,n)),r!==void 0&&r.rval!==!0){var a=Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}},p=function(e,t){if(!e)throw Error(`WebStorage not available.`);var n=e.getItem(t);if(e.init)if(n.rval===null){if(n.error){var r=Error(n.error.message);throw r.id=n.error.id,r.name=n.error.name,r}n=null}else n=n.rval;return n!==null&&(n=JSON.parse(i.decode64(n))),n},m=function(e,t,n,r){var i=p(e,t);i===null&&(i={}),i[n]=r,f(e,t,i)},h=function(e,t,n){var r=p(e,t);return r!==null&&(r=n in r?r[n]:null),r},g=function(e,t,n){var r=p(e,t);if(r!==null&&n in r){delete r[n];var i=!0;for(var a in r){i=!1;break}i&&(r=null),f(e,t,r)}},_=function(e,t){f(e,t,null)},v=function(e,t,n){var r=null;n===void 0&&(n=[`web`,`flash`]);var i,a=!1,o=null;for(var s in n){i=n[s];try{if(i===`flash`||i===`both`){if(t[0]===null)throw Error(`Flash local storage not available.`);r=e.apply(this,t),a=i===`flash`}(i===`web`||i===`both`)&&(t[0]=localStorage,r=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return r};i.setItem=function(e,t,n,r,i){v(m,arguments,i)},i.getItem=function(e,t,n,r){return v(h,arguments,r)},i.removeItem=function(e,t,n,r){v(g,arguments,r)},i.clearItems=function(e,t,n){v(_,arguments,n)},i.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},i.format=function(e){for(var t=/%./g,n,r,i=0,a=[],o=0;n=t.exec(e);){r=e.substring(o,t.lastIndex-2),r.length>0&&a.push(r),o=t.lastIndex;var s=n[0][1];switch(s){case`s`:case`o`:i<arguments.length?a.push(arguments[i+++1]):a.push(`<?>`);break;case`%`:a.push(`%`);break;default:a.push(`<%`+s+`?>`)}}return a.push(e.substring(o)),a.join(``)},i.formatNumber=function(e,t,n,r){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=n===void 0?`,`:n,s=r===void 0?`.`:r,c=i<0?`-`:``,l=parseInt(i=Math.abs(+i||0).toFixed(a),10)+``,u=l.length>3?l.length%3:0;return c+(u?l.substr(0,u)+s:``)+l.substr(u).replace(/(\d{3})(?=\d)/g,`$1`+s)+(a?o+Math.abs(i-l).toFixed(a).slice(2):``)},i.formatSize=function(e){return e=e>=1073741824?i.formatNumber(e/1073741824,2,`.`,``)+` GiB`:e>=1048576?i.formatNumber(e/1048576,2,`.`,``)+` MiB`:e>=1024?i.formatNumber(e/1024,0)+` KiB`:i.formatNumber(e,0)+` bytes`,e},i.bytesFromIP=function(e){return e.indexOf(`.`)===-1?e.indexOf(`:`)===-1?null:i.bytesFromIPv6(e):i.bytesFromIPv4(e)},i.bytesFromIPv4=function(e){if(e=e.split(`.`),e.length!==4)return null;for(var t=i.createBuffer(),n=0;n<e.length;++n){var r=parseInt(e[n],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()},i.bytesFromIPv6=function(e){var t=0;e=e.split(`:`).filter(function(e){return e.length===0&&++t,!0});for(var n=(8-e.length+t)*2,r=i.createBuffer(),a=0;a<8;++a){if(!e[a]||e[a].length===0){r.fillWithByte(0,n),n=0;continue}var o=i.hexToBytes(e[a]);o.length<2&&r.putByte(0),r.putBytes(o)}return r.getBytes()},i.bytesToIP=function(e){return e.length===4?i.bytesToIPv4(e):e.length===16?i.bytesToIPv6(e):null},i.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t.join(`.`)},i.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],n=[],r=0,a=0;a<e.length;a+=2){for(var o=i.bytesToHex(e[a]+e[a+1]);o[0]===`0`&&o!==`0`;)o=o.substr(1);if(o===`0`){var s=n[n.length-1],c=t.length;!s||c!==s.end+1?n.push({start:c,end:c}):(s.end=c,s.end-s.start>n[r].end-n[r].start&&(r=n.length-1))}t.push(o)}if(n.length>0){var l=n[r];l.end-l.start>0&&(t.splice(l.start,l.end-l.start+1,``),l.start===0&&t.unshift(``),l.end===7&&t.push(``))}return t.join(`:`)},i.estimateCores=function(e,t){if(typeof e==`function`&&(t=e,e={}),e=e||{},`cores`in i&&!e.update)return t(null,i.cores);if(typeof navigator<`u`&&`hardwareConcurrency`in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if(typeof Worker>`u`)return i.cores=1,t(null,i.cores);if(typeof Blob>`u`)return i.cores=2,t(null,i.cores);var n=URL.createObjectURL(new Blob([`(`,function(){self.addEventListener(`message`,function(e){for(var t=Date.now(),n=t+4;Date.now()<n;);self.postMessage({st:t,et:n})})}.toString(),`)()`],{type:`application/javascript`}));r([],5,16);function r(e,s,c){if(s===0){var l=Math.floor(e.reduce(function(e,t){return e+t},0)/e.length);return i.cores=Math.max(1,l),URL.revokeObjectURL(n),t(null,i.cores)}a(c,function(t,n){e.push(o(c,n)),r(e,s-1,c)})}function a(e,t){for(var r=[],i=[],a=0;a<e;++a){var o=new Worker(n);o.addEventListener(`message`,function(n){if(i.push(n.data),i.length===e){for(var a=0;a<e;++a)r[a].terminate();t(null,i)}}),r.push(o)}for(var a=0;a<e;++a)r[a].postMessage(a)}function o(e,t){for(var n=[],r=0;r<e;++r)for(var i=t[r],a=n[r]=[],o=0;o<e;++o)if(r!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return n.reduce(function(e,t){return Math.max(e,t.length)},0)}}})),ue=r(((e,t)=>{var n=Z();Q(),t.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if(typeof r==`string`&&(r=n.cipher.getAlgorithm(r),r&&(r=r())),!r)throw Error(`Unsupported algorithm: `+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if(typeof r==`string`&&(r=n.cipher.getAlgorithm(r),r&&(r=r())),!r)throw Error(`Unsupported algorithm: `+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in n.cipher.algorithms?n.cipher.algorithms[e]:null};var r=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};r.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},r.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},r.prototype.finish=function(e){e&&(this.mode.name===`ECB`||this.mode.name===`CBC`)&&(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))}})),de=r(((e,t)=>{var n=Z();Q(),n.cipher=n.cipher||{};var r=t.exports=n.cipher.modes=n.cipher.modes||{};r.ecb=function(e){e=e||{},this.name=`ECB`,this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},r.ecb.prototype.start=function(e){},r.ecb.prototype.encrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},r.ecb.prototype.decrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])},r.ecb.prototype.pad=function(e,t){var n=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(n,n),!0},r.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var n=e.length(),r=e.at(n-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},r.cbc=function(e){e=e||{},this.name=`CBC`,this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},r.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw Error(`Invalid IV parameter.`);this._iv=this._prev.slice(0)}else if(`iv`in e)this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw Error(`Invalid IV parameter.`)},r.cbc.prototype.encrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock},r.cbc.prototype.decrypt=function(e,t,n){if(e.length()<this.blockSize&&!(n&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)},r.cbc.prototype.pad=function(e,t){var n=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(n,n),!0},r.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var n=e.length(),r=e.at(n-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)},r.cfb=function(e){e=e||{},this.name=`CFB`,this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialBlock=Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},r.cfb.prototype.start=function(e){if(!(`iv`in e))throw Error(`Invalid IV parameter.`);this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.cfb.prototype.encrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},r.cfb.prototype.decrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},r.ofb=function(e){e=e||{},this.name=`OFB`,this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},r.ofb.prototype.start=function(e){if(!(`iv`in e))throw Error(`Invalid IV parameter.`);this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.ofb.prototype.encrypt=function(e,t,n){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-r)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!n)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0},r.ofb.prototype.decrypt=r.ofb.prototype.encrypt,r.ctr=function(e){e=e||{},this.name=`CTR`,this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},r.ctr.prototype.start=function(e){if(!(`iv`in e))throw Error(`Invalid IV parameter.`);this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},r.ctr.prototype.encrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},r.ctr.prototype.decrypt=r.ctr.prototype.encrypt,r.gcm=function(e){e=e||{},this.name=`GCM`,this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},r.gcm.prototype.start=function(e){if(!(`iv`in e))throw Error(`Invalid IV parameter.`);var t=n.util.createBuffer(e.iv);this._cipherLength=0;var r=`additionalData`in e?n.util.createBuffer(e.additionalData):n.util.createBuffer();if(`tagLength`in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw Error(`Authentication tag does not match tag length.`);this._hashBlock=Array(this._ints),this.tag=null,this._hashSubkey=Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=t.length();if(i===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(i*8)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,r=n.util.createBuffer(r),this._aDataLength=o(r.length()*8);var s=r.length()%this.blockSize;for(s&&r.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])},r.gcm.prototype.encrypt=function(e,t,n){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-r)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o<=0||n){if(n){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!n)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},r.gcm.prototype.decrypt=function(e,t,n){var r=e.length();if(r<this.blockSize&&!(n&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize},r.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(o(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^a[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},r.gcm.prototype.multiply=function(e,t){for(var n=[0,0,0,0],r=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),this.pow(r,r);return n},r.gcm.prototype.pow=function(e,t){for(var n=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,n&&(t[0]^=this._R)},r.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],n=0;n<32;++n){var r=e[n/8|0]>>>(7-n%8)*4&15,i=this._m[n][r];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},r.gcm.prototype.ghash=function(e,t,n){return t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3],this.tableMultiply(t)},r.gcm.prototype.generateHashTable=function(e,t){for(var n=8/t,r=4*n,i=16*n,a=Array(i),o=0;o<i;++o){var s=[0,0,0,0],c=o/r|0,l=(r-1-o%r)*t;s[c]=1<<t-1<<l,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},r.gcm.prototype.generateSubHashTable=function(e,t){var n=1<<t,r=n>>>1,i=Array(n);i[r]=e.slice(0);for(var a=r>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<r;){for(var o=1;o<a;++o){var s=i[a],c=i[o];i[a+o]=[s[0]^c[0],s[1]^c[1],s[2]^c[2],s[3]^c[3]]}a*=2}for(i[0]=[0,0,0,0],a=r+1;a<n;++a){var l=i[a^r];i[a]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return i};function i(e,t){if(typeof e==`string`&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw Error(`Invalid IV length; got `+e.length()+` bytes and expected `+t+` bytes.`);if(!n.util.isArray(e)){for(var a=[],o=t/4,i=0;i<o;++i)a.push(e.getInt32());e=a}return e}function a(e){e[e.length-1]=e[e.length-1]+1&4294967295}function o(e){return[e/4294967296|0,e&4294967295]}})),fe=r(((e,t)=>{var n=Z();ue(),de(),Q(),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,n,r){var i=m({key:e,output:n,decrypt:!1,mode:r});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return m({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,n,r){var i=m({key:e,output:n,decrypt:!0,mode:r});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return m({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){i||d();var n=this;n.name=e,n.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(n._w,e,t,!1)},decrypt:function(e,t){return p(n._w,e,t,!0)}}}),n._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if(typeof t==`string`&&(t.length===16||t.length===24||t.length===32))t=n.util.createBuffer(t);else if(n.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){r=t,t=n.util.createBuffer();for(var i=0;i<r.length;++i)t.putByte(r[i])}if(!n.util.isArray(t)){r=t,t=[];var a=r.length();if(a===16||a===24||a===32){a>>>=2;for(var i=0;i<a;++i)t.push(r.getInt32())}}if(!n.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw Error(`Invalid key parameter.`);var o=this.mode.name,s=[`CFB`,`OFB`,`CTR`,`GCM`].indexOf(o)!==-1;this._w=f(t,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return i||d(),f(e,t)},n.aes._updateBlock=p,r(`AES-ECB`,n.cipher.modes.ecb),r(`AES-CBC`,n.cipher.modes.cbc),r(`AES-CFB`,n.cipher.modes.cfb),r(`AES-OFB`,n.cipher.modes.ofb),r(`AES-CTR`,n.cipher.modes.ctr),r(`AES-GCM`,n.cipher.modes.gcm);function r(e,t){n.cipher.registerAlgorithm(e,function(){return new n.aes.Algorithm(e,t)})}var i=!1,a=4,o,s,c,l,u;function d(){i=!0,c=[0,1,2,4,8,16,32,64,128,27,54];for(var e=Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;o=Array(256),s=Array(256),l=[,,,,],u=[,,,,];for(var t=0;t<4;++t)l[t]=Array(256),u[t]=Array(256);for(var n=0,r=0,a,d,f,p,m,h,g,t=0;t<256;++t){p=r^r<<1^r<<2^r<<3^r<<4,p=p>>8^p&255^99,o[n]=p,s[p]=n,m=e[p],a=e[n],d=e[a],f=e[d],h=m<<24^p<<16^p<<8^p^m,g=(a^d^f)<<24^(n^f)<<16^(n^d^f)<<8^n^a^f;for(var _=0;_<4;++_)l[_][n]=h,u[_][p]=g,h=h<<24|h>>>8,g=g<<24|g>>>8;n===0?n=r=1:(n=a^e[e[e[a^f]]],r^=e[e[r]])}}function f(e,t){for(var n=e.slice(0),r,i=1,s=n.length,l=a*(s+6+1),d=s;d<l;++d)r=n[d-1],d%s===0?(r=o[r>>>16&255]<<24^o[r>>>8&255]<<16^o[r&255]<<8^o[r>>>24]^c[i]<<24,i++):s>6&&d%s===4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[r&255]),n[d]=n[d-s]^r;if(t){var f,p=u[0],m=u[1],h=u[2],g=u[3],_=n.slice(0);l=n.length;for(var d=0,v=l-a;d<l;d+=a,v-=a)if(d===0||d===l-a)_[d]=n[v],_[d+1]=n[v+3],_[d+2]=n[v+2],_[d+3]=n[v+1];else for(var y=0;y<a;++y)f=n[v+y],_[d+(3&-y)]=p[o[f>>>24]]^m[o[f>>>16&255]]^h[o[f>>>8&255]]^g[o[f&255]];n=_}return n}function p(e,t,n,r){var i=e.length/4-1,a,c,d,f,p;r?(a=u[0],c=u[1],d=u[2],f=u[3],p=s):(a=l[0],c=l[1],d=l[2],f=l[3],p=o);for(var m=t[0]^e[0],h=t[r?3:1]^e[1],g=t[2]^e[2],_=t[r?1:3]^e[3],v,y,b,x=3,S=1;S<i;++S)v=a[m>>>24]^c[h>>>16&255]^d[g>>>8&255]^f[_&255]^e[++x],y=a[h>>>24]^c[g>>>16&255]^d[_>>>8&255]^f[m&255]^e[++x],b=a[g>>>24]^c[_>>>16&255]^d[m>>>8&255]^f[h&255]^e[++x],_=a[_>>>24]^c[m>>>16&255]^d[h>>>8&255]^f[g&255]^e[++x],m=v,h=y,g=b;n[0]=p[m>>>24]<<24^p[h>>>16&255]<<16^p[g>>>8&255]<<8^p[_&255]^e[++x],n[r?3:1]=p[h>>>24]<<24^p[g>>>16&255]<<16^p[_>>>8&255]<<8^p[m&255]^e[++x],n[2]=p[g>>>24]<<24^p[_>>>16&255]<<16^p[m>>>8&255]<<8^p[h&255]^e[++x],n[r?1:3]=p[_>>>24]<<24^p[m>>>16&255]<<16^p[h>>>8&255]<<8^p[g&255]^e[++x]}function m(e){e=e||{};var t=`AES-`+(e.mode||`CBC`).toUpperCase(),r=e.decrypt?n.cipher.createDecipher(t,e.key):n.cipher.createCipher(t,e.key),i=r.start;return r.start=function(e,t){var a=null;t instanceof n.util.ByteBuffer&&(a=t,t={}),t=t||{},t.output=a,t.iv=e,i.call(r,t)},r}})),pe=r(((e,t)=>{var n=Z();n.pki=n.pki||{};var r=t.exports=n.pki.oids=n.oids=n.oids||{};function i(e,t){r[e]=t,r[t]=e}function a(e,t){r[e]=t}i(`1.2.840.113549.1.1.1`,`rsaEncryption`),i(`1.2.840.113549.1.1.4`,`md5WithRSAEncryption`),i(`1.2.840.113549.1.1.5`,`sha1WithRSAEncryption`),i(`1.2.840.113549.1.1.7`,`RSAES-OAEP`),i(`1.2.840.113549.1.1.8`,`mgf1`),i(`1.2.840.113549.1.1.9`,`pSpecified`),i(`1.2.840.113549.1.1.10`,`RSASSA-PSS`),i(`1.2.840.113549.1.1.11`,`sha256WithRSAEncryption`),i(`1.2.840.113549.1.1.12`,`sha384WithRSAEncryption`),i(`1.2.840.113549.1.1.13`,`sha512WithRSAEncryption`),i(`1.3.101.112`,`EdDSA25519`),i(`1.2.840.10040.4.3`,`dsa-with-sha1`),i(`1.3.14.3.2.7`,`desCBC`),i(`1.3.14.3.2.26`,`sha1`),i(`1.3.14.3.2.29`,`sha1WithRSASignature`),i(`2.16.840.1.101.3.4.2.1`,`sha256`),i(`2.16.840.1.101.3.4.2.2`,`sha384`),i(`2.16.840.1.101.3.4.2.3`,`sha512`),i(`2.16.840.1.101.3.4.2.4`,`sha224`),i(`2.16.840.1.101.3.4.2.5`,`sha512-224`),i(`2.16.840.1.101.3.4.2.6`,`sha512-256`),i(`1.2.840.113549.2.2`,`md2`),i(`1.2.840.113549.2.5`,`md5`),i(`1.2.840.113549.1.7.1`,`data`),i(`1.2.840.113549.1.7.2`,`signedData`),i(`1.2.840.113549.1.7.3`,`envelopedData`),i(`1.2.840.113549.1.7.4`,`signedAndEnvelopedData`),i(`1.2.840.113549.1.7.5`,`digestedData`),i(`1.2.840.113549.1.7.6`,`encryptedData`),i(`1.2.840.113549.1.9.1`,`emailAddress`),i(`1.2.840.113549.1.9.2`,`unstructuredName`),i(`1.2.840.113549.1.9.3`,`contentType`),i(`1.2.840.113549.1.9.4`,`messageDigest`),i(`1.2.840.113549.1.9.5`,`signingTime`),i(`1.2.840.113549.1.9.6`,`counterSignature`),i(`1.2.840.113549.1.9.7`,`challengePassword`),i(`1.2.840.113549.1.9.8`,`unstructuredAddress`),i(`1.2.840.113549.1.9.14`,`extensionRequest`),i(`1.2.840.113549.1.9.20`,`friendlyName`),i(`1.2.840.113549.1.9.21`,`localKeyId`),i(`1.2.840.113549.1.9.22.1`,`x509Certificate`),i(`1.2.840.113549.1.12.10.1.1`,`keyBag`),i(`1.2.840.113549.1.12.10.1.2`,`pkcs8ShroudedKeyBag`),i(`1.2.840.113549.1.12.10.1.3`,`certBag`),i(`1.2.840.113549.1.12.10.1.4`,`crlBag`),i(`1.2.840.113549.1.12.10.1.5`,`secretBag`),i(`1.2.840.113549.1.12.10.1.6`,`safeContentsBag`),i(`1.2.840.113549.1.5.13`,`pkcs5PBES2`),i(`1.2.840.113549.1.5.12`,`pkcs5PBKDF2`),i(`1.2.840.113549.1.12.1.1`,`pbeWithSHAAnd128BitRC4`),i(`1.2.840.113549.1.12.1.2`,`pbeWithSHAAnd40BitRC4`),i(`1.2.840.113549.1.12.1.3`,`pbeWithSHAAnd3-KeyTripleDES-CBC`),i(`1.2.840.113549.1.12.1.4`,`pbeWithSHAAnd2-KeyTripleDES-CBC`),i(`1.2.840.113549.1.12.1.5`,`pbeWithSHAAnd128BitRC2-CBC`),i(`1.2.840.113549.1.12.1.6`,`pbewithSHAAnd40BitRC2-CBC`),i(`1.2.840.113549.2.7`,`hmacWithSHA1`),i(`1.2.840.113549.2.8`,`hmacWithSHA224`),i(`1.2.840.113549.2.9`,`hmacWithSHA256`),i(`1.2.840.113549.2.10`,`hmacWithSHA384`),i(`1.2.840.113549.2.11`,`hmacWithSHA512`),i(`1.2.840.113549.3.7`,`des-EDE3-CBC`),i(`2.16.840.1.101.3.4.1.2`,`aes128-CBC`),i(`2.16.840.1.101.3.4.1.22`,`aes192-CBC`),i(`2.16.840.1.101.3.4.1.42`,`aes256-CBC`),i(`2.5.4.3`,`commonName`),i(`2.5.4.4`,`surname`),i(`2.5.4.5`,`serialNumber`),i(`2.5.4.6`,`countryName`),i(`2.5.4.7`,`localityName`),i(`2.5.4.8`,`stateOrProvinceName`),i(`2.5.4.9`,`streetAddress`),i(`2.5.4.10`,`organizationName`),i(`2.5.4.11`,`organizationalUnitName`),i(`2.5.4.12`,`title`),i(`2.5.4.13`,`description`),i(`2.5.4.15`,`businessCategory`),i(`2.5.4.17`,`postalCode`),i(`2.5.4.42`,`givenName`),i(`2.5.4.65`,`pseudonym`),i(`1.3.6.1.4.1.311.60.2.1.2`,`jurisdictionOfIncorporationStateOrProvinceName`),i(`1.3.6.1.4.1.311.60.2.1.3`,`jurisdictionOfIncorporationCountryName`),i(`2.16.840.1.113730.1.1`,`nsCertType`),i(`2.16.840.1.113730.1.13`,`nsComment`),a(`2.5.29.1`,`authorityKeyIdentifier`),a(`2.5.29.2`,`keyAttributes`),a(`2.5.29.3`,`certificatePolicies`),a(`2.5.29.4`,`keyUsageRestriction`),a(`2.5.29.5`,`policyMapping`),a(`2.5.29.6`,`subtreesConstraint`),a(`2.5.29.7`,`subjectAltName`),a(`2.5.29.8`,`issuerAltName`),a(`2.5.29.9`,`subjectDirectoryAttributes`),a(`2.5.29.10`,`basicConstraints`),a(`2.5.29.11`,`nameConstraints`),a(`2.5.29.12`,`policyConstraints`),a(`2.5.29.13`,`basicConstraints`),i(`2.5.29.14`,`subjectKeyIdentifier`),i(`2.5.29.15`,`keyUsage`),a(`2.5.29.16`,`privateKeyUsagePeriod`),i(`2.5.29.17`,`subjectAltName`),i(`2.5.29.18`,`issuerAltName`),i(`2.5.29.19`,`basicConstraints`),a(`2.5.29.20`,`cRLNumber`),a(`2.5.29.21`,`cRLReason`),a(`2.5.29.22`,`expirationDate`),a(`2.5.29.23`,`instructionCode`),a(`2.5.29.24`,`invalidityDate`),a(`2.5.29.25`,`cRLDistributionPoints`),a(`2.5.29.26`,`issuingDistributionPoint`),a(`2.5.29.27`,`deltaCRLIndicator`),a(`2.5.29.28`,`issuingDistributionPoint`),a(`2.5.29.29`,`certificateIssuer`),a(`2.5.29.30`,`nameConstraints`),i(`2.5.29.31`,`cRLDistributionPoints`),i(`2.5.29.32`,`certificatePolicies`),a(`2.5.29.33`,`policyMappings`),a(`2.5.29.34`,`policyConstraints`),i(`2.5.29.35`,`authorityKeyIdentifier`),a(`2.5.29.36`,`policyConstraints`),i(`2.5.29.37`,`extKeyUsage`),a(`2.5.29.46`,`freshestCRL`),a(`2.5.29.54`,`inhibitAnyPolicy`),i(`1.3.6.1.4.1.11129.2.4.2`,`timestampList`),i(`1.3.6.1.5.5.7.1.1`,`authorityInfoAccess`),i(`1.3.6.1.5.5.7.3.1`,`serverAuth`),i(`1.3.6.1.5.5.7.3.2`,`clientAuth`),i(`1.3.6.1.5.5.7.3.3`,`codeSigning`),i(`1.3.6.1.5.5.7.3.4`,`emailProtection`),i(`1.3.6.1.5.5.7.3.8`,`timeStamping`)})),me=r(((e,t)=>{var n=Z();Q(),pe();var r=t.exports=n.asn1=n.asn1||{};r.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},r.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},r.maxDepth=256,r.create=function(e,t,i,a,o){if(n.util.isArray(a)){for(var s=[],c=0;c<a.length;++c)a[c]!==void 0&&s.push(a[c]);a=s}var l={tagClass:e,type:t,constructed:i,composed:i||n.util.isArray(a),value:a};return o&&`bitStringContents`in o&&(l.bitStringContents=o.bitStringContents,l.original=r.copy(l)),l},r.copy=function(e,t){var i;if(n.util.isArray(e)){i=[];for(var a=0;a<e.length;++a)i.push(r.copy(e[a],t));return i}return typeof e==`string`?e:(i={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:r.copy(e.value,t)},t&&!t.excludeBitStringContents&&(i.bitStringContents=e.bitStringContents),i)},r.equals=function(e,t,i){if(n.util.isArray(e)){if(!n.util.isArray(t)||e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!r.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e==`string`)return e===t;var o=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&r.equals(e.value,t.value);return i&&i.includeBitStringContents&&(o=o&&e.bitStringContents===t.bitStringContents),o},r.getBerValueLength=function(e){var t=e.getByte();if(t!==128)return t&128?e.getInt((t&127)<<3):t};function i(e,t,n){if(n>t){var r=Error(`Too few bytes to parse DER.`);throw r.available=e.length(),r.remaining=t,r.requested=n,r}}var a=function(e,t){var n=e.getByte();if(t--,n!==128){var r;if(!(n&128))r=n;else{var a=n&127;i(e,t,a),r=e.getInt(a<<3)}if(r<0)throw Error(`Negative length: `+r);return r}};r.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t==`boolean`&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),`strict`in t||(t.strict=!0),`parseAllBytes`in t||(t.parseAllBytes=!0),`decodeBitStrings`in t||(t.decodeBitStrings=!0),`maxDepth`in t||(t.maxDepth=r.maxDepth),typeof e==`string`&&(e=n.util.createBuffer(e));var i=e.length(),a=o(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var s=Error(`Unparsed DER bytes remain after ASN.1 parsing.`);throw s.byteCount=i,s.remaining=e.length(),s}return a};function o(e,t,n,s){if(n>=s.maxDepth)throw Error(`ASN.1 parsing error: Max depth exceeded.`);var c;i(e,t,2);var l=e.getByte();t--;var u=l&192,d=l&31;c=e.length();var f=a(e,t);if(t-=c-e.length(),f!==void 0&&f>t){if(s.strict){var p=Error(`Too few bytes to read ASN.1 value.`);throw p.available=e.length(),p.remaining=t,p.requested=f,p}f=t}var m,h,g=(l&32)==32;if(g)if(m=[],f===void 0)for(;;){if(i(e,t,2),e.bytes(2)===`\0\0`){e.getBytes(2),t-=2;break}c=e.length(),m.push(o(e,t,n+1,s)),t-=c-e.length()}else for(;f>0;)c=e.length(),m.push(o(e,f,n+1,s)),t-=c-e.length(),f-=c-e.length();if(m===void 0&&u===r.Class.UNIVERSAL&&d===r.Type.BITSTRING&&(h=e.bytes(f)),m===void 0&&s.decodeBitStrings&&u===r.Class.UNIVERSAL&&d===r.Type.BITSTRING&&f>1){var _=e.read,v=t,y=0;if(d===r.Type.BITSTRING&&(i(e,t,1),y=e.getByte(),t--),y===0)try{c=e.length();var b=o(e,t,n+1,{strict:!0,decodeBitStrings:!0}),x=c-e.length();t-=x,d==r.Type.BITSTRING&&x++;var S=b.tagClass;x===f&&(S===r.Class.UNIVERSAL||S===r.Class.CONTEXT_SPECIFIC)&&(m=[b])}catch{}m===void 0&&(e.read=_,t=v)}if(m===void 0){if(f===void 0){if(s.strict)throw Error(`Non-constructed ASN.1 object of indefinite length.`);f=t}if(d===r.Type.BMPSTRING)for(m=``;f>0;f-=2)i(e,t,2),m+=String.fromCharCode(e.getInt16()),t-=2;else m=e.getBytes(f),t-=f}var C=h===void 0?null:{bitStringContents:h};return r.create(u,d,g,m,C)}r.toDer=function(e){var t=n.util.createBuffer(),i=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if(`bitStringContents`in e&&(o=!0,e.original&&(o=r.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?i|=32:a.putByte(0);for(var s=0;s<e.value.length;++s)e.value[s]!==void 0&&a.putBuffer(r.toDer(e.value[s]))}else if(e.type===r.Type.BMPSTRING)for(var s=0;s<e.value.length;++s)a.putInt16(e.value.charCodeAt(s));else e.type===r.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)==128)?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(i),a.length()<=127)t.putByte(a.length()&127);else{var c=a.length(),l=``;do l+=String.fromCharCode(c&255),c>>>=8;while(c>0);t.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)t.putByte(l.charCodeAt(s))}return t.putBuffer(a),t},r.oidToDer=function(e){var t=e.split(`.`),r=n.util.createBuffer();r.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var i,a,o,s,c=2;c<t.length;++c){if(i=!0,a=[],o=parseInt(t[c],10),o>4294967295)throw Error(`OID value too large; max is 32-bits.`);do s=o&127,o>>>=7,i||(s|=128),a.push(s),i=!1;while(o>0);for(var l=a.length-1;l>=0;--l)r.putByte(a[l])}return r},r.derToOid=function(e){var t;typeof e==`string`&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+`.`+r%40;for(var i=0;e.length()>0;){if(i>70368744177663)throw Error(`OID value too large; max is 53-bits.`);r=e.getByte(),i*=128,r&128?i+=r&127:(t+=`.`+(i+r),i=0)}return t},r.utcTimeToDate=function(e){var t=new Date,n=parseInt(e.substr(0,2),10);n=n>=50?1900+n:2e3+n;var r=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var c=e.charAt(10),l=10;c!==`+`&&c!==`-`&&(s=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(n,r,i),t.setUTCHours(a,o,s,0),l&&(c=e.charAt(l),c===`+`||c===`-`)){var u=parseInt(e.substr(l+1,2),10),d=parseInt(e.substr(l+4,2),10),f=u*60+d;f*=6e4,c===`+`?t.setTime(+t-f):t.setTime(+t+f)}return t},r.generalizedTimeToDate=function(e){var t=new Date,n=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),c=0,l=0,u=!1;e.charAt(e.length-1)===`Z`&&(u=!0);var d=e.length-5,f=e.charAt(d);if(f===`+`||f===`-`){var p=parseInt(e.substr(d+1,2),10),m=parseInt(e.substr(d+4,2),10);l=p*60+m,l*=6e4,f===`+`&&(l*=-1),u=!0}return e.charAt(14)===`.`&&(c=parseFloat(e.substr(14),10)*1e3),u?(t.setUTCFullYear(n,r,i),t.setUTCHours(a,o,s,c),t.setTime(+t+l)):(t.setFullYear(n,r,i),t.setHours(a,o,s,c)),t},r.dateToUtcTime=function(e){if(typeof e==`string`)return e;var t=``,n=[];n.push((``+e.getUTCFullYear()).substr(2)),n.push(``+(e.getUTCMonth()+1)),n.push(``+e.getUTCDate()),n.push(``+e.getUTCHours()),n.push(``+e.getUTCMinutes()),n.push(``+e.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(t+=`0`),t+=n[r];return t+=`Z`,t},r.dateToGeneralizedTime=function(e){if(typeof e==`string`)return e;var t=``,n=[];n.push(``+e.getUTCFullYear()),n.push(``+(e.getUTCMonth()+1)),n.push(``+e.getUTCDate()),n.push(``+e.getUTCHours()),n.push(``+e.getUTCMinutes()),n.push(``+e.getUTCSeconds());for(var r=0;r<n.length;++r)n[r].length<2&&(t+=`0`),t+=n[r];return t+=`Z`,t},r.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=Error(`Integer too large; max is 32-bits.`);throw r.integer=e,r},r.derToInteger=function(e){typeof e==`string`&&(e=n.util.createBuffer(e));var t=e.length()*8;if(t>32)throw Error(`Integer too large; max is 32-bits.`);return e.getSignedInt(t)},r.validate=function(e,t,i,a){var o=!1;if((e.tagClass===t.tagClass||t.tagClass===void 0)&&(e.type===t.type||t.type===void 0))if(e.constructed===t.constructed||t.constructed===void 0){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,c=0;o&&c<t.value.length;++c){var l=t.value[c];o=!!l.optional;var u=e.value[s];if(!u){l.optional||(o=!1,a&&a.push(`[`+t.name+`] Missing required element. Expected tag class "`+l.tagClass+`", type "`+l.type+`"`));continue}if(l.tagClass!==void 0&&l.type!==void 0&&(u.tagClass!==l.tagClass||u.type!==l.type))if(l.optional){o=!0;continue}else{o=!1,a&&a.push(`[`+t.name+`] Tag mismatch. Expected (`+l.tagClass+`,`+l.type+`), got (`+u.tagClass+`,`+u.type+`)`);break}if(r.validate(u,l,i,a))++s,o=!0;else if(l.optional)o=!0;else{o=!1;break}}if(o&&i&&(t.capture&&(i[t.capture]=e.value),t.captureAsn1&&(i[t.captureAsn1]=e),t.captureBitStringContents&&`bitStringContents`in e&&(i[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&`bitStringContents`in e))if(e.bitStringContents.length<2)i[t.captureBitStringValue]=``;else{if(e.bitStringContents.charCodeAt(0)!==0)throw Error(`captureBitStringValue only supported for zero unused bits`);i[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push(`[`+t.name+`] Expected constructed "`+t.constructed+`", got "`+e.constructed+`"`);else a&&(e.tagClass!==t.tagClass&&a.push(`[`+t.name+`] Expected tag class "`+t.tagClass+`", got "`+e.tagClass+`"`),e.type!==t.type&&a.push(`[`+t.name+`] Expected type "`+t.type+`", got "`+e.type+`"`));return o};var s=/[^\\u0000-\\u00ff]/;r.prettyPrint=function(e,t,i){var a=``;t=t||0,i=i||2,t>0&&(a+=`
|
|
12
|
+
`);for(var o=``,c=0;c<t*i;++c)o+=` `;switch(a+=o+`Tag: `,e.tagClass){case r.Class.UNIVERSAL:a+=`Universal:`;break;case r.Class.APPLICATION:a+=`Application:`;break;case r.Class.CONTEXT_SPECIFIC:a+=`Context-Specific:`;break;case r.Class.PRIVATE:a+=`Private:`;break}if(e.tagClass===r.Class.UNIVERSAL)switch(a+=e.type,e.type){case r.Type.NONE:a+=` (None)`;break;case r.Type.BOOLEAN:a+=` (Boolean)`;break;case r.Type.INTEGER:a+=` (Integer)`;break;case r.Type.BITSTRING:a+=` (Bit string)`;break;case r.Type.OCTETSTRING:a+=` (Octet string)`;break;case r.Type.NULL:a+=` (Null)`;break;case r.Type.OID:a+=` (Object Identifier)`;break;case r.Type.ODESC:a+=` (Object Descriptor)`;break;case r.Type.EXTERNAL:a+=` (External or Instance of)`;break;case r.Type.REAL:a+=` (Real)`;break;case r.Type.ENUMERATED:a+=` (Enumerated)`;break;case r.Type.EMBEDDED:a+=` (Embedded PDV)`;break;case r.Type.UTF8:a+=` (UTF8)`;break;case r.Type.ROID:a+=` (Relative Object Identifier)`;break;case r.Type.SEQUENCE:a+=` (Sequence)`;break;case r.Type.SET:a+=` (Set)`;break;case r.Type.PRINTABLESTRING:a+=` (Printable String)`;break;case r.Type.IA5String:a+=` (IA5String (ASCII))`;break;case r.Type.UTCTIME:a+=` (UTC time)`;break;case r.Type.GENERALIZEDTIME:a+=` (Generalized time)`;break;case r.Type.BMPSTRING:a+=` (BMP String)`;break}else a+=e.type;if(a+=`
|
|
13
|
+
`,a+=o+`Constructed: `+e.constructed+`
|
|
14
|
+
`,e.composed){for(var l=0,u=``,c=0;c<e.value.length;++c)e.value[c]!==void 0&&(l+=1,u+=r.prettyPrint(e.value[c],t+1,i),c+1<e.value.length&&(u+=`,`));a+=o+`Sub values: `+l+u}else{if(a+=o+`Value: `,e.type===r.Type.OID){var d=r.derToOid(e.value);a+=d,n.pki&&n.pki.oids&&d in n.pki.oids&&(a+=` (`+n.pki.oids[d]+`) `)}if(e.type===r.Type.INTEGER)try{a+=r.derToInteger(e.value)}catch{a+=`0x`+n.util.bytesToHex(e.value)}else if(e.type===r.Type.BITSTRING){if(e.value.length>1?a+=`0x`+n.util.bytesToHex(e.value.slice(1)):a+=`(none)`,e.value.length>0){var f=e.value.charCodeAt(0);f==1?a+=` (1 unused bit shown)`:f>1&&(a+=` (`+f+` unused bits shown)`)}}else if(e.type===r.Type.OCTETSTRING)s.test(e.value)||(a+=`(`+e.value+`) `),a+=`0x`+n.util.bytesToHex(e.value);else if(e.type===r.Type.UTF8)try{a+=n.util.decodeUtf8(e.value)}catch(t){if(t.message===`URI malformed`)a+=`0x`+n.util.bytesToHex(e.value)+` (malformed UTF8)`;else throw t}else e.type===r.Type.PRINTABLESTRING||e.type===r.Type.IA5String?a+=e.value:s.test(e.value)?a+=`0x`+n.util.bytesToHex(e.value):e.value.length===0?a+=`[null]`:a+=e.value}return a}})),he=r(((e,t)=>{var n=Z();t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}})),ge=r(((e,t)=>{var n=Z();he(),Q();var r=t.exports=n.hmac=n.hmac||{};r.create=function(){var e=null,t=null,r=null,i=null,a={};return a.start=function(a,o){if(a!==null)if(typeof a==`string`)if(a=a.toLowerCase(),a in n.md.algorithms)t=n.md.algorithms[a].create();else throw Error(`Unknown hash algorithm "`+a+`"`);else t=a;if(o===null)o=e;else{if(typeof o==`string`)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var c=0;c<s.length;++c)o.putByte(s[c])}var l=o.length();l>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),l=o.length();for(var c=0;c<l;++c){var s=o.at(c);r.putByte(54^s),i.putByte(92^s)}if(l<t.blockLength)for(var s=t.blockLength-l,c=0;c<s;++c)r.putByte(54),i.putByte(92);e=o,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},a.update=function(e){t.update(e)},a.getMac=function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()},a.digest=a.getMac,a}})),_e=r(((e,t)=>{var n=Z();he(),Q();var r=t.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=r,r.create=function(){c||l();var e=null,t=n.util.createBuffer(),r=Array(16),a={algorithm:`md5`,blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return a.start=function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var r=a.messageLengthSize/4,i=0;i<r;++i)a.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},a},a.start(),a.update=function(i,o){o===`utf8`&&(i=n.util.encodeUtf8(i));var s=i.length;a.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=s[1],s[1]=s[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),u(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),a},a.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;o.putBytes(i.substr(0,a.blockLength-s));for(var c,l=0,d=a.fullMessageLength.length-1;d>=0;--d)c=a.fullMessageLength[d]*8+l,l=c/4294967296>>>0,o.putInt32Le(c>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};u(f,r,o);var p=n.util.createBuffer();return p.putInt32Le(f.h0),p.putInt32Le(f.h1),p.putInt32Le(f.h2),p.putInt32Le(f.h3),p},a};var i=null,a=null,o=null,s=null,c=!1;function l(){i=``,i+=n.util.fillString(`\0`,64),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],s=Array(64);for(var e=0;e<64;++e)s[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);c=!0}function u(e,t,n){for(var r,i,c,l,u,d,f,p,m=n.length();m>=64;){for(i=e.h0,c=e.h1,l=e.h2,u=e.h3,p=0;p<16;++p)t[p]=n.getInt32Le(),d=u^c&(l^u),r=i+d+s[p]+t[p],f=o[p],i=u,u=l,l=c,c+=r<<f|r>>>32-f;for(;p<32;++p)d=l^u&(c^l),r=i+d+s[p]+t[a[p]],f=o[p],i=u,u=l,l=c,c+=r<<f|r>>>32-f;for(;p<48;++p)d=c^l^u,r=i+d+s[p]+t[a[p]],f=o[p],i=u,u=l,l=c,c+=r<<f|r>>>32-f;for(;p<64;++p)d=l^(c|~u),r=i+d+s[p]+t[a[p]],f=o[p],i=u,u=l,l=c,c+=r<<f|r>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+c|0,e.h2=e.h2+l|0,e.h3=e.h3+u|0,m-=64}}})),ve=r(((e,t)=>{var n=Z();Q();var r=t.exports=n.pem=n.pem||{};r.encode=function(e,t){t=t||{};var r=`-----BEGIN `+e.type+`-----\r
|
|
15
|
+
`,a;if(e.procType&&(a={name:`Proc-Type`,values:[String(e.procType.version),e.procType.type]},r+=i(a)),e.contentDomain&&(a={name:`Content-Domain`,values:[e.contentDomain]},r+=i(a)),e.dekInfo&&(a={name:`DEK-Info`,values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&a.values.push(e.dekInfo.parameters),r+=i(a)),e.headers)for(var o=0;o<e.headers.length;++o)r+=i(e.headers[o]);return e.procType&&(r+=`\r
|
|
16
|
+
`),r+=n.util.encode64(e.body,t.maxline||64)+`\r
|
|
17
|
+
`,r+=`-----END `+e.type+`-----\r
|
|
18
|
+
`,r},r.decode=function(e){for(var t=[],r=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,i=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/,s;s=r.exec(e),s;){var c=s[1];c===`NEW CERTIFICATE REQUEST`&&(c=`CERTIFICATE REQUEST`);var l={type:c,procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(s[3])};if(t.push(l),s[2]){for(var u=s[2].split(o),d=0;s&&d<u.length;){for(var f=u[d].replace(/\s+$/,``),p=d+1;p<u.length;++p){var m=u[p];if(!/\s/.test(m[0]))break;f+=m,d=p}if(s=f.match(i),s){for(var h={name:s[1],values:[]},g=s[2].split(`,`),_=0;_<g.length;++_)h.values.push(a(g[_]));if(!l.procType){if(h.name!==`Proc-Type`)throw Error(`Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".`);if(h.values.length!==2)throw Error(`Invalid PEM formatted message. The "Proc-Type" header must have two subfields.`);l.procType={version:g[0],type:g[1]}}else if(!l.contentDomain&&h.name===`Content-Domain`)l.contentDomain=g[0]||``;else if(!l.dekInfo&&h.name===`DEK-Info`){if(h.values.length===0)throw Error(`Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.`);l.dekInfo={algorithm:g[0],parameters:g[1]||null}}else l.headers.push(h)}++d}if(l.procType===`ENCRYPTED`&&!l.dekInfo)throw Error(`Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".`)}}if(t.length===0)throw Error(`Invalid PEM formatted message.`);return t};function i(e){for(var t=e.name+`: `,n=[],r=function(e,t){return` `+t},i=0;i<e.values.length;++i)n.push(e.values[i].replace(/^(\S+\r\n)/,r));t+=n.join(`,`)+`\r
|
|
19
|
+
`;for(var a=0,o=-1,i=0;i<t.length;++i,++a)if(a>65&&o!==-1){var s=t[o];s===`,`?(++o,t=t.substr(0,o)+`\r
|
|
20
|
+
`+t.substr(o)):t=t.substr(0,o)+`\r
|
|
21
|
+
`+s+t.substr(o+1),a=i-o-1,o=-1,++i}else (t[i]===` `||t[i]===` `||t[i]===`,`)&&(o=i);return t}function a(e){return e.replace(/^\s+/,``)}})),ye=r(((e,t)=>{var n=Z();ue(),de(),Q(),t.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,n,r){var i=m({key:e,output:n,decrypt:!1,mode:r||(t===null?`ECB`:`CBC`)});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return m({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,n,r){var i=m({key:e,output:n,decrypt:!0,mode:r||(t===null?`ECB`:`CBC`)});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return m({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var n=this;n.name=e,n.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return p(n._keys,e,t,!1)},decrypt:function(e,t){return p(n._keys,e,t,!0)}}}),n._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(this.name.indexOf(`3DES`)===0&&t.length()!==24)throw Error(`Invalid Triple-DES key size: `+t.length()*8);this._keys=f(t),this._init=!0}},r(`DES-ECB`,n.cipher.modes.ecb),r(`DES-CBC`,n.cipher.modes.cbc),r(`DES-CFB`,n.cipher.modes.cfb),r(`DES-OFB`,n.cipher.modes.ofb),r(`DES-CTR`,n.cipher.modes.ctr),r(`3DES-ECB`,n.cipher.modes.ecb),r(`3DES-CBC`,n.cipher.modes.cbc),r(`3DES-CFB`,n.cipher.modes.cfb),r(`3DES-OFB`,n.cipher.modes.ofb),r(`3DES-CTR`,n.cipher.modes.ctr);function r(e,t){n.cipher.registerAlgorithm(e,function(){return new n.des.Algorithm(e,t)})}var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],s=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],u=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function f(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],s=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],h=e.length()>8?3:1,g=[],_=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,y,b=0;b<h;b++){var x=e.getInt32(),S=e.getInt32();y=(x>>>4^S)&252645135,S^=y,x^=y<<4,y=(S>>>-16^x)&65535,x^=y,S^=y<<-16,y=(x>>>2^S)&858993459,S^=y,x^=y<<2,y=(S>>>-16^x)&65535,x^=y,S^=y<<-16,y=(x>>>1^S)&1431655765,S^=y,x^=y<<1,y=(S>>>8^x)&16711935,x^=y,S^=y<<8,y=(x>>>1^S)&1431655765,S^=y,x^=y<<1,y=x<<8|S>>>20&240,x=S<<24|S<<8&16711680|S>>>8&65280|S>>>24&240,S=y;for(var C=0;C<_.length;++C){_[C]?(x=x<<2|x>>>26,S=S<<2|S>>>26):(x=x<<1|x>>>27,S=S<<1|S>>>27),x&=-15,S&=-15;var w=t[x>>>28]|n[x>>>24&15]|r[x>>>20&15]|i[x>>>16&15]|a[x>>>12&15]|o[x>>>8&15]|s[x>>>4&15],T=c[S>>>28]|l[S>>>24&15]|u[S>>>20&15]|d[S>>>16&15]|f[S>>>12&15]|p[S>>>8&15]|m[S>>>4&15];y=(T>>>16^w)&65535,g[v++]=w^y,g[v++]=T^y<<16}}return g}function p(e,t,n,r){var f=e.length===32?3:9,p=f===3?r?[30,-2,-2]:[0,32,2]:r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2],m,h=t[0],g=t[1];m=(h>>>4^g)&252645135,g^=m,h^=m<<4,m=(h>>>16^g)&65535,g^=m,h^=m<<16,m=(g>>>2^h)&858993459,h^=m,g^=m<<2,m=(g>>>8^h)&16711935,h^=m,g^=m<<8,m=(h>>>1^g)&1431655765,g^=m,h^=m<<1,h=h<<1|h>>>31,g=g<<1|g>>>31;for(var _=0;_<f;_+=3){for(var v=p[_+1],y=p[_+2],b=p[_];b!=v;b+=y){var x=g^e[b],S=(g>>>4|g<<28)^e[b+1];m=h,h=g,g=m^(a[x>>>24&63]|s[x>>>16&63]|l[x>>>8&63]|d[x&63]|i[S>>>24&63]|o[S>>>16&63]|c[S>>>8&63]|u[S&63])}m=h,h=g,g=m}h=h>>>1|h<<31,g=g>>>1|g<<31,m=(h>>>1^g)&1431655765,g^=m,h^=m<<1,m=(g>>>8^h)&16711935,h^=m,g^=m<<8,m=(g>>>2^h)&858993459,h^=m,g^=m<<2,m=(h>>>16^g)&65535,g^=m,h^=m<<16,m=(h>>>4^g)&252645135,g^=m,h^=m<<4,n[0]=h,n[1]=g}function m(e){e=e||{};var t=`DES-`+(e.mode||`CBC`).toUpperCase(),r=e.decrypt?n.cipher.createDecipher(t,e.key):n.cipher.createCipher(t,e.key),i=r.start;return r.start=function(e,t){var a=null;t instanceof n.util.ByteBuffer&&(a=t,t={}),t=t||{},t.output=a,t.iv=e,i.call(r,t)},r}})),be=r(((t,n)=>{var r=Z();ge(),he(),Q();var i=r.pkcs5=r.pkcs5||{},a;r.util.isNodejs&&!r.options.usePureJavaScript&&(a=e(`crypto`)),n.exports=r.pbkdf2=i.pbkdf2=function(e,t,n,i,o,s){if(typeof o==`function`&&(s=o,o=null),r.util.isNodejs&&!r.options.usePureJavaScript&&a.pbkdf2&&(typeof o!=`object`||!o)&&(a.pbkdf2Sync.length>4||!o||o===`sha1`))return typeof o!=`string`&&(o=`sha1`),e=Buffer.from(e,`binary`),t=Buffer.from(t,`binary`),s?a.pbkdf2Sync.length===4?a.pbkdf2(e,t,n,i,function(e,t){if(e)return s(e);s(null,t.toString(`binary`))}):a.pbkdf2(e,t,n,i,o,function(e,t){if(e)return s(e);s(null,t.toString(`binary`))}):a.pbkdf2Sync.length===4?a.pbkdf2Sync(e,t,n,i).toString(`binary`):a.pbkdf2Sync(e,t,n,i,o).toString(`binary`);if(o??(o=`sha1`),typeof o==`string`){if(!(o in r.md.algorithms))throw Error(`Unknown hash algorithm: `+o);o=r.md[o].create()}var c=o.digestLength;if(i>4294967295*c){var l=Error(`Derived key is too long.`);if(s)return s(l);throw l}var u=Math.ceil(i/c),d=i-(u-1)*c,f=r.hmac.create();f.start(o,e);var p=``,m,h,g;if(!s){for(var _=1;_<=u;++_){f.start(null,null),f.update(t),f.update(r.util.int32ToBytes(_)),m=g=f.digest().getBytes();for(var v=2;v<=n;++v)f.start(null,null),f.update(g),h=f.digest().getBytes(),m=r.util.xorBytes(m,h,c),g=h;p+=_<u?m:m.substr(0,d)}return p}var _=1,v;function y(){if(_>u)return s(null,p);f.start(null,null),f.update(t),f.update(r.util.int32ToBytes(_)),m=g=f.digest().getBytes(),v=2,b()}function b(){if(v<=n)return f.start(null,null),f.update(g),h=f.digest().getBytes(),m=r.util.xorBytes(m,h,c),g=h,++v,r.util.setImmediate(b);p+=_<u?m:m.substr(0,d),++_,y()}y()}})),xe=r(((e,t)=>{var n=Z();he(),Q();var r=t.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=r,r.create=function(){a||s();var e=null,t=n.util.createBuffer(),r=Array(64),o={algorithm:`sha256`,blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,i=0;i<r;++i)o.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},o},o.start(),o.update=function(i,a){a===`utf8`&&(i=n.util.encodeUtf8(i));var s=i.length;o.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var l=o.fullMessageLength.length-1;l>=0;--l)o.fullMessageLength[l]+=s[1],s[1]=s[0]+(o.fullMessageLength[l]/4294967296>>>0),o.fullMessageLength[l]=o.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-s));for(var l,u,d=o.fullMessageLength[0]*8,f=0;f<o.fullMessageLength.length-1;++f)l=o.fullMessageLength[f+1]*8,u=l/4294967296>>>0,d+=u,a.putInt32(d>>>0),d=l>>>0;a.putInt32(d);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(p,r,a);var m=n.util.createBuffer();return m.putInt32(p.h0),m.putInt32(p.h1),m.putInt32(p.h2),m.putInt32(p.h3),m.putInt32(p.h4),m.putInt32(p.h5),m.putInt32(p.h6),m.putInt32(p.h7),m},o};var i=null,a=!1,o=null;function s(){i=``,i+=n.util.fillString(`\0`,64),o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0}function c(e,t,n){for(var r,i,a,s,c,l,u,d,f,p,m,h,g,_,v,y=n.length();y>=64;){for(u=0;u<16;++u)t[u]=n.getInt32();for(;u<64;++u)r=t[u-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=t[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=r+t[u-7]+i+t[u-16]|0;for(d=e.h0,f=e.h1,p=e.h2,m=e.h3,h=e.h4,g=e.h5,_=e.h6,v=e.h7,u=0;u<64;++u)s=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),c=_^h&(g^_),a=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),l=d&f|p&(d^f),r=v+s+c+o[u]+t[u],i=a+l,v=_,_=g,g=h,h=m+r>>>0,m=p,p=f,f=d,d=r+i>>>0;e.h0=e.h0+d|0,e.h1=e.h1+f|0,e.h2=e.h2+p|0,e.h3=e.h3+m|0,e.h4=e.h4+h|0,e.h5=e.h5+g|0,e.h6=e.h6+_|0,e.h7=e.h7+v|0,y-=64}}})),Se=r(((t,n)=>{var r=Z();Q();var i=null;r.util.isNodejs&&!r.options.usePureJavaScript&&!process.versions[`node-webkit`]&&(i=e(`crypto`));var a=n.exports=r.prng=r.prng||{};a.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:``},n=e.md,a=Array(32),o=0;o<32;++o)a[o]=n.create();t.pools=a,t.pool=0,t.generate=function(e,n){if(!n)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,c=t.plugin.formatSeed,l=r.util.createBuffer();t.key=null,u();function u(d){if(d)return n(d);if(l.length()>=e)return n(null,l.getBytes(e));if(t.generated>1048575&&(t.key=null),t.key===null)return r.util.nextTick(function(){s(u)});var f=i(t.key,t.seed);t.generated+=f.length,l.putBytes(f),t.key=o(i(t.key,a(t.seed))),t.seed=c(i(t.key,t.seed)),r.util.setImmediate(u)}},t.generateSync=function(e){var n=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var s=r.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),t.key===null&&c();var l=n(t.key,t.seed);t.generated+=l.length,s.putBytes(l),t.key=a(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed))}return s.getBytes(e)};function s(e){if(t.pools[0].messageLength>=32)return l(),e();var n=32-t.pools[0].messageLength<<5;t.seedFile(n,function(n,r){if(n)return e(n);t.collect(r),l(),e()})}function c(){if(t.pools[0].messageLength>=32)return l();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),l()}function l(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var n=1,r=0;r<32;++r)t.reseeds%n===0&&(e.update(t.pools[r].digest().getBytes()),t.pools[r].start()),n<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function u(e){var t=null,n=r.util.globalScope,i=n.crypto||n.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=r.util.createBuffer();if(t)for(;a.length()<e;){var o=Math.max(1,Math.min(e-a.length(),65536)/4),s=new Uint32Array(Math.floor(o));try{t(s);for(var c=0;c<s.length;++c)a.putInt32(s[c])}catch(e){if(!(typeof QuotaExceededError<`u`&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var l,u,d,f=Math.floor(Math.random()*65536);a.length()<e;){u=16807*(f&65535),l=16807*(f>>16),u+=(l&32767)<<16,u+=l>>15,u=(u&2147483647)+(u>>31),f=u&4294967295;for(var c=0;c<3;++c)d=f>>>(c<<3),d^=Math.floor(Math.random()*256),a.putByte(d&255)}return a.getBytes(e)}return i?(t.seedFile=function(e,t){i.randomBytes(e,function(e,n){if(e)return t(e);t(null,n.toString())})},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var n=e.length,r=0;r<n;++r)t.pools[t.pool].update(e.substr(r,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(e,n){for(var r=``,i=0;i<n;i+=8)r+=String.fromCharCode(e>>i&255);t.collect(r)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){function n(e){var r=e.data;r.forge&&r.forge.prng&&(self.removeEventListener(`message`,n),t(r.forge.prng.err,r.forge.prng.bytes))}self.addEventListener(`message`,n),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener(`message`,function(n){var r=n.data;r.forge&&r.forge.prng&&t.seedFile(r.forge.prng.needed,function(t,n){e.postMessage({forge:{prng:{err:t,bytes:n}}})})})},t}})),Ce=r(((e,t)=>{var n=Z();fe(),xe(),Se(),Q(),(function(){if(n.random&&n.random.getBytes){t.exports=n.random;return}(function(e){var r={},i=[,,,,],a=n.util.createBuffer();r.formatKey=function(e){var t=n.util.createBuffer(e);return e=[,,,,],e[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return e=[,,,,],e[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;function o(){var e=n.prng.create(r);return e.getBytes=function(t,n){return e.generate(t,n)},e.getBytesSync=function(t){return e.generate(t)},e}var s=o(),c=null,l=n.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=function(e){return u.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!c){if(typeof window>`u`||window.document,s.collectInt(+new Date,32),typeof navigator<`u`){var d=``;for(var f in navigator)try{typeof navigator[f]==`string`&&(d+=navigator[f])}catch{}s.collect(d),d=null}e&&(e().mousemove(function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)}),e().keypress(function(e){s.collectInt(e.charCode,8)}))}if(!n.random)n.random=s;else for(var f in s)n.random[f]=s[f];n.random.createInstance=o,t.exports=n.random})(typeof jQuery<`u`?jQuery:null)})()})),we=r(((e,t)=>{var n=Z();Q();var r=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],a=function(e,t){return e<<t&65535|(e&65535)>>16-t},o=function(e,t){return(e&65535)>>t|e<<16-t&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){typeof e==`string`&&(e=n.util.createBuffer(e)),t=t||128;var i=e,a=e.length(),o=t,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=a;l<128;l++)i.putByte(r[i.at(l-1)+i.at(l-a)&255]);for(i.setAt(128-s,r[i.at(128-s)&c]),l=127-s;l>=0;l--)i.setAt(l,r[i.at(l+1)^i.at(l+s)]);return i};var s=function(e,t,r){var s=!1,c=null,l=null,u=null,d,f,p,m,h=[];for(e=n.rc2.expandKey(e,t),p=0;p<64;p++)h.push(e.getInt16Le());r?(d=function(e){for(p=0;p<4;p++)e[p]+=h[m]+(e[(p+3)%4]&e[(p+2)%4])+(~e[(p+3)%4]&e[(p+1)%4]),e[p]=a(e[p],i[p]),m++},f=function(e){for(p=0;p<4;p++)e[p]+=h[e[(p+3)%4]&63]}):(d=function(e){for(p=3;p>=0;p--)e[p]=o(e[p],i[p]),e[p]-=h[m]+(e[(p+3)%4]&e[(p+2)%4])+(~e[(p+3)%4]&e[(p+1)%4]),m--},f=function(e){for(p=3;p>=0;p--)e[p]-=h[e[(p+3)%4]&63]});var g=function(e){var t=[];for(p=0;p<4;p++){var n=c.getInt16Le();u!==null&&(r?n^=u.getInt16Le():u.putInt16Le(n)),t.push(n&65535)}m=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(p=0;p<4;p++)u!==null&&(r?u.putInt16Le(t[p]):t[p]^=u.getInt16Le()),l.putInt16Le(t[p])},_=null;return _={start:function(e,t){e&&typeof e==`string`&&(e=n.util.createBuffer(e)),s=!1,c=n.util.createBuffer(),l=t||new n.util.createBuffer,u=e,_.output=l},update:function(e){for(s||c.putBuffer(e);c.length()>=8;)g([[5,d],[1,f],[6,d],[1,f],[5,d]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,c,!r);else{var n=c.length()===8?8:8-c.length();c.fillWithByte(n,n)}if(t&&(s=!0,_.update()),!r&&(t=c.length()===0,t))if(e)t=e(8,l,!r);else{var i=l.length(),a=l.at(i-1);a>i?t=!1:l.truncate(a)}return t}},_};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return s(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return s(e,t,!1)}})),Te=r(((e,t)=>{var n=Z();t.exports=n.jsbn=n.jsbn||{};var r,i=!0;function a(e,t,n){this.data=[],e!=null&&(typeof e==`number`?this.fromNumber(e,t,n):t==null&&typeof e!=`string`?this.fromString(e,256):this.fromString(e,t))}n.jsbn.BigInteger=a;function o(){return new a(null)}function s(e,t,n,r,i,a){for(;--a>=0;){var o=t*this.data[e++]+n.data[r]+i;i=Math.floor(o/67108864),n.data[r++]=o&67108863}return i}function c(e,t,n,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var c=this.data[e]&32767,l=this.data[e++]>>15,u=s*c+l*o;c=o*c+((u&32767)<<15)+n.data[r]+(i&1073741823),i=(c>>>30)+(u>>>15)+s*l+(i>>>30),n.data[r++]=c&1073741823}return i}function l(e,t,n,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var c=this.data[e]&16383,l=this.data[e++]>>14,u=s*c+l*o;c=o*c+((u&16383)<<14)+n.data[r]+i,i=(c>>28)+(u>>14)+s*l,n.data[r++]=c&268435455}return i}typeof navigator>`u`?(a.prototype.am=l,r=28):i&&navigator.appName==`Microsoft Internet Explorer`?(a.prototype.am=c,r=30):i&&navigator.appName!=`Netscape`?(a.prototype.am=s,r=26):(a.prototype.am=l,r=28),a.prototype.DB=r,a.prototype.DM=(1<<r)-1,a.prototype.DV=1<<r;var u=52;a.prototype.FV=2**u,a.prototype.F1=u-r,a.prototype.F2=2*r-u;var d=`0123456789abcdefghijklmnopqrstuvwxyz`,f=[],p=48,m;for(m=0;m<=9;++m)f[p++]=m;for(p=97,m=10;m<36;++m)f[p++]=m;for(p=65,m=10;m<36;++m)f[p++]=m;function h(e){return d.charAt(e)}function g(e,t){return f[e.charCodeAt(t)]??-1}function _(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function v(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function y(e){var t=o();return t.fromInt(e),t}function b(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var s=n==8?e[r]&255:g(e,r);if(s<0){e.charAt(r)==`-`&&(i=!0);continue}i=!1,o==0?this.data[this.t++]=s:o+n>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this.data[this.t++]=s>>this.DB-o):this.data[this.t-1]|=s<<o,o+=n,o>=this.DB&&(o-=this.DB)}n==8&&e[0]&128&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&a.ZERO.subTo(this,this)}function x(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function S(e){if(this.s<0)return`-`+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=!1,a=``,o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=h(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=h(r));return i?a:`0`}function C(){var e=o();return a.ZERO.subTo(this,e),e}function w(){return this.s<0?this.negate():this}function T(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this.data[n]-e.data[n])!=0)return t;return 0}function E(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}function D(){return this.t<=0?0:this.DB*(this.t-1)+E(this.data[this.t-1]^this.s&this.DM)}function O(e,t){var n;for(n=this.t-1;n>=0;--n)t.data[n+e]=this.data[n];for(n=e-1;n>=0;--n)t.data[n]=0;t.t=this.t+e,t.s=this.s}function k(e,t){for(var n=e;n<this.t;++n)t.data[n-e]=this.data[n];t.t=Math.max(this.t-e,0),t.s=this.s}function A(e,t){var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>r|o,o=(this.data[s]&i)<<n;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function j(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB,i=this.DB-r,a=(1<<r)-1;t.data[0]=this.data[n]>>r;for(var o=n+1;o<this.t;++o)t.data[o-n-1]|=(this.data[o]&a)<<i,t.data[o-n]=this.data[o]>>r;r>0&&(t.data[this.t-n-1]|=(this.s&a)<<i),t.t=this.t-n,t.clamp()}function M(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]-e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[n++]=this.DV+r:r>0&&(t.data[n++]=r),t.t=n,t.clamp()}function N(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+n.t]=n.am(0,r.data[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&a.ZERO.subTo(t,t)}function P(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e.data[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t.data[n],e,2*n,0,1);(e.data[n+t.t]+=t.am(n+1,2*t.data[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e.data[n+t.t]-=t.DV,e.data[n+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(n,t.data[n],e,2*n,0,1)),e.s=0,e.clamp()}function ee(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t?.fromInt(0),n!=null&&this.copyTo(n);return}n??(n=o());var s=o(),c=this.s,l=e.s,u=this.DB-E(r.data[r.t-1]);u>0?(r.lShiftTo(u,s),i.lShiftTo(u,n)):(r.copyTo(s),i.copyTo(n));var d=s.t,f=s.data[d-1];if(f!=0){var p=f*(1<<this.F1)+(d>1?s.data[d-2]>>this.F2:0),m=this.FV/p,h=(1<<this.F1)/p,g=1<<this.F2,_=n.t,v=_-d,y=t??o();for(s.dlShiftTo(v,y),n.compareTo(y)>=0&&(n.data[n.t++]=1,n.subTo(y,n)),a.ONE.dlShiftTo(d,y),y.subTo(s,s);s.t<d;)s.data[s.t++]=0;for(;--v>=0;){var b=n.data[--_]==f?this.DM:Math.floor(n.data[_]*m+(n.data[_-1]+g)*h);if((n.data[_]+=s.am(0,b,n,v,0,d))<b)for(s.dlShiftTo(v,y),n.subTo(y,n);n.data[_]<--b;)n.subTo(y,n)}t!=null&&(n.drShiftTo(d,t),c!=l&&a.ZERO.subTo(t,t)),n.t=d,n.clamp(),u>0&&n.rShiftTo(u,n),c<0&&a.ZERO.subTo(n,n)}}}function F(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t}function I(e){this.m=e}function L(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function R(e){return e}function z(e){e.divRemTo(this.m,null,e)}function B(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function V(e,t){e.squareTo(t),this.reduce(t)}I.prototype.convert=L,I.prototype.revert=R,I.prototype.reduce=z,I.prototype.mulTo=B,I.prototype.sqrTo=V;function H(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function U(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function W(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t}function G(e){var t=o();return e.copyTo(t),this.reduce(t),t}function K(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e.data[t]&32767,r=n*this.mpl+((n*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e.data[n]+=this.m.am(0,r,e,t,0,this.m.t);e.data[n]>=e.DV;)e.data[n]-=e.DV,e.data[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function q(e,t){e.squareTo(t),this.reduce(t)}function J(e,t,n){e.multiplyTo(t,n),this.reduce(n)}U.prototype.convert=W,U.prototype.revert=G,U.prototype.reduce=K,U.prototype.mulTo=J,U.prototype.sqrTo=q;function Y(){return(this.t>0?this.data[0]&1:this.s)==0}function X(e,t){if(e>4294967295||e<1)return a.ONE;var n=o(),r=o(),i=t.convert(this),s=E(e)-1;for(i.copyTo(n);--s>=0;)if(t.sqrTo(n,r),(e&1<<s)>0)t.mulTo(r,i,n);else{var c=n;n=r,r=c}return t.revert(n)}function te(e,t){var n=e<256||t.isEven()?new I(t):new U(t);return this.exp(e,n)}a.prototype.copyTo=_,a.prototype.fromInt=v,a.prototype.fromString=b,a.prototype.clamp=x,a.prototype.dlShiftTo=O,a.prototype.drShiftTo=k,a.prototype.lShiftTo=A,a.prototype.rShiftTo=j,a.prototype.subTo=M,a.prototype.multiplyTo=N,a.prototype.squareTo=P,a.prototype.divRemTo=ee,a.prototype.invDigit=H,a.prototype.isEven=Y,a.prototype.exp=X,a.prototype.toString=S,a.prototype.negate=C,a.prototype.abs=w,a.prototype.compareTo=T,a.prototype.bitLength=D,a.prototype.mod=F,a.prototype.modPowInt=te,a.ZERO=y(0),a.ONE=y(1);function ne(){var e=o();return this.copyTo(e),e}function re(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else if(this.t==1)return this.data[0];else if(this.t==0)return 0;return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function ie(){return this.t==0?this.s:this.data[0]<<24>>24}function ae(){return this.t==0?this.s:this.data[0]<<16>>16}function oe(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function se(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function ce(e){if(e??(e=10),this.signum()==0||e<2||e>36)return`0`;var t=this.chunkSize(e),n=e**+t,r=y(n),i=o(),a=o(),s=``;for(this.divRemTo(r,i,a);i.signum()>0;)s=(n+a.intValue()).toString(e).substr(1)+s,i.divRemTo(r,i,a);return a.intValue().toString(e)+s}function le(e,t){this.fromInt(0),t??(t=10);for(var n=this.chunkSize(t),r=t**+n,i=!1,o=0,s=0,c=0;c<e.length;++c){var l=g(e,c);if(l<0){e.charAt(c)==`-`&&this.signum()==0&&(i=!0);continue}s=t*s+l,++o>=n&&(this.dMultiply(r),this.dAddOffset(s,0),o=0,s=0)}o>0&&(this.dMultiply(t**+o),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)}function Q(e,t,n){if(typeof t==`number`)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),_e,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var r=[],i=e&7;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function ue(){var e=this.t,t=[];t[0]=this.s;var n=this.DB-e*this.DB%8,r,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),r&128&&(r|=-256),i==0&&(this.s&128)!=(r&128)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function de(e){return this.compareTo(e)==0}function fe(e){return this.compareTo(e)<0?this:e}function pe(e){return this.compareTo(e)>0?this:e}function me(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n.data[r]=t(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;r<e.t;++r)n.data[r]=t(i,e.data[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}function he(e,t){return e&t}function ge(e){var t=o();return this.bitwiseTo(e,he,t),t}function _e(e,t){return e|t}function ve(e){var t=o();return this.bitwiseTo(e,_e,t),t}function ye(e,t){return e^t}function be(e){var t=o();return this.bitwiseTo(e,ye,t),t}function xe(e,t){return e&~t}function Se(e){var t=o();return this.bitwiseTo(e,xe,t),t}function Ce(){for(var e=o(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function we(e){var t=o();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function Te(e){var t=o();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Ee(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function De(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+Ee(this.data[e]);return this.s<0?this.t*this.DB:-1}function Oe(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function ke(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=Oe(this.data[n]^t);return e}function Ae(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function je(e,t){var n=a.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}function Me(e){return this.changeBit(e,_e)}function Ne(e){return this.changeBit(e,xe)}function Pe(e){return this.changeBit(e,ye)}function Fe(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]+e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[n++]=r:r<-1&&(t.data[n++]=this.DV+r),t.t=n,t.clamp()}function Ie(e){var t=o();return this.addTo(e,t),t}function Le(e){var t=o();return this.subTo(e,t),t}function Re(e){var t=o();return this.multiplyTo(e,t),t}function ze(){var e=o();return this.squareTo(e),e}function Be(e){var t=o();return this.divRemTo(e,t,null),t}function Ve(e){var t=o();return this.divRemTo(e,null,t),t}function He(e){var t=o(),n=o();return this.divRemTo(e,t,n),[t,n]}function Ue(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function We(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function Ge(){}function Ke(e){return e}function qe(e,t,n){e.multiplyTo(t,n)}function Je(e,t){e.squareTo(t)}Ge.prototype.convert=Ke,Ge.prototype.revert=Ke,Ge.prototype.mulTo=qe,Ge.prototype.sqrTo=Je;function Ye(e){return this.exp(e,new Ge)}function Xe(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n.data[--r]=0;var i;for(i=n.t-this.t;r<i;++r)n.data[r+this.t]=this.am(0,e.data[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e.data[r],n,r,0,t-r);n.clamp()}function Ze(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n.data[this.t+r-t]=this.am(t-r,e.data[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}function Qe(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function $e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t}function et(e){return e}function tt(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function nt(e,t){e.squareTo(t),this.reduce(t)}function rt(e,t,n){e.multiplyTo(t,n),this.reduce(n)}Qe.prototype.convert=$e,Qe.prototype.revert=et,Qe.prototype.reduce=tt,Qe.prototype.mulTo=rt,Qe.prototype.sqrTo=nt;function it(e,t){var n=e.bitLength(),r,i=y(1),a;if(n<=0)return i;r=n<18?1:n<48?3:n<144?4:n<768?5:6,a=n<8?new I(t):t.isEven()?new Qe(t):new U(t);var s=[],c=3,l=r-1,u=(1<<r)-1;if(s[1]=a.convert(this),r>1){var d=o();for(a.sqrTo(s[1],d);c<=u;)s[c]=o(),a.mulTo(d,s[c-2],s[c]),c+=2}var f=e.t-1,p,m=!0,h=o(),g;for(n=E(e.data[f])-1;f>=0;){for(n>=l?p=e.data[f]>>n-l&u:(p=(e.data[f]&(1<<n+1)-1)<<l-n,f>0&&(p|=e.data[f-1]>>this.DB+n-l)),c=r;!(p&1);)p>>=1,--c;if((n-=c)<0&&(n+=this.DB,--f),m)s[p].copyTo(i),m=!1;else{for(;c>1;)a.sqrTo(i,h),a.sqrTo(h,i),c-=2;c>0?a.sqrTo(i,h):(g=i,i=h,h=g),a.mulTo(h,s[p],i)}for(;f>=0&&!(e.data[f]&1<<n);)a.sqrTo(i,h),g=i,i=h,h=g,--n<0&&(n=this.DB-1,--f)}return a.revert(i)}function at(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return a>0&&n.lShiftTo(a,n),n}function ot(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this.data[r])%e;return n}function st(e){if(this.signum()==0)return a.ZERO;var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return a.ZERO;for(var n=e.clone(),r=this.clone(),i=y(1),o=y(0),s=y(0),c=y(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!c.isEven())&&(s.addTo(this,s),c.subTo(e,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(s,i),o.subTo(c,o)):(r.subTo(n,r),t&&s.subTo(i,s),c.subTo(o,c))}if(r.compareTo(a.ONE)!=0)return a.ZERO;if(c.compareTo(e)>=0)return c.subtract(e);if(c.signum()<0)c.addTo(e,c);else return c;return c.signum()<0?c.add(e):c}var $=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ct=(1<<26)/$[$.length-1];function lt(e){var t,n=this.abs();if(n.t==1&&n.data[0]<=$[$.length-1]){for(t=0;t<$.length;++t)if(n.data[0]==$[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<$.length;){for(var r=$[t],i=t+1;i<$.length&&r<ct;)r*=$[i++];for(r=n.modInt(r);t<i;)if(r%$[t++]==0)return!1}return n.millerRabin(e)}function ut(e){var t=this.subtract(a.ONE),n=t.getLowestSetBit();if(n<=0)return!1;for(var r=t.shiftRight(n),i=dt(),o,s=0;s<e;++s){do o=new a(this.bitLength(),i);while(o.compareTo(a.ONE)<=0||o.compareTo(t)>=0);var c=o.modPow(r,this);if(c.compareTo(a.ONE)!=0&&c.compareTo(t)!=0){for(var l=1;l++<n&&c.compareTo(t)!=0;)if(c=c.modPowInt(2,this),c.compareTo(a.ONE)==0)return!1;if(c.compareTo(t)!=0)return!1}}return!0}function dt(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}a.prototype.chunkSize=oe,a.prototype.toRadix=ce,a.prototype.fromRadix=le,a.prototype.fromNumber=Q,a.prototype.bitwiseTo=me,a.prototype.changeBit=je,a.prototype.addTo=Fe,a.prototype.dMultiply=Ue,a.prototype.dAddOffset=We,a.prototype.multiplyLowerTo=Xe,a.prototype.multiplyUpperTo=Ze,a.prototype.modInt=ot,a.prototype.millerRabin=ut,a.prototype.clone=ne,a.prototype.intValue=re,a.prototype.byteValue=ie,a.prototype.shortValue=ae,a.prototype.signum=se,a.prototype.toByteArray=ue,a.prototype.equals=de,a.prototype.min=fe,a.prototype.max=pe,a.prototype.and=ge,a.prototype.or=ve,a.prototype.xor=be,a.prototype.andNot=Se,a.prototype.not=Ce,a.prototype.shiftLeft=we,a.prototype.shiftRight=Te,a.prototype.getLowestSetBit=De,a.prototype.bitCount=ke,a.prototype.testBit=Ae,a.prototype.setBit=Me,a.prototype.clearBit=Ne,a.prototype.flipBit=Pe,a.prototype.add=Ie,a.prototype.subtract=Le,a.prototype.multiply=Re,a.prototype.divide=Be,a.prototype.remainder=Ve,a.prototype.divideAndRemainder=He,a.prototype.modPow=it,a.prototype.modInverse=st,a.prototype.pow=Ye,a.prototype.gcd=at,a.prototype.isProbablePrime=lt,a.prototype.square=ze})),Ee=r(((e,t)=>{var n=Z();he(),Q();var r=t.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=r,r.create=function(){a||o();var e=null,t=n.util.createBuffer(),r=Array(80),c={algorithm:`sha1`,blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return c.start=function(){c.messageLength=0,c.fullMessageLength=c.messageLength64=[];for(var r=c.messageLengthSize/4,i=0;i<r;++i)c.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},c},c.start(),c.update=function(i,a){a===`utf8`&&(i=n.util.encodeUtf8(i));var o=i.length;c.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var l=c.fullMessageLength.length-1;l>=0;--l)c.fullMessageLength[l]+=o[1],o[1]=o[0]+(c.fullMessageLength[l]/4294967296>>>0),c.fullMessageLength[l]=c.fullMessageLength[l]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),s(e,r,t),(t.read>2048||t.length()===0)&&t.compact(),c},c.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var o=c.fullMessageLength[c.fullMessageLength.length-1]+c.messageLengthSize&c.blockLength-1;a.putBytes(i.substr(0,c.blockLength-o));for(var l,u,d=c.fullMessageLength[0]*8,f=0;f<c.fullMessageLength.length-1;++f)l=c.fullMessageLength[f+1]*8,u=l/4294967296>>>0,d+=u,a.putInt32(d>>>0),d=l>>>0;a.putInt32(d);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(p,r,a);var m=n.util.createBuffer();return m.putInt32(p.h0),m.putInt32(p.h1),m.putInt32(p.h2),m.putInt32(p.h3),m.putInt32(p.h4),m},c};var i=null,a=!1;function o(){i=``,i+=n.util.fillString(`\0`,64),a=!0}function s(e,t,n){for(var r,i,a,o,s,c,l,u,d=n.length();d>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,c=e.h4,u=0;u<16;++u)r=n.getInt32(),t[u]=r,l=s^a&(o^s),r=(i<<5|i>>>27)+l+c+1518500249+r,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;u<20;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=s^a&(o^s),r=(i<<5|i>>>27)+l+c+1518500249+r,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;u<32;++u)r=t[u-3]^t[u-8]^t[u-14]^t[u-16],r=r<<1|r>>>31,t[u]=r,l=a^o^s,r=(i<<5|i>>>27)+l+c+1859775393+r,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;u<40;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=a^o^s,r=(i<<5|i>>>27)+l+c+1859775393+r,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;u<60;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=a&o|s&(a^o),r=(i<<5|i>>>27)+l+c+2400959708+r,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;u<80;++u)r=t[u-6]^t[u-16]^t[u-28]^t[u-32],r=r<<2|r>>>30,t[u]=r,l=a^o^s,r=(i<<5|i>>>27)+l+c+3395469782+r,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+c|0,d-=64}}})),De=r(((e,t)=>{var n=Z();Q(),Ce(),Ee();var r=t.exports=n.pkcs1=n.pkcs1||{};r.encode_rsa_oaep=function(e,t,r){var a,o,s,c;typeof r==`string`?(a=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(a=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),c||(c=s);var l=Math.ceil(e.n.bitLength()/8),u=l-2*s.digestLength-2;if(t.length>u){var d=Error(`RSAES-OAEP input message length is too long.`);throw d.length=t.length,d.maxLength=u,d}a||(a=``),s.update(a,`raw`);for(var f=s.digest(),p=``,m=u-t.length,h=0;h<m;h++)p+=`\0`;var g=f.getBytes()+p+``+t;if(!o)o=n.random.getBytes(s.digestLength);else if(o.length!==s.digestLength){var d=Error(`Invalid RSAES-OAEP seed. The seed length must match the digest length.`);throw d.seedLength=o.length,d.digestLength=s.digestLength,d}var _=i(o,l-s.digestLength-1,c),v=n.util.xorBytes(g,_,g.length),y=i(v,s.digestLength,c);return`\0`+n.util.xorBytes(o,y,o.length)+v},r.decode_rsa_oaep=function(e,t,r){var a,o,s;typeof r==`string`?(a=r,o=arguments[3]||void 0):r&&(a=r.label||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var c=Math.ceil(e.n.bitLength()/8);if(t.length!==c){var l=Error(`RSAES-OAEP encoded message length is invalid.`);throw l.length=t.length,l.expectedLength=c,l}if(o===void 0?o=n.md.sha1.create():o.start(),s||(s=o),c<2*o.digestLength+2)throw Error(`RSAES-OAEP key is too short for the hash function.`);a||(a=``),o.update(a,`raw`);for(var u=o.digest().getBytes(),d=t.charAt(0),f=t.substring(1,o.digestLength+1),p=t.substring(1+o.digestLength),m=i(p,o.digestLength,s),h=i(n.util.xorBytes(f,m,f.length),c-o.digestLength-1,s),g=n.util.xorBytes(p,h,p.length),_=g.substring(0,o.digestLength),l=d!==`\0`,v=0;v<o.digestLength;++v)l|=u.charAt(v)!==_.charAt(v);for(var y=1,b=o.digestLength,x=o.digestLength;x<g.length;x++){var S=g.charCodeAt(x),C=S&1^1;l|=S&(y?65534:0),y&=C,b+=y}if(l||g.charCodeAt(b)!==1)throw Error(`Invalid RSAES-OAEP padding.`);return g.substring(b+1)};function i(e,t,r){r||(r=n.md.sha1.create());for(var i=``,a=Math.ceil(t/r.digestLength),o=0;o<a;++o){var s=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,o&255);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}})),Oe=r(((e,t)=>{var n=Z();Q(),Te(),Ce(),(function(){if(n.prime){t.exports=n.prime;return}var e=t.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var o=function(e,t){return e|t};e.generateProbablePrime=function(e,t,r){typeof t==`function`&&(r=t,t={}),t=t||{};var i=t.algorithm||`PRIMEINC`;typeof i==`string`&&(i={name:i}),i.options=i.options||{};var a=t.prng||n.random,o={nextBytes:function(e){for(var t=a.getBytesSync(e.length),n=0;n<e.length;++n)e[n]=t.charCodeAt(n)}};if(i.name===`PRIMEINC`)return s(e,o,i.options,r);throw Error(`Invalid prime generation algorithm: `+i.name)};function s(e,t,n,r){return`workers`in n?u(e,t,n,r):c(e,t,n,r)}function c(e,t,n,r){var i=d(e,t),a=0,o=f(i.bitLength());`millerRabinTests`in n&&(o=n.millerRabinTests);var s=10;`maxBlockTime`in n&&(s=n.maxBlockTime),l(i,e,t,a,o,s,r)}function l(e,t,r,a,o,s,c){var u=+new Date;do{if(e.bitLength()>t&&(e=d(t,r)),e.isProbablePrime(o))return c(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-u<s);n.util.setImmediate(function(){l(e,t,r,a,o,s,c)})}function u(e,t,i,a){if(typeof Worker>`u`)return c(e,t,i,a);var o=d(e,t),s=i.workers,l=i.workLoad||100,u=l*30/8,f=i.workerScript||`forge/prime.worker.js`;if(s===-1)return n.util.estimateCores(function(e,t){e&&(t=2),s=t-1,p()});p();function p(){s=Math.max(1,s);for(var n=[],i=0;i<s;++i)n[i]=new Worker(f);for(var c=s,i=0;i<s;++i)n[i].addEventListener(`message`,m);var p=!1;function m(i){if(!p){--c;var s=i.data;if(s.found){for(var f=0;f<n.length;++f)n[f].terminate();return p=!0,a(null,new r(s.prime,16))}o.bitLength()>e&&(o=d(e,t));var m=o.toString(16);i.target.postMessage({hex:m,workLoad:l}),o.dAddOffset(u,0)}}}}function d(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),o,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}function f(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}})()})),ke=r(((t,n)=>{var r=Z();if(me(),Te(),pe(),De(),Oe(),Ce(),Q(),i===void 0)var i=r.jsbn.BigInteger;var a=r.util.isNodejs?e(`crypto`):null,o=r.asn1,s=r.util;r.pki=r.pki||{},n.exports=r.pki.rsa=r.rsa=r.rsa||{};var c=r.pki,l=[6,4,2,4,2,4,6,2],u={name:`PrivateKeyInfo`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`PrivateKeyInfo.version`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyVersion`},{name:`PrivateKeyInfo.privateKeyAlgorithm`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`AlgorithmIdentifier.algorithm`,tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:`privateKeyOid`}]},{name:`PrivateKeyInfo`,tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:`privateKey`}]},d={name:`RSAPrivateKey`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`RSAPrivateKey.version`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyVersion`},{name:`RSAPrivateKey.modulus`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyModulus`},{name:`RSAPrivateKey.publicExponent`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyPublicExponent`},{name:`RSAPrivateKey.privateExponent`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyPrivateExponent`},{name:`RSAPrivateKey.prime1`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyPrime1`},{name:`RSAPrivateKey.prime2`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyPrime2`},{name:`RSAPrivateKey.exponent1`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyExponent1`},{name:`RSAPrivateKey.exponent2`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyExponent2`},{name:`RSAPrivateKey.coefficient`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`privateKeyCoefficient`}]},f={name:`RSAPublicKey`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`RSAPublicKey.modulus`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`publicKeyModulus`},{name:`RSAPublicKey.exponent`,tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:`publicKeyExponent`}]},p=r.pki.rsa.publicKeyValidator={name:`SubjectPublicKeyInfo`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:`subjectPublicKeyInfo`,value:[{name:`SubjectPublicKeyInfo.AlgorithmIdentifier`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`AlgorithmIdentifier.algorithm`,tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:`publicKeyOid`}]},{name:`SubjectPublicKeyInfo.subjectPublicKey`,tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:`SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:`rsaPublicKey`}]}]},m={name:`DigestInfo`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`DigestInfo.DigestAlgorithm`,tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:`DigestInfo.DigestAlgorithm.algorithmIdentifier`,tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:`algorithmIdentifier`},{name:`DigestInfo.DigestAlgorithm.parameters`,tagClass:o.Class.UNIVERSAL,type:o.Type.NULL,capture:`parameters`,optional:!0,constructed:!1}]},{name:`DigestInfo.digest`,tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:`digest`}]},h=function(e){var t;if(e.algorithm in c.oids)t=c.oids[e.algorithm];else{var n=Error(`Unknown message digest algorithm.`);throw n.algorithm=e.algorithm,n}var r=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,r)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,``));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},g=function(e,t,n){if(n)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var a;do a=new i(r.util.bytesToHex(r.random.getBytes(t.n.bitLength()/8)),16);while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));e=e.multiply(a.modPow(t.e,t.n)).mod(t.n);for(var o=e.mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var c=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return c=c.multiply(a.modInverse(t.n)).mod(t.n),c};c.rsa.encrypt=function(e,t,n){var a=n,o,s=Math.ceil(t.n.bitLength()/8);n!==!1&&n!==!0?(a=n===2,o=_(e,t,n)):(o=r.util.createBuffer(),o.putBytes(e));for(var c=g(new i(o.toHex(),16),t,a).toString(16),l=r.util.createBuffer(),u=s-Math.ceil(c.length/2);u>0;)l.putByte(0),--u;return l.putBytes(r.util.hexToBytes(c)),l.getBytes()},c.rsa.decrypt=function(e,t,n,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=Error(`Encrypted message length is invalid.`);throw s.length=e.length,s.expected=o,s}var c=new i(r.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw Error(`Encrypted message is invalid.`);for(var l=g(c,t,n).toString(16),u=r.util.createBuffer(),d=o-Math.ceil(l.length/2);d>0;)u.putByte(0),--d;return u.putBytes(r.util.hexToBytes(l)),a===!1?u.getBytes():v(u.getBytes(),t,n)},c.rsa.createKeyPairGenerationState=function(e,t,n){typeof e==`string`&&(e=parseInt(e,10)),e=e||2048,n=n||{};var a=n.prng||r.random,o={nextBytes:function(e){for(var t=a.getBytesSync(e.length),n=0;n<e.length;++n)e[n]=t.charCodeAt(n)}},s=n.algorithm||`PRIMEINC`,c;if(s===`PRIMEINC`)c={algorithm:s,state:0,bits:e,rng:o,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw Error(`Invalid key generation algorithm: `+s);return c},c.rsa.stepKeyPairGenerationState=function(e,t){`algorithm`in e||(e.algorithm=`PRIMEINC`);var n=new i(null);n.fromInt(30);for(var r=0,a=function(e,t){return e|t},o=+new Date,s,u=0;e.keys===null&&(t<=0||u<t);){if(e.state===0){var d=e.p===null?e.pBits:e.qBits,f=d-1;e.pqState===0?(e.num=new i(d,e.rng),e.num.testBit(f)||e.num.bitwiseTo(i.ONE.shiftLeft(f),a,e.num),e.num.dAddOffset(31-e.num.mod(n).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>d?e.pqState=0:e.num.isProbablePrime(x(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(l[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(i.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var p=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}s=+new Date,u+=s-o,o=s}return e.keys!==null},c.rsa.generateKeyPair=function(e,t,n,i){if(arguments.length===1?typeof e==`object`?(n=e,e=void 0):typeof e==`function`&&(i=e,e=void 0):arguments.length===2?typeof e==`number`?typeof t==`function`?(i=t,t=void 0):typeof t!=`number`&&(n=t,t=void 0):(n=e,i=t,e=void 0,t=void 0):arguments.length===3&&(typeof t==`number`?typeof n==`function`&&(i=n,n=void 0):(i=n,n=t,t=void 0)),n=n||{},e===void 0&&(e=n.bits||2048),t===void 0&&(t=n.e||65537),!r.options.usePureJavaScript&&!n.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(i){if(S(`generateKeyPair`))return a.generateKeyPair(`rsa`,{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:`spki`,format:`pem`},privateKeyEncoding:{type:`pkcs8`,format:`pem`}},function(e,t,n){if(e)return i(e);i(null,{privateKey:c.privateKeyFromPem(n),publicKey:c.publicKeyFromPem(t)})});if(C(`generateKey`)&&C(`exportKey`))return s.globalScope.crypto.subtle.generateKey({name:`RSASSA-PKCS1-v1_5`,modulusLength:e,publicExponent:T(t),hash:{name:`SHA-256`}},!0,[`sign`,`verify`]).then(function(e){return s.globalScope.crypto.subtle.exportKey(`pkcs8`,e.privateKey)}).then(void 0,function(e){i(e)}).then(function(e){if(e){var t=c.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(e)));i(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}});if(w(`generateKey`)&&w(`exportKey`)){var l=s.globalScope.msCrypto.subtle.generateKey({name:`RSASSA-PKCS1-v1_5`,modulusLength:e,publicExponent:T(t),hash:{name:`SHA-256`}},!0,[`sign`,`verify`]);l.oncomplete=function(e){var t=e.target.result,n=s.globalScope.msCrypto.subtle.exportKey(`pkcs8`,t.privateKey);n.oncomplete=function(e){var t=e.target.result,n=c.privateKeyFromAsn1(o.fromDer(r.util.createBuffer(t)));i(null,{privateKey:n,publicKey:c.setRsaPublicKey(n.n,n.e)})},n.onerror=function(e){i(e)}},l.onerror=function(e){i(e)};return}}else if(S(`generateKeyPairSync`)){var u=a.generateKeyPairSync(`rsa`,{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:`spki`,format:`pem`},privateKeyEncoding:{type:`pkcs8`,format:`pem`}});return{privateKey:c.privateKeyFromPem(u.privateKey),publicKey:c.publicKeyFromPem(u.publicKey)}}}var d=c.rsa.createKeyPairGenerationState(e,t,n);if(!i)return c.rsa.stepKeyPairGenerationState(d,0),d.keys;y(d,n,i)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var n={n:e,e:t};return n.encrypt=function(e,t,i){if(typeof t==`string`?t=t.toUpperCase():t===void 0&&(t=`RSAES-PKCS1-V1_5`),t===`RSAES-PKCS1-V1_5`)t={encode:function(e,t,n){return _(e,t,2).getBytes()}};else if(t===`RSA-OAEP`||t===`RSAES-OAEP`)t={encode:function(e,t){return r.pkcs1.encode_rsa_oaep(t,e,i)}};else if([`RAW`,`NONE`,`NULL`,null].indexOf(t)!==-1)t={encode:function(e){return e}};else if(typeof t==`string`)throw Error(`Unsupported encryption scheme: "`+t+`".`);var a=t.encode(e,n,!0);return c.rsa.encrypt(a,n,!0)},n.verify=function(e,t,i,a){typeof i==`string`?i=i.toUpperCase():i===void 0&&(i=`RSASSA-PKCS1-V1_5`),a===void 0&&(a={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),`_parseAllDigestBytes`in a||(a._parseAllDigestBytes=!0),`_skipPaddingChecks`in a||(a._skipPaddingChecks=!1),i===`RSASSA-PKCS1-V1_5`?i={verify:function(e,t){t=v(t,n,!0,void 0,a);var i=o.fromDer(t,{parseAllBytes:a._parseAllDigestBytes}),s={},c=[];if(!o.validate(i,m,s,c)||i.value.length!==2){var l=Error(`ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.`);throw l.errors=c,l}var u=o.derToOid(s.algorithmIdentifier);if(!(u===r.oids.md2||u===r.oids.md5||u===r.oids.sha1||u===r.oids.sha224||u===r.oids.sha256||u===r.oids.sha384||u===r.oids.sha512||u===r.oids[`sha512-224`]||u===r.oids[`sha512-256`])){var l=Error(`Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.`);throw l.oid=u,l}if((u===r.oids.md2||u===r.oids.md5)&&!(`parameters`in s))throw Error(`ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.`);return e===s.digest}}:(i===`NONE`||i===`NULL`||i===null)&&(i={verify:function(e,t){return t=v(t,n,!0,void 0,a),e===t}});var s=c.rsa.decrypt(t,n,!0,!1);return i.verify(e,s,n.n.bitLength())},n},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,n,i,a,o,s,l){var u={n:e,e:t,d:n,p:i,q:a,dP:o,dQ:s,qInv:l};return u.decrypt=function(e,t,n){typeof t==`string`?t=t.toUpperCase():t===void 0&&(t=`RSAES-PKCS1-V1_5`);var i=c.rsa.decrypt(e,u,!1,!1);if(t===`RSAES-PKCS1-V1_5`)t={decode:v};else if(t===`RSA-OAEP`||t===`RSAES-OAEP`)t={decode:function(e,t){return r.pkcs1.decode_rsa_oaep(t,e,n)}};else if([`RAW`,`NONE`,`NULL`,null].indexOf(t)!==-1)t={decode:function(e){return e}};else throw Error(`Unsupported encryption scheme: "`+t+`".`);return t.decode(i,u,!1)},u.sign=function(e,t){var n=!1;typeof t==`string`&&(t=t.toUpperCase()),t===void 0||t===`RSASSA-PKCS1-V1_5`?(t={encode:h},n=1):(t===`NONE`||t===`NULL`||t===null)&&(t={encode:function(){return e}},n=1);var r=t.encode(e,u.n.bitLength());return c.rsa.encrypt(r,u,n)},u},c.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(c.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,``)]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t={},n=[];if(o.validate(e,u,t,n)&&(e=o.fromDer(r.util.createBuffer(t.privateKey))),t={},n=[],!o.validate(e,d,t,n)){var a=Error(`Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.`);throw a.errors=n,a}var s=r.util.createBuffer(t.privateKeyModulus).toHex(),l=r.util.createBuffer(t.privateKeyPublicExponent).toHex(),f=r.util.createBuffer(t.privateKeyPrivateExponent).toHex(),p=r.util.createBuffer(t.privateKeyPrime1).toHex(),m=r.util.createBuffer(t.privateKeyPrime2).toHex(),h=r.util.createBuffer(t.privateKeyExponent1).toHex(),g=r.util.createBuffer(t.privateKeyExponent2).toHex(),_=r.util.createBuffer(t.privateKeyCoefficient).toHex();return c.setRsaPrivateKey(new i(s,16),new i(l,16),new i(f,16),new i(p,16),new i(m,16),new i(h,16),new i(g,16),new i(_,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},n=[];if(o.validate(e,p,t,n)){var a=o.derToOid(t.publicKeyOid);if(a!==c.oids.rsaEncryption){var s=Error(`Cannot read public key. Unknown OID.`);throw s.oid=a,s}e=t.rsaPublicKey}if(n=[],!o.validate(e,f,t,n)){var s=Error(`Cannot read public key. ASN.1 object does not contain an RSAPublicKey.`);throw s.errors=n,s}var l=r.util.createBuffer(t.publicKeyModulus).toHex(),u=r.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(l,16),new i(u,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(c.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,``)]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])};function _(e,t,n){var i=r.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=Error(`Message is too long for PKCS#1 v1.5 padding.`);throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(n);var s=a-3-e.length,c;if(n===0||n===1){c=n===0?0:255;for(var l=0;l<s;++l)i.putByte(c)}else for(;s>0;){for(var u=0,d=r.random.getBytes(s),l=0;l<s;++l)c=d.charCodeAt(l),c===0?++u:i.putByte(c);s=u}return i.putByte(0),i.putBytes(e),i}function v(e,t,n,i,a){var o=Math.ceil(t.n.bitLength()/8),s=r.util.createBuffer(e),c=s.getByte(),l=s.getByte();if(c!==0||n&&l!==0&&l!==1||!n&&l!==2||n&&l===0&&i===void 0)throw Error(`Encryption block is invalid.`);var u=0;if(l===0){u=o-3-i;for(var d=0;d<u;++d)if(s.getByte()!==0)throw Error(`Encryption block is invalid.`)}else if(l===1){for(u=0;s.length()>1;){if(s.getByte()!==255){--s.read;break}++u}if(u<8&&!(a&&a._skipPaddingChecks))throw Error(`Encryption block is invalid.`)}else if(l===2){for(u=0;s.length()>1;){if(s.getByte()===0){--s.read;break}++u}if(u<8&&!(a&&a._skipPaddingChecks))throw Error(`Encryption block is invalid.`)}if(s.getByte()!==0||u!==o-3-s.length())throw Error(`Encryption block is invalid.`);return s.getBytes()}function y(e,t,n){typeof t==`function`&&(n=t,t={}),t=t||{};var a={algorithm:{name:t.algorithm||`PRIMEINC`,options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};`prng`in t&&(a.prng=t.prng),o();function o(){s(e.pBits,function(t,r){if(t)return n(t);if(e.p=r,e.q!==null)return l(t,e.q);s(e.qBits,l)})}function s(e,t){r.prime.generateProbablePrime(e,a,t)}function l(t,r){if(t)return n(t);if(e.q=r,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)!==0){e.p=null,o();return}if(e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)!==0){e.q=null,s(e.qBits,l);return}if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(i.ONE)!==0){e.p=e.q=null,o();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,s(e.qBits,l);return}var u=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,u,e.p,e.q,u.mod(e.p1),u.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},n(null,e.keys)}}function b(e){var t=e.toString(16);t[0]>=`8`&&(t=`00`+t);var n=r.util.hexToBytes(t);return n.length>1&&(n.charCodeAt(0)===0&&!(n.charCodeAt(1)&128)||n.charCodeAt(0)===255&&(n.charCodeAt(1)&128)==128)?n.substr(1):n}function x(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return r.util.isNodejs&&typeof a[e]==`function`}function C(e){return s.globalScope!==void 0&&typeof s.globalScope.crypto==`object`&&typeof s.globalScope.crypto.subtle==`object`&&typeof s.globalScope.crypto.subtle[e]==`function`}function w(e){return s.globalScope!==void 0&&typeof s.globalScope.msCrypto==`object`&&typeof s.globalScope.msCrypto.subtle==`object`&&typeof s.globalScope.msCrypto.subtle[e]==`function`}function T(e){for(var t=r.util.hexToBytes(e.toString(16)),n=new Uint8Array(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}})),Ae=r(((e,t)=>{var n=Z();if(fe(),me(),ye(),he(),pe(),be(),ve(),Ce(),we(),ke(),Q(),r===void 0)var r=n.jsbn.BigInteger;var i=n.asn1,a=n.pki=n.pki||{};t.exports=a.pbe=n.pbe=n.pbe||{};var o=a.oids,s={name:`EncryptedPrivateKeyInfo`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`EncryptedPrivateKeyInfo.encryptionAlgorithm`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`AlgorithmIdentifier.algorithm`,tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:`encryptionOid`},{name:`AlgorithmIdentifier.parameters`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:`encryptionParams`}]},{name:`EncryptedPrivateKeyInfo.encryptedData`,tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:`encryptedData`}]},c={name:`PBES2Algorithms`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`PBES2Algorithms.keyDerivationFunc`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`PBES2Algorithms.keyDerivationFunc.oid`,tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:`kdfOid`},{name:`PBES2Algorithms.params`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`PBES2Algorithms.params.salt`,tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:`kdfSalt`},{name:`PBES2Algorithms.params.iterationCount`,tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:`kdfIterationCount`},{name:`PBES2Algorithms.params.keyLength`,tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:`keyLength`},{name:`PBES2Algorithms.params.prf`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:`PBES2Algorithms.params.prf.algorithm`,tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:`prfOid`}]}]}]},{name:`PBES2Algorithms.encryptionScheme`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`PBES2Algorithms.encryptionScheme.oid`,tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:`encOid`},{name:`PBES2Algorithms.encryptionScheme.iv`,tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:`encIv`}]}]},l={name:`pkcs-12PbeParams`,tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:`pkcs-12PbeParams.salt`,tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:`salt`},{name:`pkcs-12PbeParams.iterations`,tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:`iterations`}]};a.encryptPrivateKeyInfo=function(e,t,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||`aes128`,r.prfAlgorithm=r.prfAlgorithm||`sha1`;var s=n.random.getBytesSync(r.saltSize),c=r.count,l=i.integerToDer(c),u,d,m;if(r.algorithm.indexOf(`aes`)===0||r.algorithm===`des`){var h,g,_;switch(r.algorithm){case`aes128`:u=16,h=16,g=o[`aes128-CBC`],_=n.aes.createEncryptionCipher;break;case`aes192`:u=24,h=16,g=o[`aes192-CBC`],_=n.aes.createEncryptionCipher;break;case`aes256`:u=32,h=16,g=o[`aes256-CBC`],_=n.aes.createEncryptionCipher;break;case`des`:u=8,h=8,g=o.desCBC,_=n.des.createEncryptionCipher;break;default:var v=Error(`Cannot encrypt private key. Unknown encryption algorithm.`);throw v.algorithm=r.algorithm,v}var y=`hmacWith`+r.prfAlgorithm.toUpperCase(),b=f(y),x=n.pkcs5.pbkdf2(t,s,c,u,b),S=n.random.getBytesSync(h),C=_(x);C.start(S),C.update(i.toDer(e)),C.finish(),m=C.output.getBytes();var w=p(s,l,u,y);d=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.pkcs5PBES2).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.pkcs5PBKDF2).getBytes()),w]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(g).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,S)])])])}else if(r.algorithm===`3des`){u=24;var T=new n.util.ByteBuffer(s),x=a.pbe.generatePkcs12Key(t,T,1,c,u),S=a.pbe.generatePkcs12Key(t,T,2,c,u),C=n.des.createEncryptionCipher(x);C.start(S),C.update(i.toDer(e)),C.finish(),m=C.output.getBytes(),d=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o[`pbeWithSHAAnd3-KeyTripleDES-CBC`]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,s),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,l.getBytes())])])}else{var v=Error(`Cannot encrypt private key. Unknown encryption algorithm.`);throw v.algorithm=r.algorithm,v}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[d,i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,m)])},a.decryptPrivateKeyInfo=function(e,t){var r=null,o={},c=[];if(!i.validate(e,s,o,c)){var l=Error(`Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.`);throw l.errors=c,l}var u=i.derToOid(o.encryptionOid),d=a.pbe.getCipher(u,o.encryptionParams,t),f=n.util.createBuffer(o.encryptedData);return d.update(f),d.finish()&&(r=i.fromDer(d.output)),r},a.encryptedPrivateKeyToPem=function(e,t){var r={type:`ENCRYPTED PRIVATE KEY`,body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},a.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if(t.type!==`ENCRYPTED PRIVATE KEY`){var r=Error(`Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".`);throw r.headerType=t.type,r}if(t.procType&&t.procType.type===`ENCRYPTED`)throw Error(`Could not convert encrypted private key from PEM; PEM is encrypted.`);return i.fromDer(t.body)},a.encryptRsaPrivateKey=function(e,t,r){if(r=r||{},!r.legacy){var o=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));return o=a.encryptPrivateKeyInfo(o,t,r),a.encryptedPrivateKeyToPem(o)}var s,c,l,u;switch(r.algorithm){case`aes128`:s=`AES-128-CBC`,l=16,c=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case`aes192`:s=`AES-192-CBC`,l=24,c=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case`aes256`:s=`AES-256-CBC`,l=32,c=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case`3des`:s=`DES-EDE3-CBC`,l=24,c=n.random.getBytesSync(8),u=n.des.createEncryptionCipher;break;case`des`:s=`DES-CBC`,l=8,c=n.random.getBytesSync(8),u=n.des.createEncryptionCipher;break;default:var d=Error(`Could not encrypt RSA private key; unsupported encryption algorithm "`+r.algorithm+`".`);throw d.algorithm=r.algorithm,d}var f=n.pbe.opensslDeriveBytes(t,c.substr(0,8),l),p=u(f);p.start(c),p.update(i.toDer(a.privateKeyToAsn1(e))),p.finish();var m={type:`RSA PRIVATE KEY`,procType:{version:`4`,type:`ENCRYPTED`},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(c).toUpperCase()},body:p.output.getBytes()};return n.pem.encode(m)},a.decryptRsaPrivateKey=function(e,t){var r=null,o=n.pem.decode(e)[0];if(o.type!==`ENCRYPTED PRIVATE KEY`&&o.type!==`PRIVATE KEY`&&o.type!==`RSA PRIVATE KEY`){var s=Error(`Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".`);throw s.headerType=s,s}if(o.procType&&o.procType.type===`ENCRYPTED`){var c,l;switch(o.dekInfo.algorithm){case`DES-CBC`:c=8,l=n.des.createDecryptionCipher;break;case`DES-EDE3-CBC`:c=24,l=n.des.createDecryptionCipher;break;case`AES-128-CBC`:c=16,l=n.aes.createDecryptionCipher;break;case`AES-192-CBC`:c=24,l=n.aes.createDecryptionCipher;break;case`AES-256-CBC`:c=32,l=n.aes.createDecryptionCipher;break;case`RC2-40-CBC`:c=5,l=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case`RC2-64-CBC`:c=8,l=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case`RC2-128-CBC`:c=16,l=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var s=Error(`Could not decrypt private key; unsupported encryption algorithm "`+o.dekInfo.algorithm+`".`);throw s.algorithm=o.dekInfo.algorithm,s}var u=n.util.hexToBytes(o.dekInfo.parameters),d=n.pbe.opensslDeriveBytes(t,u.substr(0,8),c),f=l(d);if(f.start(u),f.update(n.util.createBuffer(o.body)),f.finish())r=f.output.getBytes();else return r}else r=o.body;return r=o.type===`ENCRYPTED PRIVATE KEY`?a.decryptPrivateKeyInfo(i.fromDer(r),t):i.fromDer(r),r!==null&&(r=a.privateKeyFromAsn1(r)),r},a.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,c;if(o==null){if(!(`sha1`in n.md))throw Error(`"sha1" hash algorithm unavailable.`);o=n.md.sha1.create()}var l=o.digestLength,u=o.blockLength,d=new n.util.ByteBuffer,f=new n.util.ByteBuffer;if(e!=null){for(c=0;c<e.length;c++)f.putInt16(e.charCodeAt(c));f.putInt16(0)}var p=f.length(),m=t.length(),h=new n.util.ByteBuffer;h.fillWithByte(r,u);var g=u*Math.ceil(m/u),_=new n.util.ByteBuffer;for(c=0;c<g;c++)_.putByte(t.at(c%m));var v=u*Math.ceil(p/u),y=new n.util.ByteBuffer;for(c=0;c<v;c++)y.putByte(f.at(c%p));var b=_;b.putBuffer(y);for(var x=Math.ceil(a/l),S=1;S<=x;S++){var C=new n.util.ByteBuffer;C.putBytes(h.bytes()),C.putBytes(b.bytes());for(var w=0;w<i;w++)o.start(),o.update(C.getBytes()),C=o.digest();var T=new n.util.ByteBuffer;for(c=0;c<u;c++)T.putByte(C.at(c%l));var E=Math.ceil(m/u)+Math.ceil(p/u),D=new n.util.ByteBuffer;for(s=0;s<E;s++){var O=new n.util.ByteBuffer(b.getBytes(u)),k=511;for(c=T.length()-1;c>=0;c--)k>>=8,k+=T.at(c)+O.at(c),O.setAt(c,k&255);D.putBuffer(O)}b=D,d.putBuffer(C)}return d.truncate(d.length()-a),d},a.pbe.getCipher=function(e,t,n){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,n);case a.oids[`pbeWithSHAAnd3-KeyTripleDES-CBC`]:case a.oids[`pbewithSHAAnd40BitRC2-CBC`]:return a.pbe.getCipherForPKCS12PBE(e,t,n);default:var r=Error(`Cannot read encrypted PBE data block. Unsupported OID.`);throw r.oid=e,r.supportedOids=[`pkcs5PBES2`,`pbeWithSHAAnd3-KeyTripleDES-CBC`,`pbewithSHAAnd40BitRC2-CBC`],r}},a.pbe.getCipherForPBES2=function(e,t,r){var o={},s=[];if(!i.validate(t,c,o,s)){var l=Error(`Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.`);throw l.errors=s,l}if(e=i.derToOid(o.kdfOid),e!==a.oids.pkcs5PBKDF2){var l=Error(`Cannot read encrypted private key. Unsupported key derivation function OID.`);throw l.oid=e,l.supportedOids=[`pkcs5PBKDF2`],l}if(e=i.derToOid(o.encOid),e!==a.oids[`aes128-CBC`]&&e!==a.oids[`aes192-CBC`]&&e!==a.oids[`aes256-CBC`]&&e!==a.oids[`des-EDE3-CBC`]&&e!==a.oids.desCBC){var l=Error(`Cannot read encrypted private key. Unsupported encryption scheme OID.`);throw l.oid=e,l.supportedOids=[`aes128-CBC`,`aes192-CBC`,`aes256-CBC`,`des-EDE3-CBC`,`desCBC`],l}var u=o.kdfSalt,f=n.util.createBuffer(o.kdfIterationCount);f=f.getInt(f.length()<<3);var p,m;switch(a.oids[e]){case`aes128-CBC`:p=16,m=n.aes.createDecryptionCipher;break;case`aes192-CBC`:p=24,m=n.aes.createDecryptionCipher;break;case`aes256-CBC`:p=32,m=n.aes.createDecryptionCipher;break;case`des-EDE3-CBC`:p=24,m=n.des.createDecryptionCipher;break;case`desCBC`:p=8,m=n.des.createDecryptionCipher;break}var h=d(o.prfOid),g=n.pkcs5.pbkdf2(r,u,f,p,h),_=o.encIv,v=m(g);return v.start(_),v},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var o={},s=[];if(!i.validate(t,l,o,s)){var c=Error(`Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.`);throw c.errors=s,c}var u=n.util.createBuffer(o.salt),f=n.util.createBuffer(o.iterations);f=f.getInt(f.length()<<3);var p,m,h;switch(e){case a.oids[`pbeWithSHAAnd3-KeyTripleDES-CBC`]:p=24,m=8,h=n.des.startDecrypting;break;case a.oids[`pbewithSHAAnd40BitRC2-CBC`]:p=5,m=8,h=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var c=Error(`Cannot read PKCS #12 PBE data block. Unsupported OID.`);throw c.oid=e,c}var g=d(o.prfOid),_=a.pbe.generatePkcs12Key(r,u,1,f,p,g);g.start();var v=a.pbe.generatePkcs12Key(r,u,2,f,m,g);return h(_,v)},a.pbe.opensslDeriveBytes=function(e,t,r,i){if(i==null){if(!(`md5`in n.md))throw Error(`"md5" hash algorithm unavailable.`);i=n.md.md5.create()}t===null&&(t=``);for(var a=[u(i,e+t)],o=16,s=1;o<r;++s,o+=16)a.push(u(i,a[s-1]+e+t));return a.join(``).substr(0,r)};function u(e,t){return e.start().update(t).digest().getBytes()}function d(e){var t;if(!e)t=`hmacWithSHA1`;else if(t=a.oids[i.derToOid(e)],!t){var n=Error(`Unsupported PRF OID.`);throw n.oid=e,n.supported=[`hmacWithSHA1`,`hmacWithSHA224`,`hmacWithSHA256`,`hmacWithSHA384`,`hmacWithSHA512`],n}return f(t)}function f(e){var t=n.md;switch(e){case`hmacWithSHA224`:t=n.md.sha512;case`hmacWithSHA1`:case`hmacWithSHA256`:case`hmacWithSHA384`:case`hmacWithSHA512`:e=e.substr(8).toLowerCase();break;default:var r=Error(`Unsupported PRF algorithm.`);throw r.algorithm=e,r.supported=[`hmacWithSHA1`,`hmacWithSHA224`,`hmacWithSHA256`,`hmacWithSHA384`,`hmacWithSHA512`],r}if(!t||!(e in t))throw Error(`Unknown hash algorithm: `+e);return t[e].create()}function p(e,t,r,o){var s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,t.getBytes())]);return o!==`hmacWithSHA1`&&s.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids[o]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,``)])),s}})),je=r(((e,t)=>{var n=Z();me(),Q();var r=n.asn1,i=t.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=i;var a={name:`ContentInfo`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`ContentInfo.ContentType`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`contentType`},{name:`ContentInfo.content`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:`content`}]};i.contentInfoValidator=a;var o={name:`EncryptedContentInfo`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`EncryptedContentInfo.contentType`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`contentType`},{name:`EncryptedContentInfo.contentEncryptionAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`EncryptedContentInfo.contentEncryptionAlgorithm.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`encAlgorithm`},{name:`EncryptedContentInfo.contentEncryptionAlgorithm.parameter`,tagClass:r.Class.UNIVERSAL,captureAsn1:`encParameter`}]},{name:`EncryptedContentInfo.encryptedContent`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,capture:`encryptedContent`,captureAsn1:`encryptedContentAsn1`}]};i.envelopedDataValidator={name:`EnvelopedData`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`EnvelopedData.Version`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`version`},{name:`EnvelopedData.RecipientInfos`,tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,captureAsn1:`recipientInfos`}].concat(o)},i.encryptedDataValidator={name:`EncryptedData`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`EncryptedData.Version`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`version`}].concat(o)};var s={name:`SignerInfo`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`SignerInfo.version`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1},{name:`SignerInfo.issuerAndSerialNumber`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`SignerInfo.issuerAndSerialNumber.issuer`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`issuer`},{name:`SignerInfo.issuerAndSerialNumber.serialNumber`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`serial`}]},{name:`SignerInfo.digestAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`SignerInfo.digestAlgorithm.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`digestAlgorithm`},{name:`SignerInfo.digestAlgorithm.parameter`,tagClass:r.Class.UNIVERSAL,constructed:!1,captureAsn1:`digestParameter`,optional:!0}]},{name:`SignerInfo.authenticatedAttributes`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:`authenticatedAttributes`},{name:`SignerInfo.digestEncryptionAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,capture:`signatureAlgorithm`},{name:`SignerInfo.encryptedDigest`,tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:`signature`},{name:`SignerInfo.unauthenticatedAttributes`,tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:`unauthenticatedAttributes`}]};i.signedDataValidator={name:`SignedData`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`SignedData.Version`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`version`},{name:`SignedData.DigestAlgorithms`,tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,captureAsn1:`digestAlgorithms`},a,{name:`SignedData.Certificates`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:`certificates`},{name:`SignedData.CertificateRevocationLists`,tagClass:r.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:`crls`},{name:`SignedData.SignerInfos`,tagClass:r.Class.UNIVERSAL,type:r.Type.SET,capture:`signerInfos`,optional:!0,value:[s]}]},i.recipientInfoValidator={name:`RecipientInfo`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`RecipientInfo.version`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`version`},{name:`RecipientInfo.issuerAndSerial`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`RecipientInfo.issuerAndSerial.issuer`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`issuer`},{name:`RecipientInfo.issuerAndSerial.serialNumber`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`serial`}]},{name:`RecipientInfo.keyEncryptionAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`RecipientInfo.keyEncryptionAlgorithm.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`encAlgorithm`},{name:`RecipientInfo.keyEncryptionAlgorithm.parameter`,tagClass:r.Class.UNIVERSAL,constructed:!1,captureAsn1:`encParameter`,optional:!0}]},{name:`RecipientInfo.encryptedKey`,tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:`encKey`}]}})),Me=r(((e,t)=>{var n=Z();Q(),n.mgf=n.mgf||{};var r=t.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{};r.create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new n.util.ByteBuffer;s.putInt32(o),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}})),Ne=r(((e,t)=>{var n=Z();Me(),t.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1})),Pe=r(((e,t)=>{var n=Z();Ce(),Q();var r=t.exports=n.pss=n.pss||{};r.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,r=e.mgf,i=t.digestLength,a=e.salt||null;typeof a==`string`&&(a=n.util.createBuffer(a));var o;if(`saltLength`in e)o=e.saltLength;else if(a!==null)o=a.length();else throw Error(`Salt length not specified or specific salt not given.`);if(a!==null&&a.length()!==o)throw Error(`Given salt length does not match length of given salt.`);var s=e.prng||n.random,c={};return c.encode=function(e,c){var l,u=c-1,d=Math.ceil(u/8),f=e.digest().getBytes();if(d<i+o+2)throw Error(`Message is too long to encrypt.`);var p=a===null?s.getBytesSync(o):a.bytes(),m=new n.util.ByteBuffer;m.fillWithByte(0,8),m.putBytes(f),m.putBytes(p),t.start(),t.update(m.getBytes());var h=t.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,d-o-i-2),g.putByte(1),g.putBytes(p);var _=g.getBytes(),v=d-i-1,y=r.generate(h,v),b=``;for(l=0;l<v;l++)b+=String.fromCharCode(_.charCodeAt(l)^y.charCodeAt(l));var x=65280>>8*d-u&255;return b=String.fromCharCode(b.charCodeAt(0)&~x)+b.substr(1),b+h+`¼`},c.verify=function(e,a,s){var c,l=s-1,u=Math.ceil(l/8);if(a=a.substr(-u),u<i+o+2)throw Error(`Inconsistent parameters to PSS signature verification.`);if(a.charCodeAt(u-1)!==188)throw Error(`Encoded message does not end in 0xBC.`);var d=u-i-1,f=a.substr(0,d),p=a.substr(d,i),m=65280>>8*u-l&255;if((f.charCodeAt(0)&m)!==0)throw Error(`Bits beyond keysize not zero as expected.`);var h=r.generate(p,d),g=``;for(c=0;c<d;c++)g+=String.fromCharCode(f.charCodeAt(c)^h.charCodeAt(c));g=String.fromCharCode(g.charCodeAt(0)&~m)+g.substr(1);var _=u-i-o-2;for(c=0;c<_;c++)if(g.charCodeAt(c)!==0)throw Error(`Leftmost octets not zero as expected`);if(g.charCodeAt(_)!==1)throw Error(`Inconsistent PSS signature, 0x01 marker not found`);var v=g.substr(-o),y=new n.util.ByteBuffer;return y.fillWithByte(0,8),y.putBytes(e),y.putBytes(v),t.start(),t.update(y.getBytes()),p===t.digest().getBytes()},c}})),Fe=r(((e,t)=>{var n=Z();fe(),me(),ye(),he(),Ne(),pe(),ve(),Pe(),ke(),Q();var r=n.asn1,i=t.exports=n.pki=n.pki||{},a=i.oids,o={};o.CN=a.commonName,o.commonName=`CN`,o.C=a.countryName,o.countryName=`C`,o.L=a.localityName,o.localityName=`L`,o.ST=a.stateOrProvinceName,o.stateOrProvinceName=`ST`,o.O=a.organizationName,o.organizationName=`O`,o.OU=a.organizationalUnitName,o.organizationalUnitName=`OU`,o.E=a.emailAddress,o.emailAddress=`E`;var s=n.pki.rsa.publicKeyValidator,c={name:`Certificate`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`Certificate.TBSCertificate`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`tbsCertificate`,value:[{name:`Certificate.TBSCertificate.version`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:`Certificate.TBSCertificate.version.integer`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`certVersion`}]},{name:`Certificate.TBSCertificate.serialNumber`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`certSerialNumber`},{name:`Certificate.TBSCertificate.signature`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`Certificate.TBSCertificate.signature.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`certinfoSignatureOid`},{name:`Certificate.TBSCertificate.signature.parameters`,tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:`certinfoSignatureParams`}]},{name:`Certificate.TBSCertificate.issuer`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`certIssuer`},{name:`Certificate.TBSCertificate.validity`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`Certificate.TBSCertificate.validity.notBefore (utc)`,tagClass:r.Class.UNIVERSAL,type:r.Type.UTCTIME,constructed:!1,optional:!0,capture:`certValidity1UTCTime`},{name:`Certificate.TBSCertificate.validity.notBefore (generalized)`,tagClass:r.Class.UNIVERSAL,type:r.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:`certValidity2GeneralizedTime`},{name:`Certificate.TBSCertificate.validity.notAfter (utc)`,tagClass:r.Class.UNIVERSAL,type:r.Type.UTCTIME,constructed:!1,optional:!0,capture:`certValidity3UTCTime`},{name:`Certificate.TBSCertificate.validity.notAfter (generalized)`,tagClass:r.Class.UNIVERSAL,type:r.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:`certValidity4GeneralizedTime`}]},{name:`Certificate.TBSCertificate.subject`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`certSubject`},s,{name:`Certificate.TBSCertificate.issuerUniqueID`,tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:`Certificate.TBSCertificate.issuerUniqueID.id`,tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:`certIssuerUniqueId`}]},{name:`Certificate.TBSCertificate.subjectUniqueID`,tagClass:r.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:`Certificate.TBSCertificate.subjectUniqueID.id`,tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:`certSubjectUniqueId`}]},{name:`Certificate.TBSCertificate.extensions`,tagClass:r.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:`certExtensions`,optional:!0}]},{name:`Certificate.signatureAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`Certificate.signatureAlgorithm.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`certSignatureOid`},{name:`Certificate.TBSCertificate.signature.parameters`,tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:`certSignatureParams`}]},{name:`Certificate.signatureValue`,tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:`certSignature`}]},l={name:`rsapss`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`rsapss.hashAlgorithm`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:`rsapss.hashAlgorithm.AlgorithmIdentifier`,tagClass:r.Class.UNIVERSAL,type:r.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:`rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`hashOid`}]}]},{name:`rsapss.maskGenAlgorithm`,tagClass:r.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:`rsapss.maskGenAlgorithm.AlgorithmIdentifier`,tagClass:r.Class.UNIVERSAL,type:r.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:`rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`maskGenOid`},{name:`rsapss.maskGenAlgorithm.AlgorithmIdentifier.params`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`maskGenHashOid`}]}]}]},{name:`rsapss.saltLength`,tagClass:r.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:`rsapss.saltLength.saltLength`,tagClass:r.Class.UNIVERSAL,type:r.Class.INTEGER,constructed:!1,capture:`saltLength`}]},{name:`rsapss.trailerField`,tagClass:r.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:`rsapss.trailer.trailer`,tagClass:r.Class.UNIVERSAL,type:r.Class.INTEGER,constructed:!1,capture:`trailer`}]}]},u={name:`CertificationRequestInfo`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`certificationRequestInfo`,value:[{name:`CertificationRequestInfo.integer`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`certificationRequestInfoVersion`},{name:`CertificationRequestInfo.subject`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`certificationRequestInfoSubject`},s,{name:`CertificationRequestInfo.attributes`,tagClass:r.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:`certificationRequestInfoAttributes`,value:[{name:`CertificationRequestInfo.attributes`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`CertificationRequestInfo.attributes.type`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1},{name:`CertificationRequestInfo.attributes.value`,tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0}]}]}]},d={name:`CertificationRequest`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:`csr`,value:[u,{name:`CertificationRequest.signatureAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`CertificationRequest.signatureAlgorithm.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`csrSignatureOid`},{name:`CertificationRequest.signatureAlgorithm.parameters`,tagClass:r.Class.UNIVERSAL,optional:!0,captureAsn1:`csrSignatureParams`}]},{name:`CertificationRequest.signature`,tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,captureBitStringValue:`csrSignature`}]};i.RDNAttributesAsArray=function(e,t){for(var n=[],i,s,c,l=0;l<e.value.length;++l){i=e.value[l];for(var u=0;u<i.value.length;++u)c={},s=i.value[u],c.type=r.derToOid(s.value[0].value),c.value=s.value[1].value,c.valueTagClass=s.value[1].type,c.type in a&&(c.name=a[c.type],c.name in o&&(c.shortName=o[c.name])),t&&(t.update(c.type),t.update(c.value)),n.push(c)}return n},i.CRIAttributesAsArray=function(e){for(var t=[],n=0;n<e.length;++n)for(var s=e[n],c=r.derToOid(s.value[0].value),l=s.value[1].value,u=0;u<l.length;++u){var d={};if(d.type=c,d.value=l[u].value,d.valueTagClass=l[u].type,d.type in a&&(d.name=a[d.type],d.name in o&&(d.shortName=o[d.name])),d.type===a.extensionRequest){d.extensions=[];for(var f=0;f<d.value.length;++f)d.extensions.push(i.certificateExtensionFromAsn1(d.value[f]))}t.push(d)}return t};function f(e,t){typeof t==`string`&&(t={shortName:t});for(var n=null,r,i=0;n===null&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}var p=function(e,t,n){var i={};if(e!==a[`RSASSA-PSS`])return i;n&&(i={hash:{algorithmOid:a.sha1},mgf:{algorithmOid:a.mgf1,hash:{algorithmOid:a.sha1}},saltLength:20});var o={},s=[];if(!r.validate(t,l,o,s)){var c=Error(`Cannot read RSASSA-PSS parameter block.`);throw c.errors=s,c}return o.hashOid!==void 0&&(i.hash=i.hash||{},i.hash.algorithmOid=r.derToOid(o.hashOid)),o.maskGenOid!==void 0&&(i.mgf=i.mgf||{},i.mgf.algorithmOid=r.derToOid(o.maskGenOid),i.mgf.hash=i.mgf.hash||{},i.mgf.hash.algorithmOid=r.derToOid(o.maskGenHashOid)),o.saltLength!==void 0&&(i.saltLength=o.saltLength.charCodeAt(0)),i},m=function(e){switch(a[e.signatureOid]){case`sha1WithRSAEncryption`:case`sha1WithRSASignature`:return n.md.sha1.create();case`md5WithRSAEncryption`:return n.md.md5.create();case`sha256WithRSAEncryption`:return n.md.sha256.create();case`sha384WithRSAEncryption`:return n.md.sha384.create();case`sha512WithRSAEncryption`:return n.md.sha512.create();case`RSASSA-PSS`:return n.md.sha256.create();default:var t=Error(`Could not compute `+e.type+` digest. Unknown signature OID.`);throw t.signatureOid=e.signatureOid,t}},h=function(e){var t=e.certificate,r;switch(t.signatureOid){case a.sha1WithRSAEncryption:case a.sha1WithRSASignature:break;case a[`RSASSA-PSS`]:var i=a[t.signatureParameters.mgf.hash.algorithmOid],o;if(i===void 0||n.md[i]===void 0){var s=Error(`Unsupported MGF hash function.`);throw s.oid=t.signatureParameters.mgf.hash.algorithmOid,s.name=i,s}if(o=a[t.signatureParameters.mgf.algorithmOid],o===void 0||n.mgf[o]===void 0){var s=Error(`Unsupported MGF function.`);throw s.oid=t.signatureParameters.mgf.algorithmOid,s.name=o,s}if(o=n.mgf[o].create(n.md[i].create()),i=a[t.signatureParameters.hash.algorithmOid],i===void 0||n.md[i]===void 0){var s=Error(`Unsupported RSASSA-PSS hash function.`);throw s.oid=t.signatureParameters.hash.algorithmOid,s.name=i,s}r=n.pss.create(n.md[i].create(),o,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,r)};i.certificateFromPem=function(e,t,a){var o=n.pem.decode(e)[0];if(o.type!==`CERTIFICATE`&&o.type!==`X509 CERTIFICATE`&&o.type!==`TRUSTED CERTIFICATE`){var s=Error(`Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".`);throw s.headerType=o.type,s}if(o.procType&&o.procType.type===`ENCRYPTED`)throw Error(`Could not convert certificate from PEM; PEM is encrypted.`);var c=r.fromDer(o.body,a);return i.certificateFromAsn1(c,t)},i.certificateToPem=function(e,t){var a={type:`CERTIFICATE`,body:r.toDer(i.certificateToAsn1(e)).getBytes()};return n.pem.encode(a,{maxline:t})},i.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if(t.type!==`PUBLIC KEY`&&t.type!==`RSA PUBLIC KEY`){var a=Error(`Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".`);throw a.headerType=t.type,a}if(t.procType&&t.procType.type===`ENCRYPTED`)throw Error(`Could not convert public key from PEM; PEM is encrypted.`);var o=r.fromDer(t.body);return i.publicKeyFromAsn1(o)},i.publicKeyToPem=function(e,t){var a={type:`PUBLIC KEY`,body:r.toDer(i.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(a,{maxline:t})},i.publicKeyToRSAPublicKeyPem=function(e,t){var a={type:`RSA PUBLIC KEY`,body:r.toDer(i.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(a,{maxline:t})},i.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||n.md.sha1.create(),o=t.type||`RSAPublicKey`,s;switch(o){case`RSAPublicKey`:s=r.toDer(i.publicKeyToRSAPublicKey(e)).getBytes();break;case`SubjectPublicKeyInfo`:s=r.toDer(i.publicKeyToAsn1(e)).getBytes();break;default:throw Error(`Unknown fingerprint type "`+t.type+`".`)}a.start(),a.update(s);var c=a.digest();if(t.encoding===`hex`){var l=c.toHex();return t.delimiter?l.match(/.{2}/g).join(t.delimiter):l}else if(t.encoding===`binary`)return c.getBytes();else if(t.encoding)throw Error(`Unknown encoding "`+t.encoding+`".`);return c},i.certificationRequestFromPem=function(e,t,a){var o=n.pem.decode(e)[0];if(o.type!==`CERTIFICATE REQUEST`){var s=Error(`Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".`);throw s.headerType=o.type,s}if(o.procType&&o.procType.type===`ENCRYPTED`)throw Error(`Could not convert certification request from PEM; PEM is encrypted.`);var c=r.fromDer(o.body,a);return i.certificationRequestFromAsn1(c,t)},i.certificationRequestToPem=function(e,t){var a={type:`CERTIFICATE REQUEST`,body:r.toDer(i.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(a,{maxline:t})},i.createCertificate=function(){var e={};return e.version=2,e.serialNumber=`00`,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return f(e.issuer,t)},e.issuer.addField=function(t){_([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return f(e.subject,t)},e.subject.addField=function(t){_([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,n){_(t),e.subject.attributes=t,delete e.subject.uniqueId,n&&(e.subject.uniqueId=n),e.subject.hash=null},e.setIssuer=function(t,n){_(t),e.issuer.attributes=t,delete e.issuer.uniqueId,n&&(e.issuer.uniqueId=n),e.issuer.hash=null},e.setExtensions=function(t){for(var n=0;n<t.length;++n)v(t[n],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t==`string`&&(t={name:t});for(var n=null,r,i=0;n===null&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,o){e.md=o||n.md.sha1.create();var s=a[e.md.algorithm+`WithRSAEncryption`];if(!s){var c=Error(`Could not compute certificate digest. Unknown message digest algorithm OID.`);throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=s,e.tbsCertificate=i.getTBSCertificate(e);var l=r.toDer(e.tbsCertificate);e.md.update(l.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var n=!1;if(!e.issued(t)){var a=t.issuer,o=e.subject,s=Error(`The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.`);throw s.expectedIssuer=o.attributes,s.actualIssuer=a.attributes,s}var c=t.md;if(c===null){c=m({signatureOid:t.signatureOid,type:`certificate`});var l=t.tbsCertificate||i.getTBSCertificate(t),u=r.toDer(l);c.update(u.getBytes())}return c!==null&&(n=h({certificate:e,md:c,signature:t.signature})),n},e.isIssuer=function(t){var n=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)n=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){n=!0;for(var a,o,s=0;n&&s<r.attributes.length;++s)a=r.attributes[s],o=i.attributes[s],(a.type!==o.type||a.value!==o.value)&&(n=!1)}return n},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return i.getPublicKeyFingerprint(e.publicKey,{type:`RSAPublicKey`})},e.verifySubjectKeyIdentifier=function(){for(var t=a.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var o=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===o}}return!1},e},i.certificateFromAsn1=function(e,t){var a={},o=[];if(!r.validate(e,c,a,o)){var s=Error(`Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.`);throw s.errors=o,s}if(r.derToOid(a.publicKeyOid)!==i.oids.rsaEncryption)throw Error(`Cannot read public key. OID is not RSA.`);var l=i.createCertificate();l.version=a.certVersion?a.certVersion.charCodeAt(0):0,l.serialNumber=n.util.createBuffer(a.certSerialNumber).toHex(),l.signatureOid=n.asn1.derToOid(a.certSignatureOid),l.signatureParameters=p(l.signatureOid,a.certSignatureParams,!0),l.siginfo.algorithmOid=n.asn1.derToOid(a.certinfoSignatureOid),l.siginfo.parameters=p(l.siginfo.algorithmOid,a.certinfoSignatureParams,!1),l.signature=a.certSignature;var u=[];if(a.certValidity1UTCTime!==void 0&&u.push(r.utcTimeToDate(a.certValidity1UTCTime)),a.certValidity2GeneralizedTime!==void 0&&u.push(r.generalizedTimeToDate(a.certValidity2GeneralizedTime)),a.certValidity3UTCTime!==void 0&&u.push(r.utcTimeToDate(a.certValidity3UTCTime)),a.certValidity4GeneralizedTime!==void 0&&u.push(r.generalizedTimeToDate(a.certValidity4GeneralizedTime)),u.length>2)throw Error(`Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.`);if(u.length<2)throw Error(`Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.`);if(l.validity.notBefore=u[0],l.validity.notAfter=u[1],l.tbsCertificate=a.tbsCertificate,t){l.md=m({signatureOid:l.signatureOid,type:`certificate`});var d=r.toDer(l.tbsCertificate);l.md.update(d.getBytes())}var h=n.md.sha1.create(),g=r.toDer(a.certIssuer);h.update(g.getBytes()),l.issuer.getField=function(e){return f(l.issuer,e)},l.issuer.addField=function(e){_([e]),l.issuer.attributes.push(e)},l.issuer.attributes=i.RDNAttributesAsArray(a.certIssuer),a.certIssuerUniqueId&&(l.issuer.uniqueId=a.certIssuerUniqueId),l.issuer.hash=h.digest().toHex();var v=n.md.sha1.create(),y=r.toDer(a.certSubject);return v.update(y.getBytes()),l.subject.getField=function(e){return f(l.subject,e)},l.subject.addField=function(e){_([e]),l.subject.attributes.push(e)},l.subject.attributes=i.RDNAttributesAsArray(a.certSubject),a.certSubjectUniqueId&&(l.subject.uniqueId=a.certSubjectUniqueId),l.subject.hash=v.digest().toHex(),a.certExtensions?l.extensions=i.certificateExtensionsFromAsn1(a.certExtensions):l.extensions=[],l.publicKey=i.publicKeyFromAsn1(a.subjectPublicKeyInfo),l},i.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var r=e.value[n],a=0;a<r.value.length;++a)t.push(i.certificateExtensionFromAsn1(r.value[a]));return t},i.certificateExtensionFromAsn1=function(e){var t={};if(t.id=r.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===r.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in a){if(t.name=a[t.id],t.name===`keyUsage`){var i=r.fromDer(t.value),o=0,s=0;i.value.length>1&&(o=i.value.charCodeAt(1),s=i.value.length>2?i.value.charCodeAt(2):0),t.digitalSignature=(o&128)==128,t.nonRepudiation=(o&64)==64,t.keyEncipherment=(o&32)==32,t.dataEncipherment=(o&16)==16,t.keyAgreement=(o&8)==8,t.keyCertSign=(o&4)==4,t.cRLSign=(o&2)==2,t.encipherOnly=(o&1)==1,t.decipherOnly=(s&128)==128}else if(t.name===`basicConstraints`){var i=r.fromDer(t.value);i.value.length>0&&i.value[0].type===r.Type.BOOLEAN?t.cA=i.value[0].value.charCodeAt(0)!==0:t.cA=!1;var c=null;i.value.length>0&&i.value[0].type===r.Type.INTEGER?c=i.value[0].value:i.value.length>1&&(c=i.value[1].value),c!==null&&(t.pathLenConstraint=r.derToInteger(c))}else if(t.name===`extKeyUsage`)for(var i=r.fromDer(t.value),l=0;l<i.value.length;++l){var u=r.derToOid(i.value[l].value);u in a?t[a[u]]=!0:t[u]=!0}else if(t.name===`nsCertType`){var i=r.fromDer(t.value),o=0;i.value.length>1&&(o=i.value.charCodeAt(1)),t.client=(o&128)==128,t.server=(o&64)==64,t.email=(o&32)==32,t.objsign=(o&16)==16,t.reserved=(o&8)==8,t.sslCA=(o&4)==4,t.emailCA=(o&2)==2,t.objCA=(o&1)==1}else if(t.name===`subjectAltName`||t.name===`issuerAltName`){t.altNames=[];for(var d,i=r.fromDer(t.value),f=0;f<i.value.length;++f){d=i.value[f];var p={type:d.type,value:d.value};switch(t.altNames.push(p),d.type){case 1:case 2:case 6:break;case 7:p.ip=n.util.bytesToIP(d.value);break;case 8:p.oid=r.derToOid(d.value);break;default:}}}else if(t.name===`subjectKeyIdentifier`){var i=r.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(i.value)}}return t},i.certificationRequestFromAsn1=function(e,t){var a={},o=[];if(!r.validate(e,d,a,o)){var s=Error(`Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.`);throw s.errors=o,s}if(r.derToOid(a.publicKeyOid)!==i.oids.rsaEncryption)throw Error(`Cannot read public key. OID is not RSA.`);var c=i.createCertificationRequest();if(c.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,c.signatureOid=n.asn1.derToOid(a.csrSignatureOid),c.signatureParameters=p(c.signatureOid,a.csrSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(a.csrSignatureOid),c.siginfo.parameters=p(c.siginfo.algorithmOid,a.csrSignatureParams,!1),c.signature=a.csrSignature,c.certificationRequestInfo=a.certificationRequestInfo,t){c.md=m({signatureOid:c.signatureOid,type:`certification request`});var l=r.toDer(c.certificationRequestInfo);c.md.update(l.getBytes())}var u=n.md.sha1.create();return c.subject.getField=function(e){return f(c.subject,e)},c.subject.addField=function(e){_([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(a.certificationRequestInfoSubject,u),c.subject.hash=u.digest().toHex(),c.publicKey=i.publicKeyFromAsn1(a.subjectPublicKeyInfo),c.getAttribute=function(e){return f(c,e)},c.addAttribute=function(e){_([e]),c.attributes.push(e)},c.attributes=i.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),c},i.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return f(e.subject,t)},e.subject.addField=function(t){_([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return f(e,t)},e.addAttribute=function(t){_([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){_(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){_(t),e.attributes=t},e.sign=function(t,o){e.md=o||n.md.sha1.create();var s=a[e.md.algorithm+`WithRSAEncryption`];if(!s){var c=Error(`Could not compute certification request digest. Unknown message digest algorithm OID.`);throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=s,e.certificationRequestInfo=i.getCertificationRequestInfo(e);var l=r.toDer(e.certificationRequestInfo);e.md.update(l.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,n=e.md;if(n===null){n=m({signatureOid:e.signatureOid,type:`certification request`});var a=e.certificationRequestInfo||i.getCertificationRequestInfo(e),o=r.toDer(a);n.update(o.getBytes())}return n!==null&&(t=h({certificate:e,md:n,signature:e.signature})),t},e};function g(e){for(var t=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),i,a,o=e.attributes,s=0;s<o.length;++s){i=o[s];var c=i.value,l=r.Type.PRINTABLESTRING;`valueTagClass`in i&&(l=i.valueTagClass,l===r.Type.UTF8&&(c=n.util.encodeUtf8(c))),a=r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.type).getBytes()),r.create(r.Class.UNIVERSAL,l,!1,c)])]),t.value.push(a)}return t}function _(e){for(var t,n=0;n<e.length;++n){if(t=e[n],t.name===void 0&&(t.type&&t.type in i.oids?t.name=i.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=i.oids[o[t.shortName]])),t.type===void 0)if(t.name&&t.name in i.oids)t.type=i.oids[t.name];else{var s=Error(`Attribute type not specified.`);throw s.attribute=t,s}if(t.shortName===void 0&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===a.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=r.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var c=0;c<t.extensions.length;++c)t.value.push(i.certificateExtensionToAsn1(v(t.extensions[c])))}if(t.value===void 0){var s=Error(`Attribute value not specified.`);throw s.attribute=t,s}}}function v(e,t){if(t=t||{},e.name===void 0&&e.id&&e.id in i.oids&&(e.name=i.oids[e.id]),e.id===void 0)if(e.name&&e.name in i.oids)e.id=i.oids[e.name];else{var o=Error(`Extension ID not specified.`);throw o.extension=e,o}if(e.value!==void 0)return e;if(e.name===`keyUsage`){var s=0,c=0,l=0;e.digitalSignature&&(c|=128,s=7),e.nonRepudiation&&(c|=64,s=6),e.keyEncipherment&&(c|=32,s=5),e.dataEncipherment&&(c|=16,s=4),e.keyAgreement&&(c|=8,s=3),e.keyCertSign&&(c|=4,s=2),e.cRLSign&&(c|=2,s=1),e.encipherOnly&&(c|=1,s=0),e.decipherOnly&&(l|=128,s=7);var u=String.fromCharCode(s);l===0?c!==0&&(u+=String.fromCharCode(c)):u+=String.fromCharCode(c)+String.fromCharCode(l),e.value=r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,u)}else if(e.name===`basicConstraints`)e.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(r.create(r.Class.UNIVERSAL,r.Type.BOOLEAN,!1,`ÿ`)),`pathLenConstraint`in e&&e.value.value.push(r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name===`extKeyUsage`){e.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);var d=e.value.value;for(var f in e)e[f]===!0&&(f in a?d.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a[f]).getBytes())):f.indexOf(`.`)!==-1&&d.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(f).getBytes())))}else if(e.name===`nsCertType`){var s=0,c=0;e.client&&(c|=128,s=7),e.server&&(c|=64,s=6),e.email&&(c|=32,s=5),e.objsign&&(c|=16,s=4),e.reserved&&(c|=8,s=3),e.sslCA&&(c|=4,s=2),e.emailCA&&(c|=2,s=1),e.objCA&&(c|=1,s=0);var u=String.fromCharCode(s);c!==0&&(u+=String.fromCharCode(c)),e.value=r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,u)}else if(e.name===`subjectAltName`||e.name===`issuerAltName`){e.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);for(var p,m=0;m<e.altNames.length;++m){p=e.altNames[m];var u=p.value;if(p.type===7&&p.ip){if(u=n.util.bytesFromIP(p.ip),u===null){var o=Error(`Extension "ip" value is not a valid IPv4 or IPv6 address.`);throw o.extension=e,o}}else p.type===8&&(u=p.oid?r.oidToDer(r.oidToDer(p.oid)):r.oidToDer(u));e.value.value.push(r.create(r.Class.CONTEXT_SPECIFIC,p.type,!1,u))}}else if(e.name===`nsComment`&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw Error(`Invalid "nsComment" content.`);e.value=r.create(r.Class.UNIVERSAL,r.Type.IA5STRING,!1,e.comment)}else if(e.name===`subjectKeyIdentifier`&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,h.getBytes())}else if(e.name===`authorityKeyIdentifier`&&t.cert){e.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);var d=e.value.value;if(e.keyIdentifier){var _=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;d.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!1,_))}if(e.authorityCertIssuer){var v=[r.create(r.Class.CONTEXT_SPECIFIC,4,!0,[g(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];d.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var y=n.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);d.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if(e.name===`cRLDistributionPoints`){e.value=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);for(var d=e.value.value,b=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),x=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]),p,m=0;m<e.altNames.length;++m){p=e.altNames[m];var u=p.value;if(p.type===7&&p.ip){if(u=n.util.bytesFromIP(p.ip),u===null){var o=Error(`Extension "ip" value is not a valid IPv4 or IPv6 address.`);throw o.extension=e,o}}else p.type===8&&(u=p.oid?r.oidToDer(r.oidToDer(p.oid)):r.oidToDer(u));x.value.push(r.create(r.Class.CONTEXT_SPECIFIC,p.type,!1,u))}b.value.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[x])),d.push(b)}if(e.value===void 0){var o=Error(`Extension value not specified.`);throw o.extension=e,o}return e}function y(e,t){switch(e){case a[`RSASSA-PSS`]:var n=[];return t.hash.algorithmOid!==void 0&&n.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(t.hash.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)])])),t.mgf.algorithmOid!==void 0&&n.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(t.mgf.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(t.mgf.hash.algorithmOid).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)])])])),t.saltLength!==void 0&&n.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(t.saltLength).getBytes())])),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,n);default:return r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)}}function b(e){var t=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var i=e.attributes,a=0;a<i.length;++a){var o=i[a],s=o.value,c=r.Type.UTF8;`valueTagClass`in o&&(c=o.valueTagClass),c===r.Type.UTF8&&(s=n.util.encodeUtf8(s));var l=!1;`valueConstructed`in o&&(l=o.valueConstructed);var u=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(o.type).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[r.create(r.Class.UNIVERSAL,c,l,s)])]);t.value.push(u)}return t}var x=new Date(`1950-01-01T00:00:00Z`),S=new Date(`2050-01-01T00:00:00Z`);function C(e){return e>=x&&e<S?r.create(r.Class.UNIVERSAL,r.Type.UTCTIME,!1,r.dateToUtcTime(e)):r.create(r.Class.UNIVERSAL,r.Type.GENERALIZEDTIME,!1,r.dateToGeneralizedTime(e))}i.getTBSCertificate=function(e){var t=C(e.validity.notBefore),a=C(e.validity.notAfter),o=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.version).getBytes())]),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.siginfo.algorithmOid).getBytes()),y(e.siginfo.algorithmOid,e.siginfo.parameters)]),g(e.issuer),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[t,a]),g(e.subject),i.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&o.value.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,`\0`+e.issuer.uniqueId)])),e.subject.uniqueId&&o.value.push(r.create(r.Class.CONTEXT_SPECIFIC,2,!0,[r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,`\0`+e.subject.uniqueId)])),e.extensions.length>0&&o.value.push(i.certificateExtensionsToAsn1(e.extensions)),o},i.getCertificationRequestInfo=function(e){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.version).getBytes()),g(e.subject),i.publicKeyToAsn1(e.publicKey),b(e)])},i.distinguishedNameToAsn1=function(e){return g(e)},i.certificateToAsn1=function(e){var t=e.tbsCertificate||i.getTBSCertificate(e);return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[t,r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.signatureOid).getBytes()),y(e.signatureOid,e.signatureParameters)]),r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,`\0`+e.signature)])},i.certificateExtensionsToAsn1=function(e){var t=r.create(r.Class.CONTEXT_SPECIFIC,3,!0,[]),n=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);t.value.push(n);for(var a=0;a<e.length;++a)n.value.push(i.certificateExtensionToAsn1(e[a]));return t},i.certificateExtensionToAsn1=function(e){var t=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);t.value.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.id).getBytes())),e.critical&&t.value.push(r.create(r.Class.UNIVERSAL,r.Type.BOOLEAN,!1,`ÿ`));var n=e.value;return typeof e.value!=`string`&&(n=r.toDer(n).getBytes()),t.value.push(r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,n)),t},i.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||i.getCertificationRequestInfo(e);return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[t,r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.signatureOid).getBytes()),y(e.signatureOid,e.signatureParameters)]),r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,`\0`+e.signature)])},i.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(e){return a(e.issuer)},t.addCertificate=function(e){if(typeof e==`string`&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){typeof e==`string`&&(e=n.pki.certificateFromPem(e));var t=a(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var o=r.toDer(i.certificateToAsn1(e)).getBytes(),s=0;s<t.length;++s)if(o===r.toDer(i.certificateToAsn1(t[s])).getBytes())return!0;return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(!n.util.isArray(i))e.push(i);else for(var a=0;a<i.length;++a)e.push(i[a])}return e},t.removeCertificate=function(e){var s;if(typeof e==`string`&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))return null;var c=a(e.subject);if(!n.util.isArray(c))return s=t.certs[e.subject.hash],delete t.certs[e.subject.hash],s;for(var l=r.toDer(i.certificateToAsn1(e)).getBytes(),u=0;u<c.length;++u)l===r.toDer(i.certificateToAsn1(c[u])).getBytes()&&(s=c[u],c.splice(u,1));return c.length===0&&delete t.certs[e.subject.hash],s};function a(e){return o(e),t.certs[e.hash]||null}function o(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=i.RDNAttributesAsArray(g(e),t),e.hash=t.digest().toHex()}}if(e)for(var s=0;s<e.length;++s){var c=e[s];t.addCertificate(c)}return t},i.certificateError={bad_certificate:`forge.pki.BadCertificate`,unsupported_certificate:`forge.pki.UnsupportedCertificate`,certificate_revoked:`forge.pki.CertificateRevoked`,certificate_expired:`forge.pki.CertificateExpired`,certificate_unknown:`forge.pki.CertificateUnknown`,unknown_ca:`forge.pki.UnknownCertificateAuthority`},i.verifyCertificateChain=function(e,t,r){typeof r==`function`&&(r={verify:r}),r=r||{},t=t.slice(0);var a=t.slice(0),o=r.validityCheckDate;o===void 0&&(o=new Date);var s=!0,c=null,l=0;do{var u=t.shift(),d=null,f=!1;if(o&&(o<u.validity.notBefore||o>u.validity.notAfter)&&(c={message:`Certificate is not valid yet or has expired.`,error:i.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=t[0]||e.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var p=d;n.util.isArray(p)||(p=[p]);for(var m=!1;!m&&p.length>0;){d=p.shift();try{m=d.verify(u)}catch{}}m||(c={message:`Certificate signature is invalid.`,error:i.certificateError.bad_certificate})}c===null&&(!d||f)&&!e.hasCertificate(u)&&(c={message:`Certificate is not trusted.`,error:i.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:`Certificate issuer is invalid.`,error:i.certificateError.bad_certificate}),c===null)for(var h={keyUsage:!0,basicConstraints:!0},g=0;c===null&&g<u.extensions.length;++g){var _=u.extensions[g];_.critical&&!(_.name in h)&&(c={message:`Certificate has an unsupported critical extension.`,error:i.certificateError.unsupported_certificate})}if(c===null&&(!s||t.length===0&&(!d||f))){var v=u.getExtension(`basicConstraints`),y=u.getExtension(`keyUsage`);y!==null&&(!y.keyCertSign||v===null)&&(c={message:`Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.`,error:i.certificateError.bad_certificate}),c===null&&v===null&&(c={message:`Certificate is missing basicConstraints extension and cannot be used as a CA.`,error:i.certificateError.bad_certificate}),c===null&&v!==null&&!v.cA&&(c={message:`Certificate basicConstraints indicates the certificate is not a CA.`,error:i.certificateError.bad_certificate}),c===null&&y!==null&&`pathLenConstraint`in v&&l-1>v.pathLenConstraint&&(c={message:`Certificate basicConstraints pathLenConstraint violated.`,error:i.certificateError.bad_certificate})}var b=c===null?!0:c.error,x=r.verify?r.verify(b,l,a):b;if(x===!0)c=null;else throw b===!0&&(c={message:`The application rejected the certificate.`,error:i.certificateError.bad_certificate}),(x||x===0)&&(typeof x==`object`&&!n.util.isArray(x)?(x.message&&(c.message=x.message),x.error&&(c.error=x.error)):typeof x==`string`&&(c.error=x)),c;s=!1,++l}while(t.length>0);return!0}})),Ie=r(((e,t)=>{var n=Z();me(),ge(),pe(),je(),Ae(),Ce(),ke(),Ee(),Q(),Fe();var r=n.asn1,i=n.pki,a=t.exports=n.pkcs12=n.pkcs12||{},o={name:`ContentInfo`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`ContentInfo.contentType`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`contentType`},{name:`ContentInfo.content`,tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:`content`}]},s={name:`PFX`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`PFX.version`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:`version`},o,{name:`PFX.macData`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:`mac`,value:[{name:`PFX.macData.mac`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`PFX.macData.mac.digestAlgorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`PFX.macData.mac.digestAlgorithm.algorithm`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`macAlgorithm`},{name:`PFX.macData.mac.digestAlgorithm.parameters`,optional:!0,tagClass:r.Class.UNIVERSAL,captureAsn1:`macAlgorithmParameters`}]},{name:`PFX.macData.mac.digest`,tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:`macDigest`}]},{name:`PFX.macData.macSalt`,tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:`macSalt`},{name:`PFX.macData.iterations`,tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,optional:!0,capture:`macIterations`}]}]},c={name:`SafeBag`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`SafeBag.bagId`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`bagId`},{name:`SafeBag.bagValue`,tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:`bagValue`},{name:`SafeBag.bagAttributes`,tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,optional:!0,capture:`bagAttributes`}]},l={name:`Attribute`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`Attribute.attrId`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`oid`},{name:`Attribute.attrValues`,tagClass:r.Class.UNIVERSAL,type:r.Type.SET,constructed:!0,capture:`values`}]},u={name:`CertBag`,tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:`CertBag.certId`,tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:`certId`},{name:`CertBag.certValue`,tagClass:r.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:`CertBag.certValue[0]`,tagClass:r.Class.UNIVERSAL,type:r.Class.OCTETSTRING,constructed:!1,capture:`cert`}]}]};function d(e,t,n,r){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];if(!(r!==void 0&&s.type!==r)){if(t===null){i.push(s);continue}s.attributes[t]!==void 0&&s.attributes[t].indexOf(n)>=0&&i.push(s)}}return i}a.pkcs12FromAsn1=function(e,t,o){typeof t==`string`?(o=t,t=!0):t===void 0&&(t=!0);var c={};if(!r.validate(e,s,c,[])){var l=Error(`Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.`);throw l.errors=l,l}var u={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t={},r;return`localKeyId`in e?r=e.localKeyId:`localKeyIdHex`in e&&(r=n.util.hexToBytes(e.localKeyIdHex)),r===void 0&&!(`friendlyName`in e)&&`bagType`in e&&(t[e.bagType]=d(u.safeContents,null,null,e.bagType)),r!==void 0&&(t.localKeyId=d(u.safeContents,`localKeyId`,r,e.bagType)),`friendlyName`in e&&(t.friendlyName=d(u.safeContents,`friendlyName`,e.friendlyName,e.bagType)),t},getBagsByFriendlyName:function(e,t){return d(u.safeContents,`friendlyName`,e,t)},getBagsByLocalKeyId:function(e,t){return d(u.safeContents,`localKeyId`,e,t)}};if(c.version.charCodeAt(0)!==3){var l=Error(`PKCS#12 PFX of version other than 3 not supported.`);throw l.version=c.version.charCodeAt(0),l}if(r.derToOid(c.contentType)!==i.oids.data){var l=Error(`Only PKCS#12 PFX in password integrity mode supported.`);throw l.oid=r.derToOid(c.contentType),l}var m=c.content.value[0];if(m.tagClass!==r.Class.UNIVERSAL||m.type!==r.Type.OCTETSTRING)throw Error(`PKCS#12 authSafe content data is not an OCTET STRING.`);if(m=f(m),c.mac){var h=null,g=0,_=r.derToOid(c.macAlgorithm);switch(_){case i.oids.sha1:h=n.md.sha1.create(),g=20;break;case i.oids.sha256:h=n.md.sha256.create(),g=32;break;case i.oids.sha384:h=n.md.sha384.create(),g=48;break;case i.oids.sha512:h=n.md.sha512.create(),g=64;break;case i.oids.md5:h=n.md.md5.create(),g=16;break}if(h===null)throw Error(`PKCS#12 uses unsupported MAC algorithm: `+_);var v=new n.util.ByteBuffer(c.macSalt),y=`macIterations`in c?parseInt(n.util.bytesToHex(c.macIterations),16):1,b=a.generateKey(o,v,3,y,g,h),x=n.hmac.create();if(x.start(h,b),x.update(m.value),x.getMac().getBytes()!==c.macDigest)throw Error(`PKCS#12 MAC could not be verified. Invalid password?`)}else if(Array.isArray(e.value)&&e.value.length>2)throw Error(`Invalid PKCS#12. macData field present but MAC was not validated.`);return p(u,m.value,t,o),u};function f(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function p(e,t,n,a){if(t=r.fromDer(t,n),t.tagClass!==r.Class.UNIVERSAL||t.type!==r.Type.SEQUENCE||t.constructed!==!0)throw Error(`PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo`);for(var s=0;s<t.value.length;s++){var c=t.value[s],l={},u=[];if(!r.validate(c,o,l,u)){var d=Error(`Cannot read ContentInfo.`);throw d.errors=u,d}var p={encrypted:!1},g=null,_=l.content.value[0];switch(r.derToOid(l.contentType)){case i.oids.data:if(_.tagClass!==r.Class.UNIVERSAL||_.type!==r.Type.OCTETSTRING)throw Error(`PKCS#12 SafeContents Data is not an OCTET STRING.`);g=f(_).value;break;case i.oids.encryptedData:g=m(_,a),p.encrypted=!0;break;default:var d=Error(`Unsupported PKCS#12 contentType.`);throw d.contentType=r.derToOid(l.contentType),d}p.safeBags=h(g,n,a),e.safeContents.push(p)}}function m(e,t){var a={},o=[];if(!r.validate(e,n.pkcs7.asn1.encryptedDataValidator,a,o)){var s=Error(`Cannot read EncryptedContentInfo.`);throw s.errors=o,s}var c=r.derToOid(a.contentType);if(c!==i.oids.data){var s=Error(`PKCS#12 EncryptedContentInfo ContentType is not Data.`);throw s.oid=c,s}c=r.derToOid(a.encAlgorithm);var l=i.pbe.getCipher(c,a.encParameter,t),u=f(a.encryptedContentAsn1),d=n.util.createBuffer(u.value);if(l.update(d),!l.finish())throw Error(`Failed to decrypt PKCS#12 SafeContents.`);return l.output.getBytes()}function h(e,t,n){if(!t&&e.length===0)return[];if(e=r.fromDer(e,t),e.tagClass!==r.Class.UNIVERSAL||e.type!==r.Type.SEQUENCE||e.constructed!==!0)throw Error(`PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.`);for(var a=[],o=0;o<e.value.length;o++){var s=e.value[o],l={},d=[];if(!r.validate(s,c,l,d)){var f=Error(`Cannot read SafeBag.`);throw f.errors=d,f}var p={type:r.derToOid(l.bagId),attributes:g(l.bagAttributes)};a.push(p);var m,h,_=l.bagValue.value[0];switch(p.type){case i.oids.pkcs8ShroudedKeyBag:if(_=i.decryptPrivateKeyInfo(_,n),_===null)throw Error(`Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?`);case i.oids.keyBag:try{p.key=i.privateKeyFromAsn1(_)}catch{p.key=null,p.asn1=_}continue;case i.oids.certBag:m=u,h=function(){if(r.derToOid(l.certId)!==i.oids.x509Certificate){var e=Error(`Unsupported certificate type, only X.509 supported.`);throw e.oid=r.derToOid(l.certId),e}var n=r.fromDer(l.cert,t);try{p.cert=i.certificateFromAsn1(n,!0)}catch{p.cert=null,p.asn1=n}};break;default:var f=Error(`Unsupported PKCS#12 SafeBag type.`);throw f.oid=p.type,f}if(m!==void 0&&!r.validate(_,m,l,d)){var f=Error(`Cannot read PKCS#12 `+m.name);throw f.errors=d,f}h()}return a}function g(e){var t={};if(e!==void 0)for(var n=0;n<e.length;++n){var a={},o=[];if(!r.validate(e[n],l,a,o)){var s=Error(`Cannot read PKCS#12 BagAttribute.`);throw s.errors=o,s}var c=r.derToOid(a.oid);if(i.oids[c]!==void 0){t[i.oids[c]]=[];for(var u=0;u<a.values.length;++u)t[i.oids[c]].push(a.values[u].value)}}return t}a.toPkcs12Asn1=function(e,t,o,s){s=s||{},s.saltSize=s.saltSize||8,s.count=s.count||2048,s.algorithm=s.algorithm||s.encAlgorithm||`aes128`,`useMac`in s||(s.useMac=!0),`localKeyId`in s||(s.localKeyId=null),`generateLocalKeyId`in s||(s.generateLocalKeyId=!0);var c=s.localKeyId,l;if(c!==null)c=n.util.hexToBytes(c);else if(s.generateLocalKeyId)if(t){var u=n.util.isArray(t)?t[0]:t;typeof u==`string`&&(u=i.certificateFromPem(u));var d=n.md.sha1.create();d.update(r.toDer(i.certificateToAsn1(u)).getBytes()),c=d.digest().getBytes()}else c=n.random.getBytes(20);var f=[];c!==null&&f.push(r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.localKeyId).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,c)])])),`friendlyName`in s&&f.push(r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.friendlyName).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[r.create(r.Class.UNIVERSAL,r.Type.BMPSTRING,!1,s.friendlyName)])])),f.length>0&&(l=r.create(r.Class.UNIVERSAL,r.Type.SET,!0,f));var p=[],m=[];t!==null&&(m=n.util.isArray(t)?t:[t]);for(var h=[],g=0;g<m.length;++g){t=m[g],typeof t==`string`&&(t=i.certificateFromPem(t));var _=g===0?l:void 0,v=i.certificateToAsn1(t),y=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.certBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.x509Certificate).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(v).getBytes())])])]),_]);h.push(y)}if(h.length>0){var b=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,h),x=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(b).getBytes())])]);p.push(x)}var S=null;if(e!==null){var C=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=o===null?r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.keyBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[C]),l]):r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(C,o,s)]),l]);var w=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[S]),T=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(w).getBytes())])]);p.push(T)}var E=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,p),D;if(s.useMac){var d=n.md.sha1.create(),O=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),k=s.count,e=a.generateKey(o,O,3,k,20),A=n.hmac.create();A.start(d,e),A.update(r.toDer(E).getBytes());var j=A.getMac();D=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.sha1).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,j.getBytes())]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,O.getBytes()),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(k).getBytes())])}return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(3).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(i.oids.data).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(E).getBytes())])]),D])},a.generateKey=n.pbe.generatePkcs12Key})),Le=r(((e,t)=>{var n=Z();me(),pe(),Ae(),ve(),be(),Ie(),Pe(),ke(),Q(),Fe();var r=n.asn1,i=t.exports=n.pki=n.pki||{};i.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&t.procType.type===`ENCRYPTED`)throw Error(`Could not convert PEM to DER; PEM is encrypted.`);return n.util.createBuffer(t.body)},i.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if(t.type!==`PRIVATE KEY`&&t.type!==`RSA PRIVATE KEY`){var a=Error(`Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".`);throw a.headerType=t.type,a}if(t.procType&&t.procType.type===`ENCRYPTED`)throw Error(`Could not convert private key from PEM; PEM is encrypted.`);var o=r.fromDer(t.body);return i.privateKeyFromAsn1(o)},i.privateKeyToPem=function(e,t){var a={type:`RSA PRIVATE KEY`,body:r.toDer(i.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(a,{maxline:t})},i.privateKeyInfoToPem=function(e,t){var i={type:`PRIVATE KEY`,body:r.toDer(e).getBytes()};return n.pem.encode(i,{maxline:t})}})),Re=r(((e,t)=>{var n=Z();me(),ge(),_e(),ve(),Le(),Ce(),Ee(),Q();var r=function(e,t,r,i){var a=n.util.createBuffer(),o=e.length>>1,s=o+(e.length&1),c=e.substr(0,s),l=e.substr(o,s),u=n.util.createBuffer(),d=n.hmac.create();r=t+r;var f=Math.ceil(i/16),p=Math.ceil(i/20);d.start(`MD5`,c);var m=n.util.createBuffer();u.putBytes(r);for(var h=0;h<f;++h)d.start(null,null),d.update(u.getBytes()),u.putBuffer(d.digest()),d.start(null,null),d.update(u.bytes()+r),m.putBuffer(d.digest());d.start(`SHA1`,l);var g=n.util.createBuffer();u.clear(),u.putBytes(r);for(var h=0;h<p;++h)d.start(null,null),d.update(u.getBytes()),u.putBuffer(d.digest()),d.start(null,null),d.update(u.bytes()+r),g.putBuffer(d.digest());return a.putBytes(n.util.xorBytes(m.getBytes(),g.getBytes(),i)),a},i=function(e,t,r){var i=n.hmac.create();i.start(`SHA1`,e);var a=n.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(r.type),a.putByte(r.version.major),a.putByte(r.version.minor),a.putInt16(r.length),a.putBytes(r.fragment.bytes()),i.update(a.getBytes()),i.digest().getBytes()},a=function(e,t,r){var i=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch{}return i},o=function(e,t,r){var i=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch{}return i},s=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32();break}return n.util.createBuffer(e.getBytes(r))},c=function(e,t,n){e.putInt(n.length(),t<<3),e.putBuffer(n)},l={};l.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},l.SupportedVersions=[l.Versions.TLS_1_1,l.Versions.TLS_1_0],l.Version=l.SupportedVersions[0],l.MaxFragment=15360,l.ConnectionEnd={server:0,client:1},l.PRFAlgorithm={tls_prf_sha256:0},l.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},l.CipherType={stream:0,block:1,aead:2},l.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},l.CompressionMethod={none:0,deflate:1},l.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},l.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},l.Alert={},l.Alert.Level={warning:1,fatal:2},l.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},l.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},l.CipherSuites={},l.getCipherSuite=function(e){var t=null;for(var n in l.CipherSuites){var r=l.CipherSuites[n];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t},l.handleUnexpected=function(e,t){!e.open&&e.entity===l.ConnectionEnd.client||e.error(e,{message:`Unexpected message. Received TLS record out of order.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})},l.handleHelloRequest=function(e,t,n){!e.handshaking&&e.handshakes>0&&(l.queue(e,l.createAlert(e,{level:l.Alert.Level.warning,description:l.Alert.Description.no_renegotiation})),l.flush(e)),e.process()},l.parseHelloMessage=function(e,t,r){var i=null,a=e.entity===l.ConnectionEnd.client;if(r<38)e.error(e,{message:a?`Invalid ServerHello message. Message too short.`:`Invalid ClientHello message. Message too short.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});else{var o=t.fragment,c=o.length();if(i={version:{major:o.getByte(),minor:o.getByte()},random:n.util.createBuffer(o.getBytes(32)),session_id:s(o,1),extensions:[]},a?(i.cipher_suite=o.getBytes(2),i.compression_method=o.getByte()):(i.cipher_suites=s(o,2),i.compression_methods=s(o,1)),c=r-(c-o.length()),c>0){for(var u=s(o,2);u.length()>0;)i.extensions.push({type:[u.getByte(),u.getByte()],data:s(u,2)});if(!a)for(var d=0;d<i.extensions.length;++d){var f=i.extensions[d];if(f.type[0]===0&&f.type[1]===0)for(var p=s(f.data,2);p.length()>0&&p.getByte()===0;)e.session.extensions.server_name.serverNameList.push(s(p,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:`TLS version change is disallowed during renegotiation.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=l.getCipherSuite(i.cipher_suite);else for(var m=n.util.createBuffer(i.cipher_suites.bytes());m.length()>0&&(e.session.cipherSuite=l.getCipherSuite(m.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:`No cipher suites in common.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});a?e.session.compressionMethod=i.compression_method:e.session.compressionMethod=l.CompressionMethod.none}return i},l.createSecurityParameters=function(e,t){var n=e.entity===l.ConnectionEnd.client,r=t.random.bytes(),i=n?e.session.sp.client_random:r,a=n?r:l.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:l.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}},l.handleServerHello=function(e,t,n){var r=l.parseHelloMessage(e,t,n);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:`Incompatible TLS version.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=h,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=d,e.session.resuming=!1,l.createSecurityParameters(e,r)),e.session.id=i,e.process()}},l.handleClientHello=function(e,t,r){var i=l.parseHelloMessage(e,t,r);if(!e.fail){var a=i.session_id.bytes(),o=null;if(e.sessionCache&&(o=e.sessionCache.getSession(a),o===null?a=``:(o.version.major!==i.version.major||o.version.minor>i.version.minor)&&(o=null,a=``)),a.length===0&&(a=n.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=i.version,e.session.sp={},o)e.version=e.session.version=o.version,e.session.sp=o.sp;else{for(var s,c=1;c<l.SupportedVersions.length&&(s=l.SupportedVersions[c],!(s.minor<=i.version.minor));++c);e.version={major:s.major,minor:s.minor},e.session.version=e.version}o===null?(e.expect=e.verifyClient===!1?x:b,e.session.resuming=!1,l.createSecurityParameters(e,i)):(e.expect=C,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()),e.open=!0,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHello(e)})),e.session.resuming?(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))):(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)})),e.fail||(l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerKeyExchange(e)})),e.verifyClient!==!1&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateRequest(e)})),l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createServerHelloDone(e)})))),l.flush(e),e.process()}},l.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:`Invalid Certificate message. Message too short.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment,a={certificate_list:s(i,3)},o,c,u=[];try{for(;a.certificate_list.length()>0;)o=s(a.certificate_list,3),c=n.asn1.fromDer(o),o=n.pki.certificateFromAsn1(c,!0),u.push(o)}catch(t){return e.error(e,{message:`Could not parse certificate list.`,cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var d=e.entity===l.ConnectionEnd.client;(d||e.verifyClient===!0)&&u.length===0?e.error(e,{message:d?`No server certificate provided.`:`No client certificate provided.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}}):u.length===0?e.expect=d?f:x:(d?e.session.serverCertificate=u[0]:e.session.clientCertificate=u[0],l.verifyCertificateChain(e,u)&&(e.expect=d?f:x)),e.process()},l.handleServerKeyExchange=function(e,t,n){if(n>0)return e.error(e,{message:`Invalid key parameters. Only RSA is supported.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},l.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:`Invalid key parameters. Only RSA is supported.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});var i=t.fragment,a={enc_pre_master_secret:s(i,2).getBytes()},o=null;if(e.getPrivateKey)try{o=e.getPrivateKey(e,e.session.serverCertificate),o=n.pki.privateKeyFromPem(o)}catch(t){e.error(e,{message:`Could not get private key.`,cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}if(o===null)return e.error(e,{message:`No private key set.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=o.decrypt(a.enc_pre_master_secret);var u=e.session.clientHelloVersion;if(u.major!==c.pre_master_secret.charCodeAt(0)||u.minor!==c.pre_master_secret.charCodeAt(1))throw Error(`TLS version rollback attack detected.`)}catch{c.pre_master_secret=n.random.getBytes(48)}e.expect=C,e.session.clientCertificate!==null&&(e.expect=S),e.process()},l.handleCertificateRequest=function(e,t,n){if(n<3)return e.error(e,{message:`Invalid CertificateRequest. Message too short.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:s(r,1),certificate_authorities:s(r,2)};e.session.certificateRequest=i,e.expect=m,e.process()},l.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:`Invalid CertificateVerify. Message too short.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var o={signature:s(i,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,o.signature,`NONE`))throw Error(`CertificateVerify signature does not match.`);e.session.md5.update(a),e.session.sha1.update(a)}catch{return e.error(e,{message:`Bad signature in CertificateVerify.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure}})}e.expect=C,e.process()},l.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:`Invalid ServerHelloDone message. Invalid length.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.record_overflow}});if(e.serverCertificate===null){var i={message:`No server certificate provided. Not enough security.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.insufficient_security}},a=e.verify(e,i.alert.description,0,[]);if(a!==!0)return(a||a===0)&&(typeof a==`object`&&!n.util.isArray(a)?(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert)):typeof a==`number`&&(i.alert.description=a)),e.error(e,i)}e.session.certificateRequest!==null&&(t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificate(e)}),l.queue(e,t)),t=l.createRecord(e,{type:l.ContentType.handshake,data:l.createClientKeyExchange(e)}),l.queue(e,t),e.expect=v;var o=function(e,t){e.session.certificateRequest!==null&&e.session.clientCertificate!==null&&l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createCertificateVerify(e,t)})),l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.pending=l.createConnectionState(e),e.state.current.write=e.state.pending.write,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)})),e.expect=h,l.flush(e),e.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return o(e,null);l.getClientSignature(e,o)},l.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:`Invalid ChangeCipherSpec message received.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var n=e.entity===l.ConnectionEnd.client;(e.session.resuming&&n||!e.session.resuming&&!n)&&(e.state.pending=l.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&n||e.session.resuming&&!n)&&(e.state.pending=null),e.expect=n?g:w,e.process()},l.handleFinished=function(e,t,i){var a=t.fragment;a.read-=4;var o=a.bytes();a.read+=4;var s=t.fragment.getBytes();a=n.util.createBuffer(),a.putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var c=e.entity===l.ConnectionEnd.client,u=c?`server finished`:`client finished`,d=e.session.sp;if(a=r(d.master_secret,u,a.getBytes(),12),a.getBytes()!==s)return e.error(e,{message:`Invalid verify_data in Finished message.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decrypt_error}});e.session.md5.update(o),e.session.sha1.update(o),(e.session.resuming&&c||!e.session.resuming&&!c)&&(l.queue(e,l.createRecord(e,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,l.queue(e,l.createRecord(e,{type:l.ContentType.handshake,data:l.createFinished(e)}))),e.expect=c?_:T,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,l.flush(e),e.isConnected=!0,e.connected(e),e.process()},l.handleAlert=function(e,t){var n=t.fragment,r={level:n.getByte(),description:n.getByte()},i;switch(r.description){case l.Alert.Description.close_notify:i=`Connection closed.`;break;case l.Alert.Description.unexpected_message:i=`Unexpected message.`;break;case l.Alert.Description.bad_record_mac:i=`Bad record MAC.`;break;case l.Alert.Description.decryption_failed:i=`Decryption failed.`;break;case l.Alert.Description.record_overflow:i=`Record overflow.`;break;case l.Alert.Description.decompression_failure:i=`Decompression failed.`;break;case l.Alert.Description.handshake_failure:i=`Handshake failure.`;break;case l.Alert.Description.bad_certificate:i=`Bad certificate.`;break;case l.Alert.Description.unsupported_certificate:i=`Unsupported certificate.`;break;case l.Alert.Description.certificate_revoked:i=`Certificate revoked.`;break;case l.Alert.Description.certificate_expired:i=`Certificate expired.`;break;case l.Alert.Description.certificate_unknown:i=`Certificate unknown.`;break;case l.Alert.Description.illegal_parameter:i=`Illegal parameter.`;break;case l.Alert.Description.unknown_ca:i=`Unknown certificate authority.`;break;case l.Alert.Description.access_denied:i=`Access denied.`;break;case l.Alert.Description.decode_error:i=`Decode error.`;break;case l.Alert.Description.decrypt_error:i=`Decrypt error.`;break;case l.Alert.Description.export_restriction:i=`Export restriction.`;break;case l.Alert.Description.protocol_version:i=`Unsupported protocol version.`;break;case l.Alert.Description.insufficient_security:i=`Insufficient security.`;break;case l.Alert.Description.internal_error:i=`Internal error.`;break;case l.Alert.Description.user_canceled:i=`User canceled.`;break;case l.Alert.Description.no_renegotiation:i=`Renegotiation not supported.`;break;default:i=`Unknown error.`;break}if(r.description===l.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===l.ConnectionEnd.client?`server`:`client`,alert:r}),e.process()},l.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt24();if(a>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var o=r.bytes(a+4);r.read+=4,i in z[e.entity][e.expect]?(e.entity===l.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==l.HandshakeType.hello_request&&i!==l.HandshakeType.certificate_verify&&i!==l.HandshakeType.finished&&(e.session.md5.update(o),e.session.sha1.update(o)),z[e.entity][e.expect][i](e,t,a)):l.handleUnexpected(e,t)},l.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},l.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt16(),o=r.getBytes(a);if(i===l.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>o.length)return e.process();l.queue(e,l.createRecord(e,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_response,o)})),l.flush(e)}else if(i===l.HeartbeatMessageType.heartbeat_response){if(o!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(o))}e.process()};var u=0,d=1,f=2,p=3,m=4,h=5,g=6,_=7,v=8,y=0,b=1,x=2,S=3,C=4,w=5,T=6,E=l.handleUnexpected,D=l.handleChangeCipherSpec,O=l.handleAlert,k=l.handleHandshake,A=l.handleApplicationData,j=l.handleHeartbeat,M=[];M[l.ConnectionEnd.client]=[[E,O,k,E,j],[E,O,k,E,j],[E,O,k,E,j],[E,O,k,E,j],[E,O,k,E,j],[D,O,E,E,j],[E,O,k,E,j],[E,O,k,A,j],[E,O,k,E,j]],M[l.ConnectionEnd.server]=[[E,O,k,E,j],[E,O,k,E,j],[E,O,k,E,j],[E,O,k,E,j],[D,O,E,E,j],[E,O,k,E,j],[E,O,k,A,j],[E,O,k,E,j]];var N=l.handleHelloRequest,P=l.handleServerHello,ee=l.handleCertificate,F=l.handleServerKeyExchange,I=l.handleCertificateRequest,L=l.handleServerHelloDone,R=l.handleFinished,z=[];z[l.ConnectionEnd.client]=[[E,E,P,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,ee,F,I,L,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,E,F,I,L,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,E,E,I,L,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,E,E,E,L,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,R],[N,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[N,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E]];var B=l.handleClientHello,V=l.handleClientKeyExchange,H=l.handleCertificateVerify;z[l.ConnectionEnd.server]=[[E,B,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,ee,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,V,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,H,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,R],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E],[E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E]],l.generateKeys=function(e,t){var n=r,i=t.client_random+t.server_random;e.session.resuming||(t.master_secret=n(t.pre_master_secret,`master secret`,i,48).bytes(),t.pre_master_secret=null),i=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,o=e.version.major===l.Versions.TLS_1_0.major&&e.version.minor===l.Versions.TLS_1_0.minor;o&&(a+=2*t.fixed_iv_length);var s=n(t.master_secret,`key expansion`,i,a),c={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return o&&(c.client_write_IV=s.getBytes(t.fixed_iv_length),c.server_write_IV=s.getBytes(t.fixed_iv_length)),c},l.createConnectionState=function(e){var t=e.entity===l.ConnectionEnd.client,n=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){e.sequenceNumber[1]===4294967295?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},r={read:n(),write:n()};if(r.read.update=function(e,t){return r.read.cipherFunction(t,r.read)?r.read.compressFunction(e,t,r.read)||e.error(e,{message:`Could not decompress record.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decompression_failure}}):e.error(e,{message:`Could not decrypt record or bad MAC.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_record_mac}}),!e.fail},r.write.update=function(e,t){return r.write.compressFunction(e,t,r.write)?r.write.cipherFunction(t,r.write)||e.error(e,{message:`Could not encrypt record.`,send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):e.error(e,{message:`Could not compress record.`,send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=l.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case l.CompressionMethod.none:break;case l.CompressionMethod.deflate:r.read.compressFunction=o,r.write.compressFunction=a;break;default:throw Error(`Unsupported compression algorithm.`)}}return r},l.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},l.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},l.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),l.createRecord(e,{type:l.ContentType.alert,data:r})},l.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var a=t.length(),o=n.util.createBuffer();o.putByte(l.CompressionMethod.none);var s=o.length(),u=n.util.createBuffer();if(e.virtualHost){var d=n.util.createBuffer();d.putByte(0),d.putByte(0);var f=n.util.createBuffer();f.putByte(0),c(f,2,n.util.createBuffer(e.virtualHost));var p=n.util.createBuffer();c(p,2,f),c(d,2,p),u.putBuffer(d)}var m=u.length();m>0&&(m+=2);var h=e.session.id,g=h.length+1+2+4+28+2+a+1+s+m,_=n.util.createBuffer();return _.putByte(l.HandshakeType.client_hello),_.putInt24(g),_.putByte(e.version.major),_.putByte(e.version.minor),_.putBytes(e.session.sp.client_random),c(_,1,n.util.createBuffer(h)),c(_,2,t),c(_,1,o),m>0&&c(_,2,u),_},l.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(l.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},l.createCertificate=function(e){var t=e.entity===l.ConnectionEnd.client,r=null;if(e.getCertificate){var i=t?e.session.certificateRequest:e.session.extensions.server_name.serverNameList;r=e.getCertificate(e,i)}var a=n.util.createBuffer();if(r!==null)try{n.util.isArray(r)||(r=[r]);for(var o=null,s=0;s<r.length;++s){var u=n.pem.decode(r[s])[0];if(u.type!==`CERTIFICATE`&&u.type!==`X509 CERTIFICATE`&&u.type!==`TRUSTED CERTIFICATE`){var d=Error(`Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".`);throw d.headerType=u.type,d}if(u.procType&&u.procType.type===`ENCRYPTED`)throw Error(`Could not convert certificate from PEM; PEM is encrypted.`);var f=n.util.createBuffer(u.body);o===null&&(o=n.asn1.fromDer(f.bytes(),!1));var p=n.util.createBuffer();c(p,3,f),a.putBuffer(p)}r=n.pki.certificateFromAsn1(o),t?e.session.clientCertificate=r:e.session.serverCertificate=r}catch(t){return e.error(e,{message:`Could not send certificate list.`,cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}var m=3+a.length(),h=n.util.createBuffer();return h.putByte(l.HandshakeType.certificate),h.putInt24(m),c(h,3,a),h},l.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes(),t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret);var i=t.length+2,a=n.util.createBuffer();return a.putByte(l.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a},l.createServerKeyExchange=function(e){var t=0,r=n.util.createBuffer();return t>0&&(r.putByte(l.HandshakeType.server_key_exchange),r.putInt24(t)),r},l.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:`Could not get private key.`,cause:t,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}i===null?e.error(e,{message:`No private key set.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},l.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(l.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},l.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var a=e.caStore.certs[i],o=n.pki.distinguishedNameToAsn1(a.subject),s=n.asn1.toDer(o);r.putInt16(s.length()),r.putBuffer(s)}var u=1+t.length()+2+r.length(),d=n.util.createBuffer();return d.putByte(l.HandshakeType.certificate_request),d.putInt24(u),c(d,1,t),c(d,2,r),d},l.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(l.HandshakeType.server_hello_done),t.putInt24(0),t},l.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},l.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var i=e.entity===l.ConnectionEnd.client,a=e.session.sp,o=12,s=r,c=i?`client finished`:`server finished`;t=s(a.master_secret,c,t.getBytes(),o);var u=n.util.createBuffer();return u.putByte(l.HandshakeType.finished),u.putInt24(t.length()),u.putBuffer(t),u},l.createHeartbeat=function(e,t,r){r===void 0&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var a=i.length(),o=Math.max(16,a-r-3);return i.putBytes(n.random.getBytes(o)),i},l.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===l.ContentType.handshake||t.type===l.ContentType.alert||t.type===l.ContentType.change_cipher_spec))){if(t.type===l.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=l.MaxFragment)i=[t];else{i=[];for(var a=t.fragment.bytes();a.length>l.MaxFragment;)i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(a.slice(0,l.MaxFragment))})),a=a.slice(l.MaxFragment);a.length>0&&i.push(l.createRecord(e,{type:t.type,data:n.util.createBuffer(a)}))}for(var o=0;o<i.length&&!e.fail;++o){var s=i[o];e.state.current.write.update(e,s)&&e.records.push(s)}}},l.flush=function(e){for(var t=0;t<e.records.length;++t){var n=e.records[t];e.tlsData.putByte(n.type),e.tlsData.putByte(n.version.major),e.tlsData.putByte(n.version.minor),e.tlsData.putInt16(n.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var U=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return l.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return l.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return l.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return l.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return l.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return l.Alert.Description.unknown_ca;default:return l.Alert.Description.bad_certificate}},W=function(e){switch(e){case!0:return!0;case l.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case l.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case l.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case l.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case l.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case l.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}};for(var G in l.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){U(t);var a=e.verify(e,t,r,i);if(a!==!0){if(typeof a==`object`&&!n.util.isArray(a)){var o=Error(`The application rejected the certificate.`);throw o.send=!0,o.alert={level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate},a.message&&(o.message=a.message),a.alert&&(o.alert.description=a.alert),o}a!==t&&(a=W(a))}return a},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var a=t;(typeof a!=`object`||n.util.isArray(a))&&(a={send:!0,alert:{level:l.Alert.Level.fatal,description:U(t)}}),`send`in a||(a.send=!0),`alert`in a||(a.alert={level:l.Alert.Level.fatal,description:U(a.error)}),e.error(e,a)}return!e.fail},l.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in r={},r.cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),i!==null&&i in r.cache){for(var a in t=r.cache[i],delete r.cache[i],r.order)if(r.order[a]===i){r.order.splice(a,1);break}}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=n.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},l.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(r===null)for(var i in r=[],l.CipherSuites)r.push(l.CipherSuites[i]);var a=e.server?l.ConnectionEnd.server:l.ConnectionEnd.client,o=e.sessionCache?l.createSessionCache(e.sessionCache):null,s={version:{major:l.Version.major,minor:l.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:o,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,n,r){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,n){n.origin=n.origin||(t.entity===l.ConnectionEnd.client?`client`:`server`),n.send&&(l.queue(t,l.createAlert(t,n.alert)),l.flush(t));var r=n.fatal!==!1;r&&(t.fail=!0),e.error(t,n),r&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(e){s.version={major:l.Version.major,minor:l.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===l.ConnectionEnd.client?u:y,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(e||e===void 0),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=l.createConnectionState(s)},s.reset();var c=function(e,t){var n=t.type-l.ContentType.change_cipher_spec,r=M[e.entity][e.expect];n in r?r[n](e,t):l.handleUnexpected(e,t)},d=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var a=e.record.version.major===e.version.major;a&&e.session&&e.session.version&&(a=e.record.version.minor===e.version.minor),a||e.error(e,{message:`Incompatible TLS version.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}})}return t},f=function(e){var t=0,n=e.input,r=n.length();return r<e.record.length?t=e.record.length-r:(e.record.fragment.putBytes(n.getBytes(e.record.length)),n.compact(),e.state.current.read.update(e,e.record)&&(e.fragmented!==null&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:`Invalid fragmented record.`,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})),e.record.ready=!0)),t};return s.handshake=function(e){if(s.entity!==l.ConnectionEnd.client)s.error(s,{message:`Cannot initiate handshake as a server.`,fatal:!1});else if(s.handshaking)s.error(s,{message:`Handshake already in progress.`,fatal:!1});else{s.fail&&!s.open&&s.handshakes===0&&(s.fail=!1),s.handshaking=!0,e=e||``;var t=null;e.length>0&&(s.sessionCache&&(t=s.sessionCache.getSession(e)),t===null&&(e=``)),e.length===0&&s.sessionCache&&(t=s.sessionCache.getSession(),t!==null&&(e=t.id)),s.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(s.version=t.version,s.session.sp=t.sp),s.session.sp.client_random=l.createRandom().getBytes(),s.open=!0,l.queue(s,l.createRecord(s,{type:l.ContentType.handshake,data:l.createClientHello(s)})),l.flush(s)}},s.process=function(e){var t=0;return e&&s.input.putBytes(e),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(t=d(s)),!s.fail&&s.record!==null&&!s.record.ready&&(t=f(s)),!s.fail&&s.record!==null&&s.record.ready&&c(s,s.record)),t},s.prepare=function(e){return l.queue(s,l.createRecord(s,{type:l.ContentType.application_data,data:n.util.createBuffer(e)})),l.flush(s)},s.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),t===void 0&&(t=e.length),s.expectedHeartbeatPayload=e,l.queue(s,l.createRecord(s,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_request,e,t)})),l.flush(s)},s.close=function(e){if(!s.fail&&s.sessionCache&&s.session){var t={id:s.session.id,version:s.session.version,sp:s.session.sp};t.sp.keys=null,s.sessionCache.setSession(t.id,t)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,l.queue(s,l.createAlert(s,{level:l.Alert.Level.warning,description:l.Alert.Description.close_notify})),l.flush(s)),s.closed(s)),s.reset(e)},s},t.exports=n.tls=n.tls||{},l)typeof l[G]!=`function`&&(n.tls[G]=l[G]);n.tls.prf_tls1=r,n.tls.hmac_sha1=i,n.tls.createSessionCache=l.createSessionCache,n.tls.createConnection=l.createConnection})),ze=r(((e,t)=>{var n=Z();fe(),Re();var r=t.exports=n.tls;r.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:`TLS_RSA_WITH_AES_128_CBC_SHA`,initSecurityParameters:function(e){e.bulk_cipher_algorithm=r.BulkCipherAlgorithm.aes,e.cipher_type=r.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=r.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},r.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:`TLS_RSA_WITH_AES_256_CBC_SHA`,initSecurityParameters:function(e){e.bulk_cipher_algorithm=r.BulkCipherAlgorithm.aes,e.cipher_type=r.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=r.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i};function i(e,t,i){var o=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher(`AES-CBC`,o?i.keys.server_write_key:i.keys.client_write_key),iv:o?i.keys.server_write_IV:i.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher(`AES-CBC`,o?i.keys.client_write_key:i.keys.server_write_key),iv:o?i.keys.client_write_IV:i.keys.server_write_IV},e.read.cipherFunction=c,e.write.cipherFunction=a,e.read.macLength=e.write.macLength=i.mac_length,e.read.macFunction=e.write.macFunction=r.hmac_sha1}function a(e,t){var i=!1,a=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(a),t.updateSequenceNumber();var s=e.version.minor===r.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16);t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:s}),e.version.minor>=r.Versions.TLS_1_1.minor&&c.output.putBytes(s),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),i=!0),i}function o(e,t,n){if(!n){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function s(e,t,n){var r=!0;if(n){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)r=r&&t.at(o)==a;r&&t.truncate(a+1)}return r}function c(e,t){var i=!1,a=e.version.minor===r.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16);t.cipherState.init=!0;var o=t.cipherState.cipher;o.start({iv:a}),o.update(e.fragment),i=o.finish(s);var c=t.macLength,u=n.random.getBytesSync(c),d=o.output.length();d>=c?(e.fragment=o.output.getBytes(d-c),u=o.output.getBytes(c)):e.fragment=o.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var f=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=l(t.macKey,u,f)&&i,i}function l(e,t,r){var i=n.hmac.create();return i.start(`SHA1`,e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),r=i.digest().getBytes(),t===r}})),Be=r(((e,t)=>{var n=Z();he(),Q();var r=t.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=r;var i=n.sha384=n.sha512.sha384=n.sha512.sha384||{};i.create=function(){return r.create(`SHA-384`)},n.md.sha384=n.md.algorithms.sha384=i,n.sha512.sha256=n.sha512.sha256||{create:function(){return r.create(`SHA-512/256`)}},n.md[`sha512/256`]=n.md.algorithms[`sha512/256`]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return r.create(`SHA-512/224`)}},n.md[`sha512/224`]=n.md.algorithms[`sha512/224`]=n.sha512.sha224,r.create=function(e){if(o||l(),e===void 0&&(e=`SHA-512`),!(e in c))throw Error(`Invalid SHA-512 algorithm: `+e);for(var t=c[e],r=null,i=n.util.createBuffer(),s=Array(80),d=0;d<80;++d)s[d]=[,,];var f=64;switch(e){case`SHA-384`:f=48;break;case`SHA-512/256`:f=32;break;case`SHA-512/224`:f=28;break}var p={algorithm:e.replace(`-`,``).toLowerCase(),blockLength:128,digestLength:f,messageLength:0,fullMessageLength:null,messageLengthSize:16};return p.start=function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a<e;++a)p.fullMessageLength.push(0);i=n.util.createBuffer(),r=Array(t.length);for(var a=0;a<t.length;++a)r[a]=t[a].slice(0);return p},p.start(),p.update=function(e,t){t===`utf8`&&(e=n.util.encodeUtf8(e));var a=e.length;p.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=p.fullMessageLength.length-1;o>=0;--o)p.fullMessageLength[o]+=a[1],a[1]=a[0]+(p.fullMessageLength[o]/4294967296>>>0),p.fullMessageLength[o]=p.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(e),u(r,s,i),(i.read>2048||i.length()===0)&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var o=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(a.substr(0,p.blockLength-o));for(var c,l,d=p.fullMessageLength[0]*8,f=0;f<p.fullMessageLength.length-1;++f)c=p.fullMessageLength[f+1]*8,l=c/4294967296>>>0,d+=l,t.putInt32(d>>>0),d=c>>>0;t.putInt32(d);for(var m=Array(r.length),f=0;f<r.length;++f)m[f]=r[f].slice(0);u(m,s,t);for(var h=n.util.createBuffer(),g=e===`SHA-512`?m.length:e===`SHA-384`?m.length-2:m.length-4,f=0;f<g;++f)h.putInt32(m[f][0]),(f!==g-1||e!==`SHA-512/224`)&&h.putInt32(m[f][1]);return h},p};var a=null,o=!1,s=null,c=null;function l(){a=``,a+=n.util.fillString(`\0`,128),s=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],c={},c[`SHA-512`]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c[`SHA-384`]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c[`SHA-512/256`]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c[`SHA-512/224`]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0}function u(e,t,n){for(var r,i,a,o,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,ee,F,I,L,R=n.length();R>=128;){for(M=0;M<16;++M)t[M][0]=n.getInt32()>>>0,t[M][1]=n.getInt32()>>>0;for(;M<80;++M)ee=t[M-2],N=ee[0],P=ee[1],r=((N>>>19|P<<13)^(P>>>29|N<<3)^N>>>6)>>>0,i=((N<<13|P>>>19)^(P<<3|N>>>29)^(N<<26|P>>>6))>>>0,I=t[M-15],N=I[0],P=I[1],a=((N>>>1|P<<31)^(N>>>8|P<<24)^N>>>7)>>>0,o=((N<<31|P>>>1)^(N<<24|P>>>8)^(N<<25|P>>>7))>>>0,F=t[M-7],L=t[M-16],P=i+F[1]+o+L[1],t[M][0]=r+F[0]+a+L[0]+(P/4294967296>>>0)>>>0,t[M][1]=P>>>0;for(g=e[0][0],_=e[0][1],v=e[1][0],y=e[1][1],b=e[2][0],x=e[2][1],S=e[3][0],C=e[3][1],w=e[4][0],T=e[4][1],E=e[5][0],D=e[5][1],O=e[6][0],k=e[6][1],A=e[7][0],j=e[7][1],M=0;M<80;++M)u=((w>>>14|T<<18)^(w>>>18|T<<14)^(T>>>9|w<<23))>>>0,d=((w<<18|T>>>14)^(w<<14|T>>>18)^(T<<23|w>>>9))>>>0,f=(O^w&(E^O))>>>0,p=(k^T&(D^k))>>>0,c=((g>>>28|_<<4)^(_>>>2|g<<30)^(_>>>7|g<<25))>>>0,l=((g<<4|_>>>28)^(_<<30|g>>>2)^(_<<25|g>>>7))>>>0,m=(g&v|b&(g^v))>>>0,h=(_&y|x&(_^y))>>>0,P=j+d+p+s[M][1]+t[M][1],r=A+u+f+s[M][0]+t[M][0]+(P/4294967296>>>0)>>>0,i=P>>>0,P=l+h,a=c+m+(P/4294967296>>>0)>>>0,o=P>>>0,A=O,j=k,O=E,k=D,E=w,D=T,P=C+i,w=S+r+(P/4294967296>>>0)>>>0,T=P>>>0,S=b,C=x,b=v,x=y,v=g,y=_,P=i+o,g=r+a+(P/4294967296>>>0)>>>0,_=P>>>0;P=e[0][1]+_,e[0][0]=e[0][0]+g+(P/4294967296>>>0)>>>0,e[0][1]=P>>>0,P=e[1][1]+y,e[1][0]=e[1][0]+v+(P/4294967296>>>0)>>>0,e[1][1]=P>>>0,P=e[2][1]+x,e[2][0]=e[2][0]+b+(P/4294967296>>>0)>>>0,e[2][1]=P>>>0,P=e[3][1]+C,e[3][0]=e[3][0]+S+(P/4294967296>>>0)>>>0,e[3][1]=P>>>0,P=e[4][1]+T,e[4][0]=e[4][0]+w+(P/4294967296>>>0)>>>0,e[4][1]=P>>>0,P=e[5][1]+D,e[5][0]=e[5][0]+E+(P/4294967296>>>0)>>>0,e[5][1]=P>>>0,P=e[6][1]+k,e[6][0]=e[6][0]+O+(P/4294967296>>>0)>>>0,e[6][1]=P>>>0,P=e[7][1]+j,e[7][0]=e[7][0]+A+(P/4294967296>>>0)>>>0,e[7][1]=P>>>0,R-=128}}})),Ve=r((e=>{var t=Z();me();var n=t.asn1;e.privateKeyValidator={name:`PrivateKeyInfo`,tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:`PrivateKeyInfo.version`,tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:`privateKeyVersion`},{name:`PrivateKeyInfo.privateKeyAlgorithm`,tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:`AlgorithmIdentifier.algorithm`,tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:`privateKeyOid`}]},{name:`PrivateKeyInfo`,tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:`privateKey`}]},e.publicKeyValidator={name:`SubjectPublicKeyInfo`,tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:`subjectPublicKeyInfo`,value:[{name:`SubjectPublicKeyInfo.AlgorithmIdentifier`,tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:`AlgorithmIdentifier.algorithm`,tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:`publicKeyOid`}]},{tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:`ed25519PublicKey`}]}})),He=r(((e,t)=>{var n=Z();Te(),Ce(),Be(),Q();var r=Ve(),i=r.publicKeyValidator,a=r.privateKeyValidator;if(o===void 0)var o=n.jsbn.BigInteger;var s=n.util.ByteBuffer,c=typeof Buffer>`u`?Uint8Array:Buffer;n.pki=n.pki||{},t.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var l=n.ed25519;l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=n.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if(typeof t==`string`){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw TypeError(`"seed" must be `+l.constants.SEED_BYTE_LENGTH+` bytes in length.`)}else if(!(t instanceof Uint8Array))throw TypeError(`"seed" must be a node.js Buffer, Uint8Array, or a binary string.`);t=u({message:t,encoding:`binary`});for(var r=new c(l.constants.PUBLIC_KEY_BYTE_LENGTH),i=new c(l.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)i[a]=t[a];return b(r,i),{publicKey:r,privateKey:i}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!n.asn1.validate(e,a,t,r)){var i=Error(`Invalid Key.`);throw i.errors=r,i}var o=n.asn1.derToOid(t.privateKeyOid),s=n.oids.EdDSA25519;if(o!==s)throw Error(`Invalid OID "`+o+`"; OID must be "`+s+`".`);var c=t.privateKey;return{privateKeyBytes:u({message:n.asn1.fromDer(c).value,encoding:`binary`})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!n.asn1.validate(e,i,t,r)){var a=Error(`Invalid Key.`);throw a.errors=r,a}var o=n.asn1.derToOid(t.publicKeyOid),s=n.oids.EdDSA25519;if(o!==s)throw Error(`Invalid OID "`+o+`"; OID must be "`+s+`".`);var c=t.ed25519PublicKey;if(c.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw Error(`Key length is invalid.`);return u({message:c,encoding:`binary`})},l.publicKeyFromPrivateKey=function(e){e=e||{};var t=u({message:e.privateKey,encoding:`binary`});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError(`"options.privateKey" must have a byte length of `+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var n=new c(l.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<n.length;++r)n[r]=t[32+r];return n},l.sign=function(e){e=e||{};var t=u(e),n=u({message:e.privateKey,encoding:`binary`});if(n.length===l.constants.SEED_BYTE_LENGTH)n=l.generateKeyPair({seed:n}).privateKey;else if(n.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError(`"options.privateKey" must have a byte length of `+l.constants.SEED_BYTE_LENGTH+` or `+l.constants.PRIVATE_KEY_BYTE_LENGTH);var r=new c(l.constants.SIGN_BYTE_LENGTH+t.length);x(r,t,t.length,n);for(var i=new c(l.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=r[a];return i},l.verify=function(e){e=e||{};var t=u(e);if(e.signature===void 0)throw TypeError(`"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.`);var n=u({message:e.signature,encoding:`binary`});if(n.length!==l.constants.SIGN_BYTE_LENGTH)throw TypeError(`"options.signature" must have a byte length of `+l.constants.SIGN_BYTE_LENGTH);var r=u({message:e.publicKey,encoding:`binary`});if(r.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw TypeError(`"options.publicKey" must have a byte length of `+l.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new c(l.constants.SIGN_BYTE_LENGTH+t.length),a=new c(l.constants.SIGN_BYTE_LENGTH+t.length),o;for(o=0;o<l.constants.SIGN_BYTE_LENGTH;++o)i[o]=n[o];for(o=0;o<t.length;++o)i[o+l.constants.SIGN_BYTE_LENGTH]=t[o];return S(a,i,i.length,r)>=0};function u(e){var t=e.message;if(t instanceof Uint8Array||t instanceof c)return t;var n=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),n=`binary`;else throw TypeError(`"options.message" or "options.md" not specified.`);if(typeof t==`string`&&!n)throw TypeError(`"options.encoding" must be "binary" or "utf8".`);if(typeof t==`string`){if(typeof Buffer<`u`)return Buffer.from(t,n);t=new s(t,n)}else if(!(t instanceof s))throw TypeError(`"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.`);for(var r=new c(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}var d=H(),f=H([1]),p=H([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),m=H([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h=H([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),g=H([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),v=H([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(e,t){var r=n.md.sha512.create(),i=new s(e);r.update(i.getBytes(t),`binary`);var a=r.digest().getBytes();if(typeof Buffer<`u`)return Buffer.from(a,`binary`);for(var o=new c(l.constants.HASH_BYTE_LENGTH),u=0;u<64;++u)o[u]=a.charCodeAt(u);return o}function b(e,t){var n=[H(),H(),H(),H()],r,i=y(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,L(n,i),O(e,n),r=0;r<32;++r)t[r+32]=e[r];return 0}function x(e,t,n,r){var i,a,o=new Float64Array(64),s=[H(),H(),H(),H()],c=y(r,32);c[0]&=248,c[31]&=127,c[31]|=64;var l=n+64;for(i=0;i<n;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=y(e.subarray(32),n+32);for(T(u),L(s,u),O(e,s),i=32;i<64;++i)e[i]=r[i];var d=y(e,n+64);for(T(d),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=u[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=d[i]*c[a];return w(e.subarray(32),o),l}function S(e,t,n,r){var i,a,o=new c(32),s=[H(),H(),H(),H()],l=[H(),H(),H(),H()];if(a=-1,n<64||A(l,r)||!C(t,32))return-1;for(i=0;i<n;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var u=y(e,n);if(T(u),I(s,l,u),L(l,t.subarray(32)),E(s,l),O(o,s),n-=64,P(t,0,o,0)){for(i=0;i<n;++i)e[i]=0;return-1}for(i=0;i<n;++i)e[i]=t[i+64];return a=n,a}function C(e,t){var n;for(n=31;n>=0;--n){if(e[t+n]<_[n])return!0;if(e[t+n]>_[n])return!1}return!1}function w(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*_[i-(r-32)],n=t[i]+128>>8,t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;++i)t[i]+=n-(t[31]>>4)*_[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=n*_[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function T(e){for(var t=new Float64Array(64),n=0;n<64;++n)t[n]=e[n],e[n]=0;w(e,t)}function E(e,t){var n=H(),r=H(),i=H(),a=H(),o=H(),s=H(),c=H(),l=H(),u=H();W(n,e[1],e[0]),W(u,t[1],t[0]),K(n,n,u),U(r,e[0],e[1]),U(u,t[0],t[1]),K(r,r,u),K(i,e[3],t[3]),K(i,i,m),K(a,e[2],t[2]),U(a,a,a),W(o,r,n),W(s,a,i),U(c,a,i),U(l,r,n),K(e[0],o,s),K(e[1],l,c),K(e[2],c,s),K(e[3],o,l)}function D(e,t,n){for(var r=0;r<4;++r)V(e[r],t[r],n)}function O(e,t){var n=H(),r=H(),i=H();z(i,t[2]),K(n,t[0],i),K(r,t[1],i),k(e,r),e[31]^=F(n)<<7}function k(e,t){var n,r,i,a=H(),o=H();for(n=0;n<16;++n)o[n]=t[n];for(B(o),B(o),B(o),r=0;r<2;++r){for(a[0]=o[0]-65517,n=1;n<15;++n)a[n]=o[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,V(o,a,1-i)}for(n=0;n<16;n++)e[2*n]=o[n]&255,e[2*n+1]=o[n]>>8}function A(e,t){var n=H(),r=H(),i=H(),a=H(),o=H(),s=H(),c=H();return R(e[2],f),j(e[1],t),G(i,e[1]),K(a,i,p),W(i,i,e[2]),U(a,e[2],a),G(o,a),G(s,o),K(c,s,o),K(n,c,i),K(n,n,a),M(n,n),K(n,n,i),K(n,n,a),K(n,n,a),K(e[0],n,a),G(r,e[0]),K(r,r,a),N(r,i)&&K(e[0],e[0],v),G(r,e[0]),K(r,r,a),N(r,i)?-1:(F(e[0])===t[31]>>7&&W(e[0],d,e[0]),K(e[3],e[0],e[1]),0)}function j(e,t){var n;for(n=0;n<16;++n)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function M(e,t){var n=H(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)G(n,n),r!==1&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function N(e,t){var n=new c(32),r=new c(32);return k(n,e),k(r,t),P(n,0,r,0)}function P(e,t,n,r){return ee(e,t,n,r,32)}function ee(e,t,n,r,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function F(e){var t=new c(32);return k(t,e),t[0]&1}function I(e,t,n){var r,i;for(R(e[0],d),R(e[1],f),R(e[2],f),R(e[3],d),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,D(e,t,r),E(t,e),E(e,e),D(e,t,r)}function L(e,t){var n=[H(),H(),H(),H()];R(n[0],h),R(n[1],g),R(n[2],f),K(n[3],h,g),I(e,n,t)}function R(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function z(e,t){var n=H(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)G(n,n),r!==2&&r!==4&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function B(e){var t,n,r=1;for(t=0;t<16;++t)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function V(e,t,n){for(var r,i=~(n-1),a=0;a<16;++a)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function H(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;++t)n[t]=e[t];return n}function U(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]+n[r]}function W(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]-n[r]}function G(e,t){K(e,t,t)}function K(e,t,n){var r,i,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,ee=0,F=n[0],I=n[1],L=n[2],R=n[3],z=n[4],B=n[5],V=n[6],H=n[7],U=n[8],W=n[9],G=n[10],K=n[11],q=n[12],J=n[13],Y=n[14],X=n[15];r=t[0],a+=r*F,o+=r*I,s+=r*L,c+=r*R,l+=r*z,u+=r*B,d+=r*V,f+=r*H,p+=r*U,m+=r*W,h+=r*G,g+=r*K,_+=r*q,v+=r*J,y+=r*Y,b+=r*X,r=t[1],o+=r*F,s+=r*I,c+=r*L,l+=r*R,u+=r*z,d+=r*B,f+=r*V,p+=r*H,m+=r*U,h+=r*W,g+=r*G,_+=r*K,v+=r*q,y+=r*J,b+=r*Y,x+=r*X,r=t[2],s+=r*F,c+=r*I,l+=r*L,u+=r*R,d+=r*z,f+=r*B,p+=r*V,m+=r*H,h+=r*U,g+=r*W,_+=r*G,v+=r*K,y+=r*q,b+=r*J,x+=r*Y,S+=r*X,r=t[3],c+=r*F,l+=r*I,u+=r*L,d+=r*R,f+=r*z,p+=r*B,m+=r*V,h+=r*H,g+=r*U,_+=r*W,v+=r*G,y+=r*K,b+=r*q,x+=r*J,S+=r*Y,C+=r*X,r=t[4],l+=r*F,u+=r*I,d+=r*L,f+=r*R,p+=r*z,m+=r*B,h+=r*V,g+=r*H,_+=r*U,v+=r*W,y+=r*G,b+=r*K,x+=r*q,S+=r*J,C+=r*Y,w+=r*X,r=t[5],u+=r*F,d+=r*I,f+=r*L,p+=r*R,m+=r*z,h+=r*B,g+=r*V,_+=r*H,v+=r*U,y+=r*W,b+=r*G,x+=r*K,S+=r*q,C+=r*J,w+=r*Y,T+=r*X,r=t[6],d+=r*F,f+=r*I,p+=r*L,m+=r*R,h+=r*z,g+=r*B,_+=r*V,v+=r*H,y+=r*U,b+=r*W,x+=r*G,S+=r*K,C+=r*q,w+=r*J,T+=r*Y,E+=r*X,r=t[7],f+=r*F,p+=r*I,m+=r*L,h+=r*R,g+=r*z,_+=r*B,v+=r*V,y+=r*H,b+=r*U,x+=r*W,S+=r*G,C+=r*K,w+=r*q,T+=r*J,E+=r*Y,D+=r*X,r=t[8],p+=r*F,m+=r*I,h+=r*L,g+=r*R,_+=r*z,v+=r*B,y+=r*V,b+=r*H,x+=r*U,S+=r*W,C+=r*G,w+=r*K,T+=r*q,E+=r*J,D+=r*Y,O+=r*X,r=t[9],m+=r*F,h+=r*I,g+=r*L,_+=r*R,v+=r*z,y+=r*B,b+=r*V,x+=r*H,S+=r*U,C+=r*W,w+=r*G,T+=r*K,E+=r*q,D+=r*J,O+=r*Y,k+=r*X,r=t[10],h+=r*F,g+=r*I,_+=r*L,v+=r*R,y+=r*z,b+=r*B,x+=r*V,S+=r*H,C+=r*U,w+=r*W,T+=r*G,E+=r*K,D+=r*q,O+=r*J,k+=r*Y,A+=r*X,r=t[11],g+=r*F,_+=r*I,v+=r*L,y+=r*R,b+=r*z,x+=r*B,S+=r*V,C+=r*H,w+=r*U,T+=r*W,E+=r*G,D+=r*K,O+=r*q,k+=r*J,A+=r*Y,j+=r*X,r=t[12],_+=r*F,v+=r*I,y+=r*L,b+=r*R,x+=r*z,S+=r*B,C+=r*V,w+=r*H,T+=r*U,E+=r*W,D+=r*G,O+=r*K,k+=r*q,A+=r*J,j+=r*Y,M+=r*X,r=t[13],v+=r*F,y+=r*I,b+=r*L,x+=r*R,S+=r*z,C+=r*B,w+=r*V,T+=r*H,E+=r*U,D+=r*W,O+=r*G,k+=r*K,A+=r*q,j+=r*J,M+=r*Y,N+=r*X,r=t[14],y+=r*F,b+=r*I,x+=r*L,S+=r*R,C+=r*z,w+=r*B,T+=r*V,E+=r*H,D+=r*U,O+=r*W,k+=r*G,A+=r*K,j+=r*q,M+=r*J,N+=r*Y,P+=r*X,r=t[15],b+=r*F,x+=r*I,S+=r*L,C+=r*R,w+=r*z,T+=r*B,E+=r*V,D+=r*H,O+=r*U,k+=r*W,A+=r*G,j+=r*K,M+=r*q,N+=r*J,P+=r*Y,ee+=r*X,a+=38*x,o+=38*S,s+=38*C,c+=38*w,l+=38*T,u+=38*E,d+=38*D,f+=38*O,p+=38*k,m+=38*A,h+=38*j,g+=38*M,_+=38*N,v+=38*P,y+=38*ee,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=_+i+65535,i=Math.floor(r/65536),_=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=y+i+65535,i=Math.floor(r/65536),y=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=p,e[9]=m,e[10]=h,e[11]=g,e[12]=_,e[13]=v,e[14]=y,e[15]=b}})),Ue=r(((e,t)=>{var n=Z();Q(),Ce(),Te(),t.exports=n.kem=n.kem||{};var r=n.jsbn.BigInteger;n.kem.rsa={},n.kem.rsa.create=function(e,t){t=t||{};var i=t.prng||n.random,a={};return a.encrypt=function(t,a){var o=Math.ceil(t.n.bitLength()/8),s;do s=new r(n.util.bytesToHex(i.getBytesSync(o)),16).mod(t.n);while(s.compareTo(r.ONE)<=0);s=n.util.hexToBytes(s.toString(16));var c=o-s.length;return c>0&&(s=n.util.fillString(`\0`,c)+s),{encapsulation:t.encrypt(s,`NONE`),key:e.generate(s,a)}},a.decrypt=function(t,n,r){var i=t.decrypt(n,`NONE`);return e.generate(i,r)},a},n.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)};function i(e,t,r,i){e.generate=function(e,a){for(var o=new n.util.ByteBuffer,s=Math.ceil(a/i)+r,c=new n.util.ByteBuffer,l=r;l<s;++l){c.putInt32(l),t.start(),t.update(e+c.getBytes());var u=t.digest();o.putBytes(u.getBytes(i))}return o.truncate(o.length()-a),o.getBytes()}}})),We=r(((e,t)=>{var n=Z();Q(),t.exports=n.log=n.log||{},n.log.levels=[`none`,`error`,`warning`,`info`,`debug`,`verbose`,`max`];var r={},i=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o<n.log.levels.length;++o){var s=n.log.levels[o];r[s]={index:o,name:s.toUpperCase()}}n.log.logMessage=function(e){for(var t=r[e.level].index,a=0;a<i.length;++a){var o=i[a];o.flags&n.log.NO_LEVEL_CHECK?o.f(e):t<=r[o.level].index&&o.f(o,e)}},n.log.prepareStandard=function(e){`standard`in e||(e.standard=r[e.level].name+` [`+e.category+`] `+e.message)},n.log.prepareFull=function(e){if(!(`full`in e)){var t=[e.message];t=t.concat([]),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){`standardFull`in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};for(var c=[`error`,`warning`,`info`,`debug`,`verbose`],o=0;o<c.length;++o)(function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(a)}})(c[o]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,`none`),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED)){for(var i=0;i<n.log.levels.length;++i)if(t==n.log.levels[i]){e.level=t,r=!0;break}}return r},n.log.lock=function(e,t){t===void 0||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){i.push(e)},typeof console<`u`&&`log`in console){var l;if(console.error&&console.warn&&console.info&&console.debug){var u={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},d=function(e,t){n.log.prepareStandard(t);var r=u[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};l=n.log.makeLogger(d)}else{var d=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)};l=n.log.makeLogger(d)}n.log.setLevel(l,`debug`),n.log.addLogger(l),a=l}else console={log:function(){}};if(a!==null&&typeof window<`u`&&window.location){var f=new URL(window.location.href).searchParams;f.has(`console.level`)&&n.log.setLevel(a,f.get(`console.level`).slice(-1)[0]),f.has(`console.lock`)&&f.get(`console.lock`).slice(-1)[0]==`true`&&n.log.lock(a)}n.log.consoleLogger=a})),Ge=r(((e,t)=>{t.exports=he(),_e(),Ee(),xe(),Be()})),Ke=r(((e,t)=>{var n=Z();fe(),me(),ye(),pe(),ve(),je(),Ce(),Q(),Fe();var r=n.asn1,i=t.exports=n.pkcs7=n.pkcs7||{};i.messageFromPem=function(e){var t=n.pem.decode(e)[0];if(t.type!==`PKCS7`){var a=Error(`Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".`);throw a.headerType=t.type,a}if(t.procType&&t.procType.type===`ENCRYPTED`)throw Error(`Could not convert PKCS#7 message from PEM; PEM is encrypted.`);var o=r.fromDer(t.body);return i.messageFromAsn1(o)},i.messageToPem=function(e,t){var i={type:`PKCS7`,body:r.toDer(e.toAsn1()).getBytes()};return n.pem.encode(i,{maxline:t})},i.messageFromAsn1=function(e){var t={},a=[];if(!r.validate(e,i.asn1.contentInfoValidator,t,a)){var o=Error(`Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.`);throw o.errors=a,o}var s=r.derToOid(t.contentType),c;switch(s){case n.pki.oids.envelopedData:c=i.createEnvelopedData();break;case n.pki.oids.encryptedData:c=i.createEncryptedData();break;case n.pki.oids.signedData:c=i.createSignedData();break;default:throw Error(`Cannot read PKCS#7 message. ContentType with OID `+s+` is not (yet) supported.`)}return c.fromAsn1(t.content.value[0]),c},i.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(p(e,t,i.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,a=0;a<r.length;++a)e.certificates.push(n.pki.certificateFromAsn1(r[a]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],i=0;i<e.certificates.length;++i)t.push(n.pki.certificateToAsn1(e.certificates[i]));var a=[],o=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&o.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(r.create(r.Class.UNIVERSAL,r.Type.SET,!0,e.signerInfos)),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;typeof a==`string`&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw Error(`Could not add PKCS#7 signer; no private key specified.`);typeof o==`string`&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw Error(`Could not add PKCS#7 signer; unknown message digest algorithm: `+s)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var l=!1,u=!1,d=0;d<c.length;++d){var f=c[d];if(!l&&f.type===n.pki.oids.contentType){if(l=!0,u)break;continue}if(!u&&f.type===n.pki.oids.messageDigest){if(u=!0,l)break;continue}}if(!l||!u)throw Error(`Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.`)}e.signers.push({key:o,version:1,issuer:r,serialNumber:i,digestAlgorithm:s,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(i){if(i=i||{},(typeof e.content!=`object`||e.contentInfo===null)&&(e.contentInfo=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(n.pki.oids.data).getBytes())]),`content`in e)){var o;e.content instanceof n.util.ByteBuffer?o=e.content.bytes():typeof e.content==`string`&&(o=n.util.encodeUtf8(e.content)),i.detached?e.detachedContent=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,o):e.contentInfo.value.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,o)]))}e.signers.length!==0&&a(t())},verify:function(){throw Error(`PKCS#7 signature verification not yet implemented.`)},addCertificate:function(t){typeof t==`string`&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw Error(`PKCS#7 CRL support not yet implemented.`)}},e;function t(){for(var t={},i=0;i<e.signers.length;++i){var a=e.signers[i],o=a.digestAlgorithm;o in t||(t[o]=n.md[n.pki.oids[o]].create()),a.authenticatedAttributes.length===0?a.md=t[o]:a.md=n.md[n.pki.oids[o]].create()}for(var o in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(o).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)]));return t}function a(t){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw Error(`Could not sign PKCS#7 message; there is no content to sign.`);var a=r.derToOid(e.contentInfo.value[0].value),o=r.toDer(i);for(var s in o.getByte(),r.getBerValueLength(o),o=o.getBytes(),t)t[s].start().update(o);for(var c=new Date,l=0;l<e.signers.length;++l){var f=e.signers[l];if(f.authenticatedAttributes.length===0){if(a!==n.pki.oids.data)throw Error(`Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.`)}else{f.authenticatedAttributesAsn1=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[]),m=0;m<f.authenticatedAttributes.length;++m){var h=f.authenticatedAttributes[m];h.type===n.pki.oids.messageDigest?h.value=t[f.digestAlgorithm].digest():h.type===n.pki.oids.signingTime&&(h.value||(h.value=c)),p.value.push(d(h)),f.authenticatedAttributesAsn1.value.push(d(h))}o=r.toDer(p).getBytes(),f.md.start().update(o)}f.signature=f.key.sign(f.md,`RSASSA-PKCS1-V1_5`)}e.signerInfos=u(e.signers)}},i.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids[`aes256-CBC`]},fromAsn1:function(t){p(e,t,i.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),m(e)}},e},i.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids[`aes256-CBC`]},fromAsn1:function(t){var n=p(e,t,i.asn1.envelopedDataValidator);e.recipients=s(n.recipientInfos.value)},toAsn1:function(){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.type).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,c(e.recipients)),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,f(e.encryptedContent))])])])},findRecipient:function(t){for(var n=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===n.length){for(var o=!0,s=0;s<n.length;++s)if(a[s].type!==n[s].type||a[s].value!==n[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(e.encryptedContent.key===void 0&&t!==void 0&&r!==void 0)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw Error(`Unsupported asymmetric cipher, OID `+t.encryptedContent.algorithm)}m(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(e.encryptedContent.content===void 0){r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var i,a,o;switch(r){case n.pki.oids[`aes128-CBC`]:i=16,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids[`aes192-CBC`]:i=24,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids[`aes256-CBC`]:i=32,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids[`des-EDE3-CBC`]:i=24,a=8,o=n.des.createEncryptionCipher;break;default:throw Error(`Unsupported symmetric cipher, OID `+r)}if(t===void 0)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw Error(`Symmetric key has wrong length; got `+t.length()+` bytes, expected `+i+`.`);e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(a));var s=o(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw Error(`Symmetric encryption failed.`);e.encryptedContent.content=s.output}for(var c=0;c<e.recipients.length;++c){var l=e.recipients[c];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw Error(`Unsupported asymmetric cipher, OID `+l.encryptedContent.algorithm)}}}},e};function a(e){var t={},a=[];if(!r.validate(e,i.asn1.recipientInfoValidator,t,a)){var o=Error(`Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.`);throw o.errors=a,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:r.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function o(e){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.encryptedContent.algorithm).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function s(e){for(var t=[],n=0;n<e.length;++n)t.push(a(e[n]));return t}function c(e){for(var t=[],n=0;n<e.length;++n)t.push(o(e[n]));return t}function l(e){var t=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(e.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.digestAlgorithm).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.signatureAlgorithm).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,``)])),t.value.push(r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var i=r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var o=e.unauthenticatedAttributes[a];i.values.push(d(o))}t.value.push(i)}return t}function u(e){for(var t=[],n=0;n<e.length;++n)t.push(l(e[n]));return t}function d(e){var t;if(e.type===n.pki.oids.contentType)t=r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var i=new Date(`1950-01-01T00:00:00Z`),a=new Date(`2050-01-01T00:00:00Z`),o=e.value;if(typeof o==`string`){var s=Date.parse(o);o=isNaN(s)?o.length===13?r.utcTimeToDate(o):r.generalizedTimeToDate(o):new Date(s)}t=o>=i&&o<a?r.create(r.Class.UNIVERSAL,r.Type.UTCTIME,!1,r.dateToUtcTime(o)):r.create(r.Class.UNIVERSAL,r.Type.GENERALIZEDTIME,!1,r.dateToGeneralizedTime(o))}return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.type).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[t])])}function f(e){return[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(n.pki.oids.data).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(e.algorithm).getBytes()),e.parameter?r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,e.content.getBytes())])]}function p(e,t,i){var a={};if(!r.validate(t,i,a,[])){var o=Error(`Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.`);throw o.errors=o,o}if(r.derToOid(a.contentType)!==n.pki.oids.data)throw Error(`Unsupported PKCS#7 message. Only wrapped ContentType Data supported.`);if(a.encryptedContent){var s=``;if(n.util.isArray(a.encryptedContent))for(var c=0;c<a.encryptedContent.length;++c){if(a.encryptedContent[c].type!==r.Type.OCTETSTRING)throw Error(`Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.`);s+=a.encryptedContent[c].value}else s=a.encryptedContent;e.encryptedContent={algorithm:r.derToOid(a.encAlgorithm),parameter:n.util.createBuffer(a.encParameter.value),content:n.util.createBuffer(s)}}if(a.content){var s=``;if(n.util.isArray(a.content))for(var c=0;c<a.content.length;++c){if(a.content[c].type!==r.Type.OCTETSTRING)throw Error(`Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.`);s+=a.content[c].value}else s=a.content;e.content=n.util.createBuffer(s)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function m(e){if(e.encryptedContent.key===void 0)throw Error(`Symmetric key not available.`);if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case n.pki.oids[`aes128-CBC`]:case n.pki.oids[`aes192-CBC`]:case n.pki.oids[`aes256-CBC`]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids[`des-EDE3-CBC`]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw Error(`Unsupported symmetric cipher, OID `+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw Error(`Symmetric decryption failed.`);e.content=t.output}}})),qe=r(((e,t)=>{var n=Z();fe(),ge(),_e(),Ee(),Q();var r=t.exports=n.ssh=n.ssh||{};r.privateKeyToPutty=function(e,t,r){r=r||``,t=t||``;var s=`ssh-rsa`,c=t===``?`none`:`aes256-cbc`,l=`PuTTY-User-Key-File-2: `+s+`\r
|
|
22
|
+
`;l+=`Encryption: `+c+`\r
|
|
23
|
+
`,l+=`Comment: `+r+`\r
|
|
24
|
+
`;var u=n.util.createBuffer();a(u,s),i(u,e.e),i(u,e.n);var d=n.util.encode64(u.bytes(),64),f=Math.floor(d.length/66)+1;l+=`Public-Lines: `+f+`\r
|
|
25
|
+
`,l+=d;var p=n.util.createBuffer();i(p,e.d),i(p,e.p),i(p,e.q),i(p,e.qInv);var m;if(!t)m=n.util.encode64(p.bytes(),64);else{var h=p.length()+16-1;h-=h%16;var g=o(p.bytes());g.truncate(g.length()-h+p.length()),p.putBuffer(g);var _=n.util.createBuffer();_.putBuffer(o(`\0\0\0\0`,t)),_.putBuffer(o(`\0\0\0`,t));var v=n.aes.createEncryptionCipher(_.truncate(8),`CBC`);v.start(n.util.createBuffer().fillWithByte(0,16)),v.update(p.copy()),v.finish();var y=v.output;y.truncate(16),m=n.util.encode64(y.bytes(),64)}f=Math.floor(m.length/66)+1,l+=`\r
|
|
26
|
+
Private-Lines: `+f+`\r
|
|
27
|
+
`,l+=m;var b=o(`putty-private-key-file-mac-key`,t),x=n.util.createBuffer();a(x,s),a(x,c),a(x,r),x.putInt32(u.length()),x.putBuffer(u),x.putInt32(p.length()),x.putBuffer(p);var S=n.hmac.create();return S.start(`sha1`,b),S.update(x.bytes()),l+=`\r
|
|
28
|
+
Private-MAC: `+S.digest().toHex()+`\r
|
|
29
|
+
`,l},r.publicKeyToOpenSSH=function(e,t){var r=`ssh-rsa`;t=t||``;var o=n.util.createBuffer();return a(o,r),i(o,e.e),i(o,e.n),r+` `+n.util.encode64(o.bytes())+` `+t},r.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:`aes128`}):n.pki.privateKeyToPem(e)},r.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||n.md.md5.create(),o=`ssh-rsa`,s=n.util.createBuffer();a(s,o),i(s,e.e),i(s,e.n),r.start(),r.update(s.getBytes());var c=r.digest();if(t.encoding===`hex`){var l=c.toHex();return t.delimiter?l.match(/.{2}/g).join(t.delimiter):l}else if(t.encoding===`binary`)return c.getBytes();else if(t.encoding)throw Error(`Unknown encoding "`+t.encoding+`".`);return c};function i(e,t){var r=t.toString(16);r[0]>=`8`&&(r=`00`+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function a(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}})),Je=r(((e,t)=>{t.exports=Z(),fe(),ze(),me(),ue(),ye(),He(),ge(),Ue(),We(),Ge(),Me(),be(),ve(),De(),Ie(),Ke(),Le(),Oe(),Se(),Pe(),Ce(),we(),qe(),Re(),Q()})),Ye=t((()=>{Je(),y(b)})),Xe=t((()=>{Ye()})),Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,$=t((()=>{h(),Ze=g({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),Qe=g({name:o(),email:o().email().optional(),url:o().url().optional()}),$e=g({type:o(),url:o().url()}),et=Ze.partial(),tt=Ze.extend({platform_overrides:l(o(),et).optional()}),nt=g({type:i([`python`,`node`,`binary`]),entry_point:o(),mcp_config:tt}),rt=g({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:g({python:o().optional(),node:o().optional()}).optional()}),it=g({name:o(),description:o().optional()}),at=g({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),ot=g({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),st=g({$schema:o().optional(),dxt_version:d(`0.1`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.1`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:Qe,repository:$e.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),screenshots:p(o()).optional(),server:nt,tools:p(it).optional(),tools_generated:c().optional(),prompts:p(at).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),compatibility:rt.optional(),user_config:l(o(),ot).optional()}).refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt=t((()=>{h(),ct=g({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),lt=g({name:o(),email:o().email().optional(),url:o().url().optional()}),ut=g({type:o(),url:o().url()}),dt=ct.partial(),ft=ct.extend({platform_overrides:l(o(),dt).optional()}),pt=g({type:i([`python`,`node`,`binary`]),entry_point:o(),mcp_config:ft}),mt=g({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:g({python:o().optional(),node:o().optional()}).optional()}),ht=g({name:o(),description:o().optional()}),gt=g({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),_t=g({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),vt=g({$schema:o().optional(),dxt_version:d(`0.2`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.2`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:lt,repository:ut.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),screenshots:p(o()).optional(),server:pt,tools:p(ht).optional(),tools_generated:c().optional(),prompts:p(gt).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),privacy_policies:p(o().url()).optional(),compatibility:mt.optional(),user_config:l(o(),_t).optional()}).refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It=t((()=>{h(),bt=/\$\{locale\}/i,xt=/^[A-Za-z0-9]{2,8}(?:-[A-Za-z0-9]{1,8})*$/,St=/^\d+x\d+$/,Ct=g({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),wt=g({name:o(),email:o().email().optional(),url:o().url().optional()}),Tt=g({type:o(),url:o().url()}),Et=Ct.partial(),Dt=Ct.extend({platform_overrides:l(o(),Et).optional()}),Ot=g({type:i([`python`,`node`,`binary`]),entry_point:o(),mcp_config:Dt}),kt=g({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:g({python:o().optional(),node:o().optional()}).optional()}),At=g({name:o(),description:o().optional()}),jt=g({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),Mt=g({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),Nt=g({resources:o().regex(bt,'resources must include a "${locale}" placeholder'),default_locale:o().regex(xt,`default_locale must be a valid BCP 47 locale identifier`)}),Pt=g({src:o(),size:o().regex(St,`size must be in the format "WIDTHxHEIGHT" (e.g., "16x16")`),theme:o().min(1,`theme cannot be empty when provided`).optional()}),Ft=g({$schema:o().optional(),dxt_version:d(`0.3`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.3`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:wt,repository:Tt.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),icons:p(Pt).optional(),screenshots:p(o()).optional(),localization:Nt.optional(),server:Ot,tools:p(At).optional(),tools_generated:c().optional(),prompts:p(jt).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),privacy_policies:p(o().url()).optional(),compatibility:kt.optional(),user_config:l(o(),Mt).optional(),_meta:l(o(),l(o(),u())).optional()}).refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t=t((()=>{h(),Lt=/\$\{locale\}/i,Rt=/^[A-Za-z0-9]{2,8}(?:-[A-Za-z0-9]{1,8})*$/,zt=/^\d+x\d+$/,Bt=g({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),Vt=g({name:o(),email:o().email().optional(),url:o().url().optional()}),Ht=g({type:o(),url:o().url()}),Ut=Bt.partial(),Wt=Bt.extend({platform_overrides:l(o(),Ut).optional()}),Gt=g({type:i([`python`,`node`,`binary`,`uv`]),entry_point:o(),mcp_config:Wt}),Kt=g({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:g({python:o().optional(),node:o().optional()}).optional()}),qt=g({name:o(),description:o().optional()}),Jt=g({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),Yt=g({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),Xt=g({resources:o().regex(Lt,'resources must include a "${locale}" placeholder'),default_locale:o().regex(Rt,`default_locale must be a valid BCP 47 locale identifier`)}),Zt=g({src:o(),size:o().regex(zt,`size must be in the format "WIDTHxHEIGHT" (e.g., "16x16")`),theme:o().min(1,`theme cannot be empty when provided`).optional()}),Qt=g({$schema:o().optional(),dxt_version:d(`0.4`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.4`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:Vt,repository:Ht.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),icons:p(Zt).optional(),screenshots:p(o()).optional(),localization:Xt.optional(),server:Gt,tools:p(qt).optional(),tools_generated:c().optional(),prompts:p(Jt).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),privacy_policies:p(o().url()).optional(),compatibility:Kt.optional(),user_config:l(o(),Yt).optional(),_meta:l(o(),l(o(),u())).optional()}).refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),en,tn,nn,rn,an,on,sn,cn,ln,un,dn=t((()=>{h(),en=a({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),tn=a({name:o(),email:o().email().optional(),url:o().url().optional()}),nn=a({type:o(),url:o().url()}),rn=en.partial(),an=en.extend({platform_overrides:l(o(),rn).optional()}),on=a({type:i([`python`,`node`,`binary`]),entry_point:o(),mcp_config:an}),sn=a({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:a({python:o().optional(),node:o().optional()}).optional()}).passthrough(),cn=a({name:o(),description:o().optional()}),ln=a({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),un=a({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),a({$schema:o().optional(),dxt_version:d(`0.1`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.1`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:tn,repository:nn.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),screenshots:p(o()).optional(),server:on,tools:p(cn).optional(),tools_generated:c().optional(),prompts:p(ln).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),compatibility:sn.optional(),user_config:l(o(),un).optional()}).refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn=t((()=>{h(),fn=a({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),pn=a({name:o(),email:o().email().optional(),url:o().url().optional()}),mn=a({type:o(),url:o().url()}),hn=fn.partial(),gn=fn.extend({platform_overrides:l(o(),hn).optional()}),_n=a({type:i([`python`,`node`,`binary`]),entry_point:o(),mcp_config:gn}),vn=a({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:a({python:o().optional(),node:o().optional()}).optional()}).passthrough(),yn=a({name:o(),description:o().optional()}),bn=a({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),xn=a({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),a({$schema:o().optional(),dxt_version:d(`0.2`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.2`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:pn,repository:mn.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),screenshots:p(o()).optional(),server:_n,tools:p(yn).optional(),tools_generated:c().optional(),prompts:p(bn).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),privacy_policies:p(o().url()).optional(),compatibility:vn.optional(),user_config:l(o(),xn).optional()}).passthrough().refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn=t((()=>{h(),Cn=/\$\{locale\}/i,wn=/^[A-Za-z0-9]{2,8}(?:-[A-Za-z0-9]{1,8})*$/,Tn=/^\d+x\d+$/,En=a({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),Dn=a({name:o(),email:o().email().optional(),url:o().url().optional()}),On=a({type:o(),url:o().url()}),kn=En.partial(),An=En.extend({platform_overrides:l(o(),kn).optional()}),jn=a({type:i([`python`,`node`,`binary`]),entry_point:o(),mcp_config:An}),Mn=a({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:a({python:o().optional(),node:o().optional()}).optional()}).passthrough(),Nn=a({name:o(),description:o().optional()}),Pn=a({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),Fn=a({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),In=a({resources:o().regex(Cn,'resources must include a "${locale}" placeholder'),default_locale:o().regex(wn,`default_locale must be a valid BCP 47 locale identifier`)}).passthrough(),Ln=a({src:o(),size:o().regex(Tn,`size must be in the format "WIDTHxHEIGHT" (e.g., "16x16")`),theme:o().min(1).optional()}).passthrough(),a({$schema:o().optional(),dxt_version:d(`0.3`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.3`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:Dn,repository:On.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),icons:p(Ln).optional(),screenshots:p(o()).optional(),localization:In.optional(),server:jn,tools:p(Nn).optional(),tools_generated:c().optional(),prompts:p(Pn).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),privacy_policies:p(o().url()).optional(),compatibility:Mn.optional(),user_config:l(o(),Fn).optional(),_meta:l(o(),l(o(),u())).optional()}).passthrough().refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er=t((()=>{h(),zn=/\$\{locale\}/i,Bn=/^[A-Za-z0-9]{2,8}(?:-[A-Za-z0-9]{1,8})*$/,Vn=/^\d+x\d+$/,Hn=a({command:o(),args:p(o()).optional(),env:l(o(),o()).optional()}),Un=a({name:o(),email:o().email().optional(),url:o().url().optional()}),Wn=a({type:o(),url:o().url()}),Gn=Hn.partial(),Kn=Hn.extend({platform_overrides:l(o(),Gn).optional()}),qn=a({type:i([`python`,`node`,`binary`,`uv`]),entry_point:o(),mcp_config:Kn.optional()}),Jn=a({claude_desktop:o().optional(),platforms:p(i([`darwin`,`win32`,`linux`])).optional(),runtimes:a({python:o().optional(),node:o().optional()}).optional()}).passthrough(),Yn=a({name:o(),description:o().optional()}),Xn=a({name:o(),description:o().optional(),arguments:p(o()).optional(),text:o()}),Zn=a({type:i([`string`,`number`,`boolean`,`directory`,`file`]),title:o(),description:o(),required:c().optional(),default:s([o(),m(),c(),p(o())]).optional(),multiple:c().optional(),sensitive:c().optional(),min:m().optional(),max:m().optional()}),Qn=a({resources:o().regex(zn,'resources must include a "${locale}" placeholder'),default_locale:o().regex(Bn,`default_locale must be a valid BCP 47 locale identifier`)}).passthrough(),$n=a({src:o(),size:o().regex(Vn,`size must be in the format "WIDTHxHEIGHT" (e.g., "16x16")`),theme:o().min(1).optional()}).passthrough(),a({$schema:o().optional(),dxt_version:d(`0.4`).optional().describe(`@deprecated Use manifest_version instead`),manifest_version:d(`0.4`).optional(),name:o(),display_name:o().optional(),version:o(),description:o(),long_description:o().optional(),author:Un,repository:Wn.optional(),homepage:o().url().optional(),documentation:o().url().optional(),support:o().url().optional(),icon:o().optional(),icons:p($n).optional(),screenshots:p(o()).optional(),localization:Qn.optional(),server:qn,tools:p(Yn).optional(),tools_generated:c().optional(),prompts:p(Xn).optional(),prompts_generated:c().optional(),keywords:p(o()).optional(),license:o().optional(),privacy_policies:p(o().url()).optional(),compatibility:Jn.optional(),user_config:l(o(),Zn).optional(),_meta:l(o(),l(o(),u())).optional()}).passthrough().refine(e=>!!(e.dxt_version||e.manifest_version),{message:`Either 'dxt_version' (deprecated) or 'manifest_version' must be provided`})})),tr=t((()=>{$(),yt(),It(),$t(),dn(),Sn(),Rn(),er()})),nr=t((()=>{tr()})),rr=t((()=>{se(),ce(),Xe(),tr(),nr()})),ir=t((()=>{tr()})),ar=t((()=>{x(),rr(),tr(),nr(),ir()})),or=n({McpbManifestSchema:()=>sr}),sr,cr=t((()=>{h(),$(),yt(),It(),$t(),sr=s([st,vt,Ft,Qt])})),lr=t((()=>{$(),yt(),It(),$t(),cr()})),ur=t((()=>{h(),l(o(),s([o(),m(),c(),p(o())])),g({status:i([`signed`,`unsigned`,`self-signed`]),publisher:o().optional(),issuer:o().optional(),valid_from:o().optional(),valid_to:o().optional(),fingerprint:o().optional()})}));function dr(e,t){if(typeof e==`string`){let n=e;for(let[r,i]of Object.entries(t)){let t=RegExp(`\\$\\{${r}\\}`,`g`);n.match(t)&&(Array.isArray(i)?console.warn(`Cannot replace ${r} with array value in string context: "${e}"`,{key:r,replacement:i}):n=n.replace(t,i))}return n}else if(Array.isArray(e)){let n=[];for(let r of e)if(typeof r==`string`&&r.match(/^\$\{user_config\.[^}]+\}$/)){let e=r.match(/^\$\{([^}]+)\}$/)?.[1];if(e&&t[e]){let r=t[e];Array.isArray(r)?n.push(...r):n.push(r)}else n.push(r)}else n.push(dr(r,t));return n}else if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=dr(i,t);return n}return e}async function fr(e){let{manifest:t,extensionPath:n,systemDirs:r,userConfig:i,pathSeparator:a,logger:o}=e,s=t.server?.mcp_config;if(!s)return;let c={...s};if(s.platform_overrides&&process.platform in s.platform_overrides){let e=s.platform_overrides[process.platform];c.command=e.command||c.command,c.args=e.args||c.args,c.env=e.env||c.env}if(mr({manifest:t,userConfig:i})){o?.warn(`Extension ${t.name} has missing required configuration, skipping MCP config`);return}let l={__dirname:n,pathSeparator:a,"/":a,...r},u={};if(t.user_config)for(let[e,n]of Object.entries(t.user_config))n.default!==void 0&&(u[e]=n.default);i&&Object.assign(u,i);for(let[e,t]of Object.entries(u)){let n=`user_config.${e}`;Array.isArray(t)?l[n]=t.map(String):typeof t==`boolean`?l[n]=t?`true`:`false`:l[n]=String(t)}return c=dr(c,l),c}function pr(e){return e==null||e===``}function mr({manifest:e,userConfig:t}){if(!e.user_config)return!1;let n=t||{};for(let[t,r]of Object.entries(e.user_config))if(r.required){let e=n[t];if(pr(e)||Array.isArray(e)&&(e.length===0||e.some(pr)))return!0}return!1}var hr=t((()=>{})),gr=t((()=>{}));t((()=>{ir(),ar(),Xe(),x(),Ye(),rr(),lr(),ur(),hr(),tr(),gr()}))();export{fr as getMcpConfigForManifest,or as vAny};
|